Browse Source

修改库存转移

wms3.0_pda
lijuncheng 11 months ago
parent
commit
38a408ecbb
  1. 13
      api/request2.js
  2. 10
      common/array.js
  3. 2
      mycomponents/status/statusEdit.vue
  4. 224
      pages/inventoryMove/coms/comMove.vue
  5. 9
      pages/inventoryMove/coms/comMoveRecord.vue
  6. 4
      pages/inventoryMove/coms/comMovebalance.vue
  7. 2
      pages/inventoryMove/record/holdToOkRecord.vue
  8. 2
      pages/inventoryMove/record/holdToScrapRecord.vue
  9. 2
      pages/inventoryMove/record/moveFreeRecord.vue
  10. 2
      pages/inventoryMove/record/okToHoldRecord.vue
  11. 2
      pages/inventoryMove/record/oktoScrapRecord.vue
  12. 2
      pages/inventoryMove/record/scrapToHoldRecord.vue
  13. 2
      static/config.json

13
api/request2.js

@ -1134,6 +1134,19 @@ export function inventoryMoveSubmit(params) {
}); });
} }
/**
* 库存转移记录 提交
* @param {*} 任务id
*
*/
export function inventoryMoveRecordSubmit(params) {
return request({
url: baseApi + "/wms/inventorymove-record-main/create",
method: "post",
data: params,
});
}
/** /**
* 盘点 任务 * 盘点 任务
* status 任务状态 * status 任务状态

10
common/array.js

@ -233,19 +233,19 @@ export function getEditRemoveOption() {
export function getInventoryStatusArray() { export function getInventoryStatusArray() {
let array = [{ let array = [{
text: '待检', text: '待检',
value: "kcztINSP" value: "INSP"
}, { }, {
text: '合格', text: '合格',
value: "kcztOK" value: "OK"
}, { }, {
text: '不合格', text: '不合格',
value: "kcztNOK" value: "NOK"
}, { }, {
text: '隔离', text: '隔离',
value: "kcztHOLD" value: "HOLD"
}, { }, {
text: '报废', text: '报废',
value: "kcztSCRAP" value: "SCRAP"
}] }]
return array; return array;
} }

2
mycomponents/status/statusEdit.vue

@ -75,7 +75,7 @@
close() { close() {
this.$refs.popup.close() this.$refs.popup.close()
}, },
statusStyle: function(val) { statusStyle(val) {
return getInventoryStatusStyle(val); return getInventoryStatusStyle(val);
}, },
tagClick(item) { tagClick(item) {

224
pages/inventoryMove/coms/comMove.vue

@ -10,7 +10,8 @@
<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="">
<com-move-record :dataContent="item" :index="index" @removeData="removeData" <com-move-record :dataContent="item" :index="index" @removeData="removeData"
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack'> :isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack'
:allowEditStatus ="allowEditStatus">
</com-move-record> </com-move-record>
</view> </view>
<u-line /> <u-line />
@ -34,7 +35,7 @@
</view> </view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'"></win-scan-pack-and-location> <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'"></win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getLocation' <win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromLocationTypeArray"></win-scan-location> :locationTypeList="fromlocationTypeList"></win-scan-location>
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
</view> </view>
</template> </template>
@ -49,13 +50,21 @@
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue' import comMessage from '@/mycomponents/common/comMessage.vue'
import { import {
getBalanceByUniquecode, inventoryMoveRecordSubmit,
} from '@/api/request.js'; } from '@/api/request2.js';
import { import {
getDirectoryItemArray getDirectoryItemArray
} from '@/common/directory.js'; } from '@/common/directory.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import { import {
getBusinessType, getBusinessType,
createItemInfo, createItemInfo,
@ -84,9 +93,14 @@
// default: "" // default: ""
// }, // },
isShowStatus: { isShowStatus: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean, type: Boolean,
default: false default: false
}, },
businessTypeCode: { businessTypeCode: {
type: String, type: String,
default: "Move" default: "Move"
@ -95,14 +109,17 @@
data() { data() {
return { return {
fromLocationCode: "", fromLocationCode: "",
fromLocationInfo: {},
fromLocationTypeArray: [],
toLocationCode: "", toLocationCode: "",
toLocationInfo: {}, toLocationInfo: {},
toLocationTypeArray: [], toLocationTypeArray: [],
toInventoryStatus: "", toInventoryStatus: "",
businessType: {}, // businessType: {}, //
detailSource: [], // detailSource: [], //
title:"",
dataContent:{},
toWarehouseCode:"",
fromlocationTypeList: [],
tolocationTypeList: [],
} }
}, },
@ -114,7 +131,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)
} }
}); });
this.updateTitle(); this.updateTitle();
@ -126,27 +143,27 @@
methods: { methods: {
updateTitle() { updateTitle() {
var name ="" if(this.businessTypeCode=="InventoryMoveRecord"){
if(this.businessTypeCode=="Move"){ this.title = "库存转移记录";
name = "库存转移记录"; this.toInventoryStatus = "OK"
}else if(this.businessTypeCode=="HoldToOkRecord"){ }else if(this.businessTypeCode=="HoldToOkRecord"){
name = "隔离转合格记录"; this.title = "隔离转合格记录";
this.toInventoryStatus = "OK" this.toInventoryStatus = "OK"
}else if(this.businessTypeCode=="HoldToScrapRecord"){ }else if(this.businessTypeCode=="HoldToScrapRecord"){
name = "隔离转报废记录"; this.title = "隔离转报废记录";
this.toInventoryStatus = "SCRAP" this.toInventoryStatus = "SCRAP"
}else if(this.businessTypeCode=="OkToHoldRecord"){ }else if(this.businessTypeCode=="OkToHoldRecord"){
name = "合格转隔离记录"; this.title = "合格转隔离记录";
this.toInventoryStatus ="HOLD" this.toInventoryStatus ="HOLD"
}else if(this.businessTypeCode=="OktoScrapRecord"){ }else if(this.businessTypeCode=="OktoScrapRecord"){
name = "合格转报废记录"; this.title = "合格转报废记录";
this.toInventoryStatus ="SCRAP" this.toInventoryStatus ="SCRAP"
}else if(this.businessTypeCode=="ScrapToHoldRecord"){ }else if(this.businessTypeCode=="ScrapToHoldRecord"){
name = "报废转隔离记录"; this.title = "报废转隔离记录";
this.toInventoryStatus ="HOLD" this.toInventoryStatus ="HOLD"
} }
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: name title: this.title
}) })
}, },
openScanPopup() { openScanPopup() {
@ -166,11 +183,11 @@
this.getfromLocationCode(location) this.getfromLocationCode(location)
}, },
getfromLocationCode(location) { getfromLocationCode(location) {
this.fromLocationInfo = location;
this.fromLocationCode = location.code; this.fromLocationCode = location.code;
this.openScanPopup(); this.openScanPopup();
}, },
getToLocationCode(location, code) { getToLocationCode(location, code) {
this.toWarehouseCode = location.warehouseCode
this.toLocationCode = code; this.toLocationCode = code;
}, },
getScanResult(result) { getScanResult(result) {
@ -188,6 +205,8 @@
if (item == undefined) { if (item == undefined) {
var itemp = createItemInfo(balance,pack); var itemp = createItemInfo(balance,pack);
let newDetail = createDetailInfo(balance, pack); // let newDetail = createDetailInfo(balance, pack); //
newDetail.inventoryStatus =balance.inventoryStatus;
newDetail.toInventoryStatus =this.toInventoryStatus
itemp.subList.push(newDetail); itemp.subList.push(newDetail);
this.detailSource.push(itemp) this.detailSource.push(itemp)
} else { } else {
@ -203,6 +222,8 @@
if (detail == undefined) { if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack); let newDetail = createDetailInfo(balance, pack);
newDetail.inventoryStatus = balance.inventoryStatus;
newDetail.toInventoryStatus =this.toInventoryStatus
item.subList.push(newDetail); item.subList.push(newDetail);
} else { } else {
this.showErrorMessage(balance.packingNumber + "已经在列表中") this.showErrorMessage(balance.packingNumber + "已经在列表中")
@ -212,41 +233,6 @@
}, },
createItemInfo(balance, pack) {
let item = {
itemCode: pack.itemCode,
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
qty: balance.qty,
handleQty: 0,
uom: pack.uom,
subList: []
}
return item;
},
createDetailInfo(data, pack) {
data.scaned = true;
data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
let detail = {};
Object.assign(detail, data)
detail.balanceQty = detail.qty
detail.package = pack
return detail;
},
calcHandleQty() {
for (let item of this.detailSource) {
item.qty = 0;
for (let detail of item.subList) {
if (detail != undefined) {
item.qty += detail.qty
}
}
}
this.$forceUpdate();
},
showErrorMessage(message) { showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => { this.$refs.comMessage.showErrorMessage(message, res => {
@ -283,35 +269,133 @@
} }
} }
}, },
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
})
},
commit() { commit() {
uni.showLoading({
title: "提交中....",
mask: true
});
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) {
console.log("提交参数", JSON.stringify(params)); //
uni.showLoading({
title: "提交中....",
mask: true
});
this.managementList = [];
var precisionStrategParams = this.setPrecisionStrategParams()
// getPrecisionStrategyList(precisionStrategParams, res => {
//退 if (res.success) {
var params = this.setRecordParams(true) this.managementList = res.list;
console.log("提交参数", JSON.stringify(params)); var params = this.setParams()
console.log("提交" + JSON.stringify(params))
inventoryMoveRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成"+this.title+"记录<br>" + res.data)
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
purchaseReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购退货记录" + res.data)
} else { } else {
this.showErrorMessage("提交失败" + res.msg) uni.hideLoading();
this.showErrorMessage(res.message);
} }
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
}) })
} else { } else {
this.showErrorMessage("没有要提交的数据") this.showErrorMessage("没有要提交的数据,请先扫描")
} }
},
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 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);
detail.itemCode = detail.itemCode;
detail.itemName = detail.package.itemName;
detail.itemDesc1 = detail.package.itemDesc1;
detail.itemDesc2 = detail.package.itemDesc2;
detail.fromInventoryStatus = detail.inventoryStatus;
// detail.toInventoryStatus = this.toInventoryStatus;
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;
subList.push(detail)
}
})
})
this.dataContent.subList = subList;
this.dataContent.creator = creator;
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode;
this.dataContent.toWarehouseCode = this.toWarehouseCode;
this.dataContent.businessType = this.businessTypeCode;
return this.dataContent;
},
} }
} }
</script> </script>

9
pages/inventoryMove/coms/comMoveRecord.vue

@ -24,7 +24,7 @@
</view> </view>
</uni-collapse-item> </uni-collapse-item>
</uni-collapse> </uni-collapse>
<balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="isShowStatus" :allowEditStatus="true"> <balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="isShowStatus" :allowEditStatus="allowEditStatus">
</balanceQtyEdit> </balanceQtyEdit>
<job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup> <job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
@ -75,9 +75,14 @@
default: "" default: ""
}, },
isShowStatus: { isShowStatus: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean, type: Boolean,
default: false default: false
} },
}, },
watch: { watch: {

4
pages/inventoryMove/coms/comMovebalance.vue

@ -19,14 +19,14 @@
:fromInventoryStatus="fromInventoryStatus" :toInventoryStatus="toInventoryStatus"> :fromInventoryStatus="fromInventoryStatus" :toInventoryStatus="toInventoryStatus">
</moveStatus> </moveStatus>
</view> </view>
<view class="" v-if="isDevlement()"> <!-- <view class="" v-if="isDevlement()">
<view class="" style="font-size: 40rpx;"> <view class="" style="font-size: 40rpx;">
<u-button @click="copy" size="mini" type="primary">复制箱码</u-button> <u-button @click="copy" size="mini" type="primary">复制箱码</u-button>
</view> </view>
<view class="" style="font-size: 40rpx;"> <view class="" style="font-size: 40rpx;">
<u-button @click="copyPro" size="mini" type="primary">复制制品</u-button> <u-button @click="copyPro" size="mini" type="primary">复制制品</u-button>
</view> </view>
</view> </view> -->
</view> </view>
<!-- <u-line></u-line> --> <!-- <u-line></u-line> -->

2
pages/inventoryMove/record/holdToOkRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove businessTypeCode='HoldToOkRecord' :isShowStatus="false"> </comMove> <comMove businessTypeCode='HoldToOkRecord' > </comMove>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/holdToScrapRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove :isShowStatus="true" businessTypeCode='HoldToScrapRecord'> </comMove> <comMove businessTypeCode='HoldToScrapRecord'> </comMove>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/moveFreeRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove :isShowStatus="true" businessTypeCode='Move'> </comMove> <comMove :allowEditStatus="true" businessTypeCode='InventoryMoveRecord'> </comMove>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/okToHoldRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove businessTypeCode='OkToHoldRecord' :isShowStatus="true"> </comMove> <comMove businessTypeCode='OkToHoldRecord' > </comMove>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/oktoScrapRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove businessTypeCode='OktoScrapRecord' :isShowStatus="true"> </comMove> <comMove businessTypeCode='OktoScrapRecord' > </comMove>
</view> </view>
</template> </template>

2
pages/inventoryMove/record/scrapToHoldRecord.vue

@ -1,6 +1,6 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper">
<comMove :isShowStatus="true" businessTypeCode='ScrapToHoldRecord'> </comMove> <comMove businessTypeCode='ScrapToHoldRecord'> </comMove>
</view> </view>
</template> </template>

2
static/config.json

@ -18,7 +18,7 @@
"request_url": { "request_url": {
"name": "request_url", "name": "request_url",
"value": "http://dev.ccwin-in.com:25100/api/admin-api", "value": "http://192.168.0.180: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