Browse Source

维修保养

liuyang 5 years ago
parent
commit
038c865646

+ 4 - 16
frontend_web/src/views/instrument/maintainlog/_opera/add.vue

@@ -146,7 +146,6 @@
 // } from 'vuex'
 import {
   maintainsavedata,
-  OperaTpyelist,
   selectinstrument,
   InstrumenCode,
   savedataOne
@@ -154,6 +153,9 @@ import {
 import maintainlogdialog from '@/components/samples/maintainlogdialog'
 export default {
   name: 'materialdetect',
+  props: {
+    classificationlist: Array
+  },
   components: {
     maintainlogdialog
   },
@@ -180,7 +182,6 @@ export default {
       ID: '',
       InstrumenNamelist: [],
       maintainlogattrlist: [],
-      classificationlist: [],
 
       rulestestlistform: {
 
@@ -217,7 +218,6 @@ export default {
         this.testlistform.InstrumenId = pid
       }
     }
-    // this.getOperaTpyelist()
     this.getselectinstrument()
   },
   methods: {
@@ -253,19 +253,7 @@ export default {
           console.error(err)
         })
     },
-    getOperaTpyelist () {
-      // 获取样本单位
-      let _this = this
-      let params = {
-        code: 'OperaTpye'
-      }
-      OperaTpyelist(params)
-        // _this.$axios.get('/items/worditem?code=OperaTpye', {})
-        .then(res => {
-          _this.classificationlist = res.info
-        })
-    },
-    // 上传附件
+
     maintainlogattr () {
       let _this = this
       _this.attrinfo.ID = _this.ID

+ 3 - 16
frontend_web/src/views/instrument/maintainlog/_opera/edit.vue

@@ -57,7 +57,7 @@
                 <el-option v-for="item in classificationlist"
                            :label="item.Value"
                            :value="item.Value"
-                           :key="item.Value">
+                           :key="item.Id">
                 </el-option>
               </el-select>
 
@@ -154,6 +154,7 @@ import maintainlogdialog from '@/components/samples/maintainlogdialog'
 export default {
   name: 'materialdetect',
   props: {
+    classificationlist: Array,
     maintainlogId: {
       type: Number,
       default: 0
@@ -191,8 +192,6 @@ export default {
       ID: '',
       InstrumenNamelist: [],
       maintainlogattrlist: [],
-      classificationlist: [],
-
       rulestestlistform: {
 
         InstrumenId: [{
@@ -220,7 +219,6 @@ export default {
     }
   },
   mounted () {
-    // this.getOperaTpyelist()
     this.getselectinstrument()
   },
   methods: {
@@ -283,18 +281,7 @@ export default {
           _this.testlistform = response.info
         })
     },
-    getOperaTpyelist () {
-      // 获取样本单位
-      let _this = this
-      let params = {
-        code: 'OperaTpye'
-      }
-      OperaTpyelist(params)
-        // _this.$axios.get('/items/worditem?code=OperaTpye', {})
-        .then(res => {
-          _this.classificationlist = res.info
-        })
-    },
+
     // 上传附件
     maintainlogattr () {
       let _this = this

+ 20 - 17
frontend_web/src/views/instrument/maintainlog/index.vue

@@ -112,10 +112,14 @@
     </el-table>
     <!-- </el-card> -->
     <addmaintainlog ref="addmaintain"
-                    @closeAddDialog="handleCloseAdd"></addmaintainlog>
+                    @closeAddDialog="handleCloseAdd"
+                    :classificationlist="classificationlist"
+    ></addmaintainlog>
     <editmiantainlog ref="editmaintainlog"
                      @closeAddDialog="handleCloseEdit"
-                     :maintainlogId="selectedMaintainLogId"></editmiantainlog>
+                     :maintainlogId="selectedMaintainLogId"
+                     :classificationlist="classificationlist"
+    ></editmiantainlog>
     <!-- </div> -->
     <template slot="footer">
       <el-pagination style="margin: -10px;"
@@ -134,7 +138,7 @@
 <script>
 import {
   searchdatazl,
-  // OperaTpyelist,
+  OperaTpyelist,
   deleteinstrumentzl
 } from '@/api/instrumentroom'
 import addmaintainlog from './_opera/add'
@@ -182,7 +186,7 @@ export default {
     //   this.search.InstrumenName = ''
     // }
     this.searchdata()
-    // this.getOperaTpyelist()
+    this.getOperaTpyelist()
   },
   methods: {
     // 获取所有的维护保养记录
@@ -239,7 +243,7 @@ export default {
       searchdatazl(params)
         .then(function (response) {
           _this.activities = response.info.items
-          console.log('----response---', response)
+          // console.log('----response---', response)
           _this.totalsize = response.info.currentItemCount
         })
         .catch(function (error) {
@@ -304,18 +308,17 @@ export default {
         })
         .catch(() => { })
     },
-    // getOperaTpyelist () {
-    //   // 获取样本单位
-    //   let _this = this
-    //   let params = {
-
-    //     code: 'OperaTpye'
-    //   }
-    //   OperaTpyelist(params)
-    //     .then(res => {
-    //       _this.classificationlist = res.info
-    //     })
-    // },
+    getOperaTpyelist () {
+      // 获取样本单位
+      let _this = this
+      let params = {
+        code: 'OperaTpye'
+      }
+      OperaTpyelist(params)
+        .then(res => {
+          _this.classificationlist = res.info
+        })
+    },
     // 列表排序功能
     orderby (column) {
       if (column.order === 'ascending') {