亚健康合同

This commit is contained in:
xiezhijun 2021-01-28 20:20:10 +08:00
parent 0479cfe4ae
commit ffa2544215
11 changed files with 384 additions and 98 deletions

BIN
running/pdf/contract_3.pdf Normal file

Binary file not shown.

View File

@ -1,6 +1,7 @@
package com.stdiet.web.controller.custom; package com.stdiet.web.controller.custom;
import com.stdiet.common.annotation.Log; import com.stdiet.common.annotation.Log;
import com.stdiet.common.constant.ContractContants;
import com.stdiet.common.core.controller.BaseController; import com.stdiet.common.core.controller.BaseController;
import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.common.core.domain.AjaxResult;
import com.stdiet.common.core.page.TableDataInfo; import com.stdiet.common.core.page.TableDataInfo;
@ -109,11 +110,22 @@ public class SysContractController extends BaseController {
} else { } else {
Map<String, String> data = new HashMap<>(); Map<String, String> data = new HashMap<>();
data.put("id", contract.getId().toString()); data.put("id", contract.getId().toString());
data.put("projectId", contract.getProjectId().toString());
data.put("projectName", contract.getProjectName());
data.put("amount", contract.getAmount().toString()); data.put("amount", contract.getAmount().toString());
data.put("serveTime", contract.getServeTime() + ""); data.put("serveTime", contract.getServeTime() + "");
data.put("tutor", contract.getTutor()); data.put("tutor", contract.getTutor());
data.put("servePromise", contract.getServePromise()); data.put("servePromise", contract.getServePromise());
data.put("remark", contract.getRemark()); data.put("remark", contract.getRemark());
data.put("companyName", ContractContants.companyName);
data.put("companyLegalPerson", ContractContants.companyLegalPerson);
data.put("companyAddress", ContractContants.companyAddress);
data.put("companyPhone", ContractContants.companyPhone);
data.put("bankName", ContractContants.bankName);
data.put("bankAccount", ContractContants.bankAccount);
data.put("hourDay", ContractContants.hourDay);
data.put("dayWeek", ContractContants.dayWeek);
data.put("replyIntervalTime", ContractContants.replyIntervalTime);
ajax.put("data", data); ajax.put("data", data);
} }
return ajax; return ajax;

View File

@ -5,14 +5,7 @@ import java.util.List;
import com.stdiet.common.utils.StringUtils; import com.stdiet.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.stdiet.common.annotation.Log; import com.stdiet.common.annotation.Log;
import com.stdiet.common.core.controller.BaseController; import com.stdiet.common.core.controller.BaseController;
import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.common.core.domain.AjaxResult;
@ -77,7 +70,11 @@ public class SysCustomerHealthyController extends BaseController
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
return AjaxResult.success(sysCustomerHealthyService.selectSysCustomerHealthyById(id)); SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyById(id);
if(sysCustomerHealthy != null && StringUtils.isNotEmpty(sysCustomerHealthy.getPhone())){
sysCustomerHealthy.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerHealthy.getPhone()));
}
return AjaxResult.success(sysCustomerHealthy);
} }
/** /**

View File

@ -0,0 +1,57 @@
package com.stdiet.common.constant;
import java.util.HashMap;
import java.util.Map;
/**
* 合同相关常量
*/
public class ContractContants {
//public static final Map<String,Object> CONTRACT_BASE = new HashMap<>();
/**
* 公司名称
*/
public static final String companyName = "深圳市胜唐科技有限公司";
/**
* 公司法人
*/
public static final String companyLegalPerson = "张玉";
/**
* 公司地址
*/
public static final String companyAddress = "深圳市宝安区西乡街道宝民二路缤纷时代广场3楼318";
/**
* 公司联系电话
*/
public static final String companyPhone = "深圳市宝安区西乡街道宝民二路缤纷时代广场3楼318";
/**
* 最长回复间隔
*/
public static final String replyIntervalTime = "3.5";
/**
* 银行名称
*/
public static final String bankName = "平安银行深圳新城支行";
/**
* 银行账户
*/
public static final String bankAccount = "15000102247278";
/**
* 每天服务时间小时
*/
public static final String hourDay = "10.5";
/**
* 每周服务天数
*/
public static final String dayWeek = "6";
}

View File

