From d5b955494f6d658959e50b9e87ea7ebafb86c6d4 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期三, 05 三月 2025 17:13:09 +0800
Subject: [PATCH] art: 中心项 改为 必填

---
 src/views/eam/DailyMaintenanceStandardList.vue |  263 +++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 208 insertions(+), 55 deletions(-)

diff --git a/src/views/eam/DailyMaintenanceStandardList.vue b/src/views/eam/DailyMaintenanceStandardList.vue
index 5692a18..4edd32c 100644
--- a/src/views/eam/DailyMaintenanceStandardList.vue
+++ b/src/views/eam/DailyMaintenanceStandardList.vue
@@ -1,6 +1,6 @@
 <template>
   <a-card
-    title="鏃ュ父淇濆吇鏍囧噯"
+    title=""
     :bordered='false'
   >
     <div class='table-page-search-wrapper'>
@@ -28,10 +28,10 @@
             :md='8'
             :sm='24'
           >
-            <a-form-item label='璁惧鍚嶇О'>
+            <a-form-item label='缁熶竴缂栧彿'>
               <a-input
-                placeholder='璇疯緭鍏ヨ澶囧悕绉�'
-                v-model='queryParam.name'
+                placeholder='璇疯緭鍏ョ粺涓�缂栧彿'
+                v-model='queryParam.equipmentNum'
               ></a-input>
             </a-form-item>
           </a-col>
@@ -90,7 +90,32 @@
         type='primary'
         icon='plus'
         v-has="'dailyMaintenanceStandard:add'"
-      >鏂板</a-button>
+      >缂栧埗</a-button>
+      <a-upload
+        name="file"
+        :showUploadList="false"
+        :multiple="false"
+        :headers="tokenHeader"
+        :action="importExcelUrl"
+        @change="handleImportExcel"
+      >
+        <a-button
+          type="primary"
+          icon="import"
+          v-has="'dailyMaintenanceStandard:import'"
+        >瀵煎叆</a-button>
+      </a-upload>
+      <a-button
+        type="primary"
+        @click="handleDownload"
+        icon="download"
+      >妯$増涓嬭浇</a-button>
+      <a-button
+        v-show="selectedRowKeys.length == 1 "
+        type="primary"
+        @click="handlePrint(selectionRows[0])"
+        icon="highlight"
+      >妯$増鎵撳嵃</a-button>
       <a-button
         type='primary'
         @click='searchQuery'
@@ -122,7 +147,7 @@
         size='middle'
         bordered
         rowKey='id'
-        :scroll="{ x: 'calc(1600px + 50%)', y: 900 }"
+        :scroll="{ x: 'calc(2300px + 50%)', y: 900 }"
         :columns='columns'
         :dataSource='dataSource'
         :pagination='ipagination'
@@ -159,30 +184,49 @@
           slot-scope="text, record"
         >
           <a
-            v-if="record.versionStatus == '2'"
-            @click="handleRevise(record)"
-            v-has="'dailyMaintenanceStandard:revise'"
-          >鍗囩増</a>
-          <a
-            v-if="record.versionStatus == '1'"
-            @click="handleTakeEffect(record)"
-            v-has="'dailyMaintenanceStandard:takeEffect'"
-          >鐢熸晥</a>
+            v-show="record.versionStatus == '1' && record.approvalStatus == '1' "
+            @click="handleAuditApproval(record)"
+            v-has="'dailyMaintenanceStandard:audit'"
+          >瀹℃牳</a>
           <a-divider type="vertical" />
           <a
-            v-if="record.versionStatus == '1'"
+            v-show="record.versionStatus == '1' && record.approvalStatus == '4'"
+            @click="handleAuditApproval(record)"
+            v-has="'dailyMaintenanceStandard:againAudit'"
+          >閲嶆柊瀹℃牳</a>
+          <a-divider type="vertical" />
+          <a
+            v-show="record.versionStatus == '1'&& record.approvalStatus == '3' "
+            @click="handleAuditApproval(record)"
+            v-has="'dailyMaintenanceStandard:approval'"
+          >瀹℃壒</a>
+          <a-divider type="vertical" />
+          <a
+            v-show="record.versionStatus == '1' && (record.approvalStatus == '1' || record.approvalStatus == '2')"
             @click="handleEdit(record)"
             v-has="'dailyMaintenanceStandard:edit'"
           >缂栬緫</a>
           <a-divider type="vertical" />
           <a-popconfirm
