|
@@ -6,6 +6,7 @@
|
|
<template slot="subTitle">
|
|
<template slot="subTitle">
|
|
<a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<a id="purchaseReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<span style="margin: 0 15px;color: #666;">供应商名称:箭冠营销中心</span>
|
|
<span style="margin: 0 15px;color: #666;">供应商名称:箭冠营销中心</span>
|
|
|
|
+ <span style="margin: 0 15px;color: #666;">退货类别:{{detailData&&detailData.goodFlagDictValue||'--'}}</span>
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<template slot="extra" v-if="$hasPermissions('B_purchaseReturnApplyPrint')">
|
|
<template slot="extra" v-if="$hasPermissions('B_purchaseReturnApplyPrint')">
|
|
@@ -74,7 +75,7 @@
|
|
</template>
|
|
</template>
|
|
<!-- 退货原因 -->
|
|
<!-- 退货原因 -->
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
- <returnReason v-model="record.returnReason"></returnReason>
|
|
|
|
|
|
+ <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode"></returnReason>
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -178,7 +179,11 @@
|
|
</template>
|
|
</template>
|
|
<!-- 退货原因 -->
|
|
<!-- 退货原因 -->
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
- <returnReason v-model="record.returnReason" @blur="e => remarksBlur(e, record)"></returnReason>
|
|
|
|
|
|
+ <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode" @change="e => returnReasonChange(e, record, 0)"></returnReason>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- 备注 -->
|
|
|
|
+ <template slot="returnRemarks" slot-scope="text, record">
|
|
|
|
+ <a-input size="small" v-model="record.returnReasonRemarks" @change="e => returnReasonChange(e, record, 1)"></a-input>
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -203,16 +208,21 @@
|
|
<!-- 导入明细 -->
|
|
<!-- 导入明细 -->
|
|
<importGuideModal
|
|
<importGuideModal
|
|
:openModal="openGuideModal"
|
|
:openModal="openGuideModal"
|
|
|
|
+ :goodFlag="goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : 0"
|
|
:params="{purchaseReturnApplySn: $route.params.sn, purchaseReturnApplyNo:detailData?detailData.purchaseReturnApplyNo:''}"
|
|
:params="{purchaseReturnApplySn: $route.params.sn, purchaseReturnApplyNo:detailData?detailData.purchaseReturnApplyNo:''}"
|
|
@close="openGuideModal=false"
|
|
@close="openGuideModal=false"
|
|
@ok="hanldeImprotOk" />
|
|
@ok="hanldeImprotOk" />
|
|
|
|
|
|
<!-- 批量设置退货原因 -->
|
|
<!-- 批量设置退货原因 -->
|
|
<commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @close="showPlModal=false" @ok="setPlReturnReason">
|
|
<commonModal modalTit="批量设置退货原因" :openModal="showPlModal" @close="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" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</commonModal>
|
|
</commonModal>
|
|
@@ -235,7 +245,7 @@ import {
|
|
purchaseReturnDetailDel,
|
|
purchaseReturnDetailDel,
|
|
purchaseReturnDetailDelAll,
|
|
purchaseReturnDetailDelAll,
|
|
purchaseReturnModifyQty,
|
|
purchaseReturnModifyQty,
|
|
- modifyReturnReason,
|
|
|
|
|
|
+ modifyReturnInfo,
|
|
purchaseReturnSubmit,
|
|
purchaseReturnSubmit,
|
|
purchaseReturnApplyPrint,
|
|
purchaseReturnApplyPrint,
|
|
purchaseReturnApplyExport,
|
|
purchaseReturnApplyExport,
|
|
@@ -258,7 +268,7 @@ export default {
|
|
},
|
|
},
|
|
productType: [],
|
|
productType: [],
|
|
dataSource: [],
|
|
dataSource: [],
|
|
- returnReasonList: [], // 退货原因列表
|
|
|
|
|
|
+ returnReasonlist: [],
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
openGuideModal: false, // 导入产品弹框
|
|
openGuideModal: false, // 导入产品弹框
|
|
@@ -266,12 +276,14 @@ export default {
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.queryParam.sysFlag = '1' // 剪冠产品
|
|
this.queryParam.sysFlag = '1' // 剪冠产品
|
|
|
|
+ this.queryParam.onlineFalg = this.goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : undefined
|
|
return queryDealerScopeProductPage(Object.assign(parameter, this.queryParam)).then(res => {
|
|
return queryDealerScopeProductPage(Object.assign(parameter, this.queryParam)).then(res => {
|
|
const data = res.data
|
|
const data = res.data
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
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].returnQty = 1
|
|
data.list[i].returnQty = 1
|
|
|
|
+ data.list[i].returnReasonCode = undefined
|
|
}
|
|
}
|
|
this.disabled = false
|
|
this.disabled = false
|
|
return data
|
|
return data
|
|
@@ -289,7 +301,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].initQty
|
|
data.list[i].qtyBackups = data.list[i].initQty
|
|
- data.list[i].returnReasonBackups = data.list[i].returnReason
|
|
|
|
|
|
+ data.list[i].returnReasonBackups = data.list[i].returnReasonCode
|
|
}
|
|
}
|
|
this.dataSource = data.list
|
|
this.dataSource = data.list
|
|
return data
|
|
return data
|
|
@@ -297,14 +309,16 @@ export default {
|
|
},
|
|
},
|
|
detailData: null,
|
|
detailData: null,
|
|
rowSelectionInfo: null,
|
|
rowSelectionInfo: null,
|
|
- plReturnReason: '',
|
|
|
|
|
|
+ plReturnReason: undefined,
|
|
|
|
+ plReturnRemark: '',
|
|
showPlModal: false
|
|
showPlModal: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
showPlModal (newValue, oldValue) {
|
|
showPlModal (newValue, oldValue) {
|
|
if (!newValue) {
|
|
if (!newValue) {
|
|
- this.plReturnReason = ''
|
|
|
|
|
|
+ this.plReturnReason = undefined
|
|
|
|
+ this.plReturnRemark = ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -312,6 +326,9 @@ export default {
|
|
selNums () {
|
|
selNums () {
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
},
|
|
},
|
|
|
|
+ goodFlag() {
|
|
|
|
+ return this.detailData && this.detailData.goodFlag || ''
|
|
|
|
+ },
|
|
columns () {
|
|
columns () {
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
@@ -397,11 +414,15 @@ export default {
|
|
this.$message.warning('请输入退货数量')
|
|
this.$message.warning('请输入退货数量')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ // 退货原因
|
|
|
|
+ const rows = this.returnReasonlist.find(item => item.code == row.returnReasonCode)
|
|
const params = {
|
|
const params = {
|
|
purchaseReturnApplySn: this.$route.params.sn,
|
|
purchaseReturnApplySn: this.$route.params.sn,
|
|
initQty: row.returnQty, // 退货数量
|
|
initQty: row.returnQty, // 退货数量
|
|
productSn: row.productSn,
|
|
productSn: row.productSn,
|
|
- returnReason: row.returnReason
|
|
|
|
|
|
+ returnReasonCode: row.returnReasonCode,
|
|
|
|
+ returnReason: rows ? rows.dispName : '',
|
|
|
|
+ goodFlag: this.goodFlag
|
|
}
|
|
}
|
|
this.spinning = true
|
|
this.spinning = true
|
|
purchaseReturnDetailSave(params).then(res => {
|
|
purchaseReturnDetailSave(params).then(res => {
|
|
@@ -500,23 +521,31 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 已选产品 退货原因修改
|
|
// 已选产品 退货原因修改
|
|
- remarksBlur (val, record) {
|
|
|
|
- // 空或没有改变时不保存数据
|
|
|
|
- if (!record.returnReason || record.returnReason == record.returnReasonBackups) {
|
|
|
|
- record.returnReason = record.returnReasonBackups
|
|
|
|
- return
|
|
|
|
|
|
+ returnReasonChange (val, record, type) {
|
|
|
|
+ console.log(val,record,type)
|
|
|
|
+ const params = {
|
|
|
|
+ purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
|
|
|
|
+ purchaseReturnApplySn: this.$route.params.sn,
|
|
|
|
+ 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
|
|
}
|
|
}
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- modifyReturnReason({
|
|
|
|
- returnReason: record.returnReason,
|
|
|
|
- purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
|
|
|
|
- purchaseReturnApplySn: this.$route.params.sn
|
|
|
|
- }).then(res => {
|
|
|
|
|
|
+ modifyReturnInfo(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.$message.success(res.message)
|
|
this.$message.success(res.message)
|
|
this.$refs.chooseTable.refresh()
|
|
this.$refs.chooseTable.refresh()
|
|
} else {
|
|
} else {
|
|
- record.returnReason = record.returnReasonBackups
|
|
|
|
|
|
+ if(type == 0){
|
|
|
|
+ record.returnReasonCode = record.returnReasonBackups
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
})
|
|
})
|
|
@@ -530,16 +559,20 @@ 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({
|
|
snList.push({
|
|
purchaseReturnApplyDetailSn: item.purchaseReturnApplyDetailSn,
|
|
purchaseReturnApplyDetailSn: item.purchaseReturnApplyDetailSn,
|
|
- returnReason: this.plReturnReason
|
|
|
|
|
|
+ returnReason: rows ? rows.dispName : '',
|
|
|
|
+ returnReasonCode: this.plReturnReason,
|
|
|
|
+ returnReasonRemarks: this.plReturnRemark,
|
|
|
|
+ goodFlag: this.goodFlag
|
|
})
|
|
})
|
|
})
|
|
})
|
|
modifyReturnReasonList({
|
|
modifyReturnReasonList({
|
|
@@ -556,16 +589,24 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 获取单据详情
|
|
// 获取单据详情
|
|
- getDetail () {
|
|
|
|
|
|
+ getDetail (flag) {
|
|
purchaseReturnDetail({ sn: this.$route.params.sn }).then(res => {
|
|
purchaseReturnDetail({ sn: this.$route.params.sn }).then(res => {
|
|
this.detailData = res.data ? res.data : null
|
|
this.detailData = res.data ? 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
|
|
|
|
+ }
|
|
|
|
+ if(flag){
|
|
|
|
+ this.$refs.chooseTable.refresh(true)
|
|
|
|
+ this.resetSearchForm()
|
|
|
|
+ }
|
|
})
|
|
})
|
|
},
|
|
},
|
|
pageInit () {
|
|
pageInit () {
|
|
- this.returnReasonList = this.$store.state.app.returnReason
|
|
|
|
- this.$refs.chooseTable.refresh(true)
|
|
|
|
- this.resetSearchForm()
|
|
|
|
- this.getDetail()
|
|
|
|
|
|
+ this.getDetail(true)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|