renwuzhixing
This commit is contained in:
parent
5df8ebc4f0
commit
7949cc9c7d
|
@ -3,6 +3,7 @@ ENV = 'development'
|
|||
|
||||
# base api
|
||||
VUE_APP_BASE_API = 'http://10.0.11.127:8000/api'
|
||||
#VUE_APP_BASE_API = 'http://127.0.0.1:8000/api'
|
||||
|
||||
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
|
||||
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
//质量巡查----巡查表
|
||||
|
||||
export function getinspecttasklist(query) {
|
||||
return request({
|
||||
|
@ -24,13 +24,7 @@ export function createinspecttask(data) {
|
|||
})
|
||||
}
|
||||
|
||||
export function updateinspecttask(id, data) {
|
||||
return request({
|
||||
url: `/quality/inspecttask/${id}/`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function deleteinspecttask(id, data) {
|
||||
return request({
|
||||
|
@ -40,60 +34,3 @@ export function deleteinspecttask(id, data) {
|
|||
})
|
||||
}
|
||||
|
||||
export function initinspecttask(id, data) {
|
||||
return request({
|
||||
url: `/quality/inspecttask/${id}/init/`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function appendinspecttask(id, data) {
|
||||
return request({
|
||||
url: `/quality/inspecttask/${id}/append/`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getinspecttaskcontents(id) {
|
||||
return request({
|
||||
url: `/quality/inspecttask/${id}/contents/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getinspecttaskdepts(id) {
|
||||
return request({
|
||||
url: `/quality/inspecttask/${id}/depts/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function startinspecttask(id) {
|
||||
return request({
|
||||
url: `/quality/inspecttask/${id}/start/`,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function closeinspecttask(id) {
|
||||
return request({
|
||||
url: `/quality/inspecttask/${id}/close/`,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
export function getinspecttaskdeptall(id) {
|
||||
return request({
|
||||
url: `/quality/inspecttask/${id}/deptall/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function getmyinspecttasklist(query) {
|
||||
return request({
|
||||
url: '/quality/inspecttask/self/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
|
@ -7,9 +7,6 @@ export function getInspectionList(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function createInspection(data) {
|
||||
return request({
|
||||
url: '/ability/inspection/',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
|
||||
//质量巡检----检查表
|
||||
|
||||
|
||||
export function getQualityinspectList(query) {
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
import request from '@/utils/request'
|
||||
//质量巡查----子任务
|
||||
|
||||
export function getsubinspecttasklist(query) {
|
||||
return request({
|
||||
url: '/quality/subinspecttask/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function getsubinspecttaskselflist(query) {
|
||||
return request({
|
||||
url: '/quality/subinspecttask/self/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getsubinspecttask(id) {
|
||||
return request({
|
||||
url: `/quality/subinspecttask/${id}/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function starttask(id) {
|
||||
return request({
|
||||
url: `/quality/inspecttask/${id}/start/`,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
export function updatesubinspecttask(id) {
|
||||
return request({
|
||||
url: `/quality/subinspecttask/${id}/`,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
export function createsubinspecttask(data) {
|
||||
return request({
|
||||
url: '/quality/subinspecttask/',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function getsubinspecttaskdep(id) {
|
||||
return request({
|
||||
url: `/quality/subinspecttask/${id}/depts/`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getinspectrecordlist(query) {
|
||||
return request({
|
||||
url: '/quality/inspectrecord/',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function deletesubinspecttask(id, data) {
|
||||
return request({
|
||||
url: `/quality/subinspecttask/${id}/`,
|
||||
method: 'delete',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function addappoint(data) {
|
||||
return request({
|
||||
url: '/quality/inspectrecord/appoint/ ',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ export const asyncRoutes = [
|
|||
component: Layout,
|
||||
redirect: '/qualityinspect/task',
|
||||
name: 'Qualityinspect',
|
||||
meta: { title: '质量巡查', icon: 'inspect', perms: ['qualityinspect_view'] },
|
||||
meta: { title: '质量巡查', icon: 'inspect', perms: ['qualityinspect'] },
|
||||
alwaysShow: true,
|
||||
children: [
|
||||
{
|
||||
|
@ -178,6 +178,21 @@ export const asyncRoutes = [
|
|||
meta: { title: '报送任务执行', perms: ['task_view'] },
|
||||
hidden: true
|
||||
},
|
||||
|
||||
{
|
||||
path: 'myinspecttask',
|
||||
name: 'myinspectTask',
|
||||
component: () => import('@/views/qualityinspect/mytask.vue'),
|
||||
meta: { title: '我的任务', perms: ['my_inspecttask'] }
|
||||
},
|
||||
{
|
||||
path:'mytaskdos/:id',
|
||||
name: 'myTaskdos',
|
||||
component: () => import('@/views/qualityinspect/mytaskdo.vue'),
|
||||
meta: { title: '任务执行', perms: ['my_inspecttask'] },
|
||||
hidden: true
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -204,9 +204,6 @@ export default {
|
|||
this.$nextTick(() => {
|
||||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
},
|
||||
handleCreate2() {
|
||||
|
||||
},
|
||||
handleDo(scope) {
|
||||
this.$router.push({name: "InpectTaskdo", params: { id: scope.row.id }, })
|
||||
|
|
|
@ -40,102 +40,222 @@
|
|||
</el-row>
|
||||
|
||||
</div>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="starttask()"
|
||||
v-if="task.state != '已完成'"
|
||||
size="small"
|
||||
>发布任务</el-button
|
||||
>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card style="margin-top: 2px">
|
||||
<div slot="header" class="clearfix">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||
<el-button type="primary" icon="el-icon-plus" @click="dialogVisible = true"
|
||||
>创建子任务</el-button
|
||||
>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
<el-table
|
||||
:data="subinsecttask"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
max-height="400px"
|
||||
style="margin-top:2px"
|
||||
max-height="300"
|
||||
@row-click="clickRow"
|
||||
>
|
||||
<el-table-column type="selection" align="center" width="55" />
|
||||
<el-table-column label="序号" type="index" align="center" width="55" />
|
||||
<el-table-column label="材料">
|
||||
<template slot-scope="scope">{{ scope.row.content_name }}</template>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column align="center" label="子任务">
|
||||
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="danger" v-if="scope.row.state == '待报送'">{{
|
||||
scope.row.state
|
||||
}}</el-tag>
|
||||
<el-tag
|
||||
type="warning"
|
||||
v-else-if="
|
||||
scope.row.state == '待整改' || scope.row.state == '待发布'
|
||||
"
|
||||
>{{ scope.row.state }}</el-tag
|
||||
>
|
||||
<el-tag type="success" v-else-if="scope.row.state == '已确认'">{{
|
||||
scope.row.state
|
||||
}}</el-tag>
|
||||
<el-tag v-else-if="scope.row.state == '已报送'">{{
|
||||
scope.row.state
|
||||
}}</el-tag>
|
||||
</template>
|
||||
<el-table-column align="center" label="巡检人员">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="item in scope.row.members" v-bind:key="item.member">
|
||||
|
||||
<el-tag v-if="item.type=='组长'" effect="plain">{{
|
||||
item.member__name
|
||||
}}</el-tag>
|
||||
<el-tag type="danger" effect="plain" v-else>{{
|
||||
item.member__name
|
||||
}}</el-tag>
|
||||
</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报送要求/备注">
|
||||
<template slot-scope="scope">{{ scope.row.note }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否适用">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.is_yes" effect="plain">是</el-tag>
|
||||
<el-tag type="danger" effect="plain" v-else>否</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="报送情况">
|
||||
<template slot-scope="scope" v-if="scope.row.up_user_"
|
||||
>{{ scope.row.up_user_.name }}/{{ scope.row.up_date }}</template
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="报送说明">
|
||||
<template slot-scope="scope" >{{ scope.row.noteb}}</template
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column label="文件">
|
||||
<template slot-scope="scope" v-if="scope.row.files">
|
||||
<el-link
|
||||
v-if="scope.row.files.length > 1"
|
||||
@click="handleRecord({ action: 'view', record: scope.row })"
|
||||
>有
|
||||
<span style="color: red">{{ scope.row.files.length }}</span>
|
||||
个文件</el-link
|
||||
>
|
||||
<div v-else v-for="item in scope.row.files_" v-bind:key="item.id">
|
||||
<el-link :href="item.path" target="_blank" type="primary">{{
|
||||
item.name
|
||||
}}</el-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table-column align="center" label="发布状态">
|
||||
<template slot-scope="scope">{{ scope.row.state }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="240px"
|
||||
width="200px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-link
|
||||
v-if="checkPermission(['record_delete'])"
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope)"
|
||||
/>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
@click="handleRecord({ action: 'delete', record: scope.row })"
|
||||
>删除</el-link
|
||||
>
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
|
||||
<el-card style="float:left;width: 30%;">
|
||||
<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="组织名称"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
|
||||
{{ scope.row.dept__name }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查状态"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-tag size="medium">{{ scope.row.state }}</el-tag>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDeletes(scope.$index, scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<el-card class="box-card" style="float:right;width: 70%;">
|
||||
<el-button type="primary" icon="el-icon-plus" @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="检查类别"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
|
||||
{{ scope.row.item_.cate_name }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查要点"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
|
||||
{{ scope.row.item_.name }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查类型"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
|
||||
{{ scope.row.item_.type }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查人"
|
||||
width="180">
|
||||
<template slot-scope="scope" v-if="scope.row.checker_">
|
||||
|
||||
{{ scope.row.checker_.name }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否检查"
|
||||
width="180">
|
||||
<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
|
||||
:visible.sync="dialogVisible"
|
||||
:title="dialogType === 'edit' ? '编辑任务' : '新增任务'"
|
||||
|
@ -152,8 +272,6 @@
|
|||
<el-form-item label="选择组长" prop="leader">
|
||||
<el-select
|
||||
v-model="inspecttask.leader"
|
||||
multiple
|
||||
filterable
|
||||
style="width: 100%"
|
||||
allow-create
|
||||
default-first-option
|
||||
|
@ -170,7 +288,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="选择组员" prop="member">
|
||||
<el-select
|
||||
v-model="inspecttask.member"
|
||||
v-model="inspecttask.members"
|
||||
multiple
|
||||
filterable
|
||||
style="width: 100%"
|
||||
|
@ -190,7 +308,7 @@
|
|||
<el-form-item label="选择组织" prop="leader">
|
||||
|
||||
<el-select
|
||||
v-model="inspecttask.dept"
|
||||
v-model="inspecttask.depts"
|
||||
multiple
|
||||
filterable
|
||||
style="width: 100%"
|
||||
|
@ -215,6 +333,19 @@
|
|||
|
||||
</div>
|
||||
</template>
|
||||
<style>
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width: 50%;
|
||||
}
|
||||
</style>
|
||||
<style >
|
||||
.term {
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
|
@ -234,7 +365,8 @@
|
|||
}
|
||||
</style>
|
||||
<script>
|
||||
import { getinspecttask, createinspecttask } from "@/api/inspectTask";
|
||||
import { getinspecttask } from "@/api/inspectTask";
|
||||
import { getsubinspecttasklist,createsubinspecttask,starttask,deletesubinspecttask,getsubinspecttaskdep,getinspectrecordlist,addappoint} from "@/api/subinspecttask";
|
||||
import { getUserList } from "@/api/user";
|
||||
import { getOrgList } from "@/api/org";
|
||||
import { genTree } from "@/utils";
|
||||
|
@ -244,9 +376,12 @@ import checkPermission from "@/utils/permission";
|
|||
const defaulttask = {
|
||||
name: "",
|
||||
leader:"",
|
||||
member:"",
|
||||
dept:"",
|
||||
members:"",
|
||||
depts:"",
|
||||
};
|
||||
const mbersData = {
|
||||
checker:""
|
||||
}
|
||||
export default {
|
||||
components: { Pagination},
|
||||
|
||||
|
@ -255,11 +390,17 @@ export default {
|
|||
task: { id: 0 },
|
||||
inspecttask: defaulttask,
|
||||
dialogVisible: false,
|
||||
dialogFormVisible:false,
|
||||
listLoading: true,
|
||||
leaderOptions:[],
|
||||
recordList:[],
|
||||
ids:[],
|
||||
subinsecttask:[],
|
||||
memberOptions:[],
|
||||
inspectitemList:[],
|
||||
mbersData:mbersData,
|
||||
deptOptions:[],
|
||||
dialogVisible: false,
|
||||
leaders:[],
|
||||
dialogType: "new",
|
||||
data: {},
|
||||
listQuery:{},
|
||||
|
@ -271,6 +412,7 @@ export default {
|
|||
this.getTypeAll();//组长
|
||||
this.getUserList();//组员
|
||||
this.getOrgList();//组织
|
||||
this.getsubinspecttasklist();//子任务名
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
|
@ -281,6 +423,12 @@ export default {
|
|||
|
||||
});
|
||||
},
|
||||
//子任务信息
|
||||
getsubinspecttasklist(){
|
||||
getsubinspecttasklist({pageoff:true}).then((res)=>{
|
||||
this.subinsecttask=res.data;
|
||||
});
|
||||
},
|
||||
//组长列表
|
||||
getTypeAll() {
|
||||
getUserList({pageoff:true}).then((res) => {
|
||||
|
@ -308,15 +456,122 @@ export default {
|
|||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
},
|
||||
|
||||
starttask() {
|
||||
this.$confirm("确认发布任务吗?", "提示")
|
||||
.then(async () => {
|
||||
await starttask(this.task.id);
|
||||
location.reload();
|
||||
this.$message.success("成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
},
|
||||
//创建子任务
|
||||
async confirm(form) {
|
||||
//创建子任务
|
||||
createinspecttask(this.deptOptions).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
console.log(this.inspecttask)
|
||||
this.inspecttask.inspecttask=this.$route.params.id;
|
||||
|
||||
createsubinspecttask(this.inspecttask).then((res) => {
|
||||
|
||||
this.dialogVisible = false;
|
||||
this.getsubinspecttasklist()
|
||||
this.$message.success("成功");
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
//子任务删除
|
||||
handleDelete(scope){
|
||||
|
||||
this.$confirm("确认删除?", "警告", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "error",
|
||||
})
|
||||
.then(async () => {
|
||||
await deletesubinspecttask(scope.row.id);
|
||||
this.getsubinspecttasklist()
|
||||
this.$message.success("成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
},
|
||||
//子任务编辑
|
||||
handleEdit(){
|
||||
|
||||
},
|
||||
//点击子任务,弹出巡检的公司
|
||||
getsubinspecttaskdep() {
|
||||
getsubinspecttaskdep(this.id)
|
||||
.then((res) => {
|
||||
this.recordList = res.data;
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
clickRow(row, col, e) {
|
||||
this.listLoading2 = true;
|
||||
this.id = row.id;
|
||||
this.subtask=row.id;
|
||||
|
||||
this.getsubinspecttaskdep();
|
||||
|
||||
this.leaders = row.members;
|
||||
|
||||
|
||||
},
|
||||
//增加巡检组织
|
||||
adddept()
|
||||
{
|
||||
|
||||
},
|
||||
//点击组织弹出清单
|
||||
getinspectrecordlist() {
|
||||
getinspectrecordlist(this.listQuery)
|
||||
.then((res) => {
|
||||
this.inspectitemList = res.data;
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
recorclickRow(row, col, e) {
|
||||
this.listLoading2 = true;
|
||||
this.listQuery = {pageoff:true, subtask: this.subtask, dept: row.dept }
|
||||
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);
|
||||
}
|
||||
|
||||
//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>
|
|
@ -0,0 +1,120 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-card style="margin-top: 10px">
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="subinspecttasklist"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
max-height="600"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column align="center" label="父级任务">
|
||||
<template slot-scope="scope">{{ scope.row.inspecttask_.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="开始巡查时间">
|
||||
<template slot-scope="scope">{{ scope.row.inspecttask_.start_date }}</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="结束巡查时间">
|
||||
<template slot-scope="scope">{{ scope.row.inspecttask_.end_date }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="任务名称">
|
||||
<template slot-scope="scope">{{ scope.row.name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="任务状态">
|
||||
<template slot-scope="scope">{{ scope.row.state }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="巡查公司数">
|
||||
<template slot-scope="scope">{{ scope.row.depts_count }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="组长">
|
||||
<template slot-scope="scope">
|
||||
<span v-for="item in scope.row.members" v-bind:key="item.member">
|
||||
|
||||
<el-tag v-if="item.type=='组长'" effect="plain">{{
|
||||
item.member__name
|
||||
}}</el-tag>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="操作"
|
||||
width="200px"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-link @click="handleClick(scope)" type="primary">执行</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getsubinspecttaskselflist} from "@/api/subinspecttask";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import { getDictList, getDictTypeList } from "@/api/dict";
|
||||
const defaultinspectTable = {
|
||||
name: "",
|
||||
require: "",
|
||||
type: null,
|
||||
sortnum: null,
|
||||
};
|
||||
export default {
|
||||
components: { Pagination, Treeselect },
|
||||
data() {
|
||||
return {
|
||||
subinspecttasklist:[],
|
||||
listLoading: true,
|
||||
dialogVisible: false,
|
||||
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
filterOrgText(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
|
||||
|
||||
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
getsubinspecttaskselflist().then((response) => {
|
||||
if (response.data) {
|
||||
this.subinspecttasklist = response.data;
|
||||
}
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
handleClick(scope){
|
||||
this.$router.push({name: "myTaskdos", params: { id: scope.row.id }, })
|
||||
},
|
||||
|
||||
handleFilter() {
|
||||
this.listQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,285 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card style="float:left;width: 25%;">
|
||||
|
||||
<el-table
|
||||
:data="recordList"
|
||||
max-height="300"
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
@row-click="recorclickRow"
|
||||
>
|
||||
<el-table-column
|
||||
label="组织名称"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
|
||||
{{ scope.row.dept__name }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查状态"
|
||||
width="180">
|
||||
<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: 75%;">
|
||||
|
||||
<el-table
|
||||
:data="inspectitemList"
|
||||
max-height="300"
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
style="width: 100%">
|
||||
|
||||
<el-table-column
|
||||
label="检查类别"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
|
||||
{{ scope.row.item_.cate_name }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查要点"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
|
||||
{{ scope.row.item_.name }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查类型"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
|
||||
{{ scope.row.item_.type }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="取证要求"
|
||||
width="180">
|
||||
<template slot-scope="scope">
|
||||
|
||||
{{ scope.row.item_.require }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="检查人"
|
||||
width="180">
|
||||
<template slot-scope="scope" v-if="scope.row.checker_">
|
||||
|
||||
{{ scope.row.checker_.name }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="检查状态"
|
||||
width="150">
|
||||
<template slot-scope="scope" >
|
||||
<span v-if="scope.row.checked">已检查</span>
|
||||
<span v-else>未检查</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-button
|
||||
@click="handleCheck(scope.row)">提交结果</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<el-drawer
|
||||
title="任务检查"
|
||||
:before-close="handleClose"
|
||||
:visible.sync="dialog"
|
||||
direction="ltr"
|
||||
custom-class="demo-drawer"
|
||||
ref="drawer"
|
||||
>
|
||||
<div class="demo-drawer__content">
|
||||
<el-form :model="form">
|
||||
|
||||
<el-form-item label="检查结果" :label-width="formLabelWidth">
|
||||
<el-select v-model="form.region" placeholder="请选择活动区域">
|
||||
<el-option label="区域一" value="shanghai"></el-option>
|
||||
<el-option label="区域二" value="beijing"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="检查说明" :label-width="formLabelWidth">
|
||||
<el-input v-model="form.name" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件列表">
|
||||
<el-upload
|
||||
|
||||
ref="upload"
|
||||
multiple
|
||||
accept="image/*,.ppt,.pdf,.doc,.docx,.xls,.xlsx"
|
||||
>
|
||||
<el-button size="small" type="primary">上传文件</el-button>
|
||||
<span class="el-upload__tip">
|
||||
可上传多个pdf,word,ppt,excel,图片文件,单文件大小不超过50M
|
||||
</span>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<div
|
||||
v-for="(item, index) in fileList"
|
||||
v-bind:key="item.id"
|
||||
style="margin-top: 2px"
|
||||
>
|
||||
<i
|
||||
class="el-icon-delete"
|
||||
@click="deleteFile(index)"
|
||||
style="color: red"
|
||||
v-if="data.action == 'up'"
|
||||
></i>
|
||||
<el-link :href="item.path" target="_blank" type="primary">{{
|
||||
item.name
|
||||
}}</el-link>
|
||||
</div>
|
||||
</el-form>
|
||||
<div class="demo-drawer__footer">
|
||||
<el-button @click="cancelForm">取 消</el-button>
|
||||
<el-button type="primary" @click="$refs.drawer.closeDrawer()" :loading="loading">{{ loading ? '提交中 ...' : '确 定' }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getsubinspecttaskdep,getinspectrecordlist,addappoint} from "@/api/subinspecttask";
|
||||
|
||||
import Pagination from "@/components/Pagination";
|
||||
import checkPermission from "@/utils/permission";
|
||||
|
||||
const defaulttask = {
|
||||
name: "",
|
||||
leader:"",
|
||||
members:"",
|
||||
depts:"",
|
||||
};
|
||||
const mbersData = {
|
||||
checker:""
|
||||
}
|
||||
export default {
|
||||
components: { Pagination},
|
||||
|
||||
data() {
|
||||
return {
|
||||
inspecttask: defaulttask,
|
||||
listLoading: true,
|
||||
dialog:false,
|
||||
recordList:[],
|
||||
inspectitemList:[],
|
||||
deptOptions:[],
|
||||
leaders:[],
|
||||
dialogType: "new",
|
||||
listQuery:{},
|
||||
|
||||
table: false,
|
||||
dialog: false,
|
||||
loading: false,
|
||||
|
||||
form: {
|
||||
name: '',
|
||||
|
||||
},
|
||||
formLabelWidth: '80px',
|
||||
timer: null,
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.id = this.$route.params.id;
|
||||
this.getsubinspecttaskdep();//主任务信息
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
|
||||
|
||||
|
||||
//巡检的公司
|
||||
getsubinspecttaskdep() {
|
||||
console.log(this.id)
|
||||
getsubinspecttaskdep(this.id)
|
||||
.then((res) => {
|
||||
this.recordList = res.data;
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
//点击组织弹出清单
|
||||
getinspectrecordlist() {
|
||||
getinspectrecordlist(this.listQuery)
|
||||
.then((res) => {
|
||||
this.inspectitemList = res.data;
|
||||
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
recorclickRow(row, col, e) {
|
||||
this.listLoading2 = true;
|
||||
this.listQuery = {pageoff:true, subtask: this.subtask, dept: row.dept }
|
||||
this.getinspectrecordlist();
|
||||
},
|
||||
|
||||
handleCheck(scope)
|
||||
{
|
||||
this.dialog=true;
|
||||
},
|
||||
|
||||
|
||||
|
||||
handleClose(done) {
|
||||
if (this.loading) {
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定要提交表单吗?')
|
||||
.then(_ => {
|
||||
this.loading = true;
|
||||
this.timer = setTimeout(() => {
|
||||
done();
|
||||
// 动画关闭需要一定的时间
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
}, 400);
|
||||
}, 2000);
|
||||
})
|
||||
.catch(_ => {});
|
||||
},
|
||||
cancelForm() {
|
||||
this.loading = false;
|
||||
this.dialog = false;
|
||||
clearTimeout(this.timer);
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue