Просмотр исходного кода

fix(出库管理): 修复挂起状态下删除按钮显示问题并添加行样式

liujt 7 месяцев назад
Родитель
Сommit
4fde19a11f

+ 25 - 0
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -123,11 +123,13 @@
       :needPage="false"
       :columns="columns"
       @columns-change="handleColumnChange"
+      @row-click="handleRowClick"
       :cache-key="cacheKeyUrl"
       :datasource="detailData.productList"
       row-key="id"
       show-summary
       :summary-method="getSummaries"
+      :row-class-name="tableRowClassName"
     >
       <template v-slot:stockLedger="scope">
         <el-popover placement="right" width="60%" trigger="hover">
@@ -669,6 +671,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,
@@ -734,6 +756,9 @@
 </script>
 
 <style scoped lang="scss">
+  ::v-deep .el-table .warning-row {
+    background: #d9ecff;
+  }
   .title {
     font-size: 22px;
     font-weight: 800;

+ 2 - 1
src/views/bpm/outgoingManagement/outbound.vue

@@ -337,7 +337,7 @@
                   <el-link
                     type="danger"
                     @click="deleteProductList(row, $index)"
-                    v-if="isEdit"
+                    v-if="isEdit && row.isSuspend != 1"
                     >删除</el-link
                   >
                 </template>
@@ -744,6 +744,7 @@
       },
       tableRowClassName({ row, rowIndex }) {
         console.log(row);
+        // 结果 0=默认,1=合格,2=不合格
         if (row.result == 1) {
           return 'warning-row';
         } else {