From 88f195eda091eebf570814d8e970e6c5abea2026 Mon Sep 17 00:00:00 2001 From: Yjhon Date: Wed, 11 May 2022 17:52:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E8=AE=A1=E5=88=92=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=80=89=E6=8B=A9=E5=8D=95=E4=BD=8D,=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=AF=A6=E6=83=85:=E5=A6=82=E6=9E=9C=E6=98=AF?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E9=A1=B9=E7=9B=AE=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=80=83=E8=AF=95=E6=AC=A1=E6=95=B0=E4=B8=8E=E6=A8=A1=E6=8B=9F?= =?UTF-8?q?=E8=80=83=E8=AF=95=EF=BC=8C=E5=9F=B9=E8=AE=AD=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=BA=20=E5=9F=B9=E8=AE=AD=20=E6=88=96=20=E5=9F=B9=E8=AE=AD?= =?UTF-8?q?-=E7=BB=83=E4=B9=A0=20=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=80=83=E8=AF=95=E6=AC=A1=E6=95=B0;=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=B8=AD=E5=8E=BB=E9=99=A4=E4=BA=BA=E6=95=B0?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/project/ProjectDetail.vue | 7 +-- src/views/project/ProjectList.vue | 4 +- src/views/project/trainPlan/TrainPlanForm.vue | 53 +++++++++++++++---- 3 files changed, 49 insertions(+), 15 deletions(-) diff --git a/src/views/project/ProjectDetail.vue b/src/views/project/ProjectDetail.vue index 51c8e80..0047c48 100644 --- a/src/views/project/ProjectDetail.vue +++ b/src/views/project/ProjectDetail.vue @@ -12,15 +12,16 @@ {{projectBasicInfo.trainSdate + ' - ' + projectBasicInfo.trainEdate}} {{projectBasicInfo.practiceSdate + ' - ' + projectBasicInfo.practiceEdate}} {{projectBasicInfo.examSdate + ' - ' + projectBasicInfo.examEdate}} - {{projectBasicInfo.examNumber + '次'}} - {{projectBasicInfo.mockExam == 1 ? '允许':'不允许'}} + + {{projectBasicInfo.examNumber + '次'}} + {{projectBasicInfo.mockExam == 1 ? '允许':'不允许'}} {{projectBasicInfo.remark}} - + diff --git a/src/views/project/ProjectList.vue b/src/views/project/ProjectList.vue index 4f3572a..9721159 100644 --- a/src/views/project/ProjectList.vue +++ b/src/views/project/ProjectList.vue @@ -97,7 +97,7 @@ export default { return record.startDate + ' - ' + record.endDate }, }, - { title: '人数', key: 'personNum', dataIndex: 'personNum', customRender: (text) => text + '人' }, + // { title: '人数', key: 'personNum', dataIndex: 'personNum', customRender: (text) => text + '人' }, { title: '项目类型', dataIndex: 'trainType', key: 'trainType', customRender: (text, record, index) => { //项目类型 @@ -225,7 +225,7 @@ export default { // let f = e.filter(item => {return item.key != 'status'}) c = c.filter(item => {return item.key != 'startDate'}) - c = c.filter(item => {return item.key != 'personNum'}) + // c = c.filter(item => {return item.key != 'personNum'}) c = c.filter(item => {return item.key != 'status'}) this.columns = c diff --git a/src/views/project/trainPlan/TrainPlanForm.vue b/src/views/project/trainPlan/TrainPlanForm.vue index b087edc..98eff1a 100644 --- a/src/views/project/trainPlan/TrainPlanForm.vue +++ b/src/views/project/trainPlan/TrainPlanForm.vue @@ -9,8 +9,15 @@ {{ entity }}年度 - 选择项目 - + + + + + 选择项目 + {{ index + 1 }} @@ -19,13 +26,17 @@ - 保存 + 保存 + 关闭 - - + + @@ -37,6 +48,9 @@ import { STable } from '@/components' import { getProjectList } from '@/api/project/project' import { trainPlanAdd, trainPlanGet } from '@/api/trainplan'; +import { orgList } from '@/api/org/org' +import { listToTree } from '@/utils/util' +const rootParentId = 0 export default { // import引入的组件需要注入到对象中才能使用 @@ -47,6 +61,7 @@ export default { return { disabled: false, title: '年度培训计划', + orgTree: [], queryParam: { pageNum: 1, pageSize: 20 @@ -58,6 +73,7 @@ export default { type: 2, //默认年度计划 name: '', year: '', + orgId: '', projectIds: [], status: 1, //未发布 }, @@ -65,13 +81,20 @@ export default { selectedRowKeys: [], rules: { name: [{ required: true, message: '请输入培训计划名称', trigger: 'blur' }], + orgId: [{ required: true, message: '请选择培训单位', trigger: 'change' }], year: [{ required: true, message: '请选择培训计划年度', trigger: 'change' }], }, - wayEmun:['培训','考试','培训-练习','培训-练习-考试'], + replaceFields: { + children: 'children', + title: 'name', + key: 'id', + value: 'id' + }, + wayEmun: ['培训', '考试', '培训-练习', '培训-练习-考试'], columns: [ { title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } }, { title: '项目名称', dataIndex: 'projectName', key: 'projectName' }, - { title: '项目类型', key: 'trainWay', dataIndex: 'trainWay',customRender: (text, record, index) => { return this.wayEmun[Number(text)-1] } }, + { title: '项目类型', key: 'trainWay', dataIndex: 'trainWay', customRender: (text, record, index) => { return this.wayEmun[Number(text) - 1] } }, { title: '创建人', dataIndex: 'createBy', key: 'createBy' }, { title: '创建时间', dataIndex: 'createDate', key: 'createDate' } ], @@ -205,12 +228,22 @@ export default { this.years.push(new Date().getFullYear() - 2 + i); } console.log('YEARS', this.years) - } + }, + /** + * 获取机构树,并加载于表单中 + */ + getOrgTree() { + const params = { orgType: this.orgType } + orgList(params).then((res) => { + const orgList = listToTree(res.data, [], rootParentId) + this.orgTree = orgList + }) + }, }, // 生命周期 - 创建完成(可以访问当前this实例) created() { let id = this.$route.query.trainPlanId; - + this.getOrgTree(); this.initYears(); if (id) { trainPlanGet({ id: id }).then((res) => { @@ -221,7 +254,7 @@ export default { this.columns = this.columns.filter(item => { return item.key != 'createBy' }) this.columns = this.columns.filter(item => { return item.key != 'createDate' }) - this.columns.push({title:'参与人数',dataIndex:'signCount',key:'signCount'}); + this.columns.push({ title: '参与人数', dataIndex: 'signCount', key: 'signCount' }); }) } if (this.$route.query.t != 'year') {