diff --git a/src/views/mobileSupervise/Inspection.vue b/src/views/mobileSupervise/Inspection.vue index b32b02d..8c90d66 100644 --- a/src/views/mobileSupervise/Inspection.vue +++ b/src/views/mobileSupervise/Inspection.vue @@ -82,7 +82,7 @@ 已完成 - + - @@ -431,7 +431,7 @@ >重点人员管控模板下载 - + - - - - - - - - - - - - - - - - 删除 - - - - - + + + {{fileData[fileData.length - 1]?.name}} + + + 重新上传 + - - {{ item.name }}-{{ item.idCode }} - + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + + + + + + + + + + + + + + + + 删除 + + + + + + + @@ -729,11 +767,71 @@ - - {{ item.name }}-{{ item.idCode }} - + + + + + + + + + + + + + + + + + + + + + + 查询 + + + + + + + + + + + + + + + + + + + + + @@ -1389,7 +1487,7 @@ import {getTaskProblem} from "@/api/mobileSupervision/taskProblem"; import { getToken } from "@/utils/token"; let cardContent = ref() const catchStore = useCatchStore(); -const dict = catchStore.getDicts(["supervisionType", "personnelTypeArray", "inspectorType", "personType"]); +const dict = catchStore.getDicts(["supervisionType", "personnelTypeArray", "inspectorType", "personType","controlLevel","controlType"]); const fileListData = ref([]); const list = ref([]); @@ -1485,7 +1583,8 @@ getList(); const form = ref({ - files: [] + files: [], + supRiskDtoList:[] }); const formRef = ref(null); @@ -1497,13 +1596,15 @@ async function submit() { if (quillRef.value) { form.value.taskContent = quillRef.value.getText() } - // await addInspection(form.value); await addTaskManagement(form.value) feedback.msgSuccess("发布成功"); show.value = false; getList(); - form.value = {}; + form.value = { + files: [], + supRiskDtoList:[] + }; } //任务类型转换函数 @@ -1521,10 +1622,16 @@ const getTaskType = (val) => { function handleShowAdd() { form.value.supervisionType = '日常督察' show.value = true; + form.value = { + files: [], + supRiskDtoList:[] + }; } const detailShow = ref(false); -const activeRow = ref({}); +const activeRow = ref({ + supRiskDtoList:[] +}); /** * 显示督察任务详情 @@ -1566,29 +1673,18 @@ const activeRowData = ref({}) async function showDeatil(row) { problemShow.value = true - console.log('activeRowData-start') activeRowData.value = await getTaskProblem(row.id) - console.log('activeRowData', activeRowData.value) } //重点督察人员导入 const fileData=ref([]) const fileDataLoading = ref(false) -// async function handleSupRiskImport() { -// const formData = new FormData(); -// formData.append("file", fileData.value[fileData.value.length - 1].raw); -// fileDataLoading.value = true; -// try { -// form.value.supRiskDtoList = await importSupRiskPersonal(formData); -// } catch (e) { -// fileDataLoading.value = false; -// return -// } -// fileDataLoading.value = false; -// } +const showRiskDataTable =ref(false); async function SupRiskSuccess (val){ form.value.supRiskDtoList=val.data fileDataLoading.value=false; + showRiskDataTable.value=true; + showUploadFun(); } const SupRiskProgress= ()=>{ fileDataLoading.value=true; @@ -1789,20 +1885,6 @@ const managementProgress = async (val)=>{ temperancLoading.value=true; } -// async function handleImport() { -// const formData = new FormData(); -// formData.append("file", fileListData.value[fileListData.value.length - 1].raw); -// loading.value = true; -// try { -// form.value.userList = await importTemperancePolice(formData); -// } catch (e) { -// loading.value = false; -// return -// } -// loading.value = false; -// } - - //getDeparts const departs = catchStore.getDepartsAll(); @@ -1822,29 +1904,79 @@ onMounted(() => { const riskDataTable = ref([]); const riskDataQuery=ref({}) const riskDataTotal = ref(0); - +const filterDataTable = ref([]) +const uploadShow =ref(false) +/** + * 获取重点督察人员表单 + * */ watch(()=>form.value.supRiskDtoList,(newVal)=>{ - console.log('form.value.supRiskDtoList',form.value.supRiskDtoList) - if(form.value.supRiskDtoList){ - riskDataTotal.value=form.value.supRiskDtoList.length; - riskDataTable.value = form.value.supRiskDtoList.slice(0,11) + if(form.value.supRiskDtoList.length > 0){ + getRiskDataTableSubmit(); } -},{immediate:true}) +},{immediate:true,deep:true}) +/** + * 获取重点督察人员表单 + * */ +watch(()=>activeRow.value.supRiskDtoList,(newVal)=>{ + if(activeRow.value.supRiskDtoList.length > 0){ + getRiskDataTableSubmit(); + } + +},{immediate:true,deep:true}) + + +const showUploadFun = ()=>{ + uploadShow.value = !uploadShow.value +} + +/** + * 获取表单数据 + * */ const getRiskDataTableList = (val)=>{ - console.log('getRiskDataTableList',val) let end =(10 * val) + 1; let start =(10 * (val -1)); if(riskDataTotal.value < (10 * val )){ end=riskDataTotal.value; } + riskDataTable.value = filterDataTable.value.slice(start,end); +} - riskDataTable.value = form.value.supRiskDtoList.slice(start,end); - - +/** + * 删除数据 + * */ +const delriskData =(row)=>{ + form.value.supRiskDtoList = form.value.supRiskDtoList.filter(s=>s.idCode !== row.idCode); } +// controlLevel 管控级别 +// keyword 姓名或手机号或身份证 +// personalType 人员类别 +// responsibleName 责任民警 +// controlName 包保督察人员 +const getRiskDataTableSubmit =()=>{ + filterDataTable.value = form.value.supRiskDtoList.length > 0?form.value.supRiskDtoList:activeRow.value.supRiskDtoList + //管控级别 + if(riskDataQuery.value.controlLevel){ + filterDataTable.value = filterDataTable.value.filter(s=>s.controlLevel.includes(riskDataQuery.value.controlLevel)); + console.log('filterDataTable',filterDataTable.value) + } + if(riskDataQuery.value.keyword){ + filterDataTable.value = filterDataTable.value.filter(s=>s.name.includes(riskDataQuery.value.keyword) || s.idCode.includes(riskDataQuery.value.keyword)||s.mobile.includes(riskDataQuery.value.keyword)); + } + if(riskDataQuery.value.personalType){ + filterDataTable.value = filterDataTable.value.filter(s=>s.personalType.includes(riskDataQuery.value.personalType)); + } + if(riskDataQuery.value.responsibleName){ + filterDataTable.value = filterDataTable.value.filter(s=>s.responsibleName.includes(riskDataQuery.value.responsibleName)); + } + if(riskDataQuery.value.controlName){ + filterDataTable.value = filterDataTable.value.filter(s=>s.controlName.includes(riskDataQuery.value.controlName)); + } + riskDataTotal.value=filterDataTable.value.length; + riskDataTable.value=filterDataTable.value.slice(0,11); +} watch(departs, () => {