修改问题

master
sunzehua 1 year ago
parent aa2223977a
commit 800a528b69

@ -1597,58 +1597,6 @@ export default {
this.$message.error('箱量与场站不一致') this.$message.error('箱量与场站不一致')
} }
} }
{
/* const addTable = []
const cntrnoArr = []
this.tableData.map((item, index) => {
if (!item.cntrno) {
this.tableData.splice(index, 1)
} else {
cntrnoArr.push(item.cntrno)
}
})
const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
data.map((item, index) => {
if (cntrnoArr.includes(item.CNTRNO)) {
this.tableData[cntrnoArr.indexOf(item.CNTRNO)] = {
rowKey: lastNum + index,
ctnall: item.CTNALL,
ctnnum: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].ctnnum,
cntrno: item.CNTRNO,
sealno: item.SEALNO,
pkgs: item.PKGS,
kindpkgs: item.KINDPKGS,
kgs: item.KGS,
cbm: item.CBM,
tareweight: item.TAREWEIGHT,
weightype: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].weightype,
weighkgs: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].weighkgs,
weighdate: item.WEIGHDATE
}
} else {
const _data = {
rowKey: lastNum + index,
ctnall: item.CTNALL,
ctnnum: '1',
cntrno: item.CNTRNO,
sealno: item.SEALNO,
pkgs: item.PKGS,
kindpkgs: item.KINDPKGS,
kgs: item.KGS,
cbm: item.CBM,
tareweight: item.TAREWEIGHT,
weightype: '',
weighkgs: '',
weighdate: item.WEIGHDATE
}
addTable.push(_data)
}
})
this.tableData = [...this.tableData, ...addTable]
this.$forceUpdate() */
}
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
} }

