代码更新

This commit is contained in:
2022-11-27 11:27:27 +08:00
parent cce8d4eb53
commit 17eae55192
9 changed files with 199 additions and 54 deletions

View File

@@ -215,7 +215,7 @@
</template>
</el-table-column>-->
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" show-overflow-tooltip />
<!-- <el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" show-overflow-tooltip />-->
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" show-overflow-tooltip />
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center">
<template scope="scope">
@@ -230,7 +230,7 @@
</el-table-column>
</el-table>
<AddDtl :dialog-show.sync="dtlShow" :open-param="materType" @tableChanged="tableChanged" />
<AddDtl :dialog-show.sync="dtlShow" :open-param="materType" @tableChanged="tableChanged5" />
<MaterDialog :dialog-show.sync="materShow" :mater-opt-code.sync="materType" @setMaterValue="setMaterValue" />
</el-dialog>
</template>
@@ -379,32 +379,52 @@ export default {
})*/
},
tableChanged(rows) {
const tablemap = new Map()
rows.forEach((item) => {
debugger
if (this.form.tableData.length !== 0) {
this.flagnow = false
for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].material_id === item.material_id) {
if (this.form.tableData[i].box_no === item.box_no && this.form.tableData[i].pcsn === item.pcsn) {
this.flagnow = true
}
}
if (!this.flagnow) {
item.edit = true
item.quality_scode = '00'
tablemap.set(item.material_id, item)
this.form.tableData.splice(-1, 0, item)
}
} else {
item.edit = true
item.quality_scode = '00'
tablemap.set(item.material_id, item)
this.form.tableData.splice(-1, 0, item)
}
})
for (const value of tablemap.values()) {
this.form.tableData.push(value)
}
this.form.detail_count = this.form.tableData.length
},
tableChanged5(rows) {
const data = {
'data': rows
}
checkoutbill.queryBox(data).then(res => {
res.forEach((item) => {
debugger
if (this.form.tableData.length !== 0) {
this.flagnow = false
for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].box_no === item.box_no && this.form.tableData[i].pcsn === item.pcsn) {
this.flagnow = true
}
}
if (!this.flagnow) {
item.edit = true
this.form.tableData.splice(-1, 0, item)
}
} else {
item.edit = true
this.form.tableData.splice(-1, 0, item)
}
})
this.form.detail_count = this.form.tableData.length
})
},
setMaterValue(row) {
for (let i = 0; i < this.form.tableData.length; i++) {
if (this.form.tableData[i].material_id === row.material_id) {