Explorar o código

代办详情页更新

guoqing %!s(int64=2) %!d(string=hai) anos
pai
achega
d143bfc213

+ 9 - 11
src/views/activityMan/nonReligiousInformation/nonReligiousInformationView.vue

@@ -185,10 +185,6 @@ export default {
       placeSelectType6: "",
       placeDetailed: "",
       reportingTime: "",
-      participants: {
-        id: "",
-        name: "",
-      },
       eventContent: "",
       state: "0",
       assessment: "0",
@@ -205,13 +201,15 @@ export default {
           .queryById(route.query.id)
           .then((data) => {
             inputForm.value = data;
-            let ids = data.participants.id.split(",");
-            inputForm.value.participants.name = "";
-            ids.forEach((item) => {
-              new UserManage().queryById(item).then((data) => {
-                inputForm.value.participants.name += data.name + ",";
-              });
-            });
+
+            inputForm.value.siteName.name=inputForm.value.siteName.organizationName;
+
+            Categories.value.forEach((item) => {
+              if(item.id==inputForm.value.nonReligiousCategories){
+                inputForm.value.nonReligiousCategoriesname = item.name;   
+              }              
+            });            
+            
             contentEditor.value.init(inputForm.value.eventContent);
             
             isLoading.value = false;

+ 23 - 8
src/views/activityMan/placeactivity/placeActivityInfo.vue

@@ -141,11 +141,10 @@
             <van-uploader
               v-show="fileList.length != 0"
               v-model="fileList"
-              :max-count="1"
+              :max-count="fileList.length"
+              :deletable="false"
+              @click-preview="downHandle"
             >
-              <template #preview-cover="file">
-                <div class="preview-cover van-ellipsis">{{ file.name }}</div>
-              </template>
             </van-uploader>
           </template>
         </van-field>
@@ -254,10 +253,12 @@ export default {
         placeActivity.value.safetyPlan.split("|").forEach((item) => {
           if (item.trim().length > 0) {
             fileList.value.push({
-              name: decodeURIComponent(
-                item.substring(item.lastIndexOf("/") + 1)
-              ),
-              url: $base + item,
+              file: {
+                name: decodeURIComponent(
+                  item.substring(item.lastIndexOf("/") + 1)
+                ),
+              },
+              url: $base + item.replace("程序附件//", "程序附件/"),
             });
           }
         });
@@ -273,6 +274,19 @@ export default {
         }
       });
     };
+    /**
+     * 下载文件 网页端可用
+     */
+    const downHandle = (fileObj) => {
+      // 声明a标签
+      const aEle = document.createElement("a");
+      // 设置下载文件名
+      aEle.download = fileObj.file.name;
+      // 下载地址
+      aEle.href = fileObj.content;
+      // 调用下载
+      aEle.click();
+    };
     // 审核通过
     const update = () => {
       xm.showConfirm({
@@ -296,6 +310,7 @@ export default {
       onClickLeft,
       placeActivity,
       fileList,
+      downHandle,
       isLoading,
       update,
       subjectContentEditor,

+ 45 - 12
src/views/activityMan/placeactivity/placeActivityView.vue

@@ -206,7 +206,9 @@
               :max-count="5"
               capture="camera"
               accept=""
+              :preview-full-image="false"
               :before-delete="deleteRead"
+              @click-preview="downHandle"
             >
               <van-button>上传文件</van-button>
             </van-uploader>
@@ -309,11 +311,21 @@ export default {
           });
           placeActivity.value.safetyPlan.split("|").forEach((item) => {
             if (item.trim().length > 0) {
+              fileupList.value.push({
+                file: {
+                  name: decodeURIComponent(
+                    item.substring(item.lastIndexOf("/") + 1)
+                  ),
+                },
+                url: item,
+              });
               fileList.value.push({
-                name: decodeURIComponent(
-                  item.substring(item.lastIndexOf("/") + 1)
-                ),
-                url: $base + item,
+                file: {
+                  name: decodeURIComponent(
+                    item.substring(item.lastIndexOf("/") + 1)
+                  ),
+                },
+                url: $base + item.replace("程序附件//", "程序附件/"),
               });
             }
           });
@@ -390,26 +402,33 @@ export default {
     let fileList = ref([]);
     let fileupList = ref([]);
     const afterRead = (file) => {
+      file.status = "uploading";
+      file.message = "上传中";
       // 此时可以自行将文件上传至服务器
       new tools()
         .uploadFile(file, `reporting/reportingActivities`)
         .then(({ data, status, statusText }) => {
           if (status == 200 || statusText == "OK") {
-            xm.showToast({
-              message: "上传成功",
-            });
+            file.status = "done";
+            // xm.showToast({
+            //   message: "上传成功",
+            // });
             data.name = decodeURIComponent(
               data.url.substring(data.url.lastIndexOf("/") + 1)
             );
             fileupList.value.push(data);
           }
+        })
+        .catch(() => {
+          file.status = "failed";
+          file.message = "上传失败";
         });
     };
     // 删除文件
     const deleteRead = (file) => {
       //删除文件操作
       for (let index = 0; index < fileList.value.length; index++) {
-        if (file.file == fileList.value[index].file) {
+        if (file.file.name == fileList.value[index].file.name) {
           let delurl = fileupList.value[index].url;
           new tools().uploadFiledelete("", delurl).then(({ data }) => {});
           fileupList.value.splice(index, 1);
@@ -417,18 +436,31 @@ export default {
         }
       }
     };
+    /**
+     * 下载文件 网页端可用
+     */
+    const downHandle = (fileObj) => {
+      // 声明a标签
+      const aEle = document.createElement("a");
+      // 设置下载文件名
+      aEle.download = fileObj.file.name;
+      // 下载地址
+      aEle.href = fileObj.content;
+      // 调用下载
+      aEle.click();
+    };
     // 提交数据
     const submit = () => {
       isLoading.value = true;
       //保存前附件处理
-      siteInspection.enclosure = fileupList.value
+      placeActivity.value.safetyPlan = fileupList.value
         .map((option) => option.url)
         .join("|");
       new placeActivityServer().save(placeActivity.value).then((res) => {
         if (res.status == 200 || res.statusText == "OK") {
-          xm.showToast({
-            message: res.data,
-          });
+          // xm.showToast({
+          //   message: res.data,
+          // });
         }
         onClickLeft();
       });
@@ -457,6 +489,7 @@ export default {
       // 文件上传
       afterRead,
       deleteRead,
+      downHandle,
       fileList,
       submit,
       subjectContentEditor,

+ 1 - 0
src/views/activityMan/religiousConference/religiousConferenceView.vue

@@ -202,6 +202,7 @@ export default {
             });
             contentEditor.value.init(inputForm.value.meetingTopics);
             isLoading.value = false;
+            console.log(inputForm.value);
           });
       } else {
         contentEditor.value.init(inputForm.value.meetingTopics);

+ 56 - 16
src/views/activityMan/securityFacilitiesErr/securityFacilitiesErrView.vue

@@ -153,10 +153,13 @@
 </template>
 
 <script>
-import { reactive, ref } from "vue";
+import { reactive, ref, onMounted } from "vue";
 import personList from "../personList.vue";
 import securityFacilitiesErrService from "@/api/securityFacilitiesErr/securityFacilitiesErrService";
 import tools from "@/api/sys/tools";
+import { useRoute } from "vue-router";
+// 图片路径
+import $base from "@/utils/config";
 
 export default {
   components: { personList },
@@ -166,7 +169,7 @@ export default {
     const onClickLeft = () => {
       history.back();
     };
-    const info = reactive({
+    const info = ref({
       id: "",
       siteName: {
         id: "",
@@ -185,6 +188,43 @@ export default {
       state: "0",
       assessment: "0",
     });
+
+    // 根据路由初始化
+    let route = useRoute();
+    onMounted(() => {
+      if (route.query.id) {
+        new securityFacilitiesErrService().queryById(route.query.id).then((data) => {
+          info.value = data;    
+          if(info.value.facilityType=="1"){
+            info.value.facilityTypename="消防设备";
+          }else{
+            info.value.facilityTypename="监控、音频";
+          }
+
+          //附件处理      
+          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('程序附件//','程序附件/'),
+              });
+              fileupList.value.push({
+                name: decodeURIComponent(
+                  item.substring(item.lastIndexOf("/") + 1)
+                ),
+                url: item,
+              });
+            }
+          });
+
+          console.log(info.value);
+
+        });
+      }
+    });
+
     // 场所名称
     let places = ref([]);
     const customFieldName = {
@@ -203,7 +243,7 @@ export default {
     const getPlace = ({ selectedOptions }) => {
       if(selectedOptions[0]!=undefined&&selectedOptions[0]!=null){ 
         showPlace.value = false;
-        info.siteName = selectedOptions[0];
+        info.value.siteName = selectedOptions[0];
         //场所选择完成后刷新
         getVideoAudioList();
         getFireStationList();
@@ -214,8 +254,8 @@ export default {
     const facilityTypes = [{text:"监控、音频",value:"0"},{text:"消防设备",value:"1"}];
     const getfacilityType= ({ selectedOptions }) => {     
       if(selectedOptions[0]!=undefined&&selectedOptions[0]!=null){  
-        info.facilityType = selectedOptions[0].value;
-        info.facilityTypename = selectedOptions[0].text;
+        info.value.facilityType = selectedOptions[0].value;
+        info.value.facilityTypename = selectedOptions[0].text;
         getVideoAudioList();
         getFireStationList();
         showLx.value = false;
@@ -227,12 +267,12 @@ export default {
     let VideoAudios = ref([]);
     //同时选择好场所、设施类型后才获取视频列表
     const getVideoAudioList= () => {    
-      if(info.siteName.id!=""&&info.facilityType=="0"){
+      if(info.value.siteName.id!=""&&info.value.facilityType=="0"){
         new tools()
         .videoPointList({
           current: 1,
           size: 10000,
-          siteId: info.siteName.id,
+          siteId: info.value.siteName.id,
         })
         .then(({ records }) => {
           VideoAudios.value=records;
@@ -242,8 +282,8 @@ export default {
     };
     const setVideoAudios= ({ selectedOptions }) => {    
       if(selectedOptions[0]!=undefined&&selectedOptions[0]!=null){
-        info.videoAudioPoint = selectedOptions[0];
-        info.position=selectedOptions[0].position;
+        info.value.videoAudioPoint = selectedOptions[0];
+        info.value.position=selectedOptions[0].position;
         showVideoAudio.value = false;
       }            
     };
@@ -254,12 +294,12 @@ export default {
     let FireStations = ref([]);
     //同时选择好场所、设施类型后才获取消防点位列表
     const getFireStationList= () => {    
-      if(info.siteName.id!=""&&info.facilityType=="1"){
+      if(info.value.siteName.id!=""&&info.value.facilityType=="1"){
         new tools()
         .fireStationList({
           current: 1,
           size: 10000,
-          siteId: info.siteName.id,
+          siteId: info.value.siteName.id,
         })
         .then(({ records }) => {
           FireStations.value=records;
@@ -269,8 +309,8 @@ export default {
     };
     const setFireStations= ({ selectedOptions }) => {     
       if(selectedOptions[0]!=undefined&&selectedOptions[0]!=null){ 
-        info.siteFireProtection = selectedOptions[0];
-        info.position=selectedOptions[0].position;
+        info.value.siteFireProtection = selectedOptions[0];
+        info.value.position=selectedOptions[0].position;
         showFireStation.value = false;
       }
     };
@@ -313,15 +353,15 @@ export default {
     // 提交数据
     const submit = () => {
       //添加保存前判断
-      if(info.siteName.id==""){
+      if(info.value.siteName.id==""){
         window.xm.showToast({
           message:"请先选择场所信息!"
         })
       }else{
 
         //保存前附件处理
-        info.enclosure = fileupList.value.map((option) => option.url).join("|");
-        new securityFacilitiesErrService().save(info).then((res) => {
+        info.value.enclosure = fileupList.value.map((option) => option.url).join("|");
+        new securityFacilitiesErrService().save(info.value).then((res) => {
           if(res.data=="保存安防设施异常成功"){
             window.xm.showToast({
               message:"保存成功!"

+ 39 - 9
src/views/activityMan/siteInspection/siteInspectionView.vue

@@ -130,9 +130,10 @@
 </template>
 
 <script>
-import { reactive, ref } from "vue";
+import { reactive, ref , onMounted} from "vue";
 import personList from "../personList.vue";
 import siteInspectionService from "@/api/siteInspection/siteInspectionService";
+import { useRoute } from "vue-router";
 import tools from "@/api/sys/tools";
 // 图片路径
 import $base from "@/utils/config";
@@ -144,7 +145,7 @@ export default {
     const onClickLeft = () => {
       history.back();
     };
-    const siteInspection = reactive({
+    const siteInspection = ref({
       id: "",
       siteName: {
         id: "",
@@ -158,6 +159,35 @@ export default {
       state: "0",
       assessment: "0",
     });
+
+    // 根据路由初始化
+    let route = useRoute();
+    onMounted(() => {
+      if (route.query.id) {
+        new siteInspectionService().queryById(route.query.id).then((data) => {
+          siteInspection.value = data;    
+          //附件处理      
+          siteInspection.value.enclosure.split("|").forEach((item) => {
+            if (item.trim().length > 0) {
+              fileList.value.push({
+                name: decodeURIComponent(
+                  item.substring(item.lastIndexOf("/") + 1)
+                ),
+                url: $base + item.replace('程序附件//','程序附件/'),
+              });
+              fileupList.value.push({
+                name: decodeURIComponent(
+                  item.substring(item.lastIndexOf("/") + 1)
+                ),
+                url: item,
+              });
+            }
+          });
+
+        });
+      }
+    });
+
     // 场所名称
     let places = ref([]);
     const customFieldName = {
@@ -176,8 +206,8 @@ export default {
     const getPlace = ({ selectedOptions }) => {
       if(selectedOptions[0]!=undefined&&selectedOptions[0]!=null){ 
         showPlace.value = false;
-        siteInspection.siteName = selectedOptions[0];
-        siteInspection.place = selectedOptions[0].placeSelectName
+        siteInspection.value.siteName = selectedOptions[0];
+        siteInspection.value.place = selectedOptions[0].placeSelectName
       }
     };
     // 获取督查时间
@@ -187,7 +217,7 @@ export default {
     const columnsType = ['hour', 'minute', 'second'];
     const getTime = () => {
       showAct.value = false;
-      siteInspection.supervisionTime = `${currentDate.value.join(
+      siteInspection.value.supervisionTime = `${currentDate.value.join(
         "-"
       )} ${currentTime.value.join(":")}`;
     };
@@ -213,7 +243,7 @@ export default {
     const onFinish = ({ selectedOptions }) => {
       if(selectedOptions[0]!=undefined&&selectedOptions[0]!=null){ 
         showArea.value = false;
-        siteInspection.place = selectedOptions
+        siteInspection.value.place = selectedOptions
           .map((option) => option.name)
           .join("/");
       }
@@ -256,15 +286,15 @@ export default {
     // 提交数据
     const submit = () => {
       //添加保存前判断
-      if(siteInspection.siteName.id==""){
+      if(siteInspection.value.siteName.id==""){
         window.xm.showToast({
           message:"请先选择场所信息!"
         })
       }else{
 
         //保存前附件处理
-        siteInspection.enclosure = fileupList.value.map((option) => option.url).join("|");
-        new siteInspectionService().save(siteInspection).then((res) => {
+        siteInspection.value.enclosure = fileupList.value.map((option) => option.url).join("|");
+        new siteInspectionService().save(siteInspection.value).then((res) => {
           if(res.data=="保存场所检查情况成功"){
             window.xm.showToast({
               message:"保存成功!"