From c7ccbc6510a9350e0a0a5a39a84f46c382d080b3 Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期五, 15 九月 2023 15:00:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.22:9001/r/mom-before

---
 src/components/view/laboratoryManagement.vue | 1098 +++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 713 insertions(+), 385 deletions(-)

diff --git a/src/components/view/laboratoryManagement.vue b/src/components/view/laboratoryManagement.vue
index 73219f8..c29f494 100644
--- a/src/components/view/laboratoryManagement.vue
+++ b/src/components/view/laboratoryManagement.vue
@@ -1,24 +1,47 @@
 <template>
-  <div>
+  <div class="laboratoryMangement">
     <el-row>
-      <el-col :span="12" class="top_left_name">瀹為獙瀹ょ鐞�</el-col>
-      <el-col :span="12" style="text-align: right;">
-        <el-button @click="testItem()" type="primary" size="mini" icon="el-icon-plus" style="background: #004EA2; ">鏂板浠櫒璁惧</el-button>
+      <el-col :span="12" class="top_left_name">璁惧缁存姢</el-col>
+      <el-col :span="12" style="text-align: right;" class="title">
+        <el-button
+          @click="testItem()"
+          type="primary"
+          size="mini"
+          icon="el-icon-plus"
+          style="background: #004EA2; "
+          >鏂板浠櫒璁惧</el-button
+        >
         <el-dialog
           title="鏂板浠櫒璁惧"
           :visible.sync="dialogVisible"
           width="750px"
-          :before-close="handleClose">
-          <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
+          :before-close="handleClose"
+        >
+          <el-form
+            :model="ruleForm"
+            :rules="rules"
+            ref="ruleForm"
+            label-width="130px"
+            class="demo-ruleForm"
+          >
             <el-row>
               <el-col :span="12">
                 <el-form-item label="璁惧鍚嶇О" prop="name">
-                  <el-input placeholder="璇疯緭鍏ヤ华鍣ㄨ澶囩紪鍙�" style="width: 206px" clearable v-model="ruleForm.name"></el-input>
+                  <el-input
+                    placeholder="璇疯緭鍏ヤ华鍣ㄨ澶囩紪鍙�"
+                    style="width: 206px"
+                    clearable
+                    v-model="ruleForm.name"
+                  ></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="璁惧鐢ㄩ��" prop="type">
-                  <el-select v-model="ruleForm.type" placeholder="璇烽�夋嫨璁惧鐢ㄩ��">
+                  <el-select
+                    v-model="ruleForm.type"
+                    @change="selectinstall"
+                    placeholder="璇烽�夋嫨璁惧鐢ㄩ��"
+                  >
                     <el-option label="鐢熶骇璁惧" value="1"></el-option>
                     <el-option label="妫�娴嬭澶�" value="2"></el-option>
                   </el-select>
@@ -27,28 +50,48 @@
             </el-row>
             <el-row>
               <el-col :span="12">
-                <el-form-item label="鐖剁骇鍒嗙被">
-                  <el-select v-model="value" @blur="productSelect" filterable allow-create placeholder="璇烽�夋嫨鐖剁骇鍒嗙被">
+                <el-form-item label="璁惧缁�" prop="name">
+                  <el-select
+                    v-model="ruleForm.equr"
+                    allow-create
+                    filterable
+                    @create=""
+                    placeholder="璇烽�夋嫨璁惧缁�"
+                  >
                     <el-option
-                      v-for="list in parentClassificationList"
-                      :key="list.index"
-                      :label="list.father"
-                      :value="list.father"
+                      v-for="list in equaip"
+                      :key="list"
+                      :label="list"
+                      :value="list"
                     >
                     </el-option>
                   </el-select>
+                <!-- <el-autocomplete 
+                class="inline-input"
+                v-model="ruleForm.equr"
+                :fetch-suggestions="querySearch"
+                 placeholder="璇疯緭鍏ュ唴瀹�"
+    ></el-autocomplete> -->
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="浠櫒璁惧缂栧彿" prop="name">
-                  <el-input placeholder="璇疯緭鍏ヤ华鍣ㄨ澶囩紪鍙�" style="width: 206px" clearable v-model="ruleForm.code"></el-input>
+                  <el-input
+                    placeholder="璇疯緭鍏ヤ华鍣ㄨ澶囩紪鍙�"
+                    style="width: 206px"
+                    clearable
+                    v-model="ruleForm.code"
+                  ></el-input>
                 </el-form-item>
               </el-col>
             </el-row>
             <el-row>
               <el-col :span="12">
                 <el-form-item label="淇濈浜�" prop="keeper">
-                  <el-select v-model="ruleForm.keeper" placeholder="璇烽�夋嫨淇濈浜�">
+                  <el-select
+                    v-model="ruleForm.keeper"
+                    placeholder="璇烽�夋嫨淇濈浜�"
+                  >
                     <el-option
                       v-for="list in keeperList"
                       :key="list.index"
@@ -74,68 +117,63 @@
             <el-row>
               <el-col :span="12">
                 <el-form-item label="璁惧鐘舵��" prop="deviceStatus" required>
-                  <el-select v-model="ruleForm.deviceStatus" placeholder="璇烽�夋嫨璁惧鐘舵��">
-                    <el-option label="杩愯" style="color: #66c03b" value="1"></el-option>
-                    <el-option label="鎶ュ簾" style="color: #ac9299" value="2"></el-option>
-                    <el-option label="妫�淇�" style="color: #52d6c0" value="3"></el-option>
-                    <el-option label="鏁呴殰" style="color: #f36b6c" value="4"></el-option>
-                    <el-option label="绌洪棽" style="color: #fcb642" value="5"></el-option>
+                  <el-select
+                    v-model="ruleForm.deviceStatus"
+                    placeholder="璇烽�夋嫨璁惧鐘舵��"
+                  >
+                    <el-option
+                      label="杩愯"
+                      style="color: #66c03b"
+                      value="1"
+                    ></el-option>
+                    <el-option
+                      label="鎶ュ簾"
+                      style="color: #ac9299"
+                      value="2"
+                    ></el-option>
+                    <el-option
+                      label="妫�淇�"
+                      style="color: #52d6c0"
+                      value="3"
+                    ></el-option>
+                    <el-option
+                      label="鏁呴殰"
+                      style="color: #f36b6c"
+                      value="4"
+                    ></el-option>
+                    <el-option
+                      label="绌洪棽"
+                      style="color: #fcb642"
+                      value="5"
+                    ></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="12">
                 <el-form-item label="鍘傚" prop="factory" required>
