|
|
<script setup> |
|
|
|
|
|
import {auditReport,auditWarning} from "@/api/report/flow"; |
|
|
import {auditPassWarningDistribute} from "@/api/warning/business"; |
|
|
import feedback from "@/utils/feedback"; |
|
|
import {listPolice} from "@/api/system/police"; |
|
|
import {getList,save,delCommon} from '@/api/commonOpinions'; |
|
|
import useCatchStore from "@/stores/modules/catch"; |
|
|
import useUserStore from "@/stores/modules/user"; |
|
|
const userStore = useUserStore(); |
|
|
const props = defineProps(['dialog','reportId','nextNode','message',"isWarning","flowId","batchItems"]) |
|
|
const emits = defineEmits(['submitFeedback',"closeFun"]) |
|
|
|
|
|
const catchStore = useCatchStore(); |
|
|
const departs = catchStore.getDeparts() ; |
|
|
const formData = ref({ |
|
|
isAudit:true, |
|
|
nextNode:'end', |
|
|
data:{} |
|
|
}) |
|
|
const auditForm= ref() |
|
|
const submitLoading = ref(false) |
|
|
const dict = catchStore.getDicts([ |
|
|
"businessType", |
|
|
"suspectProblem", |
|
|
"policeType", |
|
|
"timeLimit", |
|
|
"approvalFlow", |
|
|
"distributionFlow" |
|
|
]); |
|
|
|
|
|
|
|
|
//审核人 |
|
|
const query = ref({ |
|
|
current: 1, |
|
|
departBranch: true |
|
|
}); |
|
|
let polices = ref([]) |
|
|
function getPoliceList() { |
|
|
listPolice(query.value).then((data) => { |
|
|
polices.value = data.records; |
|
|
}); |
|
|
} |
|
|
getPoliceList() |
|
|
|
|
|
// 获取常用意见 |
|
|
const commonList =ref([]) |
|
|
async function getCommonList(){ |
|
|
const res = await getList(); |
|
|
commonList.value=res |
|
|
if(commonList.value && commonList.value.length > 0 ){ |
|
|
formData.value.message = commonList.value[0].content |
|
|
} |
|
|
} |
|
|
getCommonList() |
|
|
//存为常用 |
|
|
async function saveCommon(){ |
|
|
if(formData.value.message){ |
|
|
const res = await save({"content":formData.value.message}) |
|
|
feedback.msgSuccess("保存成功"); |
|
|
await getCommonList(); |
|
|
} |
|
|
} |
|
|
//删除常用 |
|
|
async function delCommonFun(){ |
|
|
if(formData.value.message){ |
|
|
const res = await delCommon({"content":formData.value.message}) |
|
|
feedback.msgSuccess("保存成功"); |
|
|
await getCommonList(); |
|
|
} |
|
|
} |
|
|
//获取单位为简称 |
|
|
function getDepartShortName(departData,id,rowName){ |
|
|
if(departData){ |
|
|
for(let i =0;i<departData.length;i++){ |
|
|
let s = departData[i]; |
|
|
if(s.id === id){ |
|
|
formData.value[rowName]= s.shortName; |
|
|
break; |
|
|
} |
|
|
if(s.children){ |
|
|
getDepartShortName(s.children,id,rowName) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
//根据输入值获取信息 |
|
|
const inputGetList= (val)=>{ |
|
|
query.value.name = val; |
|
|
getPoliceList() |
|
|
} |
|
|
|
|
|
const closeAdd=()=>{ |
|
|
formData.value={ |
|
|
isAudit:true, |
|
|
data:{} |
|
|
} |
|
|
emits("closeFun",false) |
|
|
} |
|
|
|
|
|
const submitFun = async ()=>{ |
|
|
await auditForm.value.validate(); |
|
|
const isBatch = Array.isArray(props.batchItems) && props.batchItems.length > 0 |
|
|
const targets = isBatch ? props.batchItems : [{ |
|
|
reportId: props.reportId, |
|
|
flowId: props.flowId |
|
|
}] |
|
|
await feedback.confirm(isBatch ? `是否确认批量通过选中的 ${targets.length} 个项目?` : "是否确认通过?"); |
|
|
submitLoading.value = true |
|
|
try { |
|
|
const createSubmitData = (target) => ({ |
|
|
...formData.value, |
|
|
data: {...formData.value.data}, |
|
|
reportId: target.reportId, |
|
|
flowId: target.flowId, |
|
|
nextNode: props.nextNode || formData.value.nextNode |
|
|
}) |
|
|
if (isBatch) { |
|
|
const results = await Promise.allSettled(targets.map(target => |
|
|
auditPassWarningDistribute(createSubmitData(target)) |
|
|
)) |
|
|
const successCount = results.filter(item => item.status === 'fulfilled').length |
|
|
const failCount = results.length - successCount |
|
|
if (failCount > 0) { |
|
|
feedback.msgError(`批量通过完成:成功 ${successCount} 个,失败 ${failCount} 个`) |
|
|
} else { |
|
|
feedback.msgSuccess(`已批量通过 ${successCount} 个项目`) |
|
|
} |
|
|
} else if(props.isWarning){ |
|
|
await auditPassWarningDistribute(createSubmitData(targets[0])); |
|
|
}else{ |
|
|
await auditReport(createSubmitData(targets[0])); |
|
|
} |
|
|
emits('submitFeedback',true) |
|
|
closeAdd() |
|
|
} finally { |
|
|
submitLoading.value = false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//获取单位简称 |
|
|
watch(()=>formData.value.approverUnitId,(val)=>{ |
|
|
if(val){ |
|
|
query.value.departId =val; |
|
|
getDepartShortName(departs,val,'approverUnit') |
|
|
}else{ |
|
|
delete query.value.departId; |
|
|
} |
|
|
getPoliceList() |
|
|
}) |
|
|
//获用户名称 |
|
|
watch(()=>formData.value.approverId,(val)=>{ |
|
|
if(val){ |
|
|
let policesData = polices.value.filter(s=>s.idCode === formData.value.approverId); |
|
|
if(policesData.length > 0){ |
|
|
formData.value.approver = policesData[0].name |
|
|
} |
|
|
} |
|
|
}) |
|
|
</script> |
|
|
|
|
|
<template> |
|
|
<el-dialog title="提交审核" v-model="props.dialog" @close="closeAdd" destroy-on-close > |
|
|
<el-form ref="auditForm" :model="formData" :label-width="120"> |
|
|
<el-form-item label="通知报审人" prop="isInform"> |
|
|
<el-radio-group v-model="formData.isInform"> |
|
|
<el-radio value="1" >是</el-radio> |
|
|
<el-radio value="0" >否</el-radio> |
|
|
</el-radio-group> |
|
|
</el-form-item> |
|
|
<el-form-item label="办理意见" prop="message" :rules="{ required: true, message: '请输入办理意见', trigger: 'blur' }"> |
|
|
<el-input type="textarea" :rows="10" v-model="formData.message" ></el-input> |
|
|
</el-form-item> |
|
|
<el-form-item label="常用意见" > |
|
|
<el-row :gutter="20" style="width:100%"> |
|
|
<el-col :span="16"> |
|
|
<el-select allow-create filterable default-first-option v-model="formData.message"> |
|
|
<el-option v-for="(item,index) in commonList" :key="index" |
|
|
:value="item.content" :label="item.content" |
|
|
></el-option> |
|
|
</el-select> |
|
|
</el-col> |
|
|
<el-col :span="8"> |
|
|
<el-button type="primary" @click="saveCommon" >存为常用</el-button> |
|
|
<el-button @click="delCommonFun">删除常用</el-button> |
|
|
</el-col> |
|
|
</el-row> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item |
|
|
label="业务类别" |
|
|
prop="data.businessTypeCode" |
|
|
:rules="{ |
|
|
required: true, |
|
|
message: '请选择业务类别', |
|
|
trigger: ['blur'], |
|
|
}" |
|
|
> |
|
|
<el-select |
|
|
v-model="formData.data.businessTypeCode" |
|
|
@change=" |
|
|
(val) => |
|
|
(formData.data.businessTypeName = dict.businessType.filter( |
|
|
(item) => item.dictValue === val |
|
|
)[0].dictLabel) |
|
|
" |
|
|
style="width: 280px" |
|
|
> |
|
|
<el-option |
|
|
v-for="item in dict.businessType" |
|
|
:key="item.id" |
|
|
:label="item.dictLabel" |
|
|
:value="item.dictValue" |
|
|
/> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
label="涉嫌问题" |
|
|
prop="data.involveProblem" |
|
|
:rules="{ |
|
|
required: true, |
|
|
message: '请选择涉嫌问题', |
|
|
trigger: ['blur'], |
|
|
}" |
|
|
> |
|
|
<el-select |
|
|
v-model="formData.data.involveProblem" |
|
|
multiple |
|
|
clearable |
|
|
style="width: 280px" |
|
|
> |
|
|
<el-option |
|
|
v-for="item in dict.suspectProblem" |
|
|
:key="item.id" |
|
|
:label="item.dictLabel" |
|
|
:value="item.dictValue" |
|
|
/> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
<el-form-item label="涉及警种" prop="data.policeType"> |
|
|
<el-select |
|
|
v-model="formData.data.policeType" |
|
|
clearable |
|
|
style="width: 280px" |
|
|
> |
|
|
<el-option |
|
|
v-for="item in dict.policeType" |
|
|
:key="item.id" |
|
|
:label="item.dictLabel" |
|
|
:value="item.dictValue" |
|
|
/> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
label="办理时限" |
|
|
prop="data.timeLimit" |
|
|
:rules="{ |
|
|
required: true, |
|
|
message: '请选择办理时限', |
|
|
}" |
|
|
> |
|
|
<time-limit-select |
|
|
v-model="formData.data.timeLimit" |
|
|
v-model:maxSignDuration="formData.data.maxSignDuration" |
|
|
v-model:maxHandleDuration="formData.data.maxHandleDuration" |
|
|
v-model:maxExtensionDuration="formData.data.maxExtensionDuration" |
|
|
/> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
label="下发流程" |
|
|
prop="data.distributionFlow" |
|
|
:rules="{ |
|
|
required: true, |
|
|
message: '请选择下发流程', |
|
|
}" |
|
|
> |
|
|
<el-radio-group v-model="formData.data.distributionFlow" class="block"> |
|
|
<el-radio |
|
|
v-for="item in dict.distributionFlow" |
|
|
:key="item.dictCode" |
|
|
:value="item.dictValue" |
|
|
>{{ item.dictLabel |
|
|
}}</el-radio |
|
|
> |
|
|
</el-radio-group> |
|
|
</el-form-item> |
|
|
<el-form-item |
|
|
label="审核流程" |
|
|
prop="data.approvalFlow" |
|
|
:rules="{ |
|
|
required: true, |
|
|
message: '请选择审核流程', |
|
|
}" |
|
|
> |
|
|
<el-radio-group v-model="formData.data.approvalFlow"> |
|
|
<el-radio |
|
|
v-for="item in dict.approvalFlow" |
|
|
:key="item.dictCode" |
|
|
:value="item.dictValue" |
|
|
>{{ item.dictLabel |
|
|
}}{{ item.remark ? `(${item.remark})` : "" }}</el-radio |
|
|
> |
|
|
</el-radio-group> |
|
|
<div class="tips mt-10"> |
|
|
<p> |
|
|
三级审核 在问题提交办结时,需经过“所队—>二级机构—>市局”三级审核,通过后方可办结; |
|
|
</p> |
|
|
<p> |
|
|
二级审核 在问题提交办结时,仅需经过“所队—>二级机构”两级审核,通过后即可办结; |
|
|
</p> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
<div class="flex end"> |
|
|
<el-button @click="closeAdd">关闭</el-button> |
|
|
<el-button type="primary" :loading="submitLoading" @click="submitFun">提交</el-button> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</template> |
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
|
</style>
|
|
|
|