|
|
@ -16,7 +16,7 @@ |
|
|
|
@click="selectCurrentClick(item, index)" |
|
|
|
class="pkg-li" |
|
|
|
:class="[activePkg === item.PackOrderId ? 'active-pck' : 'unactive-pkg']"> |
|
|
|
{{item.PackOrderId}} |
|
|
|
{{item.PackOrderId}} {{item['LOG_PackOrder-PackTemplateId']}} |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
@ -145,14 +145,14 @@ export default { |
|
|
|
element.PackOrderId = element['LOG_PackOrder-PackOrderId'] |
|
|
|
}) |
|
|
|
} |
|
|
|
this.pkgs = res.data |
|
|
|
this.pkgs = res.data || [] |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
choosePkg(PackOrderId) { // 扫码后选中包装单 |
|
|
|
this.activePkg = PackOrderId |
|
|
|
this.actPkgObj = this.pkgs.filter((pkg) => pkg.PackOrderId == PackOrderId)[0] || null |
|
|
|
this.packorderitemlst() |
|
|
|
this.actPkgObj = this.pkgs.filter((pkg) => pkg.PackOrderId == PackOrderId)[0] || {} |
|
|
|
this.packorderitemlst() //获取包装单下的包装项 |
|
|
|
this.$nextTick(() => { |
|
|
|
if (this.$refs[`${PackOrderId}`]) |
|
|
|
this.$refs[`${PackOrderId}`][0].scrollIntoView() |
|
|
@ -161,8 +161,15 @@ export default { |
|
|
|
packorderitemlst() { //获取包装单下的包装项 |
|
|
|
this.tableLoading = true |
|
|
|
api.packorderitemlst(this.activePkg).then((res) => { |
|
|
|
this.tableData = res.data |
|
|
|
this.tableData = res.data || [] |
|
|
|
this.tableLoading = false |
|
|
|
// let newPkgsArray = this.tableData.filter((el) => el['LOG_PackOrderItemlst-Status'] !== 80) |
|
|
|
// if (newPkgsArray.length === 0) { |
|
|
|
// this.activePkg = '' |
|
|
|
// this.actPkgObj = {} |
|
|
|
// this.tableData = [] |
|
|
|
// this.getPackorder() |
|
|
|
// } |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkCodeInPkgs(code) { // 校验扫码是否在包装列表中 |
|
|
@ -180,7 +187,11 @@ export default { |
|
|
|
} |
|
|
|
api.checkpackorderitem(params).then((res) => { |
|
|
|
if (res.code === 200) { |
|
|
|
this.packorderitemlst() |
|
|
|
if (res.data == 'close') { |
|
|
|
this.defaultSelectOne() |
|
|
|
} else { |
|
|
|
this.packorderitemlst() // 获取包装单下的包装项 |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -223,17 +234,33 @@ export default { |
|
|
|
} |
|
|
|
this.pkgNum = '' // 条码 |
|
|
|
}, |
|
|
|
// 关闭包装之后,默认选中第一个 |
|
|
|
defaultSelectOne() { |
|
|
|
api.getPackorder().then((res) => { |
|
|
|
if (res.data && res.data.length) { |
|
|
|
res.data.forEach((element) => { |
|
|
|
element.PackOrderId = element['LOG_PackOrder-PackOrderId'] |
|
|
|
}) |
|
|
|
} |
|
|
|
this.pkgs = res.data || [] |
|
|
|
if (this.pkgs.length > 0) { |
|
|
|
this.activePkg = this.pkgs[0]['LOG_PackOrder-PackOrderId'] |
|
|
|
this.actPkgObj = this.pkgs[0] || {} |
|
|
|
this.packorderitemlst() |
|
|
|
} else { |
|
|
|
this.activePkg = '' |
|
|
|
this.actPkgObj = {} |
|
|
|
this.tableData = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
closePkg() { // 关闭包装 |
|
|
|
let params = { |
|
|
|
packOrderId: this.activePkg |
|
|
|
} |
|
|
|
api.closePkg(params).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.pkgs = this.pkgs.filter((pkg) => pkg.PackOrderId != this.activePkg) |
|
|
|
this.msgSuccess(`关闭包装${this.activePkg}!`) |
|
|
|
this.activePkg = '' |
|
|
|
this.actPkgObj = null |
|
|
|
this.tableData = [] |
|
|
|
this.defaultSelectOne() |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -326,7 +353,7 @@ export default { |
|
|
|
width: 100%; |
|
|
|
.pkg-list-left { // 包装列表 |
|
|
|
padding: 10px; |
|
|
|
width: 20%; |
|
|
|
width: 25%; |
|
|
|
height: calc(65vh); |
|
|
|
.pkg-list-info { |
|
|
|
background: #fff; |
|
|
@ -386,7 +413,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
.pkg-list-right { // 包装项列表 |
|
|
|
width: 80%; |
|
|
|
width: 75%; |
|
|
|
margin-top: 10px; |
|
|
|
height: calc(65vh - 10px); |
|
|
|
background: #fff; |
|
|
|