-                  <el-input style="width: 206px" placeholder="璇疯緭鍏ュ巶瀹�" clearable v-model="ruleForm.factory"></el-input>
+                  <el-input
+                    style="width: 206px"
+                    placeholder="璇疯緭鍏ュ巶瀹�"
+                    clearable
+                    v-model="ruleForm.factory"
+                  ></el-input>
                 </el-form-item>
               </el-col>
             </el-row>
-            <el-row>
-              <el-col :span="12">
-                <el-form-item label="妫�娴嬮」鐩�" prop="rawInsProductId" required>
-                  <el-select v-model="ruleForm.rawInsProductId" placeholder="璇烽�夋嫨妫�娴嬮」鐩�">
-                    <el-option v-for="item in inspectionList"
-                               :key="item.index"
-                               :label="item.name"
-                               :value="item.id">
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12">
-                <el-form-item label="妫�娴嬫牱鍝�" required>
-                  <el-form-item>
-                    <el-input
-                      placeholder="妫�娴嬫牱鍝�"
-                      :disabled="true"
-                      style="width: 206px"
-                      v-model="showCodeNameModel.name">
-                    </el-input>
-                  </el-form-item>
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row>
+            <!-- <el-row>
               <el-col :span="12">
                 <el-form-item label="瑙勬牸鍨嬪彿">
                   <el-input
                     placeholder="瑙勬牸鍨嬪彿"
                     :disabled="true"
                     style="width: 206px"
-                    v-model="showCodeNameModel.specifications">
+                    v-model="showCodeNameModel.specifications"
+                  >
                   </el-input>
                 </el-form-item>
               </el-col>
-              <el-col :span="12">
-                <el-form-item label="妫�娴嬩汉">
-                  <el-input
-                    placeholder="妫�娴嬩汉"
-                    :disabled="true"
-                    style="width: 206px"
-                    v-model="showCodeNameModel.user_name">
-                  </el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
+
+            </el-row> -->
           </el-form>
           <span slot="footer" class="dialog-footer">
             <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
@@ -145,45 +183,82 @@
       </el-col>
     </el-row>
     <el-row class="left_row">
-      <div :style="`width: ${isCollapse?300:0}px;transition: 1s;opacity: ${isCollapse?1:0};`" class="class_sidebar">
-        <el-radio-group class="ai-tab-change" style="width: 270px; margin-top: 5px" v-model="radio1">
-          <el-radio-button size="small" label="true">
-            <div class="el_radio_button_div">鐢熶骇璁惧</div>
-          </el-radio-button>
-          <el-radio-button size="small" label="false">
-            <div class="el_radio_button_div">妫�娴嬭澶�</div>
-          </el-radio-button>
+      <div
+        :style="
+          `width: ${isCollapse ? 300 : 0}px;transition: 1s;opacity: ${
+            isCollapse ? 1 : 0
+          };`
+        "
+        class="class_sidebar"
+      >
+        <el-radio-group
+          class="ai-tab-change"
+          style="width: 270px; margin-top: 5px"
+          v-model="equipment"
+          @input="RadioChange"
+        >
+        <el-radio-button  label="1">鐢熶骇璁惧</el-radio-button>
+        <el-radio-button  label="2">妫�楠岃澶�</el-radio-button>
         </el-radio-group>
-        <el-input
+        <!-- <el-input
           class="frame_input"
           v-model="search_class"
           placeholder="璇疯緭鍏ュ垎绫诲悕绉�"
           size="small"
         >
-          <i slot="suffix" class="el-icon-search" style="font-size: 23px; padding: 5px 0;cursor:pointer;" @click="handlerDeptList"></i>
-        </el-input>
+          <i
+            slot="suffix"
+            class="el-icon-search"
+            style="font-size: 23px; padding: 5px 0;cursor:pointer;"
+            @click="handlerDeptList"
+          ></i>
+        </el-input> -->
         <el-tree
-          :data="towTree" ref="tree"
-          :props="{children: 'children',label: 'father'}"
-          node-key="id"
+          :data="towTree"
+          ref="tree"
+          :props="{ children: 'children', label: 'father' }"
+          node-key="father"
           default-expand-all
+          highlight-current
+          style="margin-top: 20px;"
           @node-click="handleNodeClick"
-          >
-            <div class="custom-tree-node" slot-scope="{ node, data }">
-              <span><i :class="`node_i ${data.code != '[4]'?'el-icon-folder-opened':'el-icon-tickets'}`"></i>
-                {{ data.name }}</span>
-              <el-button type="text" size="mini" @click.stop="remove(node, data)">
-                <i class="el-icon-delete"></i>
-              </el-button>
-            </div>
+        >
+          <div class="custom-tree-node" slot-scope="{ node, data }">
+            <span
+              ><i
+                :class="
+                  `node_i ${
+                    data.code != '[4]'
+                      ? 'el-icon-folder-opened'
+                      : 'el-icon-tickets'
+                  }`
+                "
+              ></i>
+              {{ data.father }}</span
+            >
+           <!--  <el-button type="text" size="mini" @click.stop="remove(node, data)">
+              <i class="el-icon-delete"></i>
+            </el-button> -->
+          </div>
         </el-tree>
       </div>
