Quellcode durchsuchen

待办详情页更新

guoqing vor 2 Jahren
Ursprung
Commit
752a0e5a1f

+ 3 - 1
src/utils/config.js

@@ -4,7 +4,9 @@ if (process.env.NODE_ENV === 'development') {
     // 开发环境
     //APP_SERVER_URL = 'http://192.168.139.110:8084'
     //APP_SERVER_URL = 'http://192.168.139.74:8080'
-    APP_SERVER_URL = 'http://localhost:8084'
+    APP_SERVER_URL = 'http://192.168.139.77:8084'
+    //APP_SERVER_URL = 'http://localhost:8084'
+    
 } else {
     // 生产环境
     APP_SERVER_URL = 'http://123.57.226.179:8010/hs'

+ 29 - 2
src/views/activityMan/securityFacilitiesErr/securityFacilitiesErrInfo.vue

@@ -80,6 +80,7 @@
                 :max-count="fileList.length"
                 capture="camera"
                 accept=""
+                @click-preview="downHandle"
               >
               </van-uploader>
             </template>
@@ -140,15 +141,40 @@
 
           info.value.enclosure.split("|").forEach((item) => {
             if (item.trim().length > 0) {
+              // fileList.value.push({
+              //   name: decodeURIComponent(item.substring(item.lastIndexOf("/") + 1)),
+              //   url: $base + item.replace('程序附件//','程序附件/'),
+              // });
+
               fileList.value.push({
-                name: decodeURIComponent(item.substring(item.lastIndexOf("/") + 1)),
-                url: $base + item.replace('程序附件//','程序附件/'),
+                file: {
+                  name: decodeURIComponent(
+                    item.substring(item.lastIndexOf("/") + 1)
+                  ),
+                },
+                url: $base + item.replace("程序附件//", "程序附件/"),
               });
             }
           });
           isLoading.value = false;
         });
       });
+      /**
+     * 下载文件 网页端可用
+     */
+      const downHandle = (fileObj) => {
+        if(!(fileObj.file.name.includes(".jpg")||fileObj.file.name.includes(".jpeg")||fileObj.file.name.includes(".png"))){
+          // 声明a标签
+          const aEle = document.createElement("a");
+          // 设置下载文件名
+          aEle.download = fileObj.file.name;
+          // 下载地址
+          aEle.href = fileObj.url;
+          // 调用下载
+          aEle.click();
+        }
+        
+      };
 
       // 审核通过
       const update = () => {
@@ -169,6 +195,7 @@
         onClickLeft,
         info,
         fileList,
+        downHandle,
         isLoading,
         update,
       };

+ 34 - 4
src/views/activityMan/siteInspection/siteInspectionInfo.vue

@@ -70,6 +70,7 @@
               :max-count="fileList.length"
               capture="camera"
               accept=""
+              @click-preview="downHandle"
             >
             </van-uploader>
           </template>
@@ -124,17 +125,45 @@
           info.value.enclosure.split("|").forEach((item) => {
             console.log(item);
             if (item.trim().length > 0) {
+              // fileList.value.push({
+              //   name: decodeURIComponent(
+              //     item.substring(item.lastIndexOf("/") + 1)
+              //   ),
+              //   url: $base + item.replace('程序附件//','程序附件/'),
+              // });
+
+
               fileList.value.push({
-                name: decodeURIComponent(
-                  item.substring(item.lastIndexOf("/") + 1)
-                ),
-                url: $base + item.replace('程序附件//','程序附件/'),
+                file: {
+                  name: decodeURIComponent(
+                    item.substring(item.lastIndexOf("/") + 1)
+                  ),
+                },
+                url: $base + item.replace("程序附件//", "程序附件/"),
               });
+
             }
           });
           isLoading.value = false;
         });
       });
+
+      /**
+     * 下载文件 网页端可用
+     */
+    const downHandle = (fileObj) => {
+      if(!(fileObj.file.name.includes(".jpg")||fileObj.file.name.includes(".jpeg")||fileObj.file.name.includes(".png"))){
+        // 声明a标签
+        const aEle = document.createElement("a");
+        // 设置下载文件名
+        aEle.download = fileObj.file.name;
+        // 下载地址
+        aEle.href = fileObj.url;
+        // 调用下载
+        aEle.click();
+      }
+      
+    };
       
       // 审核通过
       const update = () => {
@@ -155,6 +184,7 @@
         onClickLeft,
         info,
         fileList,
+        downHandle,
         isLoading,
         update,
       };

+ 2 - 2
src/views/toBeDone/toBeDone_details.vue

@@ -153,7 +153,7 @@
             </template>
           </van-field>
         </van-cell-group>
-        <van-cell-group class="upload">
+        <van-cell-group class="upload" v-if="PersonInfo.data.assignState == '1' || PersonInfo.data.assignState == '2'">
           <van-field name="uploader" label-align="top" label="处理证据资料:">
             <template #input>
               <van-uploader
@@ -171,7 +171,7 @@
         </van-cell-group>
       </div>
     </div>
-     <van-button type="primary" @click="submit" class="btn-sub">确认</van-button>
+     <van-button v-if="PersonInfo.data.assignState == '1' || PersonInfo.data.assignState == '2'" type="primary" @click="submit" class="btn-sub">确认</van-button>
   </div>