This commit is contained in:
shilixia 2021-04-30 09:49:17 +08:00
parent 52c1ed13d9
commit 9c70118512
3 changed files with 107 additions and 195 deletions

View File

@ -52,7 +52,7 @@
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-button type="primary" icon="el-icon-plus" @click="dialogVisible = true" <el-button type="primary" icon="el-icon-plus" @click="createChildtask()"
>创建子任务</el-button >创建子任务</el-button
> >
</div> </div>
@ -64,7 +64,6 @@
stripe stripe
highlight-current-row highlight-current-row
max-height="300" max-height="300"
@row-click="clickRow"
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column align="center" label="子任务"> <el-table-column align="center" label="子任务">
@ -96,6 +95,7 @@
fixed="right" fixed="right"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="handleClick(scope)" type="primary">执行</el-button>
<el-button <el-button
type="primary" type="primary"
size="small" size="small"
@ -114,132 +114,6 @@
</el-card> </el-card>
<el-card style="float:left;width: 30%;margin-top:4px">
<!-- <el-button type="primary" icon="el-icon-plus" @click="adddept">增加巡检组织</el-button> -->
<el-table
:data="recordList"
max-height="300"
fit
stripe
highlight-current-row
style="width: 100%"
@row-click="recorclickRow"
>
<el-table-column
label="组织名称">
<template slot-scope="scope">
{{ scope.row.dept__name }}
</template>
</el-table-column>
<el-table-column
label="检查状态">
<template slot-scope="scope">
<el-tag size="medium">{{ scope.row.state }}</el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card class="box-card" style="float:right;width: 70%;margin-top:4px;">
<el-button type="primary" @click="dialogFormVisible=true">指派任务</el-button>
<el-table
:data="inspectitemList"
max-height="300"
fit
stripe
highlight-current-row
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="检查类别">
<template slot-scope="scope">
{{ scope.row.item_.cate_name }}
</template>
</el-table-column>
<el-table-column
label="检查要点">
<template slot-scope="scope">
{{ scope.row.item_.name }}
</template>
</el-table-column>
<el-table-column
label="检查类型">
<template slot-scope="scope">
{{ scope.row.item_.type }}
</template>
</el-table-column>
<el-table-column
label="检查人">
<template slot-scope="scope" v-if="scope.row.checker_">
{{ scope.row.checker_.name }}
</template>
</el-table-column>
<el-table-column
label="是否检查">
<template slot-scope="scope">
<el-tag v-if="scope.row.checked" effect="plain"></el-tag>
<el-tag type="danger" effect="plain" v-else></el-tag>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog
:visible.sync="dialogFormVisible"
:title="dialogType === 'edit' ? '编辑任务' : '指派人员'"
>
<el-form
ref="Forms"
:model="mbersData"
label-width="80px"
label-position="right"
>
<el-form-item label="负责人" prop="checker">
<el-select
v-model="mbersData.checker"
style="width: 100%"
allow-create
default-first-option
placeholder="请选择组长">
<el-option
v-for="item in leaders"
:key="item.member"
:label="item.member__name"
:value="item.member">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="sendconfirm('Forms')">确认</el-button>
</div>
</el-dialog>
<el-dialog <el-dialog
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
@ -364,9 +238,7 @@ const defaulttask = {
members:"", members:"",
depts:"", depts:"",
}; };
const mbersData = {
checker:""
}
export default { export default {
components: { Pagination}, components: { Pagination},
@ -382,13 +254,10 @@ export default {
ids:[], ids:[],
subinsecttask:[], subinsecttask:[],
memberOptions:[], memberOptions:[],
inspectitemList:[],
mbersData:mbersData,
deptOptions:[], deptOptions:[],
leaders:[], leaders:[],
dialogType: "new", dialogType: "new",
data: {}, data: {},
listQuery:{},
}; };
}, },
created() { created() {
@ -455,7 +324,7 @@ export default {
}, },
//创建子任务 //创建子任务
async confirm(form) { async confirm(form) {
console.log(this.inspecttask)
this.inspecttask.inspecttask=this.$route.params.id; this.inspecttask.inspecttask=this.$route.params.id;
createsubinspecttask(this.inspecttask).then((res) => { createsubinspecttask(this.inspecttask).then((res) => {
@ -496,65 +365,29 @@ export default {
}) })
}, },
createChildtask()
{
this.inspecttask = Object.assign({}, defaulttask);
this.dialogVisible = true;
},
clickRow(row, col, e) { clickRow(row, col, e) {
this.listLoading2 = true; this.listLoading2 = true;
this.id = row.id; this.id = row.id;
this.subtask=row.id; this.$router.push({name: "myTaskdos", params: { id: this.id,leaders:row.members }, })
this.getsubinspecttaskdep();
this.leaders = row.members;
}, },
//增加巡检组织
adddept()
{
},
//点击组织弹出清单
getinspectrecordlist() {
getinspectrecordlist(this.listQuery)
.then((res) => {
this.inspectitemList = res.data;
}) handleClick(scope) {
},
recorclickRow(row, col, e) {
this.listLoading2 = true; this.listLoading2 = true;
this.listQuery = {pageoff:true, subtask: this.subtask, dept: row.dept } this.$router.push({name: "myTaskdos", params: { id: scope.row.id,leaders:scope.row.members }, })
this.getinspectrecordlist();
}, },
handleSelectionChange(val){
      this.multipleSelection = val;
},
sendconfirm(){
const lengths = this.multipleSelection.length;
for (let i = 0; i < lengths; i++) {
this.ids.push(this.multipleSelection[i].id);
}
console.log(lengths)
//let data = { records: this.ids };//检查项ID
this.mbersData.records=this.ids
console.log(this.mbersData)
addappoint(this.mbersData).then((res) => {
this.dialogFormVisible = false;
this.getinspectrecordlist();
this.$message.success("成功");
});
}
}, },
}; };
</script> </script>

