From f2cf3c86f4c76ac5471c4c8bccb0c6dab5e0b280 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 19 六月 2024 14:28:41 +0800
Subject: [PATCH] 1.工单 工序 设备sop 查看开发

---
 src/views/deviceManager/deviceList.vue |  119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 115 insertions(+), 4 deletions(-)

diff --git a/src/views/deviceManager/deviceList.vue b/src/views/deviceManager/deviceList.vue
index b65696f..1cc07cb 100644
--- a/src/views/deviceManager/deviceList.vue
+++ b/src/views/deviceManager/deviceList.vue
@@ -63,7 +63,13 @@
         >
           <div class="bodyTopButtonGroup" style="justify-content: space-between">
             <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-            <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=9')">瀵煎叆</el-button>
+            <el-button
+              v-waves
+              type="success"
+              icon="el-icon-download"
+              @click="$router.push('./../systemSetting/dataImport?fileCode=9')"
+            >瀵煎叆
+            </el-button>
           </div>
 
           <div class="bodyTopFormGroup">
@@ -128,7 +134,13 @@
                 class="bodySearchReset"
                 :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
               >
-                <el-button v-waves type="primary" icon="el-icon-search" @click="getDeviceMangerSearch($refs.treeLeftRef.getCurrentNode())">鏌ヨ</el-button>
+                <el-button
+                  v-waves
+                  type="primary"
+                  icon="el-icon-search"
+                  @click="getDeviceMangerSearch($refs.treeLeftRef.getCurrentNode())"
+                >鏌ヨ
+                </el-button>
                 <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
               </div>
             </el-form>
@@ -225,6 +237,15 @@
               >
                 <template slot-scope="{row}">
                   <div class="operationClass">
+                    <el-tooltip v-del-tab-index class="item" effect="dark" content="SOP棰勮" placement="top">
+                      <i
+                        v-if="mesSetting.device"
+                        class="el-icon-files"
+                        style="cursor: pointer;color:#42b983;margin-right: 15px"
+                        @click="pre(row)"
+                      />
+                    </el-tooltip>
+
                     <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
                       <i
                         class="el-icon-edit-outline"
@@ -361,6 +382,63 @@
       </span>
     </el-dialog>
 
+    <!--    sop棰勮-->
+    <el-dialog
+      v-el-drag-dialog
+      title="璁惧SOP棰勮"
+      :visible.sync="SopDialogVisible"
+      width="800px"
+      :close-on-click-modal="false"
+      top="15vh"
+      @closed="handleSopClose"
+      @close="handleSopClose"
+    >
+
+      <el-form ref="dialogClassForm" inline :rules="dialogClassFormRules" :model="dialogClassForm" label-width="110px">
+        <el-form-item label="璁惧SOP">
+          <el-select
+            v-model="dialogSopForm.sop"
+            style="width:200px"
+            placeholder="璇烽�夋嫨"
+            filterable
+            :popper-append-to-body="false"
+            @change="sopChange"
+          >
+            <el-option
+              v-for="item in sopArr"
+              :key="item.filepath"
+              :label="item.filename"
+              :value="item.filepath"
+            />
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="Sop鐗堟湰">
+          <el-input v-model="dialogSopForm.v" disabled style="width: 200px" />
+        </el-form-item>
+      </el-form>
+
+      <el-button
+        v-waves
+        type="primary"
+        style="margin-left: 37px"
+        @click="view"
+      >棰� 瑙�/涓� 杞�</el-button>
+
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button v-waves @click="handleSopClose">鍙� 娑�</el-button>
+          <!--          <el-button-->
+          <!--            v-waves-->
+          <!--            type="primary"-->
+          <!--            :loading="$store.state.app.buttonIsDisabled"-->
+          <!--            :disabled="$store.state.app.buttonIsDisabled"-->
+          <!--            @click="handleSopConfirm"-->
+          <!--          >纭� 瀹�</el-button>-->
+        </div>
+      </span>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -375,7 +453,7 @@
   AddUpdateDeviceManger,
   AddUpdateDeviceType, DeleteDeviceManger,
   DeleteDeviceType,
-  DeviceMangerSearch,
+  DeviceMangerSearch, DeviceSopSearch,
   DeviceTypeSearch
 } from '@/api/DeviceManager'
 
@@ -387,6 +465,7 @@
   },
   data() {
     return {
+      mesSetting: JSON.parse(localStorage.getItem('mesSetting')),
       mouseHoverType: 'mouseout',
       isExpandForm: false,
       mainHeight: 0,
@@ -469,8 +548,14 @@
         storgcode: [
           { required: true, message: '璇烽�夋嫨鎵�灞炵粍缁�', trigger: ['blur', 'change'] }
         ]
+      },
 
-      }
+      SopDialogVisible: false,
+      dialogSopForm: { // 璁惧SOP琛ㄥ崟
+        sop: '',
+        v: ''
+      },
+      sopArr: []
 
     }
   },
@@ -486,6 +571,32 @@
     this.getPrentOrganization()
   },
   methods: {
+    // 寮瑰嚭妗嗗叧闂�
+    handleSopClose() {
+      this.SopDialogVisible = false
+      this.dialogSopForm = { // 璁惧SOP琛ㄥ崟
+        sop: '',
+        v: ''
+      }
+    },
+    // 棰勮
+    view() {
+      window.open(process.env.VUE_APP_BASE_API_FILE + this.dialogSopForm.sop)
+    },
+    // sop棰勮
+    async pre(row) {
+      const data = {
+        eqptypecode: row.eqptype_code,
+        eqpcode: row.code
+      }
+      const { data: res } = await DeviceSopSearch(data)
+      this.sopArr = res
+
+      this.SopDialogVisible = true
+    },
+    sopChange(val) {
+      this.dialogSopForm.v = this.sopArr.find(i => i.filepath === val).version
+    },
     async getDeviceTypeSearch() {
       const res = await DeviceTypeSearch()
       res.data.forEach(i => {

--
Gitblit v1.9.3