From 3457909638c660c0cfcb521b6104ab64c679b914 Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期二, 19 九月 2023 16:23:16 +0800
Subject: [PATCH] 修改页面左右展示比例

---
 src/views/eam/SpecialtyMaintenanceOrderList.vue |  120 +++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 90 insertions(+), 30 deletions(-)

diff --git a/src/views/eam/SpecialtyMaintenanceOrderList.vue b/src/views/eam/SpecialtyMaintenanceOrderList.vue
index 68ba0e9..c557e19 100644
--- a/src/views/eam/SpecialtyMaintenanceOrderList.vue
+++ b/src/views/eam/SpecialtyMaintenanceOrderList.vue
@@ -64,13 +64,14 @@
         @click="handleAdd"
         type="primary"
         icon="plus"
+        v-has="'specialtyMaintenanceOrder:add'"
       >鏂板</a-button>
-      <a-button
+      <!-- <a-button
         v-if="selectedRowKeys.length > 0"
         type="primary"
         @click="batchAssign"
         style="margin-left: 8px"
-      >宸ュ崟娲惧伐</a-button>
+      >宸ュ崟娲惧伐</a-button> -->
       <!-- <a-button
         type="primary"
         icon="download"
@@ -125,6 +126,7 @@
         :loading="loading"
         class="j-table-force-nowrap"
         @change="handleTableChange"
+        :rowClassName="tableRowClass"
       >
         <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
         <span
@@ -135,7 +137,10 @@
             title="纭畾涓嬪彂宸ュ崟鍚�?"
             @confirm="() => handleOrderIssue(record)"
           >
-            <a v-if="record.status == '1'">涓嬪彂</a>
+            <a
+              v-has="'specialtyMaintenanceOrder:issue'"
+              v-if="record.status == '1'"
+            >涓嬪彂</a>
           </a-popconfirm>
           <a-divider
             v-if="record.status == '1'"
@@ -145,7 +150,10 @@
             title="纭畾鎾ゅ洖宸ュ崟鍚�?"
             @confirm="() => handleOrderReset(record)"
           >
-            <a v-if="record.status == '2'">鎾ゅ洖</a>
+            <a
+              v-has="'specialtyMaintenanceOrder:issue'"
+              v-if="record.status == '2'"
+            >鎾ゅ洖</a>
           </a-popconfirm>
           <a-divider
             v-if="record.status == '2'"
@@ -155,7 +163,10 @@
             title="纭畾鎭㈠宸ュ崟鍚�?"
             @confirm="() => handleOrderRecover(record)"
           >
-            <a v-if="record.status == '7'">鎭㈠</a>
+            <a
+              v-has="'specialtyMaintenanceOrder:recover'"
+              v-if="record.status == '7'"
+            >鎭㈠</a>
           </a-popconfirm>
           <a-divider
             v-if="record.status == '7'"
@@ -165,7 +176,10 @@
             title="纭畾浣滃簾宸ュ崟鍚�?"
             @confirm="() => handleOrderCancel(record)"
           >
-            <a v-if="record.status == '2'">浣滃簾</a>
+            <a
+              v-has="'specialtyMaintenanceOrder:recover'"
+              v-if="record.status == '2'"
+            >浣滃簾</a>
           </a-popconfirm>
           <a-divider
             v-if="record.status == '2'"
@@ -175,19 +189,25 @@
             title="纭畾棰嗗彇宸ュ崟鍚�?"
             @confirm="() => handleOrderGet(record)"
           >
-            <a v-if="record.status == '2' && record.assignMode == '1'">棰嗗彇</a>
+            <a
+              v-has="'specialtyMaintenanceOrder:get'"
+              v-if="record.status == '2' && record.assignMode == '1'"
+            >棰嗗彇</a>
           </a-popconfirm>
           <a
             v-if="record.status == '2' && record.assignMode == '2'  "
             @click="handleAssignOrder(record)"
+            v-has="'specialtyMaintenanceOrder:assign'"
           >娲惧伐</a>
           <a
-            v-if="record.status == '2'&& record.assignMode == '3'  && record.inspectionUserName != null  "
+            v-if="record.status == '2'&& record.assignMode == '3'  && record.maintenanceUserName != null  "
             @click="handleAssignOrder(record)"
+            v-has="'specialtyMaintenanceOrder:assign'"
           >鏀规淳</a>
           <a
             v-if="record.status == '3'"
             @click="handleAssignOrder(record)"
+            v-has="'specialtyMaintenanceOrder:assign'"
           >鏀规淳</a>
           <a-divider
             v-if="record.status == '2'"
@@ -200,6 +220,7 @@
           <a
             v-if="record.status === '3' || record.status === '4'  "
             @click="handleOrderExe(record)"
+            v-has="'specialtyMaintenanceOrder:exe'"
           >鎵ц</a>
           <a-divider
             v-if="record.status === '3' || record.status === '4' "
