master
lion 2 years ago
parent d5b50a4ecb
commit 4ecfbd8e9c

@ -46,10 +46,10 @@ import { getToken } from "@/utils/auth";
import { imports } from "@/api/task/newplan.js";
export default {
props: {
// formInfo: {
// type: Array,
// default: () => [],
// },
formInfo: {
type: Array,
default: () => [],
},
tableName: String,
},
data() {
@ -57,7 +57,7 @@ export default {
action: `${process.env.VUE_APP_BASE_API}api/admin/base-form/excel-show`,
dialogVisible: false,
headers: [],
formInfo:[],
// formInfo:[],
tableList: [],
table: [],
};

@ -68,8 +68,8 @@
</div>
</div>
</template> -->
<template v-slot:start_date>
<!-- <div class="xy-table-item">
<!-- <template v-slot:start_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>月份
</div>
@ -82,9 +82,9 @@
:key="mon">{{mon}}</el-checkbox>
</el-checkbox-group>
</div>
</div> -->
</template>
<!-- <template v-slot:status>
</div>
</template> -->
<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>计划状态
@ -96,7 +96,7 @@
</el-select>
</div>
</div>
</template> -->
</template>
<!-- <template v-slot:end_date>
<div class="xy-table-item">
@ -414,7 +414,8 @@ import elSelectTree from '@/components/selectTree'
out_line_content:'',
name: '',
year:'',
start_date: [],
status:1,
// end_date: '',
@ -427,9 +428,9 @@ import elSelectTree from '@/components/selectTree'
accept_admin_ids: [],
accept_department_ids: [],
mission_plan_groups: [],
status:1,
plan_type:'',
type: '',
start_date: [],
},
monthsArr:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
table:[{
@ -519,11 +520,12 @@ import elSelectTree from '@/components/selectTree'
const res = await getparameteritem('planType')
this.planTypeList = res.detail
},
setMenuLevel(menu,level,outLineId,content){
setMenuLevel(menu,level,outLineId,out_line_content,content){
this.form.menu = menu?menu:''
this.form.level = level?level:''
this.form.out_line_id = outLineId?outLineId:''
this.form.out_line_content = content?content:''
this.form.out_line_content = out_line_content?out_line_content:''
this.form.content = content?content:''
},
changeType(e){
console.log("e",e)
@ -707,8 +709,8 @@ import elSelectTree from '@/components/selectTree'
out_line_content:res?.out_line_content,
name: res?.name,
year:res.year?res.year:new Date().getFullYear(),
status:res.status?res.status:1,
start_date: res.start_date?res.start_date:[],
// end_date: res?.end_date,
@ -720,9 +722,10 @@ import elSelectTree from '@/components/selectTree'
content: res?.content,
accept_admin_ids: res?.accept_admin_ids,
accept_department_ids: res?.accept_department_ids,
status:res.status?res.status:1,
plan_type:res?.plan_type,
type: res?.type,
start_date: res.start_date?res.start_date:[],
}
this.valueMultiple=[]
this.valueArr=[]
@ -941,6 +944,10 @@ import elSelectTree from '@/components/selectTree'
}]
this.valueMultiple = []
this.valueArr = []
this.checkAll = false
this.isIndeterminate = true
this.checkAllMonth = false
this.isIndeterminateMonth = true
this.$refs['dialog'].reset()
}
},

@ -556,6 +556,10 @@ import elSelectTree from '@/components/selectTree'
this.getUnitTypeList()
},
methods: {
setNameContent(name,content){
this.form.name = name?name:''
this.form.content = content?content:''
},
async getLeads(){
// const res = await leads()
this.leads_list = state.state.leads_list.departmen
@ -1006,6 +1010,8 @@ import elSelectTree from '@/components/selectTree'
this.upload_link = ''
this.valueMultiple = []
this.valueArr = []
this.checkAll = false
this.isIndeterminate = true
// if(this.auditStatusList.length>5){
// this.auditStatusList.splice(5,1)
// }

@ -17,6 +17,12 @@
</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">
计划名称
@ -64,14 +70,6 @@
</template>
{{showform.end_date?showform.end_date:''}}
</el-descriptions-item> -->
<el-descriptions-item span='4'>
<template slot="label">
附件
</template>
<div v-for="item in pictureList">
<a target="_blank" :href="item.url">{{item.name}}</a>
</div>
</el-descriptions-item>
<el-descriptions-item span='4'>
<template slot="label">
参与对象
@ -103,6 +101,14 @@
</template>
{{showform.content?showform.content:''}}
</el-descriptions-item>
<el-descriptions-item span='4'>
<template slot="label">
附件
</template>
<div v-for="item in pictureList">
<a target="_blank" :href="item.url">{{item.name}}</a>
</div>
</el-descriptions-item>
</el-descriptions>
<!-- <el-divider>计划内容</el-divider>
<xy-table
@ -373,6 +379,7 @@
this.$refs.addUnit.id=plan_id
}else{
this.$refs.addUnit.plan_id = this.id
this.$refs.addUnit.setNameContent(this.showform.level,this.showform.content)
}
this.$refs.addUnit.isShow = true

@ -214,7 +214,7 @@
this.$refs.addOutline.isShow = true
},
editorPlan(row, type){
this.$refs.addPlan.setMenuLevel(row.menu,row.level,row.id,row.content)
this.$refs.addPlan.setMenuLevel(row.menu,row.level,row.id,row.content,row.flow)
this.$refs.addPlan.type = type
this.$refs.addPlan.isShow = true
}

