Browse Source

修改盘点扫描功能

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

14
mycomponents/qty/CountQtyEdit.vue

@ -38,14 +38,13 @@
<text>数量 : </text>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<input class="qty_input" v-model="allQty" :focus="true" type="number"
@mousedown="mousedown"
@input="checkNum"
:maxlength="maxlength" />
@mousedown="mousedown" @input="checkNum" :maxlength="maxlength" />
<uom :uom="dataContent.uom"></uom>
</view>
</view>
<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>
<view class="uni-flex uni-row uni-center" style="align-items: center;">
<text class="text_recommend">{{Number(dataContent.balanceQty)}}</text>
@ -57,7 +56,7 @@
style="align-items: center; padding-left: 30rpx;">
<text>库存状态 : </text>
<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">
</balanceStatus>
</view>
@ -213,16 +212,17 @@
this.allQty = val * Number(this.dataContent.stdPackQty);
}
},
setValue() {
this.dataContent.handleQty = Number(this.allQty)
this.$emit("confirm");
this.$emit("confirm", Number(this.allQty), this.inventoryStatus);
this.closeEditPopup();
},
updateStatus(value) {
this.inventoryStatus = value
console.log(this.inventoryStatus)
},
getStdPackUnitInfo(value) {
return getStdPackUnitInfo(value).name
}

11
mycomponents/scan/winComScan.vue

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

8
mycomponents/scan/winScanPackAndLocation.vue

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

3
mycomponents/status/balanceStatus.vue

@ -3,7 +3,8 @@
<status :status='status' style='font-size: 70rpx;'></status>
<text :class="statusStyle(status)" style='font-size: 38rpx;margin-right: 15rpx;'>
{{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>
</view>
<status-edit :status='status' ref="statusEdit" @updateStatus="updateStatus"></status-edit>

239
pages/count/job/countDetail.vue

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

2
static/config.json

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

Loading…
Cancel
Save