From 84605fd1e766d200f9ce219c0294c65ac888dc28 Mon Sep 17 00:00:00 2001 From: yanran200730 Date: Mon, 24 Oct 2022 15:57:26 +0800 Subject: [PATCH] bug --- .../app/AppRatingTask/components/Detail.vue | 201 ++++++++++---- .../AppRatingTask/components/FormDetail.vue | 251 ++++++++---------- .../hlj/app/AppRatingTask/components/List.vue | 63 +++-- 3 files changed, 296 insertions(+), 219 deletions(-) diff --git a/project/hlj/app/AppRatingTask/components/Detail.vue b/project/hlj/app/AppRatingTask/components/Detail.vue index 477ca135..93f58716 100644 --- a/project/hlj/app/AppRatingTask/components/Detail.vue +++ b/project/hlj/app/AppRatingTask/components/Detail.vue @@ -9,11 +9,13 @@ @@ -24,24 +26,23 @@ 添加表单 + + + @@ -51,37 +52,38 @@ title="添加表单" @onConfirm="onConfirm"> - + - - + + - - + +
- -
- {{ item.name }} + +
+ {{ item.name }}
- 请选择 -
{{ form.examines.length ? '重新选择' : '选择' }}
+ 请选择 +
{{ form.evaluatorsList.length ? '重新选择' : '选择' }}
- - + +
- -
- {{ item.name }} + +
+ {{ item.name }}
- 请选择 -
{{ form.examines1.length ? '重新选择' : '选择' }}
+ 请选择 +
{{ form.scorerList.length ? '重新选择' : '选择' }}
@@ -91,6 +93,7 @@ type="daterange" size="small" range-separator="至" + value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期"> @@ -116,12 +119,12 @@ info: {}, form: { date: '', - name: '', - type: '', - examines: [], - examines1: [], - examinesName2: '', - examinesName1: '' + templateId: '', + templateName: '', + evaluatorsList: [], + scorerList: [], + evaluatorsNames: '', + scorerNames: '' }, search: { current: 1, @@ -133,10 +136,45 @@ isLoading: false, tableData: [], colConfigs: [ - {prop: 'remarks', label: '异常记录', align: 'center' }, - {prop: 'createTime', label: '创建时间', align: 'center'}, - {prop: 'createUserName', label: '记录人', align: 'center' } + {prop: 'templateName', label: '表单名称', align: 'center', width: 220 }, + {prop: 'createUserName', label: '添加人', align: 'center', width: 150 }, + { + prop: 'status', + align: 'center', + label: '开始结束时间', + render: (h, {row}) => { + return h('span', { + }, `${row.beginTime.split(' ')[0]} - ${row.endTime.split(' ')[0]}`) + } + }, + { + prop: 'status', + align: 'center', + width: 300, + label: '已填写/剩余份数', + render: (h, {row}) => { + return h('span', { + style: { + width: '300px' + } + }, `${row.overPhr}/${row.totalPhr}`) + } + }, + { + prop: 'status', + align: 'center', + label: '任务状态', + width: 100, + render: (h, {row}) => { + return h('span', { + style: { + color: this.dict.getColor('formStatus', row.status) + } + }, this.dict.getLabel('formStatus', row.status)) + } + } ], + list: [], tabList: ['基本信息', '风险处置'] } }, @@ -144,20 +182,19 @@ created () { if (this.params && this.params.id) { this.id = this.params.id - // this.$dict.load(['EP_registerPersonType', 'EP_communityHandleType', 'EP_highRiskIndustries', 'EP_travelType', 'yesOrNo', 'EP_homeStatus2', 'EP_quarantineStrategy', 'EP_controlMethod', 'EP_abnormalType']).then(() => { - // this.getInfo(this.params.id) - // }) + this.$dict.load(['tastStatus', 'formStatus']).then(() => { + this.getInfo() + }) } + + this.getList() }, methods: { - getInfo (id) { - this.instance.post(`/app/appepidemicpreventionregisterinfo/queryDetailById?id=${id}`).then(res => { + getInfo () { + this.instance.post(`/app/appassessmentscortask/queryDetailById?id=${this.params.id}`).then(res => { if (res.code === 0) { this.info = res.data - this.info.travelTypeNames = res.data.travelType.split(',').map(v => { - return this.dict.getLabel('EP_travelType', v) - }).join(',') } this.isLoading = false @@ -166,6 +203,40 @@ }) }, + changeStatus (id) { + this.$confirm(`确定停用该表单?`).then(() => { + this.instance.post(`/app/appassessmentscortask/stopTaskTemplate?id=${id}`).then(res => { + if (res.code == 0) { + this.$message.success(`停用成功!`) + this.getList() + } + }) + }) + }, + + getList () { + this.instance.post(`/app/appassessmentscoretemplate/list?size=1000`).then(res => { + if (res.code == 0) { + this.list = res.data.records.map(v => { + return { + dictValue: v.id, + dictName: v.title + } + }) + } + }) + }, + + toDetail (formId) { + this.$emit('change', { + type: 'FormDetail', + params: { + id: this.params.id, + formId: formId || '' + } + }) + }, + onUserChange(e, type) { if (e.length) { this.form[type] = '1' @@ -174,14 +245,34 @@ } }, - onConfirm (id) { + onClose () { + this.form.date = '' + this.form.name = '' + this.form.templateId = '' + this.form.templateName = '' + this.form.evaluatorsList = [] + this.form.scorerList = [] + this.form.evaluatorsNames = '' + this.form.scorerNames = '' + }, + + onConfirm () { this.$refs.form.validate((valid) => { if (valid) { - this.isShow = false - this.$emit('change', { - type: 'Detail', - params: { - id: id || '' + this.instance.post(`/app/appassessmentscortask/addTemplate`, { + ...this.form, + beginTime: this.form.date[0] + ' 00:00:00', + endTime: this.form.date[1] + ' 23:59:59', + taskId: this.params.id, + evaluatorsNames: this.form.evaluatorsList.map(v => v.name).join(','), + scorerNames: this.form.scorerList.map(v => v.name).join(','), + date: '' + }).then(res => { + if (res.code == 0) { + this.$message.success('提交成功!') + this.isShow = false + + this.getInfo() } }) } diff --git a/project/hlj/app/AppRatingTask/components/FormDetail.vue b/project/hlj/app/AppRatingTask/components/FormDetail.vue index 247e5cde..ae812cce 100644 --- a/project/hlj/app/AppRatingTask/components/FormDetail.vue +++ b/project/hlj/app/AppRatingTask/components/FormDetail.vue @@ -8,10 +8,11 @@ @@ -27,11 +28,18 @@