Browse Source

fix:督察任务发布(合并改造 + 重点人员督察开发(非表单))v2

main
pengwei 5 months ago
parent
commit
fb82f27517
  1. 146
      src/views/mobileSupervise/Inspection.vue

146
src/views/mobileSupervise/Inspection.vue

@ -238,11 +238,15 @@
<el-upload
style="width: 100%"
drag
:action="`${BASE_PATH}/task/management/import`"
:headers="{ Authorization: getToken() }"
:multiple="false"
:auto-upload="true"
:show-file-list="false"
v-model:file-list="fileListData"
@change="handleImport"
:on-success="managementSuccess"
:on-progress="managementProgress"
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
>
<template v-if="fileListData.length === 0">
@ -431,11 +435,15 @@
<el-upload
style="width: 100%"
drag
v-loading="fileDataLoading"
:action="`${BASE_PATH}/task/management/importSupRiskPersonal`"
:headers="{ Authorization: getToken() }"
:multiple="false"
:auto-upload="true"
:show-file-list="false"
v-model:file-list="fileData"
@change="handleSupRiskImport"
:on-progress="SupRiskProgress"
:on-success="SupRiskSuccess"
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
>
<template v-if="fileData.length === 0">
@ -457,6 +465,41 @@
</template>
</el-upload>
</div>
<el-table
ref="singleTableRef"
:data="riskDataTable"
highlight-current-row
style="width: 100%"
>
<el-table-column type="index" width="50" label="序号" />
<el-table-column property="name" label="项目" width="60" />
<el-table-column property="gender" label="性别" width="60" />
<el-table-column property="idCode" label="身份证号" width="100" />
<el-table-column property="mobile" label="联系方式" width="100" />
<el-table-column property="personalType" label="人员类别" width="80" />
<el-table-column property="controlLevel" label="管控级别" width="80" />
<el-table-column property="controlTimeInterval" label="管控间隔" width="120" />
<el-table-column property="responsibleDepartName" label="责任单位" width="120" />
<el-table-column property="responsibleName" label="责任民警" width="120" />
<el-table-column property="controlEmpNo" label="包保督察人员警号" width="120" />
<el-table-column property="controlName" label="包保督察人员姓名" width="120" />
<el-table-column fixed="right" label="操作" min-width="120">
<template #default>
<el-button link type="danger" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="flex end mt-8">
<el-pagination
@size-change="getRiskDataTableList"
@current-change="getRiskDataTableList"
:page-sizes="[10]"
v-model:page-size="riskDataQuery.size"
v-model:current-page="riskDataQuery.current"
layout="total, sizes, prev, pager, next"
:total="riskDataTotal"
/>
</div>
<div class="flex gap wrap pepole-container mt-20">
<el-tag v-for="item in form.supRiskDtoList" :key="item"
>{{ item.name }}-{{ item.idCode }}
@ -1343,12 +1386,13 @@ import {
import {listTestingAlcoholPeoples, TestingAlcoholDetail} from "@/api/mobileSupervision/testingAlcohol";
import {getSelfexaminationProblem} from "@/api/mobileSupervision/selfexamination";
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 fileListData = ref([]);
const list = ref([]);
const samplingList = ref([]);
const samplingTotal = ref(10)
const samplingloading = ref(false)
@ -1529,18 +1573,25 @@ async function showDeatil(row) {
//
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;
step.value = 2;
// 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;
// }
async function SupRiskSuccess (val){
form.value.supRiskDtoList=val.data
fileDataLoading.value=false;
}
const SupRiskProgress= ()=>{
fileDataLoading.value=true;
}
@ -1727,22 +1778,30 @@ const addSelfArray = () => {
}
}
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;
step.value = 2;
nextTick(() => {
});
const temperancLoading =ref(false);
const managementSuccess = async (val)=>{
form.value.userList = val.data;
temperancLoading.value=false;
}
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();
@ -1760,6 +1819,34 @@ onMounted(() => {
getData()
})
const riskDataTable = ref([]);
const riskDataQuery=ref({})
const riskDataTotal = ref(0);
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)
}
},{immediate:true})
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 = form.value.supRiskDtoList.slice(start,end);
}
watch(departs, () => {
getData()
})
@ -1787,6 +1874,7 @@ watch(() => form.value.supervisionType, (newVal) => {
}, {immediate: true})
</script>
<style lang="scss" scoped>
h5 {

Loading…
Cancel
Save