Browse Source

修改盘点扫描功能

wms3.0_pda
niexiting 8 months ago
parent
commit
9309c5e146
  1. 18
      mycomponents/qty/CountQtyEdit.vue
  2. 13
      mycomponents/scan/winComScan.vue
  3. 8
      mycomponents/scan/winScanPackAndLocation.vue
  4. 3
      mycomponents/status/balanceStatus.vue
  5. 273
      pages/count/job/countDetail.vue
  6. 2
      static/config.json

18
mycomponents/qty/CountQtyEdit.vue

@ -38,14 +38,13 @@
<text>数量 : </text> <text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;"> <view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number" <input class="qty_input" v-model="allQty" :focus="true" type="number"
@mousedown="mousedown" @mousedown="mousedown" @input="checkNum" :maxlength="maxlength" />
@input="checkNum"
:maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom> <uom :uom="dataContent.uom"></uom>
</view> </view>
</view> </view>
<u-line /> <u-line />
<view v-if="isShowBalance" class="uni-flex uni-row space-between padding title u-col-center"> <view v-if="isShowBalance"
class="uni-flex uni-row space-between padding title u-col-center">
<text>库存数量 : </text> <text>库存数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;"> <view class="uni-flex uni-row uni-center" style="align-items: center;">
<text class="text_recommend">{{Number(dataContent.balanceQty)}}</text> <text class="text_recommend">{{Number(dataContent.balanceQty)}}</text>
@ -57,7 +56,7 @@
style="align-items: center; padding-left: 30rpx;"> style="align-items: center; padding-left: 30rpx;">
<text>库存状态 : </text> <text>库存状态 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;"> <view class="uni-flex uni-row uni-center" style="align-items: center;">
<balanceStatus ref="balanceStatus" :status="inventoryStatus" :allowEdit='false' <balanceStatus ref="balanceStatus" :status="inventoryStatus" :allowEdit='true'
@updateStatus="updateStatus" @onOpen="clickState"> @updateStatus="updateStatus" @onOpen="clickState">
</balanceStatus> </balanceStatus>
</view> </view>
@ -150,7 +149,7 @@
if (dot > -1) { if (dot > -1) {
this.maxlength = dot + 7; // this.maxlength = dot + 7; //
if (value.length > dot + 7) { if (value.length > dot + 7) {
} }
} }
if (reg.test(value)) { // if (reg.test(value)) { //
@ -209,20 +208,21 @@
}, 1000) }, 1000)
}, },
calcQty(val) { calcQty(val) {
if(val>0){ if (val > 0) {
this.allQty = val * Number(this.dataContent.stdPackQty); this.allQty = val * Number(this.dataContent.stdPackQty);
} }
}, },
setValue() { setValue() {
this.dataContent.handleQty = Number(this.allQty) this.dataContent.handleQty = Number(this.allQty)
this.$emit("confirm"); this.$emit("confirm", Number(this.allQty), this.inventoryStatus);
this.closeEditPopup(); this.closeEditPopup();
}, },
updateStatus(value) { updateStatus(value) {
this.inventoryStatus = value this.inventoryStatus = value
console.log(this.inventoryStatus)
}, },
getStdPackUnitInfo(value) { getStdPackUnitInfo(value) {
return getStdPackUnitInfo(value).name return getStdPackUnitInfo(value).name
} }

13
mycomponents/scan/winComScan.vue

@ -144,12 +144,6 @@
that.losefocus(); that.losefocus();
let content = uni.$u.trim(that.scanMsg) let content = uni.$u.trim(that.scanMsg)
if (content == "") { if (content == "") {
//
// this.$refs.comMessage.showErrorMessage('', res => {
// if (res) {
// that.getfocus();
// }
// })
that.getfocus(); that.getfocus();
return; return;
} }
@ -158,7 +152,12 @@
that.scanList.unshift(content); that.scanList.unshift(content);
} }
uni.showLoading({
title:'解析中...',
mask:true
})
getLabelInfo(content,this.headerType, callback => { getLabelInfo(content,this.headerType, callback => {
uni.hideLoading();
let scanResult = callback; let scanResult = callback;
if (scanResult.success) { if (scanResult.success) {
that.clear(); that.clear();
@ -171,7 +170,7 @@
that.getfocus(); that.getfocus();
} }
}) })
} }
}); });
}, 500); }, 500);
} }

8
mycomponents/scan/winScanPackAndLocation.vue

