|
@ -8,23 +8,30 @@ |
|
|
<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=""> |
|
|
<record-com-detail-card :dataContent="item" :settingParam="dataContent" |
|
|
<comReturnRecord :dataContent="item" :index="index" |
|
|
@removeData="removeData" @updateData="updateData" @removePack="removePack"> |
|
|
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"> |
|
|
</record-com-detail-card> |
|
|
</comReturnRecord> |
|
|
</view> |
|
|
</view> |
|
|
<u-line /> |
|
|
<u-line /> |
|
|
</view> |
|
|
</view> |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" :isShowEdit="true" |
|
|
|
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
|
|
<u-line></u-line> |
|
|
|
|
|
|
|
|
|
|
|
<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> |
|
@ -34,22 +41,20 @@ |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> |
|
|
<win-scan-pack ref="scanPopup" @getResult='getScanResult' title="箱标签" headerType="HPQ"></win-scan-pack> |
|
|
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation' |
|
|
|
|
|
:locationTypeList="fromLocationTypeList"></win-scan-location> |
|
|
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
productionReturnRecordSubmit |
|
|
productionReturnRecordSubmit, |
|
|
|
|
|
getWorkShopLineStation |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
goHome, |
|
|
goHome, |
|
|
updateTitle, |
|
|
getPackingNumberAndBatchByList |
|
|
getPackingNumberAndBatch |
|
|
|
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -63,18 +68,17 @@ |
|
|
calcHandleQty |
|
|
calcHandleQty |
|
|
} from '@/common/record.js'; |
|
|
} from '@/common/record.js'; |
|
|
import { |
|
|
import { |
|
|
getManagementPrecisions |
|
|
getPrecisionStrategyList |
|
|
} from '@/common/balance.js'; |
|
|
} from '@/common/balance.js'; |
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.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 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 comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'comReturn', |
|
|
name: 'comReturn', |
|
|
components: { |
|
|
components: { |
|
@ -82,10 +86,9 @@ |
|
|
// comReturnRecord, |
|
|
// comReturnRecord, |
|
|
requiredLocation, |
|
|
requiredLocation, |
|
|
comBlankView, |
|
|
comBlankView, |
|
|
winScanLocation, |
|
|
|
|
|
comMessage, |
|
|
comMessage, |
|
|
winScanPackAndLocation, |
|
|
comReturnRecord, |
|
|
recordComDetailCard |
|
|
winScanPack |
|
|
}, |
|
|
}, |
|
|
props: { |
|
|
props: { |
|
|
returnType: { |
|
|
returnType: { |
|
@ -103,17 +106,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
watch: { |
|
|
watch: {}, |
|
|
fromType: { |
|
|
|
|
|
handler(newName, oldName) { |
|
|
|
|
|
this.updateTitle() |
|
|
|
|
|
}, |
|
|
|
|
|
immediate: true, |
|
|
|
|
|
deep: true |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
id: '', |
|
|
id: '', |
|
@ -121,40 +116,48 @@ |
|
|
dataContent: {}, //任务内容 |
|
|
dataContent: {}, //任务内容 |
|
|
subList: [], //接口返回的任务subList |
|
|
subList: [], //接口返回的任务subList |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
fromLocationInfo: {}, |
|
|
|
|
|
fromLocationCode: '', |
|
|
fromLocationCode: '', |
|
|
fromLocationTypeList: [], |
|
|
fromLocationTypeList: [], |
|
|
toLocationInfo: {}, |
|
|
|
|
|
toLocationCode: '', |
|
|
toLocationCode: '', |
|
|
tolocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
showToLoaction:false |
|
|
inventoryStatus: '', |
|
|
|
|
|
managementList: [], |
|
|
|
|
|
show: false, |
|
|
|
|
|
positionInfo: "请选择位置", |
|
|
|
|
|
positionList: [], |
|
|
|
|
|
productionLineCode: '', |
|
|
|
|
|
rawLocationCode: "", |
|
|
|
|
|
fgLocationCode: "", |
|
|
|
|
|
workshopCode: "", |
|
|
|
|
|
workStationCode: "", |
|
|
|
|
|
workShopName: "", |
|
|
|
|
|
productionLineName: "", |
|
|
|
|
|
workStationName: "", |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() {}, |
|
|
// var typeCode = "" |
|
|
|
|
|
// if (this.returnType == "returnToStore") { |
|
|
|
|
|
// typeCode = "ReturnToStore" |
|
|
|
|
|
// } else if (this.returnType == "returnToHold") { |
|
|
|
|
|
// typeCode = "ReturnToHold" |
|
|
|
|
|
// } |
|
|
|
|
|
}, |
|
|
|
|
|
mounted() { |
|
|
mounted() { |
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
getBusinessType(this.businessTypeCode, res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
this.businessType = res.businessType; |
|
|
this.businessType = res.businessType; |
|
|
this.fromlocationTypeList = res.fromlocationTypeList; |
|
|
this.fromlocationTypeList = res.fromlocationTypeList; |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.showFromLocationPopup(); |
|
|
this.openScanPopup(); |
|
|
} else { |
|
|
} else { |
|
|
this.$refs.comMessage.showBreakMessage(res.message); |
|
|
this.$refs.comMessage.showBreakMessage(res.message); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
getWorkShopLineStation().then(res => { |
|
|
|
|
|
this.positionList = res.data |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//返回首页 |
|
|
//返回首页 |
|
|
onNavigationBarButtonTap(e) { |
|
|
onNavigationBarButtonTap(e) { |
|
|
if (e.index === 0) { |
|
|
if (e.index === 0) { |
|
@ -169,82 +172,87 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
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() { |
|
|
openScanPopup() { |
|
|
if (this.fromLocationCode == "") { |
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
this.showFromLocationPopup(); |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getDataSource(result) { |
|
|
getScanResult(result) { |
|
|
let balance = result.balance; |
|
|
|
|
|
let label = result.label; |
|
|
let label = result.label; |
|
|
let pack = result.package; |
|
|
let pack = result.package; |
|
|
|
|
|
|
|
|
var item = this.detailSource.find(res => { |
|
|
var item = this.detailSource.find(res => { |
|
|
if (res.itemCode == result.balance.itemCode) { |
|
|
if (res.itemCode == label.itemCode) { |
|
|
return res |
|
|
return res |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
var itemInfo = createItemInfo(balance, pack); |
|
|
var itemp = this.createItemInfo(label, pack); |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
let newDetail = this.createDetailInfo(label, pack); |
|
|
itemInfo.subList.push(newDetail); |
|
|
itemp.subList.push(newDetail); |
|
|
this.detailSource.push(itemInfo) |
|
|
this.detailSource.push(itemp) |
|
|
} else { |
|
|
} else { |
|
|
var detail = item.subList.find(r => { |
|
|
var detail = item.subList.find(r => { |
|
|
if (r.packingNumber == result.balance.packingNumber && |
|
|
if (r.packingNumber == label.packingNumber && |
|
|
r.batch == result.balance.batch && |
|
|
r.batch == label.batch) { |
|
|
r.locationCode == result.balance.locationCode && |
|
|
|
|
|
r.inventoryStatus == result.balance.inventoryStatus) { |
|
|
|
|
|
return r; |
|
|
return r; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
if (detail == undefined) { |
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
let newDetail = this.createDetailInfo(label, pack); |
|
|
item.subList.push(newDetail); |
|
|
item.subList.push(newDetail); |
|
|
} else { |
|
|
} else { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned == true) { |
|
|
this.showErrorMessage(result.balance.packingNumber + "已经在列表中") |
|
|
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() { |
|
|
removePack() { |
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
@ -256,14 +264,13 @@ |
|
|
this.updateData(); |
|
|
this.updateData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showSelect() { |
|
|
|
|
|
this.show = !this.show |
|
|
|
|
|
}, |
|
|
updateData() { |
|
|
updateData() { |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
|
|
this.getDataSource(result) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
removeData(item) { |
|
|
removeData(item) { |
|
|
for (let i = 0; i < this.detailSource.length; i++) { |
|
|
for (let i = 0; i < this.detailSource.length; i++) { |
|
|
if (this.detailSource[i].itemCode == item.itemCode) { |
|
|
if (this.detailSource[i].itemCode == item.itemCode) { |
|
@ -273,123 +280,123 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
commit() { |
|
|
commit() { |
|
|
if (this.showToLoaction &&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 |
|
|
if(this.fromType=="requestType"){ |
|
|
}); |
|
|
var params = this.setRequestParams() |
|
|
this.managementList = []; |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
var precisionStrategParams = this.setPrecisionStrategParams() |
|
|
// productionReturnRequestSubmit(params).then(res => { |
|
|
|
|
|
// uni.hideLoading() |
|
|
getPrecisionStrategyList(precisionStrategParams, res => { |
|
|
// if (res.data) { |
|
|
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
|
|
// } |
|
|
|
|
|
// }).catch(error => { |
|
|
|
|
|
// uni.hideLoading() |
|
|
|
|
|
// this.showErrorMessage(error) |
|
|
|
|
|
// }) |
|
|
|
|
|
}else { |
|
|
|
|
|
//记录有目标库位,需要查询管理模式 |
|
|
|
|
|
var itemCodes = [] |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
|
|
}) |
|
|
|
|
|
//获取管理模式,封装参数 |
|
|
|
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
this.managementList = res.list; |
|
|
this.managementList = res.list; |
|
|
var params = this.setParams(true) |
|
|
var params = this.setParams() |
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
|
|
productionReturnRecordSubmit(params).then(res => { |
|
|
// productionReturnRecordSubmit(params).then(res => { |
|
|
uni.hideLoading() |
|
|
// uni.hideLoading() |
|
|
if (res.data) { |
|
|
// if (res.data) { |
|
|
this.showCommitSuccessMessage("提交成功<br>生成制品收货记录<br>" + res.data) |
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
} else { |
|
|
// } else { |
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
// this.showErrorMessage("提交失败"+res.msg) |
|
|
} |
|
|
// } |
|
|
}).catch(error => { |
|
|
// }).catch(error => { |
|
|
uni.hideLoading() |
|
|
// uni.hideLoading() |
|
|
this.showErrorMessage(error) |
|
|
// this.showErrorMessage(error) |
|
|
}) |
|
|
// }) |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
this.showErrorMessage(res.message); |
|
|
this.showErrorMessage(res.message); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage("没有要提交的数据,请先扫描") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setRequestParams(){ |
|
|
setPrecisionStrategParams() { |
|
|
var subList = [] |
|
|
var itemList = [] |
|
|
var supplierCode="" |
|
|
|
|
|
this.detailSource.forEach(item => { |
|
|
this.detailSource.forEach(item => { |
|
|
item.subList.forEach(detail => { |
|
|
item.subList.forEach(detail => { |
|
|
if (detail.scaned) { |
|
|
if (detail.scaned) { |
|
|
if(supplierCode==""){ |
|
|
detail.toLocationCode = this.fgLocationCode; |
|
|
supplierCode = detail.package.supplierCode |
|
|
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) |
|
|
} |
|
|
} |
|
|
subList.push(detail) |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
return itemList; |
|
|
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; |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setParams(queryModel) { |
|
|
setParams() { |
|
|
|
|
|
|
|
|
var subList = [] |
|
|
var subList = [] |
|
|
var creator = this.$store.state.user.id |
|
|
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 subItem = {}; |
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
// Object.assign(subItem, detail) |
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
if (queryModel) { |
|
|
detail.itemCode = detail.itemCode; |
|
|
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
detail.itemName = detail.package.itemName; |
|
|
detail.packingNumber, detail.batch); |
|
|
detail.itemDesc1 = detail.package.itemDesc1; |
|
|
detail.toPackingNumber = info.packingNumber;; |
|
|
detail.itemDesc2 = detail.package.itemDesc2; |
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
|
|
detail.toBatch = info.batch; |
|
|
detail.inventoryStatus = detail.inventoryStatus; |
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
|
|
detail.toLocationCode = this.toLocationCode |
|
|
detail.fromPackingNumber = info.packingNumber; |
|
|
} else { |
|
|
detail.toPackingNumber = info.packingNumber; |
|
|
detail.toPackingNumber = detail.packingNumber; |
|
|
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
detail.fromContainerNumber = detail.containerNumber; |
|
|
detail.toBatch = detail.toBatch; |
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
|
|
detail.toLocationCode = "" |
|
|
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) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
this.dataContent.subList = subList |
|
|
this.dataContent.subList = subList; |
|
|
this.dataContent.creator = creator; |
|
|
this.dataContent.creator = creator; |
|
|
|
|
|
this.dataContent.workshopCode = this.workshopCode; |
|
|
|
|
|
this.dataContent.businessType = this.businessTypeCode; |
|
|
return this.dataContent; |
|
|
return this.dataContent; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
showMessage(message) { |
|
|
this.scanPopupLoseFocus(); |
|
|
this.scanPopupLoseFocus(); |
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
@ -408,58 +415,58 @@ |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showScanMessage(message) { |
|
|
|
|
|
this.$refs.comMessage.showScanMessage(message); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
afterCloseMessage() { |
|
|
afterCloseMessage() { |
|
|
this.scanPopupGetFocus(); |
|
|
this.scanPopupGetFocus(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
scanPopupGetFocus() { |
|
|
scanPopupGetFocus() { |
|
|
this.$refs.scanPopup.packGetFocus(); |
|
|
this.$refs.scanPopup.getfocus(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
scanPopupLoseFocus() { |
|
|
scanPopupLoseFocus() { |
|
|
this.$refs.scanPopup.packLoseFocus(); |
|
|
this.$refs.scanPopup.losefocus(); |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
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(); |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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({ |
|
|
confirmSelect(e) { |
|
|
// url: './receiptJob' |
|
|
this.positionInfo = e[0].label + "-" + e[1].label + "-" + e[2].label |
|
|
// }) |
|
|
console.log("位置", this.positionInfo) |
|
|
}, 3000) |
|
|
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("车间-生产线基础信息维护错误") |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|