View File

@ -12,7 +12,7 @@
max-height="600" max-height="600"
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column align="center" label="级任务"> <el-table-column align="center" label="级任务">
<template slot-scope="scope">{{ scope.row.inspecttask_.name }}</template> <template slot-scope="scope">{{ scope.row.inspecttask_.name }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="开始巡查时间"> <el-table-column align="center" label="开始巡查时间">
@ -26,7 +26,8 @@
<template slot-scope="scope">{{ scope.row.name }}</template> <template slot-scope="scope">{{ scope.row.name }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="任务状态"> <el-table-column align="center" label="任务状态">
<template slot-scope="scope">{{ scope.row.state }}</template> <template slot-scope="scope">
{{ scope.row.state }}</template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="巡查公司数"> <el-table-column align="center" label="巡查公司数">
<template slot-scope="scope">{{ scope.row.depts_count }}</template> <template slot-scope="scope">{{ scope.row.depts_count }}</template>
@ -107,7 +108,7 @@ export default {
}); });
}, },
handleClick(scope){ handleClick(scope){
this.$router.push({name: "myTaskdos", params: { id: scope.row.id }, }) this.$router.push({name: "myTaskdos", params: { id: scope.row.id,leaders:scope.row.members }, })
}, },
handleFilter() { handleFilter() {

View File

@ -37,7 +37,9 @@
" "
@click="handleStartup(scope)">开始检查</el-button> @click="handleStartup(scope)">开始检查</el-button>
<el-button type="primary" <el-button type="primary" v-if="
scope.row.state == '检测中'
"
@click="handleCheckup(scope)">组长提交</el-button> @click="handleCheckup(scope)">组长提交</el-button>
@ -47,18 +49,24 @@
</el-table> </el-table>
</el-card> </el-card>
<el-card class="box-card" style="float:right;width: 55%;"> <el-card class="box-card" style="float:right;width: 55%;">
<el-button type="primary" @click="dialogFormVisible=true">指派任务</el-button>
<el-table <el-table
:data="inspectitemList" :data="inspectitemList"
fit fit
stripe stripe
highlight-current-row highlight-current-row
style="width: 100%"> style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column <el-table-column
label="检查要点" label="检查要点"
width="280"> width="230">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.item_.name }} {{ scope.row.item_.name }}
@ -104,6 +112,42 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog
:visible.sync="dialogFormVisible"
:title="dialogType === 'edit' ? '编辑任务' : '指派人员'"
>
<el-form
ref="Forms"
:model="mbersData"
label-width="80px"
label-position="right"
>
<el-form-item label="负责人" prop="checker">
<el-select
v-model="mbersData.checker"
style="width: 100%"
allow-create
default-first-option
placeholder="请选择组长">
<el-option
v-for="item in leaders"
:key="item.member"
:label="item.member__name"
:value="item.member">
</el-option>
</el-select>
</el-form-item>
</el-form>
<div style="text-align: right">
<el-button type="danger" @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="sendconfirm('Forms')">确认</el-button>
</div>
</el-dialog>
<el-drawer <el-drawer
title="任务检查" title="任务检查"
@ -167,7 +211,8 @@
</div> </div>
</template> </template>
<script> <script>
import {getsubinspecttaskdep,getinspectrecordlist,updateinspectrecord,getinspectrecord,upinspectdept,gettaskdepstart} from "@/api/subinspecttask"; import {getsubinspecttaskdep,getinspectrecordlist,updateinspectrecord,getinspectrecord,upinspectdept,gettaskdepstart,addappoint} from "@/api/subinspecttask";
import { upUrl, upHeaders } from "@/api/file"; import { upUrl, upHeaders } from "@/api/file";
import Pagination from "@/components/Pagination"; import Pagination from "@/components/Pagination";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
@ -184,6 +229,7 @@ export default {
listLoading: true, listLoading: true,
dialog:false, dialog:false,
recordList:[], recordList:[],
dialogFormVisible:false,
inspectitemList:[], inspectitemList:[],
deptOptions:[], deptOptions:[],
leaders:[], leaders:[],
@ -191,6 +237,8 @@ export default {
listQuery:{}, listQuery:{},
inspectrecord:null, inspectrecord:null,
require:"", require:"",
ids:[],
mbersData:mbersData,
upHeaders: upHeaders(), upHeaders: upHeaders(),
upUrl: upUrl(), upUrl: upUrl(),
fileList: [], fileList: [],
@ -213,6 +261,8 @@ export default {
}, },
created() { created() {
this.id = this.$route.params.id; this.id = this.$route.params.id;
this.leaders = this.$route.params.leaders;
console.log(this.leaders)
this.getsubinspecttaskdep();//主任务信息 this.getsubinspecttaskdep();//主任务信息
}, },
@ -340,8 +390,35 @@ export default {
upinspectdept(scope.row.id).then((res) => { upinspectdept(scope.row.id).then((res) => {
this.$message.success("提交成功"); this.$message.success("提交成功");
this.getinspectrecordlist();
this.getsubinspecttaskdep()
}) })
},
handleSelectionChange(val){
      this.multipleSelection = val;
},
//组长指派人员
sendconfirm(){
const lengths = this.multipleSelection.length;
for (let i = 0; i < lengths; i++) {
this.ids.push(this.multipleSelection[i].id);
}
this.mbersData.records=this.ids
console.log()
addappoint(this.mbersData).then((res) => {
this.dialogFormVisible = false;
this.getinspectrecordlist();
this.$message.success("成功");
});
}, },
//组长提交开始检查 //组长提交开始检查
handleStartup(scope){ handleStartup(scope){
@ -350,7 +427,8 @@ export default {
this.getinspectrecordlist(); this.getinspectrecordlist();
this.getsubinspecttaskdep() this.getsubinspecttaskdep()
}) })
} },
}, },