|
@@ -73,16 +73,7 @@
|
|
</template>
|
|
</template>
|
|
<!-- 退货原因 -->
|
|
<!-- 退货原因 -->
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
- <a-select
|
|
|
|
- style="width:100%;"
|
|
|
|
- size="small"
|
|
|
|
- v-model="record.returnReason"
|
|
|
|
- placeholder="请选择退货原因"
|
|
|
|
- allowClear>
|
|
|
|
- <a-select-option v-for="item in returnReasonList" :value="item.code">
|
|
|
|
- {{ item.dispName }}
|
|
|
|
- </a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
|
|
+ <returnReason v-model="record.returnReason"></returnReason>
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -114,7 +105,7 @@
|
|
</a-alert>
|
|
</a-alert>
|
|
<!-- 筛选条件 -->
|
|
<!-- 筛选条件 -->
|
|
<div class="table-page-search-wrapper" style="display:flex;width:100%;">
|
|
<div class="table-page-search-wrapper" style="display:flex;width:100%;">
|
|
- <div style="width:80%;">
|
|
|
|
|
|
+ <div style="flex-grow:1;">
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
@@ -134,12 +125,15 @@
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
- <div style="text-align:right;width:20%;">
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <span style="margin-right: 10px;" v-if="selNums">已选{{ selNums }}项</span>
|
|
|
|
+ <a-button type="default" style="margin-right: 10px;" class="button-info" @click="openPlSetReason">批量设置退货原因</a-button>
|
|
<a-button
|
|
<a-button
|
|
- type="default"
|
|
|
|
|
|
+ type="primary"
|
|
id="purchaseReturnEdit-import-btn"
|
|
id="purchaseReturnEdit-import-btn"
|
|
|
|
+ class="button-info"
|
|
@click="openGuideModal = true"
|
|
@click="openGuideModal = true"
|
|
- style="margin-right: 10px;">产品导入</a-button>
|
|
|
|
|
|
+ >产品导入</a-button>
|
|
<a-button
|
|
<a-button
|
|
type="primary"
|
|
type="primary"
|
|
class="button-error"
|
|
class="button-error"
|
|
@@ -154,6 +148,8 @@
|
|
ref="chooseTable"
|
|
ref="chooseTable"
|
|
size="small"
|
|
size="small"
|
|
:rowKey="(record) => record.id"
|
|
:rowKey="(record) => record.id"
|
|
|
|
+ :row-selection="{ columnWidth: 40 }"
|
|
|
|
+ @rowSelection="rowSelectionFun"
|
|
:columns="chooseColumns"
|
|
:columns="chooseColumns"
|
|
:data="chooseLoadData"
|
|
:data="chooseLoadData"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
@@ -179,17 +175,7 @@
|
|
</template>
|
|
</template>
|
|
<!-- 退货原因 -->
|
|
<!-- 退货原因 -->
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
- <a-select
|
|
|
|
- style="width:100%;"
|
|
|
|
- size="small"
|
|
|
|
- v-model="record.returnReason"
|
|
|
|
- placeholder="请选择退货原因"
|
|
|
|
- @change="e => remarksBlur(e, record)"
|
|
|
|
- allowClear>
|
|
|
|
- <a-select-option v-for="item in returnReasonList" :value="item.code">
|
|
|
|
- {{ item.dispName }}
|
|
|
|
- </a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
|
|
+ <returnReason v-model="record.returnReason" @blur="e => remarksBlur(e, record)"></returnReason>
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -217,6 +203,16 @@
|
|
: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" @cancel="showPlModal=false" @ok="setPlReturnReason">
|
|
|
|
+ <div style="text-align: center;">
|
|
|
|
+ <div style="margin-bottom: 15px;font-size: 14px;"><strong>请输入退货原因</strong></div>
|
|
|
|
+ <div style="line-height: 24px;">
|
|
|
|
+ <div><returnReason size="large" v-model="plReturnReason"></returnReason></div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </commonModal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -225,6 +221,8 @@ import { commonMixin } from '@/utils/mixin'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import Print from '@/views/common/print.vue'
|
|
import Print from '@/views/common/print.vue'
|
|
import { hdPrint } from '@/libs/JGPrint'
|
|
import { hdPrint } from '@/libs/JGPrint'
|
|
|
|
+import returnReason from '@/views/common/returnReason'
|
|
|
|
+import commonModal from '@/views/common/commonModal.vue'
|
|
import ProductType from '../../common/productType.js'
|
|
import ProductType from '../../common/productType.js'
|
|
import importGuideModal from './importGuideModal.vue'
|
|
import importGuideModal from './importGuideModal.vue'
|
|
import {
|
|
import {
|
|
@@ -239,10 +237,11 @@ import {
|
|
purchaseReturnApplyPrint,
|
|
purchaseReturnApplyPrint,
|
|
purchaseReturnApplyExport,
|
|
purchaseReturnApplyExport,
|
|
purchaseReturnApplyCreateList,
|
|
purchaseReturnApplyCreateList,
|
|
- queryDealerScopeProductPage } from '@/api/purchaseReturnApply'
|
|
|
|
|
|
+ queryDealerScopeProductPage,
|
|
|
|
+ modifyReturnReasonList } from '@/api/purchaseReturnApply'
|
|
export default {
|
|
export default {
|
|
name: 'PurchaseReturnEdit',
|
|
name: 'PurchaseReturnEdit',
|
|
- components: { STable, VSelect, Print, ProductType, importGuideModal },
|
|
|
|
|
|
+ components: { STable, VSelect, Print, ProductType, importGuideModal, returnReason, commonModal },
|
|
mixins: [commonMixin],
|
|
mixins: [commonMixin],
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -293,10 +292,16 @@ export default {
|
|
return data
|
|
return data
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- detailData: null
|
|
|
|
|
|
+ detailData: null,
|
|
|
|
+ rowSelectionInfo: null,
|
|
|
|
+ plReturnReason: '',
|
|
|
|
+ showPlModal: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ selNums () {
|
|
|
|
+ return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
|
|
+ },
|
|
columns () {
|
|
columns () {
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
@@ -329,6 +334,10 @@ export default {
|
|
handleBack () {
|
|
handleBack () {
|
|
this.$router.push({ name: 'purchaseReturnApplyFormList' })
|
|
this.$router.push({ name: 'purchaseReturnApplyFormList' })
|
|
},
|
|
},
|
|
|
|
+ // 表格选中项
|
|
|
|
+ rowSelectionFun (obj) {
|
|
|
|
+ this.rowSelectionInfo = obj || null
|
|
|
|
+ },
|
|
// 打印预览/快捷打印
|
|
// 打印预览/快捷打印
|
|
handlePrint (type, printerType) {
|
|
handlePrint (type, printerType) {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -378,10 +387,6 @@ export default {
|
|
this.$message.warning('请输入退货数量')
|
|
this.$message.warning('请输入退货数量')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if (!row.returnReason) {
|
|
|
|
- this.$message.warning('请选择退货原因')
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
const params = {
|
|
const params = {
|
|
purchaseReturnApplySn: this.$route.params.sn,
|
|
purchaseReturnApplySn: this.$route.params.sn,
|
|
initQty: row.returnQty, // 退货数量
|
|
initQty: row.returnQty, // 退货数量
|
|
@@ -459,14 +464,17 @@ export default {
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
purchaseReturnSubmit({ sn: _this.$route.params.sn }).then(res => {
|
|
purchaseReturnSubmit({ sn: _this.$route.params.sn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- this.$message.success(res.message)
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
|
+ if (res.data.length) {
|
|
|
|
+ _this.$warning({
|
|
|
|
+ title: '以下产品请输入退货原因',
|
|
|
|
+ content: res.data.toString()
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ _this.$message.success(res.message)
|
|
_this.handleBack()
|
|
_this.handleBack()
|
|
- _this.spinning = false
|
|
|
|
- }, 1000)
|
|
|
|
- } else {
|
|
|
|
- _this.spinning = false
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ _this.spinning = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 已选产品 退货数量修改
|
|
// 已选产品 退货数量修改
|
|
@@ -493,19 +501,55 @@ export default {
|
|
},
|
|
},
|
|
// 已选产品 退货原因修改
|
|
// 已选产品 退货原因修改
|
|
remarksBlur (val, record) {
|
|
remarksBlur (val, record) {
|
|
- if (val && (val != record.returnReasonBackups)) {
|
|
|
|
|
|
+ // 空或没有改变时不保存数据
|
|
|
|
+ if (!record.returnReason || record.returnReason == record.returnReasonBackups) {
|
|
|
|
+ record.returnReason = record.returnReasonBackups
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.spinning = true
|
|
|
|
+ modifyReturnReason({
|
|
|
|
+ returnReason: record.returnReason,
|
|
|
|
+ purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
|
|
|
|
+ purchaseReturnApplySn: this.$route.params.sn
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.$message.success(res.message)
|
|
|
|
+ this.$refs.chooseTable.refresh()
|
|
|
|
+ } else {
|
|
|
|
+ record.returnReason = record.returnReasonBackups
|
|
|
|
+ }
|
|
|
|
+ this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 批量设置退货原因
|
|
|
|
+ openPlSetReason () {
|
|
|
|
+ if (this.selNums) {
|
|
|
|
+ this.showPlModal = true
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.warning('请先选择产品!')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ setPlReturnReason () {
|
|
|
|
+ if (this.plReturnReason == '') {
|
|
|
|
+ this.$message.warning('请输入退货原因!')
|
|
|
|
+ } else {
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- modifyReturnReason({
|
|
|
|
- returnReason: record.returnReason,
|
|
|
|
- purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
|
|
|
|
- purchaseReturnApplySn: this.$route.params.sn
|
|
|
|
|
|
+ const snList = []
|
|
|
|
+ const arr = this.rowSelectionInfo && this.rowSelectionInfo.selectedRows || []
|
|
|
|
+ arr.map(item => {
|
|
|
|
+ snList.push({
|
|
|
|
+ purchaseReturnApplyDetailSn: item.purchaseReturnApplyDetailSn,
|
|
|
|
+ returnReason: this.plReturnReason
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ modifyReturnReasonList({
|
|
|
|
+ purchaseReturnApplySn: this.$route.params.sn,
|
|
|
|
+ detailList: snList
|
|
}).then(res => {
|
|
}).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
- this.$message.success(res.message)
|
|
|
|
|
|
+ this.showPlModal = false
|
|
this.$refs.chooseTable.refresh()
|
|
this.$refs.chooseTable.refresh()
|
|
- record.returnReasonBackups = record.returnReason
|
|
|
|
- } else {
|
|
|
|
- record.returnReason = record.returnReasonBackups
|
|
|
|
|
|
+ this.$refs.chooseTable.clearSelected()
|
|
}
|
|
}
|
|
this.spinning = false
|
|
this.spinning = false
|
|
})
|
|
})
|