|
@@ -70,11 +70,11 @@
|
|
|
</template>
|
|
|
<!-- 退货原因 -->
|
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
|
- <returnReason v-model="record.returnReason" @blur="updateReason(record)"></returnReason>
|
|
|
+ <returnReason v-model="record.returnReasonCode" @change="e => updateReason(e, record, 0)"></returnReason>
|
|
|
</template>
|
|
|
<!-- 备注 -->
|
|
|
<template slot="remarksInfo" slot-scope="text, record">
|
|
|
- <a-input size="small" v-model.trim="record.remarksInfo" allowClear placeholder="请输入备注信息(最多50字符)"/>
|
|
|
+ <a-input size="small" v-model.trim="record.returnReasonRemarks" @blur="e => updateReason(e, record, 1)" :maxlength="50" allowClear placeholder="请输入备注信息(最多50字符)"/>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
<div class="footer-btn">
|
|
@@ -93,20 +93,16 @@
|
|
|
<chooseTypeModal :openModal="openTypeModal" :type="actionType" @close="openTypeModal=false" @confirm="plconfirm"></chooseTypeModal>
|
|
|
<!-- 批量设置退货原因 -->
|
|
|
<commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @cancel="showPlModal=false" @ok="setPlReturnReason">
|
|
|
- <a-form-model
|
|
|
- ref="ruleForm"
|
|
|
- :model="reasonForm"
|
|
|
- :rules="rules"
|
|
|
- :label-col="labelCol"
|
|
|
- :wrapper-col="wrapperCol"
|
|
|
- >
|
|
|
- <a-form-model-item label="请选择退货原因" prop="plReturnReason">
|
|
|
- <returnReason size="middle" v-model="reasonForm.plReturnReason"></returnReason>
|
|
|
- </a-form-model-item>
|
|
|
- <a-form-model-item label="备注" prop="remarksInfo">
|
|
|
- <a-input v-model="reasonForm.remarksInfo" :maxLength="50" placeholder="请输入备注信息(最多50字符)" />
|
|
|
- </a-form-model-item>
|
|
|
- </a-form-model>
|
|
|
+ <div style="text-align: left;">
|
|
|
+ <div style="line-height: 24px;">
|
|
|
+ <div><span style="color:red;">*</span>退货原因</div>
|
|
|
+ <div><returnReason size="large" 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>
|
|
|
</commonModal>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -145,7 +141,6 @@ export default {
|
|
|
productForm: {
|
|
|
salesReturnBillSn: ''
|
|
|
},
|
|
|
- reasonForm: { plReturnReason: undefined, remarksInfo: '' },
|
|
|
queryParam: {
|
|
|
productCode: '',
|
|
|
productName: ''
|
|
@@ -153,12 +148,6 @@ export default {
|
|
|
chooseLoadData: [],
|
|
|
labelCol: { span: 8 },
|
|
|
wrapperCol: { span: 14 },
|
|
|
- rules: {
|
|
|
- plReturnReason: [
|
|
|
- { required: true, message: '请选择退货原因', trigger: 'change' }
|
|
|
- ],
|
|
|
- remarksInfo: [{ required: true, message: '请输入备注信息', trigger: 'blur' }]
|
|
|
- },
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
@@ -184,18 +173,24 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
rowSelectionInfo: null,
|
|
|
- plReturnReason: '',
|
|
|
- showPlModal: false
|
|
|
+ plReturnReason: undefined,
|
|
|
+ plReturnRemark: '',
|
|
|
+ showPlModal: false,
|
|
|
+ returnReasonlist: []
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
showPlModal (newValue, oldValue) {
|
|
|
if (!newValue) {
|
|
|
- this.plReturnReason = ''
|
|
|
+ this.plReturnReason = undefined
|
|
|
+ this.plReturnRemark = ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ goodFlag() {
|
|
|
+ return this.ordeDetail && this.ordeDetail.goodFlag || ''
|
|
|
+ },
|
|
|
selNums () {
|
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
|
},
|
|
@@ -298,18 +293,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
setPlReturnReason () {
|
|
|
- if (this.plReturnReason == '') {
|
|
|
- this.$message.warning('请输入退货原因!')
|
|
|
+ if (!this.plReturnReason) {
|
|
|
+ this.$message.warning('请选择退货原因!')
|
|
|
} else {
|
|
|
this.spinning = true
|
|
|
const snList = []
|
|
|
const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
|
|
|
+ const rows = this.returnReasonlist.find(item => item.code == this.plReturnReason)
|
|
|
arr.map(item => {
|
|
|
snList.push(item.salesReturnDetailSn)
|
|
|
})
|
|
|
salesReturnDetailSetReason({
|
|
|
salesReturnBillDetailSnList: snList,
|
|
|
- returnReason: this.plReturnReason
|
|
|
+ salesReturnBillSn : this.orderSn,
|
|
|
+ returnReason: rows ? rows.dispName : '',
|
|
|
+ returnReasonCode: this.plReturnReason,
|
|
|
+ returnReasonRemarks: this.plReturnRemark
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.showPlModal = false
|
|
@@ -321,17 +320,25 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 修改退货原因
|
|
|
- updateReason (row) {
|
|
|
- // 空或没有改变时不保存数据
|
|
|
- if (!row.returnReason || row.returnReason == row.returnReasonBackups) {
|
|
|
- row.returnReason = row.returnReasonBackups
|
|
|
- return
|
|
|
+ updateReason (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
|
|
|
- salesReturnDetailUpdateReason({
|
|
|
- salesReturnDetailSn: row.salesReturnDetailSn,
|
|
|
- returnReason: row.returnReason
|
|
|
- }).then(res => {
|
|
|
+ salesReturnDetailUpdateReason(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$refs.table.refresh()
|
|
|
this.$message.success(res.message)
|
|
@@ -398,6 +405,9 @@ export default {
|
|
|
getOrderDetail () {
|
|
|
salesReturnDetail({ sn: this.orderSn }).then(res => {
|
|
|
this.ordeDetail = res.data || null
|
|
|
+ if(res.data){
|
|
|
+ this.returnReasonlist = [...this.$store.state.app.goodReturnReason,...this.$store.state.app.defectiveReturnReason]
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
// 重置
|