Browse Source

fit:1、警员选择 && 六项规定督察、重点督察下发问题

main
pengwei 6 months ago
parent
commit
35142d9281
  1. 82
      src/components/police-picker.vue
  2. 38
      src/views/mobileSupervise/Inspection.vue

82
src/components/police-picker.vue

@ -1,6 +1,8 @@
<template> <template>
<div class="flex gap"> <div class="flex gap">
<el-tag type="info" effect="plain" closable v-for="(item, index) in modelValue" :key="item" @close="handleRemove(index)">{{ item.name }}</el-tag> <el-tag type="info" effect="plain" closable v-for="(item, index) in modelValue" :key="item"
@close="handleRemove(index)">{{ item.name }}
</el-tag>
<el-button size="small" type="primary" plain @click="show = true"> <el-button size="small" type="primary" plain @click="show = true">
<template #icon> <template #icon>
<icon name="el-icon-Plus"/> <icon name="el-icon-Plus"/>
@ -51,10 +53,14 @@
:data="polices" :data="polices"
row-key="id" row-key="id"
max-height="890px" max-height="890px"
@selection-change="selectionChange"
v-loading="loading" v-loading="loading"
> >
<el-table-column type="selection" width="55" /> <el-table-column width="55">
<template #default="{row}">
<el-checkbox
v-model="row.isCheck" @change="changeCheck(row)" size="large" />
</template>
</el-table-column>
<el-table-column <el-table-column
label="姓名" label="姓名"
prop="name" prop="name"
@ -122,13 +128,14 @@
</el-pagination> </el-pagination>
</div> </div>
<div class="flex gap mt-10 wrap v-center"> <div class="flex gap mt-10 wrap v-center">
<span>已选警员</span> <span>已选 {{checkPolices.length}} 警员</span>
<el-tag <el-tag
v-for="(item, index) in checkPolices" v-for="(item, index) in checkPolices"
:key="item" :key="item"
closable closable
@close="handleRemove(index)" @close="handleRemove(index)"
>{{ item.name }}</el-tag >{{ item.name }}
</el-tag
> >
</div> </div>
</el-col> </el-col>
@ -176,11 +183,11 @@ const ableRef =ref(null)
const treeData = catchSotre.getDepartsAll(); const treeData = catchSotre.getDepartsAll();
const polices = ref([]); const polices = ref([]);
const loading = ref(false) const loading = ref(false)
function getList() { function getList() {
loading.value = true loading.value = true
listPolice(query.value).then((data) => { listPolice(query.value).then((data) => {
polices.value = data.records; polices.value = data.records;
console.log('polices',polices)
setCheckFun(data.records) setCheckFun(data.records)
total.value = data.total; total.value = data.total;
loading.value = false loading.value = false
@ -189,57 +196,31 @@ function getList() {
const setCheckFun = (row) => { const setCheckFun = (row) => {
let keyValue = checkPolices.value.map(s=>s.empNo);
row.forEach((s) => { row.forEach((s) => {
let data =checkPolices.value.find(x=>{ if(keyValue.indexOf(s.empNo) >= 0){
return JSON.stringify(x) === JSON.stringify({ s.isCheck=true;
name: s.name, }else{
empNo: s.empNo, s.isCheck=false;
idCode: s.idCode
})
});
if(data){
nextTick(()=>{
ableRef.value.toggleRowSelection(s, true);
})
} }
}) })
} }
const checkPolices = ref([]); const checkPolices = ref([]);
const checkPolicesMap =ref([])
function selectionChange(selectionRows) {
if( checkPolicesMap.value['key'+query.value.current]){
let data = checkPolicesMap.value['key'+query.value.current];
checkPolicesMap.value['key'+query.value.current]=getCheckData(data,selectionRows);
}else{
checkPolicesMap.value['key'+query.value.current] =getCheckData([],selectionRows);
}
checkPolices.value=[]
for (let key in checkPolicesMap.value){
checkPolices.value=checkPolices.value.concat(checkPolicesMap.value[key])
}
}
const getCheckData = (data,selectionRows) =>{ const changeCheck = (row)=>{
selectionRows.forEach(item => { let checkIndex =checkPolices.value.map(s=>s.empNo);
if (data.findIndex(o => o.empNo === item.empNo) === -1) { if(row.isCheck){
data.push({ checkPolices.value.push({
name: item.name, name: row.name,
empNo: item.empNo, empNo: row.empNo,
idCode: item.idCode idCode: row.idCode
}) });
}else{
checkPolices.value.splice(checkIndex.indexOf(row.empNo),1)
} }
})
data.forEach((s,i)=>{
if (selectionRows.findIndex(o => o.empNo === s.empNo) === -1){
data.splice(i,1)
} }
})
return data;
}
@ -250,7 +231,14 @@ function handleSelectDepart(node) {
} }
function handleRemove(index) { function handleRemove(index) {
console.log(index)
polices.value.forEach(s=>{
if(s.empNo == checkPolices.value[index].empNo){
s.isCheck =false
}
})
checkPolices.value.splice(index, 1) checkPolices.value.splice(index, 1)
emit('update:modelValue', checkPolices.value) emit('update:modelValue', checkPolices.value)
} }

38
src/views/mobileSupervise/Inspection.vue

@ -1393,6 +1393,13 @@
<span>{{ row.unTestingDesc }}</span> <span>{{ row.unTestingDesc }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="下发状态" >
<template #default="{row}">
<el-tag type="info" v-if=" row.drinkResult === '饮酒' && row.distributionState == '0' ">未下发</el-tag>
<el-tag type="primary" v-if="row.drinkResult === '饮酒' && row.distributionState == '1' ">已分发</el-tag>
<el-tag type="primary" v-if="row.drinkResult === '饮酒' && row.distributionState == '2' ">已处置</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="100"> <el-table-column label="操作" width="100">
<template #default="{ row }"> <template #default="{ row }">
<el-button <el-button
@ -1401,7 +1408,7 @@
@click="handleShowPeople(row)" @click="handleShowPeople(row)"
>详情 >详情
</el-button> </el-button>
<el-button v-if="row.drinkResult === '饮酒' && row.issueState != 'done' " type="primary" link @click="issueMatterFun(row,'zjdc')">下发</el-button> <el-button v-if="row.drinkResult === '饮酒' " type="primary" link @click="issueMatterFun(row,'lxgddc')">下发</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -1635,6 +1642,11 @@
</el-table-column> </el-table-column>
<el-table-column label="督察方式" prop="supType"></el-table-column> <el-table-column label="督察方式" prop="supType"></el-table-column>
<el-table-column label="督察情况" prop="supDesc"></el-table-column> <el-table-column label="督察情况" prop="supDesc"></el-table-column>
<el-table-column label="操作">
<template #default="{row}">
<el-button v-if="['失控','无法确认'].includes(row.supStatus)" @click="issueMatterFun(row,'zdrydc')" type="primary" link>下发</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<div class="flex end mt-8"> <div class="flex end mt-8">
<el-pagination <el-pagination
@ -2030,7 +2042,6 @@ function handleShowAdd() {
fileData.value=[] fileData.value=[]
filterDataTable.value=[] filterDataTable.value=[]
riskDataTable.value=[] riskDataTable.value=[]
form.value.times[0]=timeFormat(new Date(),"yyyy-mm-dd hh:MM:ss");
} }
@ -2464,7 +2475,22 @@ const formRefs =ref();
// //
const issueMatterFun =(row,key)=>{ const issueMatterFun =(row,key)=>{
console.log('row',row) console.log('row',row)
switch (key){
case "sdzc":
issueForm.value.problemVo = row
break;
case "rcdc":
issueForm.value.problemVo = row issueForm.value.problemVo = row
break;
case "lxgddc":
issueForm.value.taskId = row.taskId;
issueForm.value.empNo =row.empNo;
break;
case "zdrydc":
issueForm.value.supRecordId =row.id
break;
}
issueForm.value.tableKey = key issueForm.value.tableKey = key
distributeShow.value=true; distributeShow.value=true;
} }
@ -2489,6 +2515,12 @@ const handleSubmitTask =async ()=>{
case "rcdc": case "rcdc":
getProblems(); getProblems();
break; break;
case "lxgddc":
getTestingAlcoholPeople();
break;
case "zdrydc":
getTaskSupDataFun();
break;
} }
} }
@ -2570,7 +2602,7 @@ watch(() => form.value.samplingTarget, (newVal) => {
watch(() => form.value.supervisionType, (newVal) => { watch(() => form.value.supervisionType, (newVal) => {
if (newVal === '日常督察') { if (newVal === '日常督察') {
form.value.taskContentHtml = '<p>仍无要求</p>' form.value.taskContentHtml = '<p>任务要求</p>'
} else { } else {
delete form.value.taskContentHtml delete form.value.taskContentHtml
} }

Loading…
Cancel
Save