lion 2 years ago
parent 3fa4fd2c78
commit b6b6958913

@ -42,3 +42,12 @@ export function get(id) {
}
})
}
export function unDoTotal(params) {
return request({
url: '/api/admin/mission/index_total',
method: 'get',
params:params
})
}

@ -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">

@ -48,7 +48,7 @@
</el-input>
</el-form-item>
<el-form-item label="排序">
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" autocomplete="off"></el-input>
</el-form-item>
</el-form>
@ -89,7 +89,8 @@
id: "",
pid: "0",
pname: "根目录",
type: 1
type: 1,
sort:0
},
rules: {
name: [{

@ -21,9 +21,9 @@
</span>
<el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType"
placeholder="请输入密码" name="password" tabindex="2" auto-complete="off" @keyup.enter.native="handleLogin" />
<!-- <span class="show-pwd" @click="showPwd">
<span class="show-pwd" @click="showPwd">
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
</span> -->
</span>
</el-form-item>
<el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;"

@ -215,8 +215,10 @@
} else {
this.form.file_list = []
}
console.log("this.form",this.form)
// return
store(this.form).then(response => {
this.saveUnitStatus()
// this.saveUnitStatus()
}).catch(error => {
//reject(error)
})

@ -31,7 +31,7 @@
</div>
<div class="xy-table-item-content">
<el-select v-model="form.menu" @change="changeMenu" style="width: 400px;" placeholder="请选择">
<el-option v-for="item in menuList" :key="item.value" :label="item.value" :value="item.value">
<el-option v-for="item in menuList" :key="item.id" :label="item.name" :value="item.name">
</el-option>
</el-select>
</div>
@ -43,8 +43,8 @@
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>性质级别
</div>
<div class="xy-table-item-content">
<el-select v-model="form.level" style="width: 400px;" placeholder="请选择">
<el-option v-for="(item,index) in levelList" :key="index" :label="item" :value="item">
<el-select v-model="form.level" @change="changeLevel" style="width: 400px;" placeholder="请选择">
<el-option v-for="(item,index) in levelList" :key="item.id" :label="item.name" :value="item.name">
</el-option>
</el-select>
</div>
@ -179,7 +179,9 @@
import {
listdept
} from "@/api/system/department.js"
import {
listregulation
} from "@/api/lawsfile/regulation.js";
export default {
components: {
@ -188,7 +190,8 @@
return {
isShow: false,
type: 'add',
id: '',
id: '',
menuSort:0,
form: {
mission_plan_id:'',
name: '',
@ -206,7 +209,10 @@
join_dep_id: '',
join_dep_explain: '',
flow: '',
resource: '',
resource: '',
sort:0,
menu_id:'',
level_id:''
},
depList: [],
@ -243,7 +249,8 @@
}
},
created() {
this.loadDeptOptions()
this.loadDeptOptions()
this.getMenus()
},
methods: {
setMissionId(e){
@ -255,16 +262,40 @@
if(e){
this.form.name = e
}
},
async getMenus(){
var that = this;
await listregulation(1, 20).then(res => {
this.menuList = res
}).catch(error => {
console.log(error)
})
},
changeMenu(e) {
if (e) {
this.form.level = ''
this.form.level = ''
this.form.level_id = ''
this.menuList.map(item => {
if (e === item.value) {
this.levelList = item.remark ? item.remark.split("、") : []
if (e === item.name) {
this.form.menu_id = item.id
this.levelList = item.children ? item.children: [],
this.menuSort = item.sort
}
})
}
},
changeLevel(e){
let sort = 0
if(e){
this.levelList.map((item,index)=>{
if(e===item.name){
sort = item.sort
this.form.level_id = item.id
}
})
this.form.sort = this.menuSort +'' +sort
console.log(this.form.sort)
}
},
//
loadDeptOptions() {
@ -321,10 +352,14 @@
this.$refs.dialog.submit()
},
submit() {
// console.log(this.form)
// return
if (this.id) {
this.form.id = this.id
}
console.log(this.form)
if(this.type=='add'){
this.form.id = ''
console.log(this.form)
// return
}
save({
table_name: 'new_plans',
@ -374,10 +409,16 @@
join_dep_id: res ? res.join_dep_id : [],
join_dep_explain: res?.join_dep_explain,
flow: res?.flow,
resource: res?.resource,
}
resource: res?.resource,
sort:res.sort?res.sort:0,
menu_id:res?.menu_id,
level_id:res?.level_id
}
this.menuList.map(item=>{
if(this.form.menu==item.name){
this.levelList = item.children
}
})
})
}
},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -5,24 +5,6 @@
<template v-slot:contents>
<el-divider>计划信息</el-divider>
<el-descriptions class="margin-top" :column="4" border>
<el-descriptions-item span="2">
<template slot="label">
工作项目
</template>
{{showform.menu?showform.menu:''}}
</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">
性质级别
</template>
{{showform.level?showform.level:''}}
</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">
主要内容
</template>
{{showform.out_line_content?showform.out_line_content:''}}
</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">
计划名称
@ -35,66 +17,18 @@
</template>
{{showform.year?showform.year:''}}
</el-descriptions-item>
<!-- <el-descriptions-item span="2">
<el-descriptions-item span='2'>
<template slot="label">
计划类型
责任人科室
</template>
<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>
</el-descriptions-item> -->
{{showform.main_admin?showform.main_admin.name:''}}
</el-descriptions-item>
<el-descriptions-item span="2">
<template slot="label">
月份
</template>
{{showform.start_date?showform.start_date.join("、"):''}}
</el-descriptions-item>
<!-- <el-descriptions-item span="2">
<template slot="label">
计划状态
</template>
<div v-for="item in statusList">
<span v-if="showform.status==item.id">
{{item.value}}
</span>
</div>
</el-descriptions-item> -->
<!-- <el-descriptions-item span="2">
<template slot="label">
结束日期
</template>
{{showform.end_date?showform.end_date:''}}
</el-descriptions-item> -->
<el-descriptions-item span='4'>
<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.group_details">
{{group.name}}:
<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>
<el-descriptions-item span='4'>
<template slot="label">
说明
@ -110,22 +44,11 @@
</div>
</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>
<!-- <Button :disabled="hasLocked" type="primary" style='margin-right:5px;margin-bottom:5px;'
@click="editorUnit('add')">发布任务</Button> -->
<Button type="primary" style='margin-right:5px;margin-bottom:5px;'
@click="editorUnit('add')">发布任务</Button>
<xy-table
:list="mission_log"
stripe
@ -139,7 +62,7 @@
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="checkUnits(scope.row.id,'show')"></Button>
</div>
<div>
<Button type="primary" :disabled="hasLocked" style='margin-right:5px;margin-bottom:5px;' size="small" @click="editorUnit('editor',scope.row.id)"></Button>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small" @click="editorUnit('editor',scope.row.id)"></Button>
</div>
<div>
<!-- <Button v-if="scope.row.audit_admin_id==login_id&&scope.row.audit_status==0" style="margin-right:5px;margin-bottom:5px;" type="primary" size="small" @click="checkUnits(scope.row.id,'check')"></Button> -->
@ -153,9 +76,9 @@
<template v-slot:footerContent>
<!-- {{showform.is_lock}} -->
<Button v-if="stateObj.login_id==showform.admin_id||stateObj.is_guiji||stateObj.is_chuzhang" :type="showform.is_lock?'':'primary'"
<!-- <Button v-if="stateObj.login_id==showform.admin_id||stateObj.is_guiji||stateObj.is_chuzhang" :type="showform.is_lock?'':'primary'"
:style="showform.is_lock?'background:#ccc;border:1px solid #ccc;color:#fff;margin-left:5px;margin-bottom:5px;':'margin-left:5px;margin-bottom:5px;'"
@click="changeLock">锁定</Button>
@click="changeLock">锁定</Button> -->
<Button type="primary" ghost style='margin-left:5px;margin-bottom:5px;' @click="isShow=false"></Button>
</template>
@ -227,30 +150,22 @@
accept_department_ids: [],
is_lock:null
},
auditStatusList:[{
id:0,
value:'待审核',
type:'warning'
},{
id:4,
value:'待开展',
type:'info'
},{
id:1,
value:'开展中',
type:''
},{
id:2,
value:'未完成',
type:'danger'
},{
id:3,
value:'已完成',
type:'success'
},{
id:5,
value:'审核不通过',
type:'warning'
auditStatusList:[{
id: 4,
value: '待开展',
type: 'info'
}, {
id: 1,
value: '未完成',
type: ''
}, {
id: 5,
value: '已归档',
type: 'success'
}, {
id: 3,
value: '待归档',
type: 'danger'
}],
table:[{
label: "月份",
@ -285,15 +200,22 @@
// fixed:'left',
width:200,
align:'left',
}, {
label: "任务内容及要求",
prop: 'content',
minWidth: 200,
align: 'left',
},{
label: "任务级别",
prop: 'type',
// fixed:'left',
width:200,
formatter: (cell, data, value, index) => {
return value===4?'专项专题任务':'年度计划任务'
}
}, {
label: "开始日期",
prop: 'start_date',
width: 110,
align:'center'
}, {
label: "结束日期",
prop: 'end_date',
width: 110,
align:'center'
}, {
label: "状态",
prop: 'audit_status',
width: 80,
@ -310,23 +232,7 @@
</div>)
}
},{
label: "开始日期",
prop: 'start_date',
width: 110,
align:'center'
}, {
label: "结束日期",
prop: 'end_date',
width: 110,
align:'center'
},
{
label: "任务类型",
prop: 'unit_type_detail.value',
width: 80,
align:'center',
}, {
label: "责任科室",
label: "参与对象",
prop: '_names',
// width: 240,
align: 'left',
@ -357,13 +263,8 @@
}</div>)
}
},{
label: "创建人",
prop: 'admin.name',
width: 80,
align: 'center',
},{
label: "创建科室",
prop: 'department.name',
label: "责任人",
prop: 'main_admin.name',
width: 80,
align: 'center',
},{
@ -386,9 +287,14 @@
if(type==='editor'){
this.$refs.addUnit.id=unit_id
}else{
this.$refs.addUnit.plan_id = this.id
this.$refs.addUnit.setNameContent(this.showform.out_line_content,this.showform.content)
this.$refs.addUnit.type="add"
this.$refs.addUnit.setoutLineId(this.showform.out_line_id)
this.$refs.addUnit.setMissionPlanId(this.showform.id)
this.$refs.addUnit.setType(1)
this.$refs.addUnit.setNameContent(this.showform.name,this.showform.content)
this.$refs.addUnit.setMenuLevel(this.showform.menu,this.showform.level)
this.$refs.addUnit.setMainId(this.showform.main_department_id,this.showform.main_admin_id)
this.$refs.addUnit.isShow = true
}
this.$refs.addUnit.isShow = true

@ -1,37 +1,36 @@
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
* 处理组别返回
*/
import {
listCommonuser
} from "@/api/common.js"
let userData1 = []
// 获取 userdata
export function getChangeUser() {
console.log("userData1", userData1)
if (userData1.length > 0) {
console.log("123")
return
} else {
listCommonuser({
page_size: 999,
}).
then((res) => {
// userData1 = res.data ? res.data.reverse() : [];
let data = res.data ? res.data.reverse() : [];
let contactData = contactUser(data)
userData1 = sortDepartment(contactData, 'department_id')
console.log("userData1", userData1)
return userData1
}).catch(error => {
console.log(error)
})
}
}
/**
* @param {Object} arr
* 处理组别返回
*/
export function contactGroup(arr) {
let tempArr = [],
newArr = []
@ -68,4 +67,37 @@ export function contactGroup(arr) {
}
}
return newArr
}
/*
* 人员按照部门重组
*/
export function contactUser(arr) {
let tempArr = [],
newArr = []
for (let i = 0; i < arr.length; i++) {
if (tempArr.indexOf(arr[i].department_id) === -1) {
newArr.push({
department_id: arr[i].department_id,
name: arr[i]['department']['name'],
manager_id: arr[i]['department']['manager_id'],
leader_id: arr[i]['department']['leader_id'],
children: [arr[i]]
})
tempArr.push(arr[i].department_id);
} else {
for (let j = 0; j < newArr.length; j++) {
if (newArr[j].department_id == arr[i].department_id) {
newArr[j].children.push(arr[i])
}
}
}
}
return newArr
}
export function sortDepartment(arr, key) {
return arr.sort(function(a, b) {
var x = a[key]
var y = b[key]
return ((x < y) ? -1 : (x > y) ? 1 : 0)
})
}

