Browse Source

page/issue/record 文件迁移 8/8-10/25

hella_vue3
王志国 4 weeks ago
parent
commit
f2e6ce3838
  1. 272
      src/pages/issue/record/directIssue.vue
  2. 645
      src/pages/issue/record/directIssue0816.vue
  3. 4
      src/pages/issue/record/issueRecord.vue
  4. 2
      src/pages/issue/record/issueRecordV1.vue

272
src/pages/issue/record/directIssue.vue

@ -4,16 +4,12 @@
<com-blank-view @goScan="getBusinessType" v-if="detailSource.length == 0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length > 0">
<view class="page-header">
<view class="page-header-box">
<view class="header_item u-p-t-20"> 来源库位 : {{ fromLocationCode }} </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="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" :isShowFromLocation="false" @removeItem="removeItem(index, item)" :isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData" @removePack="removePack"> </record-com-detail-card>
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" :isShowFromLocation="true" @removeItem="removeItem(index, item)" :isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData" @removePack="removePack"> </record-com-detail-card>
</view>
</view>
</scroll-view>
@ -37,6 +33,7 @@
<win-scan-button @goScan="openScanPopup"></win-scan-button>
</view>
<winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"></winComScanBalance>
<balanceQuery ref="refBalanceQuery" :businessTypeCode="businessTypeCode"></balanceQuery>
<com-message ref="comMessageRef" :queryBalance="false" />
</view>
</template>
@ -55,17 +52,12 @@ import { getInventoryStatusDesc, getDirectoryItemArray } from '@/common/director
import { getBusinessType, createItemInfo, createDetailInfo, calcTreeHandleQty, calcHandleQty } from '@/common/record.js'
import { getManagementPrecisions, getPrecisionStrategyList, getPrecisionStrategyParams } from '@/common/balance.js'
import { Decimal } from 'decimal.js'; //
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import winScanPackAndLocation from '@/mycomponents/scan/winScanPackAndLocation.vue'
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
@ -101,10 +93,12 @@ const workStationName = ref('')
const rawLocationCode = ref('')
const fgLocationCode = ref('')
const managementList = ref([])
const managementType = ref('')
const resultData = ref({})
const balanceSelectRef = ref()
const itemCode = ref('')
const fromInventoryStatuses = ref('')
const refBalanceQuery = ref(null)
onLoad((option) => {
uni.setNavigationBarTitle({
title: option.title
@ -141,6 +135,9 @@ onLoad((option) => {
onNavigationBarButtonTap((e) => {
if (e.index === 0) {
goHome()
}else if (e.index == 1) {
refBalanceQuery.value.showDrawer();
closeScanPopup();
}
})
const getBusinessType = ()=> {
@ -155,19 +152,29 @@ const getBusinessType = ()=> {
}
});
}
const getScanResult = (result)=> {
setData(result);
const getScanResult = async (result)=> {
await getManagementPrecisions([result.label.itemCode], result.balance.locationCode, res => {
if (res.success) {
managementList.value = res.list;
managementType.value = managementList.value && managementList.value[0] ? managementList.value[0].ManagementPrecision : ''
if(managementType.value == "BY_BATCH" || managementType.value == "BY_QUANTITY" ){
setDataBatch(result);
}else{
setData(result);
}
}
})
}
const setData = (result)=> {
let balance = result.balance;
let label = result.label;
let pack = result.package;
if (fromLocationCode.value && fromLocationCode.value != balance.locationCode) {
showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]在库位[" + this
.fromLocationCode + "]没有库存余额")
return;
}
// if (fromLocationCode.value && fromLocationCode.value != balance.locationCode) {
// showErrorMessage("[" + balance.packingNumber + "[" + balance.batch + "][" + this
// .fromLocationCode + "]")
// return;
// }
let item = detailSource.value.find(res => {
if (res.itemCode == balance.itemCode) {
@ -175,15 +182,17 @@ const setData = (result)=> {
}
})
if (item == undefined) {
if (itemCode.value != "" && itemCode.value != balance.itemCode) {
showErrorMessage("请扫描物料为【" + itemCode.value + "】的箱码")
return;
}
// if (itemCode.value != "" && itemCode.value != balance.itemCode) {
// showErrorMessage("" + itemCode.value + "")
// return;
// }
if (fromWarehouseCode.value == '') {
fromWarehouseCode.value = balance.warehouseCode;
}
let itemp = createItemInfo(balance, pack);
itemp.containerNumber = ""
let newDetail = createDetailInfo(balance, pack); //
newDetail.fromLocationCode = balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
@ -195,36 +204,224 @@ const setData = (result)=> {
detailSource.value.push(itemp)
itemCode.value = balance.itemCode;
fromLocationCode.value = balance.locationCode
await this.getToLocationBalance(this.fromLocationCode,result)
scanPopupGetFocus()
} else {
let detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == balance.batch &&
r.locationCode == balance.locationCode &&
r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
//
//
//,
if (pack.parentNumber) {
let checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if (checkData) {
//
showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
console.log("父包装已经扫描")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
}
} else {
//
let checkData = item.subList.find(r => {
if (r.parentNumber == pack.number &&
r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if (checkData) {
//
comMessageRef.value.showQuestionMessage("箱码[" + checkData.parentNumber+"]" + "批次[" + balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
item.subList = [];
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
item.subList.push(newDetail);
}
}
item.subList.push(newDetail);
this.scanPopupGetFocus()
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]已经在列表中")
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描")
}
}
}
calcHandleQty(this.detailSource);
}
const setDataBatch = async (result)=>{
let balance = result.balance;
let label = result.label;
let pack = result.package;
// if (this.fromLocationCode && this.fromLocationCode != balance.locationCode) {
// this.showErrorMessage("[" + balance.packingNumber + "[" + balance.batch + "][" + this
// .fromLocationCode + "]")
// return;
// }
let item = detailSource.value.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
if (fromWarehouseCode.value == '') {
fromWarehouseCode.value = balance.warehouseCode;
}
let itemp = createItemInfo(balance, pack);
itemp.containerNumber=""
let newDetail = createDetailInfo(balance, pack); //
newDetail.fromLocationCode=balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.handleQty = 0
itemp.subList.push(newDetail);
detailSource.value.push(itemp)
itemCode.value = balance.itemCode;
fromLocationCode.value = balance.locationCode
scanPopupGetFocus()
} else {
let detail = item.subList.find(r => {
if (r.batch == balance.batch &&
r.fromLocationCode == balance.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
//
//
//,
if (pack.parentNumber) {
let checkData = item.subList.find(r => {
if (r.packingNumber == pack.parentNumber &&
r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if (checkData) {
//
showErrorMessage("扫描箱码[" + pack.number + "]批次[" + balance.batch +
"]的父包装已经扫描")
console.log("父包装已经扫描")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
newDetail.handleQty = 0
item.subList.push(newDetail);
}
} else {
//
let checkData = item.subList.find(r => {
if (r.batch == balance.batch&&
r.fromLocationCode == balance.locationCode) {
return r;
}
})
if (checkData) {
//
comMessageRef.value.showQuestionMessage("批次[" + balance
.batch + "]是父包装,是否移除子包装", res => {
if (res) {
item.subList = [];
let newDetail = createDetailInfo(balance, pack);
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.fromLocationCode=balance.locationCode
newDetail.handleQty = 0
item.subList.push(newDetail);
}
})
console.log("扫描的是父包装,是否移除子包装")
} else {
let newDetail = createDetailInfo(balance, pack);
newDetail.fromLocationCode=balance.locationCode
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
newDetail.handleQty = 0
item.subList.push(newDetail);
}
}
scanPopupGetFocus()
} else {
if (detail.scaned == true) {
// this.showErrorMessage("[" + detail.packingNumber + "[" + balance.batch + "]")
}
}
}
// calcHandleQty(this.detailSource);
console.log(this.detailSource)
for (let item of this.detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined) {
if (detail.scaned) {
item.handleQty = calc.add(result.label.qty, detail.handleQty)
detail.handleQty = calc.add(result.label.qty, detail.handleQty);
}
item.qty = calc.add(item.qty, detail.qty);
}
}
}
}
//
const getRecommendLocation = (balance, pack, callback) => {
proxy.$modal.loading('扫描中...')
@ -356,6 +553,10 @@ const scanPopupGetFocus = () => {
}
}
const commit = () => {
if (positionInfo.value == '请选择生产线' || !positionInfo.value) {
showErrorMessage("请选择生产线")
return
}
proxy.$modal.loading('提交中....')
//
console.log(444444, detailSource.value)
@ -372,7 +573,7 @@ const commit = () => {
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成直接发料记录<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成直接发料记录\n${res.data}`)
} else {
showErrorMessage(`提交失败[${res.msg}]`)
}
@ -450,6 +651,7 @@ const showMessage = (message) => {
const showErrorMessage = (message) => {
comMessageRef.value.showErrorMessage(message, (res) => {
if (res) {
scanPopupGetFocus()
}
})
}

645
src/pages/issue/record/directIssue0816.vue

@ -0,0 +1,645 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='getBusinessType' v-if="detailSource.length==0"></com-blank-view>
</view>
<view class="page-wraper" v-if="detailSource.length>0">
<view class="page-header">
<view class="header-view">
<view class="header_item">
来源库位 : {{fromLocationCode}}
</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="">
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent"
:isShowFromLocation="false" @removeItem="removeItem(index,item)"
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData"
@removePack="removePack" :isShowParentPack="false">
</record-com-detail-card>
</view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class="uni-row uni-flex">
<text>生产线:</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 class=" uni-flex uni-row">
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button>
</view>
</view>
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</view>
<win-scan-parent-package ref="scanPopup" @getResult='getScanResult'></win-scan-parent-package>
<!-- <win-scan-package ref="scanPopup" @getResult='getScanResult'></win-scan-package> -->
<!-- <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode">
</winComScanBalance> -->
<!-- <balanceQuery ref="refBalanceQuery"></balanceQuery> -->
<comMessage ref="comMessage"></comMessage>
</view>
</template>
<script>
import {
issueRecordSubmit,
getWorkShopLineStation,
getTransactionByFilter
} from '@/api/request2.js';
import {
goHome,
getPackingNumberAndBatchByList,
deepCopyData
} from '@/common/basic.js';
import {
calc
} from '@/common/calc.js';
import {
getInventoryStatusDesc,
getDirectoryItemArray
} from '@/common/directory.js';
import {
getBusinessType,
createItemInfo,
createDetailInfo,
createDetailByPackInfo,
calcTreeHandleQty,
calcHandleQty
} from '@/common/record.js';
import {
getManagementPrecisions,
getPrecisionStrategyList,
getPrecisionStrategyParams
} from '@/common/balance.js';
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPack from '@/mycomponents/scan/winScanPack.vue'
import requiredLocation from '@/mycomponents/location/requiredLocation.vue'
import comBlankView from '@/mycomponents/common/comBlankView.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue'
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue'
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue'
// import balanceQuery from '@/mycomponents/query/balanceQuery.vue'
import winScanParentPackage from '@/mycomponents/scan/winScanParentPackage.vue'
export default {
components: {
winScanButton,
winScanPack,
requiredLocation,
comBlankView,
winScanLocation,
winScanPackAndLocation,
recordComDetailCard,
recordDetailCard,
balanceSelect,
winComScanBalance,
winScanParentPackage
// balanceQuery
},
data() {
return {
id: '',
dataContent: {}, //
detailSource: [], //
fromLocationInfo: {},
fromLocationCode: "",
fromLocationAreaTypeList: [],
toLocationAreaTypeList: [],
inInventoryStatus: "", //
outInventoryStatus: "", //
businessType: {},
showToLoaction: true,
recommendLocationList: [], //
fromWarehouseCode: '', //
businessTypeCode: "Issue",
positionList: [],
show: false,
positionInfo: "请选择生产线",
resultData: {},
itemCode: ""
};
},
onLoad(option) {
uni.setNavigationBarTitle({
title: option.title
})
this.clearData();
this.getBusinessType()
// if (this.positionList.length == 0) {
getWorkShopLineStation().then(res => {
if (res.data != null && res.data.length > 0) {
this.positionList = res.data
} else {
this.showErrorMessage('未查找到位置信息');
}
}).catch(error => {
this.showErrorMessage(error);
})
// }
},
//
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
} else if (e.index == 1) {
// this.$refs.refBalanceQuery.showDrawer();
// this.closeScanPopup();
}
},
//
onBackPress(e) {},
onPullDownRefresh() {},
mounted() {},
methods: {
// showDrawer() {
// this.$refs.showRight.open();
// },
getBusinessType() {
getBusinessType(this.businessTypeCode, res => {
if (res.success) {
this.businessType = res.businessType;
this.fromInventoryStatuses = getDirectoryItemArray(res.fromInventoryStatuses);
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList
this.openScanPopup();
} else {
this.showErrorMessage(res.message)
}
});
},
getScanResult(result) {
let pack = result.package;
let childBalance = result.balance.childBalance;
let parentBalance = result.balance.parentBalance[0];
//1.
if (this.itemCode) {
var item = this.detailSource.find(res => res.itemCode == pack.itemCode)
if (item == undefined) {
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】不在此次发料记录中")
return;
}
if (item.subList.length > 0) {
var detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == pack.batch) {
return r;
}
})
if (detail && detail.scaned) {
this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch + "]重复扫描")
return;
}
}
}
//2.
//
if (pack.parentNumber) {
//
if (childBalance.length == 0) {
this.getTransactionList(pack.number, transactionRes => {
if (transactionRes.length == 0) {
this.setPackageData(parentBalance, pack);
} else {
this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch +
"]已经发过料")
}
});
} else { //
this.setPackageData(childBalance[0], pack);
}
} else {
//
if(pack.subList.length==0){
this.getTransactionList(pack.number, transactionRes => {
if (transactionRes.length == 0) {
this.setPackageData(childBalance[0], pack);
} else {
this.showErrorMessage("箱码[" + pack.number + "批次[" + pack.batch +
"]已经发过料")
}
});
}else {
let packparams = '';
pack.subList.forEach(pack => {
packparams = packparams + pack.number + ','
})
packparams = packparams.trimEnd(',');
this.getTransactionList(packparams, transactionRes => {
//
pack.subList.forEach(sub => {
let subBalance = childBalance.find(r => r.packingNumber == sub.number);
if (subBalance) {
//
if (subBalance.locationCode == parentBalance.locationCode) {
this.setPackageData(subBalance, sub);
} else {
//
}
} else {
//
//
let transaction = transactionRes.find(p => p.packingNumber == sub
.number)
if (!transaction) {
this.setPackageData(parentBalance, sub);
}
}
})
})
}
}
},
setPackageData(balance, pack) {
var item = this.detailSource.find(res => {
if (res.itemCode == balance.itemCode) {
return res
}
})
if (item == undefined) {
var itemp = createItemInfo(balance, pack);
let newDetail = this.createPackageDetail(balance, pack);
itemp.subList.push(newDetail);
this.detailSource.push(itemp);
this.itemCode = balance.itemCode;
this.fromLocationCode = balance.locationCode;
this.fromWarehouseCode = balance.warehouseCode;
this.scanPopupGetFocus()
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == pack.number &&
r.batch == pack.batch &&
r.locationCode == pack.locationCode &&
r.inventoryStatus == balance.inventoryStatus) {
return r;
}
})
if (detail == undefined) {
let newDetail = this.createPackageDetail(balance, pack);
item.subList.push(newDetail);
this.scanPopupGetFocus()
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + detail.packingNumber + "批次[" + balance.batch + "]重复扫描")
}
}
}
calcHandleQty(this.detailSource);
},
//
getTransactionList(packingNumbers, callback) {
let params = {
filters: [{
column: "businessType",
action: "==",
value: "发料"
}, {
column: "packingNumber",
action: "in",
value: packingNumbers
}, {
column: "inventoryAction",
action: "==",
value: "OUT"
}],
pageSize: 20,
pageNo: 1,
sort: "",
by: "ASC"
}
getTransactionByFilter(params).then(res => {
callback(res.data.list);
}).catch(err => {
callback([]);
})
},
createPackageDetail(balance, pack) {
let newDetail = {};
if (balance.packingNumber != pack.number) {
newDetail = createDetailByPackInfo(pack);
newDetail.inventoryStatus = balance.inventoryStatus;
} else {
newDetail = createDetailInfo(balance, pack);
if (balance.lableQty) {
newDetail.handleQty = balance.lableQty
}
}
newDetail.parentNumber = pack.parentNumber;
newDetail.packingNumber = pack.number
newDetail.packUnit = pack.packUnit;
newDetail.packQty = pack.packQty;
return newDetail;
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.scanPopupGetFocus()
}
});
},
calcTreeHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty = calc.add(item.qty, detail.qty)
}
}
}
this.$forceUpdate();
},
showSelect() {
// if (this.editPosition) {
this.show = true
// }
},
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("车间-生产线基础信息维护错误")
}
//
let toLocationCode = ''
this.positionList.forEach(item => {
if (this.workshopCode == item.value) { //
item.children.find(child => {
if (this.productionLineCode == child.value) {
toLocationCode = child.children.find(subChild => this.workStationCode ==
subChild.value).rawLocationCode;
}
})
}
})
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.toLocationCode = toLocationCode
detail.productionLineCode = this.productionLineCode
detail.workStationCode = this.workStationCode
})
})
},
removeItem(index, item) {
this.detailSource.splice(index, 1)
},
removePack() {
for (var i = 0; i < this.detailSource.length; i++) {
var item = this.detailSource[i];
if (item.subList.length == 0) {
this.detailSource.splice(i, 1)
}
}
this.updateData();
},
// openScanPopup() {
// if (this.businessType) {
// this.$refs.scanPopup.openScanPopup(this.businessType);
// } else {
// this.getBusinessType()
// }
// },
openScanPopup() {
setTimeout(r => {
this.$refs.scanPopup.openScanPopupByBusinessType(this.businessType);
})
},
showFromLocationPopup() {
this.$nextTick(() => {
this.$refs.scanLocationCode.openScanPopup();
})
},
closeScanPopup() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup();
}
},
scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.getfocus();
}
},
// scanLocationCode(location, code) {
// this.toLocationCode = code
// this.toLocationCode = location;
// },
commit() {
uni.showLoading({
title: "提交中....",
mask: true
});
//
let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource);
//2:
getPrecisionStrategyList(precisionStrategyParams, res => {
if (res.success) {
this.managementList = res.list;
var params = {
...this.setRecordParams()
}
console.log("提交参数", JSON.stringify(params));
issueRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成直接发料记录\n" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} else {
uni.hideLoading();
this.showErrorMessage(res.message);
}
});
},
setRecordParams() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode,
detail.packingNumber, detail.toLocationCode, detail.batch);
var submitItem = deepCopyData(detail)
submitItem.toPackingNumber = info.packingNumber;
submitItem.toBatch = info.batch;
submitItem.toContainerNumber = detail.containerNumber;
submitItem.fromPackingNumber = info.packingNumber;
submitItem.fromBatch = info.batch;
submitItem.fromContainerNumber = detail.containerNumber;
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
// detail.toInventoryStatus = detail.inventoryStatus
// detail.toLocationCode = detail.toLocationCode
submitItem.qty = detail.handleQty;
submitItem.package = "";
submitItem.recordList = [{
toInventoryStatus: detail.inventoryStatus,
fromParentPackingNumber: detail.parentNumber,
fromPackingNumber: info.packingNumber,
fromBatch: info.batch,
toPackingNumber: info.packingNumber,
toBatch: info.batch,
fromLocationCode: detail.locationCode,
toLocationCode: detail.toLocationCode,
handleQty: detail.handleQty,
fromPackUnit: detail.packUnit,
toPackUnit: detail.packUnit,
fromPackQty: detail.packQty,
toPackQty: detail.packQty
}]
subList.push(submitItem)
}
})
})
if (subList.length > 0) {
this.dataContent.toWarehouseCode = subList[0].toWarehouseCode;
}
this.dataContent.subList = subList
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.fromWarehouseCode;
return this.dataContent;
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
closeScanMessage() {
this.scanPopupGetFocus();
},
getLocation(location, code) {
this.getFromLocationCode(location, code)
},
getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code;
this.openScanPopup();
},
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.clearData();
})
},
updateData() {
calcHandleQty(this.detailSource);
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
if (item.qty == 0) {
this.detailSource.splice(i, 1)
}
}
this.$forceUpdate();
},
clearData() {
this.fromLocationInfo = {};
this.fromLocationCode = '';
this.fromWarehouseCode = '';
this.toWarehouseCode = '';
this.detailSource = [];
this.positionInfo = "请选择生产线";
this.itemCode = ""
}
}
}
</script>
<style scoped lang="scss">
</style>

4
src/pages/issue/record/issueRecord.vue

@ -264,7 +264,7 @@ export default {
item.subList.push(newDetail)
calcHandleQty(this.detailSource)
} else if (detail.scaned == true) {
this.showErrorMessage(`箱码[${detail.packingNumber}]批次[${balance.batch}]已经在列表中`)
this.showErrorMessage(`箱码[${detail.packingNumber}]批次[${balance.batch}]重复扫描`)
}
}
},
@ -393,7 +393,7 @@ export default {
.then((res) => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage(`提交成功<br>生成直接发料记录<br>${res.data}`)
this.showCommitSuccessMessage(`提交成功\n生成直接发料记录\n${res.data}`)
} else {
this.showErrorMessage(`提交失败[${res.msg}]`)
}

2
src/pages/issue/record/issueRecordV1.vue

@ -301,7 +301,7 @@ const submitJob = () => {
.then((res) => {
uni.hideLoading()
if (res.data) {
showCommitSuccessMessage(`提交成功<br>生成发料记录<br>${res.data}`)
showCommitSuccessMessage(`提交成功\n生成发料记录\n${res.data}`)
} else {
showErrorMessage(`提交失败:【${res.msg}`)
}

Loading…
Cancel
Save