diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java index ffe435bc5..4af1aad63 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomerPhysicalSigns.java @@ -1,6 +1,7 @@ package com.stdiet.custom.domain; import com.alibaba.fastjson.JSONArray; +import com.fasterxml.jackson.annotation.JsonFormat; import com.stdiet.common.annotation.Excel; import lombok.Data; @@ -224,6 +225,7 @@ public class SysCustomerPhysicalSigns { private JSONArray avoidFood; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") private Date createTime; private Date updateTime; diff --git a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue index 79b223773..fdfb923be 100644 --- a/stdiet-ui/src/components/PhysicalSignsDialog/index.vue +++ b/stdiet-ui/src/components/PhysicalSignsDialog/index.vue @@ -16,22 +16,21 @@ <el-button type="info" v-show="dataType == 0" - @click="generateReport()" + @click="generateReport" plain >下载报告</el-button > <el-button type="info" v-show="dataType == 0" - @click="handleEditGuidanceClick()" + @click="handleEditGuidanceClick" plain >减脂指导</el-button > <el-button v-hasPermi="['custom:healthy:edit']" type="info" - v-show="dataType == 0" - @click="handleEditRemarkClick()" + @click="handleEditRemarkClick" plain >修改备注</el-button > @@ -39,14 +38,14 @@ v-hasPermi="['custom:healthy:edit']" type="warning" v-show="dataType == 0" - @click="handleEditHealthyClick()" + @click="handleEditHealthyClick" plain >修改信息</el-button > <el-button type="danger" v-hasPermi="['custom:healthy:remove']" - @click="handleDelete()" + @click="handleDelete" plain >删除信息</el-button > @@ -177,28 +176,39 @@ </div> </div> <!-- 客户体征 --> - <div v-else> - <table-detail-message - v-show="dataList.length > 0" - :data="dataList" - ></table-detail-message> - <div - v-show="dataList.length == 0" - style="font-size: 20px; text-align: center" + <div v-else-if="dataList.length > 0 && dataType === 1"> + <table-detail-message v-show="dataList.length > 0" :data="dataList" /> + <!-- 备注 --> + <el-table + :data="remarkList" + :show-header="false" + border + :cell-style="remarkColumnStyle" + style="width: 100%" > - <VueQr :text="copyValue" :logoSrc="logo" :size="256" /> - <div style="text-align: center; margin-top: 20px"> - <el-button - icon="el-icon-share" - size="small" - title="点击复制链接" - class="copyBtn" - type="primary" - :data-clipboard-text="copyValue" - @click="handleCopy()" - >健康评估表链接 - </el-button> - </div> + <el-table-column width="140" prop="remarkTitle"> </el-table-column> + <el-table-column prop="remarkValue"> + <template slot-scope="scope"> + <auto-hide-message + :data="scope.row.remarkValue" + :maxLength="100" + /></template> + </el-table-column> + </el-table> + </div> + <div v-else style="font-size: 20px; text-align: center"> + <VueQr :text="copyValue" :logoSrc="logo" :size="256" /> + <div style="text-align: center; margin-top: 20px"> + <el-button + icon="el-icon-share" + size="small" + title="点击复制链接" + class="copyBtn" + type="primary" + :data-clipboard-text="copyValue" + @click="handleCopy()" + >健康评估表链接 + </el-button> </div> </div> </div> @@ -207,19 +217,19 @@ <physicalSigns-guidance ref="physicalSignsGuidanceDialog" @close="editGuidanceShow(false)" - @refreshHealthyData="getCustomerHealthyByCusId()" + @refreshHealthyData="getCustomerHealthyByCusId" ></physicalSigns-guidance> </div> </div> <!-- 编辑 --> <physicalSigns-edit ref="physicalSignsEditDialog" - @refreshHealthyData="getCustomerHealthyByCusId()" + @refreshHealthyData="getCustomerHealthyByCusId" ></physicalSigns-edit> <!-- 编辑备注 --> <physicalSigns-remark ref="physicalSignsRemarkDialog" - @refreshHealthyData="getCustomerHealthyByCusId()" + @refreshHealthyData="getCustomerHealthyByCusId" ></physicalSigns-remark> </el-dialog> </template> @@ -433,9 +443,10 @@ export default { if (res.data.customerHealthy) { //判断是体征还是健康评估 this.dataType = res.data.type; + this.healthyData = res.data.customerHealthy; + this.dataList = []; + this.remarkList[0].remarkValue = this.healthyData.remark; if (this.dataType == 0) { - this.healthyData = Object.assign({}, res.data.customerHealthy); - this.remarkList[0].remarkValue = this.healthyData.remark; this.guidanceList[0].guidanceValue = this.healthyData.guidance; this.getDataListByHealthyMessage(res.data.customerHealthy); } else { @@ -847,7 +858,8 @@ export default { handleEditRemarkClick() { this.$refs["physicalSignsRemarkDialog"].showDialog( this.data, - this.healthyData + this.healthyData, + this.dataType ); }, handleEditGuidanceClick() { diff --git a/stdiet-ui/src/components/PhysicalSignsRemark/index.vue b/stdiet-ui/src/components/PhysicalSignsRemark/index.vue index a2d43b832..ab3b89249 100644 --- a/stdiet-ui/src/components/PhysicalSignsRemark/index.vue +++ b/stdiet-ui/src/components/PhysicalSignsRemark/index.vue @@ -1,49 +1,61 @@ <template> - <el-dialog :visible.sync="visible" :title="title" width="500px" append-to-body @closed="onClosed"> - <el-form ref="form" :model="form" :rules="rules" label-position="top" label-width="100px"> - <el-form-item label="" prop="remark" > + <el-dialog + :visible.sync="visible" + :title="title" + width="500px" + append-to-body + @closed="onClosed" + > + <el-form + ref="form" + :model="form" + :rules="rules" + label-position="top" + label-width="100px" + > + <el-form-item label="" prop="remark"> <el-input type="textarea" :rows="6" maxlength="300" show-word-limit placeholder="请输入备注" - v-model="form.remark"> + v-model="form.remark" + > </el-input> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submit()">确 定</el-button> - <el-button @click="onClosed()">取 消</el-button> + <el-button type="primary" @click="submit">确 定</el-button> + <el-button @click="onClosed">取 消</el-button> </div> </el-dialog> </template> <script> -import { getCustomerPhysicalSignsByCusId } from "@/api/custom/customer"; import { updateHealthy } from "@/api/custom/healthy"; +import { editPhysicalSigns } from "@/api/custom/healthy"; export default { name: "PhysicalSignsRemark", - components: { - - }, + components: {}, data() { return { visible: false, title: "", data: undefined, + type: 0, form: { id: null, - remark: null + remark: null, }, - rules: { - - } + rules: {}, }; }, methods: { - showDialog(data, healthy) { + showDialog(data, healthy, type) { + console.log(healthy) this.data = data; - this.title = "修改"+`「${data.name}」`+"备注"; + this.type = type; + this.title = "修改" + `「${data.name}」` + "备注"; this.form.id = healthy.id; this.form.remark = healthy.remark; this.visible = true; @@ -52,37 +64,39 @@ export default { this.visible = false; this.data = null; }, - submit(){ + submit() { this.$refs.form.validate((valid) => { if (valid) { this.editCustomerHealthy(); } else { - this.$message({message: "数据未填写完整", type: "warning"}); + this.$message({ message: "数据未填写完整", type: "warning" }); } }); }, - editCustomerHealthy(){ - updateHealthy(this.form).then((response) => { - if (response.code === 200) { - this.msgSuccess("修改成功"); - this.onClosed(); - this.$emit('refreshHealthyData'); - } - }).catch(function() { - console.log("error"); - }); - } - } + editCustomerHealthy() { + (this.type === 0 ? updateHealthy : editPhysicalSigns)(this.form) + .then((response) => { + if (response.code === 200) { + this.msgSuccess("修改成功"); + this.onClosed(); + this.$emit("refreshHealthyData"); + } + }) + .catch(function () { + console.log("error"); + }); + }, + }, }; </script> <style scoped> - .margin-top-20{ - margin-top:20px; - } - .p_title_1{ - font-size: 18px; - font-weight: bold; - margin-top: 20px; - } +.margin-top-20 { + margin-top: 20px; +} +.p_title_1 { + font-size: 18px; + font-weight: bold; + margin-top: 20px; +} </style> diff --git a/stdiet-ui/src/views/custom/customer/index.vue b/stdiet-ui/src/views/custom/customer/index.vue index 127446616..8150bdd56 100644 --- a/stdiet-ui/src/views/custom/customer/index.vue +++ b/stdiet-ui/src/views/custom/customer/index.vue @@ -74,9 +74,7 @@ <el-button type="cyan" icon="el-icon-search" @click="handleQuery" >搜索</el-button > - <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" - >重置</el-button - > + <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> </el-form-item> </el-form>