-      <div class="table_div" :style="`width: calc(100vw - ${isCollapse?'475':'170'}px);`">
-        <div :title="isCollapse ? '鐐瑰嚮灞曞紑' : '鐐瑰嚮鏀惰捣'" class="box_bgd" @click="isC">
+      <div
+        class="table_div"
+        :style="`width: calc(100vw - ${isCollapse ? '475' : '170'}px);`"
+      >
+        <div
+          :title="isCollapse ? '鐐瑰嚮灞曞紑' : '鐐瑰嚮鏀惰捣'"
+          class="box_bgd"
+          @click="isC"
+        >
           <div class="upper_triangle"></div>
           <div class="corner">
             <!-- 鐐瑰嚮灞曞紑鏀惰捣瀵艰埅鍜屽垏鎹㈠搴斿浘鏍� -->
-            <i :class="!isCollapse ? 'el-icon-arrow-left' : 'el-icon-arrow-right'"></i>
+            <i
+              :class="
+                !isCollapse ? 'el-icon-arrow-left' : 'el-icon-arrow-right'
+              "
+            ></i>
           </div>
           <div class="under_triangle"></div>
         </div>
@@ -195,83 +270,128 @@
               v-model="codeNameModel"
               prefix-icon="el-icon-search"
               placeholder="璇疯緭鍏ョ紪鍙�/璁惧鍚嶇О/鍨嬪彿瑙勬牸"
-              clearable>
+              clearable
+            >
             </el-input>
             <el-button size="mini" @click="reset"><span>閲� 缃�</span></el-button>
-            <el-button size="mini" type="primary" @click="selectSearch" style="background: #004EA2;"><span>鏌� 璇�</span></el-button>
-            <el-select v-model="value" size="small" placeholder="璇烽�夋嫨璁惧鐘舵��" class="table_top">
-              <el-option label="杩愯" style="color: #66c03b" value="1"></el-option>
-              <el-option label="鎶ュ簾" style="color: #ac9299" value="2"></el-option>
-              <el-option label="妫�淇�" style="color: #52d6c0" value="3"></el-option>
-              <el-option label="鏁呴殰" style="color: #f36b6c" value="4"></el-option>
-              <el-option label="绌洪棽" style="color: #fcb642" value="5"></el-option>
+            <el-button
+              size="mini"
+              type="primary"
+              @click="selectSearch"
+              style="background: #004EA2;"
+              ><span>鏌� 璇�</span></el-button
+            >
+            <el-select
+              @change="staueValueChange"
+              v-model="staue_value"
+              size="small"
+              placeholder="璇烽�夋嫨璁惧鐘舵��"
+              class="table_top"
+            >
+              <el-option
+                label="杩愯"
+                style="color: #66c03b"
+                value="1"
+              ></el-option>
+              <el-option
+                label="鎶ュ簾"
+                style="color: #ac9299"
+                value="2"
+              ></el-option>
+              <el-option
+                label="妫�淇�"
+                style="color: #52d6c0"
+                value="3"
+              ></el-option>
+              <el-option
+                label="鏁呴殰"
+                style="color: #f36b6c"
+                value="4"
+              ></el-option>
+              <el-option
+                label="绌洪棽"
+                style="color: #fcb642"
+                value="5"
+              ></el-option>
             </el-select>
           </div>
           <el-table
             :data="tableData"
             border
             height="calc(100vh - 220px)"
-            style="padding: 10px;">
-            <el-table-column
-              prop="date"
-              label="搴忓彿"
-              width="60">
+            style="padding: 10px;"
+          >
+            <el-table-column prop="date" label="搴忓彿" width="60">
               <template v-slot="scope">
                 {{ scope.$index + 1 }}
               </template>
             </el-table-column>
-            <el-table-column
-              prop="code"
-              label="浠櫒璁惧缂栧彿"
-              width="125">
+            <el-table-column prop="code" label="浠櫒璁惧缂栧彿" width="125">
             </el-table-column>
-            <el-table-column
-              prop="name"
-              label="浠櫒璁惧鍚嶇О"
-              width="125">
+            <el-table-column prop="name" label="浠櫒璁惧鍚嶇О" width="125">
             </el-table-column>
+            <el-table-column prop="userName" label="淇濈浜�"> </el-table-column>
             <el-table-column
-              prop="keeper"
-              label="淇濈浜�">
-            </el-table-column>
-            <el-table-column
-              prop="end_measure"
+              prop="DATE_FORMAT(end_measure, '%Y-%m-%d')"
               label="璁¢噺鎴嚦鏈夋晥鏈�"
-              width="147">
+              width="147"
+            >
             </el-table-column>
-            <el-table-column
-              prop="device_status"
-              label="浣跨敤鐘舵��">
+            <el-table-column prop="device_status" label="浣跨敤鐘舵��">
               <template slot-scope="scope">
-                <el-tag v-if="scope.row.device_status==1" disable-transitions type="success">杩愯</el-tag>
-                <el-tag v-else-if="scope.row.device_status==2" disable-transitions type="info">鎶ュ簾</el-tag>
-                <el-tag v-else-if="scope.row.device_status==3" style="color: #52d6c0" disable-transitions type="info">妫�淇�</el-tag>
-                <el-tag v-else-if="scope.row.device_status==4" disable-transitions type="danger">鏁呴殰</el-tag>
-                <el-tag v-else-if="scope.row.device_status==5" style="color: #fcb642" disable-transitions type="info">绌洪棽</el-tag>
+                <el-tag
+                  v-if="scope.row.device_status == 1"
+                  disable-transitions
+                  type="success"
+                  >杩愯</el-tag
+                >
+                <el-tag
+                  v-else-if="scope.row.device_status == 2"
+                  disable-transitions
+                  type="info"
+                  >鎶ュ簾</el-tag
+                >
+                <el-tag
+                  v-else-if="scope.row.device_status == 3"
+                  style="color: #52d6c0"
+                  disable-transitions
+                  type="info"
+                  >妫�淇�</el-tag
+                >
+                <el-tag
+                  v-else-if="scope.row.device_status == 4"
+                  disable-transitions
+                  type="danger"
+                  >鏁呴殰</el-tag
+                >
+                <el-tag
+                  v-else-if="scope.row.device_status == 5"
+                  style="color: #fcb642"
+                  disable-transitions
+                  type="info"
+                  >绌洪棽</el-tag
+                >
               </template>
             </el-table-column>
             <el-table-column
               prop="factory"
               label="鍘傚"
-              :show-overflow-tooltip="true">
+              :show-overflow-tooltip="true"
+            >
             </el-table-column>
-            <el-table-column
-              prop="inspectProject"
-              label="妫�娴嬮」鐩�">
+            <!-- <el-table-column prop="inspectProject" label="妫�娴嬮」鐩�">
             </el-table-column>
-            <el-table-column
-              prop="testSample"
-              label="妫�楠屾牱鍝�">
+            <el-table-column prop="testSample" label="妫�楠屾牱鍝�">
             </el-table-column>
-            <el-table-column
-              prop="user_name"
-              label="妫�娴嬩汉">
-            </el-table-column>
-            <el-table-column
-              prop="name"
-              label="鎿嶄綔">
+            <el-table-column prop="user_name" label="妫�娴嬩汉"> </el-table-column> -->
+            <el-table-column prop="name" label="鎿嶄綔">
               <template v-slot="scope">
-                <el-button @click="handleClick(scope.$index, tableData, scope.row)" type="text" size="small">鍒犻櫎</el-button>
+                <el-button
+                  @click="handleClick(scope.row)"
+                  type="text"
+                  size="small"
+                  >鍒犻櫎</el-button
+                >
               </template>
             </el-table-column>
           </el-table>
@@ -286,285 +406,473 @@
   name: "LaboratoryManagement",
   data() {
     return {
-      value: '',
+
+      value: "",
       dialogVisible: false,
+      checkTreeNode:{},
       isCollapse: true, //榛樿涓哄睍寮�
-      radio1: 'true', // 鍒嗙被鍒囨崲
-      tableData: [],
+      radio1: "true", // 鍒嗙被鍒囨崲
+      tableData: [], // 涓婚〉琛ㄦ牸鏁版嵁
       inspectionList: [], //妫�楠岄」鐩笅鎷夋鍒楄〃
       showCodeNameModel: {}, // 鏂板浠櫒灞曠ず绂佹妗�
       keeperList: [], // 鏂板璁惧淇濈浜轰笅鎷夋
       parentClassificationList: [], // 鏂板璁惧鐖剁骇鍒嗙被涓嬫媺妗�
-      search_class: '', // 鍒嗙被鎼滅储妗嗗唴瀹�
-      codeNameModel: '', // 缂栫爜鍚嶇О鍨嬪彿妯$硦鏌ヨ
+      search_class: "", // 鍒嗙被鎼滅储妗嗗唴瀹�
+      codeNameModel: "", // 缂栫爜鍚嶇О鍨嬪彿妯$硦鏌ヨ
+      staue_value: "", // 涓婚〉琛ㄦ牸涓婃柟鐨勭姸鎬侀�夋嫨
       // BOM鏍戞暟鎹粨鏋�
       towTree: [],
+      equipment: '1',
+      equaip:[],
       ruleForm: {
-        code: '',
-        father: '',
-        deviceStatus: '',
-        endMeasure: '',
-        factory: '',
-        keeper: '',
-        name: '',
-        rawInsProductId: '',
-        type: ''
+        // 鏂板浠櫒琛ㄥ崟
+        code: "",
+        father: "",
+        deviceStatus: "",
+        endMeasure: "",
+        factory: "",
+        keeper: "",
+        name: "",
+        rawInsProductId: "",
+        type: "",
+        // treedata:{
+        //     father:'璁惧缁�1',
+        // },
+        equr:'',
+       
       },
+      delete:{},
+      equip:1,
       rules: {
         name: [
-          { required: true, message: '璇疯緭鍏ヤ华鍣ㄨ澶囩紪鍙�', trigger: 'blur' },
-          { min: 2, max: 25, message: '闀垮害鍦� 2 鍒� 25 涓瓧绗�', trigger: 'blur' }
+          { required: true, message: "璇疯緭鍏ヤ华鍣ㄨ澶囩紪鍙�", trigger: "blur" },
+          { min: 2, max: 25, message: "闀垮害鍦� 2 鍒� 25 涓瓧绗�", trigger: "blur" }
         ],
         keeper: [
-          { required: true, message: '璇烽�夋嫨淇濈浜�', trigger: 'change' }
+          { required: true, message: "璇烽�夋嫨淇濈浜�", trigger: "change" }
         ],
         endMeasure: [
-          { type: 'date', required: true, message: '璇烽�夋嫨璁¢噺鎴嚦鏈夋晥鏈�', trigger: 'change' }
+          {
+            type: "date",
+            required: true,
+            message: "璇烽�夋嫨璁¢噺鎴嚦鏈夋晥鏈�",
+            trigger: "change"
+          }
         ],
         deviceStatus: [
-          { required: true, message: '璇烽�夋嫨璁惧鐘舵��', trigger: 'change' }
+          { required: true, message: "璇烽�夋嫨璁惧鐘舵��", trigger: "change" }
         ],
         factory: [
-          { required: true, message: '璇疯緭鍏ュ巶瀹�', trigger: 'blur' },
-          { min: 2, max: 25, message: '闀垮害鍦� 2 鍒� 50 涓瓧绗�', trigger: 'blur' }
+          { required: true, message: "璇疯緭鍏ュ巶瀹�", trigger: "blur" },
+          { min: 2, max: 25, message: "闀垮害鍦� 2 鍒� 50 涓瓧绗�", trigger: "blur" }
         ],
         rawInsProductId: [
-          { required: true, message: '璇烽�夋嫨妫�娴嬮」鐩�', trigger: 'change' }
+          { required: true, message: "璇烽�夋嫨妫�娴嬮」鐩�", trigger: "change" }
         ],
-        type: [
-          { required: true, message: '璇烽�夋嫨璁惧鐢ㄩ��', trigger: 'change' }
-        ]
+        type: [{ required: true, message: "璇烽�夋嫨璁惧鐢ㄩ��", trigger: "change" }]
       },
-      pickerOptions:{
+      pickerOptions: {
         //绂佺敤褰撳墠鏃ユ湡涔嬪墠鐨勬棩鏈�
         disabledDate(time) {
           //Date.now()鏄痡avascript涓殑鍐呯疆鍑芥暟锛屽畠杩斿洖鑷�1970骞�1鏈�1鏃�00:00:00 UTC浠ユ潵缁忚繃鐨勬绉掓暟銆�
           return time.getTime() < Date.now() - 8.64e7;
         }
-      },
-    }
+      }
+    };
+  },
+  mounted() {
+    // 鍒濆鍖栬皟鐢ㄤ簩绾ф爲
+    this.twoTreeApi();
+    // 鍒濆鍖栬皟鐢ㄨ〃鏍兼暟鎹�
+    // this.tableDataApi();
+    // this.selectDevice()
   },
   methods: {
+    handleNodeClick(val) {
+      this.checkTreeNode = val
+      console.log(this.checkTreeNode);
+        this.selectDevice()
+    },
+    selectInput(){
+
+    },
+    // querySearch(queryString, cb) {
+    //   console.log(this.equaip);
+    //     var restaurants = this.equaip;
+    //     var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
+    //     // 璋冪敤 callback 杩斿洖寤鸿鍒楄〃鐨勬暟鎹�
+    //     cb(results);
+    //   },
+    //   createFilter(queryString) {
+    //     return (restaurant) => {
+    //       return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
+    //     };
+    //   },
+    staueValueChange() {
+      this.selectDevice()
+      // this.tableData = [];
+      // let val = 1;
+      // if (this.radio1 === "false") {
+      //   val = 2;
+      // }
+      // this.$axios
+      //   .get(this.$api.url.tableDeviceList, {
+      //     params: { type: val, deviceStatue: this.staue_value }
+      //   })
+      //   .then(res => {
+      //     this.tableData = res.data;
+      //   });
+    },
     // 鍔ㄦ�佹帶鍒跺睍寮�涓庢敹璧峰拰鍒囨崲瀵瑰簲鍥炬爣
     isC() {
       this.isCollapse = !this.isCollapse;
     },
     productSelect(e) {
       let value = e.target.value; // 杈撳叆妗嗗��
-      if(value) { // 浣犺緭鍏ユ墠鏈夎繖涓�� 涓嶄负绌猴紝濡傛灉浣犱笅鎷夋閫夋嫨鐨勮瘽 杩欎釜鍊间负绌�
-        this.value = value
+      if (value) {
+        // 浣犺緭鍏ユ墠鏈夎繖涓�� 涓嶄负绌猴紝濡傛灉浣犱笅鎷夋閫夋嫨鐨勮瘽 杩欎釜鍊间负绌�
+        this.value = value;
       }
     },
     submitForm() {
-      this.$refs.ruleForm.validate((valid) => {
-        if (valid) {
-          this.ruleForm.father = this.value
-          this.$axios.post(this.$api.url.addDeviceInstrument, this.ruleForm,{
-            headers: {
-              'Content-Type': 'application/json'
-            }
-          }).then(res => {
-            this.keeperList = res.data
-            // 鎴愬姛鍏抽棴鏂板寮瑰嚭妗�
-            this.dialogVisible = false
-          })
-        } else {
-          console.log('error submit!!');
-          return false;
-        }
-      });
+      // this.$refs.ruleForm.validate(valid => {
+      //   if (valid) {
+      //     this.ruleForm.father = this.value;
+      //     this.$axios
+      //       .post(this.$api.url.addDeviceInstrument, this.ruleForm, {
+      //         headers: {
+      //           "Content-Type": "application/json"
+      //         }
+      //       })
+      //       .then(res => {
+      //         this.keeperList = res.data;
+      //         // 鎴愬姛鍏抽棴鏂板寮瑰嚭妗�
+      //         this.dialogVisible = false;
+      //       });
+      //   } else {
+      //     console.log("error submit!!");
+      //     return false;
+      //   }
+      // });
+      this.addApi()
+      this.dialogVisible = false;
     },
     handleClose(done) {
-      this.$confirm('纭鍏抽棴锛�')
+      this.$confirm("纭鍏抽棴锛�")
         .then(_ => {
           done();
         })
         .catch(_ => {});
     },
     testItem() {
-      this.dialogVisible = true
+      this.dialogVisible = true;
       this.$axios.get(this.$api.url.addDeviceKeeper).then(res => {
-        this.keeperList = res.data
-      })
-      this.$axios.get(this.$api.url.addDeviceInspectDownBox).then(res => {
-        this.inspectionList = res.data
-      })
-      this.$axios.get(this.$api.url.addDeviceParentClassification).then(res => {
-        this.parentClassificationList = res.data
-      })
+        this.keeperList = res.data;
+      });
+    },
+    selectinstall(val) {
+      this.equip = val
+      this.listgroup()
+    },
+    listgroup() {
+        this.$axios.get(this.$api.url.listgroup,{
+            params:{
+              type:this.equip
+            }
+        })
+        .then(res =>{
+          this.equaip = res.data
+          // res.data.forEach(item=>{
+          //   let obj={
+          //     id: item,
+          //     value: item
+          //   }
+          //   this.equaip.push(obj)
+            console.log(this.equaip);
+          // })
+        })
+    },
+    RadioChange(val){
+      console.log(val);
+        this.equip = val
+        this.twoTreeApi()
     },
     twoTreeApi() {
-      this.$axios.get(this.$api.url.towTree).then(res => {
-        let list = res.data
-        list.forEach(i => {
-          if (i.name === undefined){
-            i.name = i.children[0].name
-            i.children = undefined
-          }
-        })
-        this.towTree = res.data
-      })
+      this.$axios.get(this.$api.url.towTree,{
+        params:{
+            type:this.equip,
+        }
+      }).then(res => {
+        // let list = res.data;
+        // list.forEach(i => {
+        //   if (i.name === undefined) {
+        //     i.name = i.children[0].name;
+        //     i.id = i.children[0].id;
+        //     i.children = undefined;
+        //   }
+        // });
+        this.towTree = res.data;
+        this.$nextTick(() => {
+				this.$refs.tree.setCurrentKey(this.towTree[0].father) // 榛樿閫変腑鑺傜偣绗竴涓�
+			})
+      console.log(this.towTree);
+        let one=this.towTree[0]
+        console.log(one);
+        let name =one.father
+        this.checkTreeNode.father = name
+			  console.log(name);
+        this.selectDeviceStart(name)
+        });
     },
