5 changed files with 398 additions and 871 deletions
-
3src/api/sales-return/sales-return.js
-
2src/views/modules/sales-return/index.vue
-
375src/views/modules/sales-return/receive.vue
-
18src/views/modules/sales-return/sales-return-inbound.vue
-
871src/views/modules/sales-return/sales-return-scrap.vue
@ -1,375 +0,0 @@ |
|||
<template> |
|||
<div class="receive-container"> |
|||
<van-nav-bar title="退货收货" left-arrow @click-left="$router.back()" /> |
|||
|
|||
<!-- 退货单信息 --> |
|||
<div class="return-info"> |
|||
<div class="info-header"> |
|||
<div class="return-no">{{ returnInfo.returnNo }}</div> |
|||
<div class="return-status">{{ getStatusText(returnInfo.status) }}</div> |
|||
</div> |
|||
<van-cell-group> |
|||
<van-cell title="原订单号" :value="returnInfo.originalOrderNo" /> |
|||
<van-cell title="客户" :value="returnInfo.customerName" /> |
|||
<van-cell title="退货原因" :value="returnInfo.returnReason" /> |
|||
<van-cell title="申请时间" :value="returnInfo.applyTime" /> |
|||
</van-cell-group> |
|||
</div> |
|||
|
|||
<!-- 退货明细 --> |
|||
<div class="goods-section"> |
|||
<div class="section-title">退货明细</div> |
|||
<div |
|||
v-for="(item, index) in goodsList" |
|||
:key="index" |
|||
class="goods-item" |
|||
> |
|||
<div class="goods-info"> |
|||
<div class="goods-name">{{ item.productCode }} - {{ item.productName }}</div> |
|||
<div class="goods-spec">规格:{{ item.specification }}</div> |
|||
<div class="goods-quantity"> |
|||
申请退货:{{ item.returnQuantity }} | 实际收货:{{ item.receivedQuantity }} |
|||
</div> |
|||
</div> |
|||
<div class="receive-input"> |
|||
<van-stepper |
|||
v-model="item.currentReceive" |
|||
:min="0" |
|||
:max="item.returnQuantity - item.receivedQuantity" |
|||
integer |
|||
/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 质量检验 --> |
|||
<div class="quality-section"> |
|||
<div class="section-title">质量检验</div> |
|||
<van-field |
|||
v-model="qualityInfo.inspector" |
|||
label="检验员" |
|||
placeholder="请输入检验员" |
|||
/> |
|||
<van-field |
|||
v-model="qualityInfo.qualityResult" |
|||
label="检验结果" |
|||
placeholder="请选择检验结果" |
|||
readonly |
|||
is-link |
|||
@click="showQualityPicker = true" |
|||
/> |
|||
<van-field |
|||
v-model="qualityInfo.qualityRemark" |
|||
label="检验备注" |
|||
type="textarea" |
|||
placeholder="请输入检验备注" |
|||
rows="3" |
|||
/> |
|||
</div> |
|||
|
|||
<!-- 处理方式 --> |
|||
<div class="handle-section"> |
|||
<div class="section-title">处理方式</div> |
|||
<van-field |
|||
v-model="handleInfo.handleMethod" |
|||
label="处理方式" |
|||
placeholder="请选择处理方式" |
|||
readonly |
|||
is-link |
|||
@click="showHandlePicker = true" |
|||
/> |
|||
<van-field |
|||
v-model="handleInfo.targetLocation" |
|||
label="目标库位" |
|||
placeholder="请选择或扫描库位" |
|||
readonly |
|||
is-link |
|||
@click="showLocationPicker = true" |
|||
> |
|||
<template #right-icon> |
|||
<van-icon name="scan" @click.stop="handleScanLocation" /> |
|||
</template> |
|||
</van-field> |
|||
</div> |
|||
|
|||
<!-- 备注 --> |
|||
<div class="remark-section"> |
|||
<van-field |
|||
v-model="remark" |
|||
label="备注" |
|||
type="textarea" |
|||
placeholder="请输入处理备注" |
|||
rows="3" |
|||
autosize |
|||
/> |
|||
</div> |
|||
|
|||
<!-- 底部按钮 --> |
|||
<div class="bottom-actions"> |
|||
<van-button |
|||
type="primary" |
|||
block |
|||
:loading="submitting" |
|||
@click="handleSubmit" |
|||
> |
|||
确认收货 |
|||
</van-button> |
|||
</div> |
|||
|
|||
<!-- 选择器 --> |
|||
<van-popup v-model="showQualityPicker" position="bottom"> |
|||
<van-picker |
|||
:columns="qualityColumns" |
|||
@confirm="onQualityConfirm" |
|||
@cancel="showQualityPicker = false" |
|||
/> |
|||
</van-popup> |
|||
|
|||
<van-popup v-model="showHandlePicker" position="bottom"> |
|||
<van-picker |
|||
:columns="handleColumns" |
|||
@confirm="onHandleConfirm" |
|||
@cancel="showHandlePicker = false" |
|||
/> |
|||
</van-popup> |
|||
|
|||
<van-popup v-model="showLocationPicker" position="bottom"> |
|||
<van-picker |
|||
:columns="locationColumns" |
|||
@confirm="onLocationConfirm" |
|||
@cancel="showLocationPicker = false" |
|||
/> |
|||
</van-popup> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'SalesReturnReceive', |
|||
data() { |
|||
return { |
|||
returnInfo: { |
|||
returnNo: 'RT202401001', |
|||
originalOrderNo: 'SO202401001', |
|||
customerName: '客户A有限公司', |
|||
returnReason: '质量问题', |
|||
applyTime: '2024-01-15 10:30', |
|||
status: 0 |
|||
}, |
|||
goodsList: [ |
|||
{ |
|||
productCode: 'PROD001', |
|||
productName: '成品A', |
|||
specification: '标准规格', |
|||
returnQuantity: 10, |
|||
receivedQuantity: 0, |
|||
currentReceive: 0 |
|||
} |
|||
], |
|||
qualityInfo: { |
|||
inspector: '', |
|||
qualityResult: '', |
|||
qualityRemark: '' |
|||
}, |
|||
handleInfo: { |
|||
handleMethod: '', |
|||
targetLocation: '' |
|||
}, |
|||
remark: '', |
|||
submitting: false, |
|||
showQualityPicker: false, |
|||
showHandlePicker: false, |
|||
showLocationPicker: false, |
|||
qualityColumns: [ |
|||
'合格-重新入库', |
|||
'不合格-报废', |
|||
'不合格-返修', |
|||
'待定-暂存' |
|||
], |
|||
handleColumns: [ |
|||
'重新入库', |
|||
'报废处理', |
|||
'返修处理', |
|||
'暂存处理' |
|||
], |
|||
locationColumns: [ |
|||
'RT01-01-01', |
|||
'RT01-01-02', |
|||
'FG01-01-01', |
|||
'FG01-01-02', |
|||
'SCRAP-01' |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.loadReturnData() |
|||
}, |
|||
methods: { |
|||
loadReturnData() { |
|||
const returnNo = this.$route.params.orderNo |
|||
console.log('加载退货单数据:', returnNo) |
|||
}, |
|||
handleScanLocation() { |
|||
this.$toast('扫描库位功能开发中...') |
|||
}, |
|||
onQualityConfirm(value) { |
|||
this.qualityInfo.qualityResult = value |
|||
this.showQualityPicker = false |
|||
}, |
|||
onHandleConfirm(value) { |
|||
this.handleInfo.handleMethod = value |
|||
this.showHandlePicker = false |
|||
}, |
|||
onLocationConfirm(value) { |
|||
this.handleInfo.targetLocation = value |
|||
this.showLocationPicker = false |
|||
}, |
|||
async handleSubmit() { |
|||
// 验证收货数量 |
|||
const hasReceive = this.goodsList.some(item => item.currentReceive > 0) |
|||
if (!hasReceive) { |
|||
this.$toast('请输入收货数量') |
|||
return |
|||
} |
|||
|
|||
// 验证质量检验 |
|||
if (!this.qualityInfo.qualityResult) { |
|||
this.$toast('请选择检验结果') |
|||
return |
|||
} |
|||
|
|||
// 验证处理方式 |
|||
if (!this.handleInfo.handleMethod) { |
|||
this.$toast('请选择处理方式') |
|||
return |
|||
} |
|||
|
|||
// 验证目标库位 |
|||
if (!this.handleInfo.targetLocation) { |
|||
this.$toast('请选择目标库位') |
|||
return |
|||
} |
|||
|
|||
this.submitting = true |
|||
|
|||
try { |
|||
await new Promise(resolve => setTimeout(resolve, 2000)) |
|||
|
|||
this.$toast.success('收货成功') |
|||
this.$router.back() |
|||
} catch (error) { |
|||
this.$toast.fail('收货失败') |
|||
} finally { |
|||
this.submitting = false |
|||
} |
|||
}, |
|||
getStatusText(status) { |
|||
const statusMap = { |
|||
0: '待收货', |
|||
1: '质检中', |
|||
2: '已完成' |
|||
} |
|||
return statusMap[status] || '未知' |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.receive-container { |
|||
min-height: 100vh; |
|||
background-color: #f7f8fa; |
|||
padding-bottom: 80px; |
|||
} |
|||
|
|||
.return-info { |
|||
background: white; |
|||
margin-bottom: 10px; |
|||
} |
|||
|
|||
.info-header { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
padding: 16px; |
|||
border-bottom: 1px solid #ebedf0; |
|||
} |
|||
|
|||
.return-no { |
|||
font-size: 18px; |
|||
font-weight: bold; |
|||
color: #323233; |
|||
} |
|||
|
|||
.return-status { |
|||
padding: 4px 8px; |
|||
border-radius: 4px; |
|||
font-size: 12px; |
|||
color: white; |
|||
background-color: #ff976a; |
|||
} |
|||
|
|||
.goods-section, |
|||
.quality-section, |
|||
.handle-section, |
|||
.remark-section { |
|||
background: white; |
|||
margin-bottom: 10px; |
|||
} |
|||
|
|||
.section-title { |
|||
padding: 16px; |
|||
font-size: 16px; |
|||
font-weight: bold; |
|||
color: #323233; |
|||
border-bottom: 1px solid #ebedf0; |
|||
} |
|||
|
|||
.goods-item { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
padding: 16px; |
|||
border-bottom: 1px solid #ebedf0; |
|||
} |
|||
|
|||
.goods-item:last-child { |
|||
border-bottom: none; |
|||
} |
|||
|
|||
.goods-info { |
|||
flex: 1; |
|||
} |
|||
|
|||
.goods-name { |
|||
font-size: 16px; |
|||
font-weight: bold; |
|||
color: #323233; |
|||
margin-bottom: 4px; |
|||
} |
|||
|
|||
.goods-spec { |
|||
font-size: 12px; |
|||
color: #969799; |
|||
margin-bottom: 4px; |
|||
} |
|||
|
|||
.goods-quantity { |
|||
font-size: 14px; |
|||
color: #646566; |
|||
} |
|||
|
|||
.receive-input { |
|||
margin-left: 16px; |
|||
} |
|||
|
|||
.bottom-actions { |
|||
position: fixed; |
|||
bottom: 0; |
|||
left: 0; |
|||
right: 0; |
|||
padding: 16px; |
|||
background: white; |
|||
border-top: 1px solid #ebedf0; |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue