|
@@ -3,12 +3,10 @@
|
|
<el-page-header @back="$parent.pageType=0" :content="detailsId?'编辑':'新增'" style=" padding: 20px 20px 0 20px;"
|
|
<el-page-header @back="$parent.pageType=0" :content="detailsId?'编辑':'新增'" style=" padding: 20px 20px 0 20px;"
|
|
></el-page-header>
|
|
></el-page-header>
|
|
<return-sales-header ref="header" :details="details" />
|
|
<return-sales-header ref="header" :details="details" />
|
|
- <sales-table :dataList="dataList" :column="column" :isOperation="detailsId?false:true" isSelection
|
|
|
|
- @handleSelection="handleSelection"
|
|
|
|
- >
|
|
|
|
|
|
+ <sales-table :dataList="dataList" :column="column" :isOperation="detailsId?false:true" isSelection @handleSelection="handleSelection">
|
|
<template #bts>
|
|
<template #bts>
|
|
<div v-if="!detailsId">
|
|
<div v-if="!detailsId">
|
|
- <el-button type="primary" v-if="dis" size="mini" @click="dialogVisible=true">添加</el-button>
|
|
|
|
|
|
+ <el-button type="primary" v-if="dis" size="mini" @click="dialogVisible=true">添加</el-button>
|
|
<el-button type="danger" v-if="dis" size="mini" @click="delChange">删除</el-button>
|
|
<el-button type="danger" v-if="dis" size="mini" @click="delChange">删除</el-button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -16,7 +14,7 @@
|
|
<div v-if="!detailsId">
|
|
<div v-if="!detailsId">
|
|
<el-button type="primary" :disabled="!dis" size="mini" @click="handelSubmit(1)">提交</el-button>
|
|
<el-button type="primary" :disabled="!dis" size="mini" @click="handelSubmit(1)">提交</el-button>
|
|
<el-button size="mini" @click="onReset" v-if="dis">重置</el-button>
|
|
<el-button size="mini" @click="onReset" v-if="dis">重置</el-button>
|
|
- <el-button size="mini" :disabled="dis" @click="handleInform(2)">退货通知</el-button>
|
|
|
|
|
|
+ <el-button size="mini" v-if="isFront!==false" :disabled="dis" @click="handleInform(2)">退货通知</el-button>
|
|
</div>
|
|
</div>
|
|
<div v-else>
|
|
<div v-else>
|
|
<el-button type="primary" size="mini" @click="handelSubmit(2)">保存</el-button>
|
|
<el-button type="primary" size="mini" @click="handelSubmit(2)">保存</el-button>
|
|
@@ -27,7 +25,10 @@
|
|
<template v-slot:custom="{item:{row,$index}}">
|
|
<template v-slot:custom="{item:{row,$index}}">
|
|
<div>{{ diffQty(row) }}</div>
|
|
<div>{{ diffQty(row) }}</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
|
|
+ <template v-slot:custom="{item:{row,$index}}">
|
|
|
|
+ <el-radio label="1" v-model="row.flag">增加</el-radio>
|
|
|
|
+ <el-radio label="-1" v-model="row.flag">减少</el-radio>
|
|
|
|
+ </template>
|
|
<template v-slot:operation="{item:{row,$index}}">
|
|
<template v-slot:operation="{item:{row,$index}}">
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
v-if="dis"
|
|
v-if="dis"
|
|
@@ -39,7 +40,7 @@
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
</template>
|
|
</template>
|
|
</sales-table>
|
|
</sales-table>
|
|
- <sales-dialog ref="dia" :dialogVisible="dialogVisible" :customerNumber="customerNumber" :func="getDialogList"
|
|
|
|
|
|
+ <sales-dialog ref="dia" :dialogVisible="dialogVisible" :returnId="returnId" :func="getDialogList"
|
|
@confirm="confirm"
|
|
@confirm="confirm"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
@@ -71,74 +72,13 @@ export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
- customerNumber: '',
|
|
|
|
|
|
+ returnId: '',
|
|
dataList: [],
|
|
dataList: [],
|
|
selection: [],
|
|
selection: [],
|
|
flag: 1,
|
|
flag: 1,
|
|
dis: true,
|
|
dis: true,
|
|
details: {},
|
|
details: {},
|
|
- column: [],
|
|
|
|
- isFront: JSON.parse(localStorage.getItem('supply_user')).isFront,
|
|
|
|
- salesId: ''
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- diffQty() {
|
|
|
|
- return (row) => {
|
|
|
|
- return Number(row.qty) - Number(row.refundQty)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- created() {
|
|
|
|
- if (this.detailsId) {
|
|
|
|
- this.column = [
|
|
|
|
- {
|
|
|
|
- prop: 'materialName',
|
|
|
|
- label: '产品名称',
|
|
|
|
- width: '180'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'materialCode',
|
|
|
|
- label: '物料编码',
|
|
|
|
- width: '180'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'specification',
|
|
|
|
- label: '规格型号',
|
|
|
|
- width: '300'
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
- prop: 'refundQty',
|
|
|
|
- align: 'left',
|
|
|
|
- label: '退货数量',
|
|
|
|
- width: '180',
|
|
|
|
- isInput: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'notes',
|
|
|
|
- label: '备注',
|
|
|
|
- width: '180',
|
|
|
|
- isInput: true,
|
|
|
|
- type: 'text'
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
-
|
|
|
|
- detailRefund({ id: this.detailsId }).then(res => {
|
|
|
|
- this.dataList = res.data.orders
|
|
|
|
- this.details = res.data
|
|
|
|
- this.dataList.forEach(k => {
|
|
|
|
-
|
|
|
|
- k.refundQty = k.qty
|
|
|
|
- k.diffQty = Number(k.qty) - Number(k.refundQty || 0)
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- this.details.customerOrderNo = res.data.customerOrderNo
|
|
|
|
- this.customerNumber = res.data.materialId
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- Object.assign(this.$data, this.$options.data())
|
|
|
|
- this.column = [
|
|
|
|
|
|
+ column: [
|
|
{
|
|
{
|
|
prop: 'materialName',
|
|
prop: 'materialName',
|
|
label: '产品名称',
|
|
label: '产品名称',
|
|
@@ -191,7 +131,34 @@ export default {
|
|
isInput: true,
|
|
isInput: true,
|
|
type: 'text'
|
|
type: 'text'
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
|
|
+ isFront: JSON.parse(localStorage.getItem('supply_user')).isFront,
|
|
|
|
+ salesId: ''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ diffQty() {
|
|
|
|
+ return (row) => {
|
|
|
|
+ return Number(row.qty) - Number(row.refundQty)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ if (this.detailsId) {
|
|
|
|
+ detailRefund({ id: this.detailsId }).then(res => {
|
|
|
|
+ this.dataList = res.data.orders
|
|
|
|
+ this.details = res.data
|
|
|
|
+ this.dataList.forEach(k => {
|
|
|
|
+
|
|
|
|
+ k.refundQty=k.qty
|
|
|
|
+ k.diffQty = Number(k.qty) - Number(k.refundQty||0)
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ this.details.customerOrderNo = res.data.customerOrderNo
|
|
|
|
+ this.returnId = res.data.id
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ Object.assign(this.$data, this.$options.data())
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -208,43 +175,41 @@ export default {
|
|
},
|
|
},
|
|
confirm(selected) {
|
|
confirm(selected) {
|
|
// console.log(selected)
|
|
// console.log(selected)
|
|
- for (let i = 0; i < this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length; i++) {
|
|
|
|
- for (let j = 0; j < selected.length; j++) {
|
|
|
|
- if (this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == selected[j].id) {
|
|
|
|
- // k.disabled = true
|
|
|
|
- this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', false)
|
|
|
|
- } else {
|
|
|
|
- this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', true)
|
|
|
|
-
|
|
|
|
|
|
+ this.dataList = [...this.dataList, ...selected]
|
|
|
|
+ for (let i = 0; i <this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length ; i++) {
|
|
|
|
+ for (let j = 0; j < this.dataList.length; j++) {
|
|
|
|
+ if ( this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == this.dataList[j].id || this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].disabled ===false){
|
|
|
|
+ this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i],'disabled',false)
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i],'disabled',true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
selected.forEach(k => {
|
|
selected.forEach(k => {
|
|
k.diffQty = Number(k.qty) - Number(k.refundQty)
|
|
k.diffQty = Number(k.qty) - Number(k.refundQty)
|
|
})
|
|
})
|
|
- this.dataList = [...this.dataList, ...selected]
|
|
|
|
if (!this.detailsId) {
|
|
if (!this.detailsId) {
|
|
this.details = this.dataList[0]
|
|
this.details = this.dataList[0]
|
|
this.details.customerOrderNo = this.dataList[0].id
|
|
this.details.customerOrderNo = this.dataList[0].id
|
|
}
|
|
}
|
|
this.detailsId = this.detailsId
|
|
this.detailsId = this.detailsId
|
|
- this.customerNumber = this.dataList[0].customerNumber
|
|
|
|
|
|
+ this.returnId = this.dataList[0].id
|
|
this.dialogVisible = false
|
|
this.dialogVisible = false
|
|
this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.$refs.tableView.clearSelection()
|
|
this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.$refs.tableView.clearSelection()
|
|
|
|
|
|
},
|
|
},
|
|
handleDel(item, index) {
|
|
handleDel(item, index) {
|
|
this.dataList.splice(index, 1)
|
|
this.dataList.splice(index, 1)
|
|
- this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.find(k => {
|
|
|
|
- if (k.id == item.id) {
|
|
|
|
- this.$set(k, 'disabled', true)
|
|
|
|
|
|
+ this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.find(k=>{
|
|
|
|
+ if (k.id==item.id){
|
|
|
|
+ this.$set(k,'disabled',true)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
})
|
|
})
|
|
// if (!this.dataList.length){
|
|
// if (!this.dataList.length){
|
|
// this.$nextTick(()=>{
|
|
// this.$nextTick(()=>{
|
|
// this.details = {}
|
|
// this.details = {}
|
|
- // this.customerNumber = ''
|
|
|
|
|
|
+ // this.returnId = ''
|
|
// })
|
|
// })
|
|
// }
|
|
// }
|
|
},
|
|
},
|
|
@@ -255,17 +220,17 @@ export default {
|
|
delChange() {
|
|
delChange() {
|
|
if (this.dataList.length) {
|
|
if (this.dataList.length) {
|
|
this.dataList = this.resArr(this.dataList, this.selection)
|
|
this.dataList = this.resArr(this.dataList, this.selection)
|
|
- for (let i = 0; i < this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length; i++) {
|
|
|
|
|
|
+ for (let i = 0; i <this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length ; i++) {
|
|
for (let j = 0; j < this.selected.length; j++) {
|
|
for (let j = 0; j < this.selected.length; j++) {
|
|
- if (this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == this.selected[j].id) {
|
|
|
|
|
|
+ if ( this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == this.selected[j].id){
|
|
// k.disabled = true
|
|
// k.disabled = true
|
|
- this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', true)
|
|
|
|
|
|
+ this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i],'disabled',true)
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!this.dataList.length) {
|
|
if (!this.dataList.length) {
|
|
- this.customerNumber = ''
|
|
|
|
|
|
+ this.returnId = ''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -283,11 +248,11 @@ export default {
|
|
for (let i = 0; i < this.dataList.length; i++) {
|
|
for (let i = 0; i < this.dataList.length; i++) {
|
|
this.dataList[i].id = ''
|
|
this.dataList[i].id = ''
|
|
this.dataList[i].directFlag = this.dataList[i].flag
|
|
this.dataList[i].directFlag = this.dataList[i].flag
|
|
- this.dataList[i].qty = this.dataList[i].refundQty
|
|
|
|
if (Number(this.dataList[i].refundQty) < 0 || !this.dataList[i].refundQty) {
|
|
if (Number(this.dataList[i].refundQty) < 0 || !this.dataList[i].refundQty) {
|
|
this.$errorMsg(`第${i + 1}产品退货数量有误`)
|
|
this.$errorMsg(`第${i + 1}产品退货数量有误`)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ this.dataList[i].qty = this.dataList[i].refundQty
|
|
}
|
|
}
|
|
|
|
|
|
const params = {
|
|
const params = {
|
|
@@ -304,37 +269,6 @@ export default {
|
|
|
|
|
|
// this.$parent.pageType = 0
|
|
// this.$parent.pageType = 0
|
|
this.dis = false
|
|
this.dis = false
|
|
- this.column = [
|
|
|
|
- {
|
|
|
|
- prop: 'materialName',
|
|
|
|
- label: '产品名称',
|
|
|
|
- width: '180'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'materialCode',
|
|
|
|
- label: '物料编码',
|
|
|
|
- width: '180'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'specification',
|
|
|
|
- label: '规格型号',
|
|
|
|
- width: '300'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'refundQty',
|
|
|
|
- align: 'left',
|
|
|
|
- label: '退货数量',
|
|
|
|
- width: '180',
|
|
|
|
- isInput: true
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- prop: 'notes',
|
|
|
|
- label: '备注',
|
|
|
|
- width: '180',
|
|
|
|
- isInput: true,
|
|
|
|
- type: 'text'
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
})
|
|
})
|
|
|
|
|