-    tableDataApi() {
-      this.$axios.get(this.$api.url.tableDeviceList).then(res => {
+    selectDeviceStart(name,) {//鍙宠竟鏁版嵁
+      this.$axios.get(this.$api.url.selectDevice,{
+        params:{
+          father:name,
+          type:this.equip,
+          deviceStatus:this.staue_value,
+          message:this.codeNameModel,
+        }
+      }).then(res =>{
+        console.log(res);
         this.tableData = res.data
+      }, {
+				headers: {
+                		"Content-Type": "application/json"
+              		}
       })
     },
-    reset() {
-      this.tableDataApi()
-      this.radio1 = 'true'
-      this.codeNameModel = ''
+
+    selectDevice() {//鍙宠竟鏁版嵁
+      this.$axios.get(this.$api.url.selectDevice,{
+        params:{
+          father:this.checkTreeNode.father,
+          type:this.equip,
+          deviceStatus:this.staue_value,
+          message:this.codeNameModel,
+        }
+      }).then(res =>{
+        console.log(res);
+        this.tableData = res.data
+      }, {
+				headers: {
+                		"Content-Type": "application/json"
+              		}
+      })
     },
-    handleNodeClick(data) {
-      if (data.id === undefined) {
-        this.$axios.get(this.$api.url.tableDeviceList, {params: {fatherName: data.name}}).then(res => {
-          this.tableData = res.data
-        })
-      } else if (data.id !== undefined){
-        this.$axios.get(this.$api.url.tableDeviceList, {params: {deviceId: data.id}}).then(res => {
-          this.tableData = res.data
-        })
-      }
+    addApi() {
+      this.$axios.post(this.$api.url.addApi,{
+        code:this.ruleForm.code,
+        deviceStatus:this.ruleForm.deviceStatus,
+        endMeasure:this.ruleForm.endMeasure,
+        factory:this.ruleForm.factory,
+        father:this.ruleForm.equr,
+        keeper:this.ruleForm.keeper,
+        name:this.ruleForm.name,
+        type:this.ruleForm.type,
+      }, {headers: {"Content-Type": "application/json"}
+    }).then(res =>{
+      this.selectDevice()
+      this.$message.success('鏂板鎴愬姛')
+      this.ruleForm = {}
+    })
+    },
+    // tableDataApi() {
+    //   this.$axios.get(this.$api.url.tableDeviceList).then(res => {
+    //     this.tableData = res.data;
+    //   });
+    // },
+    reset() {
+      // this.tableDataApi();
+      // this.radio1 = "true";
+      // this.codeNameModel = "";
+      // this.staue_value = "";
+      this.staue_value = ""
+      this.codeNameModel = ""
+      this.selectDevice()
     },
     handlerDeptList() {
-      this.towTree = []
-      let val = 1
-      if (this.radio1 === "false"){
-        val = 2
+      this.towTree = [];
+      let val = 1;
+      if (this.radio1 === "false") {
+        val = 2;
       }
-      this.$axios.get(this.$api.url.towTree, {params: {type: val, search_class: this.search_class}}).then(res => {
-        this.towTree = res.data
-      })
+      this.$axios
+        .get(this.$api.url.towTree, {
+          params: { type: val, search_class: this.search_class }
+        })
+        .then(res => {
+          this.towTree = res.data;
+        });
     },
     selectSearch() {
-      this.tableData = []
-      if (this.radio1 === 'false'){
-        this.$axios.get(this.$api.url.tableDeviceList, {params: {type: 1, codeNameModel: this.codeNameModel}}).then(res => {
-          this.tableData = res.data
-        })
-      } else if (this.radio1 === 'true') {
-        this.$axios.get(this.$api.url.tableDeviceList, {params: {type: 2, codeNameModel: this.codeNameModel}}).then(res => {
-          this.tableData = res.data
-        })
-      }
+      this.selectDevice()
+      // this.tableData = [];
+      // if (this.radio1 === "false") {
+      //   this.$axios
+      //     .get(this.$api.url.tableDeviceList, {
+      //       params: { type: 1, codeNameModel: this.codeNameModel }
+      //     })
+      //     .then(res => {
+      //       this.tableData = res.data;
+      //     });
+      // } else if (this.radio1 === "true") {
+      //   this.$axios
+      //     .get(this.$api.url.tableDeviceList, {
+      //       params: { type: 2, codeNameModel: this.codeNameModel }
+      //     })
+      //     .then(res => {
+      //       this.tableData = res.data;
+      //     });
+      // }
     },
-    handleClick(index, datas, row) {
-      this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヨ澶�, 鏄惁缁х画?', '鎻愮ず', {
-        confirmButtonText: '纭畾',
-        cancelButtonText: '鍙栨秷',
-        type: 'warning'
-      }).then(() => {
-        this.$axios.delete(this.$api.url.deleteDevice,{params: {deviceId: row.id}}).then(res => {
-          this.$message({
-            message: res.message,
-            type: 'success'
-          });
-          datas.splice(index, 1);
-        }).catch(err => {
-          this.$message({
-            message: err.message,
-            type: 'warning'
-          });
-        })
-      })
+    delDeviceById() {
+      this.$axios.post(this.$api.url.delDeviceById,{
+          id:this.delete.id
+      }).then(res=>{
+        this.$parent.removeAllTab()
+      });
+    },
+    handleClick(row) {
+      console.log(row);
+        this.delete = row
+        this.delDeviceById()
+        this.selectDevice()
+      // this.$confirm("姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヨ澶�, 鏄惁缁х画?", "鎻愮ず", {
+      //   confirmButtonText: "纭畾",
+      //   cancelButtonText: "鍙栨秷",
+      //   type: "warning"
+      // }).then(() => {
+      //   this.$axios
+      //     .delete(this.$api.url.deleteDevice, { params: { deviceId: row.id } })
+      //     .then(res => {
+      //       this.$message({
+      //         message: res.message,
+      //         type: "success"
+      //       });
+      //       datas.splice(index, 1);
+      //     })
+      //     .catch(err => {
+      //       this.$message({
+      //         message: err.message,
+      //         type: "warning"
+      //       });
+      //     });
+      // });
     },
     remove(node, data) {
-      this.$confirm('姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヨ澶�, 鏄惁缁х画?', '鎻愮ず', {
-        confirmButtonText: '纭畾',
-        cancelButtonText: '鍙栨秷',
-        type: 'warning'
+      this.$confirm("姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヨ澶�, 鏄惁缁х画?", "鎻愮ず", {
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning"
       }).then(() => {
-        console.log(data)
-        let val = '';
-        if(data.id === undefined && data.children === undefined ) {
-          this.$axios.delete(this.$api.url.deleteIdorFather,{params: {deviceFather: data.name}}).then(res => {
-            if (res.code === 200){
-              this.$message({
-                message: res.message,
-                type: 'success'
-              });
-              this.handlerDeptList()
-              this.selectSearch()
-            } else {
-              this.$message({
-                message: res.message,
-                type: 'warning'
-              });
-            }
-          })
-        } else if (data.id !== undefined){
-          this.$axios.delete(this.$api.url.deleteIdorFather,{params: {id: data.id}}).then(res => {
-            if (res.code === 200){
-              this.$message({
-                message: res.message,
-                type: 'success'
-              });
-              this.handlerDeptList()
-              this.selectSearch()
-            } else {
-              this.$message({
-                message: res.message,
-                type: 'warning'
-              });
-            }
-          })
+        console.log(`output->data`, data);
+        let val = 1;
+        if (this.radio1 === "false") {
+          val = 2;
         }
-      })
-    }
-  },
-  mounted() {
-    // 鍒濆鍖栬皟鐢ㄤ簩绾ф爲
-    this.twoTreeApi()
-    // 鍒濆鍖栬皟鐢ㄨ〃鏍兼暟鎹�
-    this.tableDataApi()
-  },
-  watch: {
-    'ruleForm.rawInsProductId': { //鐩戝惉ruleForm.rawInsProductId
-      handler: function (newVal, oldVal) {
-        if (newVal != null && newVal !== ''){
-          this.$axios.get(this.$api.url.selectDeviceInspectMessage,{params: {inspectId: newVal}}).then(res => {
-            this.showCodeNameModel = res.data
-          })
-        }
-      }
-    },
-    dialogVisible: {
-      handler: function (newVal, oldVal) {
-        if (newVal){
-          // 鎴愬姛娓呯┖杈撳叆鍐呭
-          this.ruleForm = {}
-          this.value = ''
-          this.showCodeNameModel = {}
-          this.$refs.ruleForm.resetFields()
-        }
-      }
-    },
-    radio1: {
-      handler: function (newVal, oldVal) {
-        this.towTree = []
-        this.tableData = []
-        if (newVal === "true"){
-          this.twoTreeApi()
-          this.tableDataApi()
-        } else if (newVal === "false") {
-          this.$axios.get(this.$api.url.towTree, {params: {type: 2}}).then(res => {
-            let list = res.data
-            list.forEach(i => {
-              if (i.name === undefined){
-                i.name = i.children[0].name
-                i.children = undefined
-              }
+        if (data.id === undefined) {
+          console.log(`output->鎵ц鍔沗, "+++++++++++++++");
+          this.$axios
+            .delete(this.$api.url.deleteIdorFather, {
+              params: { deviceFather: data.name, type: val }
             })
-            this.towTree = res.data
-          })
-          this.$axios.get(this.$api.url.tableDeviceList, {params: {type: 2}}).then(res => {
-            this.tableData = res.data
-          })
+            .then(res => {
+              if (res.code === 200) {
+                this.$message({
+                  message: res.message,
+                  type: "success"
+                });
+                this.handlerDeptList();
+                this.selectSearch();
+              } else {
+                this.$message({
+                  message: res.message,
+                  type: "warning"
+                });
+              }
+            });
+        } else if (data.id !== undefined) {
+          console.log(`output->鎵ц鍔沗, "----------------");
+          this.$axios
+            .delete(this.$api.url.deleteIdorFather, { params: { id: data.id } })
+            .then(res => {
+              if (res.code === 200) {
+                this.$message({
+                  message: res.message,
+                  type: "success"
+                });
+                this.handlerDeptList();
+                this.selectSearch();
+              } else {
+                this.$message({
+                  message: res.message,
+                  type: "warning"
+                });
+              }
+            });
+        }
+      });
+    },
+  
+  },
+ 
+  watch: {
+    "ruleForm.rawInsProductId": {
+      //鐩戝惉ruleForm.rawInsProductId
+      handler: function(newVal, oldVal) {
+        if (newVal != null && newVal !== "") {
+          this.$axios
+            .get(this.$api.url.selectDeviceInspectMessage, {
+              params: { inspectId: newVal }
+            })
+            .then(res => {
+              this.showCodeNameModel = res.data;
+            });
+        }
+      }
+    },
+    // dialogVisible: {
+    //   handler: function(newVal, oldVal) {
+    //     if (newVal) {
+    //       // 鎴愬姛娓呯┖杈撳叆鍐呭
+    //       this.ruleForm = {};
+    //       this.value = "";
+    //       this.showCodeNameModel = {};
+    //       this.$refs.ruleForm.resetFields();
+    //     }
+    //   }
+    // },
+    radio1: {
+      handler: function(newVal, oldVal) {
+        this.towTree = [];
+        this.tableData = [];
+        if (newVal === "true") {
+          this.twoTreeApi();
+          this.tableDataApi();
+        } else if (newVal === "false") {
+          this.$axios
+            .get(this.$api.url.towTree, { params: { type: 2 } })
+            .then(res => {
+              let list = res.data;
+              list.forEach(i => {
+                if (i.name === undefined) {
+                  i.name = i.children[0].name;
+                  i.id = i.children[0].id;
+                  i.children = undefined;
+                }
+              });
+              this.towTree = res.data;
+            });
+          this.$axios
+            .get(this.$api.url.tableDeviceList, { params: { type: 2 } })
+            .then(res => {
+              this.tableData = res.data;
+            });
         }
       }
     }
   }
-}
+};
 </script>
 
 <style scoped>
@@ -577,7 +885,7 @@
   background-color: transparent;
 }
 .el-form-item >>> .el-form-item__error {
-  color: #F56C6C;
+  color: #f56c6c;
   font-size: 12px;
   line-height: 1;
   padding-top: 6px;
@@ -585,33 +893,33 @@
   top: 100%;
   left: 18px;
 }
-/deep/ .el-icon-arrow-left{
+/deep/ .el-icon-arrow-left {
   display: flex;
   line-height: 60px !important;
   justify-content: center;
 }
-/deep/ .el-icon-arrow-right{
+/deep/ .el-icon-arrow-right {
   display: flex;
   line-height: 60px !important;
   justify-content: center;
 }
-.top_left_name{
+.top_left_name {
   padding-left: 20px;
   line-height: 32px;
 }
-.left_row{
+.left_row {
   height: calc(100vh - 165px);
   margin-top: 9px;
 }
-.frame_input{
+.frame_input {
   width: 90%;
   margin: 10px 0;
   transition: 1.5s;
 }
-.table_top_div{
+.table_top_div {
   margin-left: 20px;
   padding-top: 15px;
-  padding-bottom: 15px
+  padding-bottom: 15px;
 }
 .el-dialog__footer {
   padding: 0px 20px 20px;
@@ -619,26 +927,26 @@
   -webkit-box-sizing: border-box;
   box-sizing: border-box;
 }
-.table_top{
+.table_top {
   float: right;
   width: 224px;
   margin-right: 52px;
 }
-.main_table_div{
+.main_table_div {
   background-color: #fbfbfd;
   height: 100%;
 }
-.dialog-footer{
+.dialog-footer {
   display: block;
-  text-align:center
+  text-align: center;
 }
-.table_div{
+.table_div {
   padding-left: 5px;
   transition: 1s;
   float: left;
-  position: relative
+  position: relative;
 }
-.table_top_input{
+.table_top_input {
   width: 20%;
   margin-right: 24px;
 }
@@ -651,16 +959,16 @@
   padding-right: 8px;
   width: 250px;
 }
-.el-tree{
+.el-tree {
   width: 280px;
   margin: 0 10px;
 }
-.custom-tree-node span{
-  font-size: 14px!important;
+.custom-tree-node span {
+  font-size: 14px !important;
 }
 .el-icon-delete {
   display: none;
-  color: #004EA2;
+  color: #004ea2;
 }
 .custom-tree-node:hover .el-icon-delete {
   display: inline;
@@ -669,12 +977,12 @@
   color: orange;
 }
 ::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
-     background: #f2f2f2;
-     border: 0 !important;
-     color: #696969;
-     line-height: 14px;
-     outline: none;
-     box-shadow: none;
+  background: #f2f2f2;
+  border: 0 !important;
+  color: #696969;
+  line-height: 14px;
+  outline: none;
+  box-shadow: none;
 }
 .class_sidebar {
   overflow: hidden;
@@ -692,34 +1000,54 @@
   top: 40%;
   left: -10px;
 }
-.corner{
+.corner {
   height: 60px;
   background: #ebebec;
 }
-.upper_triangle{
-  width: 0px;                 /*  瀹介珮璁剧疆涓�0锛屽緢閲嶈锛屽惁鍒欒揪涓嶅埌鏁堟灉 */
+.upper_triangle {
+  width: 0px; /*  瀹介珮璁剧疆涓�0锛屽緢閲嶈锛屽惁鍒欒揪涓嶅埌鏁堟灉 */
   height: 0px;
   border: 6px solid #ebebec;
   border-left-color: transparent;
   border-top-color: transparent;
 }
-.under_triangle{
-  width: 0px;                 /*  瀹介珮璁剧疆涓�0锛屽緢閲嶈锛屽惁鍒欒揪涓嶅埌鏁堟灉 */
+.under_triangle {
+  width: 0px; /*  瀹介珮璁剧疆涓�0锛屽緢閲嶈锛屽惁鍒欒揪涓嶅埌鏁堟灉 */
   height: 0px;
   border: 6px solid #ebebec;
   border-left-color: transparent;
   border-bottom-color: transparent;
 }
-.ai-tab-change {
-  .el-radio-button__inner {
-    border: 1px solid #ececed;
-    line-height: 14px;
-  }
-  .el-radio-button__orig-radio:checked + .el-radio-button__inner {
-    background: #fdfdfe;
-    border: 1px solid #004da2;
-    color: #004da2;
-    line-height: 14px;
-  }
+.el-radio-button__inner {
+  border: 1px solid #ececed;
+  line-height: 14px;
+}
+.el-radio-button__orig-radio:checked + .el-radio-button__inner {
+  background: #fdfdfe;
+  border: 1px solid #004da2;
+  color: #004da2;
+  line-height: 14px;
 }
 </style>
+<style>
+	.laboratoryMangement .title *{
+		font-size: 14px;
+	}
+	
+	.laboratoryMangement .table_top_div *{
+		font-size: 14px;
+	}
+	
+	.laboratoryMangement .title .el-button {
+	  height: 32px;
+	  border: 1px solid rgba(190, 190, 190, 0.44);
+	  box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+	  padding: 0 12px;
+	}
+	.laboratoryMangement .table_top_div .el-button {
+	  height: 32px;
+	  border: 1px solid rgba(190, 190, 190, 0.44);
+	  box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41);
+	  padding: 0 12px;
+	}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3