@@ -208,6 +229,7 @@
           <a
             v-if="record.status === '1'"
             @click="handleEdit(record)"
+            v-has="'specialtyMaintenanceOrder:edit'"
           >缂栬緫</a>
           <a-divider
             v-if="record.status === '1'"
@@ -224,7 +246,10 @@
                   title="纭畾鍒犻櫎鍚�?"
                   @confirm="() => handleDelete(record.id)"
                 >
-                  <a v-if="record.status === '1'">鍒犻櫎</a>
+                  <a
+                    v-has="'specialtyMaintenanceOrder:delete'"
+                    v-if="record.status === '1'"
+                  >鍒犻櫎</a>
                 </a-popconfirm>
               </a-menu-item>
             </a-menu>
@@ -258,8 +283,8 @@
       ref="SpecialyMaintenanceOrderExeDrawer"
       @ok="modalFormOk"
     ></specialy-maintenance-order-exe-drawer>
-    <specialty-maintenance-order-assign-modal 
-       ref="SpecialtyMaintenanceOrderAssignModal"
+    <specialty-maintenance-order-assign-modal
+      ref="SpecialtyMaintenanceOrderAssignModal"
       @ok="modalFormOk"
     >
     </specialty-maintenance-order-assign-modal>
@@ -349,35 +374,35 @@
           align: "center",
           dataIndex: 'teamName',
         },
-        {
-          title: '宸ユ椂瀹氶/姣忓皬鏃�',
-          align: "center",
-          dataIndex: 'sumOfWorkingHourQuota',
-        },
+        // {
+        //   title: '宸ユ椂瀹氶/姣忓皬鏃�',
+        //   align: "center",
+        //   dataIndex: 'sumOfWorkingHourQuota',
+        // },
         {
           title: '璁″垝寮�濮嬫椂闂�',
           align: "center",
           dataIndex: 'planStartTime',
-          width:170
-          
+          width: 170
+
         },
         {
           title: '璁″垝缁撴潫鏃堕棿',
           align: "center",
           dataIndex: 'planEndTime',
-          width:170
+          width: 170
         },
         {
           title: '瀹為檯寮�濮嬫椂闂�',
           align: "center",
           dataIndex: 'actualStartTime',
-          width:170
+          width: 170
         },
         {
           title: '瀹為檯缁撴潫鏃堕棿',
           align: "center",
           dataIndex: 'actualEndTime',
-          width:170
+          width: 170
         },
         {
           title: '瀹為檯鐢ㄦ椂',
@@ -398,7 +423,7 @@
           title: '鍒涘缓鏃ユ湡',
           align: "center",
           dataIndex: 'createTime',
-          width:170
+          width: 170
         },
         {
           title: '鎿嶄綔',
@@ -444,13 +469,13 @@
 
   methods: {
 
-    batchAssign() {
-      this.$refs.InspectionOrderAssignModal.visible = true
-      this.$refs.InspectionOrderAssignModal.title = '宸ュ崟娲惧伐'
-      this.$refs.InspectionOrderAssignModal.selectionRows
-      this.$refs.InspectionOrderAssignModal.handleShow()
-      this.$bus.$emit('selectionRows', this.selectionRows);
-    },
+    // batchAssign() {
+    //   this.$refs.InspectionOrderAssignModal.visible = true
+    //   this.$refs.InspectionOrderAssignModal.title = '宸ュ崟娲惧伐'
+    //   this.$refs.InspectionOrderAssignModal.selectionRows
+    //   this.$refs.InspectionOrderAssignModal.handleShow()
+    //   this.$bus.$emit('selectionRows', this.selectionRows);
+    // },
     onSelectChange(selectionRows) {
       this.selectionRows = selectionRows;
     },
@@ -549,9 +574,44 @@
     //   //娓呯┖鍒楄〃閫変腑
     //   this.onClearSelected()
     // },
+
+    //棰勮棰滆壊
+    tableRowClass(record, index) {
+      if ("1" == record.status || "2" == record.status) {
+        if (record.yellowWarningTime < record.currentDateTime && record.currentDateTime < record.redWarningTime) {
+          return 'yellow'
+        } else if (record.redWarningTime < record.currentDateTime && record.currentDateTime < record.planStartTime) {
+          return 'error'
+        } else if (record.planStartTime < record.currentDateTime) {
+          return 'frozenRowClass'
+        }
+      }
+    },
   }
 }
 </script>
-<style scoped>
+<style >
 @import '~@assets/less/common.less';
+.frozenRowClass {
+  color: #c9c9c9;
+  font-weight: bold;
+}
+.success {
+  color: green;
+}
+.error {
+  color: red;
+  font-weight: bold;
+}
+.yellow {
+  color: yellow;
+  font-weight: bold;
+}
+.fontweight {
+  font-weight: bold;
+}
+
+.ant-table-tbody .red {
+  background-color: red !important;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3