-            v-if="record.versionStatus == '1'"
+            v-show="record.versionStatus == '1' && (record.approvalStatus == '1' || record.approvalStatus == '2')"
             title="纭畾鍒犻櫎鍚�?"
             @confirm="() => handleDelete(record.id)"
             v-has="'dailyMaintenanceStandard:delete'"
           >
             <a>鍒犻櫎</a>
           </a-popconfirm>
+          <a-divider type="vertical" />
+          <a
+            v-show="record.versionStatus != '1'"
+            @click="handleRevise(record)"
+            v-has="'dailyMaintenanceStandard:revise'"
+          >鍗囩増</a>
+          <a-divider type="vertical" />
+          <a
+            v-show="record.versionStatus == '2'"
+            @click="handleTakeEffect(record)"
+            v-has="'dailyMaintenanceStandard:loseEfficacy'"
+          >澶辨晥</a>
         </span>
 
       </a-table>
@@ -201,7 +245,7 @@
             <daily-maintenance-standard-detail :maintenanceStandardId='maintenanceStandardId' />
           </div>
         </a-tab-pane>
-        <a-tab-pane
+        <!-- <a-tab-pane
           tab='璁″垝鐢ㄦ枡'
           key="2"
         >
@@ -233,7 +277,7 @@
           >
             <maintenance-standard-work-instruction :maintenanceStandardId='maintenanceStandardId' />
           </div>
-        </a-tab-pane>
+        </a-tab-pane> -->
 
       </a-tabs>
     </div>
@@ -242,6 +286,11 @@
       ref='modalForm'
       @ok='modalFormOk'
     ></daily-maintenance-standard-modal>
+
+    <audit-approval-modal
+      ref='auditApprovalModal'
+      @ok='modalFormOk'
+    ></audit-approval-modal>
   </a-card>
 </template>
 
@@ -249,12 +298,13 @@
 
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 
-import { getAction, postAction, requestPut } from '@/api/manage'
+import { getAction, postAction, requestPut, downFile } from '@/api/manage'
 import DailyMaintenanceStandardDetail from './modules/dailyMaintenanceStandard/DailyMaintenanceStandardDetail'
 import MaintenanceStandardPlanningMaterial from '@/views/eam/modules/dailyMaintenanceStandard/MaintenanceStandardPlanningMaterial'
 import MaintenanceStandardSafetyRequirement from '@/views/eam/modules/dailyMaintenanceStandard/MaintenanceStandardSafetyRequirement'
 import DailyMaintenanceStandardModal from './modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal'
 import MaintenanceStandardWorkInstruction from '@/views/eam/modules/dailyMaintenanceStandard/MaintenanceStandardWorkInstruction'
+import AuditApprovalModal from './modules/dailyMaintenanceStandard/AuditApprovalModal'
 import '@/assets/less/TableExpand.less'
 
 export default {
@@ -265,7 +315,8 @@
     DailyMaintenanceStandardModal,
     MaintenanceStandardPlanningMaterial,
     MaintenanceStandardSafetyRequirement,
-    MaintenanceStandardWorkInstruction
+    MaintenanceStandardWorkInstruction,
+    AuditApprovalModal
   },
   data() {
     return {
@@ -281,23 +332,22 @@
           }
         },
         {
-          title: '鐗堟湰',
-          align: 'center',
-          dataIndex: 'version',
-        },
-        {
-          title: '鐗堟湰鐘舵��',
-          align: 'center',
-          dataIndex: 'versionStatusName',
-        },
-        {
           title: '鏍囧噯缂栫爜',
           align: 'center',
           dataIndex: 'num',
         },
-
         {
-          title: '璁惧缂栫爜',
+          title: '鏍囧噯绫诲瀷',
+          align: 'center',
+          dataIndex: 'maintenanceTypeName',
+        },
+        {
+          title: '绛惧鐘舵��',
+          align: 'center',
+          dataIndex: 'approvalStatusName',
+        },
+        {
+          title: '缁熶竴缂栫爜',
           align: 'center',
           dataIndex: 'equipmentNum',
         },
@@ -312,45 +362,95 @@
           dataIndex: 'equipmentModel',
         },
         {
-          title: '瀵硅薄閮ㄩ棬',
+          title: '浣跨敤閮ㄩ棬',
           align: 'center',
           dataIndex: 'useDepartName',
         },
-        {
-          title: '娲惧伐鏂瑰紡',
-          align: 'center',
-          dataIndex: 'assignModeName',
-        },
+
         {
           title: '璐d换鐝粍',
           align: 'center',
           dataIndex: 'teamName',
         },
+        // {
+        //   title: '鐗圭璁惧',
+        //   align: 'center',
+        //   dataIndex: 'specificEquipment',
+        // },
         {
-          title: '鐗圭璁惧',
+          title: '瀹℃牳缁撴灉',
           align: 'center',
-          dataIndex: 'specificEquipment',
+          dataIndex: 'maintenanceStandardUda1',
+        },
+        {
+          title: '瀹℃牳鎰忚',
+          align: 'center',
+          dataIndex: 'auditFeedback',
+        },
+        {
+          title: '瀹℃壒缁撴灉',
+          align: 'center',
+          dataIndex: 'maintenanceStandardUda2',
+        },
+        {
+          title: '瀹℃壒鎰忚',
+          align: 'center',
+          dataIndex: 'approvalFeedback',
+        },
+        {
+          title: '缂栧埗浜�',
+          align: 'center',
+          dataIndex: 'writePerson',
+        },
+        {
+          title: '瀹℃牳浜�',
+          align: 'center',
+          dataIndex: 'auditPerson',
+        },
+        {
+          title: '瀹℃壒浜�',
+          align: 'center',
+          dataIndex: 'approvalPerson',
+        },
+        {
+          title: '澶辨晥浜�',
+          align: 'center',
+          dataIndex: 'loseEfficacyPerson',
+        },
+        {
+          title: '缂栧埗鏃ユ湡',
+          align: 'center',
+          dataIndex: 'createTime',
+          width: 150,
         },
         {
           title: '鐢熸晥鏃堕棿',
           align: 'center',
           dataIndex: 'takeEffectTime',
+          width: 150,
         },
         {
           title: '澶辨晥鏃堕棿',
           align: 'center',
           dataIndex: 'loseEfficacyTime',
+          width: 150,
         },
         {
-          title: '鍒涘缓浜�',
+          title: '鐗堟湰',
           align: 'center',
-          dataIndex: 'createBy',
+          dataIndex: 'version',
         },
         {
-          title: '鍒涘缓鏃ユ湡',
+          title: '鐗堟湰鐘舵��',
           align: 'center',
-          dataIndex: 'createTime',
+          dataIndex: 'versionStatusName',
         },
+        // {
+        //   title: '鍒涘缓浜�',
+        //   align: 'center',
+        //   dataIndex: 'createBy',
+        // },
+
         // {
         //   title: '鏇存柊浜�',
         //   align: 'center',
@@ -375,12 +475,15 @@
         delete: '/eam/maintenanceStandard/delete',
         deleteBatch: '/eam/maintenanceStandard/deleteBatch',
         versionTakeEffect: "/eam/maintenanceStandard/versionTakeEffect",
+        importExcelUrl: "/eam/maintenanceStandard/importExcelOfTwoMaintenance",
+        download: '/sys/upload/downloadFile',
+        uploadList: '/sys/upload/list',
       },
       /* 鍒嗛〉鍙傛暟 */
       ipagination: {
         current: 1,
-        pageSize: 5,
-        pageSizeOptions: ['5', '10', '50'],
+        pageSize: 20,
+        pageSizeOptions: ['5', '10', '20', '50'],
         showTotal: (total, range) => {
           return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
         },
@@ -389,7 +492,12 @@
         total: 0
       },
       maintenanceStandardId: '-1',