@ -22,7 +22,11 @@
<template slot-scope="scope">
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="editUnit(scope.row,1)">发起任务</Button>
@click="editPlan(scope.row,'add')">年度计划</Button>
</div>
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="editUnit(scope.row,4)">专题任务</Button>
</div>
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@ -34,8 +38,7 @@
</xy-table>
<addOutline ref="addOutline" @refresh="getList"></addOutline>
<addPlan ref="addPlan" @refresh="getList"></addPlan>
<addUnit ref="addUnit" @toUnit="toUrlUnit" @refresh="getList"></addUnit>
<addUnit ref="addUnit" @toUnit="getList" @refresh="getList"></addUnit>
</div>
</template>
@ -129,12 +132,12 @@
spanArr() {
if (!this.missionLogTable.length) return []
const mergeCols = ['menu', 'level'] //
const data = groupBy(this.mission_log, 'id')
const data = groupBy(this.mission_log, 'sort')
return getMergeCells(data, this.missionLogTable, mergeCols)
}
},
created() {
this.getMenuList()
// this.getMenuList()
this.getList()
},
methods: {
@ -180,7 +183,7 @@
this.$refs.addOutline.setMissionId(this.id)
this.$refs.addOutline.setName(`${this.select.year}任务大纲`)
this.$refs.addOutline.type = type
this.$refs.addOutline.menuList = this.menuList
// this.$refs.addOutline.menuList = this.menuList
this.$refs.addOutline.isShow = true
},
editUnit(row,type){
@ -188,13 +191,19 @@
this.$refs.addUnit.setoutLineId(row.id)
this.$refs.addUnit.setType(type)
this.$refs.addUnit.setNameContent(row.content,row.flow)
this.$refs.addUnit.setMenuLevel(row.menu,row.level)
this.$refs.addUnit.setMenuLevel(row.menu,row.level,row.menu_id,row.level_id)
this.$refs.addUnit.isShow = true
},
editPlan(row,type){
this.$refs.addPlan.type="add"
this.$refs.addPlan.setMenuLevel(row)
this.$refs.addPlan.isShow = true
},
toUrlPlan(){
this.$router.push('/task/list/plan_1')
},
toUrlUnit(e){
console.log("e",e)
let type = e? e :1
this.$router.push('/task/list/unit_'+e)
this.$router.push('/task/list/unit_4')
},
},

