xunjianrenwu
This commit is contained in:
parent
eb23199d31
commit
647f6e17a2
|
@ -69,4 +69,18 @@ export function deleteQualityinspect(id, data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
export function creatInspectdept(data){
|
||||
return request({
|
||||
url: '/quality/inspectdept/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function deleteInspectdept(id, data) {
|
||||
return request({
|
||||
url: `/quality/inspectdept/${id}/`,
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ export default {
|
|||
});
|
||||
},
|
||||
handleDo(scope) {
|
||||
this.$router.push({name: "InpectTaskdo", params: { id: scope.row.id }, })
|
||||
this.$router.push({name: "InpectTaskdo", params: { inpecttask: scope.row.id }, })
|
||||
},
|
||||
handleEdit(scope) {
|
||||
this.task = Object.assign({}, scope.row); // copy obj
|
||||
|
|
|
@ -164,7 +164,7 @@
|
|||
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="选择组织" prop="leader">
|
||||
<el-form-item label="选择组织" prop="depts">
|
||||
|
||||
<el-select
|
||||
v-model="inspecttask.depts"
|
||||
|
@ -261,7 +261,7 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.task.id = this.$route.params.id;
|
||||
this.task.id = this.$route.params.inpecttask;
|
||||
this.getinspecttask();//主任务信息
|
||||
|
||||
this.getUserList();//组员
|
||||
|
@ -279,7 +279,7 @@ export default {
|
|||
},
|
||||
//子任务信息
|
||||
getsubinspecttasklist(){
|
||||
getsubinspecttasklist({pageoff:true}).then((res)=>{
|
||||
getsubinspecttasklist({pageoff:true,inpecttask:this.$route.params.inpecttask}).then((res)=>{
|
||||
this.subinsecttask=res.data;
|
||||
});
|
||||
},
|
||||
|
@ -321,7 +321,7 @@ export default {
|
|||
//创建子任务
|
||||
async confirm(form) {
|
||||
|
||||
this.inspecttask.inspecttask=this.$route.params.id;
|
||||
this.inspecttask.inspecttask=this.$route.params.inpecttask;
|
||||
|
||||
createsubinspecttask(this.inspecttask).then((res) => {
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card style="float:left;width: 45%;">
|
||||
|
||||
<el-button type="primary" @click="dialogVisibles=true">增加组织</el-button>
|
||||
<el-table
|
||||
:data="recordList"
|
||||
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
@row-click="deptClick"
|
||||
>
|
||||
<el-table-column
|
||||
label="组织名称"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-link @click="recorclickRow(scope)" type="primary"> {{ scope.row.dept__name }}</el-link>
|
||||
{{ scope.row.dept__name }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -29,13 +29,17 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="danger"
|
||||
@click="handleDelete(scope)"
|
||||
>删除</el-button>
|
||||
<el-button type="warning" v-if="
|
||||
scope.row.state == '待检查'
|
||||
"
|
||||
@click="handleStartup(scope)">开始检查</el-button>
|
||||
|
||||
<el-button type="primary" v-if="
|
||||
scope.row.state == '检测中'
|
||||
scope.row.state == '检查中'
|
||||
"
|
||||
@click="handleCheckup(scope)">组长提交</el-button>
|
||||
|
||||
|
@ -53,6 +57,7 @@
|
|||
stripe
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
|
@ -145,7 +150,41 @@
|
|||
<el-button type="primary" @click="sendconfirm('Forms')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisibles"
|
||||
|
||||
>
|
||||
<el-form
|
||||
ref="Formss"
|
||||
label-width="80px"
|
||||
label-position="right"
|
||||
:model="inspectDept"
|
||||
|
||||
>
|
||||
|
||||
<el-form-item label="选择组织" prop="leader">
|
||||
<el-select
|
||||
filterable
|
||||
style="width: 100%"
|
||||
allow-create
|
||||
v-model="inspectDept.dept"
|
||||
default-first-option
|
||||
placeholder="请选择组织">
|
||||
<el-option
|
||||
v-for="item in deptOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisibles = false">取消</el-button>
|
||||
<el-button type="primary" @click="addDept('Formss')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-drawer
|
||||
title="任务检查"
|
||||
:before-close="handleClose"
|
||||
|
@ -210,6 +249,9 @@
|
|||
<script>
|
||||
import {getsubinspecttaskdep,getinspectrecordlist,updateinspectrecord,getinspectrecord,upinspectdept,gettaskdepstart,addappoint} from "@/api/subinspecttask";
|
||||
|
||||
import { genTree } from "@/utils";
|
||||
import { getOrgList } from "@/api/org";
|
||||
import {deleteInspectdept,creatInspectdept} from "@/api/qualityinspect"
|
||||
import { upUrl, upHeaders } from "@/api/file";
|
||||
import Pagination from "@/components/Pagination";
|
||||
import checkPermission from "@/utils/permission";
|
||||
|
@ -218,6 +260,9 @@ import checkPermission from "@/utils/permission";
|
|||
const mbersData = {
|
||||
checker:""
|
||||
}
|
||||
const inspectdept = {
|
||||
dept:null,
|
||||
}
|
||||
export default {
|
||||
components: { Pagination},
|
||||
|
||||
|
@ -226,10 +271,12 @@ export default {
|
|||
listLoading: true,
|
||||
dialog:false,
|
||||
recordList:[],
|
||||
dialogVisibles:false,
|
||||
dialogFormVisible:false,
|
||||
inspectitemList:[],
|
||||
deptOptions:[],
|
||||
leaders:[],
|
||||
inspectDept:inspectdept,
|
||||
dialogType: "new",
|
||||
listQuery:{},
|
||||
inspectrecord:null,
|
||||
|
@ -259,7 +306,7 @@ export default {
|
|||
created() {
|
||||
this.id = this.$route.params.id;
|
||||
this.leaders = this.$route.params.leaders;
|
||||
console.log(this.leaders)
|
||||
this.getOrgList();
|
||||
this.getsubinspecttaskdep();//主任务信息
|
||||
},
|
||||
|
||||
|
@ -280,15 +327,23 @@ export default {
|
|||
|
||||
},
|
||||
|
||||
//组织列表
|
||||
getOrgList() {
|
||||
getOrgList({can_supervision:true}).then((res) => {
|
||||
this.deptOptions = genTree(res.data);
|
||||
|
||||
|
||||
recorclickRow(scope) {
|
||||
|
||||
});
|
||||
},
|
||||
//点击组织弹出检查项
|
||||
deptClick(row){
|
||||
this.listLoading2 = true;
|
||||
this.listQuery = {pageoff:true, subtask: this.id, dept:scope.row.dept}
|
||||
this.listQuery = {pageoff:true, subtask: row.subtask, dept:row.dept}
|
||||
|
||||
this.getinspectrecordlist();
|
||||
|
||||
},
|
||||
|
||||
|
||||
//点击组织弹出清单
|
||||
getinspectrecordlist() {
|
||||
getinspectrecordlist(this.listQuery)
|
||||
|
@ -408,7 +463,7 @@ export default {
|
|||
|
||||
|
||||
this.mbersData.records=this.ids
|
||||
console.log()
|
||||
console.log(this.mbersData)
|
||||
addappoint(this.mbersData).then((res) => {
|
||||
|
||||
this.dialogFormVisible = false;
|
||||
|
@ -426,10 +481,38 @@ export default {
|
|||
this.getsubinspecttaskdep()
|
||||
})
|
||||
},
|
||||
handleDelete(scope) {
|
||||
this.$confirm("确认删除?", "警告", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "error",
|
||||
})
|
||||
.then(async () => {
|
||||
await deleteInspectdept(scope.row.id);
|
||||
this.getsubinspecttaskdep()
|
||||
this.$message.success("成功");
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
},
|
||||
//增加待巡检的公司
|
||||
addDept(){
|
||||
console.log(this.inspectDept);
|
||||
this.inspectDept.subtask=this.$route.params.id;
|
||||
|
||||
creatInspectdept(this.inspectDept).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.getsubinspecttaskdep();
|
||||
this.dialogVisibles = false;
|
||||
this.$message.success("成功");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue