Browse Source

fit:1、问题编辑功能

master
pengwei 3 months ago
parent
commit
932eb9d8c6
  1. 7
      src/api/mobileSupervision/taskProblem.ts
  2. 9
      src/api/system/police.ts
  3. 20
      src/views/mobileSupervise/Inspection.vue
  4. 194
      src/views/mobileSupervise/TaskProblem.vue

7
src/api/mobileSupervision/taskProblem.ts

@ -14,6 +14,13 @@ export function getTaskProblem(id) {
}); });
} }
export function upTaskProblem(body){
return request.post({
url:'/task/problem/upData',
body
})
}
export function delTaskProblem(id){ export function delTaskProblem(id){
return request.del({ return request.del({

9
src/api/system/police.ts

@ -6,6 +6,13 @@ export function listPolice(query) {
query query
}); });
} }
export function listPoliceData(body) {
return request.post({
url: '/police/postList',
body
});
}
export function listAbnormalPolice(query) { export function listAbnormalPolice(query) {
return request.get({ return request.get({
@ -58,4 +65,4 @@ export function updatePoliceAuths(idCode, body) {
url: `/police/auth/${idCode}`, url: `/police/auth/${idCode}`,
body body
}); });
} }

20
src/views/mobileSupervise/Inspection.vue

@ -1745,6 +1745,7 @@
<el-select <el-select
v-model="issueForm.policeType" v-model="issueForm.policeType"
clearable clearable
filterable
style="width: 280px" style="width: 280px"
> >
<el-option <el-option
@ -2368,7 +2369,10 @@ async function getSelfexaminationProblemFun() {
const problemsShow = ref(false); const problemsShow = ref(false);
const problems = ref([]); const problems = ref([]);
const problemQuery = ref({}); const problemQuery = ref({
size: 10,
current: 1,
});
const problemTotal = ref(0); const problemTotal = ref(0);
const activePeople = ref() const activePeople = ref()
const peoples = ref() const peoples = ref()
@ -2381,7 +2385,8 @@ async function handleProblemsShow(row) {
problemsLoading.value = true problemsLoading.value = true
problemsShow.value = true; problemsShow.value = true;
try { try {
const res = await listInspectionProblems(activeRow.value.id); problemQuery.value.id = activeRow.value.id;
const res = await listInspectionProblems(problemQuery.value.id,problemQuery.value);
problems.value = res.records; problems.value = res.records;
problemTotal.value = res.total; problemTotal.value = res.total;
} catch (e) { } catch (e) {
@ -2399,7 +2404,10 @@ function getProblems() {
} }
function problemReset() { function problemReset() {
problemQuery.value = {}; problemQuery.value = {
size: 10,
current: 1,
};
} }
/** /**
@ -2508,9 +2516,11 @@ const formRefs =ref();
const issueMatterFun =(row,key)=>{ const issueMatterFun =(row,key)=>{
switch (key){ switch (key){
case "selfexamination": case "selfexamination":
issueForm.value.taskId = selfPeopleQuery.value.id;
issueForm.value.problemVo = row issueForm.value.problemVo = row
break; break;
case "inspection": case "inspection":
issueForm.value.taskId = problemQuery.value.id;
issueForm.value.problemVo = row issueForm.value.problemVo = row
break; break;
case "testing_alcohol": case "testing_alcohol":
@ -2518,18 +2528,20 @@ const issueMatterFun =(row,key)=>{
issueForm.value.empNo =row.empNo; issueForm.value.empNo =row.empNo;
break; break;
case "risk_personal": case "risk_personal":
issueForm.value.taskId = riskPersonalQuery.value.id;
issueForm.value.supRecordId =row.id issueForm.value.supRecordId =row.id
break; break;
} }
issueForm.value.tableKey = key issueForm.value.tableKey = key
console.log('actrow',row)
distributeShow.value=true; distributeShow.value=true;
} }
// //
const handleSubmitTask =async ()=>{ const handleSubmitTask =async ()=>{
await formRefs.value.validate(); await formRefs.value.validate();
issueLoading.value = true issueLoading.value = true
console.log('activeRow----------',activeRow.value)
try { try {
await TestingAlcoholIssueMatterFun(issueForm.value) await TestingAlcoholIssueMatterFun(issueForm.value)
} catch(e) { } catch(e) {

194
src/views/mobileSupervise/TaskProblem.vue

@ -10,7 +10,7 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="问题来源"> <el-form-item label="问题来源">
<el-select <el-select
clearable clearable
v-model="query.taskType" v-model="query.taskType"
> >
@ -118,6 +118,13 @@
> >
{{row.problemState == '1'?'删除':'恢复'}} {{row.problemState == '1'?'删除':'恢复'}}
</el-button> </el-button>
<el-button
@click="upProblemFun(row)"
type="primary"
link
v-if="row.distributionState === '0'">
编辑
</el-button>
<el-button <el-button
v-if="row.distributionState === '0'" v-if="row.distributionState === '0'"
type="primary" type="primary"
@ -173,6 +180,14 @@
</el-tag> </el-tag>
</span> </span>
</div> </div>
<div class="col col-12">
<label>创建人</label>
<span>{{ activeRow.createName || '/' }}</span>
</div>
<div class="col col-12">
<label>下发人</label>
<span>{{ activeRow.issueUserName || '/' }}</span>
</div>
<div class="col col-24"> <div class="col col-24">
<label>问题类型</label> <label>问题类型</label>
<span>{{ activeRow.problemType || '/' }}</span> <span>{{ activeRow.problemType || '/' }}</span>
@ -347,31 +362,101 @@
</footer> </footer>
</el-dialog> </el-dialog>
<el-dialog @close="upClose" title="编辑问题" v-model="upShow" width="50vw" top="2vh">
<el-form :label-width="120" ref="upFormRefs" :model="upFormData" v-loading="upLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="发现时间">
<el-date-picker
value-format="YYYY-MM-DD HH:mm"
time-format="HH:mm"
style="width: 100%"
v-model="upFormData.createTime"
type="datetime"
placeholder="请输入发现时间"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="问题来源">
<el-select
clearable
v-model="upFormData.taskType"
style="width:100%"
>
<el-option
v-for="item in dict.taskType"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="涉及单位">
<depart-tree-select v-model="upFormData.departId" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="涉及人员">
<el-select
:remote-method="inputPeopleFun"
:loading="peoplesloading"
filterable
multiple
v-model="upFormData.peopleIds">
<el-option v-for="(item,index) in polices" :key="index" :value="item.idCode" :label="item.name"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="问题类型">
<problem-type-select v-model="upFormData.problemTypeCode"></problem-type-select>
</el-form-item>
</el-col>
<el-col :span="12"></el-col>
<el-col :span="12" >
<el-form-item label="问题描述">
<el-input type="textarea" v-model="upFormData.thingDesc"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<file-upload
style="width: 100%"
:uploadDrag="true"
:files="upFormData.files"></file-upload>
</el-col>
</el-row>
</el-form>
<footer class="flex end mt-20">
<el-button
type="primary"
size="large"
@click="handleUpData"
v-loading="upLoading"
>确认</el-button
>
</footer>
</el-dialog>
</template> </template>
<script setup> <script setup>
import { getDictLable } from "@/utils/util"; import { getDictLable } from "@/utils/util";
import { listTaskProblem, getTaskProblem,delTaskProblem,upProblemState } from '@/api/mobileSupervision/taskProblem' import { listTaskProblem, getTaskProblem,delTaskProblem,upProblemState,upTaskProblem } from '@/api/mobileSupervision/taskProblem'
import useCatchStore from "@/stores/modules/catch"; import useCatchStore from "@/stores/modules/catch";
import {TestingAlcoholIssueMatterFun} from "@/api/mobileSupervision/testingAlcohol"; import {TestingAlcoholIssueMatterFun} from "@/api/mobileSupervision/testingAlcohol";
import feedback from "@/utils/feedback"; import feedback from "@/utils/feedback";
import {listPoliceData} from "@/api/system/police";
const catchStore = useCatchStore(); const catchStore = useCatchStore();
const dict = catchStore.getDicts(["taskType","policeType","approvalFlow","suspectProblem","businessType","distributionFlow", "distributionState"]); const dict = catchStore.getDicts(["taskType","policeType","approvalFlow","suspectProblem","businessType","distributionFlow", "distributionState"]);
const loading = ref(false); const loading = ref(false);
const taskTypes = [ const upLoading = ref(false);
{ const peoplesloading = ref(false);
dictLabel: '测酒任务', const upShow = ref(false);
dictValue: '' const upFormData = ref({})
},
{
dictLabel: '督察任务',
dictValue: ''
},
{
dictLabel: '所队自查',
dictValue: ''
}
];
// //
const distributeShow = ref(false) const distributeShow = ref(false)
const issueForm = ref({}) const issueForm = ref({})
@ -402,9 +487,50 @@
distributeShow.value=true; distributeShow.value=true;
} }
const upQuery = ref({
departBranch:true
})
const polices = ref()
const getPeoplesFun =async ()=>{
peoplesloading.value=true;
if(upQuery.value.idCodes){
delete upQuery.value.idCodes
}
const res = await listPoliceData(upQuery.value)
polices.value = res.records.map(s=> {
return{
"name":s.name,
"idCode":s.idCode,
"empNo":s.empNo
}
});
delete upQuery.value.idCodes
console.log('polices',upFormData.value.peoples)
peoplesloading.value=false;
}
//
function inputPeopleFun(val){
upQuery.value.name = val;
getPeoplesFun();
}
inputPeopleFun();
const handleUpData = async()=>{
upLoading.value=true
console.log('upFormData',upFormData.value)
const res = await upTaskProblem(upFormData.value)
upShow.value=false;
getList()
upLoading.value=false
}
const addClose =()=>{ const addClose =()=>{
issueForm.value={ issueForm.value={
}
}
const upClose = ()=>{
upFormData.value={
} }
} }
// //
@ -468,6 +594,38 @@
show.value = true show.value = true
activeRow.value = await getTaskProblem(row.id) activeRow.value = await getTaskProblem(row.id)
} }
const upProblemFun = async (row)=>{
upFormData.value=await getTaskProblem(row.id)
upFormData.value.files = JSON.parse(upFormData.value.files )
if(upFormData.value.peoples ){
console.log('peoples',upFormData.value.peoples)
let lists = JSON.parse(upFormData.value.peoples );
upFormData.value.peoples=lists;
upFormData.value.peopleIds = lists.map((s)=>{
return s.idCode
})
let idCodes = []
upFormData.value.peoples.forEach(s=>{
if(s.idCode){
idCodes.push(s.idCode)
}
})
upQuery.value.idCodes = idCodes;
}
upShow.value=true;
}
watch(()=>upFormData.value.departId,(val)=>{
upQuery.value.departId = val;
getPeoplesFun()
},{deep:true,immediate:true})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

Loading…
Cancel
Save