|
|
@ -15,7 +15,8 @@ |
|
|
|
:class="[{'active-pck':activePkg == item.PackOrderId}]">{{item.PackOrderId}}</li> |
|
|
|
</ul> |
|
|
|
<div style="width:100%; height:10px;background:#F1F3FA" /> |
|
|
|
<div class="package open">打开包装</div> |
|
|
|
<div class="package open" |
|
|
|
@click="openPkg">打开包装</div> |
|
|
|
<div class="package" |
|
|
|
@click="selfClosePkg">关闭包装</div> |
|
|
|
</div> |
|
|
@ -73,6 +74,30 @@ |
|
|
|
<div style="background: #F5F7FC; border-radius: 4px; margin: 8px; color: #fff;text-align:center"> </div> |
|
|
|
</div> |
|
|
|
</footer> |
|
|
|
<el-dialog title="选择模板" |
|
|
|
width="60%" |
|
|
|
:visible.sync="isVisible"> |
|
|
|
<el-table ref="singleTable" |
|
|
|
:data="tempData" |
|
|
|
highlight-current-row |
|
|
|
@current-change="handleCurrentChange" |
|
|
|
style="width: 100%"> |
|
|
|
<el-table-column v-for="item in temHeaders" |
|
|
|
:key="item" |
|
|
|
:label="getColumnName(`${item}`)" |
|
|
|
show-overflow-tooltip> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{scope.row[item]}}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<div slot="footer" |
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="isVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
@click="completeCreatePkg">确 定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
@ -102,6 +127,16 @@ export default { |
|
|
|
codeRules: [], //扫码规则 |
|
|
|
autofocus: true, |
|
|
|
showInput: true, |
|
|
|
isVisible: false, |
|
|
|
tempData: [], |
|
|
|
temHeaders: [ |
|
|
|
'LOG_PackTemplate-PackTypeId', |
|
|
|
'LOG_PackTemplate-PackOrderSn', |
|
|
|
'LOG_PackTemplate-BoxSn', |
|
|
|
'LOG_PackTemplate-Descr', |
|
|
|
], |
|
|
|
chooseTemRow: {}, |
|
|
|
artId: '', |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
@ -123,7 +158,6 @@ export default { |
|
|
|
res.data.forEach((element) => { |
|
|
|
element.PackOrderId = element['LOG_PackOrder-PackOrderId'] |
|
|
|
}) |
|
|
|
this.getColumn(res.data[0].PackOrderId) |
|
|
|
} |
|
|
|
this.pkgs = res.data |
|
|
|
this.loading = false |
|
|
@ -184,7 +218,20 @@ export default { |
|
|
|
}, |
|
|
|
// 关闭包装 |
|
|
|
closePkg(isSelf = false) { |
|
|
|
api.closePkg(this.activePkg).then((res) => { |
|
|
|
let params = [this.activePkg] |
|
|
|
// 短包 |
|
|
|
if (isSelf) { |
|
|
|
let isCom = [] |
|
|
|
this.tableData.forEach((item) => { |
|
|
|
if (item.status == 0) { |
|
|
|
isCom.push(item['LOG_PackOrderItemlst-Pos']) |
|
|
|
} |
|
|
|
}) |
|
|
|
params.push(isCom) |
|
|
|
} else { |
|
|
|
params.push([]) |
|
|
|
} |
|
|
|
api.closePkg(params).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.pkgs = this.pkgs.filter( |
|
|
|
(pkg) => pkg.PackOrderId != this.activePkg |
|
|
@ -275,7 +322,7 @@ export default { |
|
|
|
if (isCom && isCom.length) { |
|
|
|
this.$message({ |
|
|
|
type: 'error', |
|
|
|
message: `条码${code}重复!`, |
|
|
|
message: `条码${code}已入包装!`, |
|
|
|
showClose: true, |
|
|
|
}) |
|
|
|
} else if (unCom && unCom.length) { |
|
|
@ -379,11 +426,51 @@ export default { |
|
|
|
}, |
|
|
|
// 创建新包装 |
|
|
|
createPkg(code) { |
|
|
|
api.createPkg([code]).then((res) => { |
|
|
|
if (res.data) { |
|
|
|
if (res.data.length == 1) { |
|
|
|
this.tempData = res.data |
|
|
|
this.chooseTemRow = res.data[0] |
|
|
|
this.completeCreatePkg() |
|
|
|
} else { |
|
|
|
this.tempData = res.data |
|
|
|
this.isVisible = true |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 打开包装 |
|
|
|
openPkg() { |
|
|
|
this.$prompt('扫描条码', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
}) |
|
|
|
.then(({ value }) => { |
|
|
|
let code = this.getRuleCode(value) |
|
|
|
// code = 'ART100' |
|
|
|
this.artId = code |
|
|
|
this.createPkg(code) |
|
|
|
}) |
|
|
|
.catch(() => {}) |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { |
|
|
|
this.chooseTemRow = val |
|
|
|
}, |
|
|
|
completeCreatePkg() { |
|
|
|
api |
|
|
|
.createPkg({ |
|
|
|
code: code, |
|
|
|
.openpackorderwithtemplate([ |
|
|
|
this.artId, |
|
|
|
this.chooseTemRow['LOG_PackTemplate-PackTemplateId'], |
|
|
|
]) |
|
|
|
.then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
this.isVisible = false |
|
|
|
this.tempData = [] |
|
|
|
this.chooseTemRow = {} |
|
|
|
this.artId = '' |
|
|
|
this.getPackorder() |
|
|
|
} |
|
|
|
}) |
|
|
|
.then((res) => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
@ -446,12 +533,12 @@ li { |
|
|
|
.pkg-list-left { |
|
|
|
margin: 0 10px 10px 0; |
|
|
|
padding: 10px 0 0 10px; |
|
|
|
width: 30%; |
|
|
|
width: 20%; |
|
|
|
height: calc(65vh); |
|
|
|
background: #ffffff; |
|
|
|
} |
|
|
|
.pkg-list-right { |
|
|
|
width: 70%; |
|
|
|
width: 80%; |
|
|
|
height: 65vh; |
|
|
|
background: #ffffff; |
|
|
|
padding: 10px; |
|
|
|