|
|
|
@ -11,6 +11,7 @@ |
|
|
|
</div> |
|
|
|
<!-- 中间 --> |
|
|
|
<div class="warp_body"> |
|
|
|
<van-form @failed="onFailed"> |
|
|
|
<van-cell-group> |
|
|
|
<van-field |
|
|
|
v-model="submitData.planYear" |
|
|
|
@ -81,7 +82,8 @@ |
|
|
|
<div class="file-upload-center"> |
|
|
|
文件上传 <span>(不多于9张)</span> |
|
|
|
</div> |
|
|
|
<van-uploader v-model="data.fileListObj" max-count="9" class="file" :after-read="uploadFiles" multiple @oversize="onOversize" :before-delete="deleteFile" accept=".pdf"> |
|
|
|
<van-uploader v-model="data.fileListObj" max-count="9" class="file" :after-read="uploadFiles" |
|
|
|
multiple @oversize="onOversize" :before-delete="deleteFile" accept=".pdf"> |
|
|
|
<template #preview-cover="{ file }"> |
|
|
|
<div class="preview-cover van-ellipsis">{{ file.name }}</div> |
|
|
|
</template> |
|
|
|
@ -89,151 +91,170 @@ |
|
|
|
</div> |
|
|
|
</van-cell-group> |
|
|
|
<van-action-bar> |
|
|
|
<van-action-bar-button text="提交" @click="submit" /> |
|
|
|
<van-button round block type="info" native-type="submit" @click="submit123">提交</van-button> |
|
|
|
</van-action-bar> |
|
|
|
</van-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup name="register"> |
|
|
|
|
|
|
|
import { showSuccessToast,showLoadingToast,closeToast } from 'vant'; |
|
|
|
import {addEnforcementInspectionProgram,queryUserInfo} from '@/api/enforce' |
|
|
|
import {getDict} from '../../api/Home' |
|
|
|
import {uploadFile} from '../../util/fileUpload' |
|
|
|
import { reactive, ref } from "vue"; |
|
|
|
import { showConfirmDialog } from 'vant'; |
|
|
|
const { useCommon, useMy } = $globalStore; |
|
|
|
import {showSuccessToast, showLoadingToast, closeToast} from 'vant'; |
|
|
|
import {addEnforcementInspectionProgram, queryUserInfo} from '@/api/enforce' |
|
|
|
import {getDict} from '../../api/Home' |
|
|
|
import {uploadFile} from '../../util/fileUpload' |
|
|
|
import {reactive, ref} from "vue"; |
|
|
|
import {showConfirmDialog} from 'vant'; |
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
|
const route = useRoute(); |
|
|
|
let queryaddressId = ref(""); |
|
|
|
const data = reactive({ |
|
|
|
const {useCommon, useMy} = $globalStore; |
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
|
const route = useRoute(); |
|
|
|
let queryaddressId = ref(""); |
|
|
|
const data = reactive({ |
|
|
|
searchResult: [], |
|
|
|
showPicker: false, |
|
|
|
columns: [], |
|
|
|
selectTypeValue : ref[0], |
|
|
|
selectTypeValue: ref[0], |
|
|
|
showDatePicker: ref(false), |
|
|
|
columnsType :['year'], |
|
|
|
columnsTypes :['year','month','day'], |
|
|
|
columnsType: ['year'], |
|
|
|
columnsTypes: ['year', 'month', 'day'], |
|
|
|
currentDate: ref(['2024']), |
|
|
|
minDate: new Date(2020, 0, 1), |
|
|
|
maxDate: new Date(2125, 5, 1), |
|
|
|
currentDate1: ref(['2024','03','01']), |
|
|
|
currentDate1: ref(['2024', '03', '01']), |
|
|
|
//vant组件上传照片列表 |
|
|
|
fileListObj:[], |
|
|
|
}); |
|
|
|
//保存参数 |
|
|
|
const submitData = reactive({ |
|
|
|
fileListObj: [], |
|
|
|
}); |
|
|
|
//保存参数 |
|
|
|
const submitData = reactive({ |
|
|
|
//用户id |
|
|
|
userId:useCommon.userId, |
|
|
|
userId: useCommon.userId, |
|
|
|
//关联案件ID |
|
|
|
relId:"", |
|
|
|
relId: "", |
|
|
|
//计划年度 |
|
|
|
planYear:"", |
|
|
|
planYear: "", |
|
|
|
//计划名称 |
|
|
|
planName:"", |
|
|
|
planName: "", |
|
|
|
//执法部门 |
|
|
|
enforcementDepartment:"", |
|
|
|
enforcementDepartment: "", |
|
|
|
//执法部门ID |
|
|
|
enforcementDepartmentId:"", |
|
|
|
enforcementDepartmentId: "", |
|
|
|
//执法时间 |
|
|
|
enforcementTime:"", |
|
|
|
enforcementTime: "", |
|
|
|
//执法区域 |
|
|
|
enforcementArea:"", |
|
|
|
enforcementArea: "", |
|
|
|
//是否发布年度执法计划 |
|
|
|
isPublish:0, |
|
|
|
isPublish: 0, |
|
|
|
//后台保存图片列表 |
|
|
|
fileList:[], |
|
|
|
fileList: [], |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 返回 |
|
|
|
const goBack = () => { |
|
|
|
// 返回 |
|
|
|
const goBack = () => { |
|
|
|
router.go(-1); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
const submit123 = () => { |
|
|
|
addEnforcementInspectionProgram(submitData, success => { |
|
|
|
console.log(success) |
|
|
|
//跳转企业二维码地址 |
|
|
|
if (success.success) { |
|
|
|
console.log("保存成功"); |
|
|
|
showSuccessToast('保存成功'); |
|
|
|
goBack(); |
|
|
|
} |
|
|
|
}, error => { |
|
|
|
console.log("保存失败") |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const submit = () =>{ |
|
|
|
const submit = () => { |
|
|
|
showConfirmDialog({ |
|
|
|
title: '公布执法计划', |
|
|
|
message: '对外公布本部门年度执法计划', |
|
|
|
}).then(() => { |
|
|
|
console.log(1) |
|
|
|
submitData.isPublish = 1 |
|
|
|
addEnforcementInspectionProgram(submitData,success =>{ |
|
|
|
addEnforcementInspectionProgram(submitData, success => { |
|
|
|
console.log(success) |
|
|
|
//跳转企业二维码地址 |
|
|
|
if(success.success){ |
|
|
|
if (success.success) { |
|
|
|
console.log("保存成功"); |
|
|
|
showSuccessToast('保存成功'); |
|
|
|
goBack(); |
|
|
|
} |
|
|
|
},error=>{ |
|
|
|
}, error => { |
|
|
|
console.log("保存失败") |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
console.log(0) |
|
|
|
showSuccessToast('保存成功'); |
|
|
|
submitData.isPublish = 0 |
|
|
|
addEnforcementInspectionProgram(submitData,success =>{ |
|
|
|
addEnforcementInspectionProgram(submitData, success => { |
|
|
|
console.log(success) |
|
|
|
//跳转企业二维码地址 |
|
|
|
if(success.success){ |
|
|
|
if (success.success) { |
|
|
|
console.log("保存成功"); |
|
|
|
showSuccessToast('保存成功'); |
|
|
|
goBack(); |
|
|
|
} |
|
|
|
},error=>{ |
|
|
|
}, error => { |
|
|
|
console.log("保存失败") |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
//消息提醒 |
|
|
|
// const toast = showLoadingToast({ |
|
|
|
// duration: 0, |
|
|
|
// forbidClick: true, |
|
|
|
// message: '提交成功', |
|
|
|
// }); |
|
|
|
// let second = 3; |
|
|
|
// const timer = setInterval(() => { |
|
|
|
// second--; |
|
|
|
// if (second) { |
|
|
|
// } else { |
|
|
|
// clearInterval(timer); |
|
|
|
// closeToast(); |
|
|
|
// } |
|
|
|
// }, 1000); |
|
|
|
// 保存地址操作 |
|
|
|
const onSave = () => { |
|
|
|
router.replace({ name: "addressList" }); |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
const onFailed = (errorInfo) => { |
|
|
|
console.log('failed', errorInfo); |
|
|
|
}; |
|
|
|
//消息提醒 |
|
|
|
// const toast = showLoadingToast({ |
|
|
|
// duration: 0, |
|
|
|
// forbidClick: true, |
|
|
|
// message: '提交成功', |
|
|
|
// }); |
|
|
|
// let second = 3; |
|
|
|
// const timer = setInterval(() => { |
|
|
|
// second--; |
|
|
|
// if (second) { |
|
|
|
// } else { |
|
|
|
// clearInterval(timer); |
|
|
|
// closeToast(); |
|
|
|
// } |
|
|
|
// }, 1000); |
|
|
|
// 保存地址操作 |
|
|
|
const onSave = () => { |
|
|
|
router.replace({name: "addressList"}); |
|
|
|
}; |
|
|
|
|
|
|
|
const onConfirm = (value)=> { |
|
|
|
const onConfirm = (value) => { |
|
|
|
data.showPicker = false; |
|
|
|
console.log(value) |
|
|
|
submitData.enforceType = value.selectedValues[0]; |
|
|
|
submitData.enforceTypeText = value.selectedOptions[0].text; |
|
|
|
} |
|
|
|
const selectType = () =>{ |
|
|
|
} |
|
|
|
const selectType = () => { |
|
|
|
data.showPicker = true; |
|
|
|
// console.log(data) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const uploadFiles = (file) =>{ |
|
|
|
uploadFile(file,(res) =>{ |
|
|
|
const uploadFiles = (file) => { |
|
|
|
uploadFile(file, (res) => { |
|
|
|
console.log(file.fileName); |
|
|
|
submitData.fileList.push({ |
|
|
|
fileUrl:res.url, |
|
|
|
fileUrl: res.url, |
|
|
|
fileName: file.file.name |
|
|
|
}) |
|
|
|
console.log(submitData.fileList); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
const deleteFile = (file,index) =>{ |
|
|
|
} |
|
|
|
const deleteFile = (file, index) => { |
|
|
|
// data.fileListObj.filter((item, indexs) => { |
|
|
|
// if (index.index == indexs) { |
|
|
|
// data.fileListObj.splice(indexs, 1);//splice 删除 |
|
|
|
@ -245,112 +266,116 @@ const deleteFile = (file,index) =>{ |
|
|
|
} |
|
|
|
}); |
|
|
|
return true; |
|
|
|
} |
|
|
|
onMounted(() => { |
|
|
|
} |
|
|
|
onMounted(() => { |
|
|
|
console.log(route?.query?.id); |
|
|
|
console.log(route?.query?.lawEnforcementIncident); |
|
|
|
submitData.relId = route?.query?.id; |
|
|
|
submitData.lawEnforcementIncident = route?.query?.lawEnforcementIncident; |
|
|
|
getDict({"dictType": "caseType"},success =>{ |
|
|
|
getDict({"dictType": "caseType"}, success => { |
|
|
|
console.log(success); |
|
|
|
success.data.forEach(res =>{ |
|
|
|
success.data.forEach(res => { |
|
|
|
console.log(res) |
|
|
|
var obj = { text: res.dictLabel, value: res.dictValue }; |
|
|
|
var obj = {text: res.dictLabel, value: res.dictValue}; |
|
|
|
data.columns.push(obj) |
|
|
|
}) |
|
|
|
},error =>{ |
|
|
|
}, error => { |
|
|
|
|
|
|
|
}) |
|
|
|
//查询企业信息 |
|
|
|
queryUserInfo(useCommon.userId,success =>{ |
|
|
|
queryUserInfo(useCommon.userId, success => { |
|
|
|
submitData.enforcementDepartment = success.data.dept.deptName; |
|
|
|
submitData.enforcementDepartmentId = success.data.dept.deptId; |
|
|
|
},error=>{ |
|
|
|
}, error => { |
|
|
|
|
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
const selectDate = () =>{ |
|
|
|
const selectDate = () => { |
|
|
|
data.showDatePicker = true; |
|
|
|
console.log(data.showDatePicker) |
|
|
|
} |
|
|
|
const onDateConfirm = (value)=> { |
|
|
|
} |
|
|
|
const onDateConfirm = (value) => { |
|
|
|
console.log(value); |
|
|
|
|
|
|
|
value.selectedValues.forEach((item,index) => { |
|
|
|
value.selectedValues.forEach((item, index) => { |
|
|
|
console.log(item); |
|
|
|
submitData.planYear = item; |
|
|
|
}); |
|
|
|
// submitData.establishmentTime = "2023-04-21" |
|
|
|
data.showDatePicker = false; |
|
|
|
} |
|
|
|
//取消日期选择 |
|
|
|
const cancelSelectDate = () =>{ |
|
|
|
} |
|
|
|
//取消日期选择 |
|
|
|
const cancelSelectDate = () => { |
|
|
|
data.showDatePicker = false; |
|
|
|
} |
|
|
|
//取消 |
|
|
|
const cancelEnforcementTime = () =>{ |
|
|
|
} |
|
|
|
//取消 |
|
|
|
const cancelEnforcementTime = () => { |
|
|
|
data.showPicker = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const selectEnforcementTime = () =>{ |
|
|
|
const selectEnforcementTime = () => { |
|
|
|
data.showPicker = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const onEnforcementTimeConfirm = (value)=> { |
|
|
|
const onEnforcementTimeConfirm = (value) => { |
|
|
|
console.log(value); |
|
|
|
|
|
|
|
value.selectedValues.forEach((item,index) => { |
|
|
|
value.selectedValues.forEach((item, index) => { |
|
|
|
console.log(item); |
|
|
|
}); |
|
|
|
submitData.enforcementTime = value.selectedValues[0] + "-" + value.selectedValues[1] + "-" + value.selectedValues[2] + " 00:00:00"; |
|
|
|
data.showPicker = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
<style lang="less" scoped> |
|
|
|
.address_edit { |
|
|
|
.address_edit { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
height: 100%; |
|
|
|
overflow: hidden; |
|
|
|
background-color: #f4f4f4; |
|
|
|
} |
|
|
|
/* vant4的 Toast 和 Popup 样式冲突,会导致 Toast 变成白底 */ |
|
|
|
// .van-popup.van-toast{ |
|
|
|
// background: var(--van-toast-background) !important; |
|
|
|
// box-sizing: content-box !important; |
|
|
|
// /* 下面3条css,影响不大 */ |
|
|
|
// transition: all var(--van-duration-fast) !important; |
|
|
|
// width: var(--van-toast-default-width) !important; |
|
|
|
// max-width: var(--van-toast-max-width) !important; |
|
|
|
// } |
|
|
|
// .van-popup.van-toast .van-toast__icon{ |
|
|
|
// font-size: var(--van-toast-icon-size) !important; |
|
|
|
// } |
|
|
|
.file-upload{ |
|
|
|
} |
|
|
|
|
|
|
|
/* vant4的 Toast 和 Popup 样式冲突,会导致 Toast 变成白底 */ |
|
|
|
// .van-popup.van-toast{ |
|
|
|
// background: var(--van-toast-background) !important; |
|
|
|
// box-sizing: content-box !important; |
|
|
|
// /* 下面3条css,影响不大 */ |
|
|
|
// transition: all var(--van-duration-fast) !important; |
|
|
|
// width: var(--van-toast-default-width) !important; |
|
|
|
// max-width: var(--van-toast-max-width) !important; |
|
|
|
// } |
|
|
|
// .van-popup.van-toast .van-toast__icon{ |
|
|
|
// font-size: var(--van-toast-icon-size) !important; |
|
|
|
// } |
|
|
|
.file-upload { |
|
|
|
height: 165px; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
.file-upload-center{ |
|
|
|
} |
|
|
|
|
|
|
|
.file-upload-center { |
|
|
|
position: absolute; |
|
|
|
height: 20%; |
|
|
|
top: 10%; |
|
|
|
left: 2%; |
|
|
|
font-size: 18px; |
|
|
|
|
|
|
|
span { |
|
|
|
font-size: 13px; |
|
|
|
color: rgb(221, 229, 227); |
|
|
|
} |
|
|
|
} |
|
|
|
.file{ |
|
|
|
} |
|
|
|
|
|
|
|
.file { |
|
|
|
position: absolute; |
|
|
|
bottom: 10%; |
|
|
|
left: 2%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.preview-cover { |
|
|
|
.preview-cover { |
|
|
|
position: absolute; |
|
|
|
bottom: 0; |
|
|
|
box-sizing: border-box; |
|
|
|
@ -362,7 +387,7 @@ const onEnforcementTimeConfirm = (value)=> { |
|
|
|
background: rgba(0, 0, 0, 0.3); |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .van-button { |
|
|
|
/deep/ .van-button { |
|
|
|
margin: 5% 3%; |
|
|
|
padding: 0; |
|
|
|
width: 94%; |
|
|
|
@ -373,8 +398,9 @@ const onEnforcementTimeConfirm = (value)=> { |
|
|
|
background: #1367fe; |
|
|
|
border: 0.02667rem solid #1367fe; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
:root { |
|
|
|
} |
|
|
|
|
|
|
|
:root { |
|
|
|
--van-dialog-width: 600px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
|