|
@@ -6,16 +6,11 @@
|
|
<template slot="subTitle">
|
|
<template slot="subTitle">
|
|
<a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
|
|
<span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
|
|
- <span style="margin: 0 15px;color: #666;" v-if="ordeDetail">
|
|
|
|
- 退货仓库:<warehouse
|
|
|
|
- style="width:200px;"
|
|
|
|
- :allowClear="false"
|
|
|
|
- disabled
|
|
|
|
- v-model="ordeDetail.warehouseSn"
|
|
|
|
- @change="updateWarehouse"
|
|
|
|
- id="basicInfo-warehouseSn"
|
|
|
|
- placeholder="请选择退货仓库"
|
|
|
|
- />
|
|
|
|
|
|
+ <span style="margin: 0 10px;color: #666;">
|
|
|
|
+ 退货仓库:{{ordeDetail&&ordeDetail.warehouseName}}
|
|
|
|
+ </span>
|
|
|
|
+ <span style="margin: 0 10px;color: #666;">
|
|
|
|
+ 退货类别:{{ordeDetail&&ordeDetail.goodFlagDictValue}}
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
@@ -115,7 +110,11 @@
|
|
</template>
|
|
</template>
|
|
<!-- 退货原因 -->
|
|
<!-- 退货原因 -->
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
- <returnReason v-model="record.returnReason" @blur="updateReason(record)"></returnReason>
|
|
|
|
|
|
+ <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode" @change="e => updateReason(e, record, 0)"></returnReason>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 备注 -->
|
|
|
|
+ <template slot="returnRemarks" slot-scope="text, record">
|
|
|
|
+ <a-input size="small" placeholder="请输入备注" v-model="record.returnReasonRemarks" @blur="e => updateReason(e, record, 1)"></a-input>
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -143,13 +142,17 @@
|
|
<!-- 选择审核人员 -->
|
|
<!-- 选择审核人员 -->
|
|
<chooseDepartUserModal ref="chooseDepart" :showDefUser="true" :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
|
|
<chooseDepartUserModal ref="chooseDepart" :showDefUser="true" :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
|
|
<!-- 导入产品 -->
|
|
<!-- 导入产品 -->
|
|
- <importGuideModal :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeOk" />
|
|
|
|
|
|
+ <importGuideModal :goodFlag="goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : 0" :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeOk" />
|
|
<!-- 批量设置退货原因 -->
|
|
<!-- 批量设置退货原因 -->
|
|
<commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
|
|
<commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
|
|
- <div style="text-align: center;">
|
|
|
|
- <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
|
|
|
|
|
|
+ <div style="text-align: left;">
|
|
<div style="line-height: 24px;">
|
|
<div style="line-height: 24px;">
|
|
- <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
|
|
|
|
|
|
+ <div><span style="color:red;">*</span>退货原因</div>
|
|
|
|
+ <div><returnReason size="large" :goodFlag="goodFlag" v-model="plReturnReason"></returnReason></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="line-height: 24px;margin-top:10px;">
|
|
|
|
+ <div>备注</div>
|
|
|
|
+ <div><a-input size="large" :maxlength="50" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</commonModal>
|
|
</commonModal>
|
|
@@ -230,7 +233,7 @@ export default {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].qtyBackups = data.list[i].initialQty
|
|
data.list[i].qtyBackups = data.list[i].initialQty
|
|
- data.list[i].returnReasonBackups = data.list[i].returnReason
|
|
|
|
|
|
+ data.list[i].returnReasonBackups = data.list[i].returnReasonCode
|
|
}
|
|
}
|
|
this.disabled = false
|
|
this.disabled = false
|
|
this.chooseLoadData = data.list
|
|
this.chooseLoadData = data.list
|
|
@@ -242,29 +245,36 @@ export default {
|
|
openGuideModal: false, // 导入产品引导
|
|
openGuideModal: false, // 导入产品引导
|
|
total: 0,
|
|
total: 0,
|
|
rowSelectionInfo: null,
|
|
rowSelectionInfo: null,
|
|
- plReturnReason: '',
|
|
|
|
- showPlModal: false
|
|
|
|
|
|
+ plReturnReason: undefined,
|
|
|
|
+ plReturnRemark: '',
|
|
|
|
+ showPlModal: false,
|
|
|
|
+ returnReasonlist: [],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
showPlModal (newValue, oldValue) {
|
|
showPlModal (newValue, oldValue) {
|
|
if (!newValue) {
|
|
if (!newValue) {
|
|
- this.plReturnReason = ''
|
|
|
|
|
|
+ this.plReturnReason = undefined
|
|
|
|
+ this.plReturnRemark = ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ goodFlag() {
|
|
|
|
+ return this.ordeDetail && this.ordeDetail.goodFlag || ''
|
|
|
|
+ },
|
|
selNums () {
|
|
selNums () {
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
},
|
|
},
|
|
columns () {
|
|
columns () {
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
|
|
{ title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
|
|
- { title: '产品编码', dataIndex: 'productEntity.code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品名称', dataIndex: 'productEntity.name', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
|
|
+ { title: '产品编码', dataIndex: 'productEntity.code', width: '13%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
|
|
{ title: '单位', dataIndex: 'productEntity.unit', align: 'center', width: '6%', customRender: function (text) { return text || '--' } },
|
|
{ title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '8%', scopedSlots: { customRender: 'qty' } },
|
|
{ title: '申请退货数量', dataIndex: 'initialQty', align: 'center', width: '8%', scopedSlots: { customRender: 'qty' } },
|
|
{ title: '退货原因', dataIndex: 'returnReason', align: 'center', width: '13%', scopedSlots: { customRender: 'returnReason' } },
|
|
{ title: '退货原因', dataIndex: 'returnReason', align: 'center', width: '13%', scopedSlots: { customRender: 'returnReason' } },
|
|
|
|
+ { title: '备注', scopedSlots: { customRender: 'returnRemarks' }, width: '10%', align: 'center' },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
]
|
|
]
|
|
if (this.$hasPermissions('B_salesReturnEdit_salesPrice')) { // 售价权限
|
|
if (this.$hasPermissions('B_salesReturnEdit_salesPrice')) { // 售价权限
|
|
@@ -322,24 +332,31 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 修改退货原因
|
|
// 修改退货原因
|
|
- updateReason (row) {
|
|
|
|
- console.log(row.returnReason)
|
|
|
|
- row.returnReason = removeEmptyStr(row.returnReason)
|
|
|
|
- // 空或没有改变时不保存数据
|
|
|
|
- if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
|
|
|
|
- row.returnReason = row.returnReasonBackups
|
|
|
|
- return
|
|
|
|
|
|
+ updateReason (val, record, type) {
|
|
|
|
+ console.log(val, record, type)
|
|
|
|
+ const params = {
|
|
|
|
+ salesReturnDetailSn: record.salesReturnDetailSn,
|
|
|
|
+ goodFlag: this.goodFlag
|
|
|
|
+ }
|
|
|
|
+ // 退货原因
|
|
|
|
+ if(type == 0){
|
|
|
|
+ const rows = this.returnReasonlist.find(item => item.code == val)
|
|
|
|
+ params.returnReasonCode = val||''
|
|
|
|
+ params.returnReason = rows ? rows.dispName : ''
|
|
|
|
+ }else{
|
|
|
|
+ // 备注
|
|
|
|
+ params.returnReasonRemarks = val.target.value
|
|
|
|
+ if(!params.returnReasonRemarks){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- salesReturnDetailUpdateReason({
|
|
|
|
- salesReturnDetailSn: row.salesReturnDetailSn,
|
|
|
|
- returnReason: row.returnReason
|
|
|
|
- }).then(res => {
|
|
|
|
|
|
+ salesReturnDetailUpdateReason(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.resetTable(false)
|
|
this.resetTable(false)
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
} else {
|
|
} else {
|
|
- row.returnReason = row.returnReasonBackups
|
|
|
|
|
|
+ row.returnReasonCode = record.returnReasonBackups
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
})
|
|
})
|
|
@@ -353,18 +370,22 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
setPlReturnReason () {
|
|
setPlReturnReason () {
|
|
- if (this.plReturnReason == '') {
|
|
|
|
- this.$message.warning('请输入退货原因!')
|
|
|
|
|
|
+ if (!this.plReturnReason) {
|
|
|
|
+ this.$message.warning('请选择退货原因!')
|
|
} else {
|
|
} else {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
const snList = []
|
|
const snList = []
|
|
const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
|
|
const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
|
|
|
|
+ const rows = this.returnReasonlist.find(item => item.code == this.plReturnReason)
|
|
arr.map(item => {
|
|
arr.map(item => {
|
|
snList.push(item.salesReturnDetailSn)
|
|
snList.push(item.salesReturnDetailSn)
|
|
})
|
|
})
|
|
salesReturnDetailSetReason({
|
|
salesReturnDetailSetReason({
|
|
salesReturnBillDetailSnList: snList,
|
|
salesReturnBillDetailSnList: snList,
|
|
- returnReason: this.plReturnReason
|
|
|
|
|
|
+ salesReturnBillSn : this.$route.params.sn,
|
|
|
|
+ returnReason: rows ? rows.dispName : '',
|
|
|
|
+ returnReasonCode: this.plReturnReason,
|
|
|
|
+ returnReasonRemarks: this.plReturnRemark
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.showPlModal = false
|
|
this.showPlModal = false
|
|
@@ -379,8 +400,16 @@ export default {
|
|
getOrderDetail (flag) {
|
|
getOrderDetail (flag) {
|
|
salesReturnDetail({ sn: this.orderSn }).then(res => {
|
|
salesReturnDetail({ sn: this.orderSn }).then(res => {
|
|
this.ordeDetail = res.data || null
|
|
this.ordeDetail = res.data || null
|
|
|
|
+ if(res.data.goodFlag == 'DEFECTIVE_PRODUCT_RETURN'){
|
|
|
|
+ this.returnReasonlist = this.$store.state.app.defectiveReturnReason
|
|
|
|
+ }
|
|
|
|
+ // 良品
|
|
|
|
+ if(res.data.goodFlag == 'GOOD_PRODUCT_RETURN'){
|
|
|
|
+ this.returnReasonlist = this.$store.state.app.goodReturnReason
|
|
|
|
+ }
|
|
|
|
+ this.$refs.table.refresh(!flag)
|
|
if (!flag) {
|
|
if (!flag) {
|
|
- this.$refs.partQuery.pageInit(this.buyerSn, this.ordeDetail.warehouseSn)
|
|
|
|
|
|
+ this.$refs.partQuery.pageInit(this.buyerSn, this.ordeDetail.warehouseSn, this.goodFlag)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -414,7 +443,6 @@ export default {
|
|
resetSearchForm (flag) {
|
|
resetSearchForm (flag) {
|
|
this.productForm.productName = ''
|
|
this.productForm.productName = ''
|
|
this.productForm.productCode = ''
|
|
this.productForm.productCode = ''
|
|
- this.$refs.table.refresh(!!flag)
|
|
|
|
this.getOrderDetail(flag)
|
|
this.getOrderDetail(flag)
|
|
},
|
|
},
|
|
// 添加或修改产品
|
|
// 添加或修改产品
|
|
@@ -423,13 +451,16 @@ export default {
|
|
if (this.isInster) {
|
|
if (this.isInster) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ // 退货原因
|
|
|
|
+ const rows = this.returnReasonlist.find(item => item.code == row.returnReasonCode)
|
|
this.isInster = true
|
|
this.isInster = true
|
|
const params = {
|
|
const params = {
|
|
'salesReturnBillSn': this.orderSn,
|
|
'salesReturnBillSn': this.orderSn,
|
|
'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
|
|
'salesReturnBillNo': this.ordeDetail.salesReturnBillNo,
|
|
'price': row.productPrice,
|
|
'price': row.productPrice,
|
|
- // 'cost': row.lastStockCost,
|
|
|
|
- 'returnReason': row.returnReason,
|
|
|
|
|
|
+ 'returnReasonCode': row.returnReasonCode,
|
|
|
|
+ 'returnReason': rows ? rows.dispName : '',
|
|
|
|
+ 'goodFlag': this.goodFlag,
|
|
'productSn': row.productSn,
|
|
'productSn': row.productSn,
|
|
'initialQty': row.qty
|
|
'initialQty': row.qty
|
|
}
|
|
}
|