This commit is contained in:
liuye
2022-10-25 09:53:32 +08:00
20 changed files with 864 additions and 927 deletions

View File

@@ -5,6 +5,15 @@ let components = [];
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册 // 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
const install = function (Vue) { const install = function (Vue) {
if (install.installed) return; 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$/); let contexts = require.context('.', true, /[\\\/]Ai([^\\\/]+)\.vue$/);
if (contexts) { if (contexts) {

View File

View File

@@ -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
}
})
}
}

View File

@@ -9,11 +9,13 @@
<template #content> <template #content>
<ai-wrapper <ai-wrapper
label-width="120px"> label-width="120px">
<ai-info-item label="任务名称" :value="info.name"></ai-info-item> <ai-info-item label="任务名称" :value="info.title"></ai-info-item>
<ai-info-item label="创建时间" :value="info.createTime"></ai-info-item> <ai-info-item label="创建时间" :value="info.createTime"></ai-info-item>
<ai-info-item label="更新时间" :value="info.idNumber"></ai-info-item> <ai-info-item label="更新时间" :value="info.updateTime"></ai-info-item>
<ai-info-item label="创建人" :value="info.phone"></ai-info-item> <ai-info-item label="创建人" :value="info.createUserName"></ai-info-item>
<ai-info-item label="任务完成度" :value="dict.getLabel('EP_registerPersonType', info.type)"></ai-info-item> <ai-info-item label="任务完成度" :value="dict.getLabel('tastStatus', info.status)">
<span :style="{color: dict.getColor('tastStatus', info.status)}">{{ dict.getLabel('tastStatus', info.status) }}</span>
</ai-info-item>
</ai-wrapper> </ai-wrapper>
</template> </template>
</ai-card> </ai-card>
@@ -24,24 +26,23 @@
<el-button type="primary" @click="isShow = true">添加表单</el-button> <el-button type="primary" @click="isShow = true">添加表单</el-button>
</template> </template>
<template #right> <template #right>
<el-input
v-model="search.name"
size="small"
placeholder="请输入参评人姓名"
clearable
v-throttle="() => {search.current = 1, getList()}"
@clear="search.current = 1, search.name = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template> </template>
</ai-search-bar> </ai-search-bar>
<ai-table <ai-table
:isShowPagination="false" :isShowPagination="false"
tableSize="small" tableSize="small"
border border
:tableData="info.riskDisposalList" :tableData="info.templateList"
:col-configs="colConfigs" :col-configs="colConfigs"
@getList="() => {}"> @getList="() => {}">
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
<el-button type="text" v-if="row.status === '1'" @click="changeStatus(row.id)">停止</el-button>
</div>
</template>
</el-table-column>
</ai-table> </ai-table>
</template> </template>
</ai-card> </ai-card>
@@ -51,46 +52,48 @@
title="添加表单" title="添加表单"
@onConfirm="onConfirm"> @onConfirm="onConfirm">
<el-form ref="form" class="ai-form" :model="form" label-width="110px" label-position="right"> <el-form ref="form" class="ai-form" :model="form" label-width="110px" label-position="right">
<el-form-item label="选择模板" style="width: 100%" prop="type" :rules="[{required: true, message: '请选择模板', trigger: 'blur'}]"> <el-form-item label="选择模板" style="width: 100%" prop="templateId" :rules="[{required: true, message: '请选择模板', trigger: 'change'}]">
<ai-select <ai-select
v-model="form.type" v-model="form.templateId"
clearable clearable
:selectList="list"
placeholder="请选择模板"> placeholder="请选择模板">
</ai-select> </ai-select>
</el-form-item> </el-form-item>
<el-form-item label="表单名称" style="width: 100%" prop="name" :rules="[{required: true, message: '请输入任务名称', trigger: 'blur'}]"> <el-form-item label="表单名称" style="width: 100%" prop="templateName" :rules="[{required: true, message: '请输入任务名称', trigger: 'blur'}]">
<el-input v-model="form.name" size="small" placeholder="请输入任务名称"></el-input> <el-input v-model="form.templateName" size="small" placeholder="请输入任务名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="参评人员" style="width: 100%" prop="examinesName1" :rules="[{required: true, message: '请选择参评人员', trigger: 'change'}]"> <el-form-item label="参评人员" style="width: 100%" prop="evaluatorsNames" :rules="[{required: true, message: '请选择参评人员', trigger: 'change'}]">
<ai-user-selecter :instance="instance" v-model="form.examines" @change="e => onUserChange(e, 'examinesName1')"> <ai-user-selecter :instance="instance" v-model="form.evaluatorsList" @change="e => onUserChange(e, 'evaluatorsNames')">
<div class="AppAnnounceDetail-select"> <div class="AppAnnounceDetail-select">
<el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.examinesName1"></el-input> <el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.evaluatorsNames"></el-input>
<div class="select-left" v-if="form.examines.length"> <div class="select-left" v-if="form.evaluatorsList.length">
<span v-for="(item, index) in form.examines" :key="index">{{ item.name }}</span> <span v-for="(item, index) in form.evaluatorsList" :key="index">{{ item.name }}</span>
</div> </div>
<i v-if="!form.examines.length">请选择</i> <i v-if="!form.evaluatorsList.length">请选择</i>
<div class="select-right">{{ form.examines.length ? '重新选择' : '选择' }}</div> <div class="select-right">{{ form.evaluatorsList.length ? '重新选择' : '选择' }}</div>
</div> </div>
</ai-user-selecter> </ai-user-selecter>
</el-form-item> </el-form-item>
<el-form-item label="评分人员" style="width: 100%" prop="examinesName2" :rules="[{required: true, message: '请选择评分人员', trigger: 'change'}]"> <el-form-item label="评分人员" style="width: 100%" prop="scorerNames" :rules="[{required: true, message: '请选择评分人员', trigger: 'change'}]">
<ai-user-selecter :instance="instance" v-model="form.examines1" @change="e => onUserChange(e, 'examinesName2')"> <ai-user-selecter :instance="instance" v-model="form.scorerList" @change="e => onUserChange(e, 'scorerNames')">
<div class="AppAnnounceDetail-select"> <div class="AppAnnounceDetail-select">
<el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.examinesName2"></el-input> <el-input class="AppAnnounceDetail-select__input" size="small" placeholder="请选择..." v-model="form.scorerNames"></el-input>
<div class="select-left" v-if="form.examines1.length"> <div class="select-left" v-if="form.scorerList.length">
<span v-for="(item, index) in form.examines1" :key="index">{{ item.name }}</span> <span v-for="(item, index) in form.scorerList" :key="index">{{ item.name }}</span>
</div> </div>
<i v-if="!form.examines1.length">请选择</i> <i v-if="!form.scorerList.length">请选择</i>
<div class="select-right">{{ form.examines1.length ? '重新选择' : '选择' }}</div> <div class="select-right">{{ form.scorerList.length ? '重新选择' : '选择' }}</div>
</div> </div>
</ai-user-selecter> </ai-user-selecter>
</el-form-item> </el-form-item>
<el-form-item label="开始结束时间" style="width: 100%" prop="date" :rules="[{required: true, message: '请选择开始结束时间', trigger: 'change'}]"> <el-form-item label="开始结束时间" style="width: 100%" prop="date" :rules="[{required: true, message: '请选择开始结束时间', trigger: 'change'}]">
<el-date-picker <el-date-picker
v-model="form.date" v-model="form.date"
type="daterange" type="datetimerange"
size="small" size="small"
range-separator="" range-separator=""
value-format="yyyy-MM-dd hh-mm-ss"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
@@ -116,12 +119,12 @@
info: {}, info: {},
form: { form: {
date: '', date: '',
name: '', templateId: '',
type: '', templateName: '',
examines: [], evaluatorsList: [],
examines1: [], scorerList: [],
examinesName2: '', evaluatorsNames: '',
examinesName1: '' scorerNames: ''
}, },
search: { search: {
current: 1, current: 1,
@@ -133,10 +136,45 @@
isLoading: false, isLoading: false,
tableData: [], tableData: [],
colConfigs: [ colConfigs: [
{prop: 'remarks', label: '异常记录', align: 'center' }, {prop: 'templateName', label: '表单名称', align: 'center', width: 220 },
{prop: 'createTime', label: '创建时间', align: 'center'}, {prop: 'createUserName', label: '添加人', align: 'center', width: 150 },
{prop: 'createUserName', label: '记录人', align: 'center' } {
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: ['基本信息', '风险处置'] tabList: ['基本信息', '风险处置']
} }
}, },
@@ -144,20 +182,19 @@
created () { created () {
if (this.params && this.params.id) { if (this.params && this.params.id) {
this.id = 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.$dict.load(['tastStatus', 'formStatus']).then(() => {
// this.getInfo(this.params.id) this.getInfo()
// }) })
} }
this.getList()
}, },
methods: { methods: {
getInfo (id) { getInfo () {
this.instance.post(`/app/appepidemicpreventionregisterinfo/queryDetailById?id=${id}`).then(res => { this.instance.post(`/app/appassessmentscortask/queryDetailById?id=${this.params.id}`).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.info = res.data this.info = res.data
this.info.travelTypeNames = res.data.travelType.split(',').map(v => {
return this.dict.getLabel('EP_travelType', v)
}).join('')
} }
this.isLoading = false 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) { onUserChange(e, type) {
if (e.length) { if (e.length) {
this.form[type] = '1' 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) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.isShow = false this.instance.post(`/app/appassessmentscortask/addTemplate`, {
this.$emit('change', { ...this.form,
type: 'Detail', beginTime: this.form.date[0],
params: { endTime: this.form.date[1],
id: id || '' 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()
} }
}) })
} }

View File

@@ -8,10 +8,14 @@
<ai-card title="基础信息"> <ai-card title="基础信息">
<template #content> <template #content>
<ai-wrapper> <ai-wrapper>
<ai-info-item label="任务名称" isLine :value="info.taskTitle"></ai-info-item> <ai-info-item label="表单名称" :value="info.templateName"></ai-info-item>
<ai-info-item label="创建时间" :value="info.createTime"></ai-info-item> <ai-info-item label="参评人" :value="info.evaluatorsNames"></ai-info-item>
<ai-info-item label="群发时间" :value="info.choiceTime"></ai-info-item> <ai-info-item label="开始时间" :value="info.beginTime"></ai-info-item>
<ai-info-item label="结束时间" :value="info.taskEndTime" v-if="info.sendChannel === '1'"></ai-info-item> <ai-info-item label="评分人" :value="info.scorerNames"></ai-info-item>
<ai-info-item label="结束时间" :value="info.endTime"></ai-info-item>
<ai-info-item label="填写情况">
<span>已填写{{ info.overPhr }}还剩{{ info.totalPhr }}</span>
</ai-info-item>
</ai-wrapper> </ai-wrapper>
</template> </template>
</ai-card> </ai-card>
@@ -27,11 +31,18 @@
<div class="bottom"> <div class="bottom">
<ai-search-bar> <ai-search-bar>
<template #left> <template #left>
<el-button type="primary" @click="isShow = true">导出明细</el-button> <ai-download
:instance="instance"
:url="`/app/appassessmentscortask/export?id=${params.formId}&type=0&name=${search1.name}&status=${search1.status}`"
fileName="填写统计"
:disabled="tableData1.length == 0">
<el-button size="small" type="primary">导出明细</el-button>
</ai-download>
<ai-select <ai-select
v-model="search1.type" v-model="search1.status"
clearable clearable
placeholder="请选择完成情况"> placeholder="请选择完成情况"
:selectList="dictList">
</ai-select> </ai-select>
</template> </template>
<template #right> <template #right>
@@ -40,8 +51,8 @@
size="small" size="small"
placeholder="请输入参评人、评分人姓名" placeholder="请输入参评人、评分人姓名"
clearable clearable
v-throttle="() => {search.current = 1, getList()}" v-throttle="() => {search1.current = 1, getList1()}"
@clear="search.current = 1, search.name = '', getList()" @clear="search1.current = 1, search1.name = '', getList1()"
suffix-icon="iconfont iconSearch"> suffix-icon="iconfont iconSearch">
</el-input> </el-input>
</template> </template>
@@ -54,7 +65,7 @@
tableSize="small" tableSize="small"
:current.sync="search1.current" :current.sync="search1.current"
:size.sync="search1.size" :size.sync="search1.size"
@getList="getMemberInfo"> @getList="getList1">
<el-table-column slot="user" label="成员" align="left"> <el-table-column slot="user" label="成员" align="left">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div class="userinfo"> <div class="userinfo">
@@ -70,16 +81,22 @@
<div class="bottom"> <div class="bottom">
<ai-search-bar> <ai-search-bar>
<template #left> <template #left>
<el-button type="primary" @click="isShow = true">导出明细</el-button> <ai-download
:instance="instance"
:url="`/app/appassessmentscortask/export?id=${params.formId}&type=1&name=${search1.name}`"
fileName="填写统计"
:disabled="tableData2.length == 0">
<el-button size="small" type="primary">导出列表</el-button>
</ai-download>
</template> </template>
<template #right> <template #right>
<el-input <el-input
v-model="search1.name" v-model="search2.name"
size="small" size="small"
placeholder="请输入参评人姓名" placeholder="请输入参评人姓名"
clearable clearable
v-throttle="() => {search.current = 1, getList()}" v-throttle="() => {search2.current = 1, getList2()}"
@clear="search.current = 1, search.name = '', getList()" @clear="search2.current = 1, search2.name = '', getList2()"
suffix-icon="iconfont iconSearch"> suffix-icon="iconfont iconSearch">
</el-input> </el-input>
</template> </template>
@@ -93,14 +110,6 @@
:current.sync="search2.current" :current.sync="search2.current"
:size.sync="search2.size" :size.sync="search2.size"
@getList="getGroupInfo"> @getList="getGroupInfo">
<el-table-column slot="user" label="群主" align="center">
<template slot-scope="{ row }">
<div class="userinfo">
<span>{{ row.groupOwnerName }}</span>
<span style="color: #999">{{ row.mainDepartmentName }}</span>
</div>
</template>
</el-table-column>
</ai-table> </ai-table>
</div> </div>
</div> </div>
@@ -111,7 +120,6 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex'
export default { export default {
name: 'Detail', name: 'Detail',
@@ -124,141 +132,97 @@
data () { data () {
return { return {
total1: 0, total1: 0,
isShowPhone: false,
total2: 0, total2: 0,
user1: [],
user2: [],
name1: '', name1: '',
name2: '', name2: '',
radio1: '未执行',
search1: { search1: {
current: 1, current: 1,
size: 10, size: 10,
deptartId: '', name: '',
type: 0, status: ''
sendStatus: '0'
}, },
search2: { search2: {
current: 1, current: 1,
size: 10, size: 10,
deptartId: '', name: ''
type: 1,
sendStatus: '0'
}, },
memberInfo: {},
groupInfo: {},
tableData1: [], tableData1: [],
fileList: [],
tableData2: [], tableData2: [],
info: {}, info: {},
content: '',
currIndex: 0, currIndex: 0,
colConfigs1: [ colConfigs1: [
{ slot: 'user', label: '成员' }, { slot: 'user', label: '参评人' },
{ prop: 'groupCount', label: '预计送达居民群', align: 'center' } { prop: 'groupCount', label: '评分人', align: 'center' },
{ prop: 'groupCount', label: '提交时间', align: 'center' },
{ prop: 'groupCount', label: '总分', align: 'center' }
], ],
colConfigs2: [ colConfigs2: [
{ prop: 'groupName', label: '居民群' }, { prop: 'groupName', label: '参评人' },
{ prop: 'memberCount', label: '人数', align: 'center' }, { prop: 'memberCount', label: '评分人数', align: 'center' },
{ slot: 'user', label: '群主', align: 'center' }, { slot: 'user', label: '平均分', align: 'center' },
], ],
groups: [], dictList: [
timer: null, {
min: 60, dictName: '未填报',
isDisabled: false, dictValue: '0'
rejecterId: '' },
{
dictName: '已填报',
dictValue: '1'
}
]
} }
}, },
computed: {
...mapState(['user'])
},
created () { created () {
this.getInfo(this.params.id) this.getInfo(this.params.formId)
this.getList1()
}, },
methods: { methods: {
getMemberInfo () {
this.instance.post(`/app/appmasssendingtask/detailStatistics`, null, {
params: {
...this.search1,
taskId: this.params.id
}
}).then(res => {
if (res.code === 0) {
this.tableData1 = res.data.executedList.records
this.total1 = res.data.executedList.total
this.memberInfo = res.data
}
})
},
getGroupInfo () {
this.instance.post(`/app/appmasssendingtask/detailStatistics`, null, {
params: {
...this.search2,
taskId: this.params.id
}
}).then(res => {
if (res.code === 0) {
this.tableData2 = res.data.executedList.records.map(v => {
return {
...v,
groupName: v.groupName || '未命名群聊'
}
})
this.total2 = res.data.executedList.total
this.groupInfo = res.data
}
})
},
getInfo (id) { getInfo (id) {
this.instance.post(`/app/appmasssendingtask/queryDetailById?id=${id}`).then(res => { this.instance.post(`/app/appassessmentscortask/taskTemplateDetail?id=${id}`).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.info = res.data this.info = res.data
if (res.data.status === '4' && res.data.remindTime) {
this.countdown()
}
const content = res.data.contents.filter(v => v.msgType === '0')
if (content.length) {
this.content = content[0].content
}
this.fileList = res.data.contents.filter(v => v.msgType !== '0').map(v => {
return {
...v,
...v.sysFile
}
})
this.info.wxGroups = res.data.wxGroups.map(v => {
this.groups.push(...v.groupIds.split(','))
return {
...v,
groupIds: v.groupIds.split(',')
}
})
if (res.data.examines && res.data.examines.length) {
const user = res.data.examines.filter(v => v.examineStatus === '2')
if (user.length) {
this.rejecterId = user[0].examineUserId
}
}
} }
}) })
}, },
cancel (isRefresh) { getList1 () {
this.instance.post(`/app/appassessmentscortask/assessStatistics`, null, {
params: {
id: this.params.formId,
...this.search1
}
}).then(res => {
if (res.code === 0) {
this.tableData1 = res.data.records
this.total1 = res.data.total
}
})
},
getList2 () {
this.instance.post(`/app/appassessmentscortask/fillStatistics`, null, {
params: {
id: this.params.formId,
...this.search2
}
}).then(res => {
if (res.code === 0) {
this.tableData2 = res.data.records
this.total2 = res.data.total
}
})
},
cancel () {
this.$emit('change', { this.$emit('change', {
type: 'List', type: 'Detail',
isRefresh: !!isRefresh isRefresh: false,
params: {
id: this.params.id
}
}) })
} }
} }
@@ -266,36 +230,36 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.AppAnnounceDetail { .AppAnnounceDetail {
::v-deep .AppAnnounceDetail-title { ::v-deep .AppAnnounceDetail-title {
display: flex; display: flex;
align-items: center; align-items: center;
span { span {
height: 100%; height: 100%;
line-height: 56px; line-height: 56px;
margin-right: 32px; margin-right: 32px;
color: #888888; color: #888888;
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
transition: all ease 0.3s; transition: all ease 0.3s;
border-bottom: 3px solid transparent; border-bottom: 3px solid transparent;
cursor: pointer; cursor: pointer;
user-select: none; user-select: none;
&:hover { &:hover {
color: #222; color: #222;
} }
&:last-child { &:last-child {
margin-right: 0; margin-right: 0;
} }
&.active { &.active {
color: #222222; color: #222222;
border-bottom: 3px solid #2266FF; border-bottom: 3px solid #2266FF;
}
} }
} }
} }
}
</style> </style>

View File

@@ -9,12 +9,12 @@
</template> </template>
<template #right> <template #right>
<el-input <el-input
v-model="search.name" v-model="search.title"
size="small" size="small"
placeholder="请输入任务名称" placeholder="请输入任务名称"
clearable clearable
v-throttle="() => {search.current = 1, getList()}" v-throttle="() => {search.current = 1, getList()}"
@clear="search.current = 1, search.name = '', getList()" @clear="search.current = 1, search.title = '', getList()"
suffix-icon="iconfont iconSearch"> suffix-icon="iconfont iconSearch">
</el-input> </el-input>
</template> </template>
@@ -42,10 +42,11 @@
:visible.sync="isShow" :visible.sync="isShow"
width="590px" width="590px"
title="新建评分任务" title="新建评分任务"
@close="onClose"
@onConfirm="onConfirm"> @onConfirm="onConfirm">
<el-form ref="form" :model="form" label-width="110px" label-position="right"> <el-form ref="form" :model="form" label-width="110px" label-position="right">
<el-form-item label="返乡登记" prop="name" :rules="[{required: true, message: '请输入任务名称', trigger: 'blur'}]"> <el-form-item label="评分任务" prop="title" :rules="[{required: true, message: '请输入任务名称', trigger: 'blur'}]">
<el-input v-model="form.name" size="small" placeholder="请输入任务名称"></el-input> <el-input v-model="form.title" size="small" placeholder="请输入任务名称"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ai-dialog> </ai-dialog>
@@ -67,16 +68,27 @@
search: { search: {
current: 1, current: 1,
size: 10, size: 10,
name: '' title: ''
}, },
form: { form: {
name: '' title: ''
}, },
colConfigs: [ colConfigs: [
{ prop: 'name', label: '任务名称' }, { prop: 'title', label: '任务名称' },
{ prop: 'phone', align: 'center', label: '创建人' }, { prop: 'createUserName', align: 'center', label: '创建人' },
{ prop: 'startTime', align: 'center', label: '更新时间' }, { prop: 'createTime', align: 'center', label: '更新时间' },
{ prop: 'startAreaName', 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: [], ids: [],
tableData: [], tableData: [],
@@ -89,14 +101,14 @@
created () { created () {
this.loading = true this.loading = true
this.dict.load(['EP_riskLevel', 'EP_handleType', 'modeType', 'EP_riskStatus', 'EP_source']).then(() => { this.dict.load(['tastStatus']).then(() => {
this.getList() this.getList()
}) })
}, },
methods: { methods: {
getList () { getList () {
this.instance.post(`/app/appepidemicpreventionregisterinfo/list`, null, { this.instance.post(`/app/appassessmentscortask/list`, null, {
params: { params: {
...this.search ...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) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.isShow = false this.instance.post(`/app/appassessmentscortask/addOrUpdate?title=${this.form.title}`).then(res => {
this.$emit('change', { if (res.code == 0) {
type: 'FormDetail', this.$message.success('提交成功!')
params: { this.getList()
id: id || '' this.isShow = false
} }
}) })
} }
@@ -129,7 +154,7 @@
remove(id) { remove(id) {
this.$confirm('确定删除该数据?').then(() => { 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) { if (res.code == 0) {
this.$message.success('删除成功!') this.$message.success('删除成功!')
this.getList() this.getList()

View File

@@ -9,7 +9,6 @@
<script> <script>
import Add from './components/Add' import Add from './components/Add'
import List from './components/List' import List from './components/List'
import Detail from './components/Detail'
export default { export default {
name: 'AppScoringTemplate', name: 'AppScoringTemplate',
@@ -29,18 +28,12 @@
}, },
components: { components: {
Detail,
List, List,
Add Add
}, },
methods: { methods: {
onChange (data) { onChange (data) {
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'Add') { if (data.type === 'Add') {
this.component = 'Add' this.component = 'Add'
this.params = data.params this.params = data.params

View File

@@ -1,6 +1,6 @@
<template> <template>
<ai-detail class="form-add"> <ai-detail class="form-add">
<ai-title :title="pageTitle" slot="title" isShowBack @onBackClick="cancel(false)"> <ai-title title="问卷表单" slot="title" isShowBack @onBackClick="cancel(false)">
<template #rightBtn> <template #rightBtn>
<el-button type="primary" icon="iconfont iconRepulsebeifen" @click="toPublish">保存模板</el-button> <el-button type="primary" icon="iconfont iconRepulsebeifen" @click="toPublish">保存模板</el-button>
</template> </template>
@@ -70,6 +70,7 @@
<span>{{ i + 1 }}. </span> <span>{{ i + 1 }}. </span>
<h2>{{ item.label }}</h2> <h2>{{ item.label }}</h2>
</div> </div>
<p>{{ item.describe }}</p>
<div class="left-item__item--wrapper"> <div class="left-item__item--wrapper">
<template v-if="(item.type === 'radio')" > <template v-if="(item.type === 'radio')" >
<div class="radio-item" v-for="(field, index) in item.options" :key="index" > <div class="radio-item" v-for="(field, index) in item.options" :key="index" >
@@ -199,6 +200,14 @@
<el-input placeholder="标题名称" :maxlength="200" show-word-limit v-model="currTarget.label"></el-input> <el-input placeholder="标题名称" :maxlength="200" show-word-limit v-model="currTarget.label"></el-input>
</div> </div>
</div> </div>
<div class="right-item" v-if="activeIndex > -1">
<div class="right-item__title no-solid">
<h2>说明文字</h2>
</div>
<div class="right-item__content">
<el-input placeholder="说明文字" :maxlength="200" show-word-limit v-model="currTarget.describe"></el-input>
</div>
</div>
<div class="right-item right-item__select" v-if="currTarget.type === 'radio' || currTarget.type === 'select' || currTarget.type === 'checkbox'"> <div class="right-item right-item__select" v-if="currTarget.type === 'radio' || currTarget.type === 'select' || currTarget.type === 'checkbox'">
<div class="right-item__title no-solid"> <div class="right-item__title no-solid">
<h2>选项设置</h2> <h2>选项设置</h2>
@@ -347,70 +356,6 @@
</template> </template>
</div> </div>
</el-scrollbar> </el-scrollbar>
<ai-dialog
:visible.sync="isShowAdd"
width="800px"
customFooter
title="发布">
<el-form label-position="top" class="publish" ref="form" label-width="120px" :model="form">
<div class="form-item__wrapper">
<div class="form-title">
<h2>基本信息</h2>
</div>
<div class="form-field">
<i>*</i>
<h2>截止时间</h2>
<span>表单截止后用户打开表单会提示此表单已结束</span>
</div>
<div class="form-item__container">
<el-radio-group v-model="form.periodValidityType">
<el-radio label="0">永久有效</el-radio>
<el-radio label="1">自定义时间</el-radio>
</el-radio-group>
</div>
<div class="form-item__container" v-if="form.periodValidityType === '1'">
<el-date-picker
v-model="form.periodValidityEndTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
size="small"
:picker-options="pickerOptions"
placeholder="截止时间">
</el-date-picker>
</div>
<div class="form-field">
<i>*</i>
<h2>匹配客户方式</h2>
<span>将参与活动的微信客户和企业微信客户匹配</span>
</div>
<div class="form-item__container">
<el-radio-group v-model="form.wechatId">
<el-radio label="0">客户微信ID匹配</el-radio>
</el-radio-group>
</div>
</div>
<div class="form-item__wrapper">
<div class="form-title">
<h2>提交次数限制</h2>
<span>此功能发布后不可修改</span>
</div>
<div class="form-field">
<i>*</i>
<h2>提交次数</h2>
</div>
<div class="form-item__container">
<el-radio-group v-model="form.commitType">
<el-radio label="0">不限次数</el-radio>
<el-radio label="1">限提交一次</el-radio>
</el-radio-group>
</div>
</div>
</el-form>
<template #footer>
<el-button @click="isShowAdd = false">返回</el-button>
<el-button type="primary" @click="onConfirm(1)">完成并发布</el-button>
</template>
</ai-dialog>
</template> </template>
</ai-detail> </ai-detail>
</template> </template>
@@ -436,7 +381,6 @@
data () { data () {
return { return {
isShowAdd: false,
components: components, components: components,
targetList: [], targetList: [],
form: { form: {
@@ -446,12 +390,6 @@
isShowTableExplain: true, isShowTableExplain: true,
isShowBtn: true, isShowBtn: true,
headPicture: [], headPicture: [],
commitType: '1',
periodValidityType: '0',
actionNotice: '1',
dynamicNotice: '1',
periodValidityEndTime: '',
shareStatus: '0',
count: 0, count: 0,
wechatId: '0', wechatId: '0',
type: 0, type: 0,
@@ -479,37 +417,6 @@
return {} return {}
}, },
pageTitle () {
let typeName = '新增'
let itemName = '问卷调查'
if (this.params.id) {
typeName = '编辑'
}
if (this.params.type == 0) {
itemName = '问卷调查'
}
if (this.params.type == 1) {
itemName = '考试测评'
}
if (this.params.type == 2) {
itemName = '报名登记'
}
if (this.params.type == 3) {
itemName = '满意调查'
}
if (this.params.type == 4) {
itemName = '投票评选'
}
return `${typeName}${itemName}`
},
currComponentTitle () { currComponentTitle () {
if (this.activeIndex >= 0) { if (this.activeIndex >= 0) {
return this.targetList[this.activeIndex].fixedLabel + '设置' return this.targetList[this.activeIndex].fixedLabel + '设置'
@@ -545,54 +452,9 @@
}, },
init () { init () {
if (this.params.type == 0) { this.form.headPicture = [{
this.form.headPicture = [{ url: 'https://cdn.cunwuyun.cn/dvcp/h5/form/interview.png'
url: 'https://cdn.cunwuyun.cn/dvcp/h5/form/interview.png' }]
}]
}
if (this.params.type == 1) {
this.form.title = '考试测评'
this.form.headPicture = [{
url: 'https://cdn.cunwuyun.cn/dvcp/h5/form/exam.png'
}]
}
if (this.params.type == 2) {
this.form.title = '报名登记'
this.form.headPicture = [{
url: 'https://cdn.cunwuyun.cn/dvcp/h5/form/apply.png'
}]
}
if (this.params.type == 3) {
this.form.title = '满意调查'
this.form.headPicture = [{
url: 'https://cdn.cunwuyun.cn/dvcp/h5/form/satisfaction.png'
}]
}
if (this.params.type == 4) {
this.form.title = '投票评选'
this.form.headPicture = [{
url: 'https://cdn.cunwuyun.cn/dvcp/h5/form/vote.png'
}]
}
},
downloadImg (url) {
let image = new Image()
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function() {
let canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
let context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
let url = canvas.toDataURL("image/png")
let a = document.createElement("a")
let event = new MouseEvent("click")
a.download = name || 'photo'
a.href = url
a.dispatchEvent(event)
}
image.src = url
}, },
onKeyup (e) { onKeyup (e) {
@@ -600,7 +462,6 @@
}, },
onSelcetKeyup (e, index) { onSelcetKeyup (e, index) {
console.log(e, index)
this.$set(this.currTarget.options[index], 'point', e.replace(/[^\d]/g, '')) this.$set(this.currTarget.options[index], 'point', e.replace(/[^\d]/g, ''))
}, },
@@ -638,36 +499,30 @@
} }
} }
} }
if (this.params.templateType != 1) {
this.isShowAdd = true
} else {
const fields = this.targetList.map(item => {
return {
fieldType: item.type,
fieldName: item.label,
fieldInfo: JSON.stringify(item)
}
})
this.instance.post(`/app/appquestionnairetemplate/addOrUpdate`, { const fields = this.targetList.map(item => {
...this.form, return {
fields, fieldType: item.type,
status: 0, fieldName: item.label,
areaId: this.params.templateType == 0 ? this.areaId : '', fieldInfo: JSON.stringify(item)
id: this.params.id, }
headPicture: this.form.headPicture.length ? this.form.headPicture[0].url : '', })
type: this.params.type,
templateType: this.params.templateType
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
setTimeout(() => { this.instance.post(`/app/appassessmentscoretemplate/addOrUpdate`, {
this.cancel() ...this.form,
}, 600) fields,
} id: this.params.id,
}) status: 1,
} headPicture: this.form.headPicture.length ? this.form.headPicture[0].url : ''
}).then(res => {
if (res.code == 0) {
this.$message.success('提交成功')
setTimeout(() => {
this.cancel(true)
}, 600)
}
})
}, },
bindEvent (e) { bindEvent (e) {
@@ -686,7 +541,7 @@
}, },
getInfo (id) { getInfo (id) {
this.instance.post(`/app/appquestionnairetemplate/queryDetailById?id=${id}`).then(res => { this.instance.post(`/app/appassessmentscoretemplate/queryDetailById?id=${id}`).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.form = { this.form = {
...res.data, ...res.data,
@@ -705,59 +560,6 @@
}) })
}, },
onConfirm (status) {
if (this.params.templateType == 1) {
// this.submitTemp()
}
if (this.form.periodValidityType === '1') {
if (!this.form.periodValidityEndTime) {
return this.$message.error('请选择截止时间')
}
if (new Date(this.form.periodValidityEndTime).getTime() < Date.now()) {
return this.$message.error('截止时间不能晚于当前时间')
}
}
const fields = this.targetList.map(item => {
return {
fieldType: item.type,
fieldName: item.label,
fieldInfo: JSON.stringify(item)
}
})
this.instance.post(`/app/appquestionnairetemplate/addOrUpdate`, {
...this.form,
fields,
areaId: this.areaId,
status: status,
id: this.params.isQuote ? '' : this.params.id,
headPicture: this.form.headPicture.length ? this.form.headPicture[0].url : '',
type: this.params.type,
templateType: this.params.templateType,
periodValidityEndTime: this.form.periodValidityType === '1' ? this.form.periodValidityEndTime : ''
}).then(res => {
if (res.code == 0) {
if (this.params.isQuote) {
this.instance.post(`/app/appquestionnairetemplate/quoteCount?id=${this.params.id}`)
}
this.$message.success('提交成功')
if (status === 0) {
return this.cancel()
}
this.successInfo = res.data
this.$nextTick(() => {
this.cancel(true)
})
}
})
},
cancel (isRefresh) { cancel (isRefresh) {
this.$emit('change', { this.$emit('change', {
type: 'List', type: 'List',
@@ -943,6 +745,12 @@
content: ' '; content: ' ';
} }
& > p {
margin: 0 0 12px 12px;
color: #888;
font-size: 14px;
}
.left-item__item--remove { .left-item__item--remove {
display: flex; display: flex;
position: absolute; position: absolute;

View File

@@ -1,188 +0,0 @@
<template>
<ai-detail isHasSidebar v-loading="isLoading">
<template slot="title">
<ai-title title="返乡报备详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<AiSidebar :tabTitle="tabList" v-model="currIndex"></AiSidebar>
<div v-show="currIndex === 0">
<ai-card title="基本信息" v-show="currIndex === 0">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="姓名" :value="info.name"></ai-info-item>
<ai-info-item label="填报时间" :value="info.createTime"></ai-info-item>
<ai-info-item label="身份证号" :value="info.idNumber"></ai-info-item>
<ai-info-item label="手机号码" :value="info.phone"></ai-info-item>
<ai-info-item label="人员类别" :value="dict.getLabel('EP_registerPersonType', info.type)"></ai-info-item>
<ai-info-item label="是否从事高危行业" :value="dict.getLabel('EP_highRiskIndustries', info.highRiskIndustries)"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="行程信息">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="出发时间" :value="info.startTime"></ai-info-item>
<ai-info-item label="出发地" >
<span :style="{color: info.denger == 1 ? '#FF4466' : '#333'}">{{info.startAreaName}} </span>
</ai-info-item>
<ai-info-item label="出发地详址" isLine :value="info.startAddress"></ai-info-item>
<ai-info-item label="出行方式" :value="info.travelTypeNames"></ai-info-item>
<ai-info-item label="车次/航班" isLine :value="info.trainNo"></ai-info-item>
<ai-info-item label="行程描述" :value="info.description"></ai-info-item>
<ai-info-item label="抵平卡口" :value="info.gatewayName"></ai-info-item>
<ai-info-item label="抵平时间" :value="info.arriveTime"></ai-info-item>
<ai-info-item label="目的地" :value="info.arriveAreaName"></ai-info-item>
<ai-info-item label="目的地详址" isLine :value="info.arriveAddress"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="健康状况">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="是否有风险旅居史" v-if="info.fromHighRiskArea === '1'">
<span style="color: red">{{ info.highRiskAreaName }}</span>
</ai-info-item>
<ai-info-item label="是否有风险旅居史" v-else value="否"></ai-info-item>
<ai-info-item label="7天内是否接触新冠确诊或疑似患者">
<span :style="{color: info.contactPatients === '1' ? 'red' : ''}">{{ dict.getLabel('yesOrNo', info.contactPatients) }}</span>
</ai-info-item>
<ai-info-item label="当前健康状况" v-if="info.abnormalHealth === '1'">
<span style="color: red">{{ dict.getLabel('EP_abnormalType', info.abnormalType) }}</span>
</ai-info-item>
<ai-info-item label="当前健康状况" v-else value="否"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
</div>
<div v-show="currIndex === 1">
<ai-card title="风险处置">
<template #right>
<el-button type="primary" v-if="info.status === '0'" @click="release">解除异常</el-button>
</template>
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="姓名" :value="info.name"></ai-info-item>
<ai-info-item label="填报时间" :value="info.createTime"></ai-info-item>
<ai-info-item label="身份证号" :value="info.idNumber"></ai-info-item>
<ai-info-item label="手机号码" :value="info.phone"></ai-info-item>
<ai-info-item label="人员类别" :value="dict.getLabel('EP_registerPersonType', info.type)"></ai-info-item>
<ai-info-item label="是否从事高危行业" :value="dict.getLabel('EP_highRiskIndustries', info.highRiskIndustries)"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="风险处理意见">
<template #content>
<ai-table
:isShowPagination="false"
tableSize="small"
border
:tableData="info.riskDisposalList"
:col-configs="colConfigs"
@getList="() => {}">
</ai-table>
</template>
</ai-card>
<ai-card title="社区初排" v-if="info.cmAdvanceDisposal">
<template #content>
<ai-wrapper
style="margin-bottom: 20px;"
label-width="120px">
<ai-info-item label="处置意见" :value="dict.getLabel('EP_communityHandleType', info.cmAdvanceDisposal.communityHandleType)"></ai-info-item>
<ai-info-item v-if="info.cmAdvanceDisposal.communityHandleType === '1'" label="居家状态" :value="dict.getLabel('EP_homeStatus2', info.cmAdvanceDisposal.homeStatus)"></ai-info-item>
<ai-info-item v-if="info.cmAdvanceDisposal.communityHandleType === '1'" label="隔离时间" :value="info.cmAdvanceDisposal.quarantineBeginTime + ' - ' + info.cmAdvanceDisposal.quarantineEndTime"></ai-info-item>
<ai-info-item v-if="info.cmAdvanceDisposal.communityHandleType === '1'" label="隔离策略" :value="dict.getLabel('EP_quarantineStrategy', info.cmAdvanceDisposal.quarantineStrategy)"></ai-info-item>
<ai-info-item v-if="info.cmAdvanceDisposal.communityHandleType === '1'" label="管控方式" :value="dict.getLabel('EP_controlMethod', info.cmAdvanceDisposal.controlMethod)"></ai-info-item>
<ai-info-item v-if="info.cmAdvanceDisposal.communityHandleType === '1'" label="图片" isLine>
<ai-uploader
:instance="instance"
:value="info.cmAdvanceDisposal.fileList"
disabled
:limit="9">
</ai-uploader>
</ai-info-item>
<ai-info-item v-if="info.cmAdvanceDisposal.communityHandleType === '2'" label="风险解除证明文件" isLine>
<ai-uploader
:instance="instance"
:value="info.cmAdvanceDisposal.proveFileList"
disabled
:limit="9">
</ai-uploader>
</ai-info-item>
</ai-wrapper>
<ai-empty style="margin-bottom: 60px;" v-if="!info.cmAdvanceDisposal"></ai-empty>
</template>
</ai-card>
</div>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
isShow: false,
currIndex: 0,
isLoading: false,
tableData: [],
colConfigs: [
{prop: 'remarks', label: '异常记录', align: 'center' },
{prop: 'createTime', label: '创建时间', align: 'center'},
{prop: 'createUserName', label: '记录人', align: 'center' }
],
tabList: ['基本信息', '风险处置']
}
},
created () {
this.isLoading = true
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)
})
}
},
methods: {
getInfo (id) {
this.instance.post(`/app/appepidemicpreventionregisterinfo/queryDetailById?id=${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
}).catch(() => {
this.isLoading = false
})
},
cancel () {
this.$emit('change', {
type: 'List',
isRefresh: true
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -5,16 +5,16 @@
<div class="content"> <div class="content">
<ai-search-bar bottomBorder> <ai-search-bar bottomBorder>
<template #left> <template #left>
<el-button type="primary" @click="toAdd">新建模板</el-button> <el-button type="primary" @click="toAdd('')">新建模板</el-button>
</template> </template>
<template #right> <template #right>
<el-input <el-input
v-model="search.name" v-model="search.title"
size="small" size="small"
placeholder="请输入姓名、手机号" placeholder="请输入姓名、手机号"
clearable clearable
v-throttle="() => {search.current = 1, getList()}" v-throttle="() => {search.current = 1, getList()}"
@clear="search.current = 1, search.name = '', getList()" @clear="search.current = 1, search.title = '', getList()"
suffix-icon="iconfont iconSearch"> suffix-icon="iconfont iconSearch">
</el-input> </el-input>
</template> </template>
@@ -31,7 +31,8 @@
<el-table-column slot="options" width="140px" fixed="right" label="操作" align="center"> <el-table-column slot="options" width="140px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<div class="table-options"> <div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button> <el-button type="text" @click="toAdd(row.id)">编辑</el-button>
<el-button type="text" @click="changeStatus(row.id, row.status)">{{ row.status === '0' ? '启用' : '停用' }}</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button> <el-button type="text" @click="remove(row.id)">删除</el-button>
</div> </div>
</template> </template>
@@ -56,12 +57,12 @@
search: { search: {
current: 1, current: 1,
size: 10, size: 10,
name: '' title: ''
}, },
colConfigs: [ colConfigs: [
{ prop: 'name', label: '模板名称' }, { prop: 'title', label: '模板名称' },
{ prop: 'phone', align: 'center', label: '创建人' }, { prop: 'createUserName', align: 'center', label: '创建人' },
{ prop: 'startTime', align: 'center', label: '更新时间' } { prop: 'createTime', align: 'center', label: '更新时间' }
], ],
ids: [], ids: [],
tableData: [], tableData: [],
@@ -80,7 +81,7 @@
methods: { methods: {
getList () { getList () {
this.instance.post(`/app/appepidemicpreventionregisterinfo/list`, null, { this.instance.post(`/app/appassessmentscoretemplate/list`, null, {
params: { params: {
...this.search ...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) { remove(id) {
this.$confirm('确定删除该数据?').then(() => { 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) { if (res.code == 0) {
this.$message.success('删除成功!') this.$message.success('删除成功!')
this.getList() this.getList()

View File

@@ -10,6 +10,7 @@ export const components = [
fixedLabel: '单选', fixedLabel: '单选',
value: '', value: '',
points: '', points: '',
describe: '',
icon: 'iconradio', icon: 'iconradio',
isShowPoints: false, isShowPoints: false,
required: true, required: true,
@@ -46,6 +47,7 @@ export const components = [
type: 'checkbox', type: 'checkbox',
label: '多选', label: '多选',
fixedLabel: '多选', fixedLabel: '多选',
describe: '',
points: '', points: '',
icon: 'iconcheck_box', icon: 'iconcheck_box',
isShowPoints: false, isShowPoints: false,
@@ -90,6 +92,7 @@ export const components = [
fixedLabel: '单下拉框', fixedLabel: '单下拉框',
value: '', value: '',
points: '', points: '',
describe: '',
icon: 'iconSelect', icon: 'iconSelect',
isShowPoints: false, isShowPoints: false,
required: true, required: true,
@@ -132,6 +135,7 @@ export const components = [
{ {
type: 'input', type: 'input',
label: '单行填空', label: '单行填空',
describe: '',
fixedLabel: '单行填空', fixedLabel: '单行填空',
value: '', value: '',
pointType: '0', pointType: '0',
@@ -146,6 +150,7 @@ export const components = [
{ {
type: 'textarea', type: 'textarea',
label: '多行填空', label: '多行填空',
describe: '',
fixedLabel: '多行填空', fixedLabel: '多行填空',
pointType: '0', pointType: '0',
icon: 'icontext_area', icon: 'icontext_area',
@@ -168,6 +173,7 @@ export const components = [
type: 'upload', type: 'upload',
label: '上传图片', label: '上传图片',
fixedLabel: '上传图片', fixedLabel: '上传图片',
describe: '',
value: '', value: '',
icon: 'iconpic', icon: 'iconpic',
isShowPoints: false, isShowPoints: false,

View File

@@ -50,6 +50,7 @@
<template slot="content"> <template slot="content">
<ai-card title="基本信息"> <ai-card title="基本信息">
<template #content> <template #content>
<div class="tips" v-if="!id"><i class="el-icon-warning"></i>换届选举仅采取不记名匿名投票</div>
<div class="add-form"> <div class="add-form">
<el-form ref="form" :model="form" :rules="formRules" size="small" label-width="150px"> <el-form ref="form" :model="form" :rules="formRules" size="small" label-width="150px">
@@ -234,6 +235,15 @@ export default {
confirm() { confirm() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if(this.form.electionMethod == 0) {
if(this.form.chooseNumber != this.form.candidateUsers.length) {
return this.$message.error('候选人数与应选人数应相等')
}
} else if(this.form.electionMethod == 1) {
if(this.form.chooseNumber >= this.form.candidateUsers.length) {
return this.$message.error('候选人数应多于应选人数')
}
}
this.instance.post(`/app/appgeneralelectioninfo/addOrUpdate`,{ this.instance.post(`/app/appgeneralelectioninfo/addOrUpdate`,{
...this.form ...this.form
}).then(res => { }).then(res => {
@@ -258,5 +268,17 @@ export default {
::v-deep .el-date-editor .el-input { ::v-deep .el-date-editor .el-input {
width: 100%; width: 100%;
} }
.tips {
width: 100%;
border: 1px solid #f82;
background-color: #fff3e9;
color: #f82;
padding: 8px 16px;
box-sizing: border-box;
border-radius: 4px;
margin-bottom: 32px;
font-size: 13px;
}
} }
</style> </style>

View File

@@ -17,10 +17,9 @@
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size" @getList="getList" :col-configs="colConfigs" :dict="dict"> <ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size" @getList="getList" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="options" label="操作" fixed="right" align="center"> <el-table-column slot="options" label="操作" fixed="right" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<!-- <el-button v-show="row.status==0" type="text" @click.native="toAdd(row.id, true)">编辑</el-button> -->
<el-button type="text" @click.native="toAdd(row.id)">详情</el-button> <el-button type="text" @click.native="toAdd(row.id)">详情</el-button>
<el-button type="text" :disabled="row.status==2" @click.native="startEnd(row.id, false)">结束</el-button> <el-button type="text" v-show="row.status!=2" :disabled="row.status==2" @click.native="startEnd(row.id, row.status)">{{row.status == 0? '开启':'结束'}}</el-button>
<el-button type="text" @click.native="toStatistics(row.id)">统计</el-button> <el-button type="text" v-show="row.status != 0" @click.native="toStatistics(row.id)">统计</el-button>
<el-button type="text" @click.native="handleDelete(row.id)">删除</el-button> <el-button type="text" @click.native="handleDelete(row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@@ -82,7 +81,7 @@ export default {
} }
}) })
}, },
toAdd(id,flag) { toAdd(id) {
this.$emit('change', { this.$emit('change', {
type: 'electionAdd', type: 'electionAdd',
params: { params: {
@@ -107,12 +106,24 @@ export default {
} }
this.getList() this.getList()
}, },
// 结束 // 开启、结束
startEnd(id, status) { startEnd(id, status) {
this.$confirm('投票正在进行中,确定要提前结束吗?').then(() => { let title = ''
this.instance.post(`/app/appgeneralelectioninfo/start-end?id=${id}&start=${status}`).then(res=>{ let bool = null
let tips = ''
if(status == 0) {
title = '未到投票开始时间,确定要提前开始吗?'
bool = true
tips = '开启成功'
} else if(status == 1) {
title = '投票正在进行中,确定要提前结束吗?'
bool = false
tips = '结束成功'
}
this.$confirm(title).then(() => {
this.instance.post(`/app/appgeneralelectioninfo/start-end?id=${id}&start=${bool}`).then(res=>{
if(res.code == 0) { if(res.code == 0) {
this.$message.success('结束成功') this.$message.success(tips)
this.getList() this.getList()
} }
}) })

View File

@@ -15,9 +15,15 @@ import organizationSetting from "./components/organizationSetting.vue";
export default { export default {
name: "AppOrganizationChange", name: "AppOrganizationChange",
label: "组织换届", label: "组织换届",
provide() {
return {
...this.$props
}
},
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
permissions: Function
}, },
components: { components: {
List, List,
@@ -27,16 +33,16 @@ export default {
computed: { computed: {
...mapState(['user']), ...mapState(['user']),
currentPage() { currentPage() {
if (this.$route.hash == "#add") { const {hash} = this.$route
if (["#add","#makeup"].includes(hash)) {
return addChange return addChange
} else if (this.$route.hash == "#setting") { } else if (hash == "#setting") {
return organizationSetting return organizationSetting
} else return List } else return List
} }
}, },
data() { data() {
return { return {
component: "List",
params: {}, params: {},
include: [], include: [],
selected: {}, selected: {},
@@ -47,10 +53,6 @@ export default {
this.params = data.params; this.params = data.params;
}, },
}, },
created() {
let {organizationId: id, organizationName: name} = this.user.info
this.selected = {id, name}
}
} }
</script> </script>

View File

@@ -1,11 +1,7 @@
<template> <template>
<ai-list class="List"> <ai-list class="List">
<template slot="title"> <template slot="title">
<ai-title title="组织换届" isShowBottomBorder> <ai-title title="组织换届" isShowBottomBorder/>
<template slot="rightBtn">
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toSetting('')">换届设置</el-button>
</template>
</ai-title>
</template> </template>
<template #left> <template #left>
<ai-tree-menu title="组织目录" searchPlaceholder="请输入组织名称" @search="onSearch"> <ai-tree-menu title="组织目录" searchPlaceholder="请输入组织名称" @search="onSearch">
@@ -19,15 +15,16 @@
</ai-tree-menu> </ai-tree-menu>
</template> </template>
<template slot="content" class="content"> <template slot="content" class="content">
<ai-title title="届次信息">
<template #rightBtn>
<el-button size="small" type="primary" @click="toSetting(selected.id)" v-if="permissions('app_apporganizationchangeconfig')">换届设置</el-button>
</template>
</ai-title>
<el-tabs v-model="currIndex"> <el-tabs v-model="currIndex">
<el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label"> <el-tab-pane v-for="(tab,i) in tabs" :key="i" :label="tab.label">
<component :ref="tab.name" v-if="currIndex == String(i)" :is="tab.comp" lazy :instance="instance" :selected="selected" <component :ref="tab.name" v-if="currIndex==i" :is="tab.comp" lazy :selected="selected" v-on="$listeners"/>
:dict="dict" :permissions="permissions" v-on="$listeners"/>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div class="add_btn">
<el-button size="small" type="primary" icon="iconfont iconAdd" @click="toAdd('')">新增换届</el-button>
</div>
</template> </template>
</ai-list> </ai-list>
</template> </template>
@@ -39,12 +36,7 @@ import history from './history.vue'
export default { export default {
name: 'List', name: 'List',
props: { inject: ['permissions', 'instance', 'dict'],
instance: Function,
permissions: Function,
dict: Object,
selected: Object
},
data() { data() {
return { return {
tabs: [ tabs: [
@@ -52,6 +44,7 @@ export default {
{label: '历史届次', name: 'history', comp: history, permission: ''} {label: '历史届次', name: 'history', comp: history, permission: ''}
], ],
currIndex: '0', currIndex: '0',
selected: null
} }
}, },
components: { components: {
@@ -60,25 +53,15 @@ export default {
}, },
computed: { computed: {
...mapState(['user']), ...mapState(['user']),
orgTree() {
return this.$refs.tree?.$refs?.partyTree
},
}, },
methods: { methods: {
showNeighbourSetting(id) {
this.$router.push({query: {id}, hash: "#ns"})
},
onTreeChange(e) { onTreeChange(e) {
this.$emit("update:selected", e) this.selected = e
this.$refs[this.tabs[Number(this.currIndex)].name][0].getList(e.id) this.$refs[this.tabs[Number(this.currIndex)].name][0].getList(e.id)
}, },
onSearch(v) { onSearch(v) {
this.orgTree.filter(v) this.$refs.tree?.$refs?.partyTree?.filter(v)
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true if (!value) return true
return data.name.indexOf(value) !== -1 return data.name.indexOf(value) !== -1
@@ -86,9 +69,13 @@ export default {
toAdd(id) { toAdd(id) {
this.$router.push({hash: "#add", query: {id}}) this.$router.push({hash: "#add", query: {id}})
}, },
toSetting(id) { toSetting(oid) {
this.$router.push({hash: "#setting", query: {id}}) this.$router.push({hash: "#setting", query: {oid, new: 1}})
} }
},
created() {
const {organizationId: id, organizationName: name} = this.user.info
this.selected = {id, name}
} }
} }
</script> </script>
@@ -135,6 +122,7 @@ export default {
.ai-list__content--right-wrapper { .ai-list__content--right-wrapper {
width: 100%; width: 100%;
padding-top: 0;
} }
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<section class="addChange"> <section class="addChange">
<ai-detail> <ai-detail>
<ai-title slot="title" title="新增换届" isShowBottomBorder isShowBack @onBackClick="cancel(false)"/> <ai-title slot="title" :title="pageTitle" isShowBottomBorder isShowBack @onBackClick="cancel(false)"/>
<template #content> <template #content>
<ai-card title="基本信息"> <ai-card title="基本信息">
<template #content> <template #content>
@@ -83,10 +83,13 @@ export default {
permissions: Function, permissions: Function,
dict: Object, dict: Object,
}, },
computed: {
isMakeUp: v => v.$route.hash == "#makeup",
pageTitle: v => v.isMakeUp ? "补录换届" : "新增换届"
},
data() { data() {
return { return {
form: { form: {
addOrMakeup: true,
changeTime: '', changeTime: '',
sessionTime: '', sessionTime: '',
serveList: [], // 任职人员列表 serveList: [], // 任职人员列表
@@ -99,8 +102,18 @@ export default {
} }
}, },
methods: { methods: {
cancel() { // getDetail() {
this.$router.push({}) // const {id: organizationId} = this.$route.query
// organizationId && this.instance.post(`/app/apporganizationgeneralelection/queryDetailByOrganizationId`, null, {
// params: {organizationId}
// }).then(res => {
// if (res?.data) {
// this.form = res.data
// }
// })
// },
cancel(refresh) {
refresh ? this.$router.push({}) : this.$router.back()
}, },
handleDelete(i, type) { handleDelete(i, type) {
this.$confirm("确定要删除该数据?").then(() => { this.$confirm("确定要删除该数据?").then(() => {
@@ -114,8 +127,9 @@ export default {
confirm() { confirm() {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
const addOrMakeup = !this.isMakeUp
this.instance.post(`/app/apporganizationgeneralelection/add`, { this.instance.post(`/app/apporganizationgeneralelection/add`, {
...this.form ...this.form, addOrMakeup
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('提交成功') this.$message.success('提交成功')

View File

@@ -0,0 +1,190 @@
<template>
<section class="detailPanel">
<div class="itemTitle">
<b>本届任职{{editable?"(必填)":""}}</b>
<span type="text" class="iconfont iconAdd" @click="showDialog({type:0})">添加任职人员</span>
</div>
<el-table :data="serveList" border header-cell-class-name="table-header" cell-class-name="table-cell">
<el-table-column label="职位" width="180px" prop="position"/>
<el-table-column label="姓名" prop="name"/>
<el-table-column label="操作" width="120px" align="center">
<div slot-scope="{row,$index}" class="table-operation">
<span class="iconfont iconEdit" @click="showDialog(row,$index)" title="编辑"/>
<span class="iconfont iconDelete" title="删除" @click="deleteItem($index,0)"/>
</div>
</el-table-column>
</el-table>
<div class="itemTitle">
<b>本届候选人</b>
<span type="text" class="iconfont iconAdd" @click="showDialog({type:1})">添加候选人</span>
</div>
<el-table :data="candidateList" border header-cell-class-name="table-header" cell-class-name="table-cell">
<el-table-column label="职位" width="180px" prop="position"/>
<el-table-column label="候选人" prop="name"/>
<el-table-column label="操作" width="120px" align="center">
<div slot-scope="{row,$index}" class="table-operation">
<span class="iconfont iconEdit" @click="showDialog(row,$index)" title="编辑"/>
<span class="iconfont iconDelete" title="删除" @click="deleteItem($index,1)"/>
</div>
</el-table-column>
</el-table>
<el-dialog :visible.sync="dialog.visible" width="520px" :title="dialog.title" class="editStyle"
@close="dialog={visible: false},$refs.editListItemForm.clearValidate()">
<el-form ref="editListItemForm" size="small" :model="dialog" :rules="rules" label-width="100px"
:validate-on-rule-change="false">
<el-form-item label="职位:" prop="position">
<el-input v-model="dialog.position" placeholder="请输入..."/>
</el-form-item>
<el-form-item :label="currentList.name+''" prop="name">
<el-input v-if="dialog.type==0" v-model="dialog.name" placeholder="请输入..."/>
<div v-else>
<el-input type="textarea" :rows="3" v-model="dialog.name" placeholder="请输入..."/>
<span style="color:#999;font-size: 12px">输入候选人姓名用空格隔开</span>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="footerBtns">
<el-button size="small" @click="dialog.visible=false">取消</el-button>
<el-button size="small" type="primary" @click="submitAdd">确认</el-button>
</div>
</el-dialog>
</section>
</template>
<script>
export default {
name: "detailPanel",
model: {
prop: "value",
event: "change"
},
props: {
value: Object,
instance: Function,
dict: Object,
permissions: Function,
editable: {type: Boolean, default: false}
},
data() {
return {
dialog: {
visible: false,
title: "",
name: "",
changeTime: ""
},
serveList: [],
candidateList: []
}
},
computed: {
lists() {
return {candidateList: this.candidateList, serveList: this.serveList}
},
currentList() {
let initData = {
0: {name: "姓名", dialogTitle: "本届任职人", list: "serveList"},
1: {name: "候选人", dialogTitle: "本届候选人", list: "candidateList"}
}
return initData[this.dialog.type || 0]
},
rules() {
return {
name: [{required: true, message: "请输入" + this.currentList.name, trigger: "change"}],
position: [{required: true, message: "请输入职位", trigger: "change"}],
}
},
},
watch: {
lists: {
deep: true,
handler() {
this.$emit('change', this.lists)
}
},
value: {
deep: true,
handler(v) {
if (v) {
v.candidateList && (this.candidateList = v.candidateList)
v.serveList && (this.serveList = v.serveList)
}
}
}
},
methods: {
showDialog(v, rowIndex) {
this.dialog = {...this.dialog, ...v, rowIndex}
this.dialog.title = (this.dialog.rowIndex==0? "编辑" : "添加") + this.currentList.dialogTitle
this.dialog.visible = true
},
submitAdd() {
this.$refs.editListItemForm.validate(v => {
if (v) {
if (this.dialog.rowIndex > -1) {
this.$data[this.currentList.list].splice(this.dialog.rowIndex, 1, this.dialog)
} else this.$data[this.currentList.list].push(this.dialog)
this.dialog.visible = false
this.dialog.rowIndex==undefined ? this.$emit("refresh",1) : this.$emit("refresh",2);
}
})
},
deleteItem(index,type) {
this.$confirm(`是否要删除该${type==0?'本届任职人':'本届候选人'}`, {type: "error"}).then(() => {
type==0?this.$data["serveList"].splice(index, 1):this.$data["candidateList"].splice(index, 1)
this.$emit("refresh",0)
}).catch(() => {
})
}
},
mounted() {
this.$nextTick(() => {
if (this.value) {
let v = JSON.parse(JSON.stringify(this.value))
v.candidateList && (this.candidateList = v.candidateList)
v.serveList && (this.serveList = v.serveList)
}
})
}
}
</script>
<style lang="scss" scoped>
.detailPanel {
.itemTitle + .el-table {
margin-top: 16px;
}
.el-table + .itemTitle {
margin-top: 24px;
}
::v-deep .table-header {
box-sizing: border-box;
border-right: 1px solid #d0d4dc !important;
.cell {
padding-left: 32px;
}
&.is-center > .cell {
padding-left: 10px !important;
}
}
::v-deep .table-cell {
height: 44px;
color: #333;
.cell {
padding-left: 32px;
}
&.is-center > .cell {
padding-left: 10px !important;
}
}
}
</style>

View File

@@ -3,26 +3,18 @@
<ai-search-bar> <ai-search-bar>
<template #left> <template #left>
<el-button type="primary" icon="iconfont iconEdit" @click="fillupAdd('')">补录</el-button> <el-button type="primary" icon="iconfont iconEdit" @click="$router.push({hash:'#makeup',query:{}})">补录</el-button>
</template> </template>
<template #right> <template #right>
<el-input size="small" placeholder="请输入届次" v-model="search.name" clearable <el-input size="small" placeholder="请输入届次" v-model="search.name" clearable
v-throttle="() => {page.current = 1, getList()}"/> v-throttle="() => {page.current = 1, getList()}"/>
<el-button icon="iconfont iconResetting" @click="reset('')">重置</el-button>
</template> </template>
</ai-search-bar> </ai-search-bar>
<ai-table <ai-table :tableData="tableData" :col-configs="colConfigs" :isShowPagination="false" @getList="getList">
class="detail-table__table"
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
:current.sync="current"
:size.sync="size"
@getList="getJobList">
<el-table-column slot="options" label="操作" align="center"> <el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-button type="text" @click="jobEdit(row.id)">编辑</el-button> <el-button type="text" @click="handleEdit(row.id)">编辑</el-button>
<el-button type="text" @click="jobDelete(row.id)">删除</el-button> <el-button type="text" @click="handleDelete(row.id)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</ai-table> </ai-table>
@@ -32,41 +24,60 @@
<script> <script>
export default { export default {
name: "history", name: "history",
props: { inject: {
instance: Function, permissions: {},
permissions: Function, instance: {},
dict: Object, dict: {}
}, },
data() { data() {
return { return {
search: { search: {
name: '', name: '',
}, },
page: { tableData: []
current: 1,
size: 10,
total: 0
}
} }
}, },
computed: { computed: {
colConfigs() { colConfigs() {
return [ return [
{prop: '', label: '届次', align: 'left'}, {prop: 'sessionTime', label: '届次', align: 'left'},
{prop: '', label: '换届日期', align: 'center'}, {prop: 'changeTime', label: '换届日期', align: 'center'},
{prop: '', label: '操作时间', align: 'center'}, {prop: 'createTime', label: '操作时间', align: 'center'},
{prop: '', label: '操作人', align: 'center'}, {prop: 'createUserName', label: '操作人', align: 'center'},
{slot: 'options'}, {slot: 'options'},
] ]
} },
oid: v => v.$attrs.selected.id
}, },
methods: { methods: {
fillupAdd() {}, handleEdit(id) {
reset() {}, this.$router.push({hash: "#makeup", query: {id}})
getList() {} },
handleDelete(id) {
this.$confirm("是否要删除该条届次记录?").then(() => {
this.instance.post("/app/apporganizationgeneralelection/delete", null, {
params: {id}
}).then(res => {
if (res?.code == 0) {
this.$message.success("删除成功!")
this.getList()
}
})
}).catch(() => 0)
},
getList() {
const {oid: organizationId} = this
this.instance.post("/app/apporganizationgeneralelection/list", null, {
params: {...this.search, organizationId}
}).then(res => {
if (res?.data) {
this.tableData = res.data
}
})
}
}, },
created() { created() {
this.getList()
}, },
} }
</script> </script>

View File

@@ -1,56 +1,64 @@
<template> <template>
<section class="moment"> <section class="moment">
<ai-title title="总体概况" class="mar-b8"> <template v-if="detail.id">
<template slot="rightBtn"> <ai-title title="总体概况" class="mar-b8">
<el-button size="small" type="text" icon="iconfont iconEdit" @click="toEdit('')">修改</el-button> <template slot="rightBtn">
</template> <el-button size="small" type="text" icon="iconfont iconEdit" @click="toEdit(oid)">修改</el-button>
</ai-title>
<ai-wrapper>
<ai-info-item label="本届换届时间" :value="111"/>
<ai-info-item label="换届类型" :value="111"/>
<ai-info-item label="下届换届时间" :value="111"/>
<ai-info-item label="当前届次" :value="111"/>
</ai-wrapper>
<ai-title title="本届任职" class="mar-b8">
<template slot="rightBtn">
<el-button size="small" type="text" icon="iconfont iconAdd" @click="dialogJob=true">添加任职人员</el-button>
</template>
</ai-title>
<ai-table
class="detail-table__table"
:tableData="tableData"
:col-configs="colConfigs"
:total="totalJob"
:current.sync="current"
:size.sync="size"
@getList="getJobList">
<el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
<el-button type="text" @click="jobEdit(row.id)">编辑</el-button>
<el-button type="text" @click="jobDelete(row.id)">删除</el-button>
</template> </template>
</el-table-column> </ai-title>
</ai-table> <ai-wrapper>
<ai-title title="本届候选人" class="mar-b8"> <ai-info-item label="本届换届时间" :value="detail.changeTime"/>
<template slot="rightBtn"> <ai-info-item label="换届类型" :value="dict.getLabel('organizationChangeType',detail.type)"/>
<el-button size="small" type="text" icon="iconfont iconAdd" @click="dialogCandidate = true">添加候选人</el-button> <ai-info-item label="下届换届时间" :value="detail.nextChangeTime"/>
</template> <ai-info-item label="当前届次" :value="detail.sessionTime"/>
</ai-title> </ai-wrapper>
<ai-table <ai-title title="本届任职" class="mar-b8">
class="detail-table__table" <template slot="rightBtn">
:tableData="tableData" <el-button size="small" type="text" icon="iconfont iconAdd" @click="dialogJob=true">添加任职人员</el-button>
:col-configs="colConfigs"
:total="totalJob"
:current.sync="current"
:size.sync="size"
@getList="getJobList">
<el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
<el-button type="text" @click="jobEdit(row.id)">编辑</el-button>
<el-button type="text" @click="jobDelete(row.id)">删除</el-button>
</template> </template>
</el-table-column> </ai-title>
</ai-table> <ai-table
class="detail-table__table"
:tableData="tableData"
:col-configs="colConfigs"
:total="totalJob"
:current.sync="current"
:size.sync="size"
@getList="getJobList">
<el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
<el-button type="text" @click="jobEdit(row.id)">编辑</el-button>
<el-button type="text" @click="jobDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</ai-table>
<ai-title title="本届候选人" class="mar-b8">
<template slot="rightBtn">
<el-button size="small" type="text" icon="iconfont iconAdd" @click="dialogCandidate = true">添加候选人</el-button>
</template>
</ai-title>
<ai-table
class="detail-table__table"
:tableData="tableData"
:col-configs="colConfigs"
:total="totalJob"
:current.sync="current"
:size.sync="size"
@getList="getJobList">
<el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
<el-button type="text" @click="jobEdit(row.id)">编辑</el-button>
<el-button type="text" @click="jobDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</ai-table>
</template>
<ai-empty>
<div>暂无换届信息</div>
<el-row type="flex" justify="center" class="mar-t8">
<ai-highlight content="请点击【@v】完善基础内容后,再进行后续操作" value="换届设置"/>
</el-row>
</ai-empty>
<ai-dialog :visible.sync="dialogJob" title="添加本届任职人" width="720px" @closed="jobForm={}" @onConfirm="handleJobForm"> <ai-dialog :visible.sync="dialogJob" title="添加本届任职人" width="720px" @closed="jobForm={}" @onConfirm="handleJobForm">
<el-form ref="jobForm" size="small" :model="jobForm" :rules="jobRules" label-width="80px"> <el-form ref="jobForm" size="small" :model="jobForm" :rules="jobRules" label-width="80px">
<el-form-item label="职位" prop="job"> <el-form-item label="职位" prop="job">
@@ -77,15 +85,10 @@
<script> <script>
export default { export default {
name: "moment", name: "moment",
props: { inject: ['permissions', 'instance', 'dict'],
instance: Function,
permissions: Function,
dict: Object,
selected: Object,
},
data() { data() {
return { return {
isEdit: false, detail: {},
tableData: [], tableData: [],
totalJob: 0, totalJob: 0,
current: 1, current: 1,
@@ -121,10 +124,11 @@ export default {
job: [{required: true, message: "请输入职位"}], job: [{required: true, message: "请输入职位"}],
name: [{required: true, message: "请输入姓名"}], name: [{required: true, message: "请输入姓名"}],
} }
} },
oid: v => v.$attrs.selected.id
}, },
mounted() { created() {
this.getList(this.selected.id) this.getList()
}, },
methods: { methods: {
jobEdit() { jobEdit() {
@@ -136,10 +140,13 @@ export default {
toEdit(id) { toEdit(id) {
this.$router.push({hash: "#add", query: {id}}) this.$router.push({hash: "#add", query: {id}})
}, },
getList(id) { getList() {
this.instance.post(`/app/apporganizationgeneralelection/queryDetailByOrganizationId?organizationId=${id}`).then(res => { const {oid: organizationId} = this
organizationId && this.instance.post(`/app/apporganizationgeneralelection/queryDetailByOrganizationId`, null, {
params: {organizationId}
}).then(res => {
if (res?.data) { if (res?.data) {
console.log(res, '111'); this.detail = res.data
} }
}) })
}, },

View File

@@ -1,90 +1,45 @@
<template> <template>
<section class="organizationSetting"> <section class="organizationSetting">
<!-- <ai-detail class="add" v-if="id && !isEdit">
<template slot="title">
<ai-title title="换届选举详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #right>
<span style="color:#2266FF;cursor: pointer;font-size: 12px;" class="iconfont iconEdit" v-if="isEdit==false" @click="isEdit = true">修改</span>
</template>
<template #content v-if="isEdit == false">
<ai-wrapper>
<ai-info-item label="标题" :value="info.title"></ai-info-item>
<ai-info-item label="投票说明" :value="info.votingInstructions"></ai-info-item>
<ai-info-item label="单位名称" :value="info.organizationName"></ai-info-item>
<ai-info-item label="选举方式">
{{ info.electionMethod==0? '等额':'差额'}}
<el-tooltip class="item" effect="dark" content="差额选举:候选人数多于应选人数的选举方式;
等额选举:候选人数与应选人数相等的选举方式。" placement="top">
<i class="el-icon-info" style="margin-right: 8px"></i>
</el-tooltip>
</ai-info-item>
<ai-info-item label="应选人数" :value="info.candidatesNumber"></ai-info-item>
<ai-info-item label="投票日期" :value="info.votingDate"></ai-info-item>
<ai-info-item label="候选人" isLine>
<span v-for="(item,index) in candidateUsersList" :key="index">
{{ item }}
<span v-if="index < candidateUsersList.length - 1"></span>
</span>
</ai-info-item>
<ai-info-item label="投票人" isLine :value="info.voteUsers">
<span v-for="(item,index) in voteUsersList" :key="index">
{{ item }}
<span v-if="index < voteUsersList.length - 1"></span>
</span>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
</template>
</ai-detail> -->
<ai-detail> <ai-detail>
<ai-title slot="title" title="换届设置" isShowBottomBorder isShowBack @onBackClick="cancel(true)"/> <ai-title slot="title" title="换届设置" isShowBottomBorder isShowBack @onBackClick="cancel(true)"/>
<template slot="content"> <template slot="content">
<ai-card title="基本信息"> <el-form ref="SettingForm" :model="form" :rules="formRules" size="small" label-width="150px">
<template #content> <ai-card title="基本信息">
<div class="tips"> <template #content>
<i class="el-icon-warning"></i> <div class="tips">
系统将在下次换届时间开始前换届提醒人进行提醒提醒方式包括平台消息推送短信提醒 <i class="el-icon-warning"></i>
</div> 系统将在下次换届时间开始前换届提醒人进行提醒提醒方式包括平台消息推送短信提醒
<div class="add-form"> </div>
<el-form ref="form" :model="form" :rules="formRules" size="small" label-width="150px"> <el-form-item label="单位名称">{{ org.name }}</el-form-item>
<el-form-item label="单位名称"> <el-form-item label="成立时间">{{ $dateFormat(org.createTime) }}</el-form-item>
<div>{{ user.info.organizationName }}</div> <el-form-item label="换届类型" prop="type">
</el-form-item> <el-radio v-model="form.type" label="0">三年换届</el-radio>
<el-radio v-model="form.type" label="1">五年换届</el-radio>
<el-form-item label="成立时间"> </el-form-item>
<div>{{ createTime }}</div> <el-form-item label="换届提醒人" prop="userList">
</el-form-item> <ai-person-select :instance="instance" :customClicker="true" :chooseUserList="chooseUserList"
:url="`/app/appparty/list?partyOrgId=${org.id}`" headerTitle="党员列表"
<el-form-item label="换届类型" prop="type"> :isMultiple="true" dialogTitle="选择抄送人" @selectPerson="selectUser" class="aipersonselect">
<el-radio v-model="form.type" label="0">三年换届</el-radio> <template name="option" v-slot:option="{ item }">
<el-radio v-model="form.type" label="1">五年换届</el-radio> <span class="iconfont iconProlife">{{ item.name }}</span>
</el-form-item> </template>
</ai-person-select>
<el-form-item label="单位名称" prop="organizationName"> </el-form-item>
<el-input size="small" disabled placeholder="请选择所属党组织" v-model="form.organizationName"> </template>
<template slot="append"> </ai-card>
<ai-party :instance="instance" size="small" :value="form.organizationId" @origin="handlePartyOrgSelect"/> <ai-card v-if="isInit" title="届次设置">
</template> <el-form-item label="本届换届时间:" prop="changeTime">
</el-input> <el-date-picker v-model="form.changeTime"/>
</el-form-item> </el-form-item>
<el-form-item label="下届换届时间:" prop="nextChangeTime">
<el-form-item label="换届提醒人" prop="userList"> <el-date-picker disabled v-model="form.nextChangeTime"/>
<ai-person-select :instance="instance" :customClicker="true" :chooseUserList="chooseUserList" </el-form-item>
:url="`/app/appparty/list?partyOrgId=${form.organizationId}`" headerTitle="党员列表" <el-form-item label="届次:" prop="sessionTime">
:isMultiple="true" dialogTitle="选择抄送人" @selectPerson="selectUser" class="aipersonselect"> <el-input v-model="form.sessionTime" placeholder="请输入..."/>
<template name="option" v-slot:option="{ item }"> </el-form-item>
<span class="iconfont iconProlife">{{ item.name }}</span> <detail-panel :instance="instance" v-model="lists" editable/>
</template> </ai-card>
</ai-person-select> </el-form>
</el-form-item>
</el-form>
</div>
</template>
</ai-card>
</template> </template>
<template slot="footer" class="footer"> <template slot="footer" class="footer">
<el-button class="delete-btn footer-btn" @click="cancel(false)">取消</el-button> <el-button class="delete-btn footer-btn" @click="cancel(false)">取消</el-button>
@@ -97,14 +52,12 @@
<script> <script>
import {mapState} from 'vuex' import {mapState} from 'vuex'
import DetailPanel from "./detailPanel";
export default { export default {
name: "organizationSetting", name: "organizationSetting",
props: { components: {DetailPanel},
instance: Function, inject: ['permissions', 'instance', 'dict'],
dict: Object,
},
data() { data() {
let validUser = (rule, value, callback) => { let validUser = (rule, value, callback) => {
if (!value.length) { if (!value.length) {
@@ -115,47 +68,46 @@ export default {
}; };
return { return {
form: { form: {
addOrMakeup: true, type: "",
organizationId: '',
organizationName: '',
type: '0',
userList: [], userList: [],
sessionTime: "",
changeTime: "",
nextChangeTime: ""
},
lists: {
candidateList: [], //本届候选人
serveList: [] //本届任职
}, },
formRules: { formRules: {
type: [{required: true, message: "请选择选举方式", trigger: "blur"}], type: [{required: true, message: "请选择选举方式", trigger: "blur"}],
organizationName: [{required: true, message: "请选择党组织", trigger: "blur"}],
userList: [{required: true, validator: validUser, trigger: "blur"}], userList: [{required: true, validator: validUser, trigger: "blur"}],
}, },
chooseUserList: [], chooseUserList: [],
createTime: '', org: null
} }
}, },
computed: { computed: {
...mapState(['user']) ...mapState(['user']),
isInit: v => !!v.form.id,
isNew: v => v.$route.query.new
}, },
created() { created() {
this.getDetail() this.org = new this.MODEL.PartyOrg(this.$route.query.oid)
this.getOrganization() !this.isNew && this.getDetail()
}, },
methods: { methods: {
cancel() { cancel() {
this.$router.back() this.$router.back()
}, },
// 查询组织关系
getOrganization() {
this.instance.post(`/app/partyOrganization/queryPartyOrganizationServiceList`).then(res => {
if (res?.data) {
let data = res.data.filter(item => item.id == this.user.info.organizationId)
this.createTime = data[0].createTime
}
})
},
getDetail() { getDetail() {
this.instance.post(`/app/apporganizationchangeconfig/queryDetailByOrganizationId?organizationId=${this.user.info.organizationId}`).then((res) => { const {oid: organizationId} = this.$route.query
this.instance.post(`/app/apporganizationchangeconfig/queryDetailByOrganizationId`, null, {
params: {organizationId}
}).then((res) => {
if (res?.data) { if (res?.data) {
// this.chooseCandidateList = res.data.candidateUsers this.form = res.data
// this.chooseVoteList = res.data.voteUsers let {candidateList, serveList} = this.form
console.log(res); this.lists = {candidateList, serveList}
} }
}) })
}, },
@@ -165,26 +117,20 @@ export default {
selectVote(e) { selectVote(e) {
this.form.voteUsers = e this.form.voteUsers = e
}, },
handlePartyOrgSelect(v) {
if (v) {
this.form.organizationId = v[0]?.id
this.form.organizationName = v[0]?.name
}
},
confirm() { confirm() {
// 换届设置 // 换届设置
this.$refs.form.validate((valid) => { this.$refs.SettingForm.validate(v => {
if (valid) { if (v) {
this.instance.post(`/app/apporganizationchangeconfig/update`, { const {id: organizationId, name: organizationName} = this.org
...this.form const action = `/app/apporganizationchangeconfig/${this.isInit ? 'update' : 'add'}`
this.instance.post(action, {
addOrMakeup: true,
...this.form, organizationId, organizationName
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('提交成功') this.$message.success('提交成功')
this.cancel(true) this.cancel(true)
} }
}).catch((err) => {
console.log(err);
}) })
} }
}) })