任务分发

master
lion 1 year ago
parent b6b6958913
commit 95375eda81

@ -1,12 +1,18 @@
import request from "@/utils/request";
function customParamsSerializer(params) {
let result = '';
let result = "";
for (let key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
params[key].forEach((item,index) => {
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
});
if (typeof params[key] === "object") {
params[key].forEach((item, index) => {
if (typeof item === "object") {
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
} else {
result += `${key}[${index}]=${item}&`;
}
});
}
} else {
result += `${key}=${params[key]}&`;
}

@ -2,7 +2,7 @@
<div class="container">
<!-- 查询配置 -->
<div style="padding: 0px 20px 20px 20px;background: #EFF2F9;">
<div @click='logout'>退出</div>
<!-- <div @click='logout'>退出</div> -->
<el-row :gutter="20" class='elrows'>
<el-col :span="24">
@ -47,24 +47,25 @@
<el-badge :value="myselfTotal" class="item"></el-badge>
</span>
<div style="height:350px">
<xy-table :list="myselfList" stripe :isPage="false" :height="'350px'" :table-item="myselfTable">
<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">
<el-table-column align='center' label="操作" width="100" header-align="center">
<template slot-scope="scope">
<div v-for="item in unitTypeList">
<!-- <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>
</div>
</div> -->
<div>
<Button style='margin-right:5px;margin-bottom:5px;' size="small"
@click="checkUnits(scope.row.id,'show')">查看</Button>
<Button style='margin-right:5px;margin-bottom:5px;' type="primary" size="small"
@click="checkUnits(scope.row.id,'show')">查看任务</Button>
</div>
</template>
</el-table-column>
</template>
</xy-table>
</xy-table>
</div>
</el-tab-pane>
</el-tabs>
@ -261,7 +262,7 @@ import addPatrol from '@/views/task/list/components/addPatrol.vue'
import answerQuestion from '@/views/task/list/components/answerQuestion.vue'
import showPlan from '@/views/task/list/components/showPlan.vue'
import showArticle from '@/views/dashboard/components/showArticle.vue'
import state from '@/store/modules/user.js'
export default {
name: 'Dashboard',
computed: {
@ -339,7 +340,8 @@ export default {
//
unitTypeList: [],
myselfList: [],
myselfTotal: '',
myselfTotal: '',
stateObj:{},
auditStatusList: [{
id:4,
value:'待开展',
@ -358,117 +360,50 @@ export default {
type:'danger'
}],
myselfTable: [{
label: "任务名称",
prop: 'name',
width: 200,
// fixed:'left',
align: 'left',
}, {
label: "状态",
prop: 'audit_status',
width: 120,
align: 'center',
customFn: (row) => {
return ( <div> {
this.auditStatusList.map(item => {
if (item.id == row.audit_status) {
return (<el-tag type = {
item.type
} > {
item.value
} </el-tag>)
}
})
} </div>)
}
label: "任务名称",
prop: 'name',
width: 200,
// fixed:'left',
align: 'left',
}, {
label: "任务内容及要求",
prop: 'content',
minWidth: 200,
align: 'left',
}, {
label: "开始日期",
prop: 'start_date',
width: 120,
align: 'center'
}, {
label: "结束日期",
label: "要求完成日期",
prop: 'end_date',
width: 120,
align: 'center'
},
// {
// label: "",
// prop: 'unit_type_detail.value',
// width: 120,
// align: 'center',
// },
{
label: "任务内容及要求",
prop: 'content',
align:'center',
},
// {
// label: "",
// prop: '_names',
// width: 360,
// align: 'left',
// customFn: row => {
// return ( <div style = {
// {
// "display": "flex",
// "flex-wrap": "wrap"
// }
// } > {
// row._names ?
// row._names.map(item => {
// return ( <div> {
// item.group_name ?
// //
// <div> {
// item.group_name
// } {
// item.details.map(detail => {
// return ( <el-tag style = {
// {
// 'margin': '0 5px 5px 0'
// }
// }
// type = {
// detail.hasDetail ? '' : 'info'
// } > {
// detail.name
// } </el-tag>
// )
// })
// } </div> :
// //
// <el-tag style = {
// {
// 'margin': '0 5px 5px 0'
// }
// }
// type = {
// item.hasDetail ? '' : 'info'
// } > {
// item.name
// } </el-tag>
// } </div>)
// }): ''
// } </div>)
// }
// },
{
label: "负责人(科室)",
prop: 'main_admin.name',
width: 120,
align: 'center',
}, {
label: "状态",
prop: 'audit_status',
width: 120,
align: 'center',
customFn: (row) => {
return ( <div> {
this.auditStatusList.map(item => {
if (item.id == row.audit_status) {
return ( <el-tag type = {
item.type
}> {
item.value
} </el-tag>)
}
})
} </div>)
}
}, {
label: "创建时间",
prop: 'created_at',
label: "责任人(科室)",
prop: 'main_admin.name',
width: 120,
align: 'center',
formatter: (cell, data, value, index) => {
return value ? value.substring(0, 11) : ''
}
},
],
}],
depYear:'',
depList:[],
auditTable:{
@ -907,6 +842,8 @@ export default {
// this.getLeads()
this.depYear = (new Date()).getFullYear() + ''
console.log(this.depYear)
this.stateObj = state.state
console.log("this.stateObj",this.stateObj)
// this.updateMissionPlan()
this.getUserId()
this.getUnitTypeList()
@ -1144,74 +1081,32 @@ export default {
page: 1,
page_size: 99,
myself: 1,
audit_status: 1
audit_status: '',
pid:''
})
//
//
for (var r of res.data) {
var _names = []
//
if (r.accept_admin_ids && r.accept_admin_ids.length > 0) {
r.accept_admin_detail.map(item => {
let hasDetail = item.detail ? true : false
_names.push({
'name': item.admin?.name,
'hasDetail': hasDetail
})
})
r._names = _names
}
//
if (r.accept_department_ids && r.accept_department_ids.length > 0) {
r.accept_department_detail.map(item => {
let hasDetail = item.detail ? true : false
_names.push({
'name': item.department?.name,
'hasDetail': hasDetail
})
})
r._names = _names
}
//
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
}
}
// accept_department_ids is_manger = true
//
let spliceIndex = []
let _arr = []
res.data.map((r,index)=>{
let doAdmins = r.do_admin_ids ? r.do_admin_ids : []
if(this.path_type == 5 && r.accept_department_ids.length > 0){
let isDepartment = r.accept_department_ids.indexOf(this.stateObj.department_id)!=-1 ? true : false
let isDomains = doAdmins.indexOf(this.stateObj.login_id)!=-1 ? true : false
if(doAdmins.length==0){
if(!(isDepartment && this.stateObj.is_manger)){
spliceIndex.push(index)
}
}else{
if(!((isDepartment && this.stateObj.is_manger)||isDomains)){
spliceIndex.push(index)
}
}
}
})
const newArr = res.data.filter((_, index) => !spliceIndex.includes(index));
this.myselfList = res.data
this.myselfList = newArr
this.myselfTotal = res.total
// this.activeCount = parseInt(this.activeList.length/6)==1?1:parseInt(this.activeList.length/6)+1
@ -1240,6 +1135,7 @@ export default {
checkUnits(id, type) {
this.$refs.checkUnit.id = id
this.$refs.checkUnit.type = type
this.$refs.checkUnit.url_type = 5
this.isautoplay = false
this.$refs.checkUnit.isShow = true
},

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="type === 'add' ? '发起任务' : '编辑任务'" :form="form"
<xy-dialog ref="dialog" :is-show.sync="isShow" type="form" :title="typeName" :form="form"
:rules='rules' @submit="submit">
<!-- <template v-slot:type>
<div class="xy-table-item">
@ -75,17 +75,31 @@
<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: 600;padding-right: 4px;">*</span>结束日期
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>要求完成日期
</div>
<div class="xy-table-item-content">
<el-date-picker style="width: 400px;" v-model="form.end_date" value-format="yyyy-MM-dd" type="date"
placeholder="选择结束日期">
placeholder="选择要求完成日期">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:lefts>
<div>
<div class="xy-table-item" v-if="showUnit4Type">
<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 @change="changeUnit4Type" v-model="form.mission_type_id" filterable clearable placeholder="请选择任务类别"
style="width: 400px;">
<el-option v-for="item in unit4TypeList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</div>
<div>
<div class="xy-table-item">
@ -358,7 +372,10 @@
get,
del,
updatemission
} from "@/api/task/unit.js";
} from "@/api/task/unit.js";
import {
save as saveLog
} from "@/api/system/baseForm.js";
import {
listdept
} from "@/api/system/department.js"
@ -389,7 +406,8 @@
data() {
return {
isShow: false,
type: 'add',
type: 'add',
typeName:'新增任务',
is_what_unitType: '',
id: '',
upload_link: '',
@ -431,8 +449,10 @@
id: 3,
value: '已完成'
}
],
unitTypeList: [],
],
showUnit4Type:false,
unitTypeList: [],
unit4TypeList:[],
missionPlanList: [],
leads_list: {},
form: {
@ -474,7 +494,10 @@
menu: '',
level: '',
menu_id:'',
level_id:''
level_id:'',
mission_type:'',
mission_type_id:'',
pid:0
},
mission_groups_list: [{
name: '',
@ -566,7 +589,7 @@
setType(type) {
this.form.type = type ? type : 1
},
setoutLineId(id,) {
setoutLineId(id) {
this.form.out_line_id = id ? id : ''
},
setMissionPlanId(id){
@ -576,10 +599,11 @@
// const res = await leads()
this.leads_list = state.state.leads_list.departmen
},
async getUnitTypeList() {
const res = await getparameteritem('unitTypeList')
this.unitTypeList = res.detail
},
async getUnit4TypeList() {
const res = await getparameteritem('missionType')
this.unit4TypeList = res.detail
this.showUnit4Type =true
},
async getMissionPlan() {
const res = await listplan({
@ -596,6 +620,15 @@
})
},
changeUnit4Type(e){
if(e){
this.unit4TypeList.map(item => {
if (e == item.id) {
this.form.mission_type = item.value
}
})
}
},
openQs() {
this.$refs.addQuestion.qsShow = true
@ -652,6 +685,10 @@
}
})
}
},
async getUnitTypeList() {
const res = await getparameteritem('unitTypeList')
this.unitTypeList = res.detail
},
loadUser() {
listCommonuser({
@ -779,8 +816,6 @@
unit_type: res?.unit_type,
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)),
@ -817,11 +852,18 @@
menu: res?.menu,
level: res?.level,
menu_id:res?.menu_id,
level_id:res?.level_id
level_id:res?.level_id,
mission_type:res?.mission_type,
mission_type_id:res?.mission_type_id,
pid:res.pid?res.pid:0
}
//
if (this.type === 'send') {
this.form.name7 = 1
}
if(this.type==='pid'){
this.form.pid = this.id
this.form.id = ''
}
//
if (res.accept_admin_ids && res.accept_admin_ids.length > 0) {
@ -987,20 +1029,28 @@
})
return
}
// return
console.log("type111", this.type)
this.betweenSe(this.form.start_date, this.form.end_date)
if (this.type === 'add') {
if (this.type === 'add' || this.type=== 'pid') {
save({
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增任务成功'
})
saveLog({
table_name:"missions_logs",
mission_name:this.form.name,
mission_id:res.id,
op_name:this.type === 'add'?'新增任务':(this.type=== 'pid'?'新增子任务':'新增任务'),
remark:''
}).then(res=>{
this.isShow = false
this.$emit('refresh')
this.$emit('toUnit', this.form.type)
})
this.isShow = false
this.$emit('refresh')
this.$emit('toUnit', this.form.type)
// this.isShow = false
// this.$emit('refresh')
// this.$emit("uploadOa")
@ -1015,9 +1065,18 @@
Message({
type: 'success',
message: '编辑任务成功'
})
saveLog({
table_name:"missions_logs",
mission_id:this.id,
mission_name:this.form.name,
op_name:this.type === 'editor'?'编辑任务':(this.type=== 'send'?'派发任务':'编辑任务'),
remark:''
}).then(res=>{
this.isShow = false
this.$emit('refresh')
})
this.isShow = false
this.$emit('refresh')
})
}
},
@ -1050,9 +1109,17 @@
var that = this;
if (this.id) {
del(this.id).then(response => {
this.$Message.success('操作成功');
this.isShow = false
this.$emit('refresh')
this.$Message.success('操作成功');
saveLog({
table_name:"missions_logs",
mission_id:this.id,
mission_name:this.form.name,
op_name:'删除任务',
remark:''
}).then(res=>{
this.isShow = false
this.$emit('refresh')
})
}).catch(error => {
console.log(error)
reject(error)
@ -1077,6 +1144,11 @@
}
}
},
"form.type":function(val){
if(val==4){
this.getUnit4TypeList()
}
},
// department_id(val){
// if(val){
@ -1088,10 +1160,28 @@
// },
isShow(newVal) {
if (newVal) {
if (this.type === 'editor' || this.type === 'send') {
this.getDetail()
}
if (newVal) {
switch(this.type){
case 'add':
this.typeName = '发起任务'
break;
case 'editor':
this.typeName = '编辑任务'
this.getDetail()
break;
case 'send':
this.typeName = '分发任务'
this.getDetail()
break;
case 'pid':
this.typeName = '创建子任务'
this.getDetail()
break;
default:
this.typeName = '发起任务'
break;
}
} else {
this.id = ''
this.pictureList = []
@ -1108,7 +1198,8 @@
this.valueMultiple = []
this.valueArr = []
this.checkAll = false
this.isIndeterminate = true
this.isIndeterminate = true
this.showUnit4Type = false
// if(this.auditStatusList.length>5){
// this.auditStatusList.splice(5,1)
// }

File diff suppressed because it is too large Load Diff

@ -0,0 +1,124 @@
<template>
<div>
<xy-dialog ref="dialog" height="90%" :is-show.sync="isShow" type="form" :title="typeName" :form="form">
<template v-slot:logotable>
<xy-table :list="list" :total="total" stripe
@pageSizeChange="e => {select.page_size = e,getList()}" @pageIndexChange="e => {select.page = e,getList()}"
:table-item="table">
<template v-slot:btns>
<div></div>
<!-- <el-table-column align='center' label="操作" width="200" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="editUnit(scope.row,1)">发布任务</Button>
</div>
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="editorPlan(scope.row.id,'editor')">编辑计划</Button>
</div>
</template>
</el-table-column> -->
</template>
</xy-table>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
index
} from "@/api/system/baseForm.js";
export default {
// mixins:[mixins],
components: {
},
data() {
return {
isShow: false,
type: 'add',
typeName: '日志',
id: '',
select:{
page:1,
page_size:10,
with_relations: ['admin']
},
form:{logotable:''},
list:[],
total:0,
table: [{
label: "操作人",
prop: 'admin.name',
align: 'center',
width: 120
},
{
label: "操作",
prop: 'op_name',
align: 'left',
},
{
label: "操作时间",
prop: 'created_at',
align: 'center',
width: 180
}
],
}
},
created() {
},
methods: {
getList() {
index({
table_name: 'missions_logs',
page:this.select.page,
page_size:this.select.page_size,
with_relations:this.select.with_relations,
filter: [{
"key": "mission_id",
"op": "eq",
"value": this.id
}],
}).then(res => {
this.list = res.data
this.total = res.total
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
if(this.id){
this.getList()
}
} else {
this.id = ''
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .logotable{
flex-basis: 100%;
}
::v-deep .xy-table__page{
align-items: center;
}
::v-deep .xy-table__setting{
bottom:13px;
}
</style>

@ -33,7 +33,7 @@
</div>
<div class="tablewrap">
<div class="tablemonth">
<div class="tablemonth" v-if="showSelectMonth">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange"></el-checkbox>
<div style="margin: 15px 0;"></div>
<el-checkbox-group v-model="selectMonth" @change="changeMonth">
@ -41,11 +41,11 @@
</el-checkbox-group>
</div>
<div class="tablecontent">
<div class="tablecontent" :style="{'width':showSelectMonth?'89%':'100%'}">
<div>
共有<span style="font-size: 24px;color:red;margin:0 5px">{{list.length}}</span>项任务<span
共有<span style="font-size: 24px;color:red;margin:0 5px">{{total}}</span>项任务<span
style="font-size: 24px;color:red;margin:0 5px">{{auditStatus1}}</span>项未完成</div>
<xy-table :list="list" :total="total" stripe @cell-dblclick='cellClicks'
<xy-table :list="list" :defaultExpandAll="false" :treeProps="treeProps" :rowKey="id" :total="total" stripe @cell-dblclick='cellClicks'
@pageSizeChange="e => {select.page_size = e,getList()}" @pageIndexChange="e => {select.page = e,getList()}"
:table-item="table">
<template v-slot:btns>
@ -69,24 +69,28 @@
@click="backPlan(scope.row)">归档</Button>
</div>
</template>
<template v-else>
<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>
<template v-else>
<!-- 任务是发给部门的只有指定部门科长能看见需要再次分发人员 -->
<div
v-if="scope.row.accept_department_ids && scope.row.accept_department_ids.length>0 && stateObj.is_manger && !(scope.row.audit_status==3||scope.row.audit_status==5)">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small"
@click="editorUnit(scope.row.id,'send')">指定人员</Button>
</div>
@click="editorUnit(scope.row.id,'send')">派发任务</Button>
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small"
@click="editorUnit(scope.row.id,'pid')">创建任务</Button>
</div>
<!-- 直接 执行任务 -->
<div v-else>
<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>
</div>
</div>
<div>
<Button style='margin-right:5px;margin-bottom:5px;' type="primary" size="small"
@click="checkUnits(scope.row.id,'show')">查看</Button>
@click="checkUnits(scope.row.id,'show')">查看任务</Button>
</div>
</template>
@ -147,7 +151,8 @@
type_name: '',
path_type: 4,
dialogVisible: false,
stateObj: {},
stateObj: {},
treeProps:{children: 'pid_details', hasChildren: 'hasChildren' },
typeName: [{
type: 1,
name: '年度计划任务'
@ -173,7 +178,8 @@
sort_name: 'start_date',
sort_type: 'DESC',
year: new Date().getFullYear(),
month: ''
month: '',
pid:0,
},
total: 0,
pickerOptions: {
@ -245,7 +251,8 @@
currentTableList: [],
auditStatus1: 0,
isIndeterminate: true,
checkAll: false,
checkAll: false,
showSelectMonth:false,
selectMonth: [],
allMonths: [{
id: "01",
@ -285,12 +292,14 @@
value: '十二月'
}],
table: [{
label: "id",
prop: 'id',
// fixed:'left',
align: 'left',
},{
table: [
// {
// label: "id",
// prop: 'id',
// // fixed:'left',
// align: 'left',
// },
{
label: "任务名称",
prop: 'name',
width: 200,
@ -307,7 +316,7 @@
width: 120,
align: 'center'
}, {
label: "结束日期",
label: "要求完成日期",
prop: 'end_date',
width: 120,
align: 'center'
@ -351,9 +360,12 @@
let path = this.$route.path.split("_")
this.select.type = path[1]
this.path_type = path[1]
if (path[1] == 5) {
if (path[1] == 5) {
this.showSelectMonth = true
this.select.type = ''
this.select.myself = 1
this.select.myself = 1
this.select.pid = ''
this.treeProps = {children: 'nochildren', hasChildren: 'hasChildren' }
this.type_name = '我的任务'
this.path_type = path[1]
// this.table = this.table.slice(2)
@ -363,12 +375,24 @@
// }
// })
}
if (path[1] == 4) {
if (path[1] == 4) {
this.selectMonth = []
this.allMonths.map(item=>{
this.selectMonth.push(item.id)
})
this.select.month = this.selectMonth.join(',')
this.select.type = 4
this.type_name = '专项专题任务'
this.path_type = path[1]
this.path_type = path[1]
this.table.unshift({
label: "任务类别",
prop: 'mission_type',
width: 120,
align: 'left'
})
}
if (path[1] == 1) {
if (path[1] == 1) {
this.showSelectMonth = true
this.select.type = 1
this.type_name = '年度计划任务'
this.path_type = path[1]
@ -415,9 +439,14 @@
case '培训':
this.openTrain(e)
break;
case '资料收集':
case '资料收集':
case '方案':
this.openUploads(e)
break;
break;
// case '':
// this.openCases(e)
// break;
}
},
@ -447,6 +476,11 @@
this.$refs.checkUnit.id = e.id
this.$refs.checkUnit.type = 'uploads'
this.$refs.checkUnit.isShow = true
},
openCases(e) {
this.$refs.checkUnit.id = e.id
this.$refs.checkUnit.type = 'cases'
this.$refs.checkUnit.isShow = true
},
openStudy(e) {
this.$refs.checkUnit.id = e.id
@ -459,7 +493,8 @@
}
if(formtype){
this.$refs.addUnit.setType(4)
}
}
this.$refs.addUnit.type = type
this.$refs.addUnit.unitTypeList = this.unitTypeList
this.$refs.addUnit.department_id = this.stateObj.department_id
@ -467,13 +502,15 @@
},
//
cellClicks(e) {
this.$refs.checkUnit.id = e.row.id
this.$refs.checkUnit.id = e.row.id
this.$refs.checkUnit.url_type = this.path_type
this.$refs.checkUnit.type = 'show'
this.$refs.checkUnit.isShow = true
},
checkUnits(id, type) {
this.$refs.checkUnit.id = id
this.$refs.checkUnit.type = type
this.$refs.checkUnit.type = type
this.$refs.checkUnit.url_type = this.path_type
this.$refs.checkUnit.isShow = true
},
changeDate(e) {
@ -501,31 +538,32 @@
// accept_department_ids is_manger = true
//
let spliceIndex = []
let _arr = []
res.data.map((r,index)=>{
let doAdmins = r.do_admin_ids ? r.do_admin_ids : []
// console.log("123", this.path_type == 5, r.accept_department_ids.length > 0, !this.stateObj
// .is_manger, (doAdmins.length == 0 || doAdmins.indexOf(this.stateObj.login_id) == -1))
if(this.path_type == 5 && r.accept_department_ids.length > 0){
console.log("id2---",r.id)
let isDepartment = r.accept_department_ids.indexOf(this.stateObj.department_id)!=-1 ? true : false
let isDomains = doAdmins.indexOf(this.stateObj.login_id)!=-1 ? true : false
console.log("id---",r.id,isDepartment,isDomains,this.stateObj.is_manger)
if(doAdmins.length==0){
if(!(isDepartment && this.stateObj.is_manger)){
// res.data.splice(index, 1)
spliceIndex.push(index)
}
}else{
if(!((isDepartment && this.stateObj.is_manger)||isDomains)){
// res.data.splice(index, 1)
spliceIndex.push(index)
}
}
}
})
if(this.path_type == 5){
const newArr = res.data.filter((_, index) => !spliceIndex.includes(index));
_arr = newArr
this.list = _arr
}else{
this.list = res.data
}
console.log("spliceIndex",spliceIndex)
const newArr = res.data.filter((_, index) => !spliceIndex.includes(index));
this.list = newArr
this.total = res.total

Loading…
Cancel
Save