first commit
This commit is contained in:
@@ -0,0 +1,409 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.item-button {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.item-button .el-button {
|
||||
padding: 12px 25px;
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
font-size: 18px; /* 修改标题字体大小 */
|
||||
color: red; /* 修改标题字体颜色 */
|
||||
border-bottom: none; /* 去掉标题底部边框线 */
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<h3 style="color: rgb(24, 103, 176);font-family: Microsoft YaHei;">疗休养配置</h3>
|
||||
</div>
|
||||
|
||||
<el-form ref="addForm" :model="formData" :rules="formRules" label-width="170px">
|
||||
<vi-title title="基本配置"></vi-title>
|
||||
<el-form-item label="配置名称" prop="configName">
|
||||
<el-input v-model="formData.configName" placeholder="请输入配置名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="activityGroupId" label="参加人员范围">
|
||||
<el-select v-model="formData.activityGroupId" placeholder="请选择参加人员范围" filterable
|
||||
clearable
|
||||
style="width: 100%">
|
||||
<el-option v-for="item in activityGroupList"
|
||||
:value="item.groupId"
|
||||
:key="item.groupId"
|
||||
:label="item.groupName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="省外名额分配" prop="outsideQuota">
|
||||
<el-input v-model.number="formData.outsideQuota"
|
||||
placeholder="请输入省外名额分配"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="省外名额分配比例" prop="outsideQuotaProportion">
|
||||
<el-slider
|
||||
show-input
|
||||
v-model="formData.outsideQuotaProportion">
|
||||
</el-slider>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="省外几年去一次" prop="outsideNumber">
|
||||
<el-input max="100"
|
||||
placeholder="请输入省外几年去一次"
|
||||
v-model.number="formData.outsideNumber"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="每年旅行频率" prop="travelFrequency">
|
||||
<el-input max="100" disabled
|
||||
placeholder="请输入每年旅行频率"
|
||||
v-model.number="formData.travelFrequency"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="组团人数" prop="groupNumber">
|
||||
<el-input max="100"
|
||||
placeholder="请输入组团人数"
|
||||
v-model.number="formData.groupNumber"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="不可取消修改天数" prop="modifyDays">
|
||||
<el-input max="100"
|
||||
placeholder="请输入不可取消修改天数"
|
||||
v-model.number="formData.modifyDays"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="可以修改几次" prop="modifyNumber">
|
||||
<el-input max="100"
|
||||
placeholder="请输入可以修改几次"
|
||||
v-model.number="formData.modifyNumber"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="省内线路是否需要审核" prop="isSnLine">
|
||||
<el-radio-group v-model="formData.isSnLine">
|
||||
<el-radio-button :label="true">需要</el-radio-button>
|
||||
<el-radio-button :label="false">不需要</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="省外线路是否需要审核" prop="isSwLine">
|
||||
<el-radio-group v-model="formData.isSwLine">
|
||||
<el-radio-button :label="true">需要</el-radio-button>
|
||||
<el-radio-button :label="false">不需要</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="全批次最多报名人数" prop="allLineSignUpNumber">
|
||||
<el-input max="100"
|
||||
placeholder="请输入全批次最多报名人数"
|
||||
v-model.number="formData.allLineSignUpNumber"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="省内起始年份" prop="provinceStartYear">
|
||||
<el-input max="100"
|
||||
placeholder="请输入省内起始年份"
|
||||
v-model.number="formData.provinceStartYear"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<vi-title title="标段管理"></vi-title>
|
||||
<el-form-item label="标段">
|
||||
<el-button type="primary" @click="formData.lots.push({})"
|
||||
style="float: right;">增加一条
|
||||
</el-button>
|
||||
<el-table :data="formData.lots" stripe style="width: 100%">
|
||||
<el-table-column prop="index" label="序号" width="180">
|
||||
<template scope="scope">
|
||||
{{scope.$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lotName" label="标段名称">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.lotName" placeholder="请输入标段名称"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lotValue" label="标段值">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.lotValue" placeholder="请输入标段值"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="activityCost" label="标段费用">
|
||||
<template scope="{row}">
|
||||
<el-input v-model="row.activityCost" placeholder="请输入标段费用"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!--# if(@shiro.hasRole('sysadmin')){ #-->
|
||||
<el-table-column prop="index" label="操作">
|
||||
<template scope="scope">
|
||||
<el-button type="danger" icon="el-icon-delete"
|
||||
@click="deleteLotsRow(scope)"></el-button>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
<!--# } #-->
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
|
||||
<vi-title title="服务须知"></vi-title>
|
||||
<el-form-item label="疗休养服务须知" prop="notice">
|
||||
<div id="lineContent"></div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item class="item-button">
|
||||
<el-button type="danger" @click="resetForm">重 置</el-button>
|
||||
<el-button type="primary" @click="operation" :loading="subLoading">提 交
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
title="该标段被以下线路/目的地绑定,是否强制删除"
|
||||
:visible.sync="centerDialogVisible"
|
||||
width="50%"
|
||||
center>
|
||||
<template>
|
||||
<el-card>
|
||||
<div v-if="LineNameList.line!=null">
|
||||
<el-descriptions class="margin-top" title="线路名称" :column="3">
|
||||
<el-descriptions-item v-for="(o,index) in LineNameList.line">
|
||||
<template slot="label">
|
||||
{{o.index}}
|
||||
</template>
|
||||
{{o}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<br/>
|
||||
</div>
|
||||
<div v-if="LineNameList.base!=null">
|
||||
<el-descriptions class="margin-top" title="目的地名称" :column="3">
|
||||
<el-descriptions-item v-for="o in LineNameList.base">
|
||||
<template slot="label">
|
||||
{{o.index}}
|
||||
</template>
|
||||
{{o}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDialog">取 消</el-button>
|
||||
<el-button type="primary" @click="deleteLotById">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
|
||||
data() {
|
||||
return {
|
||||
activityGroupList: [],
|
||||
subLoading: false,
|
||||
formData: {
|
||||
isSnLine: 0,
|
||||
isSwLine: 0,
|
||||
lots: [],
|
||||
configName: '智慧工会疗休养配置',
|
||||
outsideQuota: null,
|
||||
outsideQuotaProportion: 0,
|
||||
outsideNumber: null,
|
||||
travelFrequency: null,
|
||||
groupNumber: null,
|
||||
modifyDays: null,
|
||||
modifyNumber: null,
|
||||
allLineSignUpNumber: null,
|
||||
notice: null,
|
||||
provinceStartYear: null,
|
||||
},
|
||||
formRules: {
|
||||
configName: [{required: true, message: '请填写配置名称', trigger: ['blur', 'change']}],
|
||||
isSnLine: [{required: true, message: '请选择省内线路是否需要审核', trigger: ['blur', 'change']}],
|
||||
isSwLine: [{required: true, message: '请选择省外线路是否需要审核', trigger: ['blur', 'change']}],
|
||||
outsideQuota: [{
|
||||
required: true,
|
||||
message: '请填写省外名额分配',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
outsideNumber: [{
|
||||
required: true,
|
||||
message: '请填写省外几年去一次',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
travelFrequency: [{
|
||||
required: true,
|
||||
message: '请填写每年旅行频率',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
groupNumber: [{
|
||||
required: true,
|
||||
message: '请填写组团人数',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
modifyDays: [{
|
||||
required: true,
|
||||
message: '请填写不可取消修改天数',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
modifyNumber: [{
|
||||
required: true,
|
||||
message: '请填写可以修改几次',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
outsideQuotaProportion: [{
|
||||
required: true,
|
||||
message: '请填写比例',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
allLineSignUpNumber: [{
|
||||
required: true,
|
||||
message: '请输入全批次最多报名人数',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
notice: [{required: true, message: '请输入详细内容', trigger: ['change', 'blur']}],
|
||||
provinceStartYear: [{required: true, message: '请输入省内起始年份', trigger: ['change', 'blur']}],
|
||||
|
||||
},
|
||||
marks: [],
|
||||
lotDeleteList: [],
|
||||
LineNameList:{},
|
||||
centerDialogVisible:false,
|
||||
tableScopeId:'',
|
||||
tableScopeIndex:'',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async deleteLotsRow(scope) {
|
||||
//this.lotDeleteList.push(scope.row.id);
|
||||
//console.log(this.lotDeleteList)
|
||||
const res = await $.get(loc() + '/getLotsById?lotId=' + scope.row.id)
|
||||
if (res.code===0) {
|
||||
this.LineNameList = res.data
|
||||
}
|
||||
if (!$.isEmptyObject(this.LineNameList)) {
|
||||
this.centerDialogVisible = true;
|
||||
this.tableScopeId=scope.row.id
|
||||
this.tableScopeIndex=scope.$index;
|
||||
}else {
|
||||
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm !== 'confirm') return
|
||||
this.tableScopeId=scope.row.id
|
||||
this.tableScopeIndex=scope.$index;
|
||||
await this.deleteLotById();
|
||||
}
|
||||
//this.formData.lots.splice(scope.$index, 1)
|
||||
},
|
||||
resetForm() {
|
||||
this.formData.lots = []
|
||||
if (this.$refs['addForm']) {
|
||||
this.$refs['addForm'].resetFields()
|
||||
}
|
||||
},
|
||||
async operation() {
|
||||
const valid = await this.$refs["addForm"].validate()
|
||||
if (valid) {
|
||||
this.subLoading = true
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
})
|
||||
const cloneData = clone(this.formData)
|
||||
|
||||
if (this.lotDeleteList && this.lotDeleteList.length > 0) {
|
||||
cloneData.lotDeleteList = JSON.stringify(this.lotDeleteList)
|
||||
}
|
||||
if (this.formData.lots && this.formData.lots.length > 0) {
|
||||
cloneData.lots = JSON.stringify(this.formData.lots)
|
||||
}
|
||||
cloneData.outsideQuotaProportion = cloneData.outsideQuotaProportion / 100
|
||||
const resp = await $.post(loc() + "/operation", cloneData)
|
||||
if (resp.code === 0){
|
||||
this.$notify.success({title: '成功', message: resp.msg});
|
||||
loading.close()
|
||||
this.subLoading = false
|
||||
}else {
|
||||
this.$notify.error({title: '失败', message: resp.msg});
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
async findOne() {
|
||||
await this.getActivityGroup()
|
||||
const {data} = await $.get(loc() + "/findOne")
|
||||
if (data.outsideQuotaProportion) {
|
||||
data.outsideQuotaProportion = data.outsideQuotaProportion * 1000 / 10
|
||||
}
|
||||
if (!data.lots) {
|
||||
data.lots = []
|
||||
}
|
||||
this.formData = data
|
||||
this.initLineContentEditor(data.notice)
|
||||
},
|
||||
async getActivityGroup() {
|
||||
const {data} = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
|
||||
this.activityGroupList = data
|
||||
},
|
||||
initLineContentEditor(content) {
|
||||
$("#lineContent").html("")
|
||||
lineContentEditor = new wangEditor("#lineContent")
|
||||
lineContentEditor.config.onchange = (html) => {
|
||||
this.formData.notice = html.replace(/<p\><\/p>/g, '')
|
||||
}
|
||||
lineContentEditor.config.uploadImgShowBase64 = true
|
||||
lineContentEditor.create()
|
||||
if (content) {
|
||||
lineContentEditor.txt.html(content)
|
||||
}
|
||||
},
|
||||
async closeDialog() {
|
||||
this.tableScopeIndex = '';
|
||||
this.tableScopeId = '';
|
||||
this.centerDialogVisible = false;
|
||||
this.LineNameList = {};
|
||||
},
|
||||
async deleteLotById() {
|
||||
if (this.tableScopeId == null || this.tableScopeId===''){
|
||||
this.formData.lots.splice(this.tableScopeIndex, 1);
|
||||
this.$notify.success({title: '成功', message: "操作成功"});
|
||||
return;
|
||||
}
|
||||
const resp = await $.get(loc() + '/deleteLotById?lotId=' + this.tableScopeId)
|
||||
if (resp.code===0){
|
||||
this.$notify.success({title: '成功', message: resp.msg});
|
||||
this.tableScopeId='';
|
||||
this.centerDialogVisible = false;
|
||||
this.formData.lots.splice(this.tableScopeIndex, 1)
|
||||
await this.findOne();
|
||||
}else {
|
||||
this.$notify.error({title: '失败', message: resp.msg});
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.findOne();
|
||||
this.initLineContentEditor();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user