@ -6,6 +6,8 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/** /**
* 合同对象 sys_contract * 合同对象 sys_contract
@ -22,6 +24,16 @@ public class SysContract extends BaseEntity {
@Excel(name = "合同编号") @Excel(name = "合同编号")
private Long id; private Long id;
/**
* 调理项目ID
*/
private Long projectId;
/**
* 调理项目名称
*/
private String projectName;
/** /**
* 客户姓名 * 客户姓名
*/ */
@ -197,6 +209,22 @@ public class SysContract extends BaseEntity {
this.serveTimeStr = serveTimeStr; this.serveTimeStr = serveTimeStr;
} }
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -3,6 +3,7 @@ package com.stdiet.custom.service.impl;
import com.itextpdf.text.Document; import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException; import com.itextpdf.text.DocumentException;
import com.itextpdf.text.pdf.*; import com.itextpdf.text.pdf.*;
import com.stdiet.common.constant.ContractContants;
import com.stdiet.common.utils.DateUtils; import com.stdiet.common.utils.DateUtils;
import com.stdiet.common.utils.StringUtils; import com.stdiet.common.utils.StringUtils;
import com.stdiet.custom.domain.SysContract; import com.stdiet.custom.domain.SysContract;
@ -16,6 +17,8 @@ import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List; import java.util.List;
@ -123,21 +126,39 @@ public class SysContractServiceImpl implements ISysContractService {
AcroFields form = stamper.getAcroFields(); AcroFields form = stamper.getAcroFields();
form.addSubstitutionFont(BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED)); form.addSubstitutionFont(BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED));
form.setField("name", sysContract.getSignName(), true); if(sysContract.getProjectId().intValue() == 0){
form.setField("serveTime", sysContract.getServeTimeStr(), true); form.setField("name", sysContract.getSignName(), true);
// form.setField("tutor", sysContract.getTutor(), true); form.setField("serveTime", sysContract.getServeTimeStr(), true);
form.setField("moneyUpper", sysContract.getAmountUpper(), true); //form.setField("tutor", sysContract.getTutor(), true);
form.setField("money", sysContract.getAmount().intValue() + "", true); form.setField("moneyUpper", sysContract.getAmountUpper(), true);
form.setField("phone", sysContract.getPhone(), true); form.setField("money", sysContract.getAmount().intValue() + "", true);
form.setField("promise", sysContract.getServePromise(), true); form.setField("phone", sysContract.getPhone(), true);
form.setField("date", DateUtils.getDate(), true); form.setField("promise", sysContract.getServePromise(), true);
// form.setField("date", sysContract.getSignDate()); form.setField("date", DateUtils.getDate(), true);
form.setField("cusId", sysContract.getCusId(), true); //form.setField("date", sysContract.getSignDate());
if (StringUtils.isNotEmpty(sysContract.getRemark())) { form.setField("cusId", sysContract.getCusId(), true);
form.setField("remark", "(备注:" + sysContract.getRemark() + ")", true); if (StringUtils.isNotEmpty(sysContract.getRemark())) {
form.setField("remark", "(备注:" + sysContract.getRemark() + ")", true);
}
}else{
form.setField("companyName", ContractContants.companyName, true);
form.setField("companyLegalPerson", ContractContants.companyLegalPerson, true);
form.setField("name", sysContract.getSignName(), true);
form.setField("cusId", sysContract.getCusId(), true);
form.setField("phone", sysContract.getPhone(), true);
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
form.setField("expireTime", LocalDate.now().plusMonths(sysContract.getServeTime()/30).format(fmt), true);
form.setField("amount", sysContract.getAmount().intValue()+"", true);
form.setField("amountCapital", sysContract.getAmountUpper(), true);
form.setField("serveTime", sysContract.getServeTime()/30+"", true);
form.setField("bankName", ContractContants.bankName, true);
form.setField("bankAccount", ContractContants.bankAccount, true);
form.setField("hourDay", ContractContants.hourDay, true);
form.setField("dayWeek", ContractContants.dayWeek, true);
form.setField("replyIntervalTime", ContractContants.replyIntervalTime, true);
form.setField("tutor", sysContract.getTutor(), true);
form.setField("signTime", DateUtils.getDate(), true);
} }
stamper.setFormFlattening(true);// 如果为false那么生成的PDF文件还能编辑一定要设为true stamper.setFormFlattening(true);// 如果为false那么生成的PDF文件还能编辑一定要设为true
stamper.close(); stamper.close();

View File

@ -6,6 +6,7 @@
<resultMap type="SysContract" id="SysContractResult"> <resultMap type="SysContract" id="SysContractResult">
<result property="id" column="id"/> <result property="id" column="id"/>
<result property="projectId" column="project_id"></result>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="name" column="name"/> <result property="name" column="name"/>
<result property="signName" column="sign_name"/> <result property="signName" column="sign_name"/>
@ -21,33 +22,39 @@
<result property="updateBy" column="update_by"/> <result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<!-- 非持久化字段 -->
<result property="projectName" column="project_name"></result>
</resultMap> </resultMap>
<sql id="selectSysContractVo"> <sql id="selectSysContractVo">
select id, status, name, sign_name, phone, cus_id, serve_time, tutor, serve_promise, amount, path, create_by, create_time, update_by, update_time, remark from sys_contract select sc.id, sc.project_id, sc.status, sc.name, sc.sign_name, sc.phone, sc.cus_id, sc.serve_time, sc.tutor, sc.serve_promise, sc.amount,
sc.path, sc.create_by, sc.create_time, sc.update_by, sc.update_time, sc.remark,cp.dict_label as project_name
from sys_contract as sc
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') as cp ON cp.dict_value = sc.project_id
</sql> </sql>
<select id="selectSysContractList" parameterType="SysContract" resultMap="SysContractResult"> <select id="selectSysContractList" parameterType="SysContract" resultMap="SysContractResult">
<include refid="selectSysContractVo"/> <include refid="selectSysContractVo"/>
<where> <where>
<if test="id != null ">and id = #{id}</if> <if test="id != null ">and sc.id = #{id}</if>
<if test="status != null ">and status = #{status}</if> <if test="status != null ">and sc.status = #{status}</if>
<if test="tutor != null and tutor != '' ">and tutor = #{tutor}</if> <if test="tutor != null and tutor != '' ">and sc.tutor = #{tutor}</if>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> <if test="name != null and name != ''">and sc.name like concat('%', #{name}, '%')</if>
<if test="phone != null and phone != ''">and phone = #{phone}</if> <if test="phone != null and phone != ''">and sc.phone = #{phone}</if>
</where> </where>
order by create_time desc order by create_time desc
</select> </select>
<select id="selectSysContractById" parameterType="Long" resultMap="SysContractResult"> <select id="selectSysContractById" parameterType="Long" resultMap="SysContractResult">
<include refid="selectSysContractVo"/> <include refid="selectSysContractVo"/>
where id = #{id} where sc.id = #{id}
</select> </select>
<insert id="insertSysContract" parameterType="SysContract" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSysContract" parameterType="SysContract" useGeneratedKeys="true" keyProperty="id">
insert into sys_contract insert into sys_contract
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if> <if test="id != null">id,</if>
<if test="projectId != null">project_id,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="name != null and name != ''">name,</if> <if test="name != null and name != ''">name,</if>
<if test="signName != null and signName != ''">sign_name,</if> <if test="signName != null and signName != ''">sign_name,</if>
@ -66,6 +73,7 @@
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
<if test="projectId != null">#{projectId},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">#{name},</if>
<if test="signName != null and signName != ''">#{signName},</if> <if test="signName != null and signName != ''">#{signName},</if>
@ -87,6 +95,7 @@
<update id="updateSysContract" parameterType="SysContract"> <update id="updateSysContract" parameterType="SysContract">
update sys_contract update sys_contract
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="projectId != null">project_id = #{projectId},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="name != null and name != ''">name = #{name},</if> <if test="name != null and name != ''">name = #{name},</if>
<if test="signName != null and signName != ''">sign_name = #{signName},</if> <if test="signName != null and signName != ''">sign_name = #{signName},</if>

