Browse Source

制品收货记录

wms3.0_pda
lijuncheng 11 months ago
parent
commit
40fe229f4c
  1. 4
      api/request2.js
  2. 17
      common/label.js
  3. 1
      common/record.js
  4. 2
      mycomponents/package/packageTarget.vue
  5. 4
      mycomponents/production/productionInfo.vue
  6. 6
      mycomponents/scan/winComScan.vue
  7. 2
      mycomponents/scan/winScanLocation.vue
  8. 6
      mycomponents/scan/winScanPack.vue
  9. 11
      pages/productReceipt/coms/comProductRecord.vue
  10. 2
      pages/productReceipt/job/productReceiptDetail.vue
  11. 253
      pages/productReceipt/record/productReceiptRecord.vue

4
api/request2.js

@ -1056,8 +1056,8 @@ export function productionReceiptJobSubmit(params) {
*/
export function productionReceiptRecordSubmit(params) {
return request({
url: baseApi + "/magic-api/pda/job/putaway/jobSubmit",
method: "put",
url: baseApi + "/wms/productreceipt-record-main/create",
method: "post",
data: params,
});
}

17
common/label.js

@ -6,7 +6,7 @@ import {
} from '@/api/request2.js';
export function getLabelInfo(scanMsg, callBack) {
export function getLabelInfo(scanMsg,headerType, callBack) {
console.log('扫描信息:', scanMsg);
if (scanMsg.length == 0) {
return null
@ -15,6 +15,21 @@ export function getLabelInfo(scanMsg, callBack) {
let header = items[0];
let version = items[1];
if ((header != undefined) && (version!=undefined)) {
if(header!=headerType){
let labelResult = {
label: {
labelType: "",
barType: '',
code:""
},
package: null,
success: false,
message: '请输入'+headerType+"开始的标签",
}
callBack(labelResult);
return;
}
//解析扫描的是一维码还是二维码
let type = header.substring(header.length - 1, header.length);
if (type == 'Q') //qrcode

1
common/record.js

@ -28,6 +28,7 @@ export function createDetailInfo(data, pack) {
detail.stdPackQty = Number(pack.stdPackQty)
detail.stdPackUnit = pack.stdPackUnit
detail.package = pack;
return detail;
}

2
mycomponents/package/packageTarget.vue

@ -11,7 +11,7 @@
<image v-if="isShowEdit" style="width: 45rpx;height: 45rpx;" src="/static/icons/icons_edit.svg"
></image>
</view>
<win-scan-pack ref="scanPopup" @getResultult='getScanResult'></win-scan-pack>
<win-scan-pack ref="scanPopup" @getResultult='getScanResult' headerType="HPQ"></win-scan-pack>
</view>
</template>

4
mycomponents/production/productionInfo.vue

@ -1,11 +1,11 @@
<template>
<view class="pack_view uni-inline-item">
<text style="color: #606266;font-size: 13px;">生产线</text>
<text style="color: #606266;font-size: 13px;">{{dataContent.ProductionLineCode}}</text>
<text style="color: #606266;font-size: 13px;">{{dataContent.productionLineCode}}</text>
</view>
<view class="pack_view uni-inline-item">
<text style="color: #606266;font-size: 13px;">生产日期</text>
<text style="color: #606266;font-size: 13px;">{{dataContent.ProduceDate}}</text>
<text style="color: #606266;font-size: 13px;">{{dataContent.produceDate}}</text>
</view>
</template>

6
mycomponents/scan/winComScan.vue

@ -84,9 +84,9 @@
type: Boolean,
default: true
},
labelType:{
headerType:{
type: String,
default: 'PurchaseLabel' //PurchaseLabel LocationLabel MakeLabel ContainerLabel
default: 'HPQ' //HLB HMQ HCQ HPQ
}
},
data() {
@ -154,7 +154,7 @@
if (that.isShowHistory) {
that.scanList.unshift(content);
}
getLabelInfo(content, callback => {
getLabelInfo(content,this.headerType, callback => {
let scanResult = callback;
if (scanResult.success) {
that.clear();

2
mycomponents/scan/winScanLocation.vue

@ -13,7 +13,7 @@
<view class="">
<view class="">
<win-com-scan ref="scan" labelType="LocationLabel" @getResult="getScanResult" :placeholder='title' :clearResult="false"
:boxFocus="true" :isShowHistory="isShowHistory">
:boxFocus="true" :isShowHistory="isShowHistory" headerType="HLB">
</win-com-scan>
</view>
</view>

6
mycomponents/scan/winScanPack.vue

@ -14,7 +14,7 @@
</view>
<view class="">
<view class="">
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType"
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan>
</view>
</view>
@ -45,6 +45,10 @@
isShowHistory: {
type: Boolean,
default: true
},
headerType:{
type: String,
default: 'HPQ'
}
},
data() {

11
pages/productReceipt/coms/comProductRecord.vue

@ -16,9 +16,12 @@
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
<production-label :dataContent="item" :packageContent="item.package"
<balance :dataContent="item" :isShowStdPack="false" :isShowStatus="true"
:isShowPack="true" :isShowLocation="false"></balance>
<!-- <production-label :dataContent="item" :packageContent="item.package"
:isShowLocation="false">
</production-label>
</production-label> -->
</uni-swipe-action-item>
</uni-swipe-action>
</view>
@ -40,6 +43,7 @@
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import packageDetailPopup from '@/mycomponents/package/packageDetailPopup.vue'
import balance from '@/mycomponents/balance/balance.vue'
import {
getDetailOption,
@ -54,7 +58,8 @@
productionLabel,
recommendQtyEdit,
record,
comMessage
comMessage,
balance
},
props: {
dataContent: {

2
pages/productReceipt/job/productReceiptDetail.vue

@ -37,7 +37,7 @@
</view>
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<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>
</view>
</template>

253
pages/productReceipt/record/productReceiptRecord.vue

@ -8,7 +8,7 @@
<scroll-view scroll-y="true" class="page-main-scroll">
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<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">
</com-product-record>
</view>
@ -17,13 +17,21 @@
</scroll-view>
</view>
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
<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>
@ -33,18 +41,23 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button>
</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>
</view>
</template>
<script>
import {
productionReceiptRecordSubmit
productionReceiptRecordSubmit,
getWorkShopLineStation
} from '@/api/request2.js';
import {
goHome
getPrecisionStrategyList
} from '@/common/balance.js';
import {
goHome,
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
@ -74,15 +87,26 @@
},
data() {
return {
jobContent: {}, //
detailSource: [], //
toLocationTypeList: [],
toLocationInfo: {},
toLocationCode: "",
fromLocationTypeList: [],
fromLocationInfo: {},
fromLocationCode: "",
businessType: {},
dataContent:{},
managementList:[],
show:false,
positionInfo:"请选择位置",
positionList:[],
productionLineCode:'',
rawLocationCode:"",
fgLocationCode:"",
workshopCode :"",
workStationCode :"",
workShopName :"",
productionLineName :"",
workStationName :"",
};
},
onLoad(option) {
@ -94,9 +118,14 @@
this.tolocationTypeList = res.tolocationTypeList;
this.openScanPopup();
} else {
this.$refs.comMessage.showBreakMessage(res.message);
this.showErrorMessage(res.message)
}
});
getWorkShopLineStation().then(res => {
this.positionList = res.data
}).catch(error => {
})
},
//
onNavigationBarButtonTap(e) {
@ -129,9 +158,7 @@
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == label.packingNumber &&
r.batch == label.batch &&
r.locationCode == label.locationCode &&
r.inventoryStatus == label.inventoryStatus) {
r.batch == label.batch) {
return r;
}
})
@ -141,7 +168,7 @@
item.subList.push(newDetail);
} else {
if (detail.scaned == true) {
this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + balance.batch + "]已经在列表中")
this.showErrorMessage("箱码[" + label.packingNumber + "批次[" + label.batch + "]已经在列表中")
}
}
}
@ -167,7 +194,7 @@
Object.assign(detail, label)
detail.scaned = true;
detail.qty = Number(label.qty);
detail.inventoryStatus = "kcztOK"
detail.inventoryStatus = "OK"
detail.stdPackQty = pack.stdPackQty;
detail.stdPackUnit = pack.stdPackUnit;
@ -194,71 +221,117 @@
this.calcHandleQty();
},
openScanPopup() {
// if (this.fromLocationCode == "") {
// this.showFromLocationPopup();
// return
// }
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() {
if (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()
var params = this.setParams();
getPrecisionStrategyList(precisionStrategParams, res => {
if (res.success) {
this.managementList = res.list;
var params = this.setParams()
console.log("提交" + JSON.stringify(params))
// productionReceiptRecordSubmit(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)
// })
productionReceiptRecordSubmit(params).then(res => {
uni.hideLoading()
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() {
var subList = []
var creator = this.$store.state.user.id
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
// var info = getPackingNumberAndBatch(this.managementList, detail.itemCode,
// detail.packingNumber, detail.batch);
// detail.toPackingNumber =info.packingNumber;
// detail.toBatch =info.batch;
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.fromLocationCode = detail.locationCode;
detail.toLocationCode = detail.toLocationCode;
detail.productionlineCode = this.productionLineCode;
detail.workStationCode = this.workStationCode;
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() {
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) {
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() {
for (var i = 0; i < this.detailSource.length; i++) {
@ -350,6 +404,39 @@
updateData() {
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>

Loading…
Cancel
Save