|
@@ -6,6 +6,7 @@
|
|
|
<template slot="subTitle">
|
|
|
<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;">退货类别:{{ detailData&&detailData.goodFlagDictValue||'--' }}</span>
|
|
|
</template>
|
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
|
<template slot="extra" v-if="$hasPermissions('B_purchaseReturnApplyPrint')">
|
|
@@ -74,7 +75,7 @@
|
|
|
</template>
|
|
|
<!-- 退货原因 -->
|
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
|
- <returnReason v-model="record.returnReason"></returnReason>
|
|
|
+ <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode"></returnReason>
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -172,13 +173,17 @@
|
|
|
v-model="record.initQty"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
|
- placeholder="请输入"
|
|
|
+ placeholder="请输入数量"
|
|
|
@blur="e => qtyBlur(e.target.value, record)"
|
|
|
style="width: 100%;" />
|
|
|
</template>
|
|
|
<!-- 退货原因 -->
|
|
|
<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" placeholder="请输入备注(最多50字符)" :maxLength="50" v-model="record.returnReasonRemarks" @blur="e => returnReasonChange(e, record, 1)"></a-input>
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -203,16 +208,24 @@
|
|
|
<!-- 导入明细 -->
|
|
|
<importGuideModal
|
|
|
:openModal="openGuideModal"
|
|
|
+ :goodFlag="goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : 0"
|
|
|
:params="{purchaseReturnApplySn: $route.params.sn, purchaseReturnApplyNo:detailData?detailData.purchaseReturnApplyNo:''}"
|
|
|
@close="openGuideModal=false"
|
|
|
@ok="hanldeImprotOk" />
|
|
|
|
|
|
<!-- 批量设置退货原因 -->
|
|
|
<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><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;">
|
|
|
+ <a-checkbox :checked="showEditRemarks" @change="e => showEditRemarks=!showEditRemarks">是否设置备注</a-checkbox>
|
|
|
+ </div>
|
|
|
+ <div style="line-height: 24px;margin-top:10px;" v-if="showEditRemarks">
|
|
|
+ <div>备注</div>
|
|
|
+ <div><a-input size="large" :maxLength="50" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</commonModal>
|
|
@@ -235,7 +248,7 @@ import {
|
|
|
purchaseReturnDetailDel,
|
|
|
purchaseReturnDetailDelAll,
|
|
|
purchaseReturnModifyQty,
|
|
|
- modifyReturnReason,
|
|
|
+ modifyReturnInfo,
|
|
|
purchaseReturnSubmit,
|
|
|
purchaseReturnApplyPrint,
|
|
|
purchaseReturnApplyExport,
|
|
@@ -258,7 +271,7 @@ export default {
|
|
|
},
|
|
|
productType: [],
|
|
|
dataSource: [],
|
|
|
- returnReasonList: [], // 退货原因列表
|
|
|
+ returnReasonlist: [],
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
openGuideModal: false, // 导入产品弹框
|
|
@@ -266,12 +279,15 @@ export default {
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.queryParam.sysFlag = '1' // 剪冠产品
|
|
|
+ this.queryParam.onlineFalg = this.goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : undefined
|
|
|
return queryDealerScopeProductPage(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
data.list[i].returnQty = 1
|
|
|
+ data.list[i].returnReasonCode = undefined
|
|
|
+ data.list[i].bakReamrks = data.list[i].returnReasonRemarks
|
|
|
}
|
|
|
this.disabled = false
|
|
|
return data
|
|
@@ -289,7 +305,7 @@ export default {
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
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
|
|
|
return data
|
|
@@ -297,14 +313,18 @@ export default {
|
|
|
},
|
|
|
detailData: null,
|
|
|
rowSelectionInfo: null,
|
|
|
- plReturnReason: '',
|
|
|
+ plReturnReason: undefined,
|
|
|
+ plReturnRemark: undefined,
|
|
|
+ showEditRemarks: false,
|
|
|
showPlModal: false
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
showPlModal (newValue, oldValue) {
|
|
|
if (!newValue) {
|
|
|
- this.plReturnReason = ''
|
|
|
+ this.plReturnReason = undefined
|
|
|
+ this.plReturnRemark = undefined
|
|
|
+ this.showEditRemarks = false
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -312,6 +332,9 @@ export default {
|
|
|
selNums () {
|
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
|
},
|
|
|
+ goodFlag () {
|
|
|
+ return this.detailData && this.detailData.goodFlag || ''
|
|
|
+ },
|
|
|
columns () {
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
@@ -328,12 +351,13 @@ export default {
|
|
|
chooseColumns () {
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
- { title: '产品编码', dataIndex: 'product.code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品编码', dataIndex: 'product.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品名称', dataIndex: 'product.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '20%', align: 'center' },
|
|
|
- { title: '单位', dataIndex: 'product.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '17%', align: 'center' },
|
|
|
+ { title: '单位', dataIndex: 'product.unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '申请退货数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
|
|
|
{ title: '退货原因', scopedSlots: { customRender: 'returnReason' }, width: '10%', align: 'center' },
|
|
|
+ { title: '备注', scopedSlots: { customRender: 'returnRemarks' }, width: '10%', align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
|
]
|
|
|
return arr
|
|
@@ -397,11 +421,15 @@ export default {
|
|
|
this.$message.warning('请输入退货数量')
|
|
|
return
|
|
|
}
|
|
|
+ // 退货原因
|
|
|
+ const rows = this.returnReasonlist.find(item => item.code == row.returnReasonCode)
|
|
|
const params = {
|
|
|
purchaseReturnApplySn: this.$route.params.sn,
|
|
|
initQty: row.returnQty, // 退货数量
|
|
|
productSn: row.productSn,
|
|
|
- returnReason: row.returnReason
|
|
|
+ returnReasonCode: row.returnReasonCode,
|
|
|
+ returnReason: rows ? rows.dispName : '',
|
|
|
+ goodFlag: this.goodFlag
|
|
|
}
|
|
|
this.spinning = true
|
|
|
purchaseReturnDetailSave(params).then(res => {
|
|
@@ -500,23 +528,34 @@ 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.target.value
|
|
|
+ if (params.returnReasonRemarks == record.bakReamrks) {
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
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) {
|
|
|
this.$message.success(res.message)
|
|
|
this.$refs.chooseTable.refresh()
|
|
|
} else {
|
|
|
- record.returnReason = record.returnReasonBackups
|
|
|
+ if (type == 0) {
|
|
|
+ record.returnReasonCode = record.returnReasonBackups
|
|
|
+ }
|
|
|
}
|
|
|
this.spinning = false
|
|
|
})
|
|
@@ -530,16 +569,20 @@ 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({
|
|
|
purchaseReturnApplyDetailSn: item.purchaseReturnApplyDetailSn,
|
|
|
- returnReason: this.plReturnReason
|
|
|
+ returnReason: rows ? rows.dispName : '',
|
|
|
+ returnReasonCode: this.plReturnReason,
|
|
|
+ returnReasonRemarks: this.showEditRemarks ? this.plReturnRemark || '' : undefined,
|
|
|
+ goodFlag: this.goodFlag
|
|
|
})
|
|
|
})
|
|
|
modifyReturnReasonList({
|
|
@@ -556,16 +599,24 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 获取单据详情
|
|
|
- getDetail () {
|
|
|
+ getDetail (flag) {
|
|
|
purchaseReturnDetail({ sn: this.$route.params.sn }).then(res => {
|
|
|
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 () {
|
|
|
- this.returnReasonList = this.$store.state.app.returnReason
|
|
|
- this.$refs.chooseTable.refresh(true)
|
|
|
- this.resetSearchForm()
|
|
|
- this.getDetail()
|
|
|
+ this.getDetail(true)
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|