Kaynağa Gözat

快捷审核数据展示问题

yuanmingze 5 ay önce
ebeveyn
işleme
6f1afc4032

+ 2 - 2
.env.development

@@ -1,10 +1,10 @@
 NODE_ENV = 'development'
 VUE_APP_TYPE= 'dev'
-VUE_APP_URL = 'http://10.144.62.235:9999'
+# VUE_APP_URL = 'http://10.144.62.235:9999'
 # VUE_APP_URL = 'https://mic.freerr.cn'
 # VUE_APP_URL = 'https://mic.cnbg.com.cn'
 # VUE_APP_URL = 'https://cnbg.yaoyi.net'
 # VUE_APP_URL = 'http://192.168.110.25:9999'
-# VUE_APP_URL = 'https://mic-t.cnbg.com.cn'
+VUE_APP_URL = 'https://mic-t.cnbg.com.cn'
 
 

+ 4 - 10
jsconfig.json

@@ -5,15 +5,9 @@
     "baseUrl": "./",
     "moduleResolution": "node",
     "paths": {
-      "@/*": [
-        "src/*"
-      ]
+      "@/*": ["src/*"]
     },
-    "lib": [
-      "esnext",
-      "dom",
-      "dom.iterable",
-      "scripthost"
-    ]
-  }
+    "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
+  },
+  "include": ["src/**/*"]
 }

+ 65 - 4
src/views/serviceManagement/quickReview/index.vue

@@ -351,8 +351,8 @@ export default {
         nodeId = 1;
     }
 
-    const currentYear = dayjs().format('YYYY');
-    this.searchFrom.year = currentYear;
+    const lastYear = dayjs().subtract(1, 'year').format('YYYY');
+    this.searchFrom.year = lastYear;
     this.nodeId = nodeId;
     this.searchFrom.nodeId = nodeId;
     this.getList();
@@ -442,6 +442,15 @@ export default {
               show: true
             };
             item.reviewInfo = reviewInfo;
+            item?.info?.configs?.forEach((iten) => {
+              iten.taskFiledType = iten.taskFiledType.trim();
+              if (iten.taskFiledType == 'img') {
+                console.log('item.info.taskContent', item.info.taskContent);
+                console.log('item.info.iten', iten);
+
+                this.getImgList(item.info.taskContent[iten.taskFiledKey], iten);
+              }
+            });
           });
           this.list.push(...list);
           this.$forceUpdate();
@@ -541,6 +550,56 @@ export default {
       let curr = this.taskTypeAvailArr.find((item) => item.id == taskType);
       return curr.name;
     },
+
+    getPreviewList(imgList, index) {
+      // 解决el-image大图预览定位图片不准确的问题
+      return imgList.slice(index).concat(imgList.slice(0, index));
+    },
+    getImgList(urlStr, item) {
+      console.log('urlStr', urlStr);
+      console.log('item', item);
+
+      // 如果类型不匹配或者 urlStr 为空,直接返回
+      if (item.taskFiledType !== 'img' || !urlStr) return '';
+
+      // 缓存环境变量中的基础 URL
+      const { VUE_APP_URL } = process.env;
+
+      // 以逗号分割,并过滤掉空字符串
+      const imgArray = urlStr.split(',').filter(Boolean);
+      if (!imgArray.length) return '';
+
+      // 生成包含 type 和 url 的数组
+      const imgList = imgArray.map((originalUrl) => {
+        let type = '无';
+        let url = originalUrl;
+
+        if (url.includes(';1')) {
+          type = '拍照';
+          url = url.replace(';1', '');
+        } else if (url.includes(';2')) {
+          type = '相册';
+          url = url.replace(';2', '');
+        }
+
+        return {
+          type,
+          url: VUE_APP_URL + url
+        };
+      });
+
+      // 提取预览图片的 URL 列表
+      const previewList = imgList.map((item) => item.url);
+
+      // 将处理结果赋值给对应字段
+      item.imgList = imgList;
+
+      item.previewList = previewList;
+
+      // 函数约定返回空字符串
+      return '';
+    },
+
     getDesc(curr, item) {
       // 拜访类任务
       const arr = ['51', '52', '53'];
@@ -664,11 +723,13 @@ export default {
             const res = await taskV2CheckBatchApi(obj);
             if (res.data.code === 0 && res.data.data) {
               this.$message.success('审核成功!');
+
               this.handleClose();
               this.list.forEach((item) => {
                 if (item.reviewInfo.checked) {
-                  console.log('item', item);
-
+                  this.checkAllLength = 0;
+                  this.checkAllTaskScore;
+                  item.reviewInfo.checked = false;
                   item.reviewInfo.show = false;
                 }
               });

+ 2 - 0
src/views/serviceManagement/servicesToBeReviewed/components/TaskDetail.vue

@@ -196,6 +196,8 @@ export default {
             let imgArr = this.getImgList(this.wmTaskContent[item.taskFiledKey], item);
             item.imgList = imgArr[0];
             item.previewList = imgArr[1];
+
+            console.log('item', item);
           }
         });
       } catch (e) {

+ 4 - 3
src/views/serviceManagement/servicesToBeReviewed/index.vue

@@ -102,7 +102,7 @@
         highlight-hover-row
         height="auto"
         empty-text="暂无匹配数据"
-        :loading="tableLoading"
+        v-loading="tableLoading"
         :data="tableData"
         :scroll-y="{ enabled: false }"
         :scroll-x="{ enabled: true }"
@@ -305,8 +305,9 @@ export default {
         nodeId = 1;
     }
 
-    const currentYear = dayjs().format('YYYY');
-    this.searchFrom.year = currentYear;
+    const lastYear = dayjs().subtract(1, 'year').format('YYYY');
+
+    this.searchFrom.year = lastYear;
     this.nodeId = nodeId;
     this.searchFrom.nodeId = nodeId;
     this.getList();