|  | @@ -111,17 +111,23 @@
 | 
	
		
			
				|  |  |          </van-popup>
 | 
	
		
			
				|  |  |        </van-cell-group>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -      
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |        <van-cell-group>
 | 
	
		
			
				|  |  |          <van-field name="uploader" label="附件:">
 | 
	
		
			
				|  |  |            <template #input>
 | 
	
		
			
				|  |  | -            <van-uploader>
 | 
	
		
			
				|  |  | +            <van-uploader
 | 
	
		
			
				|  |  | +              :after-read="afterRead"
 | 
	
		
			
				|  |  | +              v-model="fileList"
 | 
	
		
			
				|  |  | +              :max-count="6"
 | 
	
		
			
				|  |  | +              capture="camera"
 | 
	
		
			
				|  |  | +              accept=""
 | 
	
		
			
				|  |  | +              :before-delete="fjdelete"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  |                <van-button icon="plus">上传文件</van-button>
 | 
	
		
			
				|  |  |              </van-uploader>
 | 
	
		
			
				|  |  |            </template>
 | 
	
		
			
				|  |  |          </van-field>
 | 
	
		
			
				|  |  |        </van-cell-group>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        <van-cell-group>
 | 
	
		
			
				|  |  |          <div class="rowTextArea">
 | 
	
		
			
				|  |  |            <van-field
 | 
	
	
		
			
				|  | @@ -147,6 +153,7 @@ import { reactive, ref } from "vue";
 | 
	
		
			
				|  |  |  import personList from "../personList.vue";
 | 
	
		
			
				|  |  |  import securityFacilitiesErrService from "@/api/securityFacilitiesErr/securityFacilitiesErrService";
 | 
	
		
			
				|  |  |  import tools from "@/api/sys/tools";
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    components: { personList },
 | 
	
		
			
				|  |  |    setup() {
 | 
	
	
		
			
				|  | @@ -262,19 +269,63 @@ export default {
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +    // 文件上传
 | 
	
		
			
				|  |  | +    let fileList = ref([]);
 | 
	
		
			
				|  |  | +    let fileupList = ref([]);
 | 
	
		
			
				|  |  | +    const afterRead = (file) => {
 | 
	
		
			
				|  |  | +      // 此时可以自行将文件上传至服务器
 | 
	
		
			
				|  |  | +      new tools()
 | 
	
		
			
				|  |  | +        .uploadFile(file, `afssyc/securityFacilitiesErr`)
 | 
	
		
			
				|  |  | +        .then(({ data }) => {
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +          data.name = decodeURIComponent(
 | 
	
		
			
				|  |  | +            data.url.substring(
 | 
	
		
			
				|  |  | +              data.url.lastIndexOf("/") + 1
 | 
	
		
			
				|  |  | +            )
 | 
	
		
			
				|  |  | +          );
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +          //data.url = `${$base}` + data.url;    
 | 
	
		
			
				|  |  | +          fileupList.value.push(data);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +    const fjdelete = (file) => {
 | 
	
		
			
				|  |  | +      //删除文件操作
 | 
	
		
			
				|  |  | +      for (let index = 0; index < fileList.value.length; index++) {
 | 
	
		
			
				|  |  | +        if(file.file==fileList.value[index].file){
 | 
	
		
			
				|  |  | +          let delurl=fileupList.value[index].url;                   
 | 
	
		
			
				|  |  | +          new tools()
 | 
	
		
			
				|  |  | +            .uploadFiledelete("", delurl)
 | 
	
		
			
				|  |  | +            .then(({ data }) => {
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +          fileupList.value.splice(index,1);
 | 
	
		
			
				|  |  | +          fileList.value.splice(index,1); 
 | 
	
		
			
				|  |  | +        }        
 | 
	
		
			
				|  |  | +      }      
 | 
	
		
			
				|  |  | +    };
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |      // 提交数据
 | 
	
		
			
				|  |  |      const submit = () => {
 | 
	
		
			
				|  |  |        //添加保存前判断
 | 
	
		
			
				|  |  | +      if(siteInspection.siteName.id==""){
 | 
	
		
			
				|  |  | +        window.xm.showToast({
 | 
	
		
			
				|  |  | +          message:"请先选择场所信息!"
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +      }else{
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -      new securityFacilitiesErrService().save(securityFacilitiesErr).then((res) => {
 | 
	
		
			
				|  |  | -        if(res.data=="保存安防设施异常成功"){
 | 
	
		
			
				|  |  | -          window.xm.showToast({
 | 
	
		
			
				|  |  | -             message:"保存成功!"
 | 
	
		
			
				|  |  | -          })
 | 
	
		
			
				|  |  | -          history.back();
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        //保存前附件处理
 | 
	
		
			
				|  |  | +        siteInspection.enclosure = fileupList.value.map((option) => option.url).join("|");
 | 
	
		
			
				|  |  | +        new securityFacilitiesErrService().save(securityFacilitiesErr).then((res) => {
 | 
	
		
			
				|  |  | +          if(res.data=="保存安防设施异常成功"){
 | 
	
		
			
				|  |  | +            window.xm.showToast({
 | 
	
		
			
				|  |  | +              message:"保存成功!"
 | 
	
		
			
				|  |  | +            })
 | 
	
		
			
				|  |  | +            history.back();
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -      });
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        securityFacilitiesErr,
 | 
	
	
		
			
				|  | @@ -299,6 +350,12 @@ export default {
 | 
	
		
			
				|  |  |        FireStations,
 | 
	
		
			
				|  |  |        setFireStations,
 | 
	
		
			
				|  |  |        
 | 
	
		
			
				|  |  | +      // 文件上传
 | 
	
		
			
				|  |  | +      afterRead,
 | 
	
		
			
				|  |  | +      fileList,
 | 
	
		
			
				|  |  | +      fileupList,
 | 
	
		
			
				|  |  | +      fjdelete,
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        // 返回
 | 
	
		
			
				|  |  |        onClickLeft,
 | 
	
		
			
				|  |  |        submit,
 |