|
@ -8,7 +8,7 @@ |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<com-product-record :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
<com-product-record :dataContent="item" :index="index" |
|
|
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"> |
|
|
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"> |
|
|
</com-product-record> |
|
|
</com-product-record> |
|
|
</view> |
|
|
</view> |
|
@ -17,13 +17,21 @@ |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' |
|
|
|
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
|
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
<view class="page-footer"> |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
|
|
|
<view class="uni-flex uni-row u-col-center"> |
|
|
|
|
|
<text style="font-size: 32rpx;">位置 : </text> |
|
|
|
|
|
<view class="uni-flex u-col-center uni-row" @click="showSelect"> |
|
|
|
|
|
<view class="" style="margin-left: 20rpx;"> |
|
|
|
|
|
{{positionInfo}} |
|
|
|
|
|
</view> |
|
|
|
|
|
<u-select v-model="show" mode="mutil-column-auto" :list="positionList" |
|
|
|
|
|
@confirm="confirmSelect"></u-select> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class=" uni-flex uni-row"> |
|
|
<view class=" uni-flex uni-row"> |
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
@ -33,18 +41,23 @@ |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult' title="制品标签"></win-scan-pack> |
|
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult' title="制品标签" headerType="HMQ"></win-scan-pack> |
|
|
<com-message ref="comMessage"></com-message> |
|
|
<com-message ref="comMessage"></com-message> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
productionReceiptRecordSubmit |
|
|
productionReceiptRecordSubmit, |
|
|
|
|
|
getWorkShopLineStation |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
goHome |
|
|
getPrecisionStrategyList |
|
|
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
import { |
|
|
|
|
|
goHome, |
|
|
|
|
|
getPackingNumberAndBatchByList |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -74,15 +87,26 @@ |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
jobContent: {}, //任务内容 |
|
|
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
toLocationTypeList: [], |
|
|
toLocationTypeList: [], |
|
|
toLocationInfo: {}, |
|
|
toLocationInfo: {}, |
|
|
toLocationCode: "", |
|
|
toLocationCode: "", |
|
|
fromLocationTypeList: [], |
|
|
fromLocationTypeList: [], |
|
|
fromLocationInfo: {}, |
|
|
|
|
|
fromLocationCode: "", |
|
|
fromLocationCode: "", |
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
|
|
|
dataContent:{}, |
|
|
|
|
|
managementList:[], |
|
|
|
|
|
show:false, |
|
|
|
|
|
positionInfo:"请选择位置", |
|
|
|
|
|
positionList:[], |
|
|
|
|
|
productionLineCode:'', |
|
|
|
|
|
rawLocationCode:"", |
|
|
|
|
|
fgLocationCode:"", |
|
|
|
|
|
workshopCode :"", |
|
|
|
|
|
workStationCode :"", |
|
|
|
|
|
workShopName :"", |
|
|
|
|
|
productionLineName :"", |
|
|
|
|
|
workStationName :"", |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
@ -94,9 +118,14 @@ |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.openScanPopup(); |
|
|
this.openScanPopup(); |
|
|
} else { |
|
|
} else { |
|
|
this.$refs.comMessage.showBreakMessage(res.message); |
|
|
this.showErrorMessage(res.message) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
getWorkShopLineStation().then(res => { |
|
|
|
|
|
this.positionList = res.data |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
//返回首页 |
|
|
//返回首页 |
|
|
onNavigationBarButtonTap(e) { |
|
|
onNavigationBarButtonTap(e) { |
|
@ -129,9 +158,7 @@ |
|
|
} else { |
|
|
} else { |
|
|
var detail = item.subList.find(r => { |
|
|
var detail = item.subList.find(r => { |
|
|
if (r.packingNumber == label.packingNumber && |
|
|
if (r.packingNumber == label.packingNumber && |
|
|
r.batch == label.batch && |
|
|
r.batch == label.batch) { |
|
|
r.locationCode == label.locationCode && |
|
|
|
|
|
r.inventoryStatus == label.inventoryStatus) { |
|
|
|
|
|
return r; |
|
|
return r; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -141,7 +168,7 @@ |
|
|
item.subList.push(newDetail); |
|
|
item.subList.push(newDetail); |
|
|
} else { |
|
|
} else { |
|
|
if (detail.scaned == true) { |
|
|
if (detail.scaned == true) { |
|
|
this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + balance.batch + "]已经在列表中") |
|
|
this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + label.batch + "]已经在列表中") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -167,7 +194,7 @@ |
|
|
Object.assign(detail, label) |
|
|
Object.assign(detail, label) |
|
|
detail.scaned = true; |
|
|
detail.scaned = true; |
|
|
detail.qty = Number(label.qty); |
|
|
detail.qty = Number(label.qty); |
|
|
detail.inventoryStatus = "kcztOK" |
|
|
detail.inventoryStatus = "OK" |
|
|
detail.stdPackQty = pack.stdPackQty; |
|
|
detail.stdPackQty = pack.stdPackQty; |
|
|
detail.stdPackUnit = pack.stdPackUnit; |
|
|
detail.stdPackUnit = pack.stdPackUnit; |
|
|
|
|
|
|
|
@ -194,71 +221,117 @@ |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
}, |
|
|
}, |
|
|
openScanPopup() { |
|
|
openScanPopup() { |
|
|
// if (this.fromLocationCode == "") { |
|
|
|
|
|
// this.showFromLocationPopup(); |
|
|
|
|
|
// return |
|
|
|
|
|
// } |
|
|
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
}, |
|
|
}, |
|
|
// showFromLocationPopup() { |
|
|
|
|
|
// this.$nextTick(() => { |
|
|
|
|
|
// this.$refs.scanLocationCode.openScanPopup(); |
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
scanLocationCode(location, code) { |
|
|
|
|
|
this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => { |
|
|
|
|
|
this.toLocationCode = code |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
|
|
|
item.subList.forEach(detail => { |
|
|
|
|
|
detail.toLocationCode = code |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
commit() { |
|
|
commit() { |
|
|
if (this.toLocationCode == "") { |
|
|
if (this.positionInfo == "请选择位置") { |
|
|
this.showMessage("请先选择目标库位") |
|
|
this.showMessage("请先选择位置") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
//允许部分提交 |
|
|
|
|
|
uni.showLoading({ |
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
title: "提交中....", |
|
|
//查询管理模式 |
|
|
mask: true |
|
|
uni.showLoading({ |
|
|
}); |
|
|
title: "提交中....", |
|
|
|
|
|
mask: true |
|
|
var params = this.setParams(); |
|
|
}); |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
this.managementList = []; |
|
|
// productionReceiptRecordSubmit(params).then(res => { |
|
|
var precisionStrategParams = this.setPrecisionStrategParams() |
|
|
// uni.hideLoading() |
|
|
|
|
|
// if (res.data) { |
|
|
getPrecisionStrategyList(precisionStrategParams, res => { |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
if (res.success) { |
|
|
// } else { |
|
|
this.managementList = res.list; |
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
var params = this.setParams() |
|
|
// } |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
// }).catch(error => { |
|
|
productionReceiptRecordSubmit(params).then(res => { |
|
|
// uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
// this.showErrorMessage(error) |
|
|
if (res.data) { |
|
|
// }) |
|
|
this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showErrorMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showErrorMessage(res.message); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage("没有要提交的数据,请先扫描") |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
setPrecisionStrategParams() { |
|
|
|
|
|
var itemList = [] |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
|
|
|
item.subList.forEach(detail => { |
|
|
|
|
|
if (detail.scaned) { |
|
|
|
|
|
detail.toLocationCode = this.fgLocationCode; |
|
|
|
|
|
var filterResult = itemList.filter(res => { |
|
|
|
|
|
if (res.itemCode == item.itemCode && |
|
|
|
|
|
detail.toLocationCode == res.locationCode) { |
|
|
|
|
|
return res |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
//去掉重复元素 |
|
|
|
|
|
if (filterResult.length == 0) { |
|
|
|
|
|
var result = { |
|
|
|
|
|
itemCode: item.itemCode, |
|
|
|
|
|
locationCode: detail.toLocationCode |
|
|
|
|
|
} |
|
|
|
|
|
itemList.push(result) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
return itemList; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setParams() { |
|
|
setParams() { |
|
|
|
|
|
|
|
|
var subList = [] |
|
|
var subList = [] |
|
|
|
|
|
var creator = this.$store.state.user.id |
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned) { |
|
|
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
// detail.packingNumber, detail.batch); |
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
// detail.toPackingNumber =info.packingNumber; |
|
|
detail.itemCode = detail.itemCode; |
|
|
// detail.toBatch =info.batch; |
|
|
detail.itemName = detail.package.itemName; |
|
|
|
|
|
detail.itemDesc1 = detail.package.itemDesc1; |
|
|
|
|
|
detail.itemDesc2 = detail.package.itemDesc2; |
|
|
|
|
|
|
|
|
|
|
|
detail.inventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
|
|
|
|
detail.fromPackingNumber = info.packingNumber; |
|
|
|
|
|
detail.toPackingNumber = info.packingNumber; |
|
|
|
|
|
|
|
|
|
|
|
detail.fromContainerNumber = detail.containerNumber; |
|
|
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
|
|
|
|
|
|
|
|
detail.fromBatch = info.batch; |
|
|
|
|
|
detail.toBatch = info.batch; |
|
|
|
|
|
|
|
|
|
|
|
detail.fromLocationCode = detail.locationCode; |
|
|
|
|
|
detail.toLocationCode = detail.toLocationCode; |
|
|
|
|
|
|
|
|
|
|
|
detail.productionlineCode = this.productionLineCode; |
|
|
|
|
|
detail.workStationCode = this.workStationCode; |
|
|
|
|
|
|
|
|
subList.push(detail) |
|
|
subList.push(detail) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
return subList; |
|
|
this.dataContent.subList = subList; |
|
|
|
|
|
this.dataContent.creator = creator; |
|
|
|
|
|
this.dataContent.workshopCode = this.workshopCode; |
|
|
|
|
|
return this.dataContent; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -303,36 +376,17 @@ |
|
|
closeScanMessage() { |
|
|
closeScanMessage() { |
|
|
this.scanPopupGetFocus(); |
|
|
this.scanPopupGetFocus(); |
|
|
}, |
|
|
}, |
|
|
getLocation(location, code) { |
|
|
|
|
|
this.getFromLocationCode(location, code) |
|
|
|
|
|
}, |
|
|
|
|
|
getFromLocationCode(location, code) { |
|
|
|
|
|
this.fromLocationInfo = location; |
|
|
|
|
|
this.fromLocationCode = code; |
|
|
|
|
|
this.openScanPopup(); |
|
|
|
|
|
}, |
|
|
|
|
|
getToLocationCode(location, code) { |
|
|
|
|
|
if (this.fromLocationCode == code) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.ToLocationCodeInfo = location; |
|
|
|
|
|
this.toLocationCode = code; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
showCommitSuccessMessage(hint) { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
|
|
this.subList = []; |
|
|
|
|
|
this.detailSource = []; |
|
|
|
|
|
this.toLocationCode = ''; |
|
|
|
|
|
this.dataContent = {}; |
|
|
|
|
|
this.positionInfo= "请选择位置"; |
|
|
|
|
|
this.fgLocationCode ="" |
|
|
}) |
|
|
}) |
|
|
setTimeout(() => { |
|
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
|
// url: './receiptJob' |
|
|
|
|
|
// }) |
|
|
|
|
|
}, 3000) |
|
|
|
|
|
}, |
|
|
}, |
|
|
removePack() { |
|
|
removePack() { |
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
@ -350,6 +404,39 @@ |
|
|
updateData() { |
|
|
updateData() { |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
showSelect() { |
|
|
|
|
|
this.show = !this.show |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
confirmSelect(e) { |
|
|
|
|
|
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label |
|
|
|
|
|
console.log("位置", this.positionInfo) |
|
|
|
|
|
this.workshopCode = e[0].value |
|
|
|
|
|
this.productionLineCode = e[1].value |
|
|
|
|
|
this.workStationCode = e[2].value |
|
|
|
|
|
this.workShopName = e[0].label |
|
|
|
|
|
this.productionLineName = e[1].label |
|
|
|
|
|
this.workStationName = e[2].label |
|
|
|
|
|
|
|
|
|
|
|
let shop = this.positionList.find(shop => shop.value == this.workshopCode); |
|
|
|
|
|
if (shop != undefined && shop.children != undefined) { |
|
|
|
|
|
let prodLine = shop.children.find(line => line.value == this.productionLineCode); |
|
|
|
|
|
if (prodLine != undefined && prodLine.children != undefined) { |
|
|
|
|
|
let station = prodLine.children.find(r => r.value == this.workStationCode); |
|
|
|
|
|
if (station.rawLocationCode == '' && station.rawLocationCode == null) { |
|
|
|
|
|
this.showErrorMessage(this.workStationName + "的原材料库位为空,请重新选择") |
|
|
|
|
|
return; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.rawLocationCode = station.rawLocationCode; |
|
|
|
|
|
this.fgLocationCode = station.fgLocationCode; |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage("生产线-工位基础信息维护错误") |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage("车间-生产线基础信息维护错误") |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|