|
@@ -38,8 +38,8 @@
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseReturnEdit-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseReturnEdit-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
@@ -66,7 +66,7 @@
|
|
|
<template slot="returnQty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
size="small"
|
|
|
- id="purchaseReturnEdit-returnQty"
|
|
|
+ :id="'purchaseReturnEdit-returnQty-'+record.id"
|
|
|
v-model="record.returnQty"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
@@ -76,7 +76,7 @@
|
|
|
</template>
|
|
|
<!-- 退货原因 -->
|
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
|
- <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode"></returnReason>
|
|
|
+ <returnReason :id="'purchaseReturnEdit-goodFlag-'+record.id" :goodFlag="goodFlag" v-model="record.returnReasonCode"></returnReason>
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record">
|
|
@@ -87,7 +87,8 @@
|
|
|
type="link"
|
|
|
class="button-primary"
|
|
|
@click="handleAdd(record)"
|
|
|
- id="purchaseReturnEdit-add-btn">添加</a-button>
|
|
|
+ :id="'purchaseReturnEdit-add-'+record.id"
|
|
|
+ >添加</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-collapse-panel>
|
|
@@ -113,17 +114,17 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品编码" prop="productCode">
|
|
|
- <a-input id="purchaseReturnEdit-productCode" v-model.trim="chooseParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
+ <a-input id="purchaseReturnEdit-cp-productCode" v-model.trim="chooseParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24">
|
|
|
<a-form-item label="产品名称" prop="productName">
|
|
|
- <a-input id="purchaseReturnEdit-productName" v-model.trim="chooseParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
+ <a-input id="purchaseReturnEdit-cp-productName" v-model.trim="chooseParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
- <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="disabled" id="purchaseReturnList-refresh">查询</a-button>
|
|
|
- <a-button style="margin-left: 8px" @click="resetChooseForm" :disabled="disabled" id="purchaseReturnList-reset">重置</a-button>
|
|
|
+ <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="disabled" id="purchaseReturnEdit-cp-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="resetChooseForm" :disabled="disabled" id="purchaseReturnEdit-cp-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
@@ -133,7 +134,7 @@
|
|
|
<a-button v-if="editGoodFlag" type="default" style="margin-right: 10px;" class="button-info" @click="openPlSetReason">批量设置退货原因</a-button>
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
- id="purchaseReturnEdit-import-btn"
|
|
|
+ id="purchaseReturnEdit-cp-import-btn"
|
|
|
class="button-info"
|
|
|
@click="openGuideModal = true"
|
|
|
>导入产品</a-button>
|
|
@@ -141,7 +142,7 @@
|
|
|
type="primary"
|
|
|
ghost
|
|
|
class="button-error"
|
|
|
- id="purchaseReturnEdit-delAll-btn"
|
|
|
+ id="purchaseReturnEdit-cp-delAll-btn"
|
|
|
:disabled="dataSource.length == 0"
|
|
|
@click.stop="handleDel('', 'all')"
|
|
|
>清空列表</a-button>
|
|
@@ -170,7 +171,7 @@
|
|
|
<template slot="qty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
size="small"
|
|
|
- id="purchaseReturnEdit-qty"
|
|
|
+ :id="'purchaseReturnEdit-cp-qty-'+record.id"
|
|
|
v-model="record.initQty"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
@@ -180,15 +181,21 @@
|
|
|
</template>
|
|
|
<!-- 退货原因 -->
|
|
|
<template slot="returnReason" slot-scope="text, record">
|
|
|
- <returnReason :goodFlag="goodFlag" v-model="record.returnReasonCode" @change="e => returnReasonChange(e, record, 0)"></returnReason>
|
|
|
+ <returnReason :id="'purchaseReturnEdit-cp-goodFlag-'+record.id" :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>
|
|
|
+ <a-input
|
|
|
+ :id="'purchaseReturnEdit-cp-remarks-'+record.id"
|
|
|
+ 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">
|
|
|
- <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="purchaseReturnEdit-del-btn">删除</a-button>
|
|
|
+ <a-button :id="'purchaseReturnEdit-cp-del-'+record.id" size="small" type="link" class="button-error" @click="handleDel(record)">删除</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-collapse-panel>
|
|
@@ -198,7 +205,7 @@
|
|
|
<a-card size="small" :bordered="false" class="affix-cont">
|
|
|
<a-button
|
|
|
type="primary"
|
|
|
- id="purchaseReturnEdit-submit"
|
|
|
+ id="purchaseReturnEdit-cp-submit"
|
|
|
size="large"
|
|
|
:disabled="spinning"
|
|
|
class="button-primary"
|
|
@@ -219,14 +226,14 @@
|
|
|
<div style="text-align: left;">
|
|
|
<div style="line-height: 24px;">
|
|
|
<div><span style="color:red;">*</span>退货原因</div>
|
|
|
- <div><returnReason size="large" :goodFlag="goodFlag" v-model="plReturnReason"></returnReason></div>
|
|
|
+ <div><returnReason id="purchaseReturnEdit-goodFlag-modal" 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>
|
|
|
+ <a-checkbox id="purchaseReturnEdit-showEdit-modal" :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><a-input id="purchaseReturnEdit-remarks-modal" size="large" :maxLength="50" placeholder="请输入备注(最多50字符)" v-model="plReturnRemark"></a-input></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</commonModal>
|
|
@@ -264,15 +271,15 @@ export default {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
queryParam: {
|
|
|
- code: '',
|
|
|
- name: '',
|
|
|
- productTypeSn1: undefined,
|
|
|
- productTypeSn2: undefined,
|
|
|
- productTypeSn3: undefined
|
|
|
+ code: '', // 编码
|
|
|
+ name: '', // 名称
|
|
|
+ productTypeSn1: undefined, // 分类1
|
|
|
+ productTypeSn2: undefined, // 分类2
|
|
|
+ productTypeSn3: undefined // 分类3
|
|
|
},
|
|
|
- productType: [],
|
|
|
- dataSource: [],
|
|
|
- returnReasonlist: [],
|
|
|
+ productType: [], // 分类默认值
|
|
|
+ dataSource: [], // 列表数据
|
|
|
+ returnReasonlist: [], // 退货原因
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
advanced: false, // 高级搜索 展开/关闭
|
|
|
openGuideModal: false, // 导入产品弹框
|
|
@@ -280,7 +287,7 @@ export default {
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.queryParam.sysFlag = '1' // 剪冠产品
|
|
|
- this.queryParam.onlineFalg = this.goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : undefined
|
|
|
+ this.queryParam.onlineFalg = this.goodFlag == 'GOOD_PRODUCT_RETURN' ? 1 : undefined // 上线标志,根据 良品or坏品
|
|
|
return queryDealerScopeProductPage(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
@@ -294,9 +301,10 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
+ // 已选产品
|
|
|
chooseParam: {
|
|
|
- productCode: '',
|
|
|
- productName: ''
|
|
|
+ productCode: '', // 产品编码
|
|
|
+ productName: '' // 产品名称
|
|
|
},
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
chooseLoadData: parameter => {
|
|
@@ -312,15 +320,16 @@ export default {
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- detailData: null,
|
|
|
- rowSelectionInfo: null,
|
|
|
- plReturnReason: undefined,
|
|
|
- plReturnRemark: undefined,
|
|
|
- showEditRemarks: false,
|
|
|
- showPlModal: false
|
|
|
+ detailData: null, // 详情信息
|
|
|
+ rowSelectionInfo: null, // 已勾选数据
|
|
|
+ plReturnReason: undefined, // 批量退货原因
|
|
|
+ plReturnRemark: undefined, // 批量退货备注
|
|
|
+ showEditRemarks: false, // 是否修改备注
|
|
|
+ showPlModal: false // 批量修改弹框
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
+ // 监听批量退货原因
|
|
|
showPlModal (newValue, oldValue) {
|
|
|
if (!newValue) {
|
|
|
this.plReturnReason = undefined
|
|
@@ -330,40 +339,47 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
+ // 已选条数
|
|
|
selNums () {
|
|
|
return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
|
|
|
},
|
|
|
+ // 良品or坏品
|
|
|
goodFlag () {
|
|
|
return this.detailData && this.detailData.goodFlag || ''
|
|
|
},
|
|
|
+ // 是否编辑退货原因
|
|
|
editGoodFlag () {
|
|
|
return this.detailData && this.detailData.goodFlag == 'DEFECTIVE_PRODUCT_RETURN'
|
|
|
},
|
|
|
+ // 列定义
|
|
|
columns () {
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
{ title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'name', width: this.editGoodFlag ? '20%':'30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '产品名称', dataIndex: 'name', width: this.editGoodFlag ? '20%' : '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '20%', align: 'center' },
|
|
|
{ title: '单位', dataIndex: 'unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '申请退货数量', scopedSlots: { customRender: 'returnQty' }, width: '10%', align: 'center' }
|
|
|
]
|
|
|
- if(this.editGoodFlag){
|
|
|
+ // 可编辑退货原因
|
|
|
+ if (this.editGoodFlag) {
|
|
|
arr.push({ title: '退货原因', scopedSlots: { customRender: 'returnReason' }, width: '10%', align: 'center' })
|
|
|
}
|
|
|
arr.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' })
|
|
|
return arr
|
|
|
},
|
|
|
+ // 已选表格列
|
|
|
chooseColumns () {
|
|
|
const arr = [
|
|
|
{ title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
|
|
|
{ title: '产品编码', dataIndex: 'product.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'product.name', width: this.editGoodFlag ? '20%':'30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '产品名称', dataIndex: 'product.name', width: this.editGoodFlag ? '20%' : '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
{ 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' }
|
|
|
]
|
|
|
- if(this.editGoodFlag){
|
|
|
+ // 可编辑退货原因
|
|
|
+ if (this.editGoodFlag) {
|
|
|
arr.push({ title: '退货原因', scopedSlots: { customRender: 'returnReason' }, width: '10%', align: 'center' })
|
|
|
}
|
|
|
arr.push({ title: '备注', scopedSlots: { customRender: 'returnRemarks' }, width: '10%', align: 'center' })
|
|
@@ -372,7 +388,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 返回列表
|
|
|
+ // 返回列表
|
|
|
handleBack () {
|
|
|
this.$router.push({ name: 'purchaseReturnApplyFormList' })
|
|
|
},
|
|
@@ -406,13 +422,13 @@ export default {
|
|
|
this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
- // 产品分类 change
|
|
|
+ // 产品分类 change
|
|
|
changeProductType (val, opt) {
|
|
|
this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
},
|
|
|
- // 重置产品列表
|
|
|
+ // 重置产品列表
|
|
|
resetSearchForm () {
|
|
|
this.queryParam.code = ''
|
|
|
this.queryParam.name = ''
|
|
@@ -451,15 +467,13 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 导入明细
|
|
|
- handleImport () {},
|
|
|
// 重置已选产品列表
|
|
|
resetChooseForm () {
|
|
|
this.chooseParam.productCode = ''
|
|
|
this.chooseParam.productName = ''
|
|
|
this.$refs.chooseTable.refresh(true)
|
|
|
},
|
|
|
- // 删除
|
|
|
+ // 删除产品,isAll: true 全部清空,false 单个删除
|
|
|
handleDel (row, isAll) {
|
|
|
const _this = this
|
|
|
if (this.dataSource.length == 0) {
|
|
@@ -478,7 +492,6 @@ export default {
|
|
|
fun(params).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
_this.$message.success(res.message)
|
|
|
- // _this.$refs.table.refresh()
|
|
|
_this.$refs.chooseTable.refresh()
|
|
|
_this.spinning = false
|
|
|
_this.getDetail()
|
|
@@ -535,9 +548,8 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- // 已选产品 退货原因修改
|
|
|
+ // 已选产品 退货原因、备注修改
|
|
|
returnReasonChange (val, record, type) {
|
|
|
- console.log(val, record, type)
|
|
|
const params = {
|
|
|
purchaseReturnApplyDetailSn: record.purchaseReturnApplyDetailSn,
|
|
|
purchaseReturnApplySn: this.$route.params.sn,
|
|
@@ -568,7 +580,7 @@ export default {
|
|
|
this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
- // 批量设置退货原因
|
|
|
+ // 批量设置退货原因弹框
|
|
|
openPlSetReason () {
|
|
|
if (this.selNums) {
|
|
|
this.showPlModal = true
|
|
@@ -576,6 +588,7 @@ export default {
|
|
|
this.$message.warning('请先选择产品!')
|
|
|
}
|
|
|
},
|
|
|
+ // 批量设置
|
|
|
setPlReturnReason () {
|
|
|
if (!this.plReturnReason) {
|
|
|
this.$message.warning('请选择退货原因!')
|
|
@@ -623,6 +636,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 初始化
|
|
|
pageInit () {
|
|
|
this.getDetail(true)
|
|
|
}
|