diff --git a/components/index.js b/components/index.js index 32334ef7..7cca617a 100644 --- a/components/index.js +++ b/components/index.js @@ -5,6 +5,15 @@ let components = []; // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册 const install = function (Vue) { if (install.installed) return; + // 声明全局业务对象类 + const models = require.context('./model', true, /\.js$/) + if (models) { + const model = {} + models.keys().map(e => { + model[e.replace(/\.[\/\\]([^\\\/]+)\.js$/, '$1')] = models(e).default + }) + Vue.prototype.MODEL = model + } // 遍历注册全局组件 let contexts = require.context('.', true, /[\\\/]Ai([^\\\/]+)\.vue$/); if (contexts) { diff --git a/components/model/Party.js b/components/model/Party.js new file mode 100644 index 00000000..e69de29b diff --git a/components/model/PartyOrg.js b/components/model/PartyOrg.js new file mode 100644 index 00000000..7b3ee15f --- /dev/null +++ b/components/model/PartyOrg.js @@ -0,0 +1,26 @@ +import http from "dvcp-ui/lib/js/request"; +import Vue from "vue" + +export default class PartyOrg { + constructor(id) { + this.id = id + this.loaded = false + this.init().finally(() => this.loaded = true) + } + + init() { + return PartyOrg.getInfo(this.id).then(data => { + Object.entries(data).map(([k, v]) => Vue.set(this, k, v)) + }) + } + + static getInfo(id) { + return http.post("/app/partyOrganization/queryOrgById", null, { + params: {id} + }).then(res => { + if (res?.data) { + return res.data + } + }) + } +} diff --git a/project/hlj/app/AppRatingTask/components/Detail.vue b/project/hlj/app/AppRatingTask/components/Detail.vue index 477ca135..7320254c 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,46 +52,48 @@ title="添加表单" @onConfirm="onConfirm"> - + - - + + - - + +
- -
- {{ item.name }} + +
+ {{ item.name }}
- 请选择 -
{{ form.examines.length ? '重新选择' : '选择' }}
+ 请选择 +
{{ form.evaluatorsList.length ? '重新选择' : '选择' }}
- - + +
- -
- {{ item.name }} + +
+ {{ item.name }}
- 请选择 -
{{ form.examines1.length ? '重新选择' : '选择' }}
+ 请选择 +
{{ form.scorerList.length ? '重新选择' : '选择' }}
@@ -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], + endTime: this.form.date[1], + 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..e01fae56 100644 --- a/project/hlj/app/AppRatingTask/components/FormDetail.vue +++ b/project/hlj/app/AppRatingTask/components/FormDetail.vue @@ -8,10 +8,14 @@ @@ -27,11 +31,18 @@
@@ -54,7 +65,7 @@ tableSize="small" :current.sync="search1.current" :size.sync="search1.size" - @getList="getMemberInfo"> + @getList="getList1"> diff --git a/project/hlj/app/AppRatingTask/components/List.vue b/project/hlj/app/AppRatingTask/components/List.vue index 9d9659cd..3de0b74f 100644 --- a/project/hlj/app/AppRatingTask/components/List.vue +++ b/project/hlj/app/AppRatingTask/components/List.vue @@ -9,12 +9,12 @@ @@ -42,10 +42,11 @@ :visible.sync="isShow" width="590px" title="新建评分任务" + @close="onClose" @onConfirm="onConfirm"> - - + + @@ -67,16 +68,27 @@ search: { current: 1, size: 10, - name: '' + title: '' }, form: { - name: '' + title: '' }, colConfigs: [ - { prop: 'name', label: '任务名称' }, - { prop: 'phone', align: 'center', label: '创建人' }, - { prop: 'startTime', align: 'center', label: '更新时间' }, - { prop: 'startAreaName', align: 'center', label: '任务状态' } + { prop: 'title', label: '任务名称' }, + { prop: 'createUserName', align: 'center', label: '创建人' }, + { prop: 'createTime', align: 'center', label: '更新时间' }, + { + prop: 'status', + align: 'center', + label: '任务状态', + render: (h, {row}) => { + return h('span', { + style: { + color: this.dict.getColor('tastStatus', row.status) + } + }, this.dict.getLabel('tastStatus', row.status)) + } + } ], ids: [], tableData: [], @@ -89,14 +101,14 @@ created () { this.loading = true - this.dict.load(['EP_riskLevel', 'EP_handleType', 'modeType', 'EP_riskStatus', 'EP_source']).then(() => { + this.dict.load(['tastStatus']).then(() => { this.getList() }) }, methods: { getList () { - this.instance.post(`/app/appepidemicpreventionregisterinfo/list`, null, { + this.instance.post(`/app/appassessmentscortask/list`, null, { params: { ...this.search } @@ -113,14 +125,27 @@ }) }, - onConfirm (id) { + onClose () { + this.form.title = '' + }, + + toDetail (id) { + this.$emit('change', { + type: 'Detail', + params: { + id + } + }) + }, + + onConfirm () { this.$refs.form.validate((valid) => { if (valid) { - this.isShow = false - this.$emit('change', { - type: 'FormDetail', - params: { - id: id || '' + this.instance.post(`/app/appassessmentscortask/addOrUpdate?title=${this.form.title}`).then(res => { + if (res.code == 0) { + this.$message.success('提交成功!') + this.getList() + this.isShow = false } }) } @@ -129,7 +154,7 @@ remove(id) { this.$confirm('确定删除该数据?').then(() => { - this.instance.post(`/app/appepidemicpreventionregisterinfo/delete?id=${id}`).then(res => { + this.instance.post(`/app/appassessmentscortask/delete?id=${id}`).then(res => { if (res.code == 0) { this.$message.success('删除成功!') this.getList() diff --git a/project/hlj/app/AppScoringTemplate/AppScoringTemplate.vue b/project/hlj/app/AppScoringTemplate/AppScoringTemplate.vue index 8d144f18..7a2e5771 100644 --- a/project/hlj/app/AppScoringTemplate/AppScoringTemplate.vue +++ b/project/hlj/app/AppScoringTemplate/AppScoringTemplate.vue @@ -9,7 +9,6 @@ - - diff --git a/project/hlj/app/AppScoringTemplate/components/List.vue b/project/hlj/app/AppScoringTemplate/components/List.vue index 4a785b75..014de7b4 100644 --- a/project/hlj/app/AppScoringTemplate/components/List.vue +++ b/project/hlj/app/AppScoringTemplate/components/List.vue @@ -5,16 +5,16 @@
@@ -31,7 +31,8 @@ @@ -56,12 +57,12 @@ search: { current: 1, size: 10, - name: '' + title: '' }, colConfigs: [ - { prop: 'name', label: '模板名称' }, - { prop: 'phone', align: 'center', label: '创建人' }, - { prop: 'startTime', align: 'center', label: '更新时间' } + { prop: 'title', label: '模板名称' }, + { prop: 'createUserName', align: 'center', label: '创建人' }, + { prop: 'createTime', align: 'center', label: '更新时间' } ], ids: [], tableData: [], @@ -80,7 +81,7 @@ methods: { getList () { - this.instance.post(`/app/appepidemicpreventionregisterinfo/list`, null, { + this.instance.post(`/app/appassessmentscoretemplate/list`, null, { params: { ...this.search } @@ -115,9 +116,20 @@ }) }, + changeStatus (id, status) { + this.$confirm(`确定${status === '0' ? '启用' : '停用'}该数据?`).then(() => { + this.instance.post(`/app/appassessmentscoretemplate/stopRelease?id=${id}`).then(res => { + if (res.code == 0) { + this.$message.success(`${status === '0' ? '启用' : '停用'}成功!`) + this.getList() + } + }) + }) + }, + remove(id) { this.$confirm('确定删除该数据?').then(() => { - this.instance.post(`/app/appepidemicpreventionregisterinfo/delete?id=${id}`).then(res => { + this.instance.post(`/app/appassessmentscoretemplate/delete?id=${id}`).then(res => { if (res.code == 0) { this.$message.success('删除成功!') this.getList() diff --git a/project/hlj/app/AppScoringTemplate/components/config.js b/project/hlj/app/AppScoringTemplate/components/config.js index 9df7bb3b..9090097e 100644 --- a/project/hlj/app/AppScoringTemplate/components/config.js +++ b/project/hlj/app/AppScoringTemplate/components/config.js @@ -10,6 +10,7 @@ export const components = [ fixedLabel: '单选', value: '', points: '', + describe: '', icon: 'iconradio', isShowPoints: false, required: true, @@ -46,6 +47,7 @@ export const components = [ type: 'checkbox', label: '多选', fixedLabel: '多选', + describe: '', points: '', icon: 'iconcheck_box', isShowPoints: false, @@ -90,6 +92,7 @@ export const components = [ fixedLabel: '单下拉框', value: '', points: '', + describe: '', icon: 'iconSelect', isShowPoints: false, required: true, @@ -132,6 +135,7 @@ export const components = [ { type: 'input', label: '单行填空', + describe: '', fixedLabel: '单行填空', value: '', pointType: '0', @@ -146,6 +150,7 @@ export const components = [ { type: 'textarea', label: '多行填空', + describe: '', fixedLabel: '多行填空', pointType: '0', icon: 'icontext_area', @@ -168,6 +173,7 @@ export const components = [ type: 'upload', label: '上传图片', fixedLabel: '上传图片', + describe: '', value: '', icon: 'iconpic', isShowPoints: false, diff --git a/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue b/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue index a8053e4f..1f3fd70b 100644 --- a/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue +++ b/project/pingchang/apps/AppGeneralElection/components/electionAdd.vue @@ -50,6 +50,7 @@