|
|
@ -8,23 +8,30 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<record-com-detail-card :dataContent="item" :settingParam="dataContent" |
|
|
|
@removeData="removeData" @updateData="updateData" @removePack="removePack"> |
|
|
|
</record-com-detail-card> |
|
|
|
<comReturnRecord :dataContent="item" :index="index" |
|
|
|
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"> |
|
|
|
</comReturnRecord> |
|
|
|
</view> |
|
|
|
<u-line /> |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" :isShowEdit="true" |
|
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
<u-line></u-line> |
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
|
<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 class=" uni-flex uni-row"> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
@ -34,22 +41,20 @@ |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> |
|
|
|
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation' |
|
|
|
:locationTypeList="fromLocationTypeList"></win-scan-location> |
|
|
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult' title="箱标签" headerType="HPQ"></win-scan-pack> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
productionReturnRecordSubmit |
|
|
|
productionReturnRecordSubmit, |
|
|
|
getWorkShopLineStation |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
goHome, |
|
|
|
updateTitle, |
|
|
|
getPackingNumberAndBatch |
|
|
|
getPackingNumberAndBatchByList |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -63,17 +68,16 @@ |
|
|
|
calcHandleQty |
|
|
|
} from '@/common/record.js'; |
|
|
|
import { |
|
|
|
getManagementPrecisions |
|
|
|
getPrecisionStrategyList |
|
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
|
// import comReturnRecord from '@/pages/productionReturn/coms/comReturnRecord.vue' |
|
|
|
import comReturnRecord from '@/pages/productionReturn/coms/comReturnRecord.vue' |
|
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'comReturn', |
|
|
@ -82,10 +86,9 @@ |
|
|
|
// comReturnRecord, |
|
|
|
requiredLocation, |
|
|
|
comBlankView, |
|
|
|
winScanLocation, |
|
|
|
comMessage, |
|
|
|
winScanPackAndLocation, |
|
|
|
recordComDetailCard |
|
|
|
comReturnRecord, |
|
|
|
winScanPack |
|
|
|
}, |
|
|
|
props: { |
|
|
|
returnType: { |
|
|
@ -104,15 +107,7 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
watch: { |
|
|
|
fromType: { |
|
|
|
handler(newName, oldName) { |
|
|
|
this.updateTitle() |
|
|
|
}, |
|
|
|
immediate: true, |
|
|
|
deep: true |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: {}, |
|
|
|
|
|
|
|
data() { |
|
|
|
return { |
|
|
@ -121,36 +116,44 @@ |
|
|
|
dataContent: {}, //任务内容 |
|
|
|
subList: [], //接口返回的任务subList |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
fromLocationInfo: {}, |
|
|
|
fromLocationCode: '', |
|
|
|
fromLocationTypeList: [], |
|
|
|
toLocationInfo: {}, |
|
|
|
toLocationCode: '', |
|
|
|
tolocationTypeList: [], |
|
|
|
businessType: {}, |
|
|
|
showToLoaction:false |
|
|
|
inventoryStatus: '', |
|
|
|
managementList: [], |
|
|
|
show: false, |
|
|
|
positionInfo: "请选择位置", |
|
|
|
positionList: [], |
|
|
|
productionLineCode: '', |
|
|
|
rawLocationCode: "", |
|
|
|
fgLocationCode: "", |
|
|
|
workshopCode: "", |
|
|
|
workStationCode: "", |
|
|
|
workShopName: "", |
|
|
|
productionLineName: "", |
|
|
|
workStationName: "", |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
// var typeCode = "" |
|
|
|
// if (this.returnType == "returnToStore") { |
|
|
|
// typeCode = "ReturnToStore" |
|
|
|
// } else if (this.returnType == "returnToHold") { |
|
|
|
// typeCode = "ReturnToHold" |
|
|
|
// } |
|
|
|
}, |
|
|
|
onLoad() {}, |
|
|
|
mounted() { |
|
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.businessType = res.businessType; |
|
|
|
this.fromlocationTypeList = res.fromlocationTypeList; |
|
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
|
this.showFromLocationPopup(); |
|
|
|
this.openScanPopup(); |
|
|
|
} else { |
|
|
|
this.$refs.comMessage.showBreakMessage(res.message); |
|
|
|
} |
|
|
|
}); |
|
|
|
getWorkShopLineStation().then(res => { |
|
|
|
this.positionList = res.data |
|
|
|
}).catch(error => { |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
@ -169,82 +172,87 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
updateTitle(){ |
|
|
|
if(this.businessTypeCode=='returnToStore'){ |
|
|
|
if(this.fromType == 'requestType'){ |
|
|
|
updateTitle("合格退料申请") |
|
|
|
this.showToLoaction=false |
|
|
|
}else { |
|
|
|
updateTitle("合格退料记录") |
|
|
|
this.showToLoaction=true |
|
|
|
} |
|
|
|
}else if(this.businessTypeCode=='returnToHold'){ |
|
|
|
if(this.fromType == 'requestType'){ |
|
|
|
updateTitle("隔离退料申请") |
|
|
|
this.showToLoaction=false |
|
|
|
}else { |
|
|
|
updateTitle("隔离退料记录") |
|
|
|
this.showToLoaction=true |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
showFromLocationPopup() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.scanFromLocationCode.openScanPopup(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getFromLocation(location, code) { |
|
|
|
this.fromLocationCode = code; |
|
|
|
this.fromLocationInfo = location; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
openScanPopup() { |
|
|
|
if (this.fromLocationCode == "") { |
|
|
|
this.showFromLocationPopup(); |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); |
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
getDataSource(result) { |
|
|
|
let balance = result.balance; |
|
|
|
getScanResult(result) { |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
|
|
|
|
|
var item = this.detailSource.find(res => { |
|
|
|
if (res.itemCode == result.balance.itemCode) { |
|
|
|
if (res.itemCode == label.itemCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (item == undefined) { |
|
|
|
var itemInfo = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
itemInfo.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemInfo) |
|
|
|
var itemp = this.createItemInfo(label, pack); |
|
|
|
let newDetail = this.createDetailInfo(label, pack); |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.packingNumber == result.balance.packingNumber && |
|
|
|
r.batch == result.balance.batch && |
|
|
|
r.locationCode == result.balance.locationCode && |
|
|
|
r.inventoryStatus == result.balance.inventoryStatus) { |
|
|
|
if (r.packingNumber == label.packingNumber && |
|
|
|
r.batch == label.batch) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
let newDetail = this.createDetailInfo(label, pack); |
|
|
|
item.subList.push(newDetail); |
|
|
|
} else { |
|
|
|
if (detail.scaned) { |
|
|
|
this.showErrorMessage(result.balance.packingNumber + "已经在列表中") |
|
|
|
if (detail.scaned == true) { |
|
|
|
this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + label.batch + "]已经在列表中") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
this.calcHandleQty(); |
|
|
|
}, |
|
|
|
createItemInfo(label, pack) { |
|
|
|
let item = { |
|
|
|
itemCode: label.itemCode, |
|
|
|
itemName: pack.itemName, |
|
|
|
stdPackQty: pack.stdPackQty, |
|
|
|
stdPackUnit: pack.stdPackUnit, |
|
|
|
qty: Number(label.qty), |
|
|
|
handleQty: 0, |
|
|
|
uom: pack.uom, |
|
|
|
subList: [] |
|
|
|
} |
|
|
|
return item; |
|
|
|
}, |
|
|
|
|
|
|
|
createDetailInfo(label, pack) { |
|
|
|
let detail = {}; |
|
|
|
Object.assign(detail, label) |
|
|
|
detail.scaned = true; |
|
|
|
detail.qty = Number(label.qty); |
|
|
|
detail.inventoryStatus = this.businessTypeCode == 'ReturnToStore' ? "OK" : "HOLD" |
|
|
|
detail.stdPackQty = pack.stdPackQty; |
|
|
|
detail.stdPackUnit = pack.stdPackUnit; |
|
|
|
|
|
|
|
detail.package = pack; |
|
|
|
detail.label = label; |
|
|
|
return detail; |
|
|
|
}, |
|
|
|
|
|
|
|
calcHandleQty() { |
|
|
|
for (let item of this.detailSource) { |
|
|
|
item.qty = 0; |
|
|
|
for (let detail of item.subList) { |
|
|
|
if (detail != undefined) { |
|
|
|
item.qty += Number(detail.qty) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
removeItem(index, item) { |
|
|
|
this.detailSource.splice(index, 1) |
|
|
|
}, |
|
|
|
|
|
|
|
removePack() { |
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
@ -256,14 +264,13 @@ |
|
|
|
this.updateData(); |
|
|
|
}, |
|
|
|
|
|
|
|
showSelect() { |
|
|
|
this.show = !this.show |
|
|
|
}, |
|
|
|
updateData() { |
|
|
|
this.calcHandleQty(); |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
this.getDataSource(result) |
|
|
|
}, |
|
|
|
|
|
|
|
removeData(item) { |
|
|
|
for (let i = 0; i < this.detailSource.length; i++) { |
|
|
|
if (this.detailSource[i].itemCode == item.itemCode) { |
|
|
@ -273,123 +280,123 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
if (this.showToLoaction &&this.toLocationCode == "") { |
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
if (this.positionInfo == "请选择位置") { |
|
|
|
this.showMessage("请先选择位置") |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
//查询管理模式 |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
this.managementList = []; |
|
|
|
var precisionStrategParams = this.setPrecisionStrategParams() |
|
|
|
|
|
|
|
if(this.fromType=="requestType"){ |
|
|
|
var params = this.setRequestParams() |
|
|
|
getPrecisionStrategyList(precisionStrategParams, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
// productionReturnRequestSubmit(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
productionReturnRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data) |
|
|
|
} else { |
|
|
|
//记录有目标库位,需要查询管理模式 |
|
|
|
var itemCodes = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
//获取管理模式,封装参数 |
|
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams(true) |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
|
|
// productionReturnRecordSubmit(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<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("没有要提交的数据,请先扫描") |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setRequestParams(){ |
|
|
|
var subList = [] |
|
|
|
var supplierCode="" |
|
|
|
setPrecisionStrategParams() { |
|
|
|
var itemList = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
if(supplierCode==""){ |
|
|
|
supplierCode = detail.package.supplierCode |
|
|
|
detail.toLocationCode = this.fgLocationCode; |
|
|
|
var filterResult = itemList.filter(res => { |
|
|
|
if (res.itemCode == item.itemCode && |
|
|
|
detail.toLocationCode == res.locationCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
subList.push(detail) |
|
|
|
}) |
|
|
|
//去掉重复元素 |
|
|
|
if (filterResult.length == 0) { |
|
|
|
var result = { |
|
|
|
itemCode: item.itemCode, |
|
|
|
locationCode: detail.toLocationCode |
|
|
|
} |
|
|
|
itemList.push(result) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.dataContent.subList = subList |
|
|
|
this.dataContent.supplierCode = supplierCode |
|
|
|
this.dataContent.businessType = "PurchasePutaway" |
|
|
|
this.dataContent.departmentCode= "研发部门"; |
|
|
|
this.dataContent.status= 1 ; |
|
|
|
this.dataContent.autoCommit = "FALSE"; |
|
|
|
this.dataContent.autoAgree = "FALSE"; |
|
|
|
this.dataContent.autoExecute = "FALSE"; |
|
|
|
this.dataContent.directCreateRecord = "FALSE"; |
|
|
|
return this.dataContent; |
|
|
|
return itemList; |
|
|
|
}, |
|
|
|
|
|
|
|
setParams(queryModel) { |
|
|
|
setParams() { |
|
|
|
|
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
// var subItem = {}; |
|
|
|
// Object.assign(subItem, detail) |
|
|
|
if (queryModel) { |
|
|
|
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
|
detail.packingNumber, detail.batch); |
|
|
|
detail.toPackingNumber = info.packingNumber;; |
|
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
|
detail.itemCode = detail.itemCode; |
|
|
|
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.toInventoryStatus = detail.inventoryStatus |
|
|
|
detail.toLocationCode = this.toLocationCode |
|
|
|
} else { |
|
|
|
detail.toPackingNumber = detail.packingNumber; |
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
detail.toBatch = detail.toBatch; |
|
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
detail.toLocationCode = "" |
|
|
|
} |
|
|
|
|
|
|
|
detail.fromLocationCode = detail.locationCode; |
|
|
|
detail.toLocationCode = detail.toLocationCode; |
|
|
|
|
|
|
|
detail.productionlineCode = this.productionLineCode; |
|
|
|
detail.workStationCode = this.workStationCode; |
|
|
|
|
|
|
|
|
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.dataContent.subList = subList |
|
|
|
this.dataContent.subList = subList; |
|
|
|
this.dataContent.creator = creator; |
|
|
|
this.dataContent.workshopCode = this.workshopCode; |
|
|
|
this.dataContent.businessType = this.businessTypeCode; |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
this.scanPopupLoseFocus(); |
|
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
@ -408,58 +415,58 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
showScanMessage(message) { |
|
|
|
this.$refs.comMessage.showScanMessage(message); |
|
|
|
}, |
|
|
|
|
|
|
|
afterCloseMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
|
this.$refs.scanPopup.packGetFocus(); |
|
|
|
this.$refs.scanPopup.getfocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupLoseFocus() { |
|
|
|
this.$refs.scanPopup.packLoseFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
scroll: function(e) { |
|
|
|
// console.log(e) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* BlobUrl转blob数据 |
|
|
|
* @param {Object} url blob URL |
|
|
|
* @param {Object} callback 回调函数 |
|
|
|
*/ |
|
|
|
objectURLToBlob(url, callback) { |
|
|
|
const http = new XMLHttpRequest(); |
|
|
|
http.open("GET", url, true); |
|
|
|
http.responseType = "blob"; |
|
|
|
http.onload = function(e) { |
|
|
|
if (this.status == 200 || this.status === 0) { |
|
|
|
callback(this.response); |
|
|
|
} |
|
|
|
}; |
|
|
|
http.send(); |
|
|
|
this.$refs.scanPopup.losefocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
|
|
|
|
this.subList = []; |
|
|
|
this.detailSource = []; |
|
|
|
this.toLocationCode = ''; |
|
|
|
this.dataContent = {}; |
|
|
|
this.positionInfo = "请选择位置"; |
|
|
|
this.fgLocationCode = "" |
|
|
|
}) |
|
|
|
setTimeout(() => { |
|
|
|
// uni.navigateTo({ |
|
|
|
// url: './receiptJob' |
|
|
|
// }) |
|
|
|
}, 3000) |
|
|
|
}, |
|
|
|
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("车间-生产线基础信息维护错误") |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|