This commit is contained in:
那些花儿
2025-05-29 15:59:22 +08:00
parent f976085cc0
commit 94db56a6d4
5 changed files with 1743 additions and 674 deletions
@@ -0,0 +1,186 @@
package io.v.nutz.zhgh.therapyRecuperation.controller.satisfactionEvaluate;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.therapyRecuperation.model.*;
import io.v.nutz.zhgh.therapyRecuperation.service.TheRapyRecuperationEnrollService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@IocBean
@At("/platform/theRapyRecuperation/satisfactionEvaluate")
@Ok("json:full")
public class TheRapyRecuperationSatisfactionEvaluateController {
@Inject
private Dao dao;
@Inject
private TheRapyRecuperationEnrollService enrollService;
@At("")
@Ok("beetl:/platform/theRapyRecuperation/satisfactionEvaluate/index.html")
@RequiresPermissions("theRapyRecuperation.satisfactionEvaluate")
public void index() {
}
@At
@RequiresPermissions("theRapyRecuperation.satisfactionEvaluate")
public Result pageData(PageForm pageForm) {
return Result.success();
}
/**
* 查询线路
* @param year
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.satisfactionEvaluate")
public Result listLines(Integer year) {
Sql sql = Sqls.create("""
SELECT
t2.id,
t2.lineName
FROM
`the_rapy_recuperation_line_union_select` t1
LEFT JOIN the_rapy_recuperation_line t2 ON t2.id = t1.lineId
WHERE
YEAR(selectTime) = @year
GROUP BY
t1.id
""");
sql.setParam("year", year);
List<NutMap> list = enrollService.listMap(sql);
return Result.success(list);
}
/**
* 查询线路的出行时间会有多条
* @param lineId
* @param year
* @return
*/
@At
@RequiresPermissions("theRapyRecuperation.satisfactionEvaluate")
public Result listTimeByLineId(String lineId, Integer year) {
Sql sql = Sqls.create("""
SELECT
concat(DATE_FORMAT(playStartTime, '%Y-%m-%d'), '至', DATE_FORMAT(playEndTime, '%Y-%m-%d')) AS label
FROM
`the_rapy_recuperation_line_union_select`
WHERE
lineId = @lineId
AND YEAR(selectTime) = @year
ORDER BY
playStartTime ASC
""");
sql.setParam("lineId",lineId);
sql.setParam("year", year);
List<NutMap> list = enrollService.listMap(sql);
return Result.success(list);
}
/**
* 提交评价
*/
@At
@RequiresAuthentication
public Result submit(TheRapyRecuperationSatisfactionEvaluate satisfactionEvaluate) {
satisfactionEvaluate.setEvaluateDate(new Date());
dao.insertOrUpdate(satisfactionEvaluate);
return Result.success();
}
/**
* 查看详情
*/
@At
@RequiresAuthentication
public Result detail() {
return Result.success();
}
/**
* 基础信息 旅行社、时间等等
*
* @param enrollId 报名id
* @return
*/
@At
@RequiresAuthentication
public Result basicInfo(String enrollId) {
NutMap result = new NutMap();
TheRapyRecuperationEnroll enroll = dao.fetch(TheRapyRecuperationEnroll.class, enrollId);
result.put("enrollId", enroll.getId());
result.put("userName", enroll.getUserName());
result.put("loginName", enroll.getLoginName());
result.put("mobile", ((Sys_user) Objects.requireNonNull(ShiroUtil.getPrincipal())).getMobile());
if (StrUtil.isNotBlank(enroll.getTakePartInLineId())) {
// 参加的线路
TheRapyRecuperationLineUnionSelect selectLine = dao.fetch(TheRapyRecuperationLineUnionSelect.class, enroll.getTakePartInLineId());
TheRapyRecuperationLine line = dao.fetch(TheRapyRecuperationLine.class, selectLine.getLineId());
TheRapyRecuperationTravelAgency travelAgency = dao.fetch(TheRapyRecuperationTravelAgency.class, line.getTravelAgencyId());
int teaNum = dao.count(TheRapyRecuperationEnroll.class, Cnd.where("takePartInLineId", "=", enroll.getTakePartInLineId()));
result.put("teaNum", teaNum);
result.put("selectLineId", selectLine.getId());
result.put("lineId", line.getId());
result.put("lineName", line.getLineName());
result.put("travelAgencyPlace", line.getTravelAgencyPlace());
result.put("travelAgencyName", travelAgency.getTravelAgencyName());
result.put("playStartTime", selectLine.getPlayStartTime());
result.put("playEndTime", selectLine.getPlayEndTime());
} else if (StrUtil.isNotBlank(enroll.getTakePartInBaseManagementId())) {
// 参加的酒店
TheRapyRecuperationBaseManagement hotel = dao.fetch(TheRapyRecuperationBaseManagement.class, enroll.getTakePartInBaseManagementId());
TheRapyRecuperationTravelAgency travelAgency = dao.fetch(TheRapyRecuperationTravelAgency.class, hotel.getTravelAgencyId());
int teaNum = dao.count(TheRapyRecuperationEnroll.class, Cnd.where("takePartInBaseManagementId", "=", enroll.getTakePartInBaseManagementId()));
result.put("teaNum", teaNum);
result.put("hotelId", hotel.getId());
result.put("travelAgencyName", travelAgency.getTravelAgencyName());
result.put("playStartTime", hotel.getActivityStartTime());
result.put("playEndTime", hotel.getActivityEndTime());
}
TheRapyRecuperationSatisfactionEvaluate evaluate = dao.fetch(TheRapyRecuperationSatisfactionEvaluate.class, Cnd.where("enrollId", "=", enrollId)
.and("loginName", "=", ShiroUtil.getPlatformLoginname()));
if (evaluate != null) {
result.putAll(BeanUtil.beanToMap(evaluate));
}
return Result.success(result);
}
}
@@ -0,0 +1,98 @@
package io.v.nutz.zhgh.therapyRecuperation.model;
import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
@EqualsAndHashCode(callSuper = true)
@Table
@Data
public class TheRapyRecuperationSatisfactionEvaluate extends BaseModel {
@Name
@Column
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("报名id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String enrollId;
@Column
@Comment("参加线路id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String selectLineId;
@Column
@Comment("线路id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String lineId;
@Column
@Comment("参加酒店id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String hotelId;
@Column
@Comment("姓名")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userName;
@Column
@Comment("工号")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String loginName;
@Column
@Comment("住宿条件得分")
@ColDefine(type = ColType.INT)
private Integer accommodationScore;
@Column
@Comment("餐饮条件得分")
@ColDefine(type = ColType.INT)
private Integer cateringScore;
@Column
@Comment("行程景点安排得分")
@ColDefine(type = ColType.INT)
private Integer travelScore;
@Column
@Comment("导游服务得分")
@ColDefine(type = ColType.INT)
private Integer guideScore;
@Column
@Comment("安全措施得分")
@ColDefine(type = ColType.INT)
private Integer safetyScore;
@Column
@Comment("总体评价及建议")
@ColDefine(type = ColType.VARCHAR, width = 1000)
private String evaluateText;
@Column
@Comment("评价时间")
@ColDefine(type = ColType.DATETIME)
private Date evaluateDate;
@Column
@Comment("联系电话")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String mobile;
@Column
@Comment("签名")
@ColDefine(type = ColType.TEXT)
private String signature;
}
@@ -1,45 +1,82 @@
<template> <template>
<div style="width: 100%"> <div style="width: 100%">
<van-image :src="imageUrl" v-if="!signDrawingBoardShow" <van-image
style="width: 100%;height: 150px;border: 1px dashed"></van-image> :src="imageUrl"
v-if="!signDrawingBoardShow"
style="width: 100%; height: 150px; border: 1px dashed"
></van-image>
<div style="text-align: right"> <div style="text-align: right">
<van-button plain type="danger" hairline size="small" @click="openSignDrawingBoard" native-type="button"> <van-button
plain
type="danger"
hairline
size="small"
@click="openSignDrawingBoard"
native-type="button"
>
打开签字版 打开签字版
</van-button> </van-button>
</div> </div>
<van-popup v-model="signDrawingBoardShow" position="bottom" :style="{ height: '60vh' }" get-container="body"> <van-popup
<div id="canvas" style="position: relative;width: 100%;height:calc(100% - 50px)"></div> v-model="signDrawingBoardShow"
<div class="button-extra" position="bottom"
style="height: 50px; :style="{ height: '60vh' }"
get-container="body"
>
<div
id="canvas"
style="position: relative; width: 100%; height: calc(100% - 50px)"
></div>
<div
class="button-extra"
style="
height: 50px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0 20px; padding: 0 20px;
column-gap:20px"> column-gap: 20px;
<van-button plain type="danger" block hairline @click="reset" native-type="button">清空重签</van-button> "
<van-button plain type="primary" block hairline @click="confirm" native-type="button">确定</van-button> >
<van-button
plain
type="danger"
block
hairline
@click="reset"
native-type="button"
>清空重签</van-button
>
<van-button
plain
type="primary"
block
hairline
@click="confirm"
native-type="button"
>确定</van-button
>
</div> </div>
</van-popup> </van-popup>
</div> </div>
</template> </template>
<script> <script>
module.exports = { module.exports = {
props: { props: {
my_sign: { my_sign: {
type: String type: String,
}, },
value: { value: {
type: String type: String,
}, },
is_value_base64: { is_value_base64: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
prefix: { prefix: {
type: String, type: String,
default: '' default: "",
}, },
}, },
data() { data() {
@@ -47,105 +84,104 @@ module.exports = {
signDrawingBoardShow: false, signDrawingBoardShow: false,
signData: null, signData: null,
imageUrl: "", imageUrl: "",
} };
}, },
watch: { watch: {
value: { value: {
handler: function (val) { handler: function (val) {
if (val) { if (val) {
this.getImageUrl(val) this.getImageUrl(val);
} }
}, },
immediate: true immediate: true,
} },
}, },
methods: { methods: {
//打开签字画板 //打开签字画板
openSignDrawingBoard() { openSignDrawingBoard() {
this.signDrawingBoardShow = true this.signDrawingBoardShow = true;
this.$nextTick(() => { this.$nextTick(() => {
// 删除之前的canvas // 删除之前的canvas
$("#canvas").empty() $("#canvas").empty();
$("#canvas").jSignature({ $("#canvas").jSignature({
width: '100%', width: "100%",
height: '100%', height: "100%",
"decor-color": "transparent", "decor-color": "transparent",
lineWidth: '3' lineWidth: "3",
}) });
}) });
}, },
reset() { reset() {
$('#canvas').jSignature('reset') $("#canvas").jSignature("reset");
this.$emit("update:my_sign", null) this.$emit("update:my_sign", null);
}, },
confirm() { confirm() {
const isNull = $('#canvas').jSignature('getData', 'native').length === 0 const isNull = $("#canvas").jSignature("getData", "native").length === 0;
if (isNull) { if (isNull) {
this.$modal.msgError("请签字后再确定") this.$modal.msgError("请签字后再确定");
return return;
} }
this.signData = $('#canvas').jSignature('getData') this.signData = $("#canvas").jSignature("getData");
this.signDrawingBoardShow = false this.signDrawingBoardShow = false;
this.uploadSignData() this.uploadSignData();
}, },
async uploadSignData() { async uploadSignData() {
if (this.is_value_base64) { if (this.is_value_base64) {
this.$emit('input', this.signData) this.$emit("input", this.signData);
this.$emit("update:my_sign", this.signData) this.$emit("update:my_sign", this.signData);
this.getImageUrl(this.signData) this.getImageUrl(this.signData);
} else { } else {
const {data, code, msg} = await $.post('/signature/uploadSignData', {data: this.signData}) const { data, code, msg } = await $.post("/signature/uploadSignData", {
data: this.signData,
});
if (code === 0) { if (code === 0) {
console.log(data) console.log(data);
this.getImageUrl(data) this.getImageUrl(data);
this.$emit('input', data) this.$emit("input", data);
this.$emit("update:my_sign", data) this.$emit("update:my_sign", data);
} else { } else {
this.$modal.msgError(msg) this.$modal.msgError(msg);
} }
} }
}, },
getImageUrl(value) { getImageUrl(value) {
if (this.is_value_base64) { if (this.is_value_base64) {
this.imageUrl = value this.imageUrl = value;
} else { } else {
this.imageUrl = '/signature/getSignData?path=' + value this.imageUrl = "/signature/getSignData?path=" + value;
} }
this.$emit('input', value) this.$emit("input", value);
}, },
checkNull() { checkNull() {
return $('#canvas').jSignature('getData', 'native').length === 0 return $("#canvas").jSignature("getData", "native").length === 0;
}, },
submitSign() { submitSign() {
this.$emit("update:my_sign", $('#canvas').jSignature('getData')) this.$emit("update:my_sign", $("#canvas").jSignature("getData"));
}, },
async updateSign() { async updateSign() {
const data = await $.post("/mobile/common/signing/update", { const data = await $.post("/mobile/common/signing/update", {
sign: $('#canvas').jSignature('getData'), sign: $("#canvas").jSignature("getData"),
prefix: this.prefix prefix: this.prefix,
}) });
}, },
async getMySign() { async getMySign() {
const data = await $.get("/mobile/common/signing/getMySign", {prefix: this.prefix}) const data = await $.get("/mobile/common/signing/getMySign", {
prefix: this.prefix,
});
if (data) { if (data) {
this.getImageUrl(data) this.getImageUrl(data);
}
} }
}, },
},
created() { created() {
this.getMySign() this.getMySign();
}, },
async mounted() { async mounted() {},
};
}
}
</script> </script>
<style scoped> <style scoped>
.clearBtn { .clearBtn {
position: absolute !important; position: absolute !important;
@@ -171,5 +207,4 @@ module.exports = {
.button-extra button { .button-extra button {
width: 40%; width: 40%;
} }
</style> </style>
@@ -0,0 +1,589 @@
const SatisfactionEvaluate = {
template: /*language=HTML*/ `
<div class="satisfaction-wrapper" v-show="show">
<div class="satisfaction-header">
<span class="title">满意度调查</span>
<span class="close-btn" @click="show = false">×</span>
</div>
<div class="satisfaction-content">
<form @submit.prevent="onSubmit">
<h2 class="form-title">疗休养满意度评价表</h2>
<div class="form-row">
<div class="form-label">疗休养服务单位:</div>
<div class="form-text">{{formData.travelAgencyName}}</div>
</div>
<div class="form-row">
<div class="form-label">疗休养地点:</div>
<div class="form-text">{{formData.travelAgencyPlace}}</div>
</div>
<div class="form-row">
<div class="form-label">教职工人数:</div>
<div class="form-text">{{formData.teaNum}}</div>
</div>
<div class="form-row">
<div class="form-label">疗休养时间:</div>
<div class="form-text" v-if="formData.playStartTime && formData.playEndTime">
{{moment(formData.playStartTime).format('YYYY年MM月DD日')}}
{{moment(formData.playEndTime).format('MM月DD日')}}
</div>
</div>
<div class="form-section">
<div class="section-title">评分项目及分值(100分)</div>
<div class="evaluation-desc">满意度评价(请您在认为的选项后空格内评分)</div>
<table class="score-table">
<thead>
<tr>
<th class="item-column">评分项目</th>
<th>好</th>
<th>较好</th>
<th>一般</th>
<th>差</th>
<th class="score-column">分数</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in currentEvaluationItems" :key="index">
<td class="item-name">{{item.title}}{{item.maxScore}}分)</td>
<td
v-for="(option, idx) in item.options"
:key="idx"
class="option-cell"
:class="{'selected': getScoreLevel(formData[item.field], item) === idx}"
@click="selectOption(index, idx)"
>
{{option.range}}
</td>
<td class="score-cell">
<input
type="number"
v-model.number="formData[item.field]"
:max="item.maxScore"
min="0"
required
@input="validateScore($event, item)"
>
</td>
</tr>
<tr class="total-row">
<td colspan="5" class="total-label">合计得分</td>
<td class="total-value">{{totalScore}}</td>
</tr>
</tbody>
</table>
</div>
<div class="form-section">
<div class="section-title">对本次疗休养的整体评价及建议</div>
<textarea
v-model="formData.evaluateText"
class="feedback-textarea"
placeholder="请输入您的评价和建议"
required
rows="4"
></textarea>
</div>
<div class="form-section">
<div class="form-row">
<div class="form-label">本人姓名:</div>
<div class="form-input">
<input type="text" v-model="formData.userName" readonly required placeholder="请输入姓名">
</div>
</div>
<div class="form-row">
<div class="form-label">联系电话:</div>
<div class="form-input">
<input type="tel" v-model="formData.mobile" required placeholder="请输入电话">
</div>
</div>
<div class="form-row signature-row" v-if="show">
<div class="form-label">签名:</div>
<div class="form-input">
<mobile-sign ref="signature" :is_value_base64="false" v-model="formData.signature"></mobile-sign>
</div>
</div>
</div>
<div class="note-box">
<div>注:</div>
<div>1. 请在相应栏目中写上具体分数并合计得分。</div>
<div>2. 得分90分(含)以上为满意,80分(含)-90分为合格,80分以下为不合格。</div>
<div>3. 此表须由每团70%及以上的教职工(含领队)填写。</div>
</div>
<div class="submit-box">
<button type="submit" class="submit-btn">提交评价</button>
</div>
</form>
</div>
</div>
`,
data() {
return {
show: false,
enrollId: null,
formData: {},
evaluationItems: [
{
title: "住宿条件",
maxScore: 20,
field: "accommodationScore",
options: [
{ label: "好", range: "20-18" },
{ label: "较好", range: "17-16" },
{ label: "一般", range: "15-12" },
{ label: "差", range: "<12" },
],
},
{
title: "餐饮状况",
maxScore: 20,
field: "cateringScore",
options: [
{ label: "好", range: "20-18" },
{ label: "较好", range: "17-16" },
{ label: "一般", range: "15-12" },
{ label: "差", range: "<12" },
],
},
{
title: "行程景点安排",
maxScore: 30,
field: "travelScore",
options: [
{ label: "好", range: "30-25" },
{ label: "较好", range: "24-20" },
{ label: "一般", range: "19-15" },
{ label: "差", range: "<15" },
],
},
{
title: "车辆状况和司机服务",
maxScore: 10,
field: "guideScore",
options: [
{ label: "好", range: "10-9" },
{ label: "较好", range: "8-7" },
{ label: "一般", range: "6-5" },
{ label: "差", range: "<5" },
],
},
{
title: "导游服务",
maxScore: 10,
field: "guideScore",
options: [
{ label: "好", range: "10-9" },
{ label: "较好", range: "8-7" },
{ label: "一般", range: "6-5" },
{ label: "差", range: "<5" },
],
},
{
title: "安全措施",
maxScore: 10,
field: "safetyScore",
options: [
{ label: "好", range: "10-9" },
{ label: "较好", range: "8-7" },
{ label: "一般", range: "6-5" },
{ label: "差", range: "<5" },
],
},
],
evaluationItemsType2: [
{
title: "住宿条件",
maxScore: 30,
field: "accommodationScore",
options: [
{ label: "好", range: "30-25" },
{ label: "较好", range: "24-20" },
{ label: "一般", range: "19-15" },
{ label: "差", range: "<15" },
],
},
{
title: "餐饮状况",
maxScore: 30,
field: "cateringScore",
options: [
{ label: "好", range: "30-25" },
{ label: "较好", range: "24-20" },
{ label: "一般", range: "19-15" },
{ label: "差", range: "<15" },
],
},
{
title: "行程景点安排",
maxScore: 30,
field: "travelScore",
options: [
{ label: "好", range: "30-25" },
{ label: "较好", range: "24-20" },
{ label: "一般", range: "19-15" },
{ label: "差", range: "<15" },
],
},
{
title: "安全措施",
maxScore: 10,
field: "safetyScore",
options: [
{ label: "好", range: "10-9" },
{ label: "较好", range: "8-7" },
{ label: "一般", range: "6-5" },
{ label: "差", range: "<5" },
],
},
],
};
},
computed: {
totalScore() {
return this.currentEvaluationItems.reduce((sum, item) => {
return sum + (Number(this.formData[item.field]) || 0);
}, 0);
},
currentEvaluationItems() {
return this.formData.type === 1
? this.evaluationItems
: this.evaluationItemsType2;
},
},
methods: {
onOpen(id) {
this.enrollId = id;
this.getBasicInfo();
this.show = true;
},
selectOption(itemIndex, optionIndex) {
const item = this.currentEvaluationItems[itemIndex];
const range = item.options[optionIndex].range;
if (range.includes("-")) {
const highScore = Number(range.split("-")[0]);
this.formData[item.field] = highScore;
} else if (range.includes("<")) {
const threshold = Number(range.replace("<", ""));
this.formData[item.field] = threshold - 1;
}
},
onSubmit() {
this.$dialog
.confirm({
title: "提示",
message: "您确定提交吗?",
})
.then(() => {
$.post(
"/platform/theRapyRecuperation/satisfactionEvaluate/submit",
this.formData,
).then((res) => {
if (res.code === 0) {
this.$toast.success("提交成功");
// this.show = false;
this.$emit("refresh");
} else {
this.$toast(res.msg);
}
});
});
},
getScoreLevel(score, item) {
if (!score && score !== 0) return -1;
const options = item.options;
// 从最低分的选项开始判断
for (let i = options.length - 1; i >= 0; i--) {
const range = options[i].range;
if (range.includes("<")) {
const threshold = Number(range.replace("<", ""));
if (score < threshold) {
return i;
}
} else if (range.includes("-")) {
const [max, min] = range.split("-").map(Number);
if (score >= min && score <= max) {
return i;
}
}
}
return -1;
},
validateScore(event, item) {
const value = Number(event.target.value);
if (isNaN(value)) {
this.formData[item.field] = 0;
return;
}
// 限制基本范围 0 到最大分值
if (value > item.maxScore) {
this.formData[item.field] = item.maxScore;
return;
} else if (value < 0) {
this.formData[item.field] = 0;
return;
}
// 根据分值自动选中对应等级
let selectedLevel = this.getScoreLevel(value, item);
if (selectedLevel === -1) {
// 如果没有找到对应等级,调整到最近的合法范围
const options = item.options;
for (let i = options.length - 1; i >= 0; i--) {
const range = options[i].range;
if (range.includes("<")) {
const threshold = Number(range.replace("<", ""));
if (value >= threshold) {
this.formData[item.field] = threshold - 1;
break;
}
} else if (range.includes("-")) {
const [max, min] = range.split("-").map(Number);
if (value > max) {
this.formData[item.field] = max;
break;
} else if (value < min) {
this.formData[item.field] = min;
break;
}
}
}
}
},
getBasicInfo() {
$.post("/platform/theRapyRecuperation/satisfactionEvaluate/basicInfo", {
enrollId: this.enrollId,
}).then((res) => {
if (res.code === 0) {
this.formData = res.data;
} else {
this.$toast(res.msg);
}
});
},
},
style: /*language=CSS*/ `
.satisfaction-wrapper {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #fff;
z-index: 999;
display: flex;
flex-direction: column;
}
.satisfaction-header {
height: 44px;
line-height: 44px;
background-color: #1867b0;
color: white;
text-align: center;
position: relative;
font-size: 16px;
}
.title {
font-weight: bold;
}
.close-btn {
position: absolute;
right: 15px;
top: 0;
font-size: 24px;
cursor: pointer;
}
.satisfaction-content {
flex: 1;
overflow-y: auto;
padding: 0 12px 20px;
}
.form-title {
text-align: center;
font-size: 18px;
margin: 15px 0;
font-weight: normal;
}
.form-row {
display: flex;
padding: 8px 0;
border-bottom: 1px solid #eee;
align-items: center;
}
.form-row.signature-row {
flex-direction: column;
align-items: flex-start;
padding: 15px 0;
}
.form-row.signature-row .form-label {
width: 100%;
margin-bottom: 10px;
}
.form-row.signature-row .form-input {
width: 100%;
}
.form-label {
width: 130px;
padding-right: 10px;
line-height: 38px;
color: #333;
}
.form-input {
flex: 1;
}
.form-input input {
width: 100%;
border: none;
outline: none;
font-size: 15px;
}
.form-section {
margin: 15px 0;
}
.section-title {
font-size: 16px;
font-weight: bold;
margin: 15px 0 5px 0;
color: #333;
border-left: 3px solid #1867b0;
padding-left: 8px;
}
.evaluation-desc {
font-size: 14px;
color: #666;
margin-bottom: 10px;
}
.score-table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
font-size: 14px;
}
.score-table th, .score-table td {
border: 1px solid #ddd;
padding: 8px 4px;
text-align: center;
}
.score-table th {
background-color: #f5f7fa;
font-weight: normal;
}
.item-column {
width: 30%;
text-align: left;
padding-left: 8px !important;
}
.score-column {
width: 15%;
}
.item-name {
text-align: left;
padding-left: 8px !important;
}
.option-cell {
cursor: pointer;
}
.option-cell.selected {
background-color: #edf4ff;
color: #1867b0;
}
.score-cell input {
width: 100%;
text-align: center;
border: none;
outline: none;
height: 32px;
}
.total-row {
font-weight: bold;
}
.total-label {
text-align: right !important;
padding-right: 8px !important;
}
.total-value {
color: #f56c6c;
}
.feedback-textarea {
width: 100%;
border: 1px solid #ddd;
padding: 8px;
font-size: 14px;
resize: vertical;
outline: none;
box-sizing: border-box;
min-height: 200px;
}
.note-box {
background-color: #f9f9f9;
padding: 10px;
font-size: 13px;
color: #666;
line-height: 1.5;
margin: 15px 0;
}
.submit-box {
margin: 20px 0;
text-align: center;
}
.submit-btn {
background-color: #1867b0;
color: white;
border: none;
width: 100%;
height: 40px;
font-size: 16px;
outline: none;
}
.form-text {
flex: 1;
font-size: 15px;
color: #333;
line-height: 38px;
}
`,
};
@@ -2,7 +2,6 @@
layout("/mobile/platform.html"){ layout("/mobile/platform.html"){
#--> #-->
<style> <style>
.van-doc-card { .van-doc-card {
margin: 10px; margin: 10px;
padding: 12px 12px 12px 12px; padding: 12px 12px 12px 12px;
@@ -60,7 +59,9 @@ layout("/mobile/platform.html"){
margin-top: 6px; margin-top: 6px;
} }
.concat, .mobile, .union { .concat,
.mobile,
.union {
font-size: 13px; font-size: 13px;
line-height: 18px; line-height: 18px;
width: 100%; width: 100%;
@@ -221,32 +222,44 @@ layout("/mobile/platform.html"){
} }
.evaluate_active { .evaluate_active {
background-color: #07C160; background-color: #07c160;
color: white; color: white;
border-color: #07C160; border-color: #07c160;
} }
</style> </style>
<div id="app" v-cloak> <div id="app" v-cloak>
<van-sticky> <van-sticky>
<van-nav-bar @click-left="pjaxReplace('/mobile/index')" fixed left-arrow placeholder <van-nav-bar
title="我的疗休养"></van-nav-bar> @click-left="pjaxReplace('/mobile/index')"
fixed
left-arrow
placeholder
title="我的疗休养"
></van-nav-bar>
</van-sticky> </van-sticky>
<van-dropdown-menu> <van-dropdown-menu>
<van-dropdown-item v-model="pageForm.year" :options="yearArray" <van-dropdown-item
@change="doSearch"></van-dropdown-item> v-model="pageForm.year"
:options="yearArray"
@change="doSearch"
></van-dropdown-item>
</van-dropdown-menu> </van-dropdown-menu>
<!--按钮导航--> <!--按钮导航-->
<div class="choose_button van-doc-card"> <div class="choose_button van-doc-card">
<van-grid :column-num="chooseButton.length" :border="false"> <van-grid :column-num="chooseButton.length" :border="false">
<van-grid-item @click="pageForm.theRapyRecuperationType = item.value;doSearch()" <van-grid-item
v-for="item in chooseButton"> @click="pageForm.theRapyRecuperationType = item.value;doSearch()"
v-for="item in chooseButton"
>
<van-image width="46" height="46" :src="item.imgUrl"></van-image> <van-image width="46" height="46" :src="item.imgUrl"></van-image>
<div :style="pageForm.theRapyRecuperationType == item.value ? 'color: #1867b0; font-weight: bold' : 'color: black; font-weight: normal'" <div
class="button_text">{{item.label}} :style="pageForm.theRapyRecuperationType == item.value ? 'color: #1867b0; font-weight: bold' : 'color: black; font-weight: normal'"
class="button_text"
>
{{item.label}}
</div> </div>
</van-grid-item> </van-grid-item>
</van-grid> </van-grid>
@@ -254,9 +267,21 @@ layout("/mobile/platform.html"){
<van-divider></van-divider> <van-divider></van-divider>
<div class="footer"> <div class="footer">
<van-button @click="pageForm.signUpStateId = 1; getData()" :class="pageForm.signUpStateId == 1 ? 'active' : 'no_active'">已报名</van-button> <van-button
<van-button @click="pageForm.signUpStateId = 2; getData()" :class="pageForm.signUpStateId == 2 ? 'active' : 'no_active'">已参加</van-button> @click="pageForm.signUpStateId = 1; getData()"
<van-button @click="pageForm.signUpStateId = 3; getData()" :class="pageForm.signUpStateId == 3 ? 'active' : 'no_active'">未参加</van-button> :class="pageForm.signUpStateId == 1 ? 'active' : 'no_active'"
>已报名</van-button
>
<van-button
@click="pageForm.signUpStateId = 2; getData()"
:class="pageForm.signUpStateId == 2 ? 'active' : 'no_active'"
>已参加</van-button
>
<van-button
@click="pageForm.signUpStateId = 3; getData()"
:class="pageForm.signUpStateId == 3 ? 'active' : 'no_active'"
>未参加</van-button
>
</div> </div>
</div> </div>
@@ -264,10 +289,10 @@ layout("/mobile/platform.html"){
:finished="finished" :finished="finished"
:immediate-check="true" :immediate-check="true"
finished-text="没有更多了" finished-text="没有更多了"
v-model="loading"> v-model="loading"
>
<div class="list-card" v-for="o in tableData"> <div class="list-card" v-for="o in tableData">
<div @click="findOne(o)" class="content"> <div @click="findOne(o)" class="content">
<van-image <van-image
height="100" height="100"
radius="8" radius="8"
@@ -275,14 +300,16 @@ layout("/mobile/platform.html"){
width="150" width="150"
></van-image> ></van-image>
<div v-if="pageForm.theRapyRecuperationType != '2' && pageForm.theRapyRecuperationType != '3'" <div
class="content-right"> v-if="pageForm.theRapyRecuperationType != '2' && pageForm.theRapyRecuperationType != '3'"
class="content-right"
>
<div class="cr-title"> <div class="cr-title">
<span>{{o.lineName}}</span> <span>{{o.lineName}}</span>
<div> <div>
<van-tag color="#1867b0">{{o.lotName}}</van-tag> <van-tag color="#1867b0">{{o.lotName}}</van-tag>
<van-tag color="#1867b0">{{o.signUpMode === 2 ? '校工会' : <van-tag color="#1867b0"
o.signUpUnionName}} >{{o.signUpMode === 2 ? '校工会' : o.signUpUnionName}}
</van-tag> </van-tag>
</div> </div>
</div> </div>
@@ -303,24 +330,26 @@ layout("/mobile/platform.html"){
<span>联系方式:</span>{{o.contactMobileNumber}} <span>联系方式:</span>{{o.contactMobileNumber}}
</div> </div>
<div class="mobile" v-if="![2715,2725,2735].includes(o.stateId)"> <div class="mobile" v-if="![2715,2725,2735].includes(o.stateId)">
<span v-if="configData.familyInfo === 1">随行家属:</span>{{o.companionUserNames ? o.companionUserNames : '无'}} <span v-if="configData.familyInfo === 1">随行家属:</span
>{{o.companionUserNames ? o.companionUserNames : '无'}}
<span v-else>随行家属:</span>{{o.familyNumber}}人 <span v-else>随行家属:</span>{{o.familyNumber}}人
</div> </div>
<div class="mobile" v-else> <div class="mobile" v-else>
<span>审核状态:</span><span :style="'color: ' + o.stateColor">{{o.stateName}}</span> <span>审核状态:</span
><span :style="'color: ' + o.stateColor">{{o.stateName}}</span>
</div> </div>
</div> </div>
</div> </div>
<div v-if="pageForm.theRapyRecuperationType == '2'" class="content-right"> <div
v-if="pageForm.theRapyRecuperationType == '2'"
class="content-right"
>
<div class="cr-title"> <div class="cr-title">
<span>{{o.travelAgencyName}}</span> <span>{{o.travelAgencyName}}</span>
</div> </div>
<div> <div>
<div class="concat"><span>联系人:</span>{{o.contact}}</div>
<div class="concat">
<span>联系人:</span>{{o.contact}}
</div>
<div class="mobile"> <div class="mobile">
<span>联系电话:</span>{{o.contactMobileNumber}} <span>联系电话:</span>{{o.contactMobileNumber}}
</div> </div>
@@ -328,13 +357,20 @@ layout("/mobile/platform.html"){
<span>邮箱:</span>{{o.email}} <span>邮箱:</span>{{o.email}}
</div>--> </div>-->
<div class="union" style="margin-top: 0"> <div class="union" style="margin-top: 0">
<span>官网:</span><span style="color: #0e5996" <span>官网:</span
@click.stop="window.open(o.officialWebsite.indexOf('http') !== -1 ? o.officialWebsite : 'https://' + o.officialWebsite)">{{o.officialWebsite}}</span> ><span
style="color: #0e5996"
@click.stop="window.open(o.officialWebsite.indexOf('http') !== -1 ? o.officialWebsite : 'https://' + o.officialWebsite)"
>{{o.officialWebsite}}</span
>
</div> </div>
</div> </div>
</div> </div>
<div v-if="pageForm.theRapyRecuperationType == '3'" class="content-right"> <div
v-if="pageForm.theRapyRecuperationType == '3'"
class="content-right"
>
<div class="cr-title"> <div class="cr-title">
<span>{{o.baseName}}</span> <span>{{o.baseName}}</span>
<div> <div>
@@ -354,45 +390,81 @@ layout("/mobile/platform.html"){
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="operateDiv"> <div class="operateDiv">
<van-button v-if="pageForm.signUpStateId == 2" @click="openEvaluate(o)" type="info" size="small" color="#1867b0"> <van-button
v-if="pageForm.signUpStateId == 2"
@click="openEvaluate(o)"
type="info"
size="small"
color="#1867b0"
>
&ensp; &ensp;
</van-button> </van-button>
<van-button v-if="pageForm.theRapyRecuperationType != '2' && moment().unix() < moment(o.changeEndTime).unix() <van-button
&& ![2715,2725,2735].includes(o.stateId)" @click="edit(o)" v-if="pageForm.theRapyRecuperationType != '2' && moment().unix() < moment(o.changeEndTime).unix()
type="info" size="small" color="#1867b0" :disabled="o.isTakePartIn == true || getDisabled(o)"> && ![2715,2725,2735].includes(o.stateId)"
@click="edit(o)"
type="info"
size="small"
color="#1867b0"
:disabled="o.isTakePartIn == true || getDisabled(o)"
>
&ensp; &ensp;
</van-button> </van-button>
<van-button type="info" size="small" color="#1867b0" @click="cancel(o)" <van-button
:disabled="getDisabled(o)"> type="info"
size="small"
color="#1867b0"
@click="cancel(o)"
:disabled="getDisabled(o)"
>
&ensp; &ensp;
</van-button> </van-button>
<!--<van-button v-if="o.isTakePartIn == true" type="info" size="small" color="#1867b0" <!--<van-button v-if="o.isTakePartIn == true" type="info" size="small" color="#1867b0"
@click="satisfaction(o)">满意度反馈</van-button>--> @click="satisfaction(o)">满意度反馈</van-button>-->
</div> </div>
</div> </div>
</van-list> </van-list>
<van-popup class="popVisible" position="right" v-model="popVisible"> <van-popup class="popVisible" position="right" v-model="popVisible">
<van-nav-bar @click-left="popVisible = false" fixed left-arrow placeholder title="满意度评分"></van-nav-bar> <van-nav-bar
@click-left="popVisible = false"
fixed
left-arrow
placeholder
title="满意度评分"
></van-nav-bar>
<div class="cus_content"> <div class="cus_content">
<van-field name="rate" label="旅行社评分"> <van-field name="rate" label="旅行社评分">
<template #input> <template #input>
<van-rate v-model="satisfactionForm.evaluationForTravelAgency" allow-half void-icon="star" color="#ffd21e"></van-rate> <van-rate
v-model="satisfactionForm.evaluationForTravelAgency"
allow-half
void-icon="star"
color="#ffd21e"
></van-rate>
</template> </template>
</van-field> </van-field>
<van-field name="rate" label="路线评分"> <van-field name="rate" label="路线评分">
<template #input> <template #input>
<van-rate v-model="satisfactionForm.evaluationForLine" allow-half void-icon="star" color="#ffd21e"></van-rate> <van-rate
v-model="satisfactionForm.evaluationForLine"
allow-half
void-icon="star"
color="#ffd21e"
></van-rate>
</template> </template>
</van-field> </van-field>
<van-field name="rate" label="风景评分"> <van-field name="rate" label="风景评分">
<template #input> <template #input>
<van-rate v-model="satisfactionForm.evaluationForJourney" allow-half void-icon="star" color="#ffd21e"></van-rate> <van-rate
v-model="satisfactionForm.evaluationForJourney"
allow-half
void-icon="star"
color="#ffd21e"
></van-rate>
</template> </template>
</van-field> </van-field>
<van-field <van-field
@@ -403,29 +475,60 @@ layout("/mobile/platform.html"){
type="textarea" type="textarea"
maxlength="100" maxlength="100"
placeholder="请输入其他建议" placeholder="请输入其他建议"
show-word-limit> show-word-limit
>
</van-field> </van-field>
</div> </div>
<div class="pop_footer"> <div class="pop_footer">
<van-button @click="satisfactionSubmit" class="cus_button">提交评分</van-button> <van-button @click="satisfactionSubmit" class="cus_button"
>提交评分</van-button
>
</div> </div>
</van-popup> </van-popup>
<van-action-sheet title="参加体验评价" v-model="evaluatePopup"> <van-action-sheet title="参加体验评价" v-model="evaluatePopup">
<div class="evaluateForm"> <div class="evaluateForm">
<div
<div style="text-align: center;margin: 20px 0;font-size: 20px;color: #f18d8d;font-weight: bold;"> style="
text-align: center;
margin: 20px 0;
font-size: 20px;
color: #f18d8d;
font-weight: bold;
"
>
您的评价让我们做的更好 您的评价让我们做的更好
</div> </div>
<div style="display: flex;justify-content: center;flex-direction: column;align-items: center"> <div
<div style="text-align: center;font-size: 13px;color: rgb(139 134 134); margin-bottom: 10px">为本次疗休养打分 style="
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
"
>
<div
style="
text-align: center;
font-size: 13px;
color: rgb(139 134 134);
margin-bottom: 10px;
"
>
为本次疗休养打分
</div> </div>
<div class="evaluate_item_content"> <div class="evaluate_item_content">
<div class="evaluate_item" @click="evaluateClick('满意', 1)">满意</div> <div class="evaluate_item" @click="evaluateClick('满意', 1)">
<div class="evaluate_item" @click="evaluateClick('一般', 2)">一般</div> 满意
<div class="evaluate_item" @click="evaluateClick('不满意', 3)">不满意</div> </div>
<div class="evaluate_item" @click="evaluateClick('一般', 2)">
一般
</div>
<div class="evaluate_item" @click="evaluateClick('不满意', 3)">
不满意
</div>
</div> </div>
</div> </div>
@@ -444,16 +547,16 @@ layout("/mobile/platform.html"){
</van-field> </van-field>
</div> </div>
<div style="padding: 10px 16px"> <div style="padding: 10px 16px">
<van-button @click="doSubmitEvaluate" <van-button @click="doSubmitEvaluate" block type="primary"
block
type="primary"
>提交 >提交
</van-button> </van-button>
</div> </div>
</van-action-sheet> </van-action-sheet>
<satisfaction-evaluate ref="satisfactionEvaluateRef"></satisfaction-evaluate>
</div> </div>
<script> <script>
<!--#include('SatisfactionEvaluate.js'){}#-->
function getQueryString(name) { function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
@@ -463,8 +566,11 @@ layout("/mobile/platform.html"){
} }
const vue = new Vue({ const vue = new Vue({
el: '#app', el: "#app",
mixins: [mobileMixins], mixins: [mobileMixins],
components: {
"satisfaction-evaluate": SatisfactionEvaluate,
},
data() { data() {
return { return {
evaluateFormData: {}, evaluateFormData: {},
@@ -482,200 +588,255 @@ layout("/mobile/platform.html"){
refreshing: false, refreshing: false,
satisfactionForm: {}, satisfactionForm: {},
configData: {}, configData: {},
} };
}, },
methods: { methods: {
async openEvaluate(o) { async openEvaluate(o) {
if (o.isTakePartIn === false) { if (o.isTakePartIn === false) {
this.$modal.msg("参加后才能评价") this.$modal.msg("参加后才能评价");
return return;
} }
await this.finOneEvaluate(o.takePartInLineId)
this.evaluatePopup = true this.$refs.satisfactionEvaluateRef.onOpen(o.id);
this.$nextTick(() => {
let score = 1 // await this.finOneEvaluate(o.takePartInLineId);
if (this.evaluateFormData.evaluateScore === '满意') { // this.evaluatePopup = true;
score = 1 // this.$nextTick(() => {
} else if (this.evaluateFormData.evaluateScore === '一般') { // let score = 1;
score = 2 // if (this.evaluateFormData.evaluateScore === "满意") {
} else if (this.evaluateFormData.evaluateScore === '不满意') { // score = 1;
score = 3 // } else if (this.evaluateFormData.evaluateScore === "一般") {
} // score = 2;
this.evaluateClick(this.evaluateFormData.evaluateScore, score) // } else if (this.evaluateFormData.evaluateScore === "不满意") {
}) // score = 3;
// }
// this.evaluateClick(this.evaluateFormData.evaluateScore, score);
// });
}, },
evaluateClick(value, index) { evaluateClick(value, index) {
this.evaluateFormData.evaluateScore = value this.evaluateFormData.evaluateScore = value;
const elements = document.querySelectorAll('.evaluate_item') const elements = document.querySelectorAll(".evaluate_item");
for (let i = 0; i < elements.length; i++) { for (let i = 0; i < elements.length; i++) {
if(index === (i + 1)) { if (index === i + 1) {
elements[i].classList.add('evaluate_active') elements[i].classList.add("evaluate_active");
} else { } else {
elements[i].classList.remove('evaluate_active') elements[i].classList.remove("evaluate_active");
} }
} }
}, },
async finOneEvaluate(lineId) { async finOneEvaluate(lineId) {
const {data, code, msg} = await $.post("/platform/theRapyRecuperation/line/enroll/finOneEvaluate", { const { data, code, msg } = await $.post(
"/platform/theRapyRecuperation/line/enroll/finOneEvaluate",
{
lineId: lineId, lineId: lineId,
}) },
);
if (code === 0) { if (code === 0) {
if (data) { if (data) {
this.evaluateFormData = data this.evaluateFormData = data;
} else { } else {
this.evaluateFormData = {lineId: lineId} this.evaluateFormData = { lineId: lineId };
} }
} else { } else {
this.$message.warning(msg) this.$message.warning(msg);
} }
}, },
async doSubmitEvaluate() { async doSubmitEvaluate() {
if (!this.evaluateFormData.evaluateScore) { if (!this.evaluateFormData.evaluateScore) {
this.$modal.msg("请为本次疗休养评分") this.$modal.msg("请为本次疗休养评分");
return return;
} }
const {code, data, msg} = await $.post('/platform/theRapyRecuperation/line/enroll/doEvaluate', this.evaluateFormData) const { code, data, msg } = await $.post(
"/platform/theRapyRecuperation/line/enroll/doEvaluate",
this.evaluateFormData,
);
if (code === 0) { if (code === 0) {
this.$modal.msgSuccess("评价成功") this.$modal.msgSuccess("评价成功");
this.evaluatePopup = false this.evaluatePopup = false;
} else { } else {
this.$modal.msgError(msg) this.$modal.msgError(msg);
} }
}, },
getDisabled(o) { getDisabled(o) {
if(o.regionalNature === '省内') { if (o.regionalNature === "省内") {
return this.configData.isSnLine && o.stateId === 2750 return this.configData.isSnLine && o.stateId === 2750;
} }
if(o.regionalNature === '省外') { if (o.regionalNature === "省外") {
return this.configData.isSwLine && o.stateId === 2750 return this.configData.isSwLine && o.stateId === 2750;
} }
return true return true;
}, },
doSearch() { doSearch() {
this.loading = true this.loading = true;
this.finished = false this.finished = false;
this.getData() this.getData();
}, },
satisfaction(o) { satisfaction(o) {
this.satisfactionForm = { this.satisfactionForm = {
id: o.id, id: o.id,
evaluationForJourney: o.evaluationForJourney ? o.evaluationForJourney * 1 : '', evaluationForJourney: o.evaluationForJourney
evaluationForLine: o.evaluationForLine ? o.evaluationForLine * 1 : '', ? o.evaluationForJourney * 1
evaluationForTravelAgency: o.evaluationForTravelAgency ? o.evaluationForTravelAgency * 1 : '', : "",
feedbackContent: o.feedbackContent ? o.feedbackContent : '', evaluationForLine: o.evaluationForLine ? o.evaluationForLine * 1 : "",
} evaluationForTravelAgency: o.evaluationForTravelAgency
this.popVisible = true ? o.evaluationForTravelAgency * 1
: "",
feedbackContent: o.feedbackContent ? o.feedbackContent : "",
};
this.popVisible = true;
}, },
async satisfactionSubmit() { async satisfactionSubmit() {
for (const key in this.satisfactionForm) { for (const key in this.satisfactionForm) {
if(key !== 'feedbackContent' && this.satisfactionForm[key] === '') { if (key !== "feedbackContent" && this.satisfactionForm[key] === "") {
vant.Toast('请先评分再提交') vant.Toast("请先评分再提交");
return return;
} }
} }
const res = await $.post('/platform/theRapyRecuperation/line/enroll/doFeedBack', this.satisfactionForm) const res = await $.post(
"/platform/theRapyRecuperation/line/enroll/doFeedBack",
this.satisfactionForm,
);
if (res.code === 0) { if (res.code === 0) {
this.popVisible = false this.popVisible = false;
vant.Toast('操作成功') vant.Toast("操作成功");
this.getData() this.getData();
} else { } else {
vant.Toast(res.msg) vant.Toast(res.msg);
} }
}, },
async edit(o) { async edit(o) {
if (this.pageForm.theRapyRecuperationType != '2' && this.pageForm.theRapyRecuperationType != '3') { if (
const res = await $.post('/platform/theRapyRecuperation/line/enroll/validSignUpInfo', { this.pageForm.theRapyRecuperationType != "2" &&
this.pageForm.theRapyRecuperationType != "3"
) {
const res = await $.post(
"/platform/theRapyRecuperation/line/enroll/validSignUpInfo",
{
enroll: JSON.stringify({ enroll: JSON.stringify({
takePartInLineId: o.takePartInLineId, takePartInLineId: o.takePartInLineId,
id: o.id, id: o.id,
takePartInUnionId: o.takePartInUnionId, takePartInUnionId: o.takePartInUnionId,
takePartInBaseManagementId: o.takePartInBaseManagementId takePartInBaseManagementId: o.takePartInBaseManagementId,
}), }),
}) },
);
if (res.code === 0) { if (res.code === 0) {
location.href = '/platform/mobile/theRapyRecuperation/lineInfo?id=' + o.takePartInLineId + location.href =
'&index=' + this.pageForm.theRapyRecuperationType + '&enrollId=' + o.id + '&fromUrlByMy=editDo' + "/platform/mobile/theRapyRecuperation/lineInfo?id=" +
'&takePartInUnionId=' + o.takePartInUnionId o.takePartInLineId +
"&index=" +
this.pageForm.theRapyRecuperationType +
"&enrollId=" +
o.id +
"&fromUrlByMy=editDo" +
"&takePartInUnionId=" +
o.takePartInUnionId;
} else { } else {
vant.Toast(res.msg) vant.Toast(res.msg);
} }
} else if (this.pageForm.theRapyRecuperationType == '3') { } else if (this.pageForm.theRapyRecuperationType == "3") {
location.href = '/platform/mobile/theRapyRecuperation/baseInfo?id=' + o.takePartInBaseManagementId + location.href =
'&index=' + this.pageForm.theRapyRecuperationType + '&enrollId=' + o.id + '&fromUrlByMy=editDo' "/platform/mobile/theRapyRecuperation/baseInfo?id=" +
o.takePartInBaseManagementId +
"&index=" +
this.pageForm.theRapyRecuperationType +
"&enrollId=" +
o.id +
"&fromUrlByMy=editDo";
} }
}, },
async cancel(o) { async cancel(o) {
if(this.pageForm.theRapyRecuperationType != '2') { if (this.pageForm.theRapyRecuperationType != "2") {
const re = await $.post('/platform/theRapyRecuperation/line/enroll/canDelete/' + o.id) const re = await $.post(
"/platform/theRapyRecuperation/line/enroll/canDelete/" + o.id,
);
if (re.code !== 0) { if (re.code !== 0) {
vant.Toast(re.msg) vant.Toast(re.msg);
return return;
} }
} }
vant.Dialog.confirm({ vant.Dialog.confirm({
title: '温馨提醒', title: "温馨提醒",
message: '您确定要撤销此报名吗?', message: "您确定要撤销此报名吗?",
}).then(async () => { })
const res = await $.post('/platform/theRapyRecuperation/line/enroll/doDeleteMyEnrollInfoById/' + o.id) .then(async () => {
const res = await $.post(
"/platform/theRapyRecuperation/line/enroll/doDeleteMyEnrollInfoById/" +
o.id,
);
if (res.code === 0) { if (res.code === 0) {
vant.Toast('撤销成功') vant.Toast("撤销成功");
this.getData() this.getData();
} else { } else {
vant.Toast(res.msg) vant.Toast(res.msg);
} }
}).catch(() => {}); })
.catch(() => {});
}, },
async findOne(o) { async findOne(o) {
if(this.pageForm.theRapyRecuperationType != '2') { if (this.pageForm.theRapyRecuperationType != "2") {
location.href = '/platform/mobile/theRapyRecuperation/lineInfo?id=' + o.takePartInLineId + '&fromUrlByMy=edit&takePartInUnionId=' + o.takePartInUnionId location.href =
"/platform/mobile/theRapyRecuperation/lineInfo?id=" +
o.takePartInLineId +
"&fromUrlByMy=edit&takePartInUnionId=" +
o.takePartInUnionId;
} }
}, },
getData() { getData() {
this.loading = true this.loading = true;
this.pageForm.pageNumber = 1 this.pageForm.pageNumber = 1;
this.tableData = [] this.tableData = [];
this.onLoad() this.onLoad();
}, },
async onLoad() { async onLoad() {
const res = await $.post('/platform/theRapyRecuperation/line/enroll/mySignUpPageData', this.pageForm) const res = await $.post(
"/platform/theRapyRecuperation/line/enroll/mySignUpPageData",
this.pageForm,
);
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
this.tableData = this.tableData.concat(res.data.list) this.tableData = this.tableData.concat(res.data.list);
if (this.tableData.length === res.data.totalCount) { if (this.tableData.length === res.data.totalCount) {
this.finished = true this.finished = true;
} else { } else {
this.pageForm.pageNumber++ this.pageForm.pageNumber++;
} }
} }
this.loading = false this.loading = false;
}, },
async getType() { async getType() {
const res = await $.post('/platform/theRapyRecuperation/line/enroll/getType') const res = await $.post(
return res.data "/platform/theRapyRecuperation/line/enroll/getType",
);
return res.data;
}, },
createYear() { createYear() {
for (let i = 2023; i <= 2043; i++) { for (let i = 2023; i <= 2043; i++) {
this.yearArray.push({value: i, text: i + '年'}) this.yearArray.push({ value: i, text: i + "年" });
} }
}, },
async getConfigData() { async getConfigData() {
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne') const resp = await $.get(
this.configData = resp.data "/platform/theRapyRecuperation/TheRapyConfig/findOne",
);
this.configData = resp.data;
}, },
}, },
async created() { async created() {
this.createYear() this.createYear();
this.yearArray.unshift({value: null, text: '所有年度'}) this.yearArray.unshift({ value: null, text: "所有年度" });
this.pageForm.theRapyRecuperationType = getQueryString('index') ? getQueryString('index') : await this.getType() this.pageForm.theRapyRecuperationType = getQueryString("index")
this.chooseButton = await getEnumOptions('TheRapyRecuperationType') ? getQueryString("index")
this.chooseButton = this.chooseButton.filter(o => o.value !== 2 && o.value !== 3) : await this.getType();
await this.getConfigData() this.chooseButton = await getEnumOptions("TheRapyRecuperationType");
this.onLoad() this.chooseButton = this.chooseButton.filter(
(o) => o.value !== 2 && o.value !== 3,
);
await this.getConfigData();
this.onLoad();
}, },
mounted() { mounted() {},
});
}
})
</script> </script>
<!--# <!--#