|
@@ -163,7 +163,7 @@
|
|
|
class="row"
|
|
|
v-for="(
|
|
|
item, index
|
|
|
- ) in scanData.materialItems"
|
|
|
+ ) in materialItemsCopy"
|
|
|
:key="index"
|
|
|
>
|
|
|
<div
|
|
@@ -209,7 +209,7 @@
|
|
|
}"
|
|
|
>
|
|
|
<div>
|
|
|
- 出库数量:{{ item.totalQuantity }}米
|
|
|
+ 出库数量:{{ item.quantity }}米
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -351,6 +351,8 @@ export default {
|
|
|
remark: '',
|
|
|
rfidTagItemsCopy:[],
|
|
|
newData:[],
|
|
|
+ //后台有bug 前端新建数据自己计算
|
|
|
+ materialItemsCopy:[],
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -460,6 +462,7 @@ export default {
|
|
|
this.$Message.info('请重新扫描出库!')
|
|
|
this.scanData.rfidTagItems = []
|
|
|
this.scanData.materialItems = []
|
|
|
+ this.materialItemsCopy = []
|
|
|
ReScan({
|
|
|
reScanType: 1,
|
|
|
storageType: sessionStorage.getItem('plcCode'),
|
|
@@ -492,6 +495,32 @@ export default {
|
|
|
if (scanRes.code === 0) {
|
|
|
this.reading = false
|
|
|
this.scanData = { ...scanRes.result }
|
|
|
+ // this.scanData.rfidTagItems = [{
|
|
|
+ // "materialCode": "123123123",
|
|
|
+ // "materialName": "123123123123",
|
|
|
+ // "rfidCode": "12312",
|
|
|
+ // "quantity": 1423,
|
|
|
+ // "scanRfidStatus": 0
|
|
|
+ // },{
|
|
|
+ // "materialCode": "234234",
|
|
|
+ // "materialName": "234234234323",
|
|
|
+ // "rfidCode": "234234242",
|
|
|
+ // "quantity": 1323,
|
|
|
+ // "scanRfidStatus": 0
|
|
|
+ // },{
|
|
|
+ // "materialCode": "464565",
|
|
|
+ // "materialName": "str4564564ing",
|
|
|
+ // "rfidCode": "4564564564564",
|
|
|
+ // "quantity": 1123,
|
|
|
+ // "scanRfidStatus": 0
|
|
|
+ // },{
|
|
|
+ // "materialCode": "464565",
|
|
|
+ // "materialName": "str4564564ing",
|
|
|
+ // "rfidCode": "4564564434343432564564",
|
|
|
+ // "quantity": 1123,
|
|
|
+ // "scanRfidStatus": 0
|
|
|
+ // }]
|
|
|
+
|
|
|
/* 临时删除的数据不可再添加到出入库列表中 */
|
|
|
this.tempDelData.forEach((temp) => {
|
|
|
for (const index in this.scanData.rfidTagItems) {
|
|
@@ -502,6 +531,7 @@ export default {
|
|
|
this.scanData.rfidTagItems.splice(index, 1)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
for (const index in this.scanData.materialItems) {
|
|
|
if (
|
|
|
temp.materialCode ===
|
|
@@ -511,6 +541,28 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ this.materialItemsCopy = []
|
|
|
+ for (let i = 0; i < this.scanData.rfidTagItems.length; i++) {
|
|
|
+ const element = this.scanData.rfidTagItems[i];
|
|
|
+ console.log(this.materialItemsCopy,12312312)
|
|
|
+ if(this.materialItemsCopy.length == 0){
|
|
|
+ this.materialItemsCopy.push({...element,tagCount:1})
|
|
|
+ }else{
|
|
|
+ var isTotal = false
|
|
|
+
|
|
|
+ for (let j = 0; j < this.materialItemsCopy.length; j++) {
|
|
|
+ const jelement = this.materialItemsCopy[j];
|
|
|
+ if(element.materialCode === jelement.materialCode){
|
|
|
+ isTotal = true
|
|
|
+ jelement.tagCount++
|
|
|
+ jelement.quantity += element.quantity
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(!isTotal) this.materialItemsCopy.push({...element,tagCount:1})
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
/* 勾选左侧列表通过扫描到的数据 */
|
|
|
this.data.forEach((item) => {
|
|
|
this.scanData.rfidTagItems.forEach((scan) => {
|