@ -72,7 +72,7 @@
} from '@/common/directory.js'; } from '@/common/directory.js';
export default { export default {
name: 'winScanPack', name: 'winScanPack',
emits: ["getResult", "close"], emits: ["getResult", "close", "getCountScanResult"],
components: { components: {
winComScan, winComScan,
comMessage, comMessage,
@ -225,6 +225,10 @@
} else { } else {
if (result.label != null) { if (result.label != null) {
this.scanResult = result; this.scanResult = result;
uni.showLoading({
title: '查询中...',
mask: true
})
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses, getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses,
res => { res => {
if (res.success) { if (res.success) {
@ -235,7 +239,7 @@
this.packGetFocus(); this.packGetFocus();
}) })
} }
uni.hideLoading();
}); });
} }
} }

3
mycomponents/status/balanceStatus.vue

@ -3,7 +3,8 @@
<status :status='status' style='font-size: 70rpx;'></status> <status :status='status' style='font-size: 70rpx;'></status>
<text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'> <text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'>
{{statusDesc(status) }}</text> {{statusDesc(status) }}</text>
<image style="width: 40rpx; height:40rpx" src="/static/icons/icons_edit.svg" v-show="allowEdit" @click="open"> <!-- v-show="allowEdit" -->
<image style="width: 40rpx; height:40rpx" src="/static/icons/icons_edit.svg" @click="open">
</image> </image>
</view> </view>
<status-edit :status='status' ref="statusEdit" @updateStatus="updateStatus"></status-edit> <status-edit :status='status' ref="statusEdit" @updateStatus="updateStatus"></status-edit>

273
pages/count/job/countDetail.vue

