Browse Source

制品上架记录

wms3.0_pda
lijuncheng 1 year ago
parent
commit
1fcc01cda4
  1. 2
      common/record.js
  2. 2
      mycomponents/qty/qty.vue
  3. 163
      pages/productPutaway/record/productPutawayRecord.vue
  4. 2
      static/config.json

2
common/record.js

@ -26,7 +26,7 @@ export function createDetailInfo(data, pack) {
Object.assign(detail, data) Object.assign(detail, data)
detail.balanceQty = Number(detail.qty) detail.balanceQty = Number(detail.qty)
detail.stdPackQty = Number(pack.stdPackQty) detail.stdPackQty = Number(pack.stdPackQty)
detail.stdPackUnit =pack.stdPackUnit detail.stdPackUnit = pack.stdPackUnit
detail.package = pack; detail.package = pack;
return detail; return detail;
} }

2
mycomponents/qty/qty.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="center uni-column"> <view class="center uni-column">
<view class="uni-flex uni-row"> <view class="uni-flex uni-row">
{{dataContent.inventoryStatus}} <!-- {{dataContent.inventoryStatus}} -->
<status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status> <status v-show="isShowStatus" :status='dataContent.inventoryStatus'></status>
<view class="text_default center"> <view class="text_default center">
{{Number(dataContent.qty)}} {{Number(dataContent.qty)}}

163
pages/productPutaway/record/productPutawayRecord.vue

@ -18,13 +18,14 @@
</scroll-view> </scroll-view>
</view> </view>
<requiredLocation v-if="showToLoaction" 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="">
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode'
:locationTypeList="tolocationTypeList"></requiredLocation>
</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>
@ -44,15 +45,14 @@
<script> <script>
import { import {
productPutawayRequestSubmit,
productPutawayRecordSubmit productPutawayRecordSubmit
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
goHome, goHome,
getPackingNumberAndBatch getPackingNumberAndBatchByList
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getManagementPrecisions getPrecisionStrategyList
} from '@/common/balance.js'; } from '@/common/balance.js';
import { import {
@ -93,28 +93,19 @@
data() { data() {
return { return {
id: '', id: '',
receiptJob: {},
received: false,
isShowPackingCode: true,
scanCount: 0, scanCount: 0,
dataContent: {}, // dataContent: {}, //
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
locationTypeList: [], locationTypeList: [],
toLocationInfo: {},
businessTypeInfo: {},
fromLocationInfo: {},
fromLocationCode: "", fromLocationCode: "",
toLocationInfo: {},
toLocationCode: "", toLocationCode: "",
isShowLocation: false,
fromlocationTypeList: [], fromlocationTypeList: [],
tolocationTypeList: [], tolocationTypeList: [],
allowModifyLocation: false,
inInventoryStatus: "", // inInventoryStatus: "", //
outInventoryStatus: "", // outInventoryStatus: "", //
businessType: {}, businessType: {},
showToLoaction:true managementList:[]
}; };
}, },
onLoad(option) { onLoad(option) {
@ -126,7 +117,7 @@
this.tolocationTypeList = res.tolocationTypeList; this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup(); this.showFromLocationPopup();
} else { } else {
this.$refs.comMessage.showBreakMessage(res.message ); this.showErrorMessage(res.message)
} }
}); });
@ -243,81 +234,116 @@
}, },
commit() { commit() {
if (this.showToLoaction &&this.toLocationCode == "") { if (this.toLocationCode == "") {
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
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
// getPrecisionStrategyList(precisionStrategParams, res => {
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.setRecordParams(true) var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交" + JSON.stringify(params))
productPutawayRecordSubmit(params).then(res => {
// productPutawayRecordSubmit(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("没有要提交的数据,请先扫描")
}
}, },
setRecordParams(queryModel) { setPrecisionStrategParams() {
var itemList = []
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
if (detail.scaned) {
detail.toLocationCode = this.toLocationCode;
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 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;
subList.push(detail) subList.push(detail)
} }
}) })
}) })
this.dataContent.subList = subList this.dataContent.subList = subList;
this.dataContent.creator = creator; this.dataContent.creator = creator;
return this.dataContent; return this.dataContent;
}, },
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
if (res) {} if (res) {}
@ -346,25 +372,20 @@
this.getFromLocationCode(location, code) this.getFromLocationCode(location, code)
}, },
getFromLocationCode(location, code) { getFromLocationCode(location, code) {
this.fromLocationInfo = location;
this.fromLocationCode = code; this.fromLocationCode = code;
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
if (this.fromLocationCode == code) {
uni.showToast({
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致",
duration: 2000
})
return
}
this.ToLocationCodeInfo = location;
this.toLocationCode = code; this.toLocationCode = code;
}, },
showCommitSuccessMessage(hint) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = ''; this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
}) })
}, },

2
static/config.json

@ -18,7 +18,7 @@
"request_url": { "request_url": {
"name": "request_url", "name": "request_url",
"value": "http://192.168.0.106:12080/admin-api", "value": "http://192.168.0.230:12080/admin-api",
"dev2": "http://192.168.0.157:12080/admin-api", "dev2": "http://192.168.0.157:12080/admin-api",
"chefang": "http://192.168.0.180:12080/admin-api", "chefang": "http://192.168.0.180:12080/admin-api",
"chenxinming": "http://192.168.0.230:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",

Loading…
Cancel
Save