From fab4d7d62b2039ab8660649d26a8c6f8f32193b5 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 11 一月 2024 17:41:11 +0800
Subject: [PATCH] 1. 初步完成评估任务整体逻辑; 2. 新增评估记录下载功能(待完善)

---
 src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue |  206 +++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 148 insertions(+), 58 deletions(-)

diff --git a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
index 9217bc3..c098e85 100644
--- a/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
+++ b/src/views/fysp/evaluation/components/precheck/components/CompCheckSource.vue
@@ -3,50 +3,57 @@
     <template #header>
       <div><el-text tag="b" size="large">鏁版嵁婧愭鏌�</el-text></div>
       <el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
+      <el-text size="small" type="info">妫�鏌ヨ瘎浼版墍闇�鏁版嵁婧愭槸鍚﹀畬鏁�</el-text>
     </template>
     <FormCol>
-      <el-form-item align="middle" v-for="(v, i) in checkResults" :key="i">
-        <el-col :span="14">
-          <el-row align="middle">
-            <el-text size="default" :class="v.required ? 'required' : 'not-required'">*</el-text>
-            <el-text size="default" class="m-l-4">{{ v.name }}</el-text>
-          </el-row>
-        </el-col>
-        <el-col :span="5">
-          <el-row align="middle">
-            <el-space>
-              <template v-if="v.loading">
-                <el-icon class="is-loading"><Loading /></el-icon>
-                <el-text size="default" type="default">妫�鏌ヤ腑...</el-text>
-              </template>
-              <template v-else-if="v.pass == true">
-                <el-icon color="var(--el-color-success)"><Check /></el-icon>
-                <el-text size="default" type="success">閫氳繃</el-text>
-              </template>
-              <template v-else-if="v.pass == false">
-                <el-icon color="var(--el-color-danger)"><Close /></el-icon>
-                <el-text size="default" type="danger">缂哄け</el-text>
-              </template>
-              <template v-else>
-                <el-icon color="var(--el-color-warning)"><Warning /></el-icon>
-                <el-text size="default" type="warning">鏆傜暐杩�</el-text>
-              </template>
-            </el-space>
-          </el-row>
-        </el-col>
-        <el-col :span="5">
-          <el-button
-            v-if="!v.pass"
-            type="primary"
-            size="small"
-            @click="goto(v.path)"
-            :disabled="v.path == ''"
-          >
-            鍘诲畬鍠�
-            <el-icon class="m-l-4"><Right /></el-icon>
-          </el-button>
-        </el-col>
-      </el-form-item>
+      <template v-for="(v, i) in checkResults" :key="i">
+        <el-row class="h-small" align="middle">
+          <el-col :span="14">
+            <el-row align="middle">
+              <el-text size="default" :class="v.required ? 'required' : 'not-required'">*</el-text>
+              <el-text size="default" class="m-l-4">{{ v.name }}</el-text>
+            </el-row>
+          </el-col>
+          <el-col :span="5">
+            <el-row align="middle">
+              <el-space>
+                <template v-if="v.loading">
+                  <el-icon class="is-loading"><Loading /></el-icon>
+                  <el-text size="default" type="default">妫�鏌ヤ腑...</el-text>
+                </template>
+                <template v-else-if="v.pass == true">
+                  <el-icon color="var(--el-color-success)"><Check /></el-icon>
+                  <el-text size="default" type="success">閫氳繃</el-text>
+                </template>
+                <template v-else-if="v.pass == false">
+                  <el-icon color="var(--el-color-danger)"><Close /></el-icon>
+                  <el-text size="default" type="danger">缂哄け</el-text>
+                </template>
+                <template v-else>
+                  <el-icon color="var(--el-color-warning)"><Warning /></el-icon>
+                  <el-text size="default" type="warning">鏆傜暐杩�</el-text>
+                </template>
+              </el-space>
+            </el-row>
+          </el-col>
+          <el-col :span="5">
+            <el-button
+              v-show="!v.loading"
+              :type="v.pass ? '' : 'danger'"
+              size="small"
+              @click="goto(v.path)"
+              :disabled="v.path == ''"
+            >
+              {{ v.pass ? '鍘讳慨鏀�' : '鍘诲畬鍠�' }}
+              <el-icon class="m-l-4"><Right /></el-icon>
+            </el-button>
+          </el-col>
+        </el-row>
+        <el-row align="middle" class="m-b-16">
+          <el-text size="small" class="not-required">*</el-text>
+          <el-text size="small" class="m-l-4 color-i">{{ v.des }}</el-text>
+        </el-row>
+      </template>
     </FormCol>
     <template #footer>
       <el-row justify="space-around">
@@ -62,6 +69,9 @@
 <script>
 import evaluateApi from '@/api/fysp/evaluateApi';
 import taskApi from '@/api/fysp/taskApi';
