|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-page-header @back="handleBack" :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 isSelection @handleSelection="handleSelection">
|
|
|
+ <el-page-header :content="detailsId?'编辑':'新增'" style=" padding: 20px 20px 0 20px;" @back="handleBack" />
|
|
|
+ <return-sales-header ref="header" :details="details" />
|
|
|
+ <sales-table :data-list="dataList" :column="column" is-operation is-selection @handleSelection="handleSelection">
|
|
|
<template #bts>
|
|
|
<div>
|
|
|
<el-button type="primary" size="mini" @click="dialogVisible=true">添加</el-button>
|
|
@@ -22,8 +22,8 @@
|
|
|
|
|
|
</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>
|
|
|
+ <el-radio v-model="row.flag" label="1">增加</el-radio>
|
|
|
+ <el-radio v-model="row.flag" label="-1">减少</el-radio>
|
|
|
</template>
|
|
|
<template v-slot:operation="{item:{row,$index}}">
|
|
|
<el-popconfirm
|
|
@@ -35,7 +35,7 @@
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
</sales-table>
|
|
|
- <sales-dialog :dialogVisible="dialogVisible" :customerNumber="customerNumber" :func="getDialogList" @confirm="confirm" />
|
|
|
+ <sales-dialog :data-list="dataList" :dialog-visible="dialogVisible" :customer-number="customerNumber" :func="getDialogList" @confirm="confirm" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -60,16 +60,16 @@ export default {
|
|
|
SalesTable,
|
|
|
SalesDialog
|
|
|
},
|
|
|
- props:['detailsId','pageType'],
|
|
|
+ props: ['detailsId', 'pageType'],
|
|
|
data() {
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
- customerNumber:'',
|
|
|
+ customerNumber: '',
|
|
|
dataList: [],
|
|
|
selection: [],
|
|
|
- flag:1,
|
|
|
- dis:true,
|
|
|
- details:{},
|
|
|
+ flag: 1,
|
|
|
+ dis: true,
|
|
|
+ details: {},
|
|
|
column: [
|
|
|
{
|
|
|
prop: 'materialName',
|
|
@@ -100,7 +100,7 @@ export default {
|
|
|
{
|
|
|
prop: 'qty',
|
|
|
label: '已退数量',
|
|
|
- width: '180',
|
|
|
+ width: '180'
|
|
|
},
|
|
|
{
|
|
|
prop: 'volume',
|
|
@@ -117,20 +117,20 @@ export default {
|
|
|
label: '备注',
|
|
|
width: '180',
|
|
|
isInput: true,
|
|
|
- type:'text'
|
|
|
+ type: 'text'
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
if (this.detailsId) {
|
|
|
- detailRefund({id:this.detailsId}).then(res=>{
|
|
|
+ detailRefund({ id: this.detailsId }).then(res => {
|
|
|
this.dataList = res.data.orders
|
|
|
this.details = res.data
|
|
|
this.details.customerOrderNo = this.dataList[0].id
|
|
|
- this.customerNumber=this.dataList[0].customerNumber
|
|
|
+ this.customerNumber = this.dataList[0].customerNumber
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
Object.assign(this.$data, this.$options.data())
|
|
|
}
|
|
|
},
|
|
@@ -146,20 +146,19 @@ export default {
|
|
|
this.details = this.dataList[0]
|
|
|
this.details.customerOrderNo = this.dataList[0].id
|
|
|
this.details.id = ''
|
|
|
- this.customerNumber=this.dataList[0].customerNumber
|
|
|
- // this.$refs.header.details.customerName = this.dataList[0].customerName
|
|
|
- // this.$refs.header.details.customerNumber = this.dataList[0].customerNumber
|
|
|
- // this.$refs.header.details.customerNumber = this.dataList[0].pickTime
|
|
|
- // this.$refs.header.details.customerNumber = this.dataList[0].userName
|
|
|
- // this.$refs.header.details.customerNumber = this.dataList[0].phone
|
|
|
- // this.$refs.header.details.customerNumber = this.dataList[0].stockType
|
|
|
+ this.customerNumber = this.dataList[0].customerNumber
|
|
|
+ // this.$refs.header.details.customerName = this.dataList[0].customerName
|
|
|
+ // this.$refs.header.details.customerNumber = this.dataList[0].customerNumber
|
|
|
+ // this.$refs.header.details.customerNumber = this.dataList[0].pickTime
|
|
|
+ // this.$refs.header.details.customerNumber = this.dataList[0].userName
|
|
|
+ // this.$refs.header.details.customerNumber = this.dataList[0].phone
|
|
|
+ // this.$refs.header.details.customerNumber = this.dataList[0].stockType
|
|
|
this.dialogVisible = false
|
|
|
-
|
|
|
},
|
|
|
handleDel(item, index) {
|
|
|
this.dataList.splice(index, 1)
|
|
|
- if (!this.dataList.length){
|
|
|
- this.$nextTick(()=>{
|
|
|
+ if (!this.dataList.length) {
|
|
|
+ this.$nextTick(() => {
|
|
|
this.details = {}
|
|
|
this.customerNumber = ''
|
|
|
})
|
|
@@ -174,8 +173,8 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- if (!this.dataList.length){
|
|
|
- this.$nextTick(()=>{
|
|
|
+ if (!this.dataList.length) {
|
|
|
+ this.$nextTick(() => {
|
|
|
this.details = {}
|
|
|
this.customerNumber = ''
|
|
|
})
|
|
@@ -185,16 +184,16 @@ export default {
|
|
|
this.selection = data
|
|
|
},
|
|
|
|
|
|
- handelSubmit(type,status=1) {
|
|
|
- if (!this.dataList.length){
|
|
|
+ handelSubmit(type, status = 1) {
|
|
|
+ if (!this.dataList.length) {
|
|
|
this.$errorMsg('请添加产品')
|
|
|
return
|
|
|
}
|
|
|
for (let i = 0; i < this.dataList.length; i++) {
|
|
|
this.dataList[i].id = ''
|
|
|
this.dataList[i].directFlag = this.dataList[i].flag
|
|
|
- if (Number(this.dataList[i].refundQty)<0 || !this.dataList[i].refundQty){
|
|
|
- this.$errorMsg(`第${i+1}产品退货数量有误`)
|
|
|
+ if (Number(this.dataList[i].refundQty) < 0 || !this.dataList[i].refundQty) {
|
|
|
+ this.$errorMsg(`第${i + 1}产品退货数量有误`)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -202,31 +201,30 @@ export default {
|
|
|
const params = {
|
|
|
...this.$refs.header.details,
|
|
|
orders: this.dataList,
|
|
|
- customerOrderNo:this.details.customerOrderNo,
|
|
|
+ customerOrderNo: this.details.customerOrderNo,
|
|
|
status
|
|
|
}
|
|
|
- if (type===1){
|
|
|
+ if (type === 1) {
|
|
|
params.id = ''
|
|
|
addRefund(params).then(res => {
|
|
|
this.$successMsg('新增成功')
|
|
|
// this.pageType = 0
|
|
|
- this.dis =false
|
|
|
+ this.dis = false
|
|
|
this.$forceUpdate()
|
|
|
})
|
|
|
-
|
|
|
- }else {
|
|
|
- updateRefund(params).then(res=>{
|
|
|
+ } else {
|
|
|
+ updateRefund(params).then(res => {
|
|
|
this.$successMsg('编辑成功')
|
|
|
this.handleBack()
|
|
|
this.$forceUpdate()
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- handleBack(){
|
|
|
+ handleBack() {
|
|
|
this.$emit('close')
|
|
|
},
|
|
|
- handleInform(status=2){
|
|
|
- sendRefund({id:this.$refs.header.details.id,status})
|
|
|
+ handleInform(status = 2) {
|
|
|
+ sendRefund({ id: this.$refs.header.details.id, status })
|
|
|
}
|
|
|
|
|
|
}
|