|
|
@ -38,7 +38,7 @@ |
|
|
|
</view> |
|
|
|
<win-scan-button @goScan='showScanPackagePopup'></win-scan-button> |
|
|
|
</view> |
|
|
|
<win-scan-location ref="scanLocationPopup" title="库位" @getLocation="getFromLocation" |
|
|
|
<win-scan-location ref="scanLocationPopup" title="来源库位" @getLocation="getFromLocation" |
|
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false"> |
|
|
|
</win-scan-pack-and-location> |
|
|
@ -48,7 +48,6 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
import { |
|
|
|
containerBindRecordSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
@ -98,6 +97,7 @@ |
|
|
|
jobContent: {}, //任务内容 |
|
|
|
subList: [], //接口返回的任务subList |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
container: {}, |
|
|
|
containerCode: "", |
|
|
|
businessType: {}, |
|
|
|
fromlocationCode: '', |
|
|
@ -190,38 +190,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
// var packingNumber = result.label.packingNumber; |
|
|
|
// var batch = result.label.batch; |
|
|
|
// var qty = result.label.qty; |
|
|
|
// var itemCode = result.label.itemCode; |
|
|
|
// var pack = result.package; |
|
|
|
// var item = this.detailSource.find(res => { |
|
|
|
// if (res.itemCode == itemCode) { |
|
|
|
// return res |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// if (item == undefined) { |
|
|
|
// var itemp = createItemInfo(result.label, pack); |
|
|
|
// let newDetail = createDetailInfo(result.label, pack); // |
|
|
|
// itemp.subList.push(newDetail); |
|
|
|
// this.detailSource.push(itemp) |
|
|
|
// } else { |
|
|
|
// var detail = item.subList.find(r => { |
|
|
|
// if (r.packingNumber == packingNumber) { |
|
|
|
// return r; |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// if (detail == undefined) { |
|
|
|
// let newDetail = createDetailInfo(result.label, pack); |
|
|
|
// item.subList.push(newDetail); |
|
|
|
// } else { |
|
|
|
// if (detail.scaned == true) { |
|
|
|
// this.showErrorMessage("箱码[" + packingNumber + "批次[" + batch + "]已经在列表中") |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// this.calcHandleQty(); |
|
|
|
// this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
@ -264,8 +232,12 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
uni.showLoading({ |
|
|
|
title: '提交中...', |
|
|
|
mask: true |
|
|
|
}) |
|
|
|
if (this.containerCode == "") { |
|
|
|
this.showMessage("请先选择托码") |
|
|
|
this.showMessage("请扫描托码") |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -274,6 +246,18 @@ |
|
|
|
} |
|
|
|
let params = this.getParams(); |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
containerBindRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成器具绑定记录<br>" + res.data) |
|
|
|
this.clear(); |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getParams() { |
|
|
@ -281,9 +265,10 @@ |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
let params = { |
|
|
|
number: this.containerCode, |
|
|
|
type: 'bind', |
|
|
|
status: 'USED', |
|
|
|
creator: creator |
|
|
|
status: this.container.containerStatus, |
|
|
|
toLocatoinCode: this.fromLocationCode, |
|
|
|
containerType: this.container.type, |
|
|
|
creator: creator, |
|
|
|
}; |
|
|
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
@ -291,11 +276,6 @@ |
|
|
|
if (detail.scaned) { |
|
|
|
detail.containerContentType = 'PACKAGE'; |
|
|
|
detail.contentNumber = detail.packingNumber; |
|
|
|
|
|
|
|
detail.itemCode = detail.itemCode; |
|
|
|
detail.batch = detail.batch; |
|
|
|
detail.inventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
detail.package = null; |
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
@ -305,7 +285,6 @@ |
|
|
|
return params; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
setTimeout(r => { |
|
|
|
this.scanPopupLoseFocus(); |
|
|
@ -329,13 +308,13 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
getContainer(containerInfo) { |
|
|
|
this.container = containerInfo; |
|
|
|
this.containerCode = containerInfo.number; |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.fromLocationCode = ''; |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
@ -347,6 +326,14 @@ |
|
|
|
this.detailSource.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
clear() { |
|
|
|
this.jobContent = {}; |
|
|
|
this.subList = []; |
|
|
|
this.detailSource = []; |
|
|
|
this.containerCode = ''; |
|
|
|
this.fromlocationCode = ''; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|