lion 3 years ago
parent 3266867a68
commit 0c04e932a9

@ -327,7 +327,8 @@
this.id = ''
this.pictureList = []
this.mission_id = ''
this.mapform=[]
this.mapform=[]
this.$refs['dialog'].reset()
}
},
@ -352,6 +353,9 @@
// .xy-table-item-label {
// width: 160px;
// }
::v-deep .avue-input-map{
display: none;
}
::v-deep .site_id,::v-deep .address,::v-deep .lat,::v-deep .lon{
display: none;
}

@ -49,6 +49,32 @@
</div>
</div>
</template>
<template v-slot:is_audit>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>是否审批
</div>
<div class="xy-table-item-content">
<el-radio-group v-model="form.is_audit" @change='changeAudit'>
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</div>
</div>
</template>
<template v-slot:audit_admin_id v-if="form.is_audit==1">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>审批人
</div>
<div class="xy-table-item-content">
<el-select v-model="form.audit_admin_id" filterable clearable placeholder="请选择审批人" style="width: 400px;">
<el-option v-for="item in userdata" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:file_ids>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -70,7 +96,7 @@
</div>
<div class="xy-table-item-content">
<el-input v-model="form.content" :rows='5' type='textarea' placeholder="请输入说明" clearable
style="width:310px"></el-input>
style="width:400px"></el-input>
</div>
</div>
</template>
@ -113,35 +139,36 @@
</div>
</div>
</template>
<template v-slot:accept_department_ids v-if='form.name7==2&&form.type!=4'>
<template v-slot:accept_admin_ids v-if='form.name7==1'>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:600px'>
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="form.accept_department_ids" @change="handleCheckedDeptChange">
<el-checkbox @change="handleCheckedDeptSingleChange" v-for="dept in deptOptions" :label="dept.id"
:key="dept.id">{{dept.name}}</el-checkbox>
</el-checkbox-group>
<el-transfer filterable :titles="['待选择', '已选择']" :props="{key: 'id',label: 'name'}"
:filter-method="filterMethod" :format="{ noChecked: '${total}',hasChecked: '${checked}/${total}' }"
filter-placeholder="请选择参与人员" v-model="form.accept_admin_ids" :data="userdata">
</el-transfer>
</div>
</div>
</template>
<template v-slot:accept_admin_ids v-if='form.name7==1'>
<template v-slot:accept_department_ids v-if='form.name7==2&&form.type!=4'>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:600px'>
<el-transfer filterable :titles="['待选择', '已选择']" :props="{key: 'id',label: 'name'}"
:filter-method="filterMethod" :format="{ noChecked: '${total}',hasChecked: '${checked}/${total}' }"
filter-placeholder="请选择参与人员" v-model="form.accept_admin_ids" :data="userdata">
</el-transfer>
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="form.accept_department_ids" @change="handleCheckedDeptChange">
<el-checkbox @change="handleCheckedDeptSingleChange" v-for="dept in deptOptions" :label="dept.id"
:key="dept.id">{{dept.name}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</template>
<template v-slot:mission_groups v-if='form.name7==3&&form.type!=4'>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -150,7 +177,7 @@
<div class="xy-table-item-content" style='min-width:600px'>
<Button type='primary' @click="mission_groups_list.push({name:'',type:1,link_id:[]})"></Button>
<div v-for="(item,index) in mission_groups_list" style='margin:10px;margin-left:0'>
<div>
<div>
<Button style="margin-right:10px" @click="mission_groups_list.splice(index,1)"></Button>
组别{{item.name=mission_groups_name[index]}}
<el-radio-group v-model="item.type" @change='item.link_id=[]' style="margin:10px;margin-right:20px">
@ -164,7 +191,7 @@
<el-select v-if='item.type==2' v-model="item.link_id" clearable filterable multiple placeholder="请选择部门">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-select>
</div>
@ -251,6 +278,9 @@
unit_type: '',
start_date: '',
end_date: '',
is_audit: 0,
audit_admin_id: '',
audit_status: 1,
file_ids: '',
content: '',
@ -258,8 +288,8 @@
end_content: '',
type: '',
name7: 1,
accept_department_ids: [],
accept_admin_ids: [],
accept_department_ids: [],
mission_groups: []
},
mission_groups_list: [{
@ -302,10 +332,20 @@
if (e) {
this.form.accept_department_ids = []
this.form.accept_admin_ids = []
this.form.mission_groups = []
this.form.mission_groups = []
this.form.mission_groups_list = []
}
},
changeAudit(e) {
console.log("e",e)
if (e == 1) {
this.form.audit_status = 0
this.form.audit_admin_id = ''
} else {
this.form.audit_status = 1
this.form.audit_admin_id = 0
}
},
//
loadDeptOptions() {
listdept().
@ -324,7 +364,7 @@
page_size: 999
}).
then((res) => {
this.userdata = res.data?res.data.reverse():[];
this.userdata = res.data ? res.data.reverse() : [];
}).catch(error => {
console.log(error)
})
@ -376,23 +416,26 @@
unit_type: res?.unit_type,
start_date: res?.start_date,
end_date: res?.end_date,
is_audit: res.audit_admin_id ? 1 : 0,
audit_admin_id: res.audit_admin_id ? res.audit_admin_id : '',
audit_status: res.audit_status?res.audit_status:1,
file_ids: res?.file_ids,
content: res?.content,
end_type: res?.end_type,
end_content: res?.end_content,
name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids.length > 0 ? 1 : (res
.groups.length > 0 ? 3 : 1)),
accept_department_ids: res?.accept_department_ids,
accept_admin_ids: res?.accept_admin_ids,
accept_department_ids: res?.accept_department_ids,
mission_groups: res?.groups
}
this.mission_groups_list = []
for(var g of res.groups){
this.mission_groups_list.push({
name:g.name,
type:g.type,
link_id:g.link_id
})
}
this.mission_groups_list = []
for (var g of res.groups) {
this.mission_groups_list.push({
name: g.name,
type: g.type,
link_id: g.link_id
})
}
// this.mission_groups_list = res?.mission_groups
for (var f of res.files) {
@ -418,25 +461,40 @@
} else {
this.form.file_ids = []
}
if(this.form.name7==3 ){
if(this.mission_groups_list.length==0){
Message({
type: 'warning',
message: `请新增组别`
})
return
}
for(let k of this.mission_groups_list){
if(k.link_id.length==0){
Message({
type: 'warning',
message: `请选择小组成员`
})
return
}
}
if(this.form.is_audit==0){
this.form.audit_admin_id = 0
this.audit_status = 1
}else{
this.audit_status = 0
if(!this.form.audit_admin_id){
Message({
type: 'warning',
message: `请选择审批人`
})
return
}
}
// console.log("this.form",this.form)
// return
if (this.form.name7 == 3) {
if (this.mission_groups_list.length == 0) {
Message({
type: 'warning',
message: `请新增组别`
})
return
}
for (let k of this.mission_groups_list) {
if (k.link_id.length == 0) {
Message({
type: 'warning',
message: `请选择小组成员`
})
return
}
}
}
this.form.mission_groups = this.mission_groups_list
// return
if (this.type === 'add') {
@ -481,12 +539,12 @@
}
} else {
this.id = ''
this.pictureList = []
this.pictureList = []
this.mission_groups_list = [{
name: '',
type: 1,
link_id: []
}]
name: '',
type: 1,
link_id: []
}]
this.$refs['dialog'].reset()
}
}
@ -495,10 +553,13 @@
}
</script>
<style scoped lang="scss">
::v-deep .name7{
flex-basis: 100%;
<style scoped lang="scss">
::v-deep .name7,::v-deep .content,
::v-deep .end_type,
::v-deep .file_ids{
flex-basis: 100%;
}
::v-deep .type {
display: none;
}

@ -1,9 +0,0 @@
<template>
</template>
<script>
</script>
<style>
</style>

@ -0,0 +1,383 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="'审核'" :form="form"
@submit="submit">
<template v-slot:mission_name>
<el-divider>任务信息</el-divider>
<div>
<el-descriptions class="margin-top" :column="2" border>
<el-descriptions-item>
<template slot="label">
任务名称
</template>
{{showform.name?showform.name:''}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
任务类型
</template>
<div v-for="item in unitTypeList">
<span v-if="showform.unit_type==item.id">
{{item.value}}
</span>
</div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
开始日期
</template>
{{showform.start_date?showform.start_date:''}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
结束日期
</template>
{{showform.end_date?showform.end_date:''}}
</el-descriptions-item>
<el-descriptions-item :span="showform.audit_admin_id>0?'1':'2'">
<template slot="label">
是否审批
</template>
{{showform.audit_admin_id>0?"是":'否'}}
</el-descriptions-item>
<el-descriptions-item v-if="showform.audit_admin_id">
<template slot="label">
审批人
</template>
{{showform.audit_admin_id?showform.audit_admin_id:''}}
</el-descriptions-item>
<el-descriptions-item span='2'>
<template slot="label">
附件
</template>
<div v-for="item in pictureList">
<a :href="item.url">{{item.name}}</a>
</div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label" span='2'>
说明
</template>
{{showform.content?showform.content:''}}
</el-descriptions-item>
<el-descriptions-item span='2'>
<template slot="label">
任务完成要求
</template>
<div v-for="item in endTypeList">
<span v-if="showform.end_type==item.id">
{{item.name}}
</span>
</div>
</el-descriptions-item>
<el-descriptions-item span='2'>
<template slot="label">
任务完成详情
</template>
{{showform.end_content?showform.end_content:''}}
</el-descriptions-item>
<el-descriptions-item span='2'>
<template slot="label">
用户类型
</template>
<div v-if="showform.accept_admin&&showform.accept_admin.length>0">
<el-tag style='margin-right:10px' v-for='item in showform.accept_admin'>
{{item.name}}
</el-tag>
</div>
<div v-if="showform.accept_department&&showform.accept_department.length>0">
<el-tag style='margin-right:10px' v-for='item in showform.accept_department'>
{{item.name}}
</el-tag>
</div>
<div v-if="showform.groups&&showform.groups.length>0">
<div v-for="group in showform.groups">
{{group.name}}:
<el-tag v-for="detail in group.details"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.name}}</el-tag>
</div>
</div>
</el-descriptions-item>
</el-descriptions>
</div>
</template>
<template v-slot:audit_status v-if="type=='check'">
<el-divider>审核</el-divider>
<div>
<el-select v-model="form.unit_type" filterable clearable placeholder="请选择状态" style="width: 400px;">
<el-option v-for="item in auditStatusList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</template>
<template v-slot:footerContent>
<Button v-if="type=='check'" type="primary"
style='margin-left:5px;margin-bottom:5px;' @click="submit">审核</Button>
<Button type="primary" ghost style='margin-left:5px;margin-bottom:5px;' @click="isShow=false"></Button>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
Message
} from 'element-ui'
import {
save,
get
} from "@/api/task/unit.js";
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id: '',
pictureList: [],
unitTypeList: [{
id: 1,
value: '专项检查'
}, {
id: 2,
value: '资料收集'
}, {
id: 3,
value: '网络安全'
}],
endTypeList: [{
id: 1,
name: '提交文字'
}, {
id: 2,
name: '提交附件'
}, {
id: 3,
name: '提交文字与附件'
}],
auditStatusList:[{
id:0,
value:'待审核'
},{
id:1,
value:'通过'
},{
id:2,
value:'不通过'
}],
showform:{},
form: {
mission_name:'',
type: '',
name: '',
unit_type: '',
start_date: '',
end_date: '',
is_audit: 0,
audit_admin_id: '',
audit_status: 1,
file_ids: '',
content: '',
end_type: '',
end_content: '',
type: '',
accept_admin_ids: [],
accept_department_ids: [],
mission_groups: []
},
mission_groups_list: [{
name: '',
type: 1,
link_id: []
}],
}
},
created() {
if (this.$route.path) {
let path = this.$route.path.split("_")
this.form.type = path[1]
}
},
methods: {
async getDetail() {
let res = await get(this.id)
console.log(res)
this.form = {
mission_name:'',
type: res?.type,
name: res?.name,
unit_type: res?.unit_type,
start_date: res?.start_date,
end_date: res?.end_date,
is_audit: res.audit_admin_id ? 1 : 0,
audit_admin_id: res.audit_admin_id ? res.audit_admin_id : '',
audit_status: res.audit_status?res.audit_status:1,
file_ids: res?.file_ids,
content: res?.content,
end_type: res?.end_type,
end_content: res?.end_content,
accept_admin_ids: res?.accept_admin_ids,
accept_department_ids: res?.accept_department_ids,
mission_groups: res?.groups
}
this.mission_groups_list = []
for (var g of res.groups) {
this.mission_groups_list.push({
name: g.name,
type: g.type,
link_id: g.link_id
})
}
// this.mission_groups_list = res?.mission_groups
for (var f of res.files) {
this.pictureList.push({
id: f.id,
url: f.url,
name: f.original_name
})
}
this.showform = res
// res.guide_upload ? this.guidePictureList.push(res.guide_upload) : ''
},
submit() {
let _files = []
if (this.pictureList.length > 0) {
for (var h of this.pictureList) {
if (h.response) {
_files.push(h.response.id)
} else {
_files.push(h.id)
}
}
this.form.file_ids = _files
} else {
this.form.file_ids = []
}
this.form.mission_groups = this.mission_groups_list
// return
save({
id: this.id,
...this.form
}).then(res => {
Message({
type: 'success',
message: '审核成功'
})
this.isShow = false
this.$emit('refresh')
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
console.log("newval",newVal)
this.getDetail()
} else {
this.id = ''
this.pictureList = []
this.mission_groups_list = [{
name: '',
type: 1,
link_id: []
}]
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
::v-deep .name7,::v-deep .content,
::v-deep .end_type,
::v-deep .file_ids,
::v-deep .mission_name{
flex-basis: 100%;
}
::v-deep .type {
display: none;
}
.xy-table-item-label {
width: 140px;
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
// ::v-deep .xy-table-item-label {
// width: 160px !important;
// }
::v-deep .el-date-editor .el-range-separator {
width: auto !important;
}
::v-deep .el-input-number .el-input__inner {
text-align: left !important;
}
.searchCompanys {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.el-input {
width: 80%
}
}
</style>

File diff suppressed because it is too large Load Diff

@ -5,16 +5,15 @@
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<!-- <Select multiple filterable clearable style='width:200px;margin-right: 10px;' v-model="select.unit_type" placeholder="任务类型">
<Option v-for="item in unitTypeList" :value="item.id">{{item.value}}</Option>
</Select> -->
<Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.audit_status" placeholder="任务状态">
<Option v-for="item in auditStatusList" :value="item.id">{{item.value}}</Option>
</Select>
<Button type="primary" @click="getList" style="margin-right: 10px;">查询</Button>
<Button v-if="path_type!=5" icon="ios-add" type="primary" style="margin-right: 10px;"
@click="$refs['addUnit'].isShow=true,$refs['addUnit'].type='add'">添加</Button>
</div>
</slot>
</lx-header>
</div>
<el-table :data="list" style="width: 100%" class='v-table' border :height='tableHeight'>
@ -63,19 +62,42 @@
</span>
<div v-else-if='item.customFn'>
<div style="white-space: normal;text-align: left;">
<div v-if="scope.row.accept_department.length>0">
<el-tag v-for="department in scope.row.accept_department"
style="margin-right: 5px;margin-bottom: 2px;">{{department.name}}</el-tag>
<div v-if="scope.row.accept_department_detail.length>0">
<span v-for="department in scope.row.accept_department_detail">
<el-tag v-if="department.detail"
style="margin-right: 5px;margin-bottom: 2px;">{{department.department.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{department.department.name}}</el-tag>
</span>
</div>
<div v-if="scope.row.accept_admin.length>0">
<el-tag v-for="admin in scope.row.accept_admin"
style="margin-right: 5px;margin-bottom: 2px;">{{admin.name}}</el-tag>
<div v-if="scope.row.accept_admin_detail.length>0">
<span v-for="admin in scope.row.accept_admin_detail">
<el-tag v-if="admin.detail"
style="margin-right: 5px;margin-bottom: 2px;">{{admin.admin.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{admin.admin.name}}</el-tag>
</span>
</div>
<div v-if="scope.row.groups.length>0">
<div v-for="group in scope.row.groups">
{{group.name}}:
<el-tag v-for="detail in group.details"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.name}}</el-tag>
<span v-if="group.type==1">
<span v-for="detail in scope.row.grounp_admin_detail">
<el-tag v-if="detail.istrue"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.admin.name}}</el-tag>
</span>
</span>
<span v-if="group.type==2">
<span v-for="detail in scope.row.grounp_department_detail">
<el-tag v-if="detail.istrue"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.department.name}}</el-tag>
<el-tag v-else type='info'
style="margin-right: 5px;margin-bottom: 2px;">{{detail.department.name}}</el-tag>
</span>
</span>
</div>
</div>
</div>
@ -90,13 +112,14 @@
<el-table-column fixed="right" align='center' label="操作" width="180" header-align="center">
<template slot-scope="scope">
<div v-if="path_type==1">
<Button type="primary" size="small" @click="editorUnit(scope.row.id,'editor')"></Button>
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="editorUnit(scope.row.id,'editor')"></Button>
<Button v-if="scope.row.audit_admin_id==login_id" style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="checkUnits(scope.row.id,'check')"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteList(scope.row.id)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
<Button type="primary" style="margin-right:5px;margin-bottom:5px;" size="small" ghost>删除</Button>
</Poptip>
</div>
<div v-else>
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="editorUnit(scope.row.id,'editor')"></Button>
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="checkUnits(scope.row.id,'show')"></Button>
<Button type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="$refs['addPatrol'].mission_id=scope.row.id,$refs['addPatrol'].isShow=true,$refs['addPatrol'].type='add'"></Button>
</div>
@ -107,49 +130,30 @@
<Page :total="total" show-elevator show-sizer show-total :page-size='select.page_size' size='small'
@on-change='changePage' @on-page-size-change='changePageSize' />
<!-- <xy-table
:list="list"
:total="total"
@pageSizeChange="e => {select.page_size = e,getList()}"
@pageIndexChange="e => {select.page = e,getList()}"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorUnit(scope.row.id,'editor')"></Button>
<Poptip
transfer
confirm
title="确认要删除吗?"
@on-ok="deleteList(scope.row.id)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table> -->
<addUnit ref='addUnit' @refresh='getList'></addUnit>
<showPatrol ref='showPatrol'></showPatrol>
<addPatrol ref='addPatrol' @refresh='getList'></addPatrol>
<checkUnit ref='checkUnit' @refresh='getList'></checkUnit>
</div>
</template>
<script>
import addUnit from '../list/components/addUnit.vue'
import showPatrol from '../list/components/showPatrol.vue'
import addPatrol from '../list/components/addPatrol.vue'
import addPatrol from '../list/components/addPatrol.vue'
import checkUnit from '../list/components/checkUnit.vue'
import {
listunit,
del
} from '@/api/task/unit.js'
} from '@/api/task/unit.js'
import {getUser} from "@/utils/auth";
export default {
components: {
addUnit,
showPatrol,
addPatrol
addPatrol,
checkUnit
},
data() {
return {
@ -178,9 +182,20 @@
myself: 0,
myself_department: 0,
type: '',
unit_type: ''
unit_type: '',
audit_status:''
},
total: 0,
total: 0,
auditStatusList:[{
id:0,
value:'待审核'
},{
id:1,
value:'通过'
},{
id:2,
value:'不通过'
}],
unitTypeList: [{
id: 1,
value: '专项检查'
@ -198,6 +213,13 @@
// fixed:'left',
width: 240
}, {
label: "状态",
prop: 'audit_status',
width: 180,
formatter: (cell, data, value, index) => {
return value == 1 ? '通过' : (value == 2 ? '不通过' : (value == 0 ? '待审核' : ''))
}
},{
label: "开始日期",
prop: 'start_date',
width: 180,
@ -291,7 +313,10 @@
value: '待领导确认整改'
}],
list: [],
path_type:1
path_type:1,
login_id:'',
department_id:'',
}
},
created() {
@ -313,7 +338,8 @@
this.path_type = path[1]
}
}
console.log("this.path_type ",this.path_type)
console.log("this.path_type ",this.path_type)
this.getUserId()
this.getList()
},
watch: {},
@ -326,6 +352,11 @@
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
async getUserId(){
let res = await getUser()
this.login_id = JSON.parse(res).id
this.department_id = JSON.parse(res).department_id
},
showPatrol(id, type) {
this.$refs.showPatrol.id = id
@ -334,9 +365,44 @@
this.$refs.showPatrol.isShow = true
},
async getList() {
const res = await listunit({
let res = await listunit({
...this.select
})
})
//
for(var r of res.data){
if(r.groups.length>0){
for(var g of r.groups){
if(g.type==1){
let is_index = 0
for(var a of r.grounp_admin_detail){
if(a.detail){
is_index++
}
}
if(is_index>0){
for(var a1 of r.grounp_admin_detail){
a1.istrue = true
}
}
}
if(g.type==2){
let is_index = 0
for(var d of r.grounp_department_detail){
if(d.detail){
is_index++
}
}
if(is_index>0){
for(var d1 of r.grounp_department_detail){
d1.istrue = true
}
}
}
}
}
}
this.list = res.data
this.total = res.total
@ -353,6 +419,11 @@
this.$refs.addUnit.id = id
this.$refs.addUnit.type = type
this.$refs.addUnit.isShow = true
},
checkUnits(id,type){
this.$refs.checkUnit.id = id
this.$refs.checkUnit.type = type
this.$refs.checkUnit.isShow = true
},
deleteList(id) {
var that = this;

Loading…
Cancel
Save