-      queryParam: { type: 'daily' }
+      queryParam: { type: 'daily', maintenanceType: '2' }
+    }
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
     }
   },
   watch: {
@@ -464,6 +572,12 @@
       this.$refs.modalForm.isRevise = false;
     },
 
+    //瀹℃牳瀹℃壒
+    handleAuditApproval: function (record) {
+      this.$refs.auditApprovalModal.showModals(record);
+      this.$refs.auditApprovalModal.title = "瀹℃牳";
+    },
+
     //鍗囩増
     handleRevise: function (record) {
       this.$refs.modalForm.edit(record);
@@ -472,22 +586,22 @@
       this.$refs.modalForm.isRevise = true;
     },
 
-    //鐢熸晥
+    //澶辨晥
     handleTakeEffect(record) {
       const that = this;
       that.confirmLoading = true;
       this.$confirm({
-        title: '鏃ュ父淇濆吇鏍囧噯鐗堟湰鐢熸晥锛�',
-        content: '鎻愮ず锛氱増鏈敓鏁堝悗涓婁竴鐗堟湰灏嗚嚜鍔ㄥけ鏁堬紝璇疯皑鎱庢搷浣滐紒',
+        title: '淇濆吇鏍囧噯鐗堟湰澶辨晥锛�',
+        content: '鎻愮ず锛氱増鏈け鏁堝悗灏嗙姝娇鐢紝璇疯皑鎱庢搷浣滐紒',
         okText: '纭',
         cancelText: '鍙栨秷',
         onOk() {
-          requestPut(that.url.versionTakeEffect, { id: record.id, num: record.num, versionStatus: '2' }).then((res) => {
+          requestPut(that.url.versionTakeEffect, { id: record.id, num: record.num, versionStatus: '3' }).then((res) => {
             if (res.success) {
-              that.$message.success("鐗堟湰鐢熸晥鎴愬姛锛�")
+              that.$message.success("鐗堟湰澶辨晥鎴愬姛锛�")
               that.loadData(1)
             } else {
-              that.$message.warning("鐗堟湰鐢熸晥澶辫触锛�")
+              that.$message.warning("鐗堟湰澶辨晥澶辫触锛�")
             }
           }).finally(() => {
             that.confirmLoading = false;
@@ -498,9 +612,48 @@
 
     searchReset() {
       this.maintenanceStandardId = '-1'
-      this.queryParam = { type: 'daily' }
+      this.queryParam = { type: 'daily', maintenanceType: '2' }
       this.loadData(1);
     },
+
+    handleDownload() {
+      var params = {}//鏌ヨ鏉′欢
+      params.type = "twoMaintenance"
+      params.pageNo = 1
+      params.pageSize = 10
+      getAction(this.url.uploadList, params).then((res2) => {
+        if (res2.success) {
+          if (res2.result.records.length > 0) {
+            downFile(this.url.download, { id: res2.result.records[0].id }).then((res) => {
+              if (!res) {
+                this.$message.warning('鏂囦欢涓嬭浇澶辫触')
+                return
+              } else {
+                let fileName = res2.result.records[0].name
+                if (typeof window.navigator.msSaveBlob !== 'undefined') {
+                  window.navigator.msSaveBlob(new Blob([res]), fileName)
+                } else {
+                  let url = window.URL.createObjectURL(new Blob([res]))
+                  let link = document.createElement('a')
+                  link.style.display = 'none'
+                  link.href = url
+                  link.setAttribute('download', fileName)
+                  document.body.appendChild(link)
+                  link.click()
+                  document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌
+                  window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄
+                }
+              }
+            })
+          }
+        }
+      })
+    },
+
+    handlePrint(record) {
+      let href = `${window._CONFIG['domianURL']}/jmreport/view/934696640354902016?id=` + record.id; //缃戠珯閾炬帴
+      window.open(href, "_blank");
+    },
   }
 }
 </script>

--
Gitblit v1.9.3