Ver Fonte

修改选中

chenrui há 2 anos atrás
pai
commit
ef555da3ba

+ 3 - 3
src/views/purchasingManagement/purchaseReturn/purchaseReturnDeatil.vue

@@ -236,9 +236,12 @@ export default {
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
+            const snArr = []
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              snArr.push(data.list[i].sparePartsDetailSn)
             }
+            this.$refs.partQuery.pageInit(this.supplierSn, snArr)
             this.disabled = false
           }
           this.chooseList = data.list
@@ -286,7 +289,6 @@ export default {
     },
     resetTable (flag) {
       this.$refs.table.refresh(flag)
-      this.$refs.partQuery.refreshTable()
     },
     //  重置
     resetSearchForm (flag) {
@@ -294,7 +296,6 @@ export default {
       this.productForm.productCode = ''
       this.productForm.sparePartsNo = ''
       this.$refs.table.refresh(!!flag)
-      this.$refs.partQuery.refreshTable()
     },
     // 已选产品  blur
     onCellBlur (val, record) {
@@ -413,7 +414,6 @@ export default {
       this.supplierSn = this.$route.query.sn
       this.sparePartsReturnSn = this.$route.query.returnSn
       this.sparePartsReturnNo = this.$route.query.no
-      this.$refs.partQuery.pageInit(this.supplierSn, 0)
       this.getStatisticsData()
       this.getBasicsData()
       this.resetSearchForm(true)

+ 7 - 3
src/views/purchasingManagement/purchaseReturn/queryPart.vue

@@ -45,7 +45,7 @@
       ref="chooseTable"
       size="small"
       :rowKey="(record) => record.id"
-      :row-selection="{ columnWidth: 40,getCheckboxProps: record => ({ props: { disabled: record.currentStockQty == 0 } }) }"
+      :row-selection="{ columnWidth: 40,getCheckboxProps: record => ({ props: { disabled: record.currentStockQty == 0 || record.is_checked} }) }"
       @rowSelection="rowSelectionFun"
       :columns="columns"
       :data="loadData"
@@ -73,7 +73,7 @@
           type="link"
           class="button-info"
           :loading="newLoading"
-          v-if="record.currentStockQty != 0"
+          v-if="record.currentStockQty != 0 && !record.is_checked"
           @click="handleAdd(record)"
         >添加</a-button>
         <span v-else>--</span>
@@ -121,6 +121,7 @@ export default {
       disabled: false, //  查询、重置按钮是否可操作
       selectArr: null,
       isChecked: false,
+      addedSn: [],
       columns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
         { title: '入库单号', dataIndex: 'sparePartsNo', width: '24%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -147,6 +148,8 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               data.list[i].qty = data.list[i].currentStockQty
+              const val = this.addedSn.findIndex(item => { return item == data.list[i].sparePartsDetailSn }) != -1
+              data.list[i].is_checked = val
             }
             this.disabled = false
           }
@@ -180,8 +183,9 @@ export default {
       this.queryParam.beginDate = date[0] ? date[0] : ''
       this.queryParam.endDate = date[1] ? date[1] : ''
     },
-    pageInit (buyerSn) {
+    pageInit (buyerSn, addedSn) {
       this.buyerSn = buyerSn
+      this.addedSn = addedSn// 已添加列表sn
       this.resetSearchForm()
     },
     // 添加