Guoxiaohuan 5 年之前
父節點
當前提交
3d168138d4
共有 3 個文件被更改,包括 59 次插入63 次删除
  1. 35 45
      src/views/appeal/appealDetail.vue
  2. 3 3
      src/views/appeal/index.vue
  3. 21 15
      src/views/strategy/index.vue

+ 35 - 45
src/views/appeal/appealDetail.vue

@@ -9,7 +9,7 @@
       <div class="title Micbold">未执行申诉单</div>
       <div class="nav MicrYaHei">
         <span>项目名称:{{localName}}</span>
-        <span>申请人:{{ applyUser||'--'}}</span>
+        <span>申请人:{{ $store.state.userInfo.username}}</span>
         <span>申请时间:{{dateNow||'--'}}</span>
       </div>
       <div
@@ -32,7 +32,7 @@
               v-for="item in options"
               :key="item.value"
               :label="item.label"
-              :value="item.value"
+              :value="item.label"
             ></el-option>
           </el-select>
         </span>
@@ -79,14 +79,13 @@ export default {
       ],
       value: "",
       detailObj: {},
-      souseArr: ["1576036336333_image.jpg", "1576036135588_image.jpg"],
+      souseArr: [],
       appealId: "",
       commandId: "",
       tableList: [],
       dateNow: "",
       applyUser: "",
-      localName: "",
-      id:""
+      localName: ""
     };
   },
   components: {
@@ -95,33 +94,6 @@ export default {
     UploadImg
   },
   methods: {
-    queryExecute(id) {
-      let params = {
-        postParams: {
-          criteria: {
-            id: id
-          }
-        }
-      };
-      queryChillerExecuteInfo(params).then(res => {
-        console.log(res)
-         this.detailObj = res.data[0]
-         this.dateNow = moment()
-          .locale("zh-cn")
-          .format("YYYY.MM.DD");
-        if (Object.keys(this.detailObj).length > 0) {
-          console.log(this.detailObj);
-          this.quertName(this.detailObj.applyUser);
-          let projects = this.$store.state.projects.projects;
-          projects.forEach(el => {
-            if (this.detailObj.projectId == el.id) {
-              this.localName = el.localName;
-            }
-          });
-        }
-        // console.log(this.appealsArr);
-      });
-    },
     formatterStr(str) {
       if (str) {
         return (
@@ -155,25 +127,32 @@ export default {
         }
       };
       queryChillerExecuteInfo(params).then(res => {
-        console.log(res)
+        const list = res.data || [{}, {}, {}];
+        this.tableList = Object.values(list[0]).map(i => i || {});
+        this.tableList[0].title = "当前运行状态";
+        this.tableList[1].title = "推送策略";
+        this.tableList[2].title = "执行策略";
       });
     },
     submission() {
+      // this.detailObj.applyUser
       let params = {
         postParams: {
           id: this.detailObj.id,
           commit: "apply",
-          updateUser: this.detailObj.applyUser, //申请人
-          applyUser: this.detailObj.applyUser, //申请人
-          judgement:
-            this.detailObj.recommend.evaluateStrategy ||
-            this.detailObj.recommend.remarks ||
-            "", //策略评价
+          updateUser: this.$store.state.userInfo.userId, //申请人
+          applyUser: this.$store.state.userInfo.userId, //申请人
+          // judgement:
+          //   this.detailObj.recommend.evaluateStrategy ||
+          //   this.detailObj.recommend.remarks ||
+          //   "", //策略评价
           reasonType: this.detailObj.reasonType, //申诉原因类型:策略原因;设备原因;其他
-          reason: this.reason, //具体申诉原因
-          pics: this.souseArr
+          reason: this.detailObj.reason, //具体申诉原因
+          pics: this.detailObj.souseArr
         }
       };
+      // console.log(params);
+      // return;
       updateWorkflow(params).then(res => {
         if (res.result == "success") {
           this.$message.success("申诉成功");
@@ -185,10 +164,21 @@ export default {
     }
   },
   mounted() {
-    this.id = this.$route.query.id
-    console.log(this.id)
-    this.queryExecute(this.id)
-   
+    this.detailObj = JSON.parse(this.$route.query.item);
+    this.dateNow = moment()
+      .locale("zh-cn")
+      .format("YYYY.MM.DD");
+    if (Object.keys(this.detailObj).length > 0) {
+      console.log(this.detailObj);
+      // return;
+      this.quertName(this.detailObj.applyUser);
+      let projects = this.$store.state.projects.projects;
+      projects.forEach(el => {
+        if (this.detailObj.projectId == el.id) {
+          this.localName = el.localName;
+        }
+      });
+    }
   }
 };
 </script>

+ 3 - 3
src/views/appeal/index.vue

@@ -159,7 +159,7 @@ export default {
           id: item.id,
           commit: type,
           roles: [1002],
-          updateUser: "594e95e50abc4b6c9bdda985d313c1b9"
+          updateUser: this.$store.state.userInfo.userId
         }
       };
       updateWorkflow(params).then(res => {
@@ -194,10 +194,10 @@ export default {
       }
     },
     menu(item) {
-      console.log(item)
+      console.log(item);
       this.$router.push({
         path: "/appeal/appealDetail",
-        query: {id:item.id }
+        query: { item: JSON.stringify(item) }
       });
     },
     init() {

+ 21 - 15
src/views/strategy/index.vue

@@ -9,7 +9,7 @@
         v-if="chillerIsNotExecutedCount"
       >今日已收到 {{chillerCount}} 条策略,其中有 {{chillerIsNotExecutedCount}} 条未执行</span>
       <span class="nav-text" v-else>今天已收到 {{chillerCommand.chillerCount || 0}} 条策略</span>
-      <span class="nav-look MicrYaHei" @click="showTodayStrategy = true">查看</span>
+      <span class="nav-look MicrYaHei" @click="lookSnapshot">查看</span>
     </div>
     <div class="strategyContainer">
       <div class="strate-left">
@@ -30,12 +30,12 @@
       </div>
       <div class="starte-right">
         <p class="strate-right-title">当前状态</p>
-        <water-unit :data="chillerOrg " :type=1></water-unit>
+        <water-unit :data="chillerOrg " :type="1"></water-unit>
         <animation-box
           v-if="chillerHourList.length>0"
           :data="chillerCommand"
           :chillerHourList="chillerHourList"
-          :chillerCommandQ='chillerCommandQ'
+          :chillerCommandQ="chillerCommandQ"
         ></animation-box>
       </div>
     </div>
@@ -59,15 +59,15 @@ export default {
       showTodayStrategy: false,
       tableData: [],
       chillerCommand: {},
-      chillerCommandQ:{},
-      chillerCount:0,
-      chillerIsNotExecutedCount :0,
+      chillerCommandQ: {},
+      chillerCount: 0,
+      chillerIsNotExecutedCount: 0,
       today: "",
       now: "",
       chillerOrg: {},
-      chillerOrgQ:{},
+      chillerOrgQ: {},
       chillerHourList: [],
-      chillerHourListQ:[],
+      chillerHourListQ: []
     };
   },
   components: {
@@ -77,6 +77,11 @@ export default {
     TodayStrategy
   },
   methods: {
+    lookSnapshot() {
+      this.showTodayStrategy = true;
+      this.getData();
+      console.log(this.$store.state.userId);
+    },
     formatTime() {
       let year = new Date().getFullYear();
       let month =
@@ -116,13 +121,14 @@ export default {
     },
     getChiller() {
       let params = {
-        getParams: {
-        }
+        getParams: {}
       };
       queryCommand(params).then(res => {
-        console.log(res)
-        this.chillerCount = res.chillerCount
-        this.chillerIsNotExecutedCount  = res.chillerIsNotExecutedCount?res.chillerIsNotExecutedCount:0
+        console.log(res);
+        this.chillerCount = res.chillerCount;
+        this.chillerIsNotExecutedCount = res.chillerIsNotExecutedCount
+          ? res.chillerIsNotExecutedCount
+          : 0;
         this.chillerOrg = res.chillerOrg;
         this.chillerCommand = res.chillerCommand;
         this.chillerHourList = res.chillerHourList;
@@ -139,6 +145,7 @@ export default {
       };
       getCommand(params).then(res => {
         this.tableData = res.content ? res.content : [];
+        console.log(this.tableData);
       });
     }
   },
@@ -150,8 +157,7 @@ export default {
     //    vm.getData()
     // },1500)
     this.getQuickData();
-    this.getChiller()
-    this.getData();
+    this.getChiller();
   }
 };
 </script>