Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-uniapp into master_hella

hella_online_20240829
lijuncheng 4 months ago
parent
commit
0e906a58a3
  1. 389
      src/pages/count/job/fuzzyCountDetail.vue

389
src/pages/count/job/fuzzyCountDetail.vue

@ -51,7 +51,7 @@
<view class="card_packing_code" style="padding: 5px; font-weight: bold ; font-size: 40rpx;"> <view class="card_packing_code" style="padding: 5px; font-weight: bold ; font-size: 40rpx;">
{{detailSource.length}} {{detailSource.length}}
</view> </view>
<view > <view>
() ()
</view> </view>
</view> </view>
@ -64,8 +64,8 @@
<win-scan-button v-if="fromLocationCode!=''" @goScan='openScanPopup'></win-scan-button> <win-scan-button v-if="fromLocationCode!=''" @goScan='openScanPopup'></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack> <win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack>
<win-scan-location ref="scanLocationCode" title="盘点库位" @getLocation='getLocation'></win-scan-location> <win-scan-location ref="scanLocationCode" title="盘点库位" @getLocation='getLocation'></win-scan-location>
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true" :isShowDesc="false" <count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true"
:allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'"> :isShowDesc="false" :allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'">
</count-qty-edit> </count-qty-edit>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
@ -326,218 +326,221 @@
if (this.itemRangeValue != '') { if (this.itemRangeValue != '') {
let index = this.itemRangeValue.indexOf(packInfo.itemCode) let index = this.itemRangeValue.indexOf(packInfo.itemCode)
if (index < 0) { if (index < 0) {
this.afterScanLocation("物料代码【" + packInfo.itemCode + "】,不在盘点范围【" + this.itemRangeValue + "】内"); this.showErrorMessage("物料代码【"+ packInfo.itemCode + "】,不在盘点范围【" + this.itemRangeValue + "】内")
return; return;
}
else {
this.onScan(packInfo);
}
} else { } else {
this.onScan(packInfo); this.onScan(packInfo);
} }
} else { },
this.onScan(packInfo);
} onScan(packInfo) {
}, let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.packingNumber ==
packInfo
onScan(packInfo) { .number && r.batch == packInfo.batch && r.inventoryStatus == "OK");
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.packingNumber == packInfo if (detail == undefined) {
.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); detail = this.createDetailInfo(packInfo);
if (detail == undefined) { this.detailSource.unshift(detail)
detail = this.createDetailInfo(packInfo); this.scanPopupGetFocus();
this.detailSource.unshift(detail) } else {
this.scanPopupGetFocus(); let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r
} else { .packingNumber ==
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r.packingNumber == packInfo
packInfo .number && r.batch == packInfo.batch && r.inventoryStatus == "OK");
.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); if (index >= 0) {
if (index >= 0) { this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); // //
// this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => {
this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => { if (res) {
this.closeScanPopup();
this.edit(detail);
} else {
this.scanPopupGetFocus();
}
});
}
}
},
//
createDetailInfo(packInfo) {
var detail = {
scaned: true,
// countDetailNumber: "",
number: this.jobContent.number,
packingNumber: packInfo.number,
batch: packInfo.batch,
inventoryStatus: "OK",
itemCode: packInfo.itemCode,
itemName: packInfo.itemName,
itemDesc1: packInfo.itemDesc1,
itemDesc2: packInfo.itemDesc2,
projectCode: "",
qty: packInfo.qty,
packUnit: packInfo.packUnit,
packQty: packInfo.packQty,
packUom: packInfo.packUom,
uom: packInfo.uom,
remark: "",
locationCode: this.fromLocationCode,
creator: this.$store.state.user.id,
warehouseCode: this.fromLocation.warehouseCode,
areaCode: this.fromLocation.areaCode,
locationGroupCode: this.fromLocation.locationGroupCode,
createTime: new Date().getTime(),
countTime: new Date().getTime(),
countUser: this.$store.state.user.id,
countDescription: '',
countQty: packInfo.qty
}
return detail;
},
editClose() {
this.$refs.countQtyEdit.closeEditPopup();
},
swipeClick(e, item, index) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
//
edit(item) {
let that = this;
this.currentEditItem = item;
item.handleQty = item.qty;
this.$refs.countQtyEdit.openEditPopup(item, null);
},
editConfirm(qty, inventoryStatus, mode) {
let that = this;
this.currentEditItem.countQty = qty;
this.currentEditItem.qty = qty;
this.currentEditItem.inventoryStatus = inventoryStatus;
this.openScanPopup();
},
editClose() {
this.scanPopupGetFocus();
},
remove(item, index) {
this.showQuestionMessage("是否要移除扫描信息?", res => {
if (res) { if (res) {
this.closeScanPopup(); this.detailSource.splice(index, 1)
this.edit(detail);
} else {
this.scanPopupGetFocus();
} }
}); });
} },
}
},
//
createDetailInfo(packInfo) {
var detail = {
scaned: true,
// countDetailNumber: "",
number: this.jobContent.number,
packingNumber: packInfo.number,
batch: packInfo.batch,
inventoryStatus: "OK",
itemCode: packInfo.itemCode,
itemName: packInfo.itemName,
itemDesc1: packInfo.itemDesc1,
itemDesc2: packInfo.itemDesc2,
projectCode: "",
qty: packInfo.qty,
packUnit: packInfo.packUnit,
packQty: packInfo.packQty,
packUom: packInfo.packUom,
uom: packInfo.uom,
remark: "",
locationCode: this.fromLocationCode,
creator: this.$store.state.user.id,
warehouseCode: this.fromLocation.warehouseCode,
areaCode: this.fromLocation.areaCode,
locationGroupCode: this.fromLocation.locationGroupCode,
createTime: new Date().getTime(),
countTime: new Date().getTime(),
countUser: this.$store.state.user.id,
countDescription: '',
countQty: packInfo.qty
}
return detail;
},
editClose() {
this.$refs.countQtyEdit.closeEditPopup();
},
swipeClick(e, item, index) { detail(item) {
if (e.content.text == "编辑") { this.showItem = item;
this.edit(item) this.$refs.detailInfoPopup.openPopup(item);
} else if (e.content.text == "移除") { },
this.remove(item)
}
},
//
edit(item) {
let that = this;
this.currentEditItem = item;
item.handleQty = item.qty;
this.$refs.countQtyEdit.openEditPopup(item, null);
},
editConfirm(qty, inventoryStatus, mode) {
let that = this;
this.currentEditItem.countQty = qty;
this.currentEditItem.qty = qty;
this.currentEditItem.inventoryStatus = inventoryStatus;
this.openScanPopup();
},
editClose() {
this.scanPopupGetFocus();
},
remove(item, index) {
this.showQuestionMessage("是否要移除扫描信息?", res => {
if (res) {
this.detailSource.splice(index, 1)
}
});
},
commit() {
if (this.detailSource.length == 0) {
detail(item) { this.$refs.comMessage.showMessage('还未扫描,是否要继续提交', res => {
this.showItem = item; if (res) {
this.$refs.detailInfoPopup.openPopup(item); this.commitJob();
}, }
});
commit() { } else {
if (this.detailSource.length == 0) {
this.$refs.comMessage.showMessage('还未扫描,是否要继续提交', res => {
if (res) {
this.commitJob(); this.commitJob();
} }
}); },
} else {
this.commitJob();
}
},
commitJob() {
uni.showLoading({
title: "提交中....",
mask: true
});
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
countJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data == null) {
this.showCommitSuccessMessage("提交成功")
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() { commitJob() {
var creator = this.$store.state.user.id uni.showLoading({
this.jobContent.subList = this.detailSource title: "提交中....",
// this.jobContent.creator = creator; mask: true
return this.jobContent; });
}, var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
countJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data == null) {
this.showCommitSuccessMessage("提交成功")
} else {
this.showErrorMessage("提交失败[" + res.msg + "]")
}
}).catch(error => {
uni.hideLoading()
this.showErrorMessage(error)
})
},
showMessage(message) { setParams() {
this.$refs.comMessage.showMessage(message, res => { var creator = this.$store.state.user.id
if (res) { this.jobContent.subList = this.detailSource
this.afterCloseMessage() // this.jobContent.creator = creator;
} return this.jobContent;
}); },
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() { showMessage(message) {
this.scanPopupGetFocus(); this.$refs.comMessage.showMessage(message, res => {
}, if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
closeScanMessage() { showScanMessage(message) {
this.scanPopupGetFocus(); this.$refs.comMessage.showScanMessage(message);
}, },
showCommitSuccessMessage(hint) { afterCloseMessage() {
this.$refs.comMessage.showSuccessMessage(hint, res => { this.scanPopupGetFocus();
this.fromLocationCode = ''; },
this.fromLocation = {};
this.detailSource = [];
this.showFromLocationPopup();
})
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == "TRUE" ? "明盘" : "盲盘"
},
getCountScopeName(value) { closeScanMessage() {
let item = getCountScopeType(value); this.scanPopupGetFocus();
return item.label; },
},
showQuestionMessage(message, callback) { showCommitSuccessMessage(hint) {
this.$refs.comMessage.showQuestionMessage(message, res => { this.$refs.comMessage.showSuccessMessage(hint, res => {
callback(res); this.fromLocationCode = '';
}); this.fromLocation = {};
}, this.detailSource = [];
this.showFromLocationPopup();
})
},
getCountStageName(value) {
return getCountStageName(value)
},
isOpenCount(value) {
return value == "TRUE" ? "明盘" : "盲盘"
},
getCountScopeName(value) {
let item = getCountScopeType(value);
return item.label;
},
showQuestionMessage(message, callback) {
this.$refs.comMessage.showQuestionMessage(message, res => {
callback(res);
});
},
}
} }
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

Loading…
Cancel
Save