|
|
@ -28,7 +28,7 @@ |
|
|
|
</view> |
|
|
|
<view class="cell_info"> |
|
|
|
<view class="text_lightblue">班次</view> |
|
|
|
<view style="line-height: 32rpx;" > |
|
|
|
<view style="line-height: 32rpx;"> |
|
|
|
{{jobContent.shiftName}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -36,19 +36,23 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="page-main"> |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<comProductDetailCardBatch :dataContent="item" :settingParam="jobContent" :isShowLocation="false" |
|
|
|
@remove="updateData" @updateData="updateData" :isNumTips='false' |
|
|
|
:locationAreaTypeList='toLocationAreaTypeList' v-if="managementType=='BY_BATCH'"> |
|
|
|
</comProductDetailCardBatch> |
|
|
|
<comProductDetailCard :dataContent="item" :settingParam="jobContent" :isShowLocation="false" |
|
|
|
@remove="updateData" @updateData="updateData" |
|
|
|
:locationAreaTypeList='toLocationAreaTypeList' v-else> |
|
|
|
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' |
|
|
|
v-if="item.manageType=='BY_PACKAGING'"> |
|
|
|
</comProductDetailCard> |
|
|
|
<comProductDetailCardBatch :dataContent="item" :settingParam="jobContent" |
|
|
|
:isShowLocation="false" @remove="updateData" @updateData="updateData" :isNumTips='false' |
|
|
|
:locationAreaTypeList='toLocationAreaTypeList' v-if="item.manageType=='BY_BATCH'"> |
|
|
|
</comProductDetailCardBatch> |
|
|
|
|
|
|
|
<comProductDetailCardQty :dataContent="item" :settingParam="jobContent" :isShowLocation="false" |
|
|
|
@remove="updateData" @updateData="updateData" :locationAreaTypeList='toLocationAreaTypeList' |
|
|
|
v-if="item.manageType=='BY_QUANTITY'"> |
|
|
|
</comProductDetailCardQty> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
@ -70,7 +74,8 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'制品标签'" headerType="HMQ" :isNoSearchPackage='isNoSearchPackage'></win-scan-pack> |
|
|
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult' :title="'制品标签'" headerType="HMQ" |
|
|
|
:isNoSearchPackage='isNoSearchPackage'></win-scan-pack> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -90,7 +95,7 @@ |
|
|
|
import { |
|
|
|
goHome, |
|
|
|
navigateBack, |
|
|
|
getPackingNumberAndBatch, |
|
|
|
getPackingNumberAndBatch, |
|
|
|
getSwitchInfoByCode |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
@ -117,6 +122,7 @@ |
|
|
|
import jobTop from '@/mycomponents/job/jobTop.vue' |
|
|
|
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue" |
|
|
|
import comProductDetailCardBatch from "@/pages/productReceipt/coms/comProductDetailCardBatch.vue" |
|
|
|
import comProductDetailCardQty from "@/pages/productReceipt/coms/comProductDetailCardQty.vue" |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
@ -127,8 +133,9 @@ |
|
|
|
locationCompare, |
|
|
|
winScanPack, |
|
|
|
jobTop, |
|
|
|
comProductDetailCard, |
|
|
|
comProductDetailCardBatch |
|
|
|
comProductDetailCard, |
|
|
|
comProductDetailCardBatch, |
|
|
|
comProductDetailCardQty |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -142,13 +149,13 @@ |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
toLocationAreaTypeList: [], |
|
|
|
managementList: [], |
|
|
|
managementType:'', |
|
|
|
managementType: '', |
|
|
|
jobStatus: "", |
|
|
|
jobToLocationCode: "", |
|
|
|
status: '', |
|
|
|
scanMessage: "", |
|
|
|
productionLineCode: "", |
|
|
|
isNoSearchPackage:false |
|
|
|
isNoSearchPackage: false |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -159,7 +166,7 @@ |
|
|
|
this.id = option.id; |
|
|
|
this.scanMessage = option.scanMessage; |
|
|
|
this.status = option.status || '' |
|
|
|
this.isNoSearchPackage=option.isNoSearchPackage |
|
|
|
this.isNoSearchPackage = option.isNoSearchPackage |
|
|
|
|
|
|
|
}, |
|
|
|
onShow() { |
|
|
@ -233,16 +240,16 @@ |
|
|
|
} else { |
|
|
|
if (res.data.subList.length > 0) { |
|
|
|
that.jobContent = res.data; |
|
|
|
console.log(344,that.jobContent.allowModifyLocation) |
|
|
|
console.log(344, that.jobContent.allowModifyLocation) |
|
|
|
that.subList = res.data.subList; |
|
|
|
that.jobStatus = res.data.status; |
|
|
|
that.jobToLocationCode = that.subList[0].toLocationCode; |
|
|
|
that.productionLineCode = that.jobContent.subList[0].productionLineCode; |
|
|
|
var valiDate = getSwitchInfoByCode("semiProductReceipCommitValidate") |
|
|
|
if(valiDate){ |
|
|
|
that.jobContent.allowModifyLocation = 'TRUE' |
|
|
|
}else{ |
|
|
|
that.jobContent.allowModifyLocation = 'FALSE' |
|
|
|
that.productionLineCode = that.jobContent.subList[0].productionLineCode; |
|
|
|
var valiDate = getSwitchInfoByCode("semiProductReceipCommitValidate") |
|
|
|
if (valiDate) { |
|
|
|
that.jobContent.allowModifyLocation = 'TRUE' |
|
|
|
} else { |
|
|
|
that.jobContent.allowModifyLocation = 'FALSE' |
|
|
|
} |
|
|
|
that.toLocationCode = that.subList[0].toLocationCode |
|
|
|
that.toLocationAreaTypeList = getDirectoryItemArray(that.jobContent.toAreaTypes) |
|
|
@ -259,8 +266,18 @@ |
|
|
|
getManagementPrecisions(itemCodes, that.jobToLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
this.managementType = this.managementList.some(item => item.ManagementPrecision == |
|
|
|
'BY_BATCH') ? 'BY_BATCH' : '' |
|
|
|
//赋值管理精度 |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
var manageInfo = this.managementList.find(r => |
|
|
|
r.itemCode == item.itemCode) |
|
|
|
if (manageInfo) { |
|
|
|
item.manageType = manageInfo |
|
|
|
.ManagementPrecision |
|
|
|
} else { |
|
|
|
item.manageType = "BY_BATCH" |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
@ -279,57 +296,102 @@ |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
const res1 = await getNumberForStatus(result.label.requestNumber) |
|
|
|
if(res1.data == 5){ |
|
|
|
uni.hideLoading() |
|
|
|
if (res1.data == 5) { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(`该品番对应的申请【${result.label.requestNumber}】已关闭`) |
|
|
|
return |
|
|
|
}else if(res1.data == 8){ |
|
|
|
uni.hideLoading() |
|
|
|
} else if (res1.data == 8) { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(`该品番对应的生产任务【${result.label.requestNumber}】已经完成`) |
|
|
|
return |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
uni.hideLoading() |
|
|
|
let label = result.label; |
|
|
|
var packingNumber = label.packingNumber; |
|
|
|
var batch = label.batch; |
|
|
|
var qty = label.qty; |
|
|
|
var itemCode = label.itemCode; |
|
|
|
|
|
|
|
|
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
if (detail == undefined) { |
|
|
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
//获取管理精度 批次,数量,包装 |
|
|
|
detail.scaned = true |
|
|
|
var itemDetail = detail.subList.find(r => |
|
|
|
r.batch == batch); |
|
|
|
if (itemDetail == undefined) { |
|
|
|
this.showErrorMessage("批次[" + batch + "]不在任务列表中") |
|
|
|
} else { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
// this.showErrorMessage("批次[" + batch + "]已经扫描") |
|
|
|
itemDetail.handleQty = calc.add(Number(result.label.qty),itemDetail.handleQty); |
|
|
|
var itemDetail; |
|
|
|
//如果是包装管理,需要包装参与判断 |
|
|
|
if (detail.manageType == "BY_PACKAGING") { |
|
|
|
itemDetail = detail.subList.find(r => |
|
|
|
r.itemCode == itemCode && |
|
|
|
r.batch == batch && |
|
|
|
r.packingNumber == packingNumber); |
|
|
|
if (itemDetail) { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
this.showErrorMessage("包装[" + packingNumber + "]" + "批次[" + batch + "]不在任务列表中") |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
|
// itemDetail.toLocationCode = this.toLocationCode; |
|
|
|
itemDetail.labelQty = Number(result.label.qty); |
|
|
|
this.continueScan() |
|
|
|
this.$forceUpdate() |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
|
// itemDetail.toLocationCode = this.toLocationCode; |
|
|
|
itemDetail.labelQty = Number(result.label.qty); |
|
|
|
this.continueScan() |
|
|
|
this.$forceUpdate() |
|
|
|
this.showErrorMessage("包装[" + packingNumber + "]" + "批次[" + batch + "]不在任务列表中") |
|
|
|
} |
|
|
|
|
|
|
|
} else if (detail.manageType == "BY_BATCH") { |
|
|
|
itemDetail = detail.subList.find(r => |
|
|
|
r.itemCode == itemCode && |
|
|
|
r.batch == batch); |
|
|
|
if (itemDetail) { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
itemDetail.handleQty = calc.add(Number(result.label.qty), itemDetail.handleQty); |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
|
itemDetail.labelQty = Number(result.label.qty); |
|
|
|
this.continueScan() |
|
|
|
this.$forceUpdate() |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
} else { |
|
|
|
this.showErrorMessage("批次[" + batch + "]不在任务列表中") |
|
|
|
} |
|
|
|
|
|
|
|
} else if (detail.manageType == "BY_QUANTITY") { |
|
|
|
itemDetail = detail.subList.find(r => |
|
|
|
r.itemCode == itemCode); |
|
|
|
if (itemDetail) { |
|
|
|
if (itemDetail.scaned) { |
|
|
|
itemDetail.handleQty = calc.add(Number(result.label.qty), itemDetail.handleQty); |
|
|
|
} else { |
|
|
|
itemDetail.scaned = true; |
|
|
|
itemDetail.handleQty = Number(result.label.qty); |
|
|
|
itemDetail.labelQty = Number(result.label.qty); |
|
|
|
this.continueScan() |
|
|
|
this.$forceUpdate() |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
} else { |
|
|
|
this.showErrorMessage("包装[" + packingNumber + "]" + "批次[" + batch + "]不在任务列表中") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//继续扫描 |
|
|
|
continueScan() { |
|
|
|
this.scanCount = getScanCount(this.subList); |
|
|
|
if (this.scanCount == this.subList.length) { |
|
|
|
this.closeScanPopup(); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
// this.scanCount = getScanCount(this.subList); |
|
|
|
// if (this.scanCount == this.subList.length) { |
|
|
|
// this.closeScanPopup(); |
|
|
|
// } else { |
|
|
|
// this.scanPopupGetFocus(); |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -376,20 +438,20 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async commit() { |
|
|
|
async commit() { |
|
|
|
this.scanCount = getScanCount(this.subList); |
|
|
|
if (this.scanCount == 0) { |
|
|
|
this.showErrorMessage("扫描数为0,请先扫描") |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
var valiDate = getSwitchInfoByCode("semiProductReceipCommitValidate") |
|
|
|
//校验库位、 |
|
|
|
if(valiDate){ |
|
|
|
if (!this.checkLocation()) { |
|
|
|
return |
|
|
|
} |
|
|
|
}else{ |
|
|
|
this.toLocationCode = this.jobToLocationCode |
|
|
|
//校验库位、 |
|
|
|
if (valiDate) { |
|
|
|
if (!this.checkLocation()) { |
|
|
|
return |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.toLocationCode = this.jobToLocationCode |
|
|
|
} |
|
|
|
//获取管理模式,封装参数 |
|
|
|
var itemCodes = [] |
|
|
@ -399,16 +461,17 @@ |
|
|
|
await getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
this.managementType = this.managementList&& this.managementList[0]&& this.managementList[0].ManagementPrecision ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING' |
|
|
|
this.managementType = this.managementList && this.managementList[0] && this |
|
|
|
.managementList[0].ManagementPrecision; |
|
|
|
} |
|
|
|
}) |
|
|
|
//扫描数量和任务数量相等,直接提交 |
|
|
|
if (this.scanCount == this.subList.length) { |
|
|
|
if(this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY'){ |
|
|
|
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') { |
|
|
|
if (this.checkCountBatch()) { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
if (this.checkCount()) { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
@ -417,11 +480,11 @@ |
|
|
|
//扫描数量小于任务数量,判断是否允许部分提交 |
|
|
|
if (this.jobContent.allowPartialComplete == "TRUE") { |
|
|
|
//提交 |
|
|
|
if(this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY'){ |
|
|
|
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') { |
|
|
|
if (this.checkCountBatch()) { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
if (this.checkCount()) { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
@ -445,7 +508,8 @@ |
|
|
|
var subItem = item.subList[i] |
|
|
|
if (calc.sub(subItem.handleQty, subItem.qty) < 0) { |
|
|
|
isCheck = false; |
|
|
|
hint = "包装【" + subItem.packingNumber + "】实际收货数量:[" + subItem.handleQty + "]与包装数量[" + subItem.qty + |
|
|
|
hint = "包装【" + subItem.packingNumber + "】实际收货数量:[" + subItem.handleQty + "]与包装数量[" + subItem |
|
|
|
.qty + |
|
|
|
"]不相等,是否继续收货?" |
|
|
|
break |
|
|
|
} |
|
|
@ -462,42 +526,42 @@ |
|
|
|
return isCheck; |
|
|
|
|
|
|
|
}, |
|
|
|
checkCountBatch(){ |
|
|
|
var isCheck = true; |
|
|
|
var hint = "" |
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
|
var item = this.detailSource[i]; |
|
|
|
let handleQty = 0 |
|
|
|
for (var j = 0; j < item.subList.length; j++) { |
|
|
|
checkCountBatch() { |
|
|
|
var isCheck = true; |
|
|
|
var hint = "" |
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
|
var item = this.detailSource[i]; |
|
|
|
let handleQty = 0 |
|
|
|
for (var j = 0; j < item.subList.length; j++) { |
|
|
|
var subItem = item.subList[j] |
|
|
|
handleQty = calc.add(handleQty,subItem.handleQty) |
|
|
|
handleQty = calc.add(handleQty, subItem.handleQty) |
|
|
|
} |
|
|
|
if (parseFloat(handleQty) < parseFloat(item.qty)) { |
|
|
|
hint = "物料号【" + item.itemCode + "】实际收货数量【" + handleQty + "】小于任务的收货数量【" + item.qty + "】,\n" |
|
|
|
isCheck = false; |
|
|
|
} |
|
|
|
// for (var j = 0; j < item.subList.length; j++) { |
|
|
|
// var subItem = item.subList[i] |
|
|
|
// console.log(calc.sub(subItem.handleQty, subItem.qty) ) |
|
|
|
// if (calc.sub(subItem.handleQty, subItem.qty) < 0 || calc.sub(subItem.handleQty, subItem.qty) > 0) { |
|
|
|
// isCheck = false; |
|
|
|
// hint = "批次【" + subItem.batch + "】批次【" + subItem.batch + "】实际收货数量【" + subItem.handleQty + "】小于任务的收货数量【" + subItem.qty + |
|
|
|
// "】,对于未收货部分将创建一个新的收货任务?" |
|
|
|
// break |
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
} |
|
|
|
if(parseFloat(handleQty)<parseFloat(item.qty)){ |
|
|
|
hint = "物料号【" + item.itemCode + "】实际收货数量【" + handleQty + "】小于任务的收货数量【" + item.qty + "】,\n" |
|
|
|
isCheck = false; |
|
|
|
console.log(isCheck) |
|
|
|
if (!isCheck) { |
|
|
|
this.showQuestMessage(hint + '对于未收货部分将创建一个新的收货任务?', res => { |
|
|
|
if (res) { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// for (var j = 0; j < item.subList.length; j++) { |
|
|
|
// var subItem = item.subList[i] |
|
|
|
// console.log(calc.sub(subItem.handleQty, subItem.qty) ) |
|
|
|
// if (calc.sub(subItem.handleQty, subItem.qty) < 0 || calc.sub(subItem.handleQty, subItem.qty) > 0) { |
|
|
|
// isCheck = false; |
|
|
|
// hint = "批次【" + subItem.batch + "】批次【" + subItem.batch + "】实际收货数量【" + subItem.handleQty + "】小于任务的收货数量【" + subItem.qty + |
|
|
|
// "】,对于未收货部分将创建一个新的收货任务?" |
|
|
|
// break |
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
} |
|
|
|
console.log(isCheck) |
|
|
|
if (!isCheck) { |
|
|
|
this.showQuestMessage(hint+'对于未收货部分将创建一个新的收货任务?', res => { |
|
|
|
if (res) { |
|
|
|
this.submitJob(); |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
return isCheck; |
|
|
|
|
|
|
|
return isCheck; |
|
|
|
}, |
|
|
|
submitJob() { |
|
|
|
uni.showLoading({ |
|
|
@ -512,17 +576,16 @@ |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
let params = this.setParams(); |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
productReceiptJobsubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
var hint = "" |
|
|
|
if(params.type=='predict'){ |
|
|
|
hint="提交成功\n生成补给品收货记录\n" +res.data |
|
|
|
}else if(params.type=='assemble'){ |
|
|
|
hint="提交成功\n生成号口品收货记录\n" +res.data |
|
|
|
}else { |
|
|
|
hint="提交成功\n生成收货记录\n" |
|
|
|
if (params.type == 'predict') { |
|
|
|
hint = "提交成功\n生成补给品收货记录\n" + res.data |
|
|
|
} else if (params.type == 'assemble') { |
|
|
|
hint = "提交成功\n生成号口品收货记录\n" + res.data |
|
|
|
} else { |
|
|
|
hint = "提交成功\n生成收货记录\n" |
|
|
|
} |
|
|
|
this.showCommitSuccessMessage(hint) |
|
|
|
} else { |
|
|
|