|
@@ -313,15 +313,28 @@
|
313
|
313
|
<div class="tool">
|
314
|
314
|
<span
|
315
|
315
|
class="remove-num"
|
|
316
|
+ v-if="!item.isWeightGood"
|
316
|
317
|
@click="selectRemove(item)"
|
317
|
318
|
></span>
|
318
|
|
- <span class="num-input">{{
|
319
|
|
- item.select_num
|
320
|
|
- }}</span>
|
|
319
|
+ <span
|
|
320
|
+ class="num-input"
|
|
321
|
+ :class="{ isWeight: item.isWeightGood }"
|
|
322
|
+ >{{ item.select_num }}
|
|
323
|
+ {{
|
|
324
|
+ item.isWeightGood ? "(kg)" : ""
|
|
325
|
+ }}</span
|
|
326
|
+ >
|
321
|
327
|
<span
|
322
|
328
|
class="add-num"
|
|
329
|
+ v-if="!item.isWeightGood"
|
323
|
330
|
@click="selectAdd(item)"
|
324
|
331
|
></span>
|
|
332
|
+ <!-- 称重删除 -->
|
|
333
|
+ <span
|
|
334
|
+ v-if="item.isWeightGood"
|
|
335
|
+ class="remove-num"
|
|
336
|
+ @click="weightRemove(item)"
|
|
337
|
+ ></span>
|
325
|
338
|
</div>
|
326
|
339
|
</div>
|
327
|
340
|
</li>
|
|
@@ -569,10 +582,13 @@ export default {
|
569
|
582
|
pageIndex: self.page,
|
570
|
583
|
pageSize: 20,
|
571
|
584
|
type: self.subCategoryId || self.categoryId,
|
572
|
|
- status: this.typeStatus,
|
|
585
|
+ // status: this.typeStatus,
|
573
|
586
|
keyword: this.searchVal || "",
|
574
|
|
- weighingGoods:this.viewWeighGood?1:0, // ,0-非称重商品,1-称重商品
|
|
587
|
+ weighingGoods: this.viewWeighGood ? 1 : 0, // ,0-非称重商品,1-称重商品
|
575
|
588
|
};
|
|
589
|
+ if (this.viewWeighGood) {
|
|
590
|
+ sendData.status = 0;
|
|
591
|
+ }
|
576
|
592
|
|
577
|
593
|
uni.showLoading({
|
578
|
594
|
title: "加载中...",
|
|
@@ -605,8 +621,12 @@ export default {
|
605
|
621
|
pageIndex: self.page,
|
606
|
622
|
pageSize: 20,
|
607
|
623
|
type: self.subCategoryId || self.categoryId,
|
608
|
|
- status: this.typeStatus,
|
|
624
|
+ // status: this.typeStatus,
|
|
625
|
+ weighingGoods: this.viewWeighGood ? 1 : 0, // ,0-非称重商品,1-称重商品
|
609
|
626
|
};
|
|
627
|
+ if (this.viewWeighGood) {
|
|
628
|
+ sendData.status = 0;
|
|
629
|
+ }
|
610
|
630
|
self.api.get("/Product/GetSlimList", sendData).then((res) => {
|
611
|
631
|
if (res.data.data.length) {
|
612
|
632
|
self.page++;
|
|
@@ -692,26 +712,8 @@ export default {
|
692
|
712
|
uni.hideLoading();
|
693
|
713
|
if (goodRes.success) {
|
694
|
714
|
let goodDetail = goodRes.data;
|
695
|
|
- self.$refs.weigh.open(goodDetail, (res, type) => {
|
696
|
|
- // if (type === "add") {
|
697
|
|
- // this.selectList.push(res);
|
698
|
|
- // } else {
|
699
|
|
- // let arr = [];
|
700
|
|
- // for (let item of this.selectList) {
|
701
|
|
- // if (
|
702
|
|
- // item.id === res.id &&
|
703
|
|
- // item._sku.skuId === res._sku.skuId
|
704
|
|
- // ) {
|
705
|
|
- // if (res.select_num !== 0) {
|
706
|
|
- // item.select_num = res.select_num;
|
707
|
|
- // arr.push(item);
|
708
|
|
- // }
|
709
|
|
- // } else {
|
710
|
|
- // arr.push(item);
|
711
|
|
- // }
|
712
|
|
- // }
|
713
|
|
- // this.selectList = arr;
|
714
|
|
- // }
|
|
715
|
+ self.$refs.weigh.open(goodDetail, (res) => {
|
|
716
|
+ this.selectList.push(res);
|
715
|
717
|
});
|
716
|
718
|
} else {
|
717
|
719
|
self.fn.showModal({
|
|
@@ -761,6 +763,18 @@ export default {
|
761
|
763
|
this.selectList = arr;
|
762
|
764
|
},
|
763
|
765
|
|
|
766
|
+ weightRemove(val){
|
|
767
|
+ let arr = [];
|
|
768
|
+ for (let item of this.selectList) {
|
|
769
|
+ if (val.id === item.id) {
|
|
770
|
+
|
|
771
|
+ } else {
|
|
772
|
+ arr.push(item);
|
|
773
|
+ }
|
|
774
|
+ }
|
|
775
|
+ this.selectList = arr;
|
|
776
|
+ },
|
|
777
|
+
|
764
|
778
|
selectAdd(val) {
|
765
|
779
|
let arr = [];
|
766
|
780
|
for (let item of this.selectList) {
|
|
@@ -1190,6 +1204,9 @@ page {
|
1190
|
1204
|
width: px(140);
|
1191
|
1205
|
font-size: px(40);
|
1192
|
1206
|
text-align: center;
|
|
1207
|
+ &.isWeight {
|
|
1208
|
+ width: px(240);
|
|
1209
|
+ }
|
1193
|
1210
|
}
|
1194
|
1211
|
}
|
1195
|
1212
|
.remove-num,
|