@ -8,7 +8,7 @@
placeholder="计划状态">
<Option v-for="item in statusList" :value="item.id">{{item.value}}</Option>
</Select>
<DatePicker style='width:200px;margin-right: 10px;' placeholder="年份" placement="bottom" format='yyyy'
<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="关键字搜索" />
@ -18,23 +18,31 @@
<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="chooseEditorPlan()">编辑</Button> -->
<!-- <Button type="primary" style='margin-left: 10px;'
@click="importPlan()">导入</Button> -->
</div>
</slot>
</lx-header>
</div>
<!-- @cell-click="cellClicks" -->
<!-- :span-method="spanMethod" -->
<!-- :showIndex='false' -->
<xy-table :list="list"
:total="total"
:span-method="spanMethod"
: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">
:defaultExpandAll="false"
:isPage='false'>
<template v-slot:btns>
<el-table-column align='center' label="操作" width="100" header-align="center">
<template slot-scope="scope">
@ -42,6 +50,10 @@
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="showPlan(scope.row.id)">查看/添加</Button>
</div>
<div>
<Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="editorPlan(scope.row.id,'editor')">编辑</Button>
</div>
<!-- <Button type="primary" style='margin-right:5px;margin-bottom:5px;' size="small"
@click="editorUnit('add',scope.row.id)">发起任务</Button> -->
</template>
@ -51,6 +63,7 @@
<addPlan ref='addPlan' @refresh='getList'></addPlan>
<showPlan ref='showPlan'></showPlan>
<addUnit ref='addUnit' @refresh='getList'></addUnit>
<imports ref="imports" :tableName="'mission_plans'" :formInfo="table"></imports>
</div>
</template>
@ -58,16 +71,22 @@
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 {
listplan,
del
} from '@/api/task/plan.js'
import {
getMergeCells,
groupBy
} from '@/utils/contactTable.js'
import state from '@/store/modules/user.js'
export default {
components: {
addPlan,
showPlan,
addUnit
addUnit,
imports
},
data() {
return {
@ -76,13 +95,13 @@
select: {
keyword: '',
page: 1,
page_size: 10,
page_size: 9999,
status: '',
// is_myself_audit:0,
year: new Date().getFullYear(),
year: '',
plan_type: '',
sort_name: 'start_date',
sort_type: 'DESC'
sort_name: '',
sort_type: ''
},
sectionList:[],
total: 0,
@ -128,55 +147,57 @@
value:'审核不通过',
type:'warning'
}],
table: [{
type:'selection',
width:50,
selectable:(row,index)=>{
if(this.stateObj.login_id==row.admin_id||this.stateObj.is_guiji||this.stateObj.is_chuzhang||this.stateObj.is_admin){
return true
}else{
return false
}
}
},
{
type:'expand',
width:50,
expandFn:(row)=>{
table: [
// {
// type:'selection',
// width:50,
// selectable:(row,index)=>{
// if(this.stateObj.login_id==row.admin_id||this.stateObj.is_guiji||this.stateObj.is_chuzhang||this.stateObj.is_admin){
// return true
// }else{
// return false
// }
// }
// },
// {
// type:'expand',
// width:50,
// expandFn:(row)=>{
return(<div style={{"border-bottom": "1px solid #EBEEF5"}}>
{
row.row.mission.length>0?
row.row.mission.map((item,index)=>{
return(<div class='expandrow'>
<p>{index+1}<span>任务名称:</span><span>{item.name}</span></p>
<p><span>状态:</span><span>{
this.auditStatusList.map(status=>{
if(item.audit_status===status.id){
return status.value
}
})
// return(<div style={{"border-bottom": "1px solid #EBEEF5"}}>
// {
// row.row.mission.length>0?
// row.row.mission.map((item,index)=>{
// return(<div class='expandrow'>
// <p>{index+1}<span>:</span><span>{item.name}</span></p>
// <p><span>:</span><span>{
// this.auditStatusList.map(status=>{
// if(item.audit_status===status.id){
// return status.value
// }
// })
}</span></p>
<p><span>开始日期:</span><span>{item.start_date}</span></p>
<p><span>结束日期:</span><span>{item.end_date}</span></p>
<p><span>任务类型:</span><span>{item.unit_type_detail?item.unit_type_detail.value:''}</span></p>
<p><span>创建人:</span><span>{item.admin?item.admin.name:''}</span></p>
<p><span>创建科室:</span><span>{item.department?item.department.name:''}</span></p>
<p><span>创建时间:</span><span>{item.created_at.substring(0,11)}</span></p>
</div>)
})
// }</span></p>
// <p><span>:</span><span>{item.start_date}</span></p>
// <p><span>:</span><span>{item.end_date}</span></p>
// <p><span>:</span><span>{item.unit_type_detail?item.unit_type_detail.value:''}</span></p>
// <p><span>:</span><span>{item.admin?item.admin.name:''}</span></p>
// <p><span>:</span><span>{item.department?item.department.name:''}</span></p>
// <p><span>:</span><span>{item.created_at.substring(0,11)}</span></p>
// </div>)
// })
:<div class='expandrow'>暂无任务</div>
}</div>)
}
},
// :<div class='expandrow'></div>
// }</div>)
// }
// },
// {
// label: "",
// prop: 'year',
// width: 80,
// },
{
label: "年份",
prop: 'year',
width: 120,
},{
label: "工作项目",
prop: 'menu',
width: 120,
@ -185,9 +206,16 @@
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"}}>
{
@ -201,13 +229,14 @@
}
</div>)
}
},{
label: "计划名称",
prop: 'name',
align: 'left'
// width:200
},
// {
// label: "",
// prop: 'name',
// align: 'left'
// // width:200
// },
// {
// label: "",
// prop: 'type_detail.value',
// width: 180,
@ -229,6 +258,7 @@
label: "状态",
prop: 'status',
width: 120,
align:'left',
customFn:(row)=>{
return(<div>
{
@ -294,6 +324,7 @@
label: "任务数量",
prop: 'mission',
width: 120,
align:'left',
formatter:(cell,data,value,index)=>{
return value?(value.length===0?'--':value.length):'--'
}
@ -305,10 +336,20 @@
list: [],
}
},
computed: {
//
spanArr() {
if (!this.list.length) return []
const mergeCols = ['menu','level'] //
const data = groupBy(this.list, 'menu')
return getMergeCells(data, this.table, mergeCols)
}
},
created() {
// this.getUserId()
// this.getLeads()
this.stateObj = state.state
this.select.year = (new Date()).getFullYear() + ''
this.getList()
},
methods: {
@ -377,6 +418,15 @@
this.list = res.data
this.total = res.total
},
spanMethod({
row,
colomn,
rowIndex,
columnIndex
}) {
return this.spanArr[rowIndex][columnIndex]
},
changeYear(e) {
console.log(e)
this.select.year = e
@ -431,6 +481,9 @@
})
}
},
importPlan(){
this.$refs.imports.show()
},
contactGroup(arr) {
let tempArr = [],
newArr = []
@ -492,6 +545,10 @@
font-weight: 300;
}
::v-deep .el-table .cell.el-tooltip {
white-space: normal !important;
width: 100% !important;
}
/* /deep/ .el-table__body tr.el-table__row--striped td {
background-color: #C0C4CC!important;
} */

@ -248,11 +248,18 @@
align:'center'
},
{
label: "任务类型",
prop: 'unit_type_detail.value',
width: 120,
label: "任务说明",
prop: 'content',
width: 200,
align:'center',
}, {
}
// {
// label: "",
// prop: 'unit_type_detail.value',
// width: 120,
// align:'center',
// }
, {
label: "参与对象",
prop: '_names',
width: 360,
@ -573,6 +580,10 @@
</script>
<style scoped>
::v-deep .el-table .cell.el-tooltip {
white-space: normal !important;
width: 100% !important;
}
/deep/ .el-icon-circle-close {
color: #fff
}

Loading…
Cancel
Save