From db2e3c739eef26e186a5342197162778789acbb8 Mon Sep 17 00:00:00 2001
From: 王震 <10952869+daywangzhen@user.noreply.gitee.com>
Date: 星期四, 07 九月 2023 17:57:39 +0800
Subject: [PATCH] 设备维护,标准Bom

---
 src/components/view/standard.vue             |  547 ++++++++++++++++-----------
 src/components/view/laboratoryManagement.vue |  306 +++++++-------
 src/main.js                                  |    2 
 src/components/view/technical.vue            |  308 ++++++---------
 src/assets/api/controller.js                 |   10 
 5 files changed, 608 insertions(+), 565 deletions(-)

diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index 7f75ef9..a4df82f 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -2,11 +2,17 @@
 const standard = {
 	// 鎶�鏈鐞�-鏍囧噯Bom
 	selectTreeByMaterial: "material/selectTreeByMaterial", //鏌ヨ鐗╂枡鐨勬爲
+	selectVersion:"/material/selectVersion",//鍙充晶鐗堟湰
 	selectProductByMaterial: "product/selectTreeByMaterial", //鏍规嵁鐗╂枡鏌ヨ椤圭洰琛ㄦ牸
 	selectTechnologyByMaterial: "technology/select",
+	selectAll:"/material/selectAll",//鍙充晶鏁版嵁
 	// 鎶�鏈鐞�-鎶�鏈枃浠�
 	selectAllOrder: "/orders/selectAllOrder", //鏌ヨ鎵�鏈夎鍗曞垪琛�
 	selectOrderById: "/orders/selectOrderById", //鏍规嵁璁㈠崟id鏌ヨ璁㈠崟璇︽儏
+
+
+	//璁㈠崟BOM
+	delDevice:"/device/delDeviceById",//璁㈠崟Bom
 }
 // 鍘熸潗鏂欐楠�
 const raw = {
@@ -34,6 +40,10 @@
 
 // QMS瀹為獙瀹ょ鐞�
 const laboratory = {
+  delDeviceById:"/device/delDeviceById",//鍒犻櫎
+  addApi:"/device/add",//鏂板
+  listgroup:"/device/list_group",
+  selectDevice:"/device/selectDevice",//鍙宠竟灞曠ず
   addDeviceInspectDownBox: "/device/listInspect", // 鏂板浠櫒璁惧锛氭楠岄」鐩笅鎷夋
   selectDeviceInspectMessage: "/device/inspectId", // 鏂板浠櫒璁惧锛氭牴鎹楠岄」鐩甀D鏌ヨ鏁版嵁
   addDeviceKeeper: "/device/list_user",// 鏂板浠櫒璁惧锛氫繚绠′汉涓嬫媺妗�
diff --git a/src/components/view/laboratoryManagement.vue b/src/components/view/laboratoryManagement.vue
index 2f2ac7e..55d2727 100644
--- a/src/components/view/laboratoryManagement.vue
+++ b/src/components/view/laboratoryManagement.vue
@@ -49,19 +49,16 @@
             </el-row>
             <el-row>
               <el-col :span="12">
-                <el-form-item label="鐖剁骇鍒嗙被">
+                <el-form-item label="璁惧缁�" prop="name">
                   <el-select
-                    v-model="value"
-                    @blur="productSelect"
-                    filterable
-                    allow-create
-                    placeholder="璇烽�夋嫨鐖剁骇鍒嗙被"
+                    v-model="ruleForm.equr"
+                    placeholder="璇烽�夋嫨璁惧缁�"
                   >
                     <el-option
-                      v-for="list in parentClassificationList"
-                      :key="list.index"
-                      :label="list.father"
-                      :value="list.father"
+                      v-for="list in equip"
+                      :key="list"
+                      :label="list"
+                      :value="list"
                     >
                     </el-option>
                   </el-select>
@@ -153,38 +150,7 @@
                 </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
@@ -196,18 +162,8 @@
                   </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>
@@ -228,14 +184,11 @@
         <el-radio-group
           class="ai-tab-change"
           style="width: 270px; margin-top: 5px"
-          v-model="radio1"
+          v-model="equipment"
+          @input="RadioChange"
         >
-          <el-radio-button size="small" label="true">
-            <div>鐢熶骇璁惧</div>
-          </el-radio-button>
-          <el-radio-button size="small" label="false">
-            <div>妫�娴嬭澶�</div>
-          </el-radio-button>
+        <el-radio-button  label="1">鐢熶骇璁惧</el-radio-button>
+        <el-radio-button  label="2">妫�楠岃澶�</el-radio-button>
         </el-radio-group>
         <el-input
           class="frame_input"
@@ -269,7 +222,7 @@
                   }`
                 "
               ></i>
-              {{ data.name }}</span
+              {{ data.father }}</span
             >
             <el-button type="text" size="mini" @click.stop="remove(node, data)">
               <i class="el-icon-delete"></i>
@@ -365,9 +318,9 @@
             </el-table-column>
             <el-table-column prop="name" label="浠櫒璁惧鍚嶇О" width="125">
             </el-table-column>
-            <el-table-column prop="keeper" label="淇濈浜�"> </el-table-column>
+            <el-table-column prop="userName" label="淇濈浜�"> </el-table-column>
             <el-table-column
-              prop="end_measure"
+              prop="DATE_FORMAT(end_measure, '%Y-%m-%d')"
               label="璁¢噺鎴嚦鏈夋晥鏈�"
               width="147"
             >
@@ -414,15 +367,15 @@
               :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>
-            <el-table-column prop="user_name" label="妫�娴嬩汉"> </el-table-column>
+            <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)"
+                  @click="handleClick(scope.row)"
                   type="text"
                   size="small"
                   >鍒犻櫎</el-button
@@ -455,6 +408,8 @@
       staue_value: "", // 涓婚〉琛ㄦ牸涓婃柟鐨勭姸鎬侀�夋嫨
       // BOM鏍戞暟鎹粨鏋�
       towTree: [],
+      equipment: '',
+      equip:'',
       ruleForm: {
         // 鏂板浠櫒琛ㄥ崟
         code: "",
@@ -465,8 +420,14 @@
         keeper: "",
         name: "",
         rawInsProductId: "",
-        type: ""
+        type: "",
+        treedata:{
+            father:'璁惧缁�1',
+        },
+        equr:1,
       },
+      delete:{},
+      equip:[],
       rules: {
         name: [
           { required: true, message: "璇疯緭鍏ヤ华鍣ㄨ澶囩紪鍙�", trigger: "blur" },
@@ -505,6 +466,22 @@
     };
   },
   methods: {
+    selectDevice() {//鍙宠竟鏁版嵁
+      console.log(this.$api.url.selectDevice);
+      this.$axios.get(this.$api.url.selectDevice,{
+        params:{
+          father:this.treedata.father,
+          type:this.equip,
+        }
+      }).then(res =>{
+        console.log(res);
+        this.tableData = res.data
+      }, {
+				headers: {
+                		"Content-Type": "application/json"
+              		}
+      })
+    },
     // 鍔ㄦ�佹帶鍒跺睍寮�涓庢敹璧峰拰鍒囨崲瀵瑰簲鍥炬爣
     isC() {
       this.isCollapse = !this.isCollapse;
@@ -517,25 +494,27 @@
       }
     },
     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("纭鍏抽棴锛�")
@@ -549,31 +528,52 @@
       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.listgroup()
+    },
+    listgroup() {
+        this.$axios.get(this.$api.url.listgroup).then(res =>{
+            this.equip = res.data
+        })
+    },
+    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.id = i.children[0].id;
-            i.children = undefined;
-          }
-        });
+      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;
       });
     },
-    tableDataApi() {
-      this.$axios.get(this.$api.url.tableDeviceList).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"}})
     },
+    // tableDataApi() {
+    //   this.$axios.get(this.$api.url.tableDeviceList).then(res => {
+    //     this.tableData = res.data;
+    //   });
+    // },
     reset() {
       this.tableDataApi();
       this.radio1 = "true";
@@ -581,21 +581,9 @@
       this.staue_value = "";
     },
     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;
-          });
-      }
+      console.log(data);
+        this.treedata = data
+        this.selectDevice()
     },
     handlerDeptList() {
       this.towTree = [];
@@ -631,28 +619,37 @@
           });
       }
     },
-    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
+      })
+    },
+    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("姝ゆ搷浣滃皢姘镐箙鍒犻櫎璇ヨ澶�, 鏄惁缁х画?", "鎻愮ず", {
@@ -728,6 +725,7 @@
     this.twoTreeApi();
     // 鍒濆鍖栬皟鐢ㄨ〃鏍兼暟鎹�
     this.tableDataApi();
+    this.selectDevice()//鍙宠竟
   },
   watch: {
     "ruleForm.rawInsProductId": {
@@ -744,17 +742,17 @@
         }
       }
     },
-    dialogVisible: {
-      handler: function(newVal, oldVal) {
-        if (newVal) {
-          // 鎴愬姛娓呯┖杈撳叆鍐呭
-          this.ruleForm = {};
-          this.value = "";
-          this.showCodeNameModel = {};
-          this.$refs.ruleForm.resetFields();
-        }
-      }
-    },
+    // dialogVisible: {
+    //   handler: function(newVal, oldVal) {
+    //     if (newVal) {
+    //       // 鎴愬姛娓呯┖杈撳叆鍐呭
+    //       this.ruleForm = {};
+    //       this.value = "";
+    //       this.showCodeNameModel = {};
+    //       this.$refs.ruleForm.resetFields();
+    //     }
+    //   }
+    // },
     radio1: {
       handler: function(newVal, oldVal) {
         this.towTree = [];
diff --git a/src/components/view/standard.vue b/src/components/view/standard.vue
index 3a9c15a..731daef 100644
--- a/src/components/view/standard.vue
+++ b/src/components/view/standard.vue
@@ -1,117 +1,12 @@
-<style scoped>
-  .standard {}
-
-  .standard .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;
-  }
-
-  .standard .title {
-    margin-bottom: 10px;
-    padding: 0 20px;
-  }
-
-  .standard .title *{
-    font-size: 16px;
-  }
-
-  .thing {
-    width: 100%;
-    height: calc(100% - 48px);
-    background-color: #fff;
-    display: flex;
-  }
-
-  .thing .left {
-    width: 295px;
-    height: calc(100% - 32px);
-    border-right: 3px solid rgb(245, 247, 251);
-    padding: 16px;
-  }
-
-  .thing .left .custom-tree-node span {
-    font-size: 14px;
-  }
-
-  .thing .left .custom-tree-node {
-    flex: 1;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    font-size: 14px;
-    padding-right: 8px;
-  }
-
-  .node_i {
-    color: orange;
-  }
-
-  .el-icon-delete {
-    display: none;
-    color: #004EA2;
-  }
-
-  .custom-tree-node:hover .el-icon-delete {
-    display: inline;
-  }
-
-  .thing .right {
-    width: calc(100% - 295px);
-    height: 100%;
-    overflow: hidden;
-  }
-
-  .thing .right .choose {
-    padding: 21px 24px;
-    display: flex;
-    align-items: center;
-  }
-
-  .thing .right .choose * {
-    font-size: 14px;
-  }
-
-  .thing .right .choose .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;
-  }
-
-  .thing .right .table{
-    margin-right: 24px;
-    height: calc(100% - 74px);
-  }
-</style>
-<style>
-  .standard .title .el-button * {
-    font-size: 14px;
-  }
-
-  .standard .title .el-button--default{
-    color: #004EA2;
-  }
-
-  .standard .thing .left .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
-    background: rgba(58, 124, 253, 0.3);
-    color: #004EA2;
-  }
-
-  .el-tree-node__content {
-    height: 30px;
-    border-radius: 2px;
-  }
-</style>
-
 <template>
   <div class="standard">
     <div class="title">
       <el-row>
         <el-col :span="12" style="line-height: 32px;">鏍囧噯BOM</el-col>
         <el-col :span="12" style="text-align: right;">
-          <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;" @click="bomAddModelVisible= true">鏂板</el-button>
+          <el-button type="primary" icon="el-icon-plus" style="background: #004EA2;"
+            @click="bomAddModelVisible = true">鏂板</el-button>
+          <el-button icon="el-icon-plus">鏂板鐗堟湰</el-button>
           <el-button icon="el-icon-edit-outline">淇敼</el-button>
           <el-button icon="el-icon-delete">鍒犻櫎</el-button>
         </el-col>
@@ -120,40 +15,83 @@
     <div class="thing">
       <div class="left">
         <el-input v-model="search" suffix-icon="el-icon-search" placeholder="璇疯緭鍏ユ悳绱㈠唴瀹�" size="small" clearable></el-input>
-        <el-tree :data="list" ref="tree" :props="{children: 'children',label: 'name'}" node-key="id" default-expand-all
-          :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current @node-expand="nodeOpen"
-          @node-collapse="nodeClose">
+
+        <el-tree :data="list" ref="tree" :default-expand-all="false" :props="{ children: 'children', label: 'name' }"
+          node-key="id" :filter-node-method="filterNode" @node-click="handleNodeClick" highlight-current>
           <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.code}}{{ data.name }}</span>
+            <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>
         </el-tree>
       </div>
+
+
       <div class="right">
         <div class="choose">
           <span>绫诲瀷锛�</span>
-          <el-select v-model="tableType" size="small" placeholder="璇烽�夋嫨" style="width: 224px;margin-right: 52px;">
-            <el-option :value="0" label="宸ヨ壓鏂囦欢"></el-option>
+          <el-select v-model="tableType" size="small" placeholder="璇烽�夋嫨" @change="TYPE"
+            style="width: 224px;margin-right: 52px;">
+            <el-option :value="0" label="宸ヨ壓璺嚎"></el-option>
             <el-option :value="1" label="鎶�鏈寚鏍�"></el-option>
+            <el-option :value="2" label="鐗╂枡娓呭崟"></el-option>
+            <el-option :value="3" label="鐢熶骇宸ヨ壓"></el-option>
           </el-select>
-          <span>{{tableType==1?'椤圭洰锛�':'宸ヨ壓鍚嶇О锛�'}}</span>
-          <el-input v-model="searchName" size="small" placeholder="璇疯緭鍏�" style="width: 224px;margin-right: 24px;" clearable></el-input>
-          <el-button size="mini" @click="()=>{searchName='';selectProductTableData()}"><span>閲� 缃�</span></el-button>
-          <el-button size="mini" type="primary" style="background: #004EA2;" @click="selectProductTableData"><span>鏌� 璇�</span></el-button>
+          <span>{{ tableType == 1 ? '椤圭洰锛�' : '宸ヨ壓鍚嶇О锛�' }}</span>
+          <el-input v-model="searchName" size="small" placeholder="璇疯緭鍏�" style="width: 224px;margin-right: 24px;"
+            clearable></el-input>
+          <span>{{ tableType == 1 ? '鐗堟湰锛�' : '宸ヨ壓鍚嶇О锛�' }}</span>
+          <el-select v-model="VER" @change="verevent" style="width: 280px;" placeholder="璇烽�夋嫨">
+            <el-option v-for="item in version" :key="item" :label="item" :value="item">
+            </el-option>
+          </el-select>
+          <el-button size="mini" @click="() => { searchName = ''; selectProductTableData() }"><span>閲� 缃�</span></el-button>
+          <el-button size="mini" type="primary" style="background: #004EA2;" @click="selectProductTableData"><span>鏌�
+              璇�</span></el-button>
+        </div>
+
+        <div>
+          <el-table :data="tableData" style="width: 100%;margin-bottom: 20px;" row-key="name" border
+            @selection-change="handleSelectionChange" default-expand-all
+            :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
+            <el-table-column type="selection" width="55">
+            </el-table-column>
+            <el-table-column type="index" width="50" label="搴忓彿">
+            </el-table-column>
+            <el-table-column prop="name" label="宸ュ簭" sortable width="300px">
+              <!-- <template slot-scope="scope">
+                        <el-tag>
+                            <div class="firstDiv" :style="`color: ${scope.row.children? '#16a7ff' : '#58c173'}`">
+                            {{ scope.row.children ? "01" : "02" }}
+                            </div>
+                        </el-tag>
+                        <span style="color: black">{{ scope.row.name }}</span>
+
+                        </template> -->
+            </el-table-column>
+            <el-table-column prop="" sortable label="宸ヨ壓鍚嶇О">
+            </el-table-column>
+            <el-table-column prop="" label="鎸囨爣鍚嶇О">
+            </el-table-column>
+            <el-table-column prop="" label="鍗曚綅">
+            </el-table-column>
+            <el-table-column prop="" label="鍐呮帶鍊�">
+            </el-table-column>
+            <el-table-column prop="unit" label="鏍囧噯鍊�">
+            </el-table-column>
+          </el-table>
         </div>
         <div class="table">
-          <technology v-if="tableData.length!==0" :tableType="tableType" :tableData="tableData"></technology>
+          <technology v-if="tableData.length !== 0" :tableType="tableType" :tableData="tableData"></technology>
         </div>
       </div>
     </div>
+
+
     <div class="bom-add-model">
-      <el-dialog
-        title="BOM鏂板"
-        :visible.sync="bomAddModelVisible"
-        width="30%">
+      <el-dialog title="BOM鏂板" :visible.sync="bomAddModelVisible" width="30%">
         <el-form>
 
         </el-form>
@@ -167,111 +105,268 @@
 </template>
 
 <script>
-  import technology from "./standard-table/technology.vue"
-  export default {
-    components: {technology},
-    data() {
-      return {
-        // BOM鏍戞暟鎹粨鏋�
-        list: [{
-          id: 0,
-          name: "鍘熸潗鏂�",
-          code: "[1]",
-          children: []
-        }, {
-          id: 1,
-          name: "鎴愬搧",
-          code: "[1]",
-          children: []
-        }, {
-          id: 2,
-          name: "鍗婃垚鍝�",
-          code: "[1]",
-          children: []
-        }],
-        search: null,
-        // 琛ㄦ牸绫诲瀷 1锛氭妧鏈寚鏍囷紝0锛氬伐鑹鸿矾绾�
-        tableType: 1,
-        // 鏌ヨ鏉′欢-鍚嶇О
-        searchName: "",
-        // 鐐瑰嚮閫変腑鏍戣妭鐐�
-        checkTreeNode: {},
-        tableData:[],
-        // 鎺у埗bom鏂板妯℃�佹鏄惁鏄剧ず
-        bomAddModelVisible: false
-      }
-    },
-    watch: {
-      search(val) {
-        this.$refs.tree.filter(val);
-      },
-      tableType(val){
-        this.selectProductTableData()
-      }
-    },
-    mounted() {
-      this.selectMaterialTree()
-    },
-    methods: {
-      handleNodeClick(data) {
-        this.checkTreeNode = data
-        // this.selectMaterialTree()
-        this.selectProductTableData()
-      },
-      filterNode(value, data) {
-        if (!value) return true;
-        return data.label.indexOf(value) !== -1;
-      },
-      remove(node, data) {
-        this.$confirm("鏄惁鍒犻櫎", "璀﹀憡", {
-          type: "warning"
-        }).then(res => {
-          const parent = node.parent;
-          const children = parent.data.children || parent.data;
-          const index = children.findIndex(d => d.id === data.id);
-          children.splice(index, 1);
-        }).catch(e => {})
-      },
-      nodeOpen(data, node, el) {
-        $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
-      },
-      nodeClose(data, node, el) {
-        $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')
-      },
-      selectMaterialTree() {
-        this.$axios.get(this.$api.url.selectTreeByMaterial).then(res => {
-          res.data.forEach(a => {
-            this.list.forEach(b => {
-              if (a.type == b.id) b.children = [a]
-            })
-          })
-          this.$nextTick().then(() => {
-          const firstNode = document.querySelector('.el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node .el-tree-node__children .el-tree-node')
-          firstNode.click()
-          })
-        })
+import technology from "./standard-table/technology.vue"
+export default {
+  components: { technology },
+  data() {
+    return {
+      // BOM鏍戞暟鎹粨鏋�
+      list: [],
+      search: null,
+      tableType: 1, // 琛ㄦ牸绫诲瀷 1锛氭妧鏈寚鏍囷紝0锛氬伐鑹鸿矾绾�
+      searchName: "",// 鏌ヨ鏉′欢-鍚嶇О
+      checkTreeNode: {},// 鐐瑰嚮閫変腑鏍戣妭鐐�
+      tableData: [],
+      bomAddModelVisible: false,// 鎺у埗bom鏂板妯℃�佹鏄惁鏄剧ず
+      list: [],
+      typeselect: {},
+      returntree: {},
+      version: {},
+      VER: {},
+      verdata: {},
+      character: '',
+    }
+  },
+  // watch: {
+  //   search(val) {
+  //     this.$refs.tree.filter(val);
+  //   },
+  //   tableType(val){
+  //     this.selectProductTableData()
+  //   }
+  // },
+  mounted() {
+    this.selectMaterialTree()
+  },
+  methods: {
+    handleSelectionChange() {
 
-      },
-      async selectProductTableData() {
-        switch (this.tableType) {
-          case 0:
-        const {data:technologyList} = await this.$axios.get(this.$api.url.selectTechnologyByMaterial,{params:{specificationId:this.checkTreeNode.id,technologyName:this.searchName}})
-        this.tableData = technologyList
-            break;
-          case 1:
-        const {data:productList} = await this.$axios.get(this.$api.url.selectProductByMaterial,{params:{specifications:this.checkTreeNode.id,project:this.searchName}})
-        productList.forEach((item,index)=>{
-          item.name = item.father
-          item.index = index+1
-          item.id = item.father
-          if(item.children.length===1){
-            productList[index] = {...item.children[0],index: index+1,name:item.father}
-          }
-        })
-        this.tableData = productList
-            break;
+    },
+    TYPE(val) {//绫诲瀷.鏁版嵁
+      console.log(val);
+      this.typeselect = val
+      console.log(this.typeselect);
+      this.selectVersion()
+    },
+    handleNodeClick(val) {//鏍戠殑鍊�
+      console.log(val);
+      this.returntree = val
+    },
+    selectVersion() {
+      this.$axios.get(this.$api.url.selectVersion, {
+        params: {
+          specificationsId: this.returntree.id,
+          type: this.typeselect,
         }
+      }).then(res => {
+        this.verdata = res.data
+        this.version = this.verdata.map(el => {
+          return el = `v${el}`
+        })
+        console.log(this.verdata);
+      })
+    },
+    verevent(val) {
+      console.log(val);
+      let cc = val.replace('v', '')
+      console.log(cc);
+      this.character = cc
+      this.selectAll()
+      // const { v, ...newObj } = val;
+      // delete newObj.v
+      // console.log(newObj);
+    },
+    //鍙充晶鏁版嵁
+    selectAll() {
+      console.log(this.$axios.get(this.$api.url.selectAll));
+      this.$axios.get(this.$api.url.selectAll, {
+        params: {
+          specificationsId: this.returntree.id,
+          type: this.typeselect,
+          version: this.character,
+        }
+      }).then(res => {
+        this.tableData = res.data
+      })
+    },
+    //浜旂骇鏍�
+    selectMaterialTree() {
+      this.$axios.get(this.$api.url.selectTreeByMaterial).then(res => {
+        this.list = res.data
+        this.list.forEach((el, idx, arr) => {
+          if (idx == 0) {
+            arr[idx].name = '鎴愬搧'
+          }
+          if (idx == 1) {
+            arr[idx].name = '鍗婃垚鍝�'
+          }
+          el.children.forEach((newEl, newIdx, newArr) => {
+            if (newIdx == 0) {
+              newArr[newIdx].name = '姗¤兌杩炴帴鍣�'
+            }
+            if (newIdx == 1) {
+              newArr[newIdx].name = '閲戝睘杩炴帴鍣�'
+            }
+            if (newIdx == 2) {
+              newArr[newIdx].name = '婀挎彃鎷旂數杩炴帴鍣�'
+            }
+            if (newIdx == 3) {
+              newArr[newIdx].name = '鍒嗘敮缁勪欢'
+            }
+          })
+        })
+        console.log(this.list);
+      })
+    },
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    remove(node, data) {
+      this.$confirm("鏄惁鍒犻櫎", "璀﹀憡", {
+        type: "warning"
+      }).then(res => {
+        const parent = node.parent;
+        const children = parent.data.children || parent.data;
+        const index = children.findIndex(d => d.id === data.id);
+        children.splice(index, 1);
+      }).catch(e => { })
+    },
+    nodeOpen(data, node, el) {
+      $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder-opened')
+    },
+    nodeClose(data, node, el) {
+      $($(el.$el).find('.node_i')[0]).attr('class', 'node_i el-icon-folder')
+    },
+    async selectProductTableData() {
+      switch (this.tableType) {
+        case 0:
+          const { data: technologyList } = await this.$axios.get(this.$api.url.selectTechnologyByMaterial, { params: { specificationId: this.checkTreeNode.id, technologyName: this.searchName } })
+          this.tableData = technologyList
+          break;
+        case 1:
+          const { data: productList } = await this.$axios.get(this.$api.url.selectProductByMaterial, { params: { specifications: this.checkTreeNode.id, project: this.searchName } })
+          productList.forEach((item, index) => {
+            item.name = item.father
+            item.index = index + 1
+            item.id = item.father
+            if (item.children.length === 1) {
+              productList[index] = { ...item.children[0], index: index + 1, name: item.father }
+            }
+          })
+          this.tableData = productList
+          break;
       }
     }
   }
+}
 </script>
+
+
+<style scoped>
+.standard {}
+
+.standard .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;
+}
+
+.standard .title {
+  margin-bottom: 10px;
+  padding: 0 20px;
+}
+
+.standard .title * {
+  font-size: 16px;
+}
+
+.thing {
+  width: 100%;
+  height: calc(100% - 48px);
+  background-color: #fff;
+  display: flex;
+}
+
+.thing .left {
+  width: 295px;
+  height: calc(100% - 32px);
+  border-right: 3px solid rgb(245, 247, 251);
+  padding: 16px;
+}
+
+.thing .left .custom-tree-node span {
+  font-size: 14px;
+}
+
+.thing .left .custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+}
+
+.node_i {
+  color: orange;
+}
+
+.el-icon-delete {
+  display: none;
+  color: #004EA2;
+}
+
+.custom-tree-node:hover .el-icon-delete {
+  display: inline;
+}
+
+.thing .right {
+  width: calc(100% - 295px);
+  height: 100%;
+  overflow: hidden;
+}
+
+.thing .right .choose {
+  padding: 21px 24px;
+  display: flex;
+  align-items: center;
+}
+
+.thing .right .choose * {
+  font-size: 14px;
+}
+
+.thing .right .choose .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;
+}
+
+.thing .right .table {
+  margin-right: 24px;
+  height: calc(100% - 74px);
+}
+</style>
+<style>
+.standard .title .el-button * {
+  font-size: 14px;
+}
+
+.standard .title .el-button--default {
+  color: #004EA2;
+}
+
+.standard .thing .left .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
+  background: rgba(58, 124, 253, 0.3);
+  color: #004EA2;
+}
+
+.el-tree-node__content {
+  height: 30px;
+  border-radius: 2px;
+}
+</style>
+
diff --git a/src/components/view/technical.vue b/src/components/view/technical.vue
index 66ed8ff..8ec3eb3 100644
--- a/src/components/view/technical.vue
+++ b/src/components/view/technical.vue
@@ -1,105 +1,3 @@
-
-<style scoped>
-  .technical{
-    height: 100%;
-    width: 100%;
-  }
-  .technical .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;
-  }
-
-  .technical .title {
-    margin-bottom: 10px;
-    padding: 0 20px;
-  }
-
-/* 鎼滅储澶撮儴鏍峰紡 */
-.search-header{
-  background: #fff;
-  padding: 24px 32px;
-}
-.search-header .el-form-item{
-  margin: 0px;
-  font-size: 14px;
-}
-.search-header .el-form-item:nth-child(1){
-  margin-right: 48px;
-} 
-.search-header .el-form-item:nth-child(2){
-  margin-right: 24px;
-} 
-/* 閲嶇疆鍜屾煡璇袱涓寜閽牱寮� */
-.search-header .el-form-item .el-button{
-width: 65px;
-height: 32px;
-box-sizing: border-box;
-background: rgb(255, 255, 255);
-border: 1px solid rgb(217, 217, 217);
-border-radius:2px;
-padding: 0;
-font-size: 14px;
-}
-.search-header .el-form-item .el-button:nth-child(2){
-/* Rectangle 77 */
-background: rgb(0, 78, 162);
-color: #fff;
-}
-/* 杈撳叆妗嗙殑鏍峰紡 */
-.search-header .el-form-item .el-input >>>.el-input__inner{
-width: 224px;
-height: 32px ;
-box-sizing: border-box;
-background: rgb(255, 255, 255);
-border: 1px solid rgb(217, 217, 217);
-border-radius:2px;
-}
-
-
-/* 鎶�鏈枃浠惰〃鏍兼牱寮� */
-.technical-table{
-  margin-top: 11px;
-  height: calc(100% - 140px);
-  background: #fff;
-  padding: 23px 21px ;
-  font-size: 14px;
-  box-sizing: border-box;
-  display: flex;
-  flex-direction: column;
-}
-/* .technical-table .el-table{
-  overflow-y:scroll;
-} */
-.technical-table .table-box {
-  flex: 1;
-  overflow-y: scroll;
-}
-.technical-table .el-pagination{
-  margin-top: 23px;
-  display: flex;
-  justify-content: end;
-}
-.formtitle{
-  display: block;
-  margin-bottom: 24px;
-  font-size: 16px;
-}
-.detail-model >>>.el-form-item__label{
-  color: rgb(51, 51, 51);
-}
-.detail-model >>>.el-input__inner{
-width: 224px;
-height: 32px;
-box-sizing: border-box;
-background: rgb(238, 238, 238);
-border: 1px solid rgb(221, 221, 221);
-border-radius:4px;
-}
-</style>
-
-
 <template>
   <div class="technical">
     <div class="title">
@@ -140,65 +38,48 @@
           width="78">
         </el-table-column>
           <el-table-column
-            prop="id"
-            label="璁㈠崟鍙�"
-            width="124">
+            prop="order_number"
+            label="璁㈠崟鍙�">
+          </el-table-column>
+          <el-table-column
+            prop="saleman"
+            label="涓氬姟鍛�">
           </el-table-column>
           <el-table-column
             prop="proname"
-            label="宸ョ▼鍚嶇О"
-            width="160">
+            label="瀹㈡埛鍚嶇О">
           </el-table-column>
           <el-table-column
-            prop="code"
-            label="浜у搧缂栫爜"
-            width="168"
-            >
-          </el-table-column>
-          <el-table-column
-            prop="type"
-            label="浜у搧澶х被"
-            width="128">
+            prop="name"
+            label="浜у搧鍚嶇О">
           </el-table-column>
           <el-table-column
             prop="specifications"
-            label="瑙勬牸鍨嬪彿"
-            width="170">
+            label="瑙勬牸鍨嬪彿">
           </el-table-column>
           <el-table-column
             prop="unit"
-            label="鍗曚綅"
-            width="100">
+            label="鍗曚綅">
           </el-table-column>
           <el-table-column
             prop="number"
-            label="鏁伴噺"
-            width="118"
-            >
+            label="鏁伴噺">
           </el-table-column>
           <el-table-column
-            prop="username"
-            label="涓嬪崟浜�"
-            width="114">
+            prop="涓嬪崟鏃ユ湡"
+            label="涓嬪崟鏃ユ湡">
           </el-table-column>
           <el-table-column
-            prop="createTime"
-            label="涓嬪崟鏃ユ湡"
-            width="153"
-            >
+            prop="浜よ揣鏃ユ湡"
+            label="浜よ揣鏃ユ湡">
           </el-table-column>
           <el-table-column
-            prop="deliveryTime"
-            label="浜よ揣鏃ユ湡"
-            width="137">
-          </el-table-column>
-          <el-table-column
-            prop="state"
+            prop="type"
             label="鐘舵��"
             width="85"
             >
             <template slot-scope="scope">
-              {{scope.state==1?'寰呯紪鍒�':'宸茬紪鍒�'}}
+              {{scope.state==0?'寰呯紪鍒�':'宸茬紪鍒�'}}
             </template>
           </el-table-column>
           <el-table-column
@@ -341,52 +222,7 @@
         id:'',
         date:''
        },
-       technicalTable: [{
-            date: '2016-05-02',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-04',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-01',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-03',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-03',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-03',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-03',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-03',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-03',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-03',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }, {
-            date: '2016-05-03',
-            name: '鐜嬪皬铏�',
-            address: '涓婃捣甯�'
-          }
-       ],
+       technicalTable: [],
        showDetail: false,
        selectedRow: {},
        pageParams:{
@@ -407,7 +243,10 @@
         console.log(this.selectedRow)
       },
       async  getTechnicalTableData() {
-        const res = await this.$axios.get(this.$api.url.selectAllOrder,{params:{pageSize:(this.pageParams.pageNo-1),countSize:this.pageParams.pageSize,...this.searchData}})
+        const res = await this.$axios.get(this.$api.url.selectAllOrder,{
+          params:{
+            pageSize:(this.pageParams.pageNo-1),
+            countSize:this.pageParams.pageSize,...this.searchData}})
         this.technicalTable = res.data.row
         this.pageParams.total = res.data.total
       },
@@ -430,3 +269,104 @@
     },
 }
 </script>
+
+<style scoped>
+  .technical{
+    height: 100%;
+    width: 100%;
+  }
+  .technical .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;
+  }
+
+  .technical .title {
+    margin-bottom: 10px;
+    padding: 0 20px;
+  }
+
+/* 鎼滅储澶撮儴鏍峰紡 */
+.search-header{
+  background: #fff;
+  padding: 24px 32px;
+}
+.search-header .el-form-item{
+  margin: 0px;
+  font-size: 14px;
+}
+.search-header .el-form-item:nth-child(1){
+  margin-right: 48px;
+} 
+.search-header .el-form-item:nth-child(2){
+  margin-right: 24px;
+} 
+/* 閲嶇疆鍜屾煡璇袱涓寜閽牱寮� */
+.search-header .el-form-item .el-button{
+width: 65px;
+height: 32px;
+box-sizing: border-box;
+background: rgb(255, 255, 255);
+border: 1px solid rgb(217, 217, 217);
+border-radius:2px;
+padding: 0;
+font-size: 14px;
+}
+.search-header .el-form-item .el-button:nth-child(2){
+/* Rectangle 77 */
+background: rgb(0, 78, 162);
+color: #fff;
+}
+/* 杈撳叆妗嗙殑鏍峰紡 */
+.search-header .el-form-item .el-input >>>.el-input__inner{
+width: 224px;
+height: 32px ;
+box-sizing: border-box;
+background: rgb(255, 255, 255);
+border: 1px solid rgb(217, 217, 217);
+border-radius:2px;
+}
+
+
+/* 鎶�鏈枃浠惰〃鏍兼牱寮� */
+.technical-table{
+  margin-top: 11px;
+  height: calc(100% - 140px);
+  background: #fff;
+  padding: 23px 21px ;
+  font-size: 14px;
+  box-sizing: border-box;
+  display: flex;
+  flex-direction: column;
+}
+/* .technical-table .el-table{
+  overflow-y:scroll;
+} */
+.technical-table .table-box {
+  flex: 1;
+  overflow-y: scroll;
+}
+.technical-table .el-pagination{
+  margin-top: 23px;
+  display: flex;
+  justify-content: end;
+}
+.formtitle{
+  display: block;
+  margin-bottom: 24px;
+  font-size: 16px;
+}
+.detail-model >>>.el-form-item__label{
+  color: rgb(51, 51, 51);
+}
+.detail-model >>>.el-input__inner{
+width: 224px;
+height: 32px;
+box-sizing: border-box;
+background: rgb(238, 238, 238);
+border: 1px solid rgb(221, 221, 221);
+border-radius:4px;
+}
+</style>
+
diff --git a/src/main.js b/src/main.js
index 41f2bc4..8d31fb2 100644
--- a/src/main.js
+++ b/src/main.js
@@ -24,7 +24,7 @@
 Vue.use(api);
 
 // const javaApi = 'http://127.0.0.1:8001/'
-const javaApi = 'http://192.168.218.251:8001/'
+const javaApi = 'http://192.168.218.249:8001/'
 
 
 

--
Gitblit v1.9.3