lion 2 years ago
parent 7a316fd203
commit d54a981a12

@ -131,7 +131,7 @@
},
itemStyle: {
borderRadius: [5, 5, 0, 0],
borderRadius: [0, 0, 0, 0]
},
xAxis: {
type: "category",

@ -21,6 +21,9 @@
</el-select>
</template>
<script>
import {
listCommonuser
} from "@/api/common.js"
export default {
name: 'el-tree-select',
props: {
@ -92,25 +95,28 @@ export default {
}
},
mounted () {
// this.getSelectTreeList()
this.resultValue = this.valueMultiple //
this.resultValue = this.valueMultiple
this.initHandle()
// this.getSelectTreeList()
//
},
methods: {
// tree
// getSelectTreeList: function () {
// this.$api.dept.findDeptTree().then((res) => {
// if (res.data.length) {
// const { children } = res.data[0] || {}
// this.options = children
// // id
// this.options.forEach((item) => {
// this.openTree.push(item.id)
// if (item.children && item.children.length > 0) {
// this.openTreeList(item.children)
// }
// })
// }
// listCommonuser({
// page_size: 999,
// }).
// then((res) => {
// // this.userdata = res.data ? res.data.reverse() : [];
// this.datas = res.data ? res.data.reverse() : [];
// // this.userdatabefore = res.data ? res.data : [];
// // let contactData = this.contactUser(data)
// // this.userdata = this.sortDepartment(contactData,'department_id')
// // console.log("this.userdata",this.userdata)
// }).catch(error => {
// console.log(error)
// })
// },
//

@ -108,7 +108,7 @@
getStudyTime(){
console.log("sec",this.sec)
this.sec++
if(this.sec==2){
if(this.sec==60){
this.min++
this.sec = 0
}
@ -140,7 +140,10 @@
}
</script>
<style>
<style scoped>
/deep/ .show{
flex-basis: 100%;
}
.dialogConcent {
overflow-y: hidden;
}

@ -43,15 +43,15 @@
<div style="padding: 15px;background-color: #fff;padding-bottom:5px;" class="form-sub-title">
<el-link icon='el-icon-user-solid' type="primary" style="font-size:18px">待办事项</el-link>
</div>
<div style="height:370px;background-color: #fff;padding: 15px;padding-top:0">
<div style="height:420px;background-color: #fff;padding: 15px;padding-top:0">
<el-tabs v-model="activeName">
<el-tab-pane name="first">
<span slot="label">
我的任务
<el-badge :value="myselfTotal" class="item"></el-badge>
</span>
<div style="height:300px">
<xy-table :list="myselfList" stripe :isPage="false" :height="'300px'" :table-item="myselfTable">
<div style="height:350px">
<xy-table :list="myselfList" stripe :isPage="false" :height="'350px'" :table-item="myselfTable">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="120" header-align="center">
<template slot-scope="scope">

@ -229,7 +229,8 @@
},
loadregulation() {
var that = this;
let type = parseInt(this.$route.path.split("_")[1]);
// let type = parseInt(this.$route.path.split("_")[1]);
let type = '2,1,3,12'
listregulation(1, type).then(response => {
that.options = response;
}).catch(error => {
@ -239,7 +240,9 @@
},
load() {
var that = this;
let type = parseInt(this.$route.path.split("_")[1]);
// let type = parseInt(this.$route.path.split("_")[1]);
// let type=""
let type = ''
listarticle(that.pagination.page, that.searchFields.menu_id, that.searchFields.KeyWord, that.pagination
.page_size, type).then(response => {
that.tableData = response.data;
@ -272,7 +275,7 @@
show(obj) {
this.$refs.viewInfo.dialogViewVisible = true;
this.$refs.viewInfo.getinfo(obj.id);
},
info(obj) {
var that = this;

@ -117,7 +117,8 @@
that.tableHeight = tableHeight;
},
load() {
let type = parseInt(this.$route.path.split("_")[1]);
// let type = parseInt(this.$route.path.split("_")[1]);
let type = '2,1,3,12'
var that = this;
listregulation(1, type).then(response => {
that.tableData = response;
@ -140,7 +141,8 @@
addchildren(obj) {
this.form = this.$options.data().form;
this.form.type = parseInt(this.$route.path.split("_")[1]);
if (obj) {
if (obj) {
this.form.type = obj.type
this.form.pname = obj.name;
this.form.pid = obj.id;
this.dialogFormVisible = true;

@ -23,7 +23,7 @@
<RelationGraph ref="graphRef3" :options="graphOptions" :on-node-click="onNodeClick">
</RelationGraph>
</div>
<div :id="'graphRef'" v-loading="g_loading">
<div :id="'graphRef5'" v-loading="g_loading">
<RelationGraph ref="graphRef4" :options="graphOptions" :on-node-click="onNodeClick">
</RelationGraph>
</div>
@ -256,7 +256,13 @@
/deep/ #graphRef7 .third .c-node-text{
font-size: 34px!important;
}
/deep/ #graphRef5 .rel-node-shape-1{
width: 170px!important;
height: 60px!important;
}
/deep/ #graphRef5 .rel-node-shape-1 .c-node-text{
font-size: 22px!important;
}
/* /deep/ #graphRef7 .first,
/deep/ #graphRef7 .second,
{

@ -53,7 +53,7 @@
<el-option v-for="item in siteList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select> -->
<el-cascader v-model="form.siteName" v-if="showCasc" clearable :options="siteList" :props="{'label':'name','value':'id'}"
<el-cascader ref="cascader1" :show-all-levels="false" v-model="form.siteName" v-if="showCasc" clearable :options="siteList" :props="{'label':'name','value':'id'}"
placeholder="请选择检查地点" style="width: 290px;margin-right: 10px;" @change="changeSite"></el-cascader>
<el-input v-model="form.siteName" v-if="!showCasc" type='text' placeholder="请选择检查地点" clearable
style="width: 290px;margin-right: 10px;" @focus="$refs.maps.box = true"></el-input>
@ -374,7 +374,7 @@
page: 1,
page_size: 9999
})
this.siteListArr = res.data
this.siteListArr = res.data.reverse()
let arr = this.contactSite(res.data)
this.siteList = arr
},
@ -435,7 +435,13 @@
}
res.mission_id?this.getGroups(res.mission_id):''
this.showCasc = res.site_id?true:false
this.$refs.cascader.computePresentText()
// this.$refs.cascader.placeholder = res.site.name
// this.$forceUpdate()
// if(this.showCasc){
// console.log("this.form.siteName",this.form.siteName)
// // this.$refs['cascader'].checkedValue = this.form.siteName
// }
this.mapform = [res.lon, res.lat, res.address]
for (var f of res.files) {
this.pictureList.push({
@ -444,6 +450,7 @@
name: f.original_name
})
}
this.$refs.cascader1.computePresentText()
// res.guide_upload ? this.guidePictureList.push(res.guide_upload) : ''
},
submit() {

@ -30,7 +30,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>计划类型
</div>
<div class="xy-table-item-content">
<el-select v-model="form.type" filterable clearable placeholder="请选择计划类型" style="width: 400px;">
<el-select @change="changeType" v-model="form.type" filterable multiple clearable placeholder="请选择计划类型" style="width: 400px;">
<el-option v-for="item in planTypeList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
@ -38,18 +38,22 @@
</div>
</template>
<template v-slot:start_date>
<div class="xy-table-item">
<!-- <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>开始日期
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>月份
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 400px;" v-model="form.start_date" value-format="yyyy-MM-dd" type="date"
placeholder="选择开始日期">
</el-date-picker>
<el-checkbox :indeterminate="isIndeterminateMonth" v-model="checkAllMonth" @change="handleCheckAllChangeMonth">
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="form.start_date" @change="handleCheckedDeptChangeMonth">
<el-checkbox @change="handleCheckedDeptSingleChangeMonth" v-for="mon in monthsArr" :label="mon"
:key="mon">{{mon}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div> -->
</template>
<template v-slot:status>
<!-- <template v-slot:status>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>计划状态
@ -61,8 +65,9 @@
</el-select>
</div>
</div>
</template>
<template v-slot:end_date>
</template> -->
<!-- <template v-slot:end_date>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>结束日期
@ -73,7 +78,7 @@
</el-date-picker>
</div>
</div>
</template>
</template> -->
<!-- <template v-slot:count>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -112,6 +117,22 @@
</div>
</template> -->
<template v-slot:lefts>
<div>
<div class="xy-table-item" style="align-items: start;">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>月份
</div>
<div class="xy-table-item-content">
<el-checkbox :indeterminate="isIndeterminateMonth" v-model="checkAllMonth" @change="handleCheckAllChangeMonth">
</el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="form.start_date" @change="handleCheckedDeptChangeMonth">
<el-checkbox @change="handleCheckedDeptSingleChangeMonth" v-for="mon in monthsArr" :label="mon"
:key="mon">{{mon}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
<div>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -223,22 +244,19 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:100px'>
<Button type='primary' @click="mission_plan_groups_list.push({name:'',type:1,link_id:[]})"></Button>
<Button type='primary' @click="mission_plan_groups_list.push({name:'',type:1,link_id:[],link_id_dep:[]})"></Button>
<div v-for="(item,index) in mission_plan_groups_list" style='margin:10px;margin-left:0'>
<div>
<Button style="margin-right:10px" @click="mission_plan_groups_list.splice(index,1)"></Button>
组别{{item.name=mission_plan_groups_name[index]}}
<el-radio-group v-model="item.type" @change='item.link_id=[]' style="margin:10px;margin-right:20px">
<div>
<Button style="margin-right:10px" @click="mission_plan_groups_list.splice(index,1)"></Button>
组别{{item.name=mission_plan_groups_name[index]}}
</div>
<!-- <el-radio-group v-model="item.type" @change='item.link_id=[]' style="margin:10px;margin-right:20px">
<el-radio :label="1">人员</el-radio>
<el-radio :label="2">部门</el-radio>
</el-radio-group>
<!-- <el-select v-if='item.type==1' v-model="item.link_id" clearable filterable multiple placeholder="请选择人员">
<el-option v-for="item in userdata" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select> -->
<el-select-tree v-if='item.type==1' :datas='userdata' :valueArr='item.valueArr' :valueMultiple="item.valueMultiple" @getValue="(e)=>{return getSelectedgroupValue(e,item)}"></el-select-tree>
<el-select v-if='item.type==2' v-model="item.link_id" clearable filterable multiple placeholder="请选择部门">
</el-radio-group> -->
<el-select-tree style="width:48%;min-width:48%;margin-right:2%" :datas='userdata' :valueArr='item.valueArr' :valueMultiple="item.valueMultiple" @getValue="(e)=>{return getSelectedgroupValue(e,item)}"></el-select-tree>
<el-select style="width:48%" v-model="item.link_id_dep" collapse-tags clearable filterable multiple placeholder="请选择部门">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@ -251,10 +269,36 @@
</div>
</div>
</div>
</template>
<!-- <template v-slot:months_list>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>计划内容
</div>
<div class="xy-table-item-content" style="width:82%">
<div>
<el-button style="margin-bottom: 5px;" type='primary' size='small' @click="form.months_list.push({month:'',list:[{content:''}]})"></el-button>
</div>
<div>
<xy-table
height="400px"
:list="form.months_list"
stripe
:isPage="false"
:table-item="table">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="100" header-align="center">
<template slot-scope="scope">
<el-button type='primary' size='small' @click="form.months_list.splice(scope.$index,1)"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
</div>
</div>
</div>
</template> -->
<template v-slot:footerContent>
<Button type="primary"
style='margin-left:5px;margin-bottom:5px;' @click="clickSubmit">确认</Button>
@ -310,6 +354,8 @@ import elSelectTree from '@/components/selectTree'
deptOptions: [],
checkAll: false,
isIndeterminate: true,
checkAllMonth: false,
isIndeterminateMonth: true,
userdata: [],
userdatabefore:[],
valueMultiple:[],
@ -336,19 +382,63 @@ import elSelectTree from '@/components/selectTree'
name: '',
year:'',
type: '',
start_date: '',
status:1,
end_date: '',
start_date: [],
// end_date: '',
// count:'',
lefts:'',
name7: 2,
name7: 2,
// months_list:[],
file_ids: '',
content: '',
accept_admin_ids: [],
accept_department_ids: [],
mission_plan_groups: [],
status:1,
},
monthsArr:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
table:[{
label: "月份",
prop: 'month',
width: 220,
align:'center',
customFn:(row)=>{
return(<div><el-select style={{"width":'120px'}} v-model={row.month}>
{
this.monthsArr.map(item=>{
return(<el-option key={item} value={item} label={item}>
</el-option>)
})
}</el-select>
<el-button style={{"margin-left":'5px',"height":'40px'}} type='primary' size='small' on={
{
["click"]:(e)=> row.list.push({'content':''}),
}
}>新增内容 </el-button></div>
)
}
},{
label: "内容",
prop: 'list',
align:'left',
customFn:(row)=>{
return(<div>
{
row.list.map((item,index)=>{
return(<div style={{'margin':'5px'}}>{index+1}<el-input style={{'width':'85%'}} v-model={item.content}>{item.content}</el-input>
<el-button style={{"margin-left":'5px',"height":'40px'}} type='primary' size='small' on={
{
["click"]:(e)=> row.list.splice(index,1),
}
} >删除</el-button>
</div>)
})
}
</div>)
}
}],
mission_plan_groups_list: [{
name: '',
type: 1,
@ -373,10 +463,10 @@ import elSelectTree from '@/components/selectTree'
required: true,
message: '请选择开始时间'
}],
end_date: [{
required: true,
message: '请选择结束时间'
}],
// end_date: [{
// required: true,
// message: ''
// }],
type: [{
required: true,
message: '请选择任务类型'
@ -394,6 +484,14 @@ import elSelectTree from '@/components/selectTree'
async getPlanList(){
const res = await getparameteritem('planType')
this.planTypeList = res.detail
},
changeType(e){
console.log("e",e)
if(e){
this.form.type = e
}else{
this.form.type=[]
}
},
changeName7(e) {
if (e) {
@ -436,7 +534,9 @@ import elSelectTree from '@/components/selectTree'
},
getSelectedValue (value) {
console.log('选中的结果值', value)
if(value.length>0){
this.form.accept_admin_ids = []
value.map(item=>{
this.form.accept_admin_ids.push(item.id)
})
@ -447,6 +547,7 @@ import elSelectTree from '@/components/selectTree'
getSelectedgroupValue (value,item) {
console.log('选中的结果值', value,item)
if(value.length>0){
item.link_id = []
value.map(item1=>{
item.link_id.push(item1.id)
})
@ -520,7 +621,44 @@ import elSelectTree from '@/components/selectTree'
this.checkAll = checkedCount === this.deptOptions.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.deptOptions.length;
},
handleCheckAllChangeMonth(val) {
let options = [];
for (var m of this.monthsArr) {
options.push(m);
}
this.form.start_date = val ? options : [];
this.isIndeterminateMonth = false;
},
handleCheckedDeptSingleChangeMonth(v) {
//
console.log(v);
var that = this;
if (this.form.start_date)
that.delDeptItemMonth();
},
//
delDeptItemMonth() {
for (var m of this.monthsArr) {
if (this.form.start_date.indexOf(m) == -1) {
var d = this.form.start_date.filter(function(t) {
return t == m;
})
if (d.length != 0) {
delDep(d[0].id).then(response => {}).catch(error => {
console.log(error)
})
}
}
}
},
handleCheckedDeptChangeMonth(value) {
let checkedCount = value.length;
this.checkAllMonth = checkedCount === this.monthsArr.length;
this.isIndeterminateMonth = checkedCount > 0 && checkedCount < this.monthsArr.length;
},
async getDetail() {
const res = await get(this.id)
this.form = {
@ -528,18 +666,22 @@ import elSelectTree from '@/components/selectTree'
name: res?.name,
year:res.year?res.year:new Date().getFullYear(),
type: res?.type,
start_date: res?.start_date,
status:res.status?res.status:1,
end_date: res?.end_date,
start_date: res.start_date?res.start_date:[],
// end_date: res?.end_date,
lefts:'',
name7: res.accept_department_ids.length > 0 ? 2 : (res.accept_admin_ids.length > 0 ? 1 : (res
.groups.length > 0 ? 3 : 2)),
name7: res.accept_department.length > 0 ? 2 : (res.accept_admin.length > 0 ? 1 : (res
.groups.length > 0 ? 3 : 2)),
// months_list:[],
file_ids: res?.file_ids,
content: res?.content,
accept_admin_ids: res?.accept_admin_ids,
accept_department_ids: res?.accept_department_ids,
accept_department_ids: res?.accept_department_ids,
status:res.status?res.status:1,
}
this.valueMultiple=[]
this.valueArr=[]
this.userdatabefore.map(item=>{
res.accept_admin_ids.map(item1=>{
if(item.id==item1){
@ -551,25 +693,40 @@ import elSelectTree from '@/components/selectTree'
console.log("this.valueMultiple",this.valueMultiple)
this.$forceUpdate()
this.mission_plan_groups_list = []
for (var g of res.groups) {
if(g.type==1){
this.mission_plan_groups_list.push({
name: g.name,
type: g.type,
link_id: g.link_id,
valueArr:g.link_id,
valueMultiple:g.details
})
}else{
this.mission_plan_groups_list.push({
name: g.name,
type: g.type,
link_id: g.link_id
})
}
let group_list = this.contactGroup(res.groups)
}
for (var g of group_list) {
let admin_arr = {}
admin_arr = {
name: g.name,
type: 1,
link_id: [],
link_id_dep:[],
valueArr:[],
valueMultiple:[]
}
if(g.admin_details.length>0){
for(var a of g.admin_details){
admin_arr.link_id.push(a.id)
admin_arr.valueArr.push(a.id)
admin_arr.valueMultiple.push(a)
}
}
if(g.dep_details.length>0){
for(var d of g.dep_details){
admin_arr.link_id_dep.push(d.id)
}
}
this.mission_plan_groups_list.push(admin_arr)
// else{
// this.mission_plan_groups_list.push({
// name: g.name,
// type: g.type,
// link_id: g.link_id
// })
// }
}
for (var f of res.files) {
this.pictureList.push({
id: f.id,
@ -595,8 +752,7 @@ import elSelectTree from '@/components/selectTree'
} else {
this.form.file_ids = []
}
console.log("this.mission_plan_groups_list",this.mission_plan_groups_list)
// return
if (this.form.name7 == 3) {
if (this.mission_plan_groups_list.length == 0) {
Message({
@ -605,16 +761,30 @@ import elSelectTree from '@/components/selectTree'
})
return
}
for (let k of this.mission_plan_groups_list) {
if (k.link_id.length == 0) {
let arr = []
for (var k of this.mission_plan_groups_list) {
if (k.link_id.length == 0&&k.link_id_dep.length == 0) {
Message({
type: 'warning',
message: `请选择小组成员`
message: `请选择${k.name}成员`
})
return
}else{
if(k.link_id_dep.length > 0 ){
arr.push({
name:k.name,
type:2,
link_id:k.link_id_dep
})
}else{
}
arr.push(k)
}
}
this.form.mission_plan_groups = this.mission_plan_groups_list
console.log("this.mission_plan_groups_list",arr,this.mission_plan_groups_list)
// return
this.form.mission_plan_groups = arr
}
// this.$refs.dialog.submit()
@ -666,7 +836,45 @@ import elSelectTree from '@/components/selectTree'
reject(error)
})
}
}
},
contactGroup(arr) {
let tempArr = [],
newArr = []
for (let i = 0; i < arr.length; i++) {
if (tempArr.indexOf(arr[i].name) === -1) {
if(arr[i].type===1){
newArr.push({
type: arr[i].type,
name: arr[i]['name'],
admin_details: arr[i].details,
dep_details: []
})
}else{
newArr.push({
type: arr[i].type,
name: arr[i]['name'],
admin_details:[],
dep_details: arr[i].details
})
}
tempArr.push(arr[i].name);
} else {
for (let j = 0; j < newArr.length; j++) {
if (newArr[j].name == arr[i].name) {
if(arr[i].type===1){
newArr[j].admin_details.push(...arr[i].details)
}else{
newArr[j].dep_details.push(
...arr[i].details
)
}
}
}
}
}
return newArr
},
},
watch: {
isShow(newVal) {
@ -706,7 +914,8 @@ import elSelectTree from '@/components/selectTree'
::v-deep .content,
::v-deep .end_type,
::v-deep .file_ids,
::v-deep .is_need_answer{
::v-deep .is_need_answer,
::v-deep .months_list{
flex-basis: 100%;
}
@ -714,7 +923,7 @@ import elSelectTree from '@/components/selectTree'
display: none;
}
::v-deep .el-form>div{
align-items: flex-start!important;
align-items: flex-start!important;
}
.xy-table-item{
padding-right:0

@ -240,22 +240,22 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>
</div>
<div class="xy-table-item-content" style='min-width:100px'>
<Button type='primary' @click="mission_groups_list.push({name:'',type:1,link_id:[]})"></Button>
<Button type='primary' @click="mission_groups_list.push({name:'',type:1,link_id:[],link_id_dep:[]})"></Button>
<div v-for="(item,index) in mission_groups_list" style='margin:10px;margin-left:0'>
<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">
<div>组别{{item.name=mission_groups_name[index]}}</div>
<!-- <el-radio-group v-model="item.type" @change='item.link_id=[]' style="margin:10px;margin-right:20px">
<el-radio :label="1">人员</el-radio>
<el-radio :label="2">部门</el-radio>
</el-radio-group>
</el-radio-group> -->
<!-- <el-select v-if='item.type==1' v-model="item.link_id" clearable filterable multiple placeholder="请选择人员">
<el-option v-for="item in userdata" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select> -->
<el-select-tree v-if='item.type==1' :datas='userdata' :valueArr='item.valueArr' :valueMultiple="item.valueMultiple" @getValue="(e)=>{return getSelectedgroupValue(e,item)}"></el-select-tree>
<el-select-tree style="width:48%;min-width:48%;margin-right:2%" :datas='userdata' :valueArr='item.valueArr' :valueMultiple="item.valueMultiple" @getValue="(e)=>{return getSelectedgroupValue(e,item)}"></el-select-tree>
<el-select v-if='item.type==2' v-model="item.link_id" clearable filterable multiple placeholder="请选择部门">
<el-select style="width:48%;" v-model="item.link_id_dep" clearable collapse-tags filterable multiple placeholder="请选择部门">
<el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
@ -411,7 +411,7 @@
leads
} from '@/api/task/patrol.js'
import addQuestion from './addQuestion.vue'
import {contactGroup} from '../js/index.js'
import elSelectTree from '@/components/selectTree'
export default {
components: {
@ -544,7 +544,8 @@ import elSelectTree from '@/components/selectTree'
],
}
},
created() {
created() {
// getUser()
this.uploadOther.token = getToken();
this.loadUser()
this.loadDeptOptions()
@ -569,7 +570,7 @@ import elSelectTree from '@/components/selectTree'
changeUnitType(e){
this.unitTypeList.map(item=>{
if(e==item.id){
this.is_what_unitType = item.remark
this.is_what_unitType = item.value
}
})
@ -779,24 +780,31 @@ import elSelectTree from '@/components/selectTree'
// }
this.is_what_unitType = res.unit_type_detail?res.unit_type_detail.value:''
this.mission_groups_list = []
for (var g of res.groups) {
if(g.type==1){
this.mission_groups_list.push({
name: g.name,
type: g.type,
link_id: g.link_id,
valueArr:g.link_id,
valueMultiple:g.details
})
}else{
this.mission_groups_list.push({
name: g.name,
type: g.type,
link_id: g.link_id
})
}
let group_list = contactGroup(res.groups)
for (var g of group_list) {
let admin_arr = {}
admin_arr = {
name: g.name,
type: 1,
link_id: [],
link_id_dep:[],
valueArr:[],
valueMultiple:[]
}
if(g.admin_details.length>0){
for(var a of g.admin_details){
admin_arr.link_id.push(a.id)
admin_arr.valueArr.push(a.id)
admin_arr.valueMultiple.push(a)
}
}
if(g.dep_details.length>0){
for(var d of g.dep_details){
admin_arr.link_id_dep.push(d.id)
}
}
this.mission_groups_list.push(admin_arr)
}
// this.mission_groups_list = res?.mission_groups
for (var f of res.files) {
@ -851,16 +859,30 @@ import elSelectTree from '@/components/selectTree'
})
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
let arr = []
for (var k of this.mission_groups_list) {
if (k.link_id.length == 0&&k.link_id_dep.length == 0) {
Message({
type: 'warning',
message: `请选择${k.name}成员`
})
return
}else{
if(k.link_id_dep.length > 0 ){
arr.push({
name:k.name,
type:2,
link_id:k.link_id_dep
})
}else{
}
arr.push(k)
}
}
console.log("this.mission_plan_groups_list",arr,this.mission_groups_list)
// return
this.form.mission_groups = arr
}
if(this.is_what_unitType=='答题'&&this.form.ask.length==0){

@ -80,12 +80,11 @@
}
},
created() {
},
watch: {
isShow(newval) {
if (newval) {
console.log(this.askList)
} else {
this.mission_id = ''
this.askList = []

@ -296,14 +296,20 @@
<template v-slot:footerContent>
<Button type="primary" v-print="'#printunit'" style='margin-left:5px;margin-bottom:5px;'>打印</Button>
<div style="display: flex;justify-content: space-between;">
<div>
<Button v-if="type=='show'" type="primary" v-print="'#printunit'" style='margin-left:5px;margin-bottom:5px;'>打印</Button>
</div>
<div>
<Button v-if="type=='check'" type="primary"
style='margin-left:5px;margin-bottom:5px;' @click="submitCheck">审核</Button>
<Button v-if="type=='train'||type=='uploads'||type=='study'" type="primary"
style='margin-left:5px;margin-bottom:5px;' @click="submitFeedback()">提交</Button>
<Button type="primary" ghost style='margin-left:5px;margin-bottom:5px;' @click="isShow=false"></Button>
</div>
</div>
<Button v-if="type=='check'" type="primary"
style='margin-left:5px;margin-bottom:5px;' @click="submitCheck">审核</Button>
<Button v-if="type=='train'||type=='uploads'||type=='study'" type="primary"
style='margin-left:5px;margin-bottom:5px;' @click="submitFeedback()">提交</Button>
<Button type="primary" ghost style='margin-left:5px;margin-bottom:5px;' @click="isShow=false"></Button>
</template>
</template>
</xy-dialog>
<answerQuestion ref='answerQuestion'></answerQuestion>
@ -341,7 +347,8 @@
} from '@/utils/auth'
import state from "@/store/modules/user.js"
import answerQuestion from '../../list/components/answerQuestion.vue'
import viewFile from '@/components/viewFile/viewFile.vue'
import viewFile from '@/components/viewFile/viewFile.vue'
import {contactGroup} from '../js/index.js'
export default {
components: {
answerQuestion,
@ -663,7 +670,7 @@
},{
label:"责任科室",
prop:'ask_department',
// width:200,
width:300,
customFn: (row) => {
return(<div style={
@ -740,14 +747,20 @@
}
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 = []
let group_details = []
if(res.groups.length>0){
for (var g of res.groups) {
this.mission_groups_list.push({
name: g.name,
type: g.type,
link_id: g.link_id
})
}
this.showform.group_details = contactGroup(res.groups)
}
console.log(this.showform.group_details,this.mission_groups_list)
// this.mission_groups_list = res?.mission_groups
for (var f of res.files) {
this.pictureList.push({

@ -759,6 +759,7 @@
import {
listunit
} from "@/api/task/unit.js";
import state from "@/store/modules/user.js"
import elSelectTree from '@/components/selectTree'
export default {
components: {
@ -981,11 +982,47 @@ import elSelectTree from '@/components/selectTree'
},
created() {
this.uploadOther.token = getToken();
this.getLeads()
this.getUnit()
this.loadDeptOptions()
this.loadUser()
},
methods: {
async getLeads(){
await this.$store.dispatch("user/getLeads")
let obj = state.state
this.login_id = obj.login_id
this.department_id = obj.department_id
this.leads_list = obj.leads_list
this.is_guiji = obj.is_guiji
this.is_chuzhang = obj.is_chuzhang
this.is_leader = obj.is_leader
this.is_main_leader = obj.is_main_leader
// const res = await leads()
// console.log("this.login_id",this.login_id)
// this.leads_list = res
// //
// for(var g of res.guiji){
// if(this.login_id==g.id){
// this.is_guiji = true
// }
// }
// //
// for(var c of res.chuzhang){
// if(this.login_id==c.id){
// this.is_chuzhang = true
// }
// }
// //
// if(this.login_id==res.guiji_leader.id){
// this.is_leader = true
// }
// //
// if(this.login_id==res.chuzhang_leader.id){
// this.is_main_leader = true
// }
},
print () {
this.$Print('#print');
},

@ -21,16 +21,23 @@
<template slot="label">
计划类型
</template>
{{showform.type_detail?showform.type_detail.value:''}}
<span v-for="(item,index) in showform.type_detail">
<span v-if="index===showform.type_detail.length-1">{{item.value}}</span>
<span v-else>
{{item.value}}
</span>
</span>
<!-- {{showform.type_detail?showform.type_detail.value:''}} -->
</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">
开始日期
月份
</template>
{{showform.start_date}}
{{showform.start_date?showform.start_date.join("、"):''}}
</el-descriptions-item>
<el-descriptions-item span="2">
<!-- <el-descriptions-item span="2">
<template slot="label">
计划状态
</template>
@ -39,13 +46,13 @@
{{item.value}}
</span>
</div>
</el-descriptions-item>
<el-descriptions-item span="2">
</el-descriptions-item> -->
<!-- <el-descriptions-item span="2">
<template slot="label">
结束日期
</template>
{{showform.end_date?showform.end_date:''}}
</el-descriptions-item>
</el-descriptions-item> -->
<el-descriptions-item span='4'>
<template slot="label">
附件
@ -69,10 +76,13 @@
</el-tag>
</div>
<div v-if="showform.groups&&showform.groups.length>0">
<div v-for="group in showform.groups">
<div v-for="group in showform.group_details">
{{group.name}}:
<el-tag v-for="detail in group.details"
<el-tag v-for="detail in group.admin_details"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.name}}</el-tag>
<el-tag v-for="detail in group.dep_details"
style="margin-right: 5px;margin-bottom: 2px;">{{detail.name}}</el-tag>
</div>
</div>
</el-descriptions-item>
@ -82,8 +92,18 @@
</template>
{{showform.content?showform.content:''}}
</el-descriptions-item>
</el-descriptions>
<!-- <el-divider>计划内容</el-divider>
<xy-table
height="300px"
:list="showform.months_list"
stripe
:isPage="false"
:table-item="table">
<template v-slot:btns>
<div></div>
</template>
</xy-table> -->
</template>
<template v-slot:missionlist>
<el-divider>任务情况</el-divider>
@ -215,6 +235,32 @@
value:'审核不通过',
type:'warning'
}],
table:[{
label: "月份",
prop: 'month',
width: 120,
align:'center'
},{
label: "内容",
prop: 'list',
align:'left',
customFn:(row)=>{
return(<div>
{
row.list.map((item,index)=>{
return(<div style={{'margin':'5px'}}>{index+1}<span style={{'width':'85%','display':'inline-block'}}>{item.content}</span>
<el-button style={{"margin-left":'5px',"height":'40px'}} type='primary' size='small' on={
{
["click"]:(e)=> this.editorUnit,
}
} >添加任务</el-button>
</div>)
})
}
</div>)
}
}],
mission_log:[],
missionLogTable:[{
label: "任务名称",
@ -443,7 +489,50 @@
name: f.original_name
})
}
let group_details = []
if(res.groups.length>0){
this.showform.group_details = this.contactGroup(res.groups)
}
console.log(this.showform.group_details)
this.getMission()
},
contactGroup(arr) {
let tempArr = [],
newArr = []
for (let i = 0; i < arr.length; i++) {
if (tempArr.indexOf(arr[i].name) === -1) {
if(arr[i].type===1){
newArr.push({
type: arr[i].type,
name: arr[i]['name'],
admin_details: arr[i].details,
dep_details: []
})
}else{
newArr.push({
type: arr[i].type,
name: arr[i]['name'],
admin_details:[],
dep_details: arr[i].details
})
}
tempArr.push(arr[i].name);
} else {
for (let j = 0; j < newArr.length; j++) {
if (newArr[j].name == arr[i].name) {
if(arr[i].type===1){
newArr[j].admin_details.push(...arr[i].details)
}else{
newArr[j].dep_details.push(
...arr[i].details
)
}
}
}
}
}
return newArr
},
},
watch: {

@ -0,0 +1,71 @@
import {
listCommonuser
} from "@/api/common.js"
let userData1 = []
// 获取 userdata
export function getUser(){
console.log("userData1",userData1)
if(userData1.length>0){
console.log("123")
return
}else{
listCommonuser({
page_size: 999,
}).
then((res) => {
// this.userdata = res.data ? res.data.reverse() : [];
userData1 = res.data ? res.data.reverse() : [];
console.log("userData1",userData1)
return userData1
}).catch(error => {
console.log(error)
})
}
}
/**
* @param {Object} arr
* 处理组别返回
*/
export function contactGroup(arr) {
let tempArr = [],
newArr = []
for (let i = 0; i < arr.length; i++) {
if (tempArr.indexOf(arr[i].name) === -1) {
if (arr[i].type === 1) {
newArr.push({
type: arr[i].type,
name: arr[i]['name'],
admin_details: arr[i].details,
dep_details: []
})
} else {
newArr.push({
type: arr[i].type,
name: arr[i]['name'],
admin_details: [],
dep_details: arr[i].details
})
}
tempArr.push(arr[i].name);
} else {
for (let j = 0; j < newArr.length; j++) {
if (newArr[j].name == arr[i].name) {
if (arr[i].type === 1) {
newArr[j].admin_details.push(...arr[i].details)
} else {
newArr[j].dep_details.push(
...arr[i].details
)
}
}
}
}
}
return newArr
}

@ -0,0 +1,55 @@
// store.js
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const state = {
listA: [],
listB: []
}
const requestMap = {
listA: (state) => {
setTimeout(() => {
state.listA = [1, 2, 3, 4, 5, 6, 7, 8, 9]
}, 3000)
},
listB: (state) => {
setTimeout(() => {
console.log('request B')
state.listB = [1, 2, 3, 4, 5, 6, 7, 8, 9]
}, 1000)
}
}
Object.keys(state).forEach(key => {
// 处理vue初始化get导致提前执行函数
let vueInitCount = 0
const defaultValue = state[key]
// 避免循环调用当获取listA实际上返回的是__listA
// 设置listA实际设置的是__listA
const privateKey = `__${key}`
Object.defineProperty(state, key, {
get () {
if (vueInitCount < 2) {
vueInitCount++
return defaultValue
}
if (!this[privateKey] || (Array.isArray(this[privateKey]) && this[privateKey].length === 0)) {
const fun = requestMap[key]
if (fun) {
fun(state)
}
}
return this[privateKey] || defaultValue
},
set (val) {
this[privateKey] = val
}
})
})
export default new Vuex.Store({
state,
})

@ -0,0 +1,24 @@
let cache = null;
let count = 0;
async function delay(ms = 200) {
return new Promise(resolve => setTimeout(resolve, ms));
}
export async function getSignature() {
if (cache) { return cache; }
if (count++) {
// 如果有计数说明自己不是第 1 个,就等。注意这里判断的是加之前的 count
// 循环里最好再加个超时判断
while (!cache) { await delay(); }
} else {
// 是第 1 个就去请求
// 如果这里有可能会抛异常,抛异常也不要漏了 count--
// (这个示例代码没做容错,自己加)
cache = await fetchSignature();
}
count--; // 记得减回去,方便以后如果要刷新 cache 的时候用
return cache;
}

@ -189,8 +189,11 @@
// }
},{
label:"任务名称",
prop:'mission.name',
prop:'mission',
align:'left',
formatter:(cell,data,value,index)=>{
return value?value.name:'日常巡查'
}
// width:180
},{
label:"状态",
@ -272,12 +275,14 @@
label:"责任对象",
prop:'ask_department',
width:200,
align:'center',
customFn: (row) => {
return(<div style={
{
'display':'flex',
'flex-wrap':'wrap'
'flex-wrap':'wrap',
"justify-content": "center"
}
}>
{
@ -425,6 +430,7 @@
// this.getDep()
// },
async getLeads(){
await this.$store.dispatch("user/getLeads")
let obj = state.state
console.log("obj",obj)
this.login_id = obj.login_id
@ -549,15 +555,17 @@
chooseEditorPatrol(){
if(this.sectionList.length>0){
if(this.sectionList.length==1){
if(!(this.is_guiji||this.is_chuzhang||this.login_id==this.sectionList[0].admin_id)){
if((this.is_guiji||this.is_chuzhang||this.login_id==this.sectionList[0].admin_id)){
this.editorPatrol(this.sectionList[0].id,'editor')
}else{
this.$Message.warning('没有权限编辑该检查');
return
}
if(!(this.sectionList[0].status==0)){
this.$Message.warning('该检查不可编辑');
return
}
this.editorPatrol(this.sectionList[0].id,'editor')
// if(!(this.sectionList[0].status==0)){
// this.$Message.warning('');
// return
// }
// this.editorPatrol(this.sectionList[0].id,'editor')
}else{
this.$Message.warning('每次只能编辑一件检查');
}

@ -111,9 +111,26 @@
}
}
}, {
label: "开始日期",
prop: 'start_date',
label: "年份",
prop: 'year',
width: 120,
},{
label: "月份",
prop: 'start_date',
width: 120,
customFn:(row)=>{
return(<div style={{"display": "flex","flex-wrap": "wrap"}}>
{
row.start_date.map((item,index)=>{
return(<span>{
index===row.start_date.length-1?
item
:item+"、"
}</span>)
})
}
</div>)
}
},{
label: "计划名称",
prop: 'name',
@ -122,7 +139,20 @@
}, {
label: "类型",
prop: 'type_detail.value',
width: 120,
width: 120,
customFn:(row)=>{
return(<div style={{"display": "flex","flex-wrap": "wrap"}}>
{
row.type_detail.map((item,index)=>{
return(<span>{
index===row.type_detail.length-1?
item.value
:item.value+"、"
}</span>)
})
}
</div>)
}
}, {
label: "状态",
prop: 'status',
@ -138,42 +168,57 @@
}
</div>)
}
}, {
label: "参与对象",
prop: '_names',
width: 240,
align: 'left',
customFn:row=>{
return(<div style={{"display": "flex","flex-wrap": "wrap"}}>
{
row._names?
row._names.map(item=>{
return(<div>
{
item.group_name?
//
<div style={{"display": "flex"}}><div>{item.group_name}</div>
<div style={{"display": "flex","flex-wrap": "wrap"}}>{
item.details.map(detail=>{
return(
<el-tag style={{'margin':'0 5px 5px 0'}}>{detail.name}</el-tag>
)
})
}</div>
</div>
:
//
<el-tag style={{'margin':'0 5px 5px 0'}}>{item.name}</el-tag>
}
</div>)
}):''
}</div>)
}
},{
label: "结束日期",
prop: 'end_date',
width: 120,
}, {
},
// {
// label: "",
// prop: '_names',
// width: 240,
// align: 'left',
// customFn:row=>{
// return(<div style={{"display": "flex","flex-wrap": "wrap"}}>
// {
// row._names?
// row._names.map(item=>{
// return(<div>
// {
// item.admin_details?
// //
// <div style={{"display": "flex"}}><div>{item.name}</div>
// <div style={{"display": "flex","flex-wrap": "wrap"}}>{
// item.admin_details.length>0?
// item.admin_details.map(detail=>{
// return(
// <el-tag style={{'margin':'0 5px 5px 0'}}>{detail.name}</el-tag>
// )
// })
// :''
// }
// {
// item.dep_details.length>0?
// item.dep_details.map(detail=>{
// return(
// <el-tag style={{'margin':'0 5px 5px 0'}}>{detail.name}</el-tag>
// )
// })
// :''
// }
// </div>
// </div>
// :
// //
// <el-tag style={{'margin':'0 5px 5px 0'}}>{item.name}</el-tag>
// }
// </div>)
// }):''
// }</div>)
// }
// },
// {
// label: "",
// prop: 'end_date',
// width: 120,
// },
{
label: "任务数量",
prop: 'mission',
width: 120,
@ -227,40 +272,35 @@
}
//
if(r.groups&&r.groups.length>0){
for(var g of r.groups){
for(var de of g.details){
if(g.type==1){
let is_index = 0
for(var a of r.grounp_admin_detail){
if(de.name===a.admin?.name){
if(a.detail){
is_index++
}
}
}
de.hasDetail=is_index>0?true:false
}
if(g.type==2){
let is_index = 0
for(var dp of r.grounp_department_detail){
if(de.name===dp.department.name){
if(dp.detail){
is_index++
}
}
}
de.hasDetail=is_index>0?true:false
}
}
}
// groups
r.groups.map((item,index)=>{
_names.push({
group_name:item.name,
details:item.details
})
})
r._names = _names
let ab = this.contactGroup(r.groups)
r._names = ab
// for(var g of r.groups){
// for(var de of g.details){
// if(g.type==1){
// let is_index = 0
// for(var a of r.grounp_admin_detail){
// if(de.name===a.admin?.name){
// if(a.detail){
// is_index++
// }
// }
// }
// de.hasDetail=is_index>0?true:false
// }
// if(g.type==2){
// let is_index = 0
// for(var dp of r.grounp_department_detail){
// if(de.name===dp.department.name){
// if(dp.detail){
// is_index++
// }
// }
// }
// de.hasDetail=is_index>0?true:false
// }
// }
// }
}
}
this.list = res.data
@ -319,7 +359,45 @@
reject(error)
})
}
}
},
contactGroup(arr) {
let tempArr = [],
newArr = []
for (let i = 0; i < arr.length; i++) {
if (tempArr.indexOf(arr[i].name) === -1) {
if(arr[i].type===1){
newArr.push({
type: arr[i].type,
name: arr[i]['name'],
admin_details: arr[i].details,
dep_details: []
})
}else{
newArr.push({
type: arr[i].type,
name: arr[i]['name'],
admin_details:[],
dep_details: arr[i].details
})
}
tempArr.push(arr[i].name);
} else {
for (let j = 0; j < newArr.length; j++) {
if (newArr[j].name == arr[i].name) {
if(arr[i].type===1){
newArr[j].admin_details.push(...arr[i].details)
}else{
newArr[j].dep_details.push(
...arr[i].details
)
}
}
}
}
}
return newArr
},
},
watch: {}
}

@ -54,12 +54,14 @@
</div>
</template>
<template v-else>
<div v-for="item in unitTypeList">
<Button v-if="scope.row.unit_type==item.id" type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="openMyMission(item.value,scope.row)">{{item.remark}}</Button>
<!-- <Button v-if="scope.row.unit_type==item.id" type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="openAsks(scope.row)"></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>
<div v-for="item in unitTypeList">
<Button v-if="scope.row.unit_type==item.id&&scope.row.audit_status==1" type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="openMyMission(item.value,scope.row)">{{item.remark}}</Button>
<!-- <Button v-if="scope.row.unit_type==item.id" type="primary" size="small" style="margin-right:5px;margin-bottom:5px;" @click="openAsks(scope.row)"></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>
<div>
<Button style='margin-right:5px;margin-bottom:5px;' size="small" @click="checkUnits(scope.row.id,'show')"></Button>
</div>
@ -96,7 +98,9 @@
import {
getparameteritem
} from "@/api/system/dictionary.js";
import state from '@/store/modules/user.js'
import state from '@/store/modules/user.js'
import {contactGroup} from './js/index.js'
export default {
components: {
addUnit,
@ -250,20 +254,32 @@
row._names.map(item=>{
return(<div>
{
item.group_name?
item.admin_details?
//
<div style={{"display": "flex"}}> <div>{item.group_name}</div>
<div style={{"display": "flex"}}><div>{item.name}</div>
<div style={{"display": "flex","flex-wrap": "wrap"}}>{
item.details.map(detail=>{
item.admin_details.length>0?
item.admin_details.map(detail=>{
return(
<el-tag type={detail.hasDetail?'':'info'} style={{'margin':'0 5px 5px 0'}}>{detail.name}</el-tag>
)
})
:''
}
{
item.dep_details.length>0?
item.dep_details.map(detail=>{
return(
<el-tag style={{'margin':'0 5px 5px 0'}} type={detail.hasDetail?'':'info'}>{detail.name}</el-tag>
<el-tag type={detail.hasDetail?'':'info'} style={{'margin':'0 5px 5px 0'}}>{detail.name}</el-tag>
)
})
}</div>
:''
}
</div>
</div>
:
//
<el-tag style={{'margin':'0 5px 5px 0'}} type={item.hasDetail?'':'info'}>{item.name}</el-tag>
<el-tag type={item.hasDetail?'':'info'} style={{'margin':'0 5px 5px 0'}}>{item.name}</el-tag>
}
</div>)
}):''
@ -286,7 +302,7 @@
}
},
created() {
this.getLeads()
this.stateObj = state.state
console.log("state111",this.stateObj)
if (this.$route.path) {
@ -332,6 +348,9 @@
},
watch: {},
methods: {
async getLeads(){
await this.$store.dispatch("user/getLeads")
},
async getUnitTypeList(){
const res = await getparameteritem('unitTypeList')
this.unitTypeList = res.detail
@ -476,40 +495,59 @@
}
//
if(r.groups&&r.groups.length>0){
for(var g of r.groups){
for(var de of g.details){
if(g.type==1){
let is_index = 0
for(var a of r.grounp_admin_detail){
if(de.name===a.admin?.name){
if(a.detail){
is_index++
}
}
}
de.hasDetail=is_index>0?true:false
let ab = contactGroup(r.groups)
ab.map(item=>{
item.admin_details.map(a=>{
r.grounp_admin_detail.map(g=>{
if(a.name===g.admin.name){
a.hasDetail = g.detail?true:false
}
if(g.type==2){
let is_index = 0
for(var dp of r.grounp_department_detail){
if(de.name===dp.department.name){
if(dp.detail){
is_index++
}
}
}
de.hasDetail=is_index>0?true:false
})
})
item.dep_details.map(a=>{
r.grounp_department_detail.map(g=>{
if(a.name===g.department.name){
a.hasDetail = g.detail?true:false
}
}
}
// groups
r.groups.map((item,index)=>{
_names.push({
group_name:item.name,
details:item.details
})
})
})
r._names = _names
r._names = ab
// for(var g of r.groups){
// for(var de of g.details){
// if(g.type==1){
// let is_index = 0
// for(var a of r.grounp_admin_detail){
// if(de.name===a.admin?.name){
// if(a.detail){
// is_index++
// }
// }
// }
// de.hasDetail=is_index>0?true:false
// }
// if(g.type==2){
// let is_index = 0
// for(var dp of r.grounp_department_detail){
// if(de.name===dp.department.name){
// if(dp.detail){
// is_index++
// }
// }
// }
// de.hasDetail=is_index>0?true:false
// }
// }
// }
// // groups
// r.groups.map((item,index)=>{
// _names.push({
// group_name:item.name,
// details:item.details
// })
// })
// r._names = _names
}
}

Loading…
Cancel
Save