+import userMapApi from '@/api/fysp/userMapApi';
+import problemApi from '@/api/fysp/problemApi';
+import complaintApi from '@/api/fytz/complaintApi';
 
 /**
  * 鐢熸垚涓�椤规暟鎹簮妫�鏌ヨ褰�
@@ -77,10 +87,13 @@
     loading: true,
     pass: false,
     path: _path,
+    des: '',
     async fetch() {
       this.loading = true;
       setTimeout(async () => {
-        this.pass = await _fetch();
+        const res = await _fetch();
+        this.pass = res ? res.pass : undefined;
+        this.des = res ? res.des : undefined;
         this.loading = false;
       }, 1000);
     }
@@ -98,34 +111,95 @@
   emits: ['update:modelValue'],
   data() {
     return {
-      areaInfo: {
-        _locations: '',
-        _scenetype: '',
-        time: '',
-        sourcetype: ''
-      },
+      areaInfo: {},
       // 鏁版嵁婧愭鏌ヨ褰�
       checkResults: [
+        // 鍖哄煙鑼冨洿鍐呯殑鑷姩璇勪及瑙勫垯琛ㄦ槸鍚﹀瓨鍦�
         baseCheckItem(
           '鑷姩璇勪及瑙勫垯琛�',
           '',
           () => {
             const param = {
               taskTypeId: 99,
-              scensetypeid: this.areaInfo._scenetype.value
+              ...this.areaInfo
             };
             return evaluateApi.fetchEvaluationRule(param).then((res) => {
-              return res.data.length > 0;
+              const pass = res.data.length > 0;
+              let des = '';
+              if (pass) {
+                res.data.forEach((e) => {
+                  if (des != '') {
+                    des += '銆�';
+                  }
+                  des += `銆�${e.rulename}銆媊;
+                });
+              } else {
+                des = '鏈壘鍒扮浉鍏宠瘎浼拌鍒欒〃';
+              }
+              return { pass, des };
             });
           },
           true
         ),
-        baseCheckItem('鐜板満鐩戠宸℃煡鎬讳换鍔�', '', () => {}),
+        // 鍖哄煙鑼冨洿鍐呯殑鐩戠浠诲姟鏄惁瀛樺湪
+        baseCheckItem('鐜板満鐩戠宸℃煡鎬讳换鍔�', '', () => {
+          return taskApi.fetchTopTasks(this.areaInfo).then((res) => {
+            const pass = res.data.length > 0;
+            let des = '';
+            if (pass) {
+              res.data.forEach((e) => {
+                if (des != '') {
+                  des += '銆�';
+                }
+                des += e.name;
+              });
+            } else {
+              des = '鏈壘鍒扮浉鍏冲贰鏌ユ�讳换鍔�';
+            }
+            return { pass, des };
+          });
+        }),
+        // 鍖哄煙鑼冨洿鍐呯殑鐩戞祴鏁版嵁鏄惁瀛樺湪銆佹暟鎹椂闂磋法搴︽槸鍚﹀畬鏁淬�佹暟鎹殑鍒濇鍒嗘瀽鏄惁瀹屾垚
         baseCheckItem('鐜板満鐩戞祴鏁版嵁', '', () => {}),
-        baseCheckItem('鐩戠鐐逛綅涓庣洃娴嬬偣鍖归厤', '', () => {}),
-        baseCheckItem('鐜板満鐩戠闂绫诲瀷', '', () => {}),
-        baseCheckItem('淇¤鎶曡瘔', '', () => {}),
-        baseCheckItem('琛屾斂澶勭綒', '', () => {})
+        // 鍖哄煙鑼冨洿鍐呯殑姣忎釜鐩戠鐐逛綅涓庣洃娴嬩华鍣ㄧ殑鍖归厤璁板綍鏄惁瀛樺湪锛岀己澶辨儏鍐电瓑
+        baseCheckItem('鐩戠鐐逛綅涓庣洃娴嬬偣鍖归厤', '', () => {
+          return userMapApi.fetchDeviceMap(this.areaInfo).then((res) => {
+            const pass = res.data.length > 0;
+            let des = '';
+            if (pass) {
+              des = `鎵惧埌鍖归厤璁板綍鍏�${res.data.length}鏉;
+            } else {
+              des = '鏈壘鍒扮浉鍏冲尮閰嶈褰�';
+            }
+            return { pass, des };
+          });
+        }),
+        // 鍖哄煙鑼冨洿鍐呯殑鐩戠闂閰嶇疆琛ㄦ槸鍚﹀瓨鍦�
+        baseCheckItem('鐜板満鐩戠闂绫诲瀷', '', () => {
+          const param = {
+            cityCode: this.areaInfo.citycode,
+            districtCode: this.areaInfo.districtcode,
+            sceneTypeId: this.areaInfo.scensetypeid
+          };
+          return problemApi.fetchProblemType(param).then((res) => {
+            const pass = res.length > 0;
+            let des = '';
+            if (pass) {
+              des = `鎵惧埌闂绫诲瀷鍏�${res.length}鏉;
+            } else {
+              des = '鏈壘鍒扮浉鍏抽棶棰樼被鍨�';
+            }
+            return { pass, des };
+          });
+        }),
+        // 鍖哄煙鑼冨洿鍐呯殑淇¤鎶曡瘔璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
+        baseCheckItem('淇¤鎶曡瘔', '', () => {
+          // complaintApi.fetchComplaints();
+        }),
+        // 鍖哄煙鑼冨洿鍐呯殑琛屾斂澶勭綒璁板綍鏄惁瀛樺湪锛屽彲闅忔椂琛ュ厖
+        baseCheckItem('琛屾斂澶勭綒', '', () => {
+          // complaintApi.fetchPunishment();
+        })
       ]
     };
   },
@@ -162,8 +236,24 @@
       }
     },
     // 寮�濮嬫鏌ヤ换鍔�
-    startCheck(v) {
-      this.areaInfo = v;
+    startCheck(value) {
+      // const v = value.value;
+      // this.areaInfo = {
+      //   provincecode: v._locations.pCode,
+      //   provincename: v._locations.pName,
+      //   citycode: v._locations.cCode,
+      //   cityname: v._locations.cName,
+      //   districtcode: v._locations.dCode,
+      //   districtname: v._locations.dName,
+      //   towncode: v._locations.tCode,
+      //   townname: v._locations.tName,
+      //   starttime: this.$fm.formatYMDH(v.time),
+      //   scensetypeid: v._scenetype.value,
+      //   online: true,
+      //   sourceType: v.sourceType
+      // };
+      this.areaInfo = value
+
       this.checkResults.forEach((e) => {
         e.fetch();
       });

--
Gitblit v1.9.3