From b89225bc6a2b3cda2b1ad5ebe211cb97beed6246 Mon Sep 17 00:00:00 2001 From: xiezhijun <15270898033@163.com> Date: Tue, 2 Feb 2021 20:29:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=81=A5=E5=BA=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/SysCustomerHealthyController.java | 4 +- .../service/ISysCustomerHealthyService.java | 15 +- .../impl/SysCustomerHealthyServiceImpl.java | 78 +- .../custom/SysCustomerHealthyMapper.xml | 2 +- .../custom/SysCustomerPhysicalSignsMapper.xml | 4 +- .../mapper/custom/SysOrderMapper.xml | 4 +- .../HealthyForm/EditHealthyFile.vue | 185 ++++ .../src/components/HealthyForm/Form1.vue | 131 +++ .../src/components/HealthyForm/Form2.vue | 110 +++ .../src/components/HealthyForm/Form3.vue | 111 +++ .../src/components/HealthyForm/Form4.vue | 197 +++++ .../src/components/HealthyForm/Form5.vue | 206 +++++ .../src/components/HealthyForm/Form6.vue | 121 +++ .../src/components/HealthyForm/Form7.vue | 104 +++ .../src/components/HealthyForm/Form8.vue | 258 ++++++ .../src/components/HealthyForm/Form9.vue | 174 ++++ .../src/components/HealthyForm/index.vue | 80 ++ .../components/PhysicalSignsDialog/index.vue | 34 +- .../components/PhysicalSignsEdit/index.vue | 185 ++++ .../custom/commision/detail_day/index.vue | 2 +- .../custom/subhealthy/investigation/index.vue | 811 +----------------- 21 files changed, 1959 insertions(+), 857 deletions(-) create mode 100644 stdiet-ui/src/components/HealthyForm/EditHealthyFile.vue create mode 100644 stdiet-ui/src/components/HealthyForm/Form1.vue create mode 100644 stdiet-ui/src/components/HealthyForm/Form2.vue create mode 100644 stdiet-ui/src/components/HealthyForm/Form3.vue create mode 100644 stdiet-ui/src/components/HealthyForm/Form4.vue create mode 100644 stdiet-ui/src/components/HealthyForm/Form5.vue create mode 100644 stdiet-ui/src/components/HealthyForm/Form6.vue create mode 100644 stdiet-ui/src/components/HealthyForm/Form7.vue create mode 100644 stdiet-ui/src/components/HealthyForm/Form8.vue create mode 100644 stdiet-ui/src/components/HealthyForm/Form9.vue create mode 100644 stdiet-ui/src/components/HealthyForm/index.vue create mode 100644 stdiet-ui/src/components/PhysicalSignsEdit/index.vue diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java index ba3e78ea1..b23ec1bab 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerHealthyController.java @@ -85,7 +85,7 @@ public class SysCustomerHealthyController extends BaseController @PostMapping public AjaxResult add(@RequestBody SysCustomerHealthy sysCustomerHealthy) { - return AjaxResult.success(); + return sysCustomerHealthyService.insertSysCustomerHealthy(sysCustomerHealthy); } /** @@ -96,7 +96,7 @@ public class SysCustomerHealthyController extends BaseController @PutMapping public AjaxResult edit(@RequestBody SysCustomerHealthy sysCustomerHealthy) { - return AjaxResult.success(); + return toAjax(sysCustomerHealthyService.updateSysCustomerHealthy(sysCustomerHealthy)); } /** diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java index def3df440..16ddda9cb 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/ISysCustomerHealthyService.java @@ -30,14 +30,6 @@ public interface ISysCustomerHealthyService */ public List selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy); - /** - * 新增或修改客户健康(已弃用) - * - * @param sysCustomerHealthy 客户健康 - * @return 结果 - */ - public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); - /** * 新增客户健康 * @@ -46,6 +38,13 @@ public interface ISysCustomerHealthyService */ public AjaxResult insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + /** + * 编辑客户健康 + * @param sysCustomerHealthy + * @return + */ + public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy); + /** * 批量删除客户健康 * diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java index 959830ab9..a3f1ea3c0 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/SysCustomerHealthyServiceImpl.java @@ -54,72 +54,6 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService return sysCustomerHealthyMapper.selectSysCustomerHealthyList(sysCustomerHealthy); } - /** - * 新增客户健康(已弃用) - * - * @param sysCustomerHealthy 客户健康 - * @return 结果 - */ - @Override - public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy) - { - //当前登录用户 - //LoginUser loginUser = SecurityUtils.getLoginUser(); - Long cutomerId = 0L; - //新增 - if(sysCustomerHealthy.getId() == null){ - //根据手机号查询客户健康信息,判断是否已存在 - SysCustomerHealthy customerHealthy = selectSysCustomerHealthyByPhone(sysCustomerHealthy.getPhone()); - if(customerHealthy != null){ - return AjaxResult.error("该手机号已存在"); - } - //根据手机号查询客户基础信息,判断是否已存在 - SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(sysCustomerHealthy.getPhone()); - if(phoneCustomer != null){ - if(!sysCustomerHealthy.getName().equals(phoneCustomer.getName())){ - return AjaxResult.error("该手机号与姓名不符"); - } - cutomerId = phoneCustomer.getId(); - }else{ - SysCustomer newSysCustomer = new SysCustomer(); - newSysCustomer.setName(sysCustomerHealthy.getName()); - newSysCustomer.setPhone(sysCustomerHealthy.getPhone()); - if(sysCustomerService.insertSysCustomer(newSysCustomer) > 0){ - cutomerId = newSysCustomer.getId(); - } - } - } - //更新 - else{ - SysCustomer oldCustomer = sysCustomerService.selectSysCustomerById(sysCustomerHealthy.getCustomerId()); - //如果修改了手机号,则需要判断手机号是否已经存在 - if(oldCustomer != null && !oldCustomer.getPhone().equals(sysCustomerHealthy.getPhone())) { - //验证该手机号是否已存在客户健康信息 - SysCustomerHealthy customerHealthy = selectSysCustomerHealthyByPhone(sysCustomerHealthy.getPhone()); - if (customerHealthy != null) { - return AjaxResult.error("该手机号已存在"); - } - //根据手机号查询客户基础信息,判断是否已存在 - SysCustomer phoneCustomer = sysCustomerService.getCustomerByPhone(sysCustomerHealthy.getPhone()); - if(phoneCustomer != null) { - return AjaxResult.error("该手机号已存在"); - } - } - SysCustomer newSysCustomer = new SysCustomer(); - newSysCustomer.setId(sysCustomerHealthy.getCustomerId()); - newSysCustomer.setName(sysCustomerHealthy.getName()); - newSysCustomer.setPhone(sysCustomerHealthy.getPhone()); - if(sysCustomerService.updateSysCustomer(newSysCustomer) > 0){ - cutomerId = newSysCustomer.getId(); - } - } - int rows = 0; - if(cutomerId != null && cutomerId > 0){ - sysCustomerHealthy.setCustomerId(cutomerId); - rows = sysCustomerHealthy.getId() == null ? sysCustomerHealthyMapper.insertSysCustomerHealthy(sysCustomerHealthy) : sysCustomerHealthyMapper.updateSysCustomerHealthy(sysCustomerHealthy); - } - return rows > 0 ? AjaxResult.success() : AjaxResult.error(); - } /** * 新增客户健康 @@ -130,7 +64,7 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService public AjaxResult insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy){ //客户ID解密 String customerId = StringUtils.isNotEmpty(sysCustomerHealthy.getCustomerEncId()) ? AesUtils.decrypt(sysCustomerHealthy.getCustomerEncId(), null) : ""; - if(StringUtils.isEmpty(customerId)){ + if(sysCustomerHealthy.getCustomerId() == null && StringUtils.isEmpty(customerId)){ return AjaxResult.error("客户不存在"); } //判断客户是否存在 @@ -149,6 +83,16 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService return rows > 0 ? AjaxResult.success() : AjaxResult.error(); } + /** + * 编辑客户健康 + * @param sysCustomerHealthy + * @return + */ + @Override + public int updateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy){ + return sysCustomerHealthyMapper.updateSysCustomerHealthy(sysCustomerHealthy); + } + /** * 批量删除客户健康 * diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml index bf11ab505..ebc4b40c6 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerHealthyMapper.xml @@ -153,7 +153,7 @@ from sys_customer_healthy as sch left join sys_customer sc on sc.id = sch.customer_id LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'conditioning_project') AS cp ON cp.dict_value = sch.conditioning_project_id - where sch.del_flag = 0 and sc.del_flag = 0 and sch.customer_id = #{customerId} + where sch.del_flag = 0 and sc.del_flag = 0 and sch.customer_id = #{customerId} order by sch.id desc limit 1 diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml index cff20111f..1caea24d6 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerPhysicalSignsMapper.xml @@ -69,7 +69,9 @@ diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysOrderMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysOrderMapper.xml index 62f469973..0bac02658 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysOrderMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysOrderMapper.xml @@ -327,9 +327,9 @@ and (su_sale.user_id = #{userId} or su_nutritionist.user_id = #{userId}) - + AND DATE_FORMAT(o.order_time,'%Y-%m-%d') <= #{endTime} diff --git a/stdiet-ui/src/components/HealthyForm/EditHealthyFile.vue b/stdiet-ui/src/components/HealthyForm/EditHealthyFile.vue new file mode 100644 index 000000000..23d627bd3 --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/EditHealthyFile.vue @@ -0,0 +1,185 @@ + + + + + diff --git a/stdiet-ui/src/components/HealthyForm/Form1.vue b/stdiet-ui/src/components/HealthyForm/Form1.vue new file mode 100644 index 000000000..74f820615 --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/Form1.vue @@ -0,0 +1,131 @@ + + + + diff --git a/stdiet-ui/src/components/HealthyForm/Form2.vue b/stdiet-ui/src/components/HealthyForm/Form2.vue new file mode 100644 index 000000000..5c42c78b4 --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/Form2.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/stdiet-ui/src/components/HealthyForm/Form3.vue b/stdiet-ui/src/components/HealthyForm/Form3.vue new file mode 100644 index 000000000..837a7061b --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/Form3.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/stdiet-ui/src/components/HealthyForm/Form4.vue b/stdiet-ui/src/components/HealthyForm/Form4.vue new file mode 100644 index 000000000..4c72eccff --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/Form4.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/stdiet-ui/src/components/HealthyForm/Form5.vue b/stdiet-ui/src/components/HealthyForm/Form5.vue new file mode 100644 index 000000000..8f3e07b1d --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/Form5.vue @@ -0,0 +1,206 @@ + + + + + diff --git a/stdiet-ui/src/components/HealthyForm/Form6.vue b/stdiet-ui/src/components/HealthyForm/Form6.vue new file mode 100644 index 000000000..55be8660a --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/Form6.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/stdiet-ui/src/components/HealthyForm/Form7.vue b/stdiet-ui/src/components/HealthyForm/Form7.vue new file mode 100644 index 000000000..e967675cb --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/Form7.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/stdiet-ui/src/components/HealthyForm/Form8.vue b/stdiet-ui/src/components/HealthyForm/Form8.vue new file mode 100644 index 000000000..6c5d1b18d --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/Form8.vue @@ -0,0 +1,258 @@ + + + + + diff --git a/stdiet-ui/src/components/HealthyForm/Form9.vue b/stdiet-ui/src/components/HealthyForm/Form9.vue new file mode 100644 index 000000000..5338170cb --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/Form9.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/stdiet-ui/src/components/HealthyForm/index.vue b/stdiet-ui/src/components/HealthyForm/index.vue new file mode 100644 index 000000000..d1612fb07 --- /dev/null +++ b/stdiet-ui/src/components/HealthyForm/index.vue @@ -0,0 +1,80 @@ + + + + diff --git a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue index a2a1f4f0c..6e54587cb 100644 --- a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue +++ b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue @@ -1,7 +1,9 @@ diff --git a/stdiet-ui/src/components/PhysicalSignsEdit/index.vue b/stdiet-ui/src/components/PhysicalSignsEdit/index.vue new file mode 100644 index 000000000..9de4f9668 --- /dev/null +++ b/stdiet-ui/src/components/PhysicalSignsEdit/index.vue @@ -0,0 +1,185 @@ + + + + diff --git a/stdiet-ui/src/views/custom/commision/detail_day/index.vue b/stdiet-ui/src/views/custom/commision/detail_day/index.vue index d4aee5002..eb9f16991 100644 --- a/stdiet-ui/src/views/custom/commision/detail_day/index.vue +++ b/stdiet-ui/src/views/custom/commision/detail_day/index.vue @@ -21,7 +21,7 @@ /> - + -
-

{{healthyData['titleArray'][0]}}

-

请您确认下方姓名、手机号是否正确

- - + + + + + + + + + + + 上一步 + 下一步 + 提交数据 - - - - - - - - - - - - - - - - - - - - - - - - - - 南方 - 北方 - - -
-
-

{{healthyData['titleArray'][1]}}

-

1、减脂经历

- - - - - - - - - - - - - - - - - - -
-
-

{{healthyData['titleArray'][2]}}

-

1、家庭调味品

- - - {{item.name}} - -
其他调味品
-
-

2、喜好的烹调方式和周频次

- - - {{item.name}} - - - -
- {{healthyData['cookingStyleRateArray'][0]}}  次 - {{healthyData['cookingStyleRateArray'][1]}}  次 -
-
- {{healthyData['cookingStyleRateArray'][2]}}  次 - {{healthyData['cookingStyleRateArray'][3]}}  次 -
-
- {{healthyData['cookingStyleRateArray'][4]}}  次 - {{healthyData['cookingStyleRateArray'][5]}}  次 -
-
-

3、洗菜方式

- - - {{item.name}} - -
其他洗菜方式
-
-
- -
-

{{healthyData['titleArray'][3]}}

-

1、您三餐的习惯

- - - {{item.name}} - -
早餐通常吃 
-
- - - {{item.name}} - - - - - {{item.name}} - - - - - - - - -

2、您晚餐时间点和夜宵习惯

- - - - - - - - - -

3、您的饮食偏好

- - - {{item.name}} - - - - - {{item.name}} - - -

4、生食果蔬状况

- - - - - - {{item.name}} - - - - - - {{item.name}} - - - - - {{item.name}} - - -

5、饮食习惯

- -
-  碗饭 -  成饱 -
-
- - - {{item.name}} - - - - - - - - -

6、您常吃的零食

- - - {{item.name}} - -
其他零食
-
-

7、服用营养保健品状况

- - - - - -
营养保健品牌名
-
营养保健产品名
-
- -
-  次/周 -  次/天 -
-
-

8、忌口或过敏食物

- - - -
- -
-

{{healthyData['titleArray'][4]}}

-

1、您每天的饮水习惯

- - - - - - {{item.name}} - - - - - {{item.name}} - - -

2、您常喝的饮品和每周频次

- -
- {{healthyData['drinksNumArray'][0]}}  次 -
-
- {{healthyData['drinksNumArray'][1]}}  次 -
-
- {{healthyData['drinksNumArray'][2]}}  次 -
-
- {{healthyData['drinksNumArray'][3]}}  次 -
-
- {{healthyData['drinksNumArray'][4]}}  次 -
-
- {{healthyData['drinksNumArray'][5]}}  次 -
-
- {{healthyData['drinksNumArray'][6]}}  次 -
-
- {{healthyData['drinksNumArray'][7]}}  次 -
-
-

3、您的饮酒习惯

- - - {{item.name}} - - - - - {{item.name}} - -
其他酒
-
- -
- {{healthyData['drinkWineAmountArray'][0]}} 两 -
-
- {{healthyData['drinkWineAmountArray'][1]}} 瓶 -
-
- {{healthyData['drinkWineAmountArray'][2]}} 毫升 -
- -
-

4、您的吸烟习惯

- - - - - - - -
- {{healthyData['smokeRateArray'][0]}} -
-
- {{healthyData['smokeRateArray'][1]}} -
-
- {{healthyData['smokeRateArray'][2]}} -
-
- - - - - - -

4、您的工作状态

- - - - - - {{item.name}} - - -

4、您的排便状况

- - -
排便次数 次/天
-
- - - - {{item.name}} - - - -
- 形状 -
-
- 气味 -
-
- 速度 -
-
- 颜色 -
-
-
- -
-

{{healthyData['titleArray'][5]}}

-

1、运动频率

- -
- 每周运动次数 -
-
- 每次运动时长分钟 -
-
- 每天运动时间 -
-
-

2、运动方式、项目

- - -
有氧运动 - - {{item.name}} - -
-
无氧运动 - - {{item.name}} - -
-
有氧无氧结合运动 - - {{item.name}} - -
-
其他项目
-
- - - {{item.name}} - -
其他场地
-
-
- -
-

{{healthyData['titleArray'][6]}}

-

1、您的睡眠状况

- - - - - - {{item.name}} - - -

2、辅助入睡药物情况

- - - - - -
辅助药物名称
-
-

3、熬夜情况

- - - - - -
- 熬夜频率 次/周 -
-
-
-
-

{{healthyData['titleArray'][7]}}

-

1、本人病史情况

- - - - - -
其他病史体征 - -
-
-

2、湿气、气血测试

- - - {{ moistureItem.dictLabel }} - - - - - {{ moistureItem.dictLabel }} - - - -

3、家族疾病史情况

- - - {{item.name}} - -
其他家族病史 - -
-
-

4、手术情况

- - - {{item.name}} - -
其他手术史 -
-
- - - - - -
手术恢复情况 - -
-
-

5、药物情况

- - - - - - - - - {{item.name}} - -
其他长期服用的药物 - -
-
-

6、过敏史

- - - - - -
过敏症状 - -
-
- - - - {{item.name}} - -
其他过敏源 - -
-
-
- -
-

{{healthyData['titleArray'][8]}}

-

1、体检报告

- - - 选取文件 - 移除文件 -
1、最多可上传三份,且每份文件不超过20M -
2、仅支持bmp,gif, jpg, jpeg, png, doc, docx, xls, xlsx, ppt, pptx, html, htm, txt, rar, zip, gz, bz2, pdf格式文件 -
-
-
-
- - 上一步 - 下一步 - 提交数据 - -
@@ -655,25 +30,24 @@ import { getDictData,addCustomerHealthy,physicalSignsList,getCustomerBaseMessage } from "@/api/custom/customerInvestigation"; import * as healthyData from "@/utils/healthyData"; const logo = require("@/assets/logo/st_logo.png"); +import Form1 from "@/components/HealthyForm/Form1"; +import Form2 from "@/components/HealthyForm/Form2"; +import Form3 from "@/components/HealthyForm/Form3"; +import Form4 from "@/components/HealthyForm/Form4"; +import Form5 from "@/components/HealthyForm/Form5"; +import Form6 from "@/components/HealthyForm/Form6"; +import Form7 from "@/components/HealthyForm/Form7"; +import Form8 from "@/components/HealthyForm/Form8"; +import Form9 from "@/components/HealthyForm/Form9"; export default { name: "index", data() { - const checkReportFile = (rule, value, callback) => { - if (this.upload.fileList == null || this.upload.fileList.length === 0) { - return callback(new Error('请选择需要上传的体检报告')) - } - callback(); - }; return { //客户是否存在标识 customerExistFlag:false, healthyData:healthyData, logo, submitFlag: false, - conditioningProjectIdOption:[], - physicalSignsList: [], - moistureDataList:[], - bloodDataList:[], stepArray: [true,false,false,false,false,false,false,false,false], stepActive: 0, form: { @@ -778,36 +152,14 @@ export default { medicalReportName:[], position:0, experience: null, - rebound: 0, + rebound: 1, difficulty:null, - crux:0, + crux:1, dishesIngredient:null, makeFoodType:3 }, - upload: { - // 是否禁用上传 - isUploading: false, - // 上传的地址 - url: process.env.VUE_APP_BASE_API + "/common/customerUploadFile", - // 设置上传的请求头部 - headers: {}, - // 其他需要携带的数据 - data:{}, - //文件列表 - fileList:[], - //同时上传文件上限 - limit: 3, - //每个文件大小 - fileSize: 1024 * 1024 * 20, - //是否支持同时选择多张 - multiple: true - }, timer: null, rules: { - /*name: [ - { required: true, trigger: "blur", message: "请填写姓名" }, - { min: 1, max: 20, trigger: "blur", message: "姓名过长" }, - ],*/ sex: [{ required: true, trigger: "blur", message: "请选择性别" }], age: [ { required: true, trigger: "blur", message: "请填写年龄" }, @@ -836,16 +188,6 @@ export default { message: "体重格式不正确", }, ], - /*phone: [ - { required: true, trigger: "blur", message: "请填写手机号" }, - { required: true, trigger: "blur", message: "请填写正确的手机号" }, - { - required: true, - trigger: "blur", - pattern: /^[0-9]{5,11}$/, - message: "手机号格式不正确", - }, - ],*/ conditioningProjectId:[ { required: true, trigger: "blur", message: "请选择调理项目" } ], @@ -855,6 +197,17 @@ export default { } }; }, + components: { + 'healthy-form1': Form1, + 'healthy-form2': Form2, + 'healthy-form3': Form3, + 'healthy-form4': Form4, + 'healthy-form5': Form5, + 'healthy-form6': Form6, + 'healthy-form7': Form7, + 'healthy-form8': Form8, + 'healthy-form9': Form9, + }, methods: { //根据用户ID获取用户基本信息(手机号、姓名) getCustomerBase(id){ @@ -864,7 +217,6 @@ export default { getCustomerBaseMessage(id).then((response) => { if (response.code === 200) { if(response.data){ - console.log(response.data); this.customerExistFlag = true; this.form.name = response.data.name; this.form.phone = response.data.phone; @@ -885,20 +237,15 @@ export default { this.$refs.form.validate((valid) => { if (valid) { this.submitFlag = true; - this.form.medicalReport = []; - if(this.upload.fileList.length > 0){ - this.$refs.upload.submit(); - }else{ - this.addCustomerHealthy(); - } + this.timer = setTimeout(this.fail,1000*60); + this.$refs.fileForm.uploadFile(); } else { this.$message({ - message: "数据未填写完整", - type: "warning", - }); - } - }); - + message: "数据未填写完整", + type: "warning", + }); + } + }); }, addCustomerHealthy(){ //数据处理 @@ -906,7 +253,6 @@ export default { this.healthyData['arrayName'].forEach(function (item, index) { cusMessage[item] = cusMessage[item] != null ? cusMessage[item].join(",") : null; }); - //this.timer = setTimeout(this.fail,1000*60); addCustomerHealthy(cusMessage).then((response) => { if (response.code === 200) { this.$notify({ @@ -920,8 +266,8 @@ export default { }); }, fail(){ + console.log("定时--------"); this.submitFlag = false; - this.upload.isUploading = false; }, nextStep(step){ if(!this.customerExistFlag){ @@ -945,82 +291,11 @@ export default { goTop (){ window.scroll(0, 0); }, - getDict(type){ - getDictData(type).then(response => { - this.conditioningProjectIdOption = response.data; - }); - }, - //监控上传文件列表 - handleFileChange(file, fileList) { - let sizeFlag = file.size > this.upload.fileSize; - if (sizeFlag) { - this.$message({ - message: "当前文件过大", - type: "warning", - }); - fileList.pop(); - } - this.upload.fileList = fileList; - }, - // 文件数量超过限度 - handleFileexceed(file, fileList){ - //console.log(this.upload.fileList.length); - this.$message({ - message: "最多可上传"+ this.upload.limit +"份文件", - type: "warning", - }); - }, - // 文件上传中处理 - handleFileUploadProgress(event, file, fileList) { - this.upload.isUploading = true; - }, - // 文件上传成功处理 - handleFileSuccess(response, file, fileList) { - //console.log(file.name); - if(response != null && response.code === 200){ - this.form.medicalReport.push(response.fileName); - this.form.medicalReportName.push(file.name); - if(this.form.medicalReport.length === this.upload.fileList.length){ - //文件全部上传成功,则调用添加客户信息方法 - this.addCustomerHealthy(); - } - }else{ - this.fail(); - this.$message.error('文件上传失败,请检查文件格式'); - } - }, - // 文件上传失败处理 - handleFileFail(err, file, fileList){ - this.$message.error('文件上传失败,请检查文件格式'); - this.fail(); - }, - //获取湿气 - getMoistureDictData() { - getDictData("sys_blood_data").then((response) => { - this.moistureDataList = response.data; - }); - }, - //获取气血 - getBloodDictData() { - getDictData("sys_moisture_data").then((response) => { - this.bloodDataList = response.data; - }); - }, - /** 查询体征列表 */ - getPhysicalSignsList() { - physicalSignsList().then((response) => { - this.physicalSignsList = response.rows; - }); - }, }, created() { this.form.customerEncId = this.$route.params.id; this.getCustomerBase(this.form.customerEncId); - this.getDict("conditioning_project"); - this.getPhysicalSignsList(); - this.getMoistureDictData(); - this.getBloodDictData(); }, beforeCreate() { document.title = this.$route.meta.title;