View File

@ -117,6 +117,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="金额" align="center" prop="amount" width="100"/> <el-table-column label="金额" align="center" prop="amount" width="100"/>
<el-table-column label="调理项目" align="center" prop="projectName" width="100"/>
<el-table-column label="签订时间" align="center" prop="updateTime" width="180"/> <el-table-column label="签订时间" align="center" prop="updateTime" width="180"/>
<el-table-column label="合同地址" align="center" prop="path" width="80"> <el-table-column label="合同地址" align="center" prop="path" width="80">
<template slot-scope="scope"> <template slot-scope="scope">
@ -159,13 +160,21 @@
<!-- 添加或修改合同对话框 --> <!-- 添加或修改合同对话框 -->
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="调理项目" prop="projectId">
<el-select v-model="form.projectId" placeholder="请选择调理项目" filterable clearable size="small">
<el-option v-for="dict in conditioningProjectIdOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"/>
</el-select>
</el-form-item>
<el-form-item label="客户姓名" prop="name"> <el-form-item label="客户姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入客户姓名"/> <el-input v-model="form.name" placeholder="请输入客户姓名"/>
</el-form-item> </el-form-item>
<el-form-item label="金额" prop="amount"> <el-form-item label="金额" prop="amount">
<el-input v-model="form.amount" placeholder="请输入金额"/> <el-input v-model="form.amount" placeholder="请输入金额"/>
</el-form-item> </el-form-item>
<el-form-item label="服务承诺" prop="servePromise"> <el-form-item label="服务承诺" prop="servePromise" v-show="form.projectId == 0">
<el-input style="width: 193px; margin-right: 12px" v-model="form.servePromise" placeholder="请输入服务承诺"/> <el-input style="width: 193px; margin-right: 12px" v-model="form.servePromise" placeholder="请输入服务承诺"/>
</el-form-item> </el-form-item>
@ -209,6 +218,12 @@
export default { export default {
name: "Contract", name: "Contract",
data() { data() {
const checkServePromise = (rule, value, callback) => {
if (this.form.projectId == 0 && !value) {
return callback(new Error('请输入服务承诺'))
}
callback();
};
return { return {
// //
loading: true, loading: true,
@ -234,6 +249,8 @@
serveTimeOptions: [], serveTimeOptions: [],
// //
signStatusOptions: [], signStatusOptions: [],
//
conditioningProjectIdOption:[],
// //
copyValue: '', copyValue: '',
// //
@ -249,14 +266,23 @@
form: {}, form: {},
// //
rules: { rules: {
projectId:[
{required: true, message: "请选择调理项目", trigger: "blur"}
],
name: [ name: [
{required: true, message: "请输入客户姓名", trigger: "blur"} {required: true, message: "请输入客户姓名", trigger: "blur"}
], ],
amount: [ amount: [
{required: true, message: "请输入签订金额", trigger: "blur"} {required: true, message: "请输入签订金额", trigger: "blur"},
{
required: true,
trigger: "blur",
pattern: /^[1-9]\d*$/,
message: "签订金额格式不正确",
},
], ],
servePromise: [ servePromise: [
{required: true, message: "请输入承诺效果", trigger: "blur"} {required: true, trigger: "blur", validator: checkServePromise}
], ],
serveTime: [ serveTime: [
{required: true, message: "请选择服务时间", trigger: "blur"} {required: true, message: "请选择服务时间", trigger: "blur"}
@ -285,6 +311,9 @@
this.getDicts("cus_sign_status").then(response => { this.getDicts("cus_sign_status").then(response => {
this.signStatusOptions = response.data; this.signStatusOptions = response.data;
}); });
this.getDicts("conditioning_project").then(response => {
this.conditioningProjectIdOption = response.data;
});
}, },
methods: { methods: {
/** 查询合同列表 */ /** 查询合同列表 */
@ -311,9 +340,11 @@
// //
reset() { reset() {
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.remark === 'default'); const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.remark === 'default');
const defaultProjectIdOption = this.conditioningProjectIdOption.find(opt => opt.remark === 'default');
this.form = { this.form = {
id: null, id: null,
projectId: defaultProjectIdOption ? parseInt(defaultProjectIdOption.dictValue) : null,
name: null, name: null,
phone: null, phone: null,
serveTime: null, serveTime: null,
@ -378,6 +409,9 @@
// }); // });
// } else { // } else {
this.form.tutor = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId) this.form.tutor = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId)
if(this.form.projectId != 0 && this.form.projectId != 3){
return;
}
addContract(this.form).then(response => { addContract(this.form).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess("新增成功"); this.msgSuccess("新增成功");

View File

@ -10,7 +10,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="调理项目" prop="conditioningProjectId"> <el-form-item label="调理项目" prop="conditioningProjectId">
<el-select v-model="queryParams.conditioningProjectId" placeholder="请选择"> <el-select v-model="queryParams.conditioningProjectId" filterable clearable placeholder="请选择">
<el-option <el-option
v-for="dict in conditioningProjectIdOption" v-for="dict in conditioningProjectIdOption"
:key="dict.dictValue" :key="dict.dictValue"
@ -485,39 +485,49 @@
</el-dialog> </el-dialog>
<!-- 查看详情 --> <!-- 查看详情 -->
<el-dialog title="客户健康评估表" v-if="healthyDetailOpen" :visible.sync="healthyDetailOpen" width="1000px" style="overflow: auto;" append-to-body> <el-dialog title="客户健康评估表" v-if="healthyDetailOpen" :visible.sync="healthyDetailOpen" width="1000px" append-to-body>
<div v-for="(item,index) in healthyDetailList" :class="index != 0 ? 'margin-top-20' : ''" v-show="titleShowArray[index]" style="margin-bottom: 50px;"> <!-- 基础信息 -->
<div v-for="(item,index) in healthyDetailList.slice(0,1)" style="margin-bottom: 50px;">
<div> <div>
<p class="p_title_1" style="margin-top: 5px;">{{titleArray[index]}}</p> <p class="p_title_1" style="margin-top: 5px;">{{titleArray[index]}}</p>
<TableDetailMessage :data="item" v-if="index != healthyDetailList.length-1"></TableDetailMessage> <TableDetailMessage :data="item" ></TableDetailMessage>
<el-table :show-header="false" v-if="index == healthyDetailList.length-1" :data="item" border :cell-style="columnStyle" style="width: 100%;">
<el-table-column width="140" prop="attr_name_one">
</el-table-column>
<el-table-column prop="value_one">
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.value_one == null ? '' : (scope.row.value_one+'')" :maxLength="20"/>
<el-button type="primary" v-show="scope.row.value_one" @click="downloadFile(medicalReportPathArray[0])">下载</el-button>
</template>
</el-table-column>
<el-table-column width="140" prop="attr_name_two"></el-table-column>
<el-table-column prop="value_two">
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.value_two == null ? '' : (scope.row.value_two+'')" :maxLength="20"/>
<el-button type="primary" v-show="scope.row.value_two" @click="downloadFile(medicalReportPathArray[1])">下载</el-button>
</template>
</el-table-column>
<el-table-column width="140" prop="attr_name_three"></el-table-column>
<el-table-column prop="value_three">
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.value_three == null ? '' : (scope.row.value_three+'')" :maxLength="20"/>
<el-button type="primary" v-show="scope.row.value_three" @click="downloadFile(medicalReportPathArray[2])">下载</el-button>
</template>
</el-table-column>
</el-table>
</div> </div>
<div style="float:right;margin-top:25px;" v-if="index == (groupShowArray[avtiveStep - 1][groupShowArray[avtiveStep - 1].length-1] - 1)"> </div>
<el-button @click="nextStep(avtiveStep - 1)" v-show="avtiveStep != 1">上一页</el-button> <!-- 剩余其他信息 -->
<el-button type="primary" @click="nextStep(avtiveStep + 1)" v-show="avtiveStep != groupShowArray.length">下一页</el-button> <div style="height:400px;overflow: auto">
<div v-for="(item,index) in healthyDetailList.slice(1,10)" v-show="titleShowArray[index]" style="margin-bottom: 50px;">
<div>
<p class="p_title_1" style="margin-top: 5px;">{{titleArray[index+1]}}</p>
<TableDetailMessage :data="item" v-if="index != healthyDetailList.length-2"></TableDetailMessage>
<el-table :show-header="false" v-if="index == healthyDetailList.length-2" :data="item" border :cell-style="columnStyle" style="width: 100%;">
<el-table-column width="140" prop="attr_name_one">
</el-table-column>
<el-table-column prop="value_one">
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.value_one == null ? '' : (scope.row.value_one+'')" :maxLength="20"/>
<el-button type="primary" v-show="scope.row.value_one" @click="downloadFile(medicalReportPathArray[0])">下载</el-button>
</template>
</el-table-column>
<el-table-column width="140" prop="attr_name_two"></el-table-column>
<el-table-column prop="value_two">
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.value_two == null ? '' : (scope.row.value_two+'')" :maxLength="20"/>
<el-button type="primary" v-show="scope.row.value_two" @click="downloadFile(medicalReportPathArray[1])">下载</el-button>
</template>
</el-table-column>
<el-table-column width="140" prop="attr_name_three"></el-table-column>
<el-table-column prop="value_three">
<template slot-scope="scope">
<AutoHideMessage :data="scope.row.value_three == null ? '' : (scope.row.value_three+'')" :maxLength="20"/>
<el-button type="primary" v-show="scope.row.value_three" @click="downloadFile(medicalReportPathArray[2])">下载</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!--<div style="float:right;margin-top:25px;" v-if="index == (groupShowArray[avtiveStep - 1][groupShowArray[avtiveStep - 1].length-1] - 1)">
<el-button @click="nextStep(avtiveStep - 1)" v-show="avtiveStep != 1">上一页</el-button>
<el-button type="primary" @click="nextStep(avtiveStep + 1)" v-show="avtiveStep != groupShowArray.length">下一页</el-button>
</div>-->
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
@ -537,7 +547,7 @@
//title //title
titleArray: healthyData['titleArray'], titleArray: healthyData['titleArray'],
// //
titleShowArray:[true,true,false,false,false,false,false,false,false], titleShowArray:[true,true,true,true,true,true,true,true,true],
// //
groupShowArray:[[1],[2,3],[4],[5,6],[7,8],[9]], groupShowArray:[[1],[2,3],[4],[5,6],[7,8],[9]],
// //
@ -680,7 +690,7 @@
handleLookDetail(row) { handleLookDetail(row) {
const id = row.id || this.ids const id = row.id || this.ids
getHealthy(id).then(response => { getHealthy(id).then(response => {
this.nextStep(1); //this.nextStep(1);
let detailHealthy = this.dealHealthy(response.data); let detailHealthy = this.dealHealthy(response.data);
// //
detailHealthy.sex = detailHealthy.sex == 0 ? "男" : (detailHealthy.sex == 1 ? "女" : "未知"); detailHealthy.sex = detailHealthy.sex == 0 ? "男" : (detailHealthy.sex == 1 ? "女" : "未知");
@ -769,10 +779,10 @@
let physicalSigns = ""; let physicalSigns = "";
if(detailHealthy.signList != null && detailHealthy.signList.length > 0){ if(detailHealthy.signList != null && detailHealthy.signList.length > 0){
detailHealthy.signList.forEach(function (sign, index) { detailHealthy.signList.forEach(function (sign, index) {
physicalSigns += "," + sign.name; physicalSigns += "" + sign.name;
}) })
} }
physicalSigns += "," + (detailHealthy.otherPhysicalSigns ? detailHealthy.otherPhysicalSigns : ""); physicalSigns += "" + (detailHealthy.otherPhysicalSigns ? detailHealthy.otherPhysicalSigns : "");
detailHealthy.physicalSigns = this.trimComma(physicalSigns); detailHealthy.physicalSigns = this.trimComma(physicalSigns);
detailHealthy.familyIllnessHistory += detailHealthy.otherFamilyIllnessHistory ? ("" + detailHealthy.otherFamilyIllnessHistory) : ""; detailHealthy.familyIllnessHistory += detailHealthy.otherFamilyIllnessHistory ? ("" + detailHealthy.otherFamilyIllnessHistory) : "";
@ -784,6 +794,7 @@
detailHealthy.allergyFlag = detailHealthy.allergyFlag == 1 ? "有" : "无"; detailHealthy.allergyFlag = detailHealthy.allergyFlag == 1 ? "有" : "无";
detailHealthy.allergen += detailHealthy.otherAllergen ? ("" +detailHealthy.otherAllergen) : ""; detailHealthy.allergen += detailHealthy.otherAllergen ? ("" +detailHealthy.otherAllergen) : "";
detailHealthy.allergen = this.trimComma(detailHealthy.allergen);
let medicalReportPathArray = detailHealthy.medicalReport ? detailHealthy.medicalReport.split(",") : []; let medicalReportPathArray = detailHealthy.medicalReport ? detailHealthy.medicalReport.split(",") : [];
let medicalReportNameArray = detailHealthy.medicalReportName ? detailHealthy.medicalReportName.split(",") : []; let medicalReportNameArray = detailHealthy.medicalReportName ? detailHealthy.medicalReportName.split(",") : [];

View File

@ -8,6 +8,9 @@
<el-form-item label="导师" style="margin: 0"> <el-form-item label="导师" style="margin: 0">
<span>{{form.tutor}}</span> <span>{{form.tutor}}</span>
</el-form-item> </el-form-item>
<el-form-item label="调理项目" style="margin: 0">
<span>{{form.projectName}}</span>
</el-form-item>
<el-form-item label="服务费" style="margin: 0"> <el-form-item label="服务费" style="margin: 0">
<span>{{form.amount}}</span> <span>{{form.amount}}</span>
</el-form-item> </el-form-item>
@ -46,12 +49,13 @@
</div> </div>
<el-button type="primary" style="width: 100%" @click="submitForm" :disabled="!read">提交签约</el-button> <el-button type="primary" style="width: 100%" @click="submitForm" :disabled="!read">提交签约</el-button>
<el-dialog <el-dialog
title="营养减脂服务合同" :title="titleArray[this.form.projectId]"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="90%" width="90%"
custom-class="contract_dialog" custom-class="contract_dialog"
center> center>
<div class="dialog-detail"> <div class="dialog-detail">
<div v-show="this.form.projectId == 0">
<p> <p>
<div>甲方胜唐体控深圳市胜唐科技有限公司</div> <div>甲方胜唐体控深圳市胜唐科技有限公司</div>
<div>公司地址深圳市宝安区西乡街道宝民二路缤纷时代广场3楼318</div> <div>公司地址深圳市宝安区西乡街道宝民二路缤纷时代广场3楼318</div>
@ -61,13 +65,13 @@
<div>乙方<b>{{form.signName}}</b></div> <div>乙方<b>{{form.signName}}</b></div>
<div>身份证号<b>{{form.cusId}}</b></div> <div>身份证号<b>{{form.cusId}}</b></div>
<div>联系电话<b>{{form.phone}}</b></div> <div>联系电话<b>{{form.phone}}</b></div>
</p> </p>
<p> <p>
<div>甲乙双方本着诚信合作互惠互利的原则依据中华人民共和国有相关法律经友好协商现就胜唐体控减肥咨询指导服务合作相关事宣达成一致协议以兹共同遵守</div> <div>甲乙双方本着诚信合作互惠互利的原则依据中华人民共和国有相关法律经友好协商现就胜唐体控减肥咨询指导服务合作相关事宣达成一致协议以兹共同遵守</div>
<div>若乙方为未成年由应由乙方法定监护人代签本合同乙方享受同等法律权益</div> <div>若乙方为未成年由应由乙方法定监护人代签本合同乙方享受同等法律权益</div>
</p> </p>
<p> <p>
第一条 甲方资质与服务保证 第一条 甲方资质与服务保证
<div class="line-rule">1甲方系经由工商部门注册合法经营的正规公司具备提供相关咨询服务的法定资质</div> <div class="line-rule">1甲方系经由工商部门注册合法经营的正规公司具备提供相关咨询服务的法定资质</div>
<div class="line-rule">2甲方在合约期内为乙方安排营养师团队提供营养减脂服务</div> <div class="line-rule">2甲方在合约期内为乙方安排营养师团队提供营养减脂服务</div>
<div class="line-rule">3甲方按与乙方约定事项及服务内容通过定制营养减脂饮食方案为乙方提供减脂服务服务中不使用任何仪器针药不使用医疗类药物等</div> <div class="line-rule">3甲方按与乙方约定事项及服务内容通过定制营养减脂饮食方案为乙方提供减脂服务服务中不使用任何仪器针药不使用医疗类药物等</div>
@ -83,16 +87,16 @@
<div style="margin-left: 24px">5.8乙方自订购服务日起享有单一营养师的指导及咨询服务如需中途更换指导老师需在当期方案执行结束至少3日内告知以便于更换指导</div> <div style="margin-left: 24px">5.8乙方自订购服务日起享有单一营养师的指导及咨询服务如需中途更换指导老师需在当期方案执行结束至少3日内告知以便于更换指导</div>
<div style="margin-left: 24px">5.9甲方每日会敦促乙方进行服务效果反馈一日三餐需进行打卡</div> <div style="margin-left: 24px">5.9甲方每日会敦促乙方进行服务效果反馈一日三餐需进行打卡</div>
<div style="margin-left: 24px">5.10甲方在接收到乙方发送咨询需求3.5小时内需及时为乙方解答周日及法定节假日除外</div> <div style="margin-left: 24px">5.10甲方在接收到乙方发送咨询需求3.5小时内需及时为乙方解答周日及法定节假日除外</div>
</p> </p>
<p>第二条 合作内容及费用 <p>第二条 合作内容及费用
<div class="line-rule">经甲乙双方协商确定乙方向甲方购买 <b>{{form.serveTimeStr}}</b> 胜唐体控瘦身指导服务以下简称服务 <div class="line-rule">经甲乙双方协商确定乙方向甲方购买 <b>{{form.serveTimeStr}}</b> 胜唐体控瘦身指导服务以下简称服务
经甲乙双方协商一致确定乙方向甲方支付服务费用为人民币 <b>{{form.amount}}</b>大写<b>{{form.amountUpper}}</b> 经甲乙双方协商一致确定乙方向甲方支付服务费用为人民币 <b>{{form.amount}}</b>大写<b>{{form.amountUpper}}</b>
</div> </div>
<div><b>{{form.remark ? `(备注:${form.remark}`:''}}</b></div> <div><b>{{form.remark ? `(备注:${form.remark}`:''}}</b></div>
</p> </p>
<p>第三条 服务期约定 <p>第三条 服务期约定
<div class="line-rule">1服务时间阶段服务指导期服务跟踪期免费咨询期具体安排由甲方根据乙方的实际情况与乙方协商确定</div> <div class="line-rule">1服务时间阶段服务指导期服务跟踪期免费咨询期具体安排由甲方根据乙方的实际情况与乙方协商确定</div>
<div class="line-rule">2因不可抗拒的因素如意外怀孕等而暂停服务指导其后续服务期限由甲乙方协商确定</div> <div class="line-rule">2因不可抗拒的因素如意外怀孕等而暂停服务指导其后续服务期限由甲乙方协商确定</div>
<div class="line-rule">3减肥需要双方的配合在不是甲方技术问题的情况下乙方不执行营养师的指导导致没有达到预期效果责任由乙方承担根据个人体质不同在调理营养健康的前提下健康吃瘦 <b>{{form.servePromise}}</b> <div class="line-rule">3减肥需要双方的配合在不是甲方技术问题的情况下乙方不执行营养师的指导导致没有达到预期效果责任由乙方承担根据个人体质不同在调理营养健康的前提下健康吃瘦 <b>{{form.servePromise}}</b>
@ -112,17 +116,123 @@
8若乙方具有特殊病史慢病疾病食用减肥药物或产品使用激素药物中药及其他疗程性药物调理需在购买减脂服务前告知甲方以便于合理安排减脂计划若乙方未告知甲方相关的疾病史以及药物使用情况因此造成的负面效果由乙方自行承担 8若乙方具有特殊病史慢病疾病食用减肥药物或产品使用激素药物中药及其他疗程性药物调理需在购买减脂服务前告知甲方以便于合理安排减脂计划若乙方未告知甲方相关的疾病史以及药物使用情况因此造成的负面效果由乙方自行承担
</div> </div>
<div class="line-rule">9甲方在乙方告知所有身体情况及药物服用情况甲方仍未做出合理安排对乙方的身体及心理造成影响时乙方可申请扣除已进行服务期外相应的服务款项退还未进行服务期对应款项</div> <div class="line-rule">9甲方在乙方告知所有身体情况及药物服用情况甲方仍未做出合理安排对乙方的身体及心理造成影响时乙方可申请扣除已进行服务期外相应的服务款项退还未进行服务期对应款项</div>
</p> </p>
<p>第四条 其他 <p>第四条 其他
<div class="line-rule">1如因本合同发生争议双方应协商解决如协商不成双方可向甲方所在地法院提起诉讼解决</div> <div class="line-rule">1如因本合同发生争议双方应协商解决如协商不成双方可向甲方所在地法院提起诉讼解决</div>
<div class="line-rule">2本合同经双方线上签字盖章后生效</div> <div class="line-rule">2本合同经双方线上签字盖章后生效</div>
</p> </p>
</div>
<div v-show="this.form.projectId == 3">
<p>
<p>
<div>服务公司以下简称甲方{{form.companyName}}</div>
<div>法定代表人{{form.companyLegalPerson}}</div>
</p>
<p>
<div>用户以下简称乙方<b>{{form.signName}}</b></div>
<div>身份证号<b>{{form.cusId}}</b></div>
<div>联系电话<b>{{form.phone}}</b></div>
</p>
<p>
<div>经甲乙方双方协商同意签定服务合同在合同有效期间乙双方必须遵守国 家法律法规以保护甲乙双方合法权益不受侵犯</div>
</p>
<p>
本合同服务期限自合同成立并生效之日开始 <b>{{form.expireTime}}</b> 日终止
</p>
<p>
服务费 <b>{{form.amount}}</b> 元人民币大写 <b>{{form.amountUpper}}</b>
</p>
<p>
支付方式
<div class="line-rule">1.乙方一次性付清服务费用以人民币形式通过银行转账或其他支付向甲方支付共计 <b>{{form.serveTime/30}}</b> 个月服务费</div>
<div class="line-rule">2.甲方账户信息<br>
<div style="padding-left: 10px;">甲方名称{{form.companyName}}</div>
<div style="padding-left: 10px;">开户行{{form.bankName}}</div>
<div style="padding-left: 10px;">银行账号{{form.bankAccount}}</div>
</div>
<div class="line-rule">
3. 墨迹商城胜唐体控收款
</div>
<div class="line-rule">
4. 微信转账与支付宝转账
</div>
</p>
<p>
服务事项
<div class="line-rule">1.乙方需提供以下筛查报告<br>
<div style="padding-left: 10px;">1).男性激素六项女性激素六项衣原体抗原优生五项AMH抗缪勒管激素 抗精子抗体抗子宫内膜抗体抗卵巢抗体血常规五分类贫血三项 </div>
<div style="padding-left: 10px;">2.过往疾病史病历在使用或服用药物</div>
<div style="padding-left: 10px;">3.过往是否使用过激素类药物或保健药品附加详细说明 </div>
</div>
<div class="line-rule">2服务时间<br>
<div style="padding-left: 10px;">1).在指导调理期内专业营养师的指导时间为一天 <b>{{form.hourDay}} </b>小时一周 <b>{{form.dayWeek}}</b> </div>
<div style="padding-left: 10px;">2).营养师回复消息时间不超过 <b>{{form.replyIntervalTime}}</b> 小时国家法定节假日期间暂停服务</div>
<div style="padding-left: 10px;">3).每日服务时间为早9301200晚13301900</div>
</div>
<div class="line-rule">3服务指导方式<br>
<div style="padding-left: 10px;">1).以线上饮食指导为主线下指导可进行预约至甲方办公所在地进行面对面咨询 指导 </div>
<div style="padding-left: 10px;">2).线上指导方式为添加指定营养师{{form.tutor}}联系方式微信或至线下咨询 </div>
<div style="padding-left: 10px;">3).一对一指导定制乙方可以指定甲方营养师团队任意营养师做咨询指导服务 若需要多位营养师同时进行指导相关服务费用按标准收取 </div>
<div style="padding-left: 10px;">4).在指定服务期内每日的饮食指导食谱按周发送每周七天每天包含三餐 的饮食指导</div>
<div style="padding-left: 10px;">5).指导服务周期自合同签订之日起指导范围不包括药物指导医用级配方 方性涉及医疗及专业药学范围 </div>
</div>
<div class="line-rule">4服务效果及保障<br>
<div style="padding-left: 10px;">1).可改善效果<br>改善双方体质改善妇科问题增加受孕几率 预防妊娠糖尿病及孕期高血压 </div>
<div style="padding-left: 10px;">2).预期调理结果 <br>1-3个月双方体质得到明显改善女性妇科炎症得到缓解男性体力得到提升 疲惫感降低<br>
4-6个月女性卵巢功能得到改善卵子质量精子活力得到提升提高受孕几率</div>
<div style="padding-left: 10px;">3).调理意义<br>提示男性体内激素水平是否正常提示女性体内激素水平是否正常 阳性结果结合临床可确定沙眼衣原体感染阴性时不能完全排除可用细胞培养 法确定,妊娠早期感染可引起流产死胎胎儿畸形等.显示女性卵巢内含有的原 始卵泡的数量和质量是反映女性生育能力的一个重要指标检测男女生育能力 检测女性生育能力,通过检测血液细胞的计数及不同种类细胞成分的分类来反映 身体状况
贫血感染血液系统疾病物理化学因素损伤等提示贫血类 </div>
<div style="padding-left: 10px;">4).需调理周期<b> {{form.serveTime/30}}</b> 个月</div>
<div style="padding-left: 10px;">5).服务暂停:<br>乙方因个人原因无法按照指导服务进行调理时应当提前一周向甲 方申请暂停服务暂停期间不计入有效服务周期内</div>
</div>
</p>
<p>
争议及提前结束服务
<div class="line-rule">1.服务时间阶段服务指导期服务跟踪期免费咨询期以下称为服务时间阶段 具体安排由甲方根据乙方的实际情况与乙方协商确定</div>
<div class="line-rule">2.如不可抗拒的因素如意外怀孕等而暂停服务指导其后续服务期限由甲乙 双方协商确定</div>
<div class="line-rule">3.若非甲方技术问题的情况下乙方未执行营养师的指导因此未达到预期效果 甲方不进行延期服务 </div>
<div class="line-rule">4.乙方未按照甲方为其制定方案执行所带来的的后果由乙方自行承担甲方不 承担责任 </div>
<div class="line-rule">5.乙方在服务期内享有 2 次暂停服务的机会暂停前应与甲方沟通暂停结束后 重新与甲方汇报当前身体状况 </div>
<div class="line-rule">6.乙方隐瞒病情或身体情况误导营养师造成的后果由乙方自行承担且甲方不予 退款</div>
<div class="line-rule">7.乙方同意且理解甲方定制营养方案付出的时间和智力成本乙方在第一周营养 方案定制交付之前申请退款可退款 90%在第一周营养方案定制交付之后因个 人原因不履行本合同的则不予退款 </div>
<div class="line-rule">8.若乙方具有特殊病史或使用激素药物中药及其他疗程性药物等影响甲方提供 服务的情况需在购买调理服务前告知甲方以便于合理安排调理计划若乙方 未告知甲方相关的疾病史以及药物使用情况因此造成的负面效果由乙方自行承 </div>
<div class="line-rule">9.甲方在乙方告知所有身体情况及药物服用情况甲方仍未做出合理安排对乙 方的身体及心理造成影响时乙方可申请扣除已进行服务期外相应的服务款项 退还未进行服务期对应款项
</div>
</p>
<p>
保密条款
<div class="line-rule">1.甲方为乙方的资料保密包括姓名性别身份证号联系电话过往病 过敏史等 </div>
<div class="line-rule">2.甲方不可把资料泄露给第三方只允许把信息透露给甲方相对应负责人</div>
<div class="line-rule">3.乙方为甲方的营养方案保密包括一对一定制方案体检安排文字或 语音解答各类指导等</div>
<div class="line-rule">4.乙方不可把资料泄露给第三方若泄露给他人造成的损失由乙方承担 </div>
<div class="line-rule">5.乙方不得为以下行为 <br>
<div style="padding-left: 10px;">1.将甲方资料提供给他人阅读复制传递</div>
<div style="padding-left: 10px;">2.未经甲方授权以甲方的名义或以甲方员工身份对外发布 </div>
<div style="padding-left: 10px;">3.将甲方资料以口头书面或者其他形式直接或间接的传递给甲方的竞 争对手 </div>
</div>
<div class="line-rule">6.若乙方违反保密义务给甲方造成名誉损失或经济损失需承担赔偿责任
</div>
</p>
<p>
合同签订与解除
<div class="line-rule">1.本合同经甲乙双方线上签订电子版之日起生效</div>
</p>
<p>
其他
<div class="line-rule">1.甲乙双方任何一方违约需向守约方赔偿2个月的服务费如果违约金不足以弥 补对方损失的违约方还需补足守约方的实际损失</div>
<div class="line-rule">2.因履行本合同发生的争议经友好协商不能解决的协商不能解决的任何一方 均可向甲方或乙方住所地有管辖权的人民法院提起诉讼</div>
<div class="line-rule">3.本合同一式二份甲方执一份乙方执一份具有同等法律效力本合同未经事宜 双方可以签订补充协议补充协议与原合同约定不一致的以补充协议为准</div>
</p>
</div>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleConfirm"> </el-button> <el-button type="primary" @click="handleConfirm"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -131,6 +241,7 @@
import {getFile, signContract} from "@/api/custom/contract"; import {getFile, signContract} from "@/api/custom/contract";
import {digitUppercase, validatorIDCard} from "../../../utils/ruoyi"; import {digitUppercase, validatorIDCard} from "../../../utils/ruoyi";
import dayjs from 'dayjs';
export default { export default {
name: 'sign', name: 'sign',
@ -217,7 +328,8 @@
cusId: [ cusId: [
{required: false, trigger: "blur", validator: checkcusId} {required: false, trigger: "blur", validator: checkcusId}
] ]
} },
titleArray:["营养减脂服务合同","","","备孕营养调理指导服务合同",""]
} }
}, },
mounted() { mounted() {
@ -238,16 +350,15 @@
this.form = result.data; this.form = result.data;
this.form.amount = parseInt(result.data.amount); this.form.amount = parseInt(result.data.amount);
this.form.amountUpper = digitUppercase(this.form.amount); this.form.amountUpper = digitUppercase(this.form.amount);
this.form.serveTimeStr = this.serveTimeIdOption.find(obj => obj.value === parseInt(result.data.serveTime)).label this.form.serveTimeStr = this.serveTimeIdOption.find(obj => obj.value === parseInt(result.data.serveTime)).label;
this.form.expireTime = dayjs().add(this.form.serveTime/30, 'month').format('YYYY-MM-DD');
this.show = true; this.show = true;
} }
}) })
}, },
submitForm() { submitForm() {
console.log("chdkscjksdc1");
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
console.log("chdkscjksdc2");
signContract(this.form).then(result => { signContract(this.form).then(result => {
if (result.code === 200) { if (result.code === 200) {
window.location.href = window.location.origin + result.url; window.location.href = window.location.origin + result.url;

View File

@ -34,7 +34,7 @@
<el-input type="number" v-model="form.phone" placeholder="请输入手机号" /> <el-input type="number" v-model="form.phone" placeholder="请输入手机号" />
</el-form-item> </el-form-item>
<el-form-item label="调理项目" prop="conditioningProjectId"> <el-form-item label="调理项目" prop="conditioningProjectId">
<el-select v-model="form.conditioningProjectId" placeholder="请选择"> <el-select v-model="form.conditioningProjectId" filterable clearable placeholder="请选择">
<el-option <el-option
v-for="dict in conditioningProjectIdOption" v-for="dict in conditioningProjectIdOption"
:key="dict.dictValue" :key="dict.dictValue"
@ -618,8 +618,10 @@
:data="upload.data" :data="upload.data"
:auto-upload="false"> :auto-upload="false">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button> <el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" ref="removeFile" @click="upload.fileList = []">移除文件</el-button> <el-button style="margin-left: 10px;" size="small" @click="upload.fileList = []">移除文件</el-button>
<div slot="tip" class="el-upload__tip">提示最多可上传三份且每份文件不超过20M</div> <div slot="tip" class="el-upload__tip">1最多可上传三份且每份文件不超过20M
<br>2仅支持bmpgif, jpg, jpeg, png, doc, docx, xls, xlsx, ppt, pptx, html, htm, txt, rar, zip, gz, bz2, pdf格式文件
</div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</div> </div>
@ -797,6 +799,7 @@ export default {
// //
multiple: true multiple: true
}, },
timer: null,
rules: { rules: {
name: [ name: [
{ required: true, trigger: "blur", message: "请填写姓名" }, { required: true, trigger: "blur", message: "请填写姓名" },
@ -853,7 +856,7 @@ export default {
submit(){ submit(){
if (this.submitFlag) { if (this.submitFlag) {
this.$message({ this.$message({
message: "请勿重复提交", message: "请勿重复提交1分钟后重试",
type: "warning", type: "warning",
}); });
return; return;
@ -863,7 +866,7 @@ export default {
this.submitFlag = true; this.submitFlag = true;
this.form.medicalReport = []; this.form.medicalReport = [];
if(this.upload.fileList.length > 0){ if(this.upload.fileList.length > 0){
this.$refs.upload.submit();removeFile this.$refs.upload.submit();
}else{ }else{
this.addCustomerHealthy(); this.addCustomerHealthy();
} }
@ -882,6 +885,7 @@ export default {
this.healthyData['arrayName'].forEach(function (item, index) { this.healthyData['arrayName'].forEach(function (item, index) {
cusMessage[item] = cusMessage[item] != null ? cusMessage[item].join(",") : null; cusMessage[item] = cusMessage[item] != null ? cusMessage[item].join(",") : null;
}); });
this.timer = setTimeout(this.fail,1000*60);
addCustomerHealthy(cusMessage).then((response) => { addCustomerHealthy(cusMessage).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.$notify({ this.$notify({
@ -889,12 +893,16 @@ export default {
message: "", message: "",
type: "success", type: "success",
}); });
}else{
this.submitFlag = false;
this.upload.isUploading = false;
} }
}).catch(function() {
console.log("error");
}); });
}, },
fail(){
console.log("fail");
this.submitFlag = false;
this.upload.isUploading = false;
},
nextStep(step){ nextStep(step){
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if(valid || step < 0){ if(valid || step < 0){
@ -954,7 +962,7 @@ export default {
}, },
// //
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
console.log(file.name); //console.log(file.name);
if(response != null && response.code === 200){ if(response != null && response.code === 200){
this.form.medicalReport.push(response.fileName); this.form.medicalReport.push(response.fileName);
this.form.medicalReportName.push(file.name); this.form.medicalReportName.push(file.name);
@ -963,16 +971,14 @@ export default {
this.addCustomerHealthy(); this.addCustomerHealthy();
} }
}else{ }else{
this.upload.isUploading = false; this.fail();
this.submitFlag = false;
this.$message.error('文件上传失败,请检查文件格式'); this.$message.error('文件上传失败,请检查文件格式');
} }
}, },
// //
handleFileFail(err, file, fileList){ handleFileFail(err, file, fileList){
this.$message.error('文件上传失败,请检查文件格式'); this.$message.error('文件上传失败,请检查文件格式');
this.upload.isUploading = false; this.fail();
this.submitFlag = false;
}, },
//湿 //湿
getMoistureDictData() { getMoistureDictData() {