master
lion 1 year ago
parent 0bd6d40664
commit a3a23707f4

@ -4,4 +4,4 @@ ENV = 'production'
# base api
VUE_APP_BASE_API = http://192.168.60.99:9001/
#VUE_APP_BASE_API = 'http://safety.115.langye.net/'
#VUE_APP_BASE_API = 'http://safety.115.langye.net/'

@ -47,7 +47,8 @@
<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" :defaultExpandAll="false" :showIndex="false"
:treeProps="treeProps" stripe :isPage="false" :height="'350px'" :table-item="myselfTable">
<template v-slot:btns>
<el-table-column align='center' label="操作" width="100" header-align="center">
<template slot-scope="scope">
@ -56,9 +57,107 @@
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',5)">查看任务</Button>
</div> -->
<!-- 任务是发给部门的只有指定部门科长能看见需要再次分发人员 -->
<!-- 任务发给部门的科长责任人都能进行任务分解任务转办执行任务的操作 -->
<div
v-if="(scope.row.accept_department_ids && scope.row.accept_department_ids.length>0 && stateObj.is_manger
) || scope.row.main_admin_id==stateObj.login_id
">
<Dropdown trigger="click" v-if="!(scope.row.audit_status==3||scope.row.audit_status==5)">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small">
执行任务
<!-- <Icon type="ios-arrow-down"></Icon> -->
</Button>
<template #list>
<DropdownMenu>
<DropdownItem>
<Button type="primary" size="small"
@click="editorUnit(scope.row.id,'send')">任务转办</Button>
</DropdownItem>
<DropdownItem>
<Button type="primary" size="small"
@click="editorUnit(scope.row.id,'pid')">任务分解</Button>
</DropdownItem>
<DropdownItem>
<div v-for="item in unitTypeList">
<Button v-if="scope.row.unit_type==item.id&&scope.row.audit_status==1" type="primary" size="small"
@click="openMyMission(item.value,scope.row)">任务执行</Button>
</div>
</DropdownItem>
</DropdownMenu>
</template>
</Dropdown>
</div>
<!-- 小组的带头人 和小组组长 -->
<div v-else-if="(scope.row.groups && scope.row.groups.length>0 )
|| scope.row.main_admin_id==stateObj.login_id">
<!-- 组长权限 -->
<Dropdown trigger="click" v-if="scope.row.grounp_admin_detail.includes(stateObj.login_id) && !(scope.row.audit_status==3||scope.row.audit_status==5)">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small">
执行任务
<!-- <Icon type="ios-arrow-down"></Icon> -->
</Button>
<template #list>
<DropdownMenu>
<DropdownItem>
<Button type="primary" size="small"
@click="editorUnit(scope.row.id,'send')">任务转办</Button>
</DropdownItem>
<DropdownItem>
<Button type="primary" size="small"
@click="editorUnit(scope.row.id,'pid')">任务分解</Button>
</DropdownItem>
<DropdownItem>
<div v-for="item in unitTypeList">
<Button v-if="scope.row.unit_type==item.id&&scope.row.audit_status==1" type="primary" size="small"
@click="openMyMission(item.value,scope.row)">任务执行</Button>
</div>
</DropdownItem>
</DropdownMenu>
</template>
</Dropdown>
<!-- 组里面所有人都能执行任务 -->
<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)">执行任务</Button>
</div>
</div>
</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)">执行任务</Button>
</div>
</div>
<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)">执行任务</Button>
</div> -->
<Button style='margin-right:5px;margin-bottom:5px;' type="primary" size="small"
@click="checkUnits(scope.row.id,'show')">查看任务</Button>
</div>
</template>
@ -221,7 +320,7 @@
<!-- <showPatrol ref='showPatrol' @refresh='getMyselfList'></showPatrol> -->
<showArticle ref='showArticle' @refresh="refreshIsshow"></showArticle>
<addUnit ref='addUnit' @refresh='getMyselfList'></addUnit>
</div>
</div>
</template>
@ -262,7 +361,8 @@ 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'
import state from '@/store/modules/user.js'
import addUnit from '@/views/task/list/components/addUnit.vue'
export default {
name: 'Dashboard',
computed: {
@ -278,7 +378,8 @@ export default {
addPatrol,
answerQuestion,
showArticle,
showPlan
showPlan,
addUnit,
},
data() {
return {
@ -358,8 +459,14 @@ export default {
id:3,
value:'待归档',
type:'danger'
}],
myselfTable: [{
}],
treeProps:{children: 'mychildren', hasChildren: 'hasChildren'},
myselfTable: [{
label: "",
prop: 'pindex',
// fixed:'left',
width:80
},{
label: "任务名称",
prop: 'name',
width: 200,
@ -398,12 +505,14 @@ export default {
})
} </div>)
}
}, {
label: "责任人(科室)",
prop: 'main_admin.name',
width: 120,
align: 'center',
}],
},
// {
// label: "()",
// prop: 'main_admin.name',
// width: 120,
// align: 'center',
// },
],
depYear:'',
depList:[],
auditTable:{
@ -1079,10 +1188,14 @@ export default {
async getMyselfList() {
const res = await listunit({
page: 1,
page_size: 99,
page_size: 999,
myself: 1,
audit_status: '',
pid:''
pid:'',
sort_name: 'start_date',
sort_type: 'DESC',
year: new Date().getFullYear(),
month: '',
})
// accept_department_ids is_manger = true
//
@ -1090,7 +1203,7 @@ export default {
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){
if(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){
@ -1103,16 +1216,50 @@ export default {
}
}
}
})
const newArr = res.data.filter((_, index) => !spliceIndex.includes(index));
this.myselfList = newArr
})
const newArr = res.data.filter((_, index) => !spliceIndex.includes(index));
_arr = this.buildTree(newArr)
_arr.map((r,index)=>{
r.pindex = index+1
})
this.myselfList = _arr
this.myselfTotal = res.total
// this.activeCount = parseInt(this.activeList.length/6)==1?1:parseInt(this.activeList.length/6)+1
// this.autoScroll()
},
buildTree(items) {
const tree = [];
const map = {};
items.forEach(item => {
map[item.id] = item;
});
items.forEach(item => {
const parent = map[item.pid];
if (parent) {
(parent.mychildren || (parent.mychildren = [])).push(item);
} else {
tree.push(item);
}
});
return tree;
},
editorUnit(id, type , formtype) {
if (id) {
this.$refs.addUnit.id = id
}
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
this.$refs.addUnit.isShow = true
},
openMyMission(remark, e) {
switch (remark) {
case '检查':

@ -21,20 +21,6 @@
</div>
</div>
</div>
<div>
<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-upload :action="action" class='upload-demo' :file-list="pictureList" ref="pictureUpload"
style="width:400px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</div>
<div>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -46,7 +32,20 @@
</div>
</div>
</div>
<div>
<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-upload :action="action" class='upload-demo' :file-list="pictureList" ref="pictureUpload"
style="width:400px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-remove="handleRemove">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</div>
</template>
<template v-slot:rights v-if="type!='audit'">
<div>
@ -94,7 +93,7 @@
</Button>
<Button v-if="type!='audit' && form.audit_status!=0" type="primary" style='margin-left:5px;margin-bottom:5px;' @click="clickSubmit('save')"></Button>
</Button>
<Button v-if="type!='audit' && form.audit_status!=0" type="primary" style='margin-left:5px;margin-bottom:5px;' @click="clickSubmit('confirm')"></Button>
<Button v-if="(type!='audit' && form.audit_status!=0) || type=='add'" type="primary" style='margin-left:5px;margin-bottom:5px;' @click="clickSubmit('confirm')"></Button>
</Button>
<Button type="primary" ghost style='margin-left:5px;margin-bottom:5px;' @click="isShow=false"></Button>
<Poptip v-if="type!='audit' && form.audit_status==2" transfer confirm title="确认要删除吗?" @on-ok="deleteList">

@ -97,9 +97,9 @@
<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)) || scope.row.main_admin_id==stateObj.login_id
) || scope.row.main_admin_id==stateObj.login_id
">
<Dropdown trigger="click">
<Dropdown trigger="click" v-if="!(scope.row.audit_status==3||scope.row.audit_status==5)">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small">
执行任务
<!-- <Icon type="ios-arrow-down"></Icon> -->
@ -130,10 +130,10 @@
</div>
<!-- 小组的带头人 和小组组长 -->
<div v-else-if="(scope.row.groups && scope.row.groups.length>0 && !(scope.row.audit_status==3||scope.row.audit_status==5))
<div v-else-if="(scope.row.groups && scope.row.groups.length>0 )
|| scope.row.main_admin_id==stateObj.login_id">
<!-- 组长权限 -->
<Dropdown trigger="click" v-if="scope.row.grounp_admin_detail.includes(stateObj.login_id)">
<Dropdown trigger="click" v-if="scope.row.grounp_admin_detail.includes(stateObj.login_id) && !(scope.row.audit_status==3||scope.row.audit_status==5)">
<Button style="margin-right:5px;margin-bottom:5px;" type="primary" size="small">
执行任务
<!-- <Icon type="ios-arrow-down"></Icon> -->
@ -174,7 +174,7 @@
<!-- 直接 执行任务 -->
<div v-else>
<div v-for="item in unitTypeList">
<Button v-if="scope.row.unit_type==item.id" type="primary" size="small"
<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)">执行任务</Button>
</div>

Loading…
Cancel
Save