From 7edce9d027ae6b4b17457baa9bbd900db9b32baf Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 三月 2025 15:01:04 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 src/views/CNAS/resourceDemand/device/component/operationInstruction.vue |   80 ++++++++++++++++-----------------------
 1 files changed, 33 insertions(+), 47 deletions(-)

diff --git a/src/views/CNAS/resourceDemand/device/component/operationInstruction.vue b/src/views/CNAS/resourceDemand/device/component/operationInstruction.vue
index 318eca1..8ab8536 100644
--- a/src/views/CNAS/resourceDemand/device/component/operationInstruction.vue
+++ b/src/views/CNAS/resourceDemand/device/component/operationInstruction.vue
@@ -1,16 +1,9 @@
 <!-- 浣滀笟鎸囧涔� -->
 <template>
   <div>
-    <div style="width:100%;height:30px;margin:5px 0px">
-      <el-row>
-        <el-col :span="12" style="text-align: left;">
-          <p style="line-height: 30px;">浣滀笟鎸囧涔�</p>
-        </el-col>
-        <el-col :span="12" style="text-align: right;">
-          <el-button size="small" type="primary" @click="getList">鍒锋柊</el-button>
-          <el-button size="small" type="primary" @click="dialogVisible = true">鍙楁帶鐢宠</el-button>
-        </el-col>
-      </el-row>
+    <div style="margin: 10px 0;text-align: right">
+      <el-button size="small" type="primary" @click="getList">鍒锋柊</el-button>
+      <el-button size="small" type="primary" @click="dialogVisible = true">鍙楁帶鐢宠</el-button>
     </div>
     <el-table :data="tableData" border height="calc(100vh - 18em)">
       <el-table-column type="index" label="搴忓彿" width="120">
@@ -58,8 +51,8 @@
               </el-form-item>
               <el-form-item label="闄勪欢锛�" style="float: left;">
                 <el-upload ref="uploadFile" :action="action" :before-remove="beforeRemove" :file-list="fileList1"
-                  :headers="headers" :limit="1" :on-error="onError" :on-exceed="handleExceed" :on-remove="handleRemove1"
-                  :on-success="onSuccess1" class="upload-demo" multiple>
+                  :headers="uploadHeader" :limit="1" :on-error="onError" :on-exceed="handleExceed"
+                  :on-remove="handleRemove1" :on-success="onSuccess1" class="upload-demo" multiple>
                   <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
                 </el-upload>
               </el-form-item>
@@ -86,7 +79,7 @@
           <el-button size="small" @click="delFile">鍒犻櫎</el-button>
         </div>
         <el-table :data="documentTableData" border style="width: 100%;" tooltip-effect="dark" :row-key="getRowKey"
-          @selection-change="handleSelectionChange" height="30em">
+          @selection-change="handleSelectionChange" height="29em">
           <el-table-column type="selection" width="55%">
           </el-table-column>
           <el-table-column label="搴忓彿" prop="id" type="index" width="60"></el-table-column>
@@ -165,8 +158,8 @@
             <el-col :span="24">
               <el-form-item label="闄勪欢锛�" style="float: left;">
                 <el-upload ref="uploadFile" :action="action" :before-remove="beforeRemove" :file-list="fileList"
-                  :headers="headers" :limit="1" :on-error="onError" :on-exceed="handleExceed" :on-remove="handleRemove"
-                  :on-success="onSuccess" class="upload-demo" multiple>
+                  :headers="uploadHeader" :limit="1" :on-error="onError" :on-exceed="handleExceed"
+                  :on-remove="handleRemove" :on-success="onSuccess" class="upload-demo" multiple>
                   <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
                 </el-upload>
               </el-form-item>
@@ -184,7 +177,15 @@
 
 <script>
 import fileDownload from "@/utils/file";
