chenrui 2 vuotta sitten
vanhempi
commit
2cabf2efcb

+ 11 - 8
src/views/purchasingManagement/purchaseReturn/purchaseReturnDeatil.vue

@@ -68,8 +68,8 @@
                   <a-form-item label="产品名称"><a-input v-model.trim="productForm.productName" allowClear placeholder="请输入产品名称" /></a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                  <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled">查询</a-button>
-                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled">重置</a-button>
+                  <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm">重置</a-button>
                 </a-col>
               </a-row>
             </a-form>
@@ -80,7 +80,7 @@
           class="sTable"
           ref="table"
           size="small"
-          :rowKey="record => record.id"
+          :rowKey="(record,index) => index"
           :columns="columns"
           :data="loadData"
           :defaultLoadData="false"
@@ -160,7 +160,6 @@ export default {
   data () {
     return {
       spinning: false,
-      disabled: false, // 查询重置
       isInster: false, // 是否正在添加产品
       openDepartUserModal: false, // 审核人员弹窗
       delLoading: false,
@@ -175,7 +174,6 @@ export default {
       chooseList: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        this.disabled = true
         this.productForm.sparePartsReturnSn = this.$route.query.returnSn
         return sparePartsReturnQueryPage(Object.assign(parameter, this.productForm)).then(res => {
           let data
@@ -185,9 +183,6 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
             }
-
-            this.$refs.partQuery.pageInit(this.supplierSn, this.sparePartsReturnSn)
-            this.disabled = false
           }
           this.chooseList = data.list
           return data
@@ -300,6 +295,8 @@ export default {
               if (res.status == 200) {
                 _this.resetTable(false)
                 _this.getStatisticsData()
+                _this.getChooseList()
+                _this.$refs.partQuery.refreshLength()
               }
               _this.$message.info(res.message)
               _this.delLoading = false
@@ -409,6 +406,7 @@ export default {
         if (res.status == 200) {
           this.getStatisticsData()
           this.$refs.table.refresh(true)
+          this.getChooseList()
         }
         this.isInster = false
         this.spinning = false
@@ -423,6 +421,7 @@ export default {
         .then(res => {
           if (res.status == 200) {
             this.getStatisticsData()
+            this.getChooseList()
             this.$refs.table.refresh(true)
           }
           this.isInster = false
@@ -460,6 +459,10 @@ export default {
       this.getStatisticsData()
       this.getBasicsData()
       this.resetSearchForm(true)
+      this.getChooseList()
+    },
+    getChooseList () {
+      this.$refs.partQuery.pageInit(this.supplierSn, this.sparePartsReturnSn)
     },
     // 获取页面统计数据
     getStatisticsData () {

+ 12 - 8
src/views/purchasingManagement/purchaseReturn/queryPart.vue

@@ -26,8 +26,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="4" :sm="24">
-              <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="disabled" id="salesReturnList-refresh">查询</a-button>
-              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesReturnList-reset">重置</a-button>
+              <a-button type="primary" @click="$refs.chooseTable.refresh(true)" id="salesReturnList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" id="salesReturnList-reset">重置</a-button>
             </a-col>
             <a-col :md="12" :sm="24" style="margin-bottom: 10px;display: flex;align-items: center;">
               <a-button type="primary" style="margin-right: 5px" @click="handleBatchAdd" :loading="addMoreLoading">批量添加</a-button>
@@ -45,7 +45,7 @@
       class="sTable"
       ref="chooseTable"
       size="small"
-      :rowKey="(record) => record.id"
+      :rowKey="(record,i) => i"
       :row-selection="{ columnWidth: 40,getCheckboxProps: record => ({ props: { disabled: record.currentStockQty == 0 || record.isCheckedFlag} }) }"
       @rowSelection="rowSelectionFun"
       :columns="columns"
@@ -74,7 +74,7 @@
           type="link"
           class="button-info"
           :loading="newLoading"
-          v-if="record.currentStockQty != 0"
+          v-if="record.currentStockQty != 0 && !record.isCheckedFlag"
           @click="handleAdd(record)"
         >添加</a-button>
         <span v-else>--</span>
@@ -120,26 +120,22 @@ export default {
         isZero: 0
       },
       warehousingDate: [], // 入库时间
-      disabled: false, //  查询、重置按钮是否可操作
       selectArr: null,
       isChecked: false,
       repeatList: null,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        this.disabled = true
         this.queryParam.supplierSn = this.buyerSn
         return queryDetailStockPage(Object.assign(parameter, this.queryParam)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
-
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               data.list[i].qty = data.list[i].currentStockQty
               data.list[i].isCheckedFlag = this.repeatList.findIndex(item => { return item == data.list[i].sparePartsDetailSn }) > -1
             }
-            this.disabled = false
           }
           return data
         })
@@ -198,8 +194,16 @@ export default {
     },
     // 添加
     handleAdd (row) {
+      if (this.selectArr && this.selectArr.length > 0) {
+        const pot = this.selectArr.findIndex(item => { return item.sparePartsDetailSn == row.sparePartsDetailSn })
+        this.selectArr.splice(pot, 1)
+      }
       this.$emit('add', row)
     },
+    // 删除后选中长度恢复
+    refreshLength (row) {
+      this.$refs.chooseTable.clearSelected()
+    },
     rowSelectionFun (obj) {
       this.selectArr = obj.selectedRows
     },

+ 2 - 2
src/views/reportData/urchaseReturn/list.vue

@@ -83,7 +83,7 @@
         <template slot="footer">
           <a-row :gutter="15">
             <a-col :md="4" :sm="24">申请退货数量:{{ (totalData && (totalData.totalQty || totalData.totalQty==0)) ? totalData.totalQty : '--' }}</a-col>
-            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowPrice')">退货金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</a-col>
+            <a-col :md="4" :sm="24" v-if="$hasPermissions('B_isShowCost')">退货金额:{{ (totalData && (totalData.totalCost || totalData.totalCost==0)) ? totalData.totalCost : '--' }}</a-col>
           </a-row>
         </template>
       </s-table>
@@ -177,7 +177,7 @@ export default {
           _this.showExport = true
           _this.exportLoading = true
           _this.spinning = true
-          params.showCostFlag = _this.$hasPermissions('B_isShowPrice') ? 1 : 0
+          params.showCostFlag = _this.$hasPermissions('B_isShowCost') ? 1 : 0
           hdExportExcel(sparePartsReturnReportExport, params, '采购退货单报表', function () {
             _this.exportLoading = false
             _this.spinning = false