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. 228
      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 任务状态

10
common/array.js

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

2
mycomponents/status/statusEdit.vue

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

228
pages/inventoryMove/coms/comMove.vue

@ -10,7 +10,8 @@
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id">
<view class="">
<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>
</view>
<u-line />
@ -34,7 +35,7 @@
</view>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'"></win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getLocation'
:locationTypeList="fromLocationTypeArray"></win-scan-location>
:locationTypeList="fromlocationTypeList"></win-scan-location>
<com-message ref="comMessage"></com-message>
</view>
</template>
@ -49,13 +50,21 @@
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comMessage from '@/mycomponents/common/comMessage.vue'
import {
getBalanceByUniquecode,
} from '@/api/request.js';
inventoryMoveRecordSubmit,
} from '@/api/request2.js';
import {
getDirectoryItemArray
} from '@/common/directory.js';
import {
getPrecisionStrategyList
} from '@/common/balance.js';
import {
getPackingNumberAndBatchByList
} from '@/common/basic.js';
import {
getBusinessType,
createItemInfo,
@ -84,9 +93,14 @@
// default: ""
// },
isShowStatus: {
type: Boolean,
default: true
},
allowEditStatus: {
type: Boolean,
default: false
},
businessTypeCode: {
type: String,
default: "Move"
@ -95,14 +109,17 @@
data() {
return {
fromLocationCode: "",
fromLocationInfo: {},
fromLocationTypeArray: [],
toLocationCode: "",
toLocationInfo: {},
toLocationTypeArray: [],
toInventoryStatus: "",
businessType: {}, //
detailSource: [], //
title:"",
dataContent:{},
toWarehouseCode:"",
fromlocationTypeList: [],
tolocationTypeList: [],
}
},
@ -114,7 +131,7 @@
this.tolocationTypeList = res.tolocationTypeList;
this.showFromLocationPopup();
} else {
this.$refs.comMessage.showBreakMessage(res.message );
this.showErrorMessage(res.message)
}
});
this.updateTitle();
@ -126,27 +143,27 @@
methods: {
updateTitle() {
var name =""
if(this.businessTypeCode=="Move"){
name = "库存转移记录";
if(this.businessTypeCode=="InventoryMoveRecord"){
this.title = "库存转移记录";
this.toInventoryStatus = "OK"
}else if(this.businessTypeCode=="HoldToOkRecord"){
name = "隔离转合格记录";
this.title = "隔离转合格记录";
this.toInventoryStatus = "OK"
}else if(this.businessTypeCode=="HoldToScrapRecord"){
name = "隔离转报废记录";
this.title = "隔离转报废记录";
this.toInventoryStatus = "SCRAP"
}else if(this.businessTypeCode=="OkToHoldRecord"){
name = "合格转隔离记录";
this.title = "合格转隔离记录";
this.toInventoryStatus ="HOLD"
}else if(this.businessTypeCode=="OktoScrapRecord"){
name = "合格转报废记录";
this.title = "合格转报废记录";
this.toInventoryStatus ="SCRAP"
}else if(this.businessTypeCode=="ScrapToHoldRecord"){
name = "报废转隔离记录";
this.title = "报废转隔离记录";
this.toInventoryStatus ="HOLD"
}
uni.setNavigationBarTitle({
title: name
title: this.title
})
},
openScanPopup() {
@ -166,11 +183,11 @@
this.getfromLocationCode(location)
},
getfromLocationCode(location) {
this.fromLocationInfo = location;
this.fromLocationCode = location.code;
this.openScanPopup();
},
getToLocationCode(location, code) {
this.toWarehouseCode = location.warehouseCode
this.toLocationCode = code;
},
getScanResult(result) {
@ -188,6 +205,8 @@
if (item == undefined) {
var itemp = createItemInfo(balance,pack);
let newDetail = createDetailInfo(balance, pack); //
newDetail.inventoryStatus =balance.inventoryStatus;
newDetail.toInventoryStatus =this.toInventoryStatus
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
@ -203,6 +222,8 @@
if (detail == undefined) {
let newDetail = createDetailInfo(balance, pack);
newDetail.inventoryStatus = balance.inventoryStatus;
newDetail.toInventoryStatus =this.toInventoryStatus
item.subList.push(newDetail);
} else {
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) {
this.$refs.comMessage.showErrorMessage(message, res => {
@ -283,35 +269,133 @@
}
}
},
commit() {
uni.showLoading({
title: "提交中....",
mask: true
});
showCommitSuccessMessage(hint) {
this.$refs.comMessage.showSuccessMessage(hint, res => {
this.fromLocationCode = '';
this.subList = [];
this.detailSource = [];
this.toLocationCode = '';
this.dataContent = {}
this.toWarehouseCode = ""
})
},
commit() {
if (this.toLocationCode == "") {
this.showMessage("请先选择目标库位")
return;
}
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) {
this.managementList = res.list;
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)
})
//
//退
var params = this.setRecordParams(true)
console.log("提交参数", JSON.stringify(params));
purchaseReturnRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功<br>生成采购退货记录" + res.data)
} else {
this.showErrorMessage("提交失败" + res.msg)
uni.hideLoading();
this.showErrorMessage(res.message);
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
} 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>

9
pages/inventoryMove/coms/comMoveRecord.vue

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

4
pages/inventoryMove/coms/comMovebalance.vue

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

2
pages/inventoryMove/record/holdToOkRecord.vue

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

2
pages/inventoryMove/record/holdToScrapRecord.vue

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

2
pages/inventoryMove/record/moveFreeRecord.vue

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

2
pages/inventoryMove/record/okToHoldRecord.vue

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

2
pages/inventoryMove/record/oktoScrapRecord.vue

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

2
pages/inventoryMove/record/scrapToHoldRecord.vue

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

2
static/config.json

@ -18,7 +18,7 @@
"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",
"chefang": "http://192.168.0.180:12080/admin-api",
"chenxinming": "http://192.168.0.230:12080/admin-api",

Loading…
Cancel
Save