@ -4,539 +4,160 @@
<lx-header icon="md-apps" :text="textName" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.status"
<!-- <Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.status"
placeholder="计划状态">
<Option v-for="item in statusList" :value="item.id">{{item.value}}</Option>
</Select>
<DatePicker v-model="select.year" style='width:200px;margin-right: 10px;' placeholder="年份" placement="bottom" format='yyyy'
type="year" @on-change="changeYear"></DatePicker>
<Input v-model="select.keyword" clearable style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<!-- <Select filterable clearable style='width:200px;margin-right: 10px;' v-model="select.plan_id" placeholder="专项任务">
<Option v-for="item in missionList" :value="item.id">{{item.name}}</Option>
</Select> -->
<DatePicker v-model="select.year" style='width:200px;margin-right: 10px;' placeholder="年份"
placement="bottom" format='yyyy' type="year" @on-change="changeYear"></DatePicker>
<Input v-model="select.keyword" clearable style="width: 200px;margin-right: 10px;" placeholder="关键字搜索" />
<Button type="primary" @click="getList"></Button>
<!-- <Button type="primary" style="margin-left: 10px;" @click="editorPlan('','add')"></Button> -->
<!-- <Button type="primary" style='margin-left: 10px;'
@click="chooseEditorPlan()">编辑</Button> -->
<!-- <Button type="primary" style='margin-left: 10px;'
@click="importPlan()">导入</Button> -->
</div>
</slot>
</lx-header>
</div>
<div class="tablewrap">
<div class="tablemonth">
<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">
<el-checkbox v-for="item in allMonths" :label="item"></el-checkbox>
</el-checkbox-group>
</div>
<div class="tablecontent">
<xy-table :list="currentTableList"
:total="total"
:span-method="spanMethod"
row-key="rowindex"
:showIndex='false'
stripe
@cell-dblclick="cellClicks"
@selection-change='selectionChange'
@pageSizeChange="e => {select.page_size = e,getList()}"
@pageIndexChange="e => {select.page = e,getList()}"
:table-item="table"
:defaultExpandAll="false"
:isPage='false'>
<template v-slot:btns>
<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="showPlan(scope.row.id)">新增年度任务</Button> -->
<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="showPlan(scope.row.id)">新增专项任务</Button> -->
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="editUnit(scope.row,4)">新增专项任务</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>
</div>
</div>
</div>
<div class="tablewrap">
<div class="tablemonth">
<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">
<el-checkbox v-for="item in allMonths" :label="item"></el-checkbox>
</el-checkbox-group>
</div>
<addPlan ref='addPlan' @refresh='getList'></addPlan>
<div class="tablecontent">
<xy-table :list="list" :total="total" row-key="rowindex" stripe @cell-dblclick="cellClicks"
@pageSizeChange="e => {select.page_size = e,getList()}" @pageIndexChange="e => {select.page = e,getList()}"
:table-item="table">
<template v-slot:btns>
<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>
</div>
</div>
<addPlan ref='addPlan' @refresh='getList'></addPlan>
<addUnit ref='addUnit' @refresh="getList"></addUnit>
<showPlan ref='showPlan'></showPlan>
<addUnit ref='addUnit' @refresh='getList'></addUnit>
<imports ref="imports" :tableName="'mission_plans'" :formInfo="table"></imports>
</div>
</template>
<script>
import addPlan from '../list/components/addPlan.vue'
import addPlan from '../list/components/addPlan.vue'
import addUnit from '../list/components/addUnit.vue'
import showPlan from '../list/components/showPlan.vue'
import imports from '@/components/imports/imports'
import showPlan from '../list/components/showPlan.vue'
import {
listplan,
del
} from '@/api/task/plan.js'
import {
getMergeCells,
groupBy
} from '@/utils/contactTable.js'
} from '@/api/task/plan.js'
import state from '@/store/modules/user.js'
export default {
components: {
addPlan,
showPlan,
addUnit,
imports
showPlan,
addUnit
},
data() {
return {
textName: '',
stateObj:{},
textName: '',
stateObj: {},
select: {
keyword: '',
page: 1,
page_size: 9999,
status: '',
page_size: 10,
// is_myself_audit:0,
year: '',
plan_type: '',
sort_name: '',
sort_type: ''
},
sectionList:[],
sort_type: '',
main_admin_id:1,
month:''
},
isIndeterminate: true,
checkAll: false,
selectMonth: [],
allMonths: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
total: 0,
statusList: [{
id:0,
value:'未完成',
type:'danger'
},{
id:1,
value:'未开展',
type:'info'
},{
id:2,
value:'开展中',
type:''
},{
id:3,
value:'已完成',
type:'success'
}],
auditStatusList:[{
id:0,
value:'待审核',
type:'warning'
},{
id:4,
value:'待开展',
type:'info'
},{
id:1,
value:'开展中',
type:''
},{
id:2,
value:'未完成',
type:'danger'
},{
id:3,
value:'已完成',
type:'success'
},{
id:5,
value:'审核不通过',
type:'warning'
}],
currentTable:'',
currentTableList:[],
isIndeterminate:true,
checkAll:false,
selectMonth:[],
allMonths : ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
table: [
{
label: "工作项目",
prop: 'menu',
width: 120,
},{
label: "性质级别",
prop: 'level',
width: 120,
},{
label: "主要内容",
prop: 'out_line_content',
// width: 120,
align:'left'
},
// {
// label: "",
// prop: 'start_date',
// width: 180,
// align:'left',
// customFn:(row)=>{
// return(<div style={{"display": "flex","flex-wrap": "wrap","justify-content": "center"}}>
// {
// row.start_date.map((item,index)=>{
// return(<span>{
// index===row.start_date.length-1?
// item
// :item+""
// }</span>)
// })
// }
// </div>)
// }
// },
// {
// label: "",
// prop: 'name',
// align: 'left'
// // width:200
// },
// {
// label: "",
// prop: 'type_detail.value',
// width: 180,
// customFn:(row)=>{
// return(<div style={{"display": "flex","flex-wrap": "wrap","justify-content": "center"}}>
// {
// row.type_detail.map((item,index)=>{
// return(<span>{
// index===row.type_detail.length-1?
// item.value
// :item.value+""
// }</span>)
// })
// }
// </div>)
// }
// },
{
label: "状态",
prop: 'status',
width: 120,
align:'left',
customFn:(row)=>{
return(<div>
{
this.statusList.map(item=>{
if(item.id==row.status){
return(<el-tag type={item.type}>{item.value}</el-tag>)
}
})
}
</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.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,
align:'left',
formatter:(cell,data,value,index)=>{
return value?(value.length===0?'--':value.length):'--'
}
list: [],
table: [{
label: "计划名称",
prop: 'name',
align:'left'
}, {
label: "任务要求及内容",
prop: 'content',
// width: 120,
align: 'left'
}, {
label: "审核人",
prop: 'admin.name',
label: "责任人",
prop: 'main_admin.name',
width: 120,
}],
list: [],
}]
}
},
computed: {
//
spanArr() {
for(var k in this.currentTableList){
if (!this.currentTableList.length) return []
const mergeCols = ['menu','level'] //
const data = groupBy(this.currentTableList, 'id')
// console.log("data",data)
return getMergeCells(data, this.table, mergeCols)
}
}
},
created() {
// this.getUserId()
// this.getLeads()
created() {
// this.getUserId()
// this.getLeads()
this.stateObj = state.state
this.select.year = (new Date()).getFullYear() + ''
let currentMonth = this.allMonths[(new Date()).getMonth()]
console.log("this.stateObj",this.stateObj)
if(this.stateObj.is_guiji){
this.select.main_admin_id = 0
}
this.select.year = (new Date()).getFullYear() + ''
let currentMonth = this.allMonths[(new Date()).getMonth()]
this.selectMonth.push(currentMonth)
this.select.month = this.selectMonth.join(',')
this.getList()
},
methods: {
spanMethod({
row,
colomn,
rowIndex,
columnIndex
}) {
return this.spanArr[rowIndex][columnIndex]
},
methods: {
async getList() {
const res = await listplan({
...this.select
})
//
for(var r of res.data){
var _names = []
//
if(r.accept_admin_ids&&r.accept_admin_ids.length>0){
r.accept_admin.map(item=>{
let hasDetail = item.detail?true:false
_names.push({
'name':item.name
})
})
r._names = _names
}
//
if(r.accept_department_ids&&r.accept_department_ids.length>0){
r.accept_department.map(item=>{
let hasDetail = item.detail?true:false
_names.push({
'name':item.name,
'hasDetail':hasDetail
})
})
r._names = _names
}
//
if(r.groups&&r.groups.length>0){
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
// this.currentTableList = this.groupByMonth(this.list)
// let data = this.groupByMonth(this.list)
// let data3 = []
// let monthObj = this.sortByMonth()
// Object.entries(data).forEach(([key, value]) => {
// value.forEach((item,index) => {
// let item1 = this.deepCloneObject(item)
// item1.monthName = key;
// data3.push({
// rowindex:key+index,
// monthIndex:monthObj[key],
// ...item1
// })
// });
// });
this.currentTableList = this.filterBySelectedMonths(this.list,this.selectMonth)
})
this.list = res.data
this.total = res.total
},
handleCheckAllChange(val) {
this.selectMonth = val ? this.allMonths : [];
this.isIndeterminate = false;
let _arr = []
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
this.currentTableList = _arr
},
changeMonth(e){
let checkedCount = e.length;
this.checkAll = checkedCount === this.allMonths.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.allMonths.length;
},
handleCheckAllChange(val) {
this.selectMonth = val ? this.allMonths : [];
this.isIndeterminate = false;
let _arr = []
_arr = this.filterBySelectedMonths(this.list,this.selectMonth)
this.currentTableList = _arr
},
filterBySelectedMonths(arr, selectMonth) {
if (!selectMonth || selectMonth.length === 0) {
return arr;
}
// Ensure selectMonth is an array even if it's a single value
if (!Array.isArray(selectMonth)) {
selectMonth = [selectMonth];
}
return arr.filter(obj => {
// Check if there's at least one common month between obj.month and selectMonth
return obj.start_date.some(month => selectMonth.includes(month));
});
},
deepCloneObject(obj) {
let clone = {};
Object.keys(obj).forEach((key) => {
if (obj[key] instanceof Array) {
clone[key] = this.deepCloneArray(obj[key]);
} else if (typeof obj[key] === 'object' && obj[key] !== null) {
clone[key] = this.deepCloneObject(obj[key]);
} else {
clone[key] = obj[key];
}
});
return clone;
},
deepCloneArray(arr) {
let clone = [];
arr.forEach((item, index) => {
if (Array.isArray(item)) {
clone[index] = this.deepCloneArray(item);
} else if (typeof item === 'object' && item !== null) {
clone[index] = this.deepCloneObject(item);
} else {
clone[index] = item;
}
});
return clone;
},
groupByMonth(originalArray) {
const groupedArrays = {};
originalArray.forEach(obj => {
obj.start_date.forEach(month => {
if (!groupedArrays[month]) {
groupedArrays[month] = [];
}
groupedArrays[month].push(obj);
});
});
return groupedArrays;
},
sortByMonth(){
const now = new Date();
const currentMonth = now.getMonth(); // 0-110
const allMonths = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
const decemberAndPrevious = allMonths.slice(currentMonth);
const monthArr = [...decemberAndPrevious, ...allMonths.slice(0, currentMonth)]
const monthObj = {}
monthArr.map((item,index)=>{
monthObj[item] = index
})
return monthObj
},
this.select.month = this.selectMonth.join(',')
this.getList()
},
changeMonth(e) {
let checkedCount = e.length;
this.checkAll = checkedCount === this.allMonths.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.allMonths.length;
this.select.month = this.selectMonth.join(',')
this.getList()
},
changeYear(e) {
console.log(e)
this.select.year = e
},
selectionChange(e){
let arr = []
if(e.length>0){
for(var k of e){
arr.push(k.id)
}
}else{
arr = []
}
this.sectionList = arr
editUnit(row,type){
this.$refs.addUnit.type="add"
this.$refs.addUnit.setoutLineId(row.out_line_id)
this.$refs.addUnit.setMissionPlanId(row.id)
this.$refs.addUnit.setType(type)
this.$refs.addUnit.setNameContent(row.name,row.content)
this.$refs.addUnit.setMenuLevel(row.menu,row.level,row.menu_id,row.level_id)
this.$refs.addUnit.setMainId(row.main_department_id,row.main_admin_id)
this.$refs.addUnit.isShow = true
},
chooseEditorPlan(){
if(this.sectionList.length>0){
if(this.sectionList.length==1){
this.editorPlan(this.sectionList[0],'editor')
}else{
this.$Message.warning('每次只能编辑一条年度计划任务');
}
}else{
this.$Message.warning('请选择需要编辑的年度计划任务');
}
toUrlUnit(e){
this.$router.push('/task/list/unit_1')
},
editorPlan(id, type) {
if (type == 'add') {
@ -546,120 +167,71 @@
this.$refs.addPlan.type = type
this.$refs.addPlan.isShow = true
},
cellClicks(e){
this.$refs.showPlan.id = e.row.id
this.$refs.showPlan.isShow = true
cellClicks(e) {
this.$refs.showPlan.id = e.row.id
this.$refs.showPlan.isShow = true
},
showPlan(id) {
this.$refs.showPlan.id = id
this.$refs.showPlan.isShow = true
},
editUnit(row,type){
this.$refs.addUnit.plan_id = row.id
this.$refs.addUnit.setType(type)
this.$refs.addUnit.setNameContent(row.out_line_content,row.content)
this.$refs.addUnit.setMenuLevel(row.menu,row.level)
this.$refs.addUnit.isShow = true
},
deleteList(id) {
var that = this;
if (id) {
del(id).then(response => {
this.$Message.success('操作成功');
that.getList();
}).catch(error => {
console.log(error)
reject(error)
})
}
},
importPlan(){
this.$refs.imports.show()
},
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: {}
}
</script>
<style scoped>
.tablewrap{
display:flex;
}
.tablemonth{
width:10%;
background: #fff;
padding: 20px;
margin-right:1%;
}
.tablecontent{
width:89%
}
/deep/ .v-table .el-table__body .monthName{
vertical-align: top!important;
<style scoped>
.tablewrap {
display: flex;
}
.tablemonth {
width: 10%;
background: #fff;
padding: 20px;
margin-right: 1%;
}
.tablecontent {
width: 89%
}
/deep/ .v-table .el-table__body .monthName {
vertical-align: top !important;
}
/deep/ .el-icon-circle-close {
color: #fff
}
.expandrow{
display: flex;
font-size: 16px;
padding-left:50px;
padding-bottom: 9px;
flex-wrap: wrap;
}
.expandrow p{
margin-right:20px;
}
.expandrow p span:first-child{
font-weight: 300;
}
::v-deep .el-table .cell.el-tooltip {
white-space: normal !important;
width: 100% !important;
}
::v-deep .el-collapse-item__header{
padding-left: 30px;
font-size: 18px;
.expandrow {
display: flex;
font-size: 16px;
padding-left: 50px;
padding-bottom: 9px;
flex-wrap: wrap;
}
.expandrow p {
margin-right: 20px;
}
.expandrow p span:first-child {
font-weight: 300;
}
::v-deep .el-table .cell.el-tooltip {
white-space: normal !important;
width: 100% !important;
}
::v-deep .el-collapse-item__header {
padding-left: 30px;
font-size: 18px;
}
/* /deep/ .el-table__body tr.el-table__row--striped td {
background-color: #C0C4CC!important;
} */

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save