-
+import {
+  approvalOfHomeworkInstructionManual,
+  homeworkGuidebook,
+  homeworkGuidebookEditor,
+  newHomeworkGuidebookAdded,
+  deleteHomeworkGuidebook,
+  pageByPageQueryOfHomeworkInstructions,
+  selectDeviceParameter,
+} from '@/api/cnas/resourceDemand/device.js'
 export default {
   props: {
     clickNodeVal: {
@@ -275,13 +276,14 @@
       });
     },
     approvalFun(id, status) {
-      this.$axios.get(this.$api.deviceCheck.approvalOfHomeworkInstructionManual + "?id=" + id + "&status=" + status).then(res => {
+      approvalOfHomeworkInstructionManual({ id, status }).then(res => {
         this.getList()
+        this.$message({
+          type: 'success',
+          message: '鎿嶄綔鎴愬姛!'
+        });
       })
-      this.$message({
-        type: 'success',
-        message: '鎿嶄綔鎴愬姛!'
-      });
+
     },
     getRowKey(row) {
       return row.index
@@ -292,7 +294,10 @@
         cancelButtonText: '鍙栨秷',
         type: 'warning'
       }).then(() => {
-        this.$axios.get(this.$api.deviceCheck.homeworkGuidebook + "?id=" + row.id + "&instructionId=" + row.instructionId).then(res => {
+        homeworkGuidebook({
+          id: row.id,
+          instructionId: row.instructionId
+        }).then(res => {
           this.$message.success('鍒犻櫎鎴愬姛锛�')
           this.getList()
         })
@@ -319,7 +324,7 @@
     },
     instructionEditFun(row) {
       this.dialogVisible = true
-      this.$axios.get(this.$api.deviceCheck.homeworkGuidebookEditor + "?instructionId=" + row.instructionId).then(res => {
+      homeworkGuidebookEditor({ instructionId: row.instructionId }).then(res => {
         if (res.code == 200) {
           this.instructionForm = res.data.instruction;
           if (this.instructionForm.fileSystemName) {
@@ -345,11 +350,7 @@
       this.$refs.form1.validate((valid) => {
         if (valid) {
           this.instructionForm.feTempHumRecordList = this.documentTableData
-          this.$axios.post(this.$api.deviceCheck.newHomeworkGuidebookAdded, this.instructionForm, {
-            headers: {
-              'Content-Type': 'application/json'
-            }
-          }).then(res => {
+          newHomeworkGuidebookAdded(this.instructionForm).then(res => {
             if (res.code == 200) {
               this.$message.success('鎿嶄綔鎴愬姛锛�')
               this.dialogVisible = false
@@ -445,7 +446,7 @@
         .filter(item => item.id !== undefined)
         .map(item => item.id).join(',');
       //鏈夐敊璇�
-      const res = await this.$axios.get(this.$api.deviceCheck.deleteHomeworkGuidebook + '?ids=' + ids);
+      const res = await deleteHomeworkGuidebook({ ids });
       if (res.code === 200) {
         // 鍒犻櫎瑙嗗浘鐨勬暟鎹�
         for (const resKey in this.selectedRow) {
@@ -483,7 +484,7 @@
       this.$message.warning(`褰撳墠闄愬埗閫夋嫨 1 涓枃浠讹紝鏈閫夋嫨浜� ${files.length} 涓枃浠躲�俙);
     },
     getList() {
-      this.$axios.get(this.$api.deviceCheck.pageByPageQueryOfHomeworkInstructions + "?size=" + this.search.size + "&current=" + this.search.current).then(res => {
+      pageByPageQueryOfHomeworkInstructions({ ...this.search }).then(res => {
         if (res.code == 200) {
           this.tableData = res.data.records;
           this.search.total = res.data.total
@@ -491,17 +492,7 @@
       })
     },
     getAllDevice() {
-      this.$axios.post(this.$api.deviceScope.selectDeviceParameter + "?laboratoryNameIsNull=" + this.laboratoryNameIsNull, {
-        page: {
-          current: 1,
-          size: -1
-        },
-        entity: this.entity
-      }, {
-        headers: {
-          'Content-Type': 'application/json'
-        }
-      }).then(res => {
+      selectDeviceParameter({ laboratoryNameIsNull: this.laboratoryNameIsNull }).then(res => {
         if (res.code == 200) {
           this.devices = res.data.records;
           this.updateDeviceNameOptions();
@@ -527,13 +518,8 @@
     },
   },
   computed: {
-    headers() {
-      return {
-        'token': sessionStorage.getItem('token')
-      }
-    },
     action() {
-      return this.javaApi + this.$api.personnel.saveCNASFile
+      return this.javaApi + '/personBasicInfo/saveCNASFile'
     }
   },
 }

--
Gitblit v1.9.3