Jelajahi Sumber

fix(销售订单): 修复挂起状态行样式和交互问题

liujt 7 bulan lalu
induk
melakukan
2bebedb491

+ 9 - 6
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -297,7 +297,7 @@
             v-if="scope.row.isSuspend === 1"
             :underline="false"
             type="primary"
-            @click="pendingReplaceTable()"
+            @click="pendingReplaceTable(scope.row, scope.$index)"
           >
             {{ scope.row.warehouseNum }}
           </el-link>
@@ -987,7 +987,7 @@
     methods: {
        // 挂起/取消挂起功能
       async pending(row) {
-        console.log('pending~~~', row, type)
+        console.log('pending~~~', row)
           // 取消挂起不需要二次确认
           this.$set(row, 'isSuspend', 0);
           this.$forceUpdate();
@@ -1001,7 +1001,7 @@
       // 通过挂起状态设置行样式
       tableRowClassName({row}) {
         // console.log('tableRowClassName', row)
-        if (row.isSuspend === 1) {
+        if (row.isSuspend == 1) {
           return 'warning-row';
         }
         return '';
@@ -1603,6 +1603,9 @@
   };
 </script>
 <style lang="scss" scoped>
+  ::v-deep .el-table .warning-row {
+    background: #d9ecff;
+  }
   .headbox {
     display: flex;
     justify-content: flex-start;
@@ -1641,9 +1644,9 @@
     background-color: transparent !important;
   }
 
-  ::v-deep .time-form .el-table tr {
-    background-color: #ffffff;
-  }
+  // ::v-deep .time-form .el-table tr {
+  //   background-color: #ffffff;
+  // }
 
   .pricebox {
     display: flex;

+ 28 - 3
src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue

@@ -6,11 +6,13 @@
     :datasource="form.datasource"
     row-key="id"
     @columns-change="handleColumnChange"
+    @row-click="handleRowClick"
     :cache-key="cacheKeyUrl"
     height="350"
     full-height="calc(100vh - 76px)"
     show-summary
     :summary-method="getSummaries"
+    :row-class-name="tableRowClassName"
   >
     <template v-slot:technicalDrawings="{ row }">
       <fileMain v-model="row.technicalDrawings" type="view"></fileMain>
@@ -452,6 +454,26 @@
       }
     },
     methods: {
+      // 通过挂起状态设置行样式
+      tableRowClassName({row}) {
+        console.log('tableRowClassName', row)
+        if (row.isSuspend === 1) {
+          return 'warning-row';
+        }
+        return '';
+      },
+      handleRowClick(row) {
+        // this.current = row;
+        // console.log('handleRowClick', row)
+        if (row.isSuspend === 1) {
+          this.$alert(`替代批次号:${row.offsetDetail[0].batchNo}`, {
+            confirmButtonText: '知道了',
+            type: 'none'
+          }).catch(() => {
+            // 捕获用户取消操作时的Promise rejection
+          });
+        }
+      },
       getSummaries(param) {
         return getSummaries(
           param,
@@ -470,6 +492,9 @@
   };
 </script>
 <style lang="scss" scoped>
+  ::v-deep .el-table .warning-row {
+    background: #d9ecff;
+  }
   .headbox {
     display: flex;
     justify-content: flex-start;
@@ -508,9 +533,9 @@
     background-color: transparent !important;
   }
 
-  ::v-deep .time-form .el-table tr {
-    background-color: #ffffff;
-  }
+  // ::v-deep .time-form .el-table tr {
+  //   background-color: #ffffff;
+  // }
 
   .pricebox {
     display: flex;

+ 1 - 1
src/views/saleManage/saleOrder/invoice/components/selectStockLedger/selectStockLedgerDialog.vue

@@ -52,7 +52,7 @@
             :selection.sync="selection"
           >
             <template v-slot:action="{ row }">
-              <el-radio class="radio" v-model="radio" :label="row.batchNo"
+              <el-radio class="radio" v-model="radio" :label="row.id"
                 ><i></i
               ></el-radio>
             </template>