Browse Source

修改盘点单件码扫描和盘点描述支持扫描

pda_nev
李俊城 7 months ago
parent
commit
271bd1efdb
  1. 8
      fe/PDA/mycomponents/common/comEasyInput.vue
  2. 247
      fe/PDA/pages/task/countFgDetail.vue

8
fe/PDA/mycomponents/common/comEasyInput.vue

@ -10,7 +10,8 @@
<view class="tab_info">
<view class="conbox">
<textarea v-model="content" trim="all" style="margin-left: 5px;" :focus="true"></textarea>
<textarea v-model="content" trim="all" style="margin-left: 5px;" :focus="true"
@keydown.enter="confirm"></textarea>
<!-- <uni-easyinput v-model="content" type="textarea" ></uni-easyinput> -->
</view>
<view class="uni-flex">
@ -36,6 +37,11 @@
},
created() {
},
mounted() {
if (this.$el.querySelector('textarea') != null) {
this.$el.querySelector('textarea').setAttribute('inputmode', 'none')
}
},
methods: {
openPopup(content) {

247
fe/PDA/pages/task/countFgDetail.vue

@ -8,7 +8,7 @@
</com-count-scan-detail>
</view>
<view class="" style="margin: 20rpx;">
<button type="primary" @click="queryItemCode">ERP料号查询</button>
<button type="primary" @click="queryItemCode">ERP料号查询</button>
</view>
<scroll-view scroll-y="true" style="margin-bottom: 50rpx;">
@ -42,8 +42,8 @@
<text class="text_black">{{item.inventoryQty}}</text>
</uni-th>
<uni-th width="100" align="center">
<com-number-box v-model="item.countQty" :max="99999"
:min="0" @change="qtyChanged($event,item)"
<com-number-box v-model="item.countQty" :max="99999" :min="0"
@change="qtyChanged($event,item)"
style='margin-right: 10px;padding: 2px;'>
</com-number-box>
@ -93,7 +93,7 @@
</view>
</picker>
</view> -->
<text class="state_point" :class="item.status | statusStyle">
<text class="state_point" :class="item.status | statusStyle">
{{ item.status | statusColor}}
</text>
</view>
@ -102,7 +102,7 @@
</view>
<view class="uni-flex space-between" style="margin:0 20rpx 20rpx;" >
<view class="uni-flex space-between" style="margin:0 20rpx 20rpx;">
<view class="">
<text class="font_xs"
style="padding: 5px 2px; text-overflow: ellipsis; overflow: hidden;">{{item.countDescription}}</text>
@ -133,7 +133,7 @@
</view>
<!-- <com-count-items ref='comcountItems' @selectedItem='selectedCountItem'> </com-count-items> -->
<win-scan-button @goScan='openScanPopup'></win-scan-button>
<winScanByProductCode ref="scanPopup" title="单件码" @getScanResult='getScanResult' ></winScanByProductCode>
<winScanByProductCode ref="scanPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode>
<com-easy-input ref="descPopup" @confirm='closeEditCountDesc'></com-easy-input>
<com-easy-input-count ref="countPopup" @confirm='closeEditCount'></com-easy-input-count>
<win-inventory-status ref="statusPopup"></win-inventory-status>
@ -178,7 +178,8 @@
getCurrDateTime,
navigateBack,
scanSuccessAudio,
scanFailedAudio
scanFailedAudio,
deepCopyData
} from '@/common/basic.js';
import {
@ -249,7 +250,7 @@
names: [],
values: [],
origin: []
}
},
}
},
props: {},
@ -345,6 +346,7 @@
})
},
methods: {
initList() {
this.index = 1;
this.showList = []
@ -352,7 +354,7 @@
this.showList = this.getDataPage(this.index, this.pageSize)
},
queryItemCode(){
queryItemCode() {
this.$refs.wzSelectPopup.open({
mode: 'radio', //radio checkbox
// dataList:[], //dataList使proxyConfig
@ -373,57 +375,25 @@
selectCheckbox(mode, resultData) {
console.log(mode, resultData)
var result = resultData
var itemCode = result.itemCode;
var itemScan = this.scanAllDetails.filter(r =>
r.itemCode == itemCode&&
r.inventoryStage==this.datacontent.inventoryStage&&
r.isDelete==false)
// if(itemScan.length == 0){
// let detail = this.creatDetail(result);
// this.setDetailNoBalance(detail, result)
// detail.inventoryQty=result.qty
// detail.countQty =result.qty
// this.scanAllDetails.unshift(detail);
// this.initList();
// this.calcScanCount();
// this.$forceUpdate();
// }else if (itemScan.length == 1){
// setTimeout(res => {
// showConfirmMsg("" + itemCode + ",", res => {
// if (res) {
// this.setQty(itemScan[0], itemScan[0].inventoryQty, false);
// }
// })
// }, 100)
// }
if (itemScan.length > 0) {
setTimeout(res => {
showConfirmMsg("物料【" + itemCode + "】已经扫描,是否覆盖已经扫描的信息", res => {
if (res) {
this.setQty(itemScan[0], itemScan[0].inventoryQty, false);
}
})
}, 100)
return;
}
let items = this.originalDetails.filter(r =>
r.itemCode === itemCode&&r.inventoryStage==this.datacontent.inventoryStage)
r.itemCode === itemCode && r.inventoryStage == this.datacontent.inventoryStage)
//
if (items.length == 0) {
this.addNewDetail(result)
} else if (items.length == 1) {
var item = items[0];
item.isNew =true;
this.setQty(item, item.inventoryQty, true);
item.isNew = true;
var addItem = deepCopyData(item)
this.addItemExit(addItem, true);
} else {
this.showMessage('盘点数量异常,ERP物料号【' + itemCode + '】的出现多条数据');
}
},
reqGetList(data) {
return getBalancesByItemCode(data.searchValue,data.pageIndex,data.pageSize);
return getBalancesByItemCode(data.searchValue, data.pageIndex, data.pageSize);
},
getDetail() {
uni.showLoading({
@ -443,9 +413,9 @@
that.scanAllDetails = res.depDetails.filter(r => r.inventoryStage == res.inventoryStage);
that.scanCount = res.depDetails.length
that.scanAllDetails.forEach(res=>{
res.isDelete = false;
res.modified=false;
that.scanAllDetails.forEach(item => {
item.isDelete = false;
item.modified = false;
})
this.initList()
@ -468,46 +438,47 @@
//
const start = (pageNo - 1) * pageSize;
const end = start + pageSize; //
var list =this.scanAllDetails.filter((r=>r.isDelete==false))
var list = this.scanAllDetails.filter((r => r.isDelete == false))
return list.slice(start, end)
},
getScanResult(result){
var itemCode =result.itemCode;
this.getitem(itemCode,res=>{
getScanResult(result) {
var itemCode = result.itemCode;
this.getitem(itemCode, res => {
var result = res;
result.itemCode = result.code;
result.itemName = result.name;
result.itemDesc1 = result.desc1;
result.itemDesc2 = result.desc2;
result.uom =result.basicUom
var itemScan = this.scanAllDetails.filter(r =>
r.itemCode == itemCode&&
r.inventoryStage==this.datacontent.inventoryStage&&
r.isDelete==false
)
if (itemScan.length > 0) {
setTimeout(res => {
scanFailedAudio()
showConfirmMsg("物料【" + itemCode + "】已经扫描,是否覆盖已经扫描的信息", res => {
if (res) {
this.setQty(itemScan[0], itemScan[0].inventoryQty, false);
}
})
}, 100)
return;
}
result.uom = result.basicUom
// var itemScan = this.scanAllDetails.filter(r =>
// r.itemCode == itemCode&&
// r.inventoryStage==this.datacontent.inventoryStage&&
// r.isDelete==false
// )
// if (itemScan.length > 0) {
// setTimeout(res => {
// scanFailedAudio()
// showConfirmMsg("" + itemCode + ",", res => {
// if (res) {
// this.setQty(itemScan[0], itemScan[0].inventoryQty, false);
// }
// })
// }, 100)
// return;
// }
let items = this.originalDetails.filter(r =>
r.itemCode === itemCode&&r.inventoryStage==this.datacontent.inventoryStage)
r.itemCode === itemCode && r.inventoryStage == this.datacontent.inventoryStage)
//
if (items.length == 0) {
this.addNewDetail(result)
} else if (items.length == 1) {
scanSuccessAudio()
var item = items[0];
item.isNew =true;
this.setQty(item, item.inventoryQty, true);
item.isNew = true;
var addItem = deepCopyData(item)
this.addItemExit(addItem, true);
} else {
scanFailedAudio()
this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据');
@ -540,7 +511,7 @@
if (balanceItem == null || balanceItem == undefined) {
setTimeout(res => {
scanFailedAudio()
showConfirmMsg("扫描的物料["+result.code+"]在任务中不存在,是否要添加为任务明细?", async confirm => {
showConfirmMsg("扫描的物料[" + result.code + "]在任务中不存在,是否要添加为任务明细?", async confirm => {
if (confirm) {
this.setDetailNoBalance(detail, result)
this.scanAllDetails.unshift(detail);
@ -561,17 +532,18 @@
} else {
setTimeout(res => {
scanFailedAudio()
showConfirmMsg("扫描的物料["+result.itemCode+"]在任务中不存在,是否要添加为任务明细?", async confirm => {
if (confirm) {
this.setDetailByBalance(detail, balanceItem);
this.scanAllDetails.unshift(detail);
this.initList();
this.calcScanCount();
this.$forceUpdate();
} else {
this.scanPopupGetfocus();
}
});
showConfirmMsg("扫描的物料[" + result.itemCode + "]在任务中不存在,是否要添加为任务明细?",
async confirm => {
if (confirm) {
this.setDetailByBalance(detail, balanceItem);
this.scanAllDetails.unshift(detail);
this.initList();
this.calcScanCount();
this.$forceUpdate();
} else {
this.scanPopupGetfocus();
}
});
}, 100)
}
}
@ -604,13 +576,13 @@
creatDetail(result) {
let detail = {
isNew: true,
isDelete:false,
modified:true,
isDelete: false,
modified: true,
countTime: new Date(),
masterID: this.id,
countLabel: "",
number: this.datacontent.number,
inventoryStage:this.datacontent.inventoryStage,
inventoryStage: this.datacontent.inventoryStage,
inventoryQty: 0,
uom: result.uom,
@ -652,23 +624,41 @@
setDetailNoBalance(detail, result) {
detail.InventoryLocationCode = "";
detail.inventoryQty = 0;
detail.countQty = 1;
detail.countQty = 0;
detail.status = 2;
detail.uom =result.uom
detail.uom = result.uom
return detail;
},
setQty(item, qty, isAdd) {
item.countQty = Number(qty);
item.countQty = 0;
item.countTime = new Date();
item.isDelete =false;
item.modified =true;
item.isDelete = false;
item.modified = true;
item.countOperator = localStorage.userId;
if (isAdd) {
this.scanAllDetails.unshift(item)
}else {
item.countDescription=""
} else {
item.countDescription = ""
}
this.initList();
this.scanPopupGetfocus();
this.calcScanCount();
this.$forceUpdate();
},
addItemExit(item, isAdd) {
item.countQty = 0;
item.countTime = new Date();
item.isDelete = false;
item.modified = true;
item.countOperator = localStorage.userId;
if (isAdd) {
this.scanAllDetails.unshift(item)
} else {
item.countDescription = ""
}
this.initList();
this.scanPopupGetfocus();
@ -681,10 +671,10 @@
content: '是否移除选择的行?',
success: res => {
if (res.confirm) {
if(item.isNew){
if (item.isNew) {
this.showList.splice(index, 1)
this.scanAllDetails.splice(index, 1)
}else {
} else {
item.isDelete = true;
item.modified = true;
}
@ -717,26 +707,25 @@
return;
}
var commitList=this.scanAllDetails.filter(r=>r.modified==true)
var commitList = this.scanAllDetails.filter(r => r.modified == true)
if (commitList.length == 0) {
this.showMessage("没有修改的数据,请先扫描")
return;
}
var temp="";
var temp = "";
for (var i = 0; i < this.scanAllDetails.length; i++) {
if(this.scanAllDetails[i].countQty==0){
temp=this.scanAllDetails[i];
break;
}
if (this.scanAllDetails[i].countQty == 0) {
temp = this.scanAllDetails[i];
break;
}
}
if(temp!=""){
this.showMessage("ERP料号:["+temp.itemCode+"]盘点数量为0,请输入盘点数量")
if (temp != "") {
this.showMessage("ERP料号:[" + temp.itemCode + "]盘点数量为0,请输入盘点数量")
return;
}
this.finishJob();
},
@ -746,13 +735,7 @@
title: "提交中...",
mask: true
});
this.datacontent.depDetails =this.scanAllDetails.filter(r=>r.modified==true&&r.isDelete==false);
this.datacontent.details =[];
that.datacontent.completeUserId = localStorage.getItem('userId')
that.datacontent.completeUserName = localStorage.getItem('userName_CN')
that.datacontent.completeTime = getCurrDateTime()
let params = JSON.stringify(this.datacontent);
console.log("提交参数",params)
var params =this.setParams();
finishCountJob(this.id, params)
.then(res => {
uni.hideLoading();
@ -766,24 +749,50 @@
});
},
setParams() {
var filterList = this.scanAllDetails.filter(r => r.modified == true && r.isDelete == false)
let submitList = []; //
filterList.forEach(item => {
//indexOf() , 1. , -1.
var findItem = submitList.find(r => r.itemCode == item.itemCode)
if (findItem) {
findItem.countQty += item.countQty
} else {
submitList.push(item);
}
})
this.datacontent.depDetails = submitList;
this.datacontent.details = [];
this.datacontent.completeUserId = localStorage.getItem('userId')
this.datacontent.completeUserName = localStorage.getItem('userName_CN')
this.datacontent.completeTime = getCurrDateTime()
var params = JSON.stringify(this.datacontent);
return params;
},
qtyChanged(value, item) {
if (value > 0) {
item.countTime = new Date();
item.countOperator = localStorage.userId;
this.calcScanCount();
if(value==item.countQty){
item.modified=false
}else {
item.modified=true
if (value == item.countQty) {
item.modified = false
} else {
item.modified = true
}
}else {
} else {
item.countTime = new Date();
item.modified = true
this.showMessage("盘点数量必须大于0")
}
},
calcScanCount() {
this.scanCount = this.scanAllDetails.filter(r=>r.isDelete==false).length;
this.scanCount = this.scanAllDetails.filter(r => r.isDelete == false).length;
},
bindPickerChange(e, item) {

Loading…
Cancel
Save