Browse Source

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

5 years ago
parent
commit
eefa3fe6aa
1 changed files with 24 additions and 33 deletions
  1. 24 33
      ys_vue/src/views/detection/maintenance.vue

+ 24 - 33
ys_vue/src/views/detection/maintenance.vue

@@ -21,17 +21,17 @@
 
     <!--列表-->
     <el-table
-      :data="moulds"
+      :data="records"
       highlight-current-row
       :height="tableHeight"
       v-loading="listLoading"
       style="width: 100%;"
     >
       <el-table-column type="index" width="60"></el-table-column>
-      <el-table-column prop="maintenancer" label="保养人" width="100" sortable></el-table-column>
-      <el-table-column prop="plan" label="保养方案" sortable></el-table-column>
-      <el-table-column prop="picture" label="保养照片" width="200" sortable></el-table-column>
-      <el-table-column prop="closeTime" label="关闭时间" width="200" sortable></el-table-column>
+      <el-table-column prop="maintainUserName" label="保养人" width="100" sortable></el-table-column>
+      <el-table-column prop="maintainType" label="保养方案" sortable></el-table-column>
+      <el-table-column prop="fileName" label="保养照片" width="200" sortable></el-table-column>
+      <el-table-column prop="indate" label="关闭时间" width="200" sortable></el-table-column>
     </el-table>
 
     <!--工具条-->
@@ -112,38 +112,26 @@ import util from "../../common/js/util";
 export default {
   data() {
     return {
+      //本页模具ID
+      mouldId: null,
       options: [{ value: "aaa", label: "123" }, { value: "bbb", label: "456" }],
-      //临时数据
-      moulds: [
-        {
-          maintenancer: "张有财",
-          plan: "100kb",
-          picture: "张富贵",
-          closeTime: "2019-07-24",
-          state: "已通过"
-        },
-        {
-          maintenancer: "刘没财",
-          plan: "200kb",
-          picture: "刘穷比",
-          closeTime: "2019-07-23",
-          state: "未通过"
-        }
-      ],
+      //记录
+      records: [],
       //标题栏过滤器
       filters: {
         name: "",
         value: ""
       },
       listLoading: false,
+      page: 1,
+      size: 20,
       total: 0,
       tableHeight: 0,
       formRules: {},
       //保养界面 种类
       type: [
         { label: "动作", value: 0 },
-        { label: "小动作", value: 1 },
-        { label: "大动作", value: 2 }
+        { label: "易损件", value: 1 }
       ],
       //保养界面 动作
       action: [
@@ -170,14 +158,14 @@ export default {
     };
   },
   methods: {
-    //  分页
+    //分页
     handleCurrentChange(val) {
       this.page = val;
-      // this.getUsers();
+      this.getList();
     },
     handleSizeChange(val) {
       this.size = val;
-      // this.getUsers();
+      this.getList();
     },
     selsChange: function(sels) {
       this.sels = sels;
@@ -194,11 +182,11 @@ export default {
       this.listLoading = true;
       this.http.post(
         this.port.mold.moldMaintainList,
-        {},
+        { mouldId: this.mouldId, pageSize: this.size, pageNum: this.page },
         res => {
           this.listLoading = false;
           if (res.code == "ok") {
-            console.log(res);
+            this.records = res.data.list;
           } else {
             this.$message({
               message: res.msg,
@@ -215,14 +203,17 @@ export default {
         }
       );
     },
-    //模具保养
+    //模具保养 N/A
     maintain() {
       this.http.post(
         this.port.mold.moldMaintain,
         {},
         res => {
           if (res.code == "ok") {
-            console.log(res);
+            this.$message({
+              message: "保养完成",
+              type: "success"
+            });
           } else {
             this.$message({
               message: res.msg,
@@ -245,8 +236,8 @@ export default {
     this.tableHeight = height - 260;
   },
   mounted() {
-    var mouldId = this.$route.params.id; //传到当前页面的模具编号
-    // this.getList();
+    this.mouldId = this.$route.params.id; //传到当前页面的模具编号
+    this.getList();
   }
 };
 </script>