@ -1984,7 +1984,9 @@ export default {
item.ediCtn.forEach(ite => { item.ediCtn.forEach(ite => {
arr.push({ arr.push({
cntrno: ite.cntrno, cntrno: ite.cntrno,
pkgs: ite.pkgs pkgs: ite.pkgs,
cbm: ite.cbm,
kgs: ite.kgs
}) })
}) })
} }
@ -1994,35 +1996,81 @@ export default {
item.haveFlag = true item.haveFlag = true
item.pkgsFlag = false item.pkgsFlag = false
arr.forEach(ite => { arr.forEach(ite => {
if (ite.cntrno === item.cntrno && ite.pkgs === item.pkgs) { if (ite.cntrno === item.cntrno && (ite.pkgs == item.pkgs && ite.cbm == item.cbm && ite.kgs == item.kgs)) {
item.haveFlag = false item.haveFlag = false
item.pkgsFlag = false item.pkgsFlag = false
} }
if (ite.cntrno === item.cntrno && ite.pkgs != item.pkgs) { if (ite.cntrno === item.cntrno) {
item.haveFlag = false item.haveFlag = false
item.pkgsFlag = true item.pkgsFlag = false
item.cbmFlag = false
item.kgsFlag = false
if (ite.pkgs != item.pkgs) {
item.pkgsFlag = true
}
if (ite.cbm != item.cbm) {
item.cbmFlag = true
}
if (ite.kgs != item.kgs) {
item.kgsFlag = true
}
} }
}) })
}) })
main.forEach((item, index) => { main.forEach((item, index) => {
delete item.id
delete item.pId
if (item.haveFlag) { if (item.haveFlag) {
$data.ediCtn.push(item) $data.ediCtn.push(item)
} }
if (item.pkgsFlag) { if (item.pkgsFlag || item.cbmFlag || item.kgsFlag) {
let total = 0 if (item.pkgsFlag) {
this.orderList.forEach(ite => { let total = 0
if (ite.isHBL) { this.orderList.forEach(ite => {
ite.ediCtn.forEach(it => { if (ite.isHBL) {
if (it.cntrno === item.cntrno) { ite.ediCtn.forEach(it => {
it.pkgs = Number(it.pkgs) if (it.cntrno === item.cntrno) {
total += it.pkgs it.pkgs = Number(it.pkgs)
} total += it.pkgs
}) }
} })
}) }
const pkgs = Number(item.pkgs) - total })
item.pkgs = pkgs const pkgs = Number(item.pkgs) - total
if (item.pkgs > 0) { item.pkgs = pkgs
}
if (item.cbmFlag) {
let total = 0
this.orderList.forEach(ite => {
if (ite.isHBL) {
ite.ediCtn.forEach(it => {
if (it.cntrno === item.cntrno) {
it.cbm = Number(it.cbm)
total += it.cbm
}
})
}
})
const cbm = Number(item.cbm) - total
item.cbm = cbm
}
if (item.kgsFlag) {
let total = 0
this.orderList.forEach(ite => {
if (ite.isHBL) {
ite.ediCtn.forEach(it => {
if (it.cntrno === item.cntrno) {
it.kgs = Number(it.kgs)
total += it.kgs
}
})
}
})
const kgs = Number(item.kgs) - total
item.kgs = kgs
}
if (item.pkgs > 0 || item.cbm > 0 || item.kgs > 0) {
$data.ediCtn.push(item) $data.ediCtn.push(item)
} }
} }

@ -201,7 +201,7 @@
</a-form-model> </a-form-model>
</div> </div>
<template slot="footer"> <template slot="footer">
<a-button @click="handleSaveActive"> <a-button type="primary" @click="handleSaveActive">
确定 确定
</a-button> </a-button>
<a-button @click="activeFlag = false"> <a-button @click="activeFlag = false">
@ -249,7 +249,7 @@
</a-form-model> </a-form-model>
</div> </div>
<template slot="footer"> <template slot="footer">
<a-button @click="handleSaveSubActive"> <a-button type="primary" @click="handleSaveSubActive">
确定 确定
</a-button> </a-button>
<a-button @click="subActiveFlag = false"> <a-button @click="subActiveFlag = false">
@ -436,6 +436,8 @@ export default {
item.subList = [] item.subList = []
} }
}) })
} else {
res.data.ext.statusSkuList = []
} }
this.form = res.data.ext this.form = res.data.ext
if (!this.form.serviceProject) { if (!this.form.serviceProject) {
@ -630,11 +632,15 @@ export default {
workFlowSaveAndEnable(this.form).then((res) => { workFlowSaveAndEnable(this.form).then((res) => {
this.confirmLoading = false this.confirmLoading = false
if (res.data.succ) { if (res.data.succ) {
this.$message.success('新增成功') if (this.form.pkId) {
this.$message.success('修改成功')
} else {
this.$message.success('新增成功')
}
this.handleCancel() this.handleCancel()
this.$emit('ok') this.$emit('ok')
} else { } else {
this.$message.error('新增失败:' + res.data.msg) this.$message.error(res.data.msg)
} }
}).finally((res) => { }).finally((res) => {
this.confirmLoading = false this.confirmLoading = false
@ -744,6 +750,7 @@ export default {
text-align: center; text-align: center;
background: rgb(184, 53, 137); background: rgb(184, 53, 137);
margin-right: 5px; margin-right: 5px;
color:white;
} }
} }
} }

@ -341,6 +341,7 @@ export default {
ServiceWorkFlowBaseGetPage(data).then(res => { ServiceWorkFlowBaseGetPage(data).then(res => {
if (res.success) { if (res.success) {
this.list = res.data.items this.list = res.data.items
this.pagination.total = res.data.totalCount
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
} }

@ -264,6 +264,7 @@ export default {
ServiceProjectGetPage(data).then(res => { ServiceProjectGetPage(data).then(res => {
if (res.success) { if (res.success) {
this.list = res.data.items this.list = res.data.items
this.pagination.total = res.data.totalCount
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
} }

@ -269,6 +269,7 @@ export default {
StatusSkuBaseGetPage(data).then(res => { StatusSkuBaseGetPage(data).then(res => {
if (res.success) { if (res.success) {
this.list = res.data.items this.list = res.data.items
this.pagination.total = res.data.totalCount
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
} }

Loading…
Cancel
Save