@ -50,8 +50,8 @@
<win-scan-button @goScan='openScanPopup'></win-scan-button> <win-scan-button @goScan='openScanPopup'></win-scan-button>
<win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" @getCountScanResult='getScanResult'> <win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" @getCountScanResult='getScanResult'>
</win-scan-pack-and-location> </win-scan-pack-and-location>
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" :isShowStatus="true" :allowEditStatus="false" <count-qty-edit ref="countQtyEdit" @confirm="editConfirm" :isShowStatus="true"
:isShowBalance="jobContent.isOpenCount=='TRUE'"> :allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'">
</count-qty-edit> </count-qty-edit>
<com-message ref="comMessage"></com-message> <com-message ref="comMessage"></com-message>
</view> </view>
@ -111,7 +111,10 @@
subList: [], //subList subList: [], //subList
detailSource: [], // detailSource: [], //
itemEditInfo: {}, itemEditInfo: {},
balance: {} // balance: {}, //
editInventoryStatus: false,
package: {}, //
label: {} //
}; };
}, },
onLoad(option) { onLoad(option) {
@ -148,7 +151,6 @@
} else { } else {
uni.navigateBack(); uni.navigateBack();
} }
return true; return true;
} }
}, },
@ -268,11 +270,10 @@
updateData() { updateData() {
this.calcHandleQty(); this.calcHandleQty();
}, },
// editConfirm() {
editConfirm() { // this.calcHandleQty();
this.calcHandleQty(); // this.scanPopupGetFocus();
this.scanPopupGetFocus(); // },
},
openScanPopup() { openScanPopup() {
let fromlocationCode = ''; let fromlocationCode = '';
@ -295,6 +296,7 @@
} }
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent); this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
}, },
closeScanPopup() { closeScanPopup() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.closeScanPopup(); this.$refs.scanPopup.closeScanPopup();
@ -307,84 +309,183 @@
} }
}, },
scanPopupLoseFocus() {
if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packLoseFocus();
}
},
// //
getOpenScanResult(result) { getScanResult(result) {
try { try {
let label = result.label; let that = this;
this.balance = result.balance[0]; that.package = result.package;
//, that.label = result.label;
if (result.balance.length == 0) {
//,
var item = this.detailSource.find(r => r.itemCode == that.package.itemCode);
let subItem = item.subList.find(item => {
if (item.packingNumber == that.label.packingNumber &&
item.batch == that.label.batch) {
return item;
}
})
return; if (subItem != undefined && subItem.scaned) {
this.$refs.comMessage.showQuestionMessage("箱码【" + packingNumber +
"】已经完成盘点,是否要编辑数量",
res => {
if (res) {
this.$refs.countQtyEdit.openEditPopup(subItem,
item.subList);
} else {
this.scanPopupGetFocus();
}
})
} else { } else {
if (result.balance.length == 0) {
that.scanPopupLoseFocus()
that.$refs.comMessage.showQuestionMessage("该包装在来源库位[" + that.fromLocationCode +
"],未查找到库存,是否继续盘点?",
res => {
if (res) {
that.editInventoryStatus = true;
let item = that.package;
item.packingNumber = that.label.packingNumber;
item.qty = Number(that.label.qty);
item.handleQty = Number(that.label.qty);
item.balanceQty = 0;
item.inventoryStatus = "OK";
this.balance = item;
that.$refs.countQtyEdit.openEditPopup(item,
null);
} else {
//
that.scanPopupGetFocus();
}
})
} else if (result.balance.length == 1) {
this.balance = result.balance[0];
that.$refs.countQtyEdit.openEditPopup(this.balance,
null);
}
} }
return;
// var packingNumber = that.label.packingNumber;
// var batch = that.label.batch;
// var itemCode = that.label.itemCode;
// var balanceQty = 0;
// var inventoryStatus = "OK"
// var detail = this.detailSource.find(r => r.itemCode == itemCode);
// var itemEditInfo;
// //
// if (detail == undefined) {
// //
// this.addNewItemCodeToList(result)
// } else {
// if (result.balance.length == 0) {
// this.balance = label;
// this.balanceQty = 0;
// this.inventoryStatus = "OK";
// this.editInventoryStatus = true;
// //
// itemEditInfo = detail.subList.find(item => {
// if (item.packingNumber == packingNumber &&
// item.batch == batch) {
// return item;
// }
// })
// } else {
// this.balance = result.balance[0];
// balanceQty = this.balance.qty;
// inventoryStatus = this.balance.inventoryStatus;
// //
// itemEditInfo = detail.subList.find(item => {
// if (item.packingNumber == packingNumber &&
// item.batch == batch &&
// item.inventoryStatus == inventoryStatus) {
// return item;
// }
// })
// }
// if (itemEditInfo == undefined) {
// //
// this.addExistItemCodeToList(detail, result);
// } else {
// //
// if (itemEditInfo.scaned) {
// this.$refs.comMessage.showQuestionMessage("" + packingNumber +
// ",",
// res => {
// if (res) {
// this.$refs.countQtyEdit.openEditPopup(itemEditInfo,
// detail.subList);
// } else {
// this.scanPopupGetFocus();
// }
// })
// } else {
// itemEditInfo.scaned = true;
// itemEditInfo.handleQty = balanceQty;
// itemEditInfo.balanceQty = balanceQty;
// itemEditInfo.stdPackQty = result.package.stdPackQty;
// itemEditInfo.stdPackUnit = result.package.stdPackUnit;
// this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail
// .subList);
// this.updateData()
// }
// }
// }
} catch (e) {
this.showErrorMessage(e.message)
}
},
editConfirm(qty, inventoryStatus) {
let that = this;
var detail = this.detailSource.find(r => r.itemCode == that.package.itemCode);
this.balance = result.balance[0]; //
if (detail == undefined) {
var packingNumber = label.packingNumber; //
var batch = label.batch; this.addNewItemCodeToList(result)
var itemCode = label.itemCode; } else {
var itemEditInfo = detail.subList.find(item => {
var balanceQty = this.balance.qty; if (item.packingNumber == that.package.number &&
var inventoryStatus = this.balance.inventoryStatus; item.batch == that.package.batch &&
item.inventoryStatus == inventoryStatus) {
return item;
}
})
var detail = this.detailSource.find(r => r.itemCode == itemCode); if (itemEditInfo == undefined) {
var itemEditInfo; //
// this.addExistItemCodeToList(detail);
if (detail == undefined) {
//
this.addNewItemCodeToList(result)
} else { } else {
// itemEditInfo.scaned = true;
itemEditInfo = detail.subList.find(item => { itemEditInfo.handleQty = qty;
if (item.packingNumber == packingNumber && itemEditInfo.balanceQty = this.balance.qty;
item.batch == batch && itemEditInfo.stdPackQty = this.package.stdPackQty;
item.inventoryStatus == inventoryStatus) { itemEditInfo.stdPackUnit = this.package.stdPackUnit;
return item; this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail
} .subList);
}) this.updateData()
if (itemEditInfo == undefined) {
//
this.addExistItemCodeToList(detail, result);
} else {
//
if (itemEditInfo.scaned) {
this.$refs.comMessage.showSelectMessageModal("箱码【" + packingNumber +
"】已经完成盘点,是否要编辑数量",
res => {
if (res) {
this.$refs.countQtyEdit.openEditPopup(itemEditInfo,
detail.subList);
} else {
this.scanPopupGetFocus();
}
})
} else {
itemEditInfo.scaned = true;
itemEditInfo.handleQty = balanceQty;
itemEditInfo.balanceQty = balanceQty;
itemEditInfo.stdPackQty = result.package.stdPackQty;
itemEditInfo.stdPackUnit = result.package.stdPackUnit;
this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail
.subList);
this.updateData()
}
}
} }
} catch (e) {
this.showErrorMessage(e.message) this.calcHandleQty();
this.scanPopupGetFocus();
} }
}, },
// //
getUnOpenScanResult(result) { getUnOpenScanResult(result) {
try { try {
debugger;
// //
if (result.balance.length == 0) { if (result.balance.length == 0) {
@ -422,7 +523,7 @@
} else { } else {
// //
if (itemEditInfo.scaned) { if (itemEditInfo.scaned) {
this.$refs.comMessage.showSelectMessageModal("箱码【" + packingNumber + this.$refs.comMessage.showQuestionMessage("箱码【" + packingNumber +
"】已经完成盘点,是否要编辑数量", "】已经完成盘点,是否要编辑数量",
res => { res => {
if (res) { if (res) {
@ -450,15 +551,12 @@
} }
}, },
addNewItemCodeToList() {
this.$refs.comMessage.showQuestionMessage("物料[" + this.package.itemCode + "]不在列表中,是否添加到列表?",
addNewItemCodeToList(result) {
this.$refs.comMessage.showSelectMessageModal("物料[" + this.balance.itemCode + "]不在列表中,是否添加到列表?",
res => { res => {
if (res) { if (res) {
var item = this.createAddItemInfo(this.balance, result.package); var item = this.createAddItemInfo(this.balance, this.package);
let newDetail = this.createAddDetailInfo(this.balance, result.package); // let newDetail = this.createAddDetailInfo(this.balance, this.package); //
item.subList.push(newDetail); item.subList.push(newDetail);
this.detailSource.push(item) this.detailSource.push(item)
this.updateData() this.updateData()
@ -467,13 +565,12 @@
}, },
addExistItemCodeToList(detail, result) { addExistItemCodeToList(detail) {
this.$refs.comMessage.showSelectMessageModal("箱码[" + this.balance.packingNumber + this.$refs.comMessage.showQuestionMessage("盘点明细不在列表中,是否添加到列表?",
"]不在列表中,是否添加到列表?",
res => { res => {
if (res) { if (res) {
detail.qty = calc.add(detail.qty, detail.qty) detail.qty = calc.add(detail.qty, detail.qty)
let newDetail = this.createAddDetailInfo(this.balance, result.package); // let newDetail = this.createAddDetailInfo(this.balance, this.package); //
detail.subList.push(newDetail); detail.subList.push(newDetail);
this.updateData() this.updateData()
@ -483,7 +580,7 @@
createAddItemInfo(balance, pack) { createAddItemInfo(balance, pack) {
let item = { let item = {
itemCode: balance.itemCode, itemCode: pack.itemCode,
itemName: pack.itemName, itemName: pack.itemName,
stdPackQty: pack.stdPackQty, stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
@ -502,9 +599,9 @@
scaned: true, scaned: true,
countDetailNumber: "", countDetailNumber: "",
ownerCode: balance.ownerCode, ownerCode: balance.ownerCode,
packingNumber: balance.packingNumber, packingNumber: pack.packingNumber,
containerNumber: pack.containerNumber, containerNumber: balance.containerNumber,
batch: balance.batch, batch: pack.batch,
inventoryStatus: balance.inventoryStatus, inventoryStatus: balance.inventoryStatus,
itemCode: pack.itemCode, itemCode: pack.itemCode,
itemName: pack.itemName, itemName: pack.itemName,
@ -523,7 +620,7 @@
stdPackUnit: pack.stdPackUnit, stdPackUnit: pack.stdPackUnit,
creator: this.$store.state.user.id creator: this.$store.state.user.id
} }
debugger;
return detail; return detail;
}, },

2
static/config.json

@ -18,7 +18,7 @@
"request_url": { "request_url": {
"name": "request_url", "name": "request_url",
"value": "http://192.168.0.178:12080/admin-api", "value": "http://192.168.0.158: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.176:12080/admin-api", "chefang": "http://192.168.0.176:12080/admin-api",
"chenxinming": "http://192.168.0.230:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",

Loading…
Cancel
Save