This commit is contained in:
2024-12-09 16:02:46 +08:00
parent 0267d27b2a
commit 8da42abcf1
14 changed files with 346 additions and 337 deletions
@@ -3,8 +3,8 @@ layout("/layouts/platform.html"){
#-->
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0 5%">
<div class="platform" id="app" v-cloak>
<guava padding="0 5%" ref="guava">
<template>
<el-card shadow="never">
@@ -14,11 +14,11 @@ layout("/layouts/platform.html"){
<div class="search-item-label">年&emsp;&emsp;度:</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.year"
type="year"
placeholder="请选择"
style="width: 100%"
value-format="yyyy"
placeholder="请选择">
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
@@ -26,56 +26,56 @@ layout("/layouts/platform.html"){
<div class="search-item">
<div class="search-item-label">项目名称:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.name"
@keyup.enter.native="doSearch" style="width:100%"></el-input>
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
style="width:100%" v-model="pageForm.name"></el-input>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="体检项目" :app="this">
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="体检项目">
<template #func>
<el-button type="primary" size="small"
icon="el-icon-plus"
@click="openAdd">新建体检项目
<el-button @click="openAdd" icon="el-icon-plus"
size="small"
type="primary">新建体检项目
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id"
@sort-change="pageOrder" :size="tableSize"
v-loading="tableLoading" ref="table" class="vi-table">
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
class="vi-table" ref="table"
row-key="id" style="width: 100%" v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index"
:index="indexMethod" label="序号"
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号" type="index"
width="80px"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
min-width="100px" show-overflow-tooltip v-for="column in tableColumns">
<template v-if="column.prop=='choiceTime'" scope="{row}">
<template scope="{row}" v-if="column.prop=='choiceTime'">
{{row.choiceTimeStart}}-{{row.choiceTimeEnd}}
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center"
label="操作" width="100px">
<el-table-column align="center" header-align="center" label="操作"
prop="userOnline" width="100px">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
@@ -87,16 +87,18 @@ layout("/layouts/platform.html"){
<el-dropdown-item :command="{type:'view',data:row}">
查看
</el-dropdown-item>
<el-dropdown-item v-if="row.isWithinChoiceTime && !row.isHasUserList"
:command="{type:'created',data:row}">
<el-dropdown-item
:command="{type:'created',data:row}"
v-if="row.isWithinChoiceTime && !row.isHasUserList">
生成名单
</el-dropdown-item>
<el-dropdown-item v-if="row.isWithinChoiceTime && row.isHasUserList"
:command="{type:'renew',data:row}">
<el-dropdown-item
:command="{type:'renew',data:row}"
v-if="row.isWithinChoiceTime && row.isHasUserList">
更新名单
</el-dropdown-item>
<el-dropdown-item v-if="row.isWithinChoiceTime"
:command="{type:'reset',data:row}">
<el-dropdown-item :command="{type:'reset',data:row}"
v-if="row.isWithinChoiceTime">
重置名单
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:row}">
@@ -122,39 +124,39 @@ layout("/layouts/platform.html"){
</template>
<template #edit>
<el-form :model="formData" ref="form" :rules="formRules" label-width="120px"
<el-form :model="formData" :rules="formRules" label-width="120px" ref="form"
v-loading="formLoading">
<vi-title title="体检项目信息"></vi-title>
<el-form-item prop="name" label="项目名称">
<el-input v-model="formData.name" placeholder="项目名称" maxlength="100"></el-input>
<el-form-item label="项目名称" prop="name">
<el-input maxlength="100" placeholder="项目名称" v-model="formData.name"></el-input>
</el-form-item>
<el-row>
<el-col span="12">
<el-form-item prop="choiceTime" label="选择时间">
<el-form-item label="选择时间" prop="choiceTime">
<el-date-picker
style="width: 80%"
v-model="formData.choiceTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
end-placeholder="结束时间"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间">
style="width: 80%"
type="datetimerange"
v-model="formData.choiceTime"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="activityGroupId" label="可报名人员范围">
<el-form-item label="可报名人员范围" prop="activityGroupId">
<div style="display: flex; justify-content: space-between">
<div style="width: 99%">
<el-select prop="activityGroupId" placeholder="参加人员范围"
v-model="formData.activityGroupId"
<el-select clearable filterable
placeholder="参加人员范围"
prop="activityGroupId"
style="width: 99%;"
clearable
filterable>
<el-option v-for="item in activityGroupList"
:label="item.groupName"
:value="item.groupId"></el-option>
v-model="formData.activityGroupId">
<el-option :label="item.groupName"
:value="item.groupId"
v-for="item in activityGroupList"></el-option>
</el-select>
</div>
<div>
@@ -167,7 +169,7 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-col>
<el-col span="24">
<el-form-item prop="healthCheckupType" label="体检对象类型">
<el-form-item label="体检对象类型" prop="healthCheckupType">
<el-radio-group v-model="formData.healthCheckupType">
<el-radio-button label="jzg">教职工</el-radio-button>
<el-radio-button label="js">家属</el-radio-button>
@@ -185,9 +187,9 @@ layout("/layouts/platform.html"){
label="套餐名称">
<template slot-scope="{row}">
<el-input v-model="row.optionName" autosize
class="text-input"
<el-input autosize class="text-input"
data-type="option"
v-model="row.optionName"
></el-input>
</template>
</el-table-column>
@@ -196,9 +198,9 @@ layout("/layouts/platform.html"){
header-align="center"
label="排序">
<template slot-scope="{row}">
<el-input v-model="row.optionSort" autosize
class="text-input"
<el-input autosize class="text-input"
data-type="option"
v-model="row.optionSort"
></el-input>
</template>
</el-table-column>
@@ -207,10 +209,10 @@ layout("/layouts/platform.html"){
header-align="center"
label="图片" width="130px">
<template slot-scope="{row,$index}">
<image-Upload ref="imageUpload" :height="100"
:width="100" :limit="1"
:file-type="['png','jpg']"
:file-size="10"
<image-Upload :file-size="10" :file-type="['png','jpg']"
:height="100" :limit="1"
:width="100"
ref="imageUpload"
v-model="row.imgUrl"></image-Upload>
</template>
</el-table-column>
@@ -218,8 +220,8 @@ layout("/layouts/platform.html"){
header-align="center"
label="说明">
<template slot-scope="{row,$index}">
<el-link type="primary"
@click="openDescRichText(row.description,$index)">
<el-link @click="openDescRichText(row.description,$index)"
type="primary">
编辑说明
</el-link>
</template>
@@ -232,14 +234,14 @@ layout("/layouts/platform.html"){
width="100px">
<template slot-scope="{row,$index}">
<div class="option-delete">
<el-button circle
icon="el-icon-s-tools"
size="mini" type="primary"
@click="openCnd(row,$index,true)"></el-button>
<el-button circle
icon="el-icon-delete"
size="mini" type="danger"
@click="deleteRow(row,$index)"></el-button>
<el-button @click="openCnd(row,$index,true)"
circle
icon="el-icon-s-tools" size="mini"
type="primary"></el-button>
<el-button @click="deleteRow(row,$index)"
circle
icon="el-icon-delete" size="mini"
type="danger"></el-button>
</div>
</template>
@@ -247,8 +249,8 @@ layout("/layouts/platform.html"){
</el-table>
<div class="s-operation">
<el-button size="small" type="primary"
@click="formData.healthCheckupProjectSubjects.push({optionNameId:'',optionName:'套餐'+(formData.healthCheckupProjectSubjects.length+1),optionSort:formData.healthCheckupProjectSubjects.length+1,imgUrl:null})">
<el-button @click="formData.healthCheckupProjectSubjects.push({optionNameId:'',optionName:'套餐'+(formData.healthCheckupProjectSubjects.length+1),optionSort:formData.healthCheckupProjectSubjects.length+1,imgUrl:null})" size="small"
type="primary">
添加项目
</el-button>
</div>
@@ -257,16 +259,16 @@ layout("/layouts/platform.html"){
</el-form-item>
<el-form-item label="项目封面" prop="cover">
<image-Upload ref="imageUpload" :height="200"
:width="200" :limit="1"
:file-type="['png','jpg']"
:file-size="10"
<image-Upload :file-size="10" :file-type="['png','jpg']"
:height="200" :limit="1"
:width="200"
ref="imageUpload"
v-model="formData.cover"></image-Upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-button @click="doAdd" type="primary" style="float: right">
<el-button @click="doAdd" style="float: right" type="primary">
提交
</el-button>
</template>
@@ -297,15 +299,15 @@ layout("/layouts/platform.html"){
:src="CREATE_PREVIEW_URL(i.imgUrl)"
@click="preview(i.imgUrl,i.imgUrl)"
fit="cover"
v-if="i.imgUrl"
style="width: 100px; height: 100px;"></el-image>
style="width: 100px; height: 100px;"
v-if="i.imgUrl"></el-image>
<div v-else>暂无</div>
</el-descriptions-item>
<el-descriptions-item label="报名条件">
<el-button circle
icon="el-icon-s-tools"
size="mini" type="primary"
@click="openCnd(i,null,false)"></el-button>
<el-button @click="openCnd(i,null,false)"
circle
icon="el-icon-s-tools" size="mini"
type="primary"></el-button>
</el-descriptions-item>
</template>
@@ -314,32 +316,31 @@ layout("/layouts/platform.html"){
</guava>
<drawer-user-scope
:group_id.sync="formData.activityGroupId"
@group_change="getActivityGroup"
ref="drawerUserScope"
:group_id.sync="formData.activityGroupId"
></drawer-user-scope>
<send-msg ref="sendMsg" :url="url"></send-msg>
<send-msg :url="url" ref="sendMsg"></send-msg>
<open-qr-code ref="openQRCode" :url="url"></open-qr-code>
<open-qr-code :url="url" ref="openQRCode"></open-qr-code>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="richTextDialog"
title="编辑说明"
:append-to-body="true"
width="60%">
<div id="descRichText">
</div>
<span slot="footer" class="dialog-footer">
<text-editor v-model="descRichTextContent"></text-editor>
<span class="dialog-footer" slot="footer">
<el-button @click="richTextDialog = false">取 消</el-button>
<el-button type="primary" @click="getRichText">确 定</el-button>
<el-button @click="getRichText" type="primary">确 定</el-button>
</span>
</el-dialog>
<condition ref="cnd" v-model="conditions" :fields="fields"
:show_submit="showSubmit"
@confirm="cndConfirm"></condition>
<condition :fields="fields" :show_submit="showSubmit" @confirm="cndConfirm"
ref="cnd"
v-model="conditions"></condition>
</div>
<script>
@@ -374,7 +375,11 @@ layout("/layouts/platform.html"){
choiceTime: [{required: true, message: '必填', trigger: ['blur', 'change']}],
activityGroupId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
// cover: [{required: true, message: '必填', trigger: ['blur', 'change']}],
healthCheckupType: [{required: true, message: '必填', trigger: ['blur', 'change']}],
healthCheckupType: [{
required: true,
message: '必填',
trigger: ['blur', 'change']
}],
healthCheckupProjectSubjects: [{
required: true,
message: '必填',
@@ -391,6 +396,7 @@ layout("/layouts/platform.html"){
{label: '出生日期', value: 'birthday', type: "date"},
],
deleteRowIds: [],
descRichTextContent: ""
}
},
components: {
@@ -577,21 +583,9 @@ layout("/layouts/platform.html"){
openDescRichText(richText, sIdx) {
this.richTextDialog = true
this.subjectIndex = sIdx
this.$nextTick(() => {
$("#descRichText").html("")
descRichTextEditor = new wangEditor("#descRichText")
descRichTextEditor.config.onchange = (html) => {
richText = (html ? html : "")
}
descRichTextEditor.config.uploadImgShowBase64 = true
descRichTextEditor.create()
if (richText) {
descRichTextEditor.txt.html(richText)
}
})
},
getRichText() {
this.formData.healthCheckupProjectSubjects[this.subjectIndex].description = descRichTextEditor.txt.html()
this.formData.healthCheckupProjectSubjects[this.subjectIndex].description = this.descRichTextContent
this.richTextDialog = false
},
async openCnd(row, index, showSubmit) {