|
@@ -3,10 +3,12 @@
|
|
|
<el-page-header @back="$parent.pageType=0" :content="detailsId?'编辑':'新增'" style=" padding: 20px 20px 0 20px;"
|
|
|
></el-page-header>
|
|
|
<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>
|
|
|
<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>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -25,10 +27,7 @@
|
|
|
<template v-slot:custom="{item:{row,$index}}">
|
|
|
<div>{{ diffQty(row) }}</div>
|
|
|
</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}}">
|
|
|
<el-popconfirm
|
|
|
v-if="dis"
|
|
@@ -78,7 +77,68 @@ export default {
|
|
|
flag: 1,
|
|
|
dis: true,
|
|
|
details: {},
|
|
|
- column: [
|
|
|
+ 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 = [
|
|
|
{
|
|
|
prop: 'materialName',
|
|
|
label: '产品名称',
|
|
@@ -131,34 +191,7 @@ export default {
|
|
|
isInput: true,
|
|
|
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.customerNumber = res.data.materialId
|
|
|
- })
|
|
|
- } else {
|
|
|
- Object.assign(this.$data, this.$options.data())
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -175,14 +208,13 @@ export default {
|
|
|
},
|
|
|
confirm(selected) {
|
|
|
// console.log(selected)
|
|
|
- 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 < selected.length; j++) {
|
|
|
- if ( this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == selected[j].id){
|
|
|
+ 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.$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)
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -203,9 +235,9 @@ export default {
|
|
|
},
|
|
|
handleDel(item, index) {
|
|
|
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
|
|
|
}
|
|
|
})
|
|
@@ -223,11 +255,11 @@ export default {
|
|
|
delChange() {
|
|
|
if (this.dataList.length) {
|
|
|
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++) {
|
|
|
- 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
|
|
|
- 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)
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -272,6 +304,37 @@ export default {
|
|
|
|
|
|
// this.$parent.pageType = 0
|
|
|
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()
|
|
|
})
|
|
|
|