合并
This commit is contained in:
commit
c507057f63
@ -9,8 +9,8 @@ stdiet:
|
|||||||
# 实例演示开关
|
# 实例演示开关
|
||||||
demoEnabled: true
|
demoEnabled: true
|
||||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||||
#profile: /Users/wonder/Documents/Workspaces/java/ShengtangManage/running/uploadPath
|
profile: /Users/wonder/Documents/Workspaces/java/ShengtangManage/running/uploadPath
|
||||||
profile: D:/ruoyi/uploadPath
|
# profile: D:/ruoyi/uploadPath
|
||||||
# 获取ip地址开关
|
# 获取ip地址开关
|
||||||
addressEnabled: false
|
addressEnabled: false
|
||||||
# 验证码类型 math 数组计算 char 字符验证
|
# 验证码类型 math 数组计算 char 字符验证
|
||||||
|
@ -20,8 +20,8 @@ public class MyApplicationRunner implements ApplicationRunner {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
/* System.out.println("项目启动调用方法");
|
System.out.println("项目启动调用方法");
|
||||||
String path = AliyunOSSUtils.uploadFileInputSteam(AliyunOSSConfig.casePrefix,"ceshi.png",new File("D:\\ceshi.png"));
|
// String path = AliyunOSSUtils.uploadFileInputSteam(AliyunOSSConfig.casePrefix,"ceshi.png",new File("D:\\ceshi.png"));
|
||||||
System.out.println(path);*/
|
// System.out.println(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,7 @@
|
|||||||
"vue": "2.6.10",
|
"vue": "2.6.10",
|
||||||
"vue-count-to": "1.0.13",
|
"vue-count-to": "1.0.13",
|
||||||
"vue-cropper": "0.4.9",
|
"vue-cropper": "0.4.9",
|
||||||
|
"vue-qr": "^2.3.0",
|
||||||
"vue-router": "3.0.2",
|
"vue-router": "3.0.2",
|
||||||
"vue-scrollto": "^2.20.0",
|
"vue-scrollto": "^2.20.0",
|
||||||
"vue-splitpane": "1.0.4",
|
"vue-splitpane": "1.0.4",
|
||||||
|
@ -50,21 +50,27 @@
|
|||||||
width="200"
|
width="200"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column label="合同地址" align="center" prop="path">
|
||||||
label="合同地址"
|
|
||||||
align="center"
|
|
||||||
prop="path"
|
|
||||||
width="80"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
|
style="margin-right: 8px"
|
||||||
icon="el-icon-copy-document"
|
icon="el-icon-copy-document"
|
||||||
@click="handleCopy(scope.row.path)"
|
@click="handleCopy(scope.row.path)"
|
||||||
class="copyBtn"
|
class="copyBtn"
|
||||||
:data-clipboard-text="copyValue"
|
:data-clipboard-text="copyValue"
|
||||||
>复制
|
>复制
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-popover placement="top" trigger="click">
|
||||||
|
<VueQr :text="copyValue" :logoSrc="logo" />
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
icon="el-icon-picture-outline"
|
||||||
|
type="text"
|
||||||
|
@click="handleCopy(scope.row.path)"
|
||||||
|
>二维码</el-button
|
||||||
|
>
|
||||||
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" width="180">
|
<el-table-column label="操作" align="center" width="180">
|
||||||
@ -108,15 +114,18 @@ import { delContract, listContract } from "@/api/custom/contract";
|
|||||||
import ContractDetail from "@/components/ContractDetail";
|
import ContractDetail from "@/components/ContractDetail";
|
||||||
import Clipboard from "clipboard";
|
import Clipboard from "clipboard";
|
||||||
import ContractAdd from "@/components/ContractAdd";
|
import ContractAdd from "@/components/ContractAdd";
|
||||||
|
import VueQr from "vue-qr";
|
||||||
|
const logo = require("@/assets/logo/logo_b.png");
|
||||||
export default {
|
export default {
|
||||||
name: "CustomerContractDrawer",
|
name: "CustomerContractDrawer",
|
||||||
components: {
|
components: {
|
||||||
"contract-detail": ContractDetail,
|
"contract-detail": ContractDetail,
|
||||||
"add-contract": ContractAdd,
|
"add-contract": ContractAdd,
|
||||||
|
VueQr,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
logo,
|
||||||
visible: false,
|
visible: false,
|
||||||
title: "",
|
title: "",
|
||||||
data: undefined,
|
data: undefined,
|
||||||
|
@ -10,13 +10,31 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button icon="el-icon-share" size="small" title="点击复制链接" class="copyBtn" type="primary" :data-clipboard-text="copyValue" @click="handleCopy()">外食计算器</el-button>
|
<el-button
|
||||||
|
icon="el-icon-share"
|
||||||
|
size="small"
|
||||||
|
title="点击复制链接"
|
||||||
|
class="copyBtn"
|
||||||
|
type="primary"
|
||||||
|
:data-clipboard-text="copyValue"
|
||||||
|
@click="handleCopy()"
|
||||||
|
>外食计算器</el-button
|
||||||
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-popover :placement="bottom" trigger="click">
|
||||||
|
<VueQr :text="copyValue" :logoSrc="logo" />
|
||||||
|
<el-button slot="reference">二维码</el-button>
|
||||||
|
</el-popover>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table :data="foodHeatStatisticsList" >
|
<el-table :data="foodHeatStatisticsList">
|
||||||
<el-table-column label="日期" align="center" prop="edibleDate" width="120">
|
<el-table-column
|
||||||
|
label="日期"
|
||||||
|
align="center"
|
||||||
|
prop="edibleDate"
|
||||||
|
width="120"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.edibleDate, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.edibleDate, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="食材" align="center" prop="ingredient" />
|
<!-- <el-table-column label="食材" align="center" prop="ingredient" />
|
||||||
@ -27,62 +45,87 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="质量(克)" align="center" prop="quantity" />-->
|
<el-table-column label="质量(克)" align="center" prop="quantity" />-->
|
||||||
|
|
||||||
<el-table-column label="可摄入量" align="center" prop="maxHeatValue" />
|
<el-table-column
|
||||||
|
label="可摄入量"
|
||||||
|
align="center"
|
||||||
|
prop="maxHeatValue"
|
||||||
|
/>
|
||||||
<el-table-column label="食材热量" align="center" prop="heatValue" />
|
<el-table-column label="食材热量" align="center" prop="heatValue" />
|
||||||
<el-table-column label="热量缺口" align="center" prop="heatGap" />
|
<el-table-column label="热量缺口" align="center" prop="heatGap" />
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@click="handleDetail(scope.row)"
|
@click="handleDetail(scope.row)"
|
||||||
v-hasPermi="['custom:foodHeatStatistics:query']"
|
v-hasPermi="['custom:foodHeatStatistics:query']"
|
||||||
>详情</el-button>
|
>详情</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleCalculate(scope.row)"
|
@click="handleCalculate(scope.row)"
|
||||||
>计算</el-button>
|
>计算</el-button
|
||||||
|
>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleOnDeleteClick(scope.row)"
|
@click="handleOnDeleteClick(scope.row)"
|
||||||
v-hasPermi="['custom:foodHeatStatistics:remove']"
|
v-hasPermi="['custom:foodHeatStatistics:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="fetchHeatList"
|
@pagination="fetchHeatList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<heatStatisticsCalculate ref="heatStatisticsCalculateRef"></heatStatisticsCalculate>
|
<heatStatisticsCalculate
|
||||||
<heatStatisticsDetail ref="heatStatisticsDetailRef"></heatStatisticsDetail>
|
ref="heatStatisticsCalculateRef"
|
||||||
|
></heatStatisticsCalculate>
|
||||||
|
<heatStatisticsDetail
|
||||||
|
ref="heatStatisticsDetailRef"
|
||||||
|
></heatStatisticsDetail>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { listFoodHeatStatistics, getFoodHeatStatistics, delFoodHeatStatistics, addFoodHeatStatistics, updateFoodHeatStatistics, exportFoodHeatStatistics } from "@/api/custom/foodHeatStatistics";
|
import {
|
||||||
import Clipboard from 'clipboard';
|
listFoodHeatStatistics,
|
||||||
import HeatStatisticsCalculate from "@/components/HeatStatisticsCalculate";
|
getFoodHeatStatistics,
|
||||||
import HeatStatisticsDetail from "@/components/HeatStatisticsDetail";
|
delFoodHeatStatistics,
|
||||||
|
addFoodHeatStatistics,
|
||||||
|
updateFoodHeatStatistics,
|
||||||
|
exportFoodHeatStatistics,
|
||||||
|
} from "@/api/custom/foodHeatStatistics";
|
||||||
|
import Clipboard from "clipboard";
|
||||||
|
import HeatStatisticsCalculate from "@/components/HeatStatisticsCalculate";
|
||||||
|
import HeatStatisticsDetail from "@/components/HeatStatisticsDetail";
|
||||||
|
import VueQr from "vue-qr";
|
||||||
|
const logo = require("@/assets/logo/logo_b.png");
|
||||||
export default {
|
export default {
|
||||||
name: "HeatStatisticsDrawer",
|
name: "HeatStatisticsDrawer",
|
||||||
components: {
|
components: {
|
||||||
'heatStatisticsCalculate':HeatStatisticsCalculate,
|
heatStatisticsCalculate: HeatStatisticsCalculate,
|
||||||
'heatStatisticsDetail': HeatStatisticsDetail
|
heatStatisticsDetail: HeatStatisticsDetail,
|
||||||
|
VueQr,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
logo,
|
||||||
visible: false,
|
visible: false,
|
||||||
title: "",
|
title: "",
|
||||||
data: undefined,
|
data: undefined,
|
||||||
@ -94,7 +137,7 @@ export default {
|
|||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
copyValue: ""
|
copyValue: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -106,33 +149,31 @@ export default {
|
|||||||
}
|
}
|
||||||
this.title = `「${this.data.name}」热量统计列表`;
|
this.title = `「${this.data.name}」热量统计列表`;
|
||||||
this.queryParams.customerId = data.id;
|
this.queryParams.customerId = data.id;
|
||||||
|
this.copyValue =
|
||||||
|
window.location.origin.replace("manage", "sign") +
|
||||||
|
"/foodHeatCalculator/" +
|
||||||
|
this.data.encId;
|
||||||
this.fetchHeatList();
|
this.fetchHeatList();
|
||||||
},
|
},
|
||||||
fetchHeatList() {
|
fetchHeatList() {
|
||||||
listFoodHeatStatistics(this.queryParams).then(response => {
|
listFoodHeatStatistics(this.queryParams).then((response) => {
|
||||||
this.foodHeatStatisticsList = response.rows;
|
this.foodHeatStatisticsList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleAdd() {
|
handleAdd() {},
|
||||||
|
|
||||||
},
|
|
||||||
handleOnClosed() {
|
handleOnClosed() {
|
||||||
this.data = undefined;
|
this.data = undefined;
|
||||||
this.copyValue = "";
|
this.copyValue = "";
|
||||||
},
|
},
|
||||||
handleOnDeleteClick(data) {
|
handleOnDeleteClick(data) {
|
||||||
const ids = data.id || this.ids;
|
const ids = data.id || this.ids;
|
||||||
this.$confirm(
|
this.$confirm("是否确认删除该数据项?", "警告", {
|
||||||
'是否确认删除该数据项?',
|
|
||||||
"警告",
|
|
||||||
{
|
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}
|
})
|
||||||
)
|
|
||||||
.then(function () {
|
.then(function () {
|
||||||
return delFoodHeatStatistics(ids);
|
return delFoodHeatStatistics(ids);
|
||||||
})
|
})
|
||||||
@ -143,21 +184,20 @@ export default {
|
|||||||
.catch(function () {});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
handleCopy() {
|
handleCopy() {
|
||||||
this.copyValue = window.location.origin.replace('manage', 'sign') + "/foodHeatCalculator/"+this.data.encId;
|
new Clipboard(".copyBtn");
|
||||||
const btnCopy = new Clipboard('.copyBtn');
|
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '拷贝成功',
|
message: "拷贝成功",
|
||||||
type: 'success'
|
type: "success",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleCalculate(data){
|
handleCalculate(data) {
|
||||||
this.$refs.heatStatisticsCalculateRef.showDialog(data,() => {
|
this.$refs.heatStatisticsCalculateRef.showDialog(data, () => {
|
||||||
this.fetchHeatList();
|
this.fetchHeatList();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleDetail(data){
|
handleDetail(data) {
|
||||||
this.$refs.heatStatisticsDetailRef.showDialog(data, this.data.name);
|
this.$refs.heatStatisticsDetailRef.showDialog(data, this.data.name);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,68 +1,189 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :visible.sync="visible" :title="title" append-to-body @closed="onClosed">
|
<el-dialog
|
||||||
|
:visible.sync="visible"
|
||||||
|
:title="title"
|
||||||
|
append-to-body
|
||||||
|
@closed="onClosed"
|
||||||
|
>
|
||||||
<div v-if="showFlag">
|
<div v-if="showFlag">
|
||||||
<div style="float:right;margin-top:-10px;margin-bottom: 10px;" v-show="dataList.length > 0">
|
<div
|
||||||
|
style="float: right; margin-top: -10px; margin-bottom: 10px"
|
||||||
|
v-show="dataList.length > 0"
|
||||||
|
>
|
||||||
<!-- 只有新版健康评估信息才可修改,旧的体征数据不支持修改 -->
|
<!-- 只有新版健康评估信息才可修改,旧的体征数据不支持修改 -->
|
||||||
<el-button type="info" v-show="dataType == 0" @click="generateReport()" plain>下载报告</el-button>
|
<el-button
|
||||||
<el-button type="info" v-show="dataType == 0" @click="handleEditGuidanceClick()" plain>减脂指导</el-button>
|
type="info"
|
||||||
<el-button v-hasPermi="['custom:healthy:edit']" type="info" v-show="dataType == 0" @click="handleEditRemarkClick()" plain>修改备注</el-button>
|
v-show="dataType == 0"
|
||||||
<el-button v-hasPermi="['custom:healthy:edit']" type="warning" v-show="dataType == 0" @click="handleEditHealthyClick()" plain>修改信息</el-button>
|
@click="generateReport()"
|
||||||
<el-button type="danger" v-hasPermi="['custom:healthy:remove']" @click="handleDelete()" plain>删除信息</el-button>
|
plain
|
||||||
|
>下载报告</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="info"
|
||||||
|
v-show="dataType == 0"
|
||||||
|
@click="handleEditGuidanceClick()"
|
||||||
|
plain
|
||||||
|
>减脂指导</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['custom:healthy:edit']"
|
||||||
|
type="info"
|
||||||
|
v-show="dataType == 0"
|
||||||
|
@click="handleEditRemarkClick()"
|
||||||
|
plain
|
||||||
|
>修改备注</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-hasPermi="['custom:healthy:edit']"
|
||||||
|
type="warning"
|
||||||
|
v-show="dataType == 0"
|
||||||
|
@click="handleEditHealthyClick()"
|
||||||
|
plain
|
||||||
|
>修改信息</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
v-hasPermi="['custom:healthy:remove']"
|
||||||
|
@click="handleDelete()"
|
||||||
|
plain
|
||||||
|
>删除信息</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<!-- 客户健康评估 -->
|
<!-- 客户健康评估 -->
|
||||||
<div v-if="dataList.length > 0 && dataType == 0">
|
<div v-if="dataList.length > 0 && dataType == 0">
|
||||||
<!-- 基础信息 -->
|
<!-- 基础信息 -->
|
||||||
<div v-for="(item,index) in dataList.slice(0,1)" style="margin-bottom: 50px;" :key="index">
|
<div
|
||||||
|
v-for="(item, index) in dataList.slice(0, 1)"
|
||||||
|
style="margin-bottom: 50px"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<p class="p_title_1" style="margin-top: 5px;">{{titleArray[index]}}</p>
|
<p class="p_title_1" style="margin-top: 5px">
|
||||||
<table-detail-message :data="item" ></table-detail-message>
|
{{ titleArray[index] }}
|
||||||
|
</p>
|
||||||
|
<table-detail-message :data="item"></table-detail-message>
|
||||||
</div>
|
</div>
|
||||||
<!-- 备注 -->
|
<!-- 备注 -->
|
||||||
<el-table :data="remarkList" :show-header="false" border :cell-style="remarkColumnStyle" style="width: 100%;">
|
<el-table
|
||||||
<el-table-column width="140" prop="remarkTitle">
|
:data="remarkList"
|
||||||
</el-table-column>
|
:show-header="false"
|
||||||
|
border
|
||||||
|
:cell-style="remarkColumnStyle"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column width="140" prop="remarkTitle"> </el-table-column>
|
||||||
<el-table-column prop="remarkValue">
|
<el-table-column prop="remarkValue">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<auto-hide-message :data="scope.row.remarkValue" :maxLength="100"/></template>
|
<auto-hide-message
|
||||||
|
:data="scope.row.remarkValue"
|
||||||
|
:maxLength="100"
|
||||||
|
/></template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- 指导 -->
|
<!-- 指导 -->
|
||||||
<el-table :data="guidanceList" :show-header="false" border :cell-style="remarkColumnStyle" style="width: 100%;">
|
<el-table
|
||||||
|
:data="guidanceList"
|
||||||
|
:show-header="false"
|
||||||
|
border
|
||||||
|
:cell-style="remarkColumnStyle"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
<el-table-column width="140" prop="guidanceTitle">
|
<el-table-column width="140" prop="guidanceTitle">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="guidanceValue">
|
<el-table-column prop="guidanceValue">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<auto-hide-message :data="scope.row.guidanceValue" :maxLength="100"/></template>
|
<auto-hide-message
|
||||||
|
:data="scope.row.guidanceValue"
|
||||||
|
:maxLength="100"
|
||||||
|
/></template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<!-- 其他信息 -->
|
<!-- 其他信息 -->
|
||||||
<div style="height:400px;overflow: auto">
|
<div style="height: 400px; overflow: auto">
|
||||||
<div v-for="(item,index) in dataList.slice(1,10)" style="margin-bottom: 50px;" :key="index">
|
<div
|
||||||
|
v-for="(item, index) in dataList.slice(1, 10)"
|
||||||
|
style="margin-bottom: 50px"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<p class="p_title_1" style="margin-top: 5px;">{{titleArray[index+1]}}</p>
|
<p class="p_title_1" style="margin-top: 5px">
|
||||||
<table-detail-message :data="item" v-if="index != dataList.length-2"></table-detail-message>
|
{{ titleArray[index + 1] }}
|
||||||
<el-table :show-header="false" v-if="index == dataList.length-2" :data="item" border :cell-style="columnStyle" style="width: 100%;">
|
</p>
|
||||||
|
<table-detail-message
|
||||||
|
:data="item"
|
||||||
|
v-if="index != dataList.length - 2"
|
||||||
|
></table-detail-message>
|
||||||
|
<el-table
|
||||||
|
:show-header="false"
|
||||||
|
v-if="index == dataList.length - 2"
|
||||||
|
:data="item"
|
||||||
|
border
|
||||||
|
:cell-style="columnStyle"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
<el-table-column width="140" prop="attr_name_one">
|
<el-table-column width="140" prop="attr_name_one">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="value_one">
|
<el-table-column prop="value_one">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<auto-hide-message :data="scope.row.value_one == null ? '' : (scope.row.value_one+'')" :maxLength="20"/>
|
<auto-hide-message
|
||||||
<el-button type="primary" v-show="scope.row.value_one" @click="downloadFile(medicalReportPathArray[0])">下载</el-button>
|
: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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="140" prop="attr_name_two"></el-table-column>
|
<el-table-column
|
||||||
|
width="140"
|
||||||
|
prop="attr_name_two"
|
||||||
|
></el-table-column>
|
||||||
<el-table-column prop="value_two">
|
<el-table-column prop="value_two">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<auto-hide-message :data="scope.row.value_two == null ? '' : (scope.row.value_two+'')" :maxLength="20"/>
|
<auto-hide-message
|
||||||
<el-button type="primary" v-show="scope.row.value_two" @click="downloadFile(medicalReportPathArray[1])">下载</el-button>
|
: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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="140" prop="attr_name_three"></el-table-column>
|
<el-table-column
|
||||||
|
width="140"
|
||||||
|
prop="attr_name_three"
|
||||||
|
></el-table-column>
|
||||||
<el-table-column prop="value_three">
|
<el-table-column prop="value_three">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<auto-hide-message :data="scope.row.value_three == null ? '' : (scope.row.value_three+'')" :maxLength="20"/>
|
<auto-hide-message
|
||||||
<el-button type="primary" v-show="scope.row.value_three" @click="downloadFile(medicalReportPathArray[2])">下载</el-button>
|
: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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -72,41 +193,75 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 客户体征 -->
|
<!-- 客户体征 -->
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<table-detail-message v-show="dataList.length > 0" :data="dataList" ></table-detail-message>
|
<table-detail-message
|
||||||
<p v-show="dataList.length == 0" style="font-size: 20px;text-align:center;">暂无数据!
|
v-show="dataList.length > 0"
|
||||||
<el-button icon="el-icon-share" size="small" title="点击复制链接" class="copyBtn" type="primary" :data-clipboard-text="copyValue" @click="handleCopy()">健康评估表链接</el-button>
|
:data="dataList"
|
||||||
</p>
|
></table-detail-message>
|
||||||
|
<div
|
||||||
|
v-show="dataList.length == 0"
|
||||||
|
style="font-size: 20px; text-align: center"
|
||||||
|
>
|
||||||
|
<VueQr :text="copyValue" :logoSrc="logo" />
|
||||||
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<physicalSigns-edit ref="physicalSignsEditDialog" @refreshHealthyData="getCustomerHealthyByCusId()"></physicalSigns-edit>
|
<physicalSigns-edit
|
||||||
|
ref="physicalSignsEditDialog"
|
||||||
|
@refreshHealthyData="getCustomerHealthyByCusId()"
|
||||||
|
></physicalSigns-edit>
|
||||||
<!-- 编辑备注 -->
|
<!-- 编辑备注 -->
|
||||||
<physicalSigns-remark ref="physicalSignsRemarkDialog" @refreshHealthyData="getCustomerHealthyByCusId()"></physicalSigns-remark>
|
<physicalSigns-remark
|
||||||
|
ref="physicalSignsRemarkDialog"
|
||||||
|
@refreshHealthyData="getCustomerHealthyByCusId()"
|
||||||
|
></physicalSigns-remark>
|
||||||
<!-- 编辑减脂指导 -->
|
<!-- 编辑减脂指导 -->
|
||||||
<physicalSigns-guidance ref="physicalSignsGuidanceDialog" @refreshHealthyData="getCustomerHealthyByCusId()"></physicalSigns-guidance>
|
<physicalSigns-guidance
|
||||||
|
ref="physicalSignsGuidanceDialog"
|
||||||
|
@refreshHealthyData="getCustomerHealthyByCusId()"
|
||||||
|
></physicalSigns-guidance>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getCustomerPhysicalSignsByCusId,delCustomerHealthy } from "@/api/custom/customer";
|
import {
|
||||||
|
getCustomerPhysicalSignsByCusId,
|
||||||
|
delCustomerHealthy,
|
||||||
|
} from "@/api/custom/customer";
|
||||||
import { generateHealthyReport } from "@/api/custom/healthy";
|
import { generateHealthyReport } from "@/api/custom/healthy";
|
||||||
import TableDetailMessage from "@/components/TableDetailMessage";
|
import TableDetailMessage from "@/components/TableDetailMessage";
|
||||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||||
import * as healthyData from "@/utils/healthyData";
|
import * as healthyData from "@/utils/healthyData";
|
||||||
import Clipboard from 'clipboard';
|
import Clipboard from "clipboard";
|
||||||
import PhysicalSignsEdit from "@/components/PhysicalSignsEdit";
|
import PhysicalSignsEdit from "@/components/PhysicalSignsEdit";
|
||||||
import PhysicalSignsRemark from "@/components/PhysicalSignsRemark";
|
import PhysicalSignsRemark from "@/components/PhysicalSignsRemark";
|
||||||
import PhysicalSignsGuidance from "@/components/PhysicalSignsGuidance";
|
import PhysicalSignsGuidance from "@/components/PhysicalSignsGuidance";
|
||||||
|
import VueQr from "vue-qr";
|
||||||
|
const logo = require("@/assets/logo/logo_b.png");
|
||||||
export default {
|
export default {
|
||||||
name: "PhysicalSignsDialog",
|
name: "PhysicalSignsDialog",
|
||||||
components: {
|
components: {
|
||||||
"auto-hide-message": AutoHideMessage,
|
"auto-hide-message": AutoHideMessage,
|
||||||
"table-detail-message": TableDetailMessage,
|
"table-detail-message": TableDetailMessage,
|
||||||
"physicalSigns-edit":PhysicalSignsEdit,
|
"physicalSigns-edit": PhysicalSignsEdit,
|
||||||
"physicalSigns-remark":PhysicalSignsRemark,
|
"physicalSigns-remark": PhysicalSignsRemark,
|
||||||
"physicalSigns-guidance":PhysicalSignsGuidance
|
"physicalSigns-guidance": PhysicalSignsGuidance,
|
||||||
|
VueQr,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
logo,
|
||||||
visible: false,
|
visible: false,
|
||||||
showFlag: false,
|
showFlag: false,
|
||||||
title: "",
|
title: "",
|
||||||
@ -114,8 +269,8 @@ export default {
|
|||||||
dataList: [],
|
dataList: [],
|
||||||
dataType: 0,
|
dataType: 0,
|
||||||
healthyData: null,
|
healthyData: null,
|
||||||
remarkList:[{"remarkTitle": "备注信息", "remarkValue": ""}],
|
remarkList: [{ remarkTitle: "备注信息", remarkValue: "" }],
|
||||||
guidanceList:[{"guidanceTitle": "减脂指导", "guidanceValue": ""}],
|
guidanceList: [{ guidanceTitle: "减脂指导", guidanceValue: "" }],
|
||||||
// 体征标题
|
// 体征标题
|
||||||
signTitleData: [
|
signTitleData: [
|
||||||
["创建时间", "姓名", "年龄"],
|
["创建时间", "姓名", "年龄"],
|
||||||
@ -143,82 +298,106 @@ export default {
|
|||||||
["experience", "difficulty", "comments"],
|
["experience", "difficulty", "comments"],
|
||||||
],
|
],
|
||||||
//健康评估每个模板标题,与调查表保持一致
|
//健康评估每个模板标题,与调查表保持一致
|
||||||
titleArray: healthyData['titleArray'],
|
titleArray: healthyData["titleArray"],
|
||||||
// 健康评估标题
|
// 健康评估标题
|
||||||
healthyTitleData:[
|
healthyTitleData: [
|
||||||
[
|
[
|
||||||
["创建时间","客户姓名","手机号"],["调理项目","性别","年龄"],["身高(厘米)","体重(斤)","地域"]
|
["创建时间", "客户姓名", "手机号"],
|
||||||
|
["调理项目", "性别", "年龄"],
|
||||||
|
["身高(厘米)", "体重(斤)", "地域"],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["减脂经历","减脂遇到的困难","减脂是否反弹"],["是否意识到生活习惯是减脂关键","",""]
|
["减脂经历", "减脂遇到的困难", "减脂是否反弹"],
|
||||||
|
["是否意识到生活习惯是减脂关键", "", ""],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["调味品种","烹调方式","烹调频次"],["洗菜方式","",""]
|
["调味品种", "烹调方式", "烹调频次"],
|
||||||
|
["洗菜方式", "", ""],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["早餐习惯","早餐吃的食物","午餐习惯"],["晚餐习惯","正餐中素菜占比","最常吃的肉类"],
|
["早餐习惯", "早餐吃的食物", "午餐习惯"],
|
||||||
["晚餐时间","每周吃夜宵次数","夜宵通常吃的食物"],["食物的冷热偏好","食物的口味偏好","平均每周吃生蔬菜几次"],
|
["晚餐习惯", "正餐中素菜占比", "最常吃的肉类"],
|
||||||
["每周吃生蔬菜的频次类型","平均每天吃水果次数","吃水果的时间段"],["平时吃水果的频次","一餐吃几碗饭","吃几成饱"],
|
["晚餐时间", "每周吃夜宵次数", "夜宵通常吃的食物"],
|
||||||
["吃饭速度","饮食特点","常吃的零食"],["有无服用营养保健品","营养保健品品牌名","营养保健品产品名"],
|
["食物的冷热偏好", "食物的口味偏好", "平均每周吃生蔬菜几次"],
|
||||||
["服用营养保健品频次","忌口过敏食物",""]
|
["每周吃生蔬菜的频次类型", "平均每天吃水果次数", "吃水果的时间段"],
|
||||||
|
["平时吃水果的频次", "一餐吃几碗饭", "吃几成饱"],
|
||||||
|
["吃饭速度", "饮食特点", "常吃的零食"],
|
||||||
|
["有无服用营养保健品", "营养保健品品牌名", "营养保健品产品名"],
|
||||||
|
["服用营养保健品频次", "忌口过敏食物", ""],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["每天的饮水量","喜欢喝什么水","喝水习惯"],["常喝的饮品的每周频次","是否喝酒","喝酒种类"],["对应酒的量","是否抽烟","抽烟频次和烟龄"],
|
["每天的饮水量", "喜欢喝什么水", "喝水习惯"],
|
||||||
["是否经常抽二手烟","工作行业","工作性质"],["排便次数","排便时间段","排便的形状"],["排便的气味","排便的速度","排便的颜色"]
|
["常喝的饮品的每周频次", "是否喝酒", "喝酒种类"],
|
||||||
|
["对应酒的量", "是否抽烟", "抽烟频次和烟龄"],
|
||||||
|
["是否经常抽二手烟", "工作行业", "工作性质"],
|
||||||
|
["排便次数", "排便时间段", "排便的形状"],
|
||||||
|
["排便的气味", "排便的速度", "排便的颜色"],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["每周运动次数","每次运动的时长","每天运动的时间"],
|
["每周运动次数", "每次运动的时长", "每天运动的时间"],
|
||||||
["运动","运动场地",""]
|
["运动", "运动场地", ""],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["睡觉时间","睡眠质量","是否有辅助入睡药物"],
|
["睡觉时间", "睡眠质量", "是否有辅助入睡药物"],
|
||||||
["辅助睡眠类药物名称","是否经常熬夜","熬夜频次"]
|
["辅助睡眠类药物名称", "是否经常熬夜", "熬夜频次"],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["病史体征","湿气数据","气血数据"],
|
["病史体征", "湿气数据", "气血数据"],
|
||||||
["家族疾病史","手术史","近期是否做过手术"],
|
["家族疾病史", "手术史", "近期是否做过手术"],
|
||||||
["手术恢复情况","是否长期服用药物","长期服用的药物"],
|
["手术恢复情况", "是否长期服用药物", "长期服用的药物"],
|
||||||
["是否出现过过敏症状","过敏症状","过敏源"]
|
["是否出现过过敏症状", "过敏症状", "过敏源"],
|
||||||
],
|
],
|
||||||
[
|
[["体检报告(1)", "体检报告(2)", "体检报告(3)"]],
|
||||||
["体检报告(1)","体检报告(2)","体检报告(3)"]
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
// 健康评估属性
|
// 健康评估属性
|
||||||
healthyValueData:[
|
healthyValueData: [
|
||||||
[["createTime","name","phone"],["conditioningProject","sex","age"],["tall","weight","position"]],
|
|
||||||
[
|
[
|
||||||
["experience","difficulty","rebound"],["crux","",""]
|
["createTime", "name", "phone"],
|
||||||
],
|
["conditioningProject", "sex", "age"],
|
||||||
[["condiment","cookingStyle","cookingStyleRate"],["washVegetablesStyle","",""]],
|
["tall", "weight", "position"],
|
||||||
[
|
|
||||||
["breakfastType","breakfastFood","lunchType"],["dinner","vegetableRate","commonMeat"],
|
|
||||||
["dinnerTime","supperNum","supperFood"],["dietHotAndCold","dietFlavor","vegetablesNum"],
|
|
||||||
["vegetablesRateType","fruitsNum","fruitsTime"],["fruitsRate","riceNum","riceFull"],
|
|
||||||
["eatingSpeed","makeFoodType","snacks"],
|
|
||||||
["healthProductsFlag","healthProductsBrand","healthProductsName"],
|
|
||||||
["healthProductsWeekRate","dishesIngredient",""]
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["waterNum","waterType","waterHabit"],["drinksNum","drinkWineFlag","drinkWineClassify"],["drinkWineAmount","smokeFlag","smokeRate"],
|
["experience", "difficulty", "rebound"],
|
||||||
["secondSmoke","workIndustry","workType"],["defecationNum","defecationTime","defecationShape"],["defecationSmell","defecationSpeed","defecationColor"]
|
["crux", "", ""],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["motionNum","motionDuration","motionTime"],["motion","motionField",""]
|
["condiment", "cookingStyle", "cookingStyleRate"],
|
||||||
|
["washVegetablesStyle", "", ""],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["sleepTime","sleepQuality","sleepDrugFlag"],
|
["breakfastType", "breakfastFood", "lunchType"],
|
||||||
["sleepDrug","stayupLateFlag","stayupLateWeekNum"]
|
["dinner", "vegetableRate", "commonMeat"],
|
||||||
|
["dinnerTime", "supperNum", "supperFood"],
|
||||||
|
["dietHotAndCold", "dietFlavor", "vegetablesNum"],
|
||||||
|
["vegetablesRateType", "fruitsNum", "fruitsTime"],
|
||||||
|
["fruitsRate", "riceNum", "riceFull"],
|
||||||
|
["eatingSpeed", "makeFoodType", "snacks"],
|
||||||
|
["healthProductsFlag", "healthProductsBrand", "healthProductsName"],
|
||||||
|
["healthProductsWeekRate", "dishesIngredient", ""],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["physicalSigns","moistureDate","bloodData"],
|
["waterNum", "waterType", "waterHabit"],
|
||||||
["familyIllnessHistory","operationHistory","nearOperationFlag"],
|
["drinksNum", "drinkWineFlag", "drinkWineClassify"],
|
||||||
["recoveryeSituation","longEatDrugFlag","longEatDrugClassify"],
|
["drinkWineAmount", "smokeFlag", "smokeRate"],
|
||||||
["allergyFlag","allergySituation","allergen"]
|
["secondSmoke", "workIndustry", "workType"],
|
||||||
|
["defecationNum", "defecationTime", "defecationShape"],
|
||||||
|
["defecationSmell", "defecationSpeed", "defecationColor"],
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
["medicalReport_one","medicalReport_two","medicalReport_three"]
|
["motionNum", "motionDuration", "motionTime"],
|
||||||
]
|
["motion", "motionField", ""],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
["sleepTime", "sleepQuality", "sleepDrugFlag"],
|
||||||
|
["sleepDrug", "stayupLateFlag", "stayupLateWeekNum"],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
["physicalSigns", "moistureDate", "bloodData"],
|
||||||
|
["familyIllnessHistory", "operationHistory", "nearOperationFlag"],
|
||||||
|
["recoveryeSituation", "longEatDrugFlag", "longEatDrugClassify"],
|
||||||
|
["allergyFlag", "allergySituation", "allergen"],
|
||||||
|
],
|
||||||
|
[["medicalReport_one", "medicalReport_two", "medicalReport_three"]],
|
||||||
],
|
],
|
||||||
copyValue: "",
|
copyValue: "",
|
||||||
detailHealthy: null,
|
detailHealthy: null,
|
||||||
@ -246,21 +425,25 @@ export default {
|
|||||||
showDialog(data) {
|
showDialog(data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
this.title = `「${data.name}」客户健康评估信息`;
|
this.title = `「${data.name}」客户健康评估信息`;
|
||||||
|
this.copyValue =
|
||||||
|
window.location.origin.replace("manage", "sign") +
|
||||||
|
"/subhealthyInvestigation/" +
|
||||||
|
this.data.encId;
|
||||||
this.getCustomerHealthyByCusId();
|
this.getCustomerHealthyByCusId();
|
||||||
},
|
},
|
||||||
getCustomerHealthyByCusId(){
|
getCustomerHealthyByCusId() {
|
||||||
getCustomerPhysicalSignsByCusId(this.data.id).then((res) => {
|
getCustomerPhysicalSignsByCusId(this.data.id).then((res) => {
|
||||||
this.showFlag = false;
|
this.showFlag = false;
|
||||||
if (res.data.customerHealthy) {
|
if (res.data.customerHealthy) {
|
||||||
//判断是体征还是健康评估
|
//判断是体征还是健康评估
|
||||||
this.dataType = res.data.type;
|
this.dataType = res.data.type;
|
||||||
if(this.dataType == 0){
|
if (this.dataType == 0) {
|
||||||
this.healthyData = Object.assign({}, res.data.customerHealthy);
|
this.healthyData = Object.assign({}, res.data.customerHealthy);
|
||||||
this.remarkList[0].remarkValue = this.healthyData.remark;
|
this.remarkList[0].remarkValue = this.healthyData.remark;
|
||||||
this.guidanceList[0].guidanceValue = this.healthyData.guidance;
|
this.guidanceList[0].guidanceValue = this.healthyData.guidance;
|
||||||
this.getDataListByHealthyMessage(res.data.customerHealthy);
|
this.getDataListByHealthyMessage(res.data.customerHealthy);
|
||||||
}else{
|
} else {
|
||||||
this.getDataListBySignMessage(res.data.customerHealthy)
|
this.getDataListBySignMessage(res.data.customerHealthy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//this.enc_id = res.data.enc_id;
|
//this.enc_id = res.data.enc_id;
|
||||||
@ -276,7 +459,7 @@ export default {
|
|||||||
this.copyValue = "";
|
this.copyValue = "";
|
||||||
},
|
},
|
||||||
//对体征信息进行处理
|
//对体征信息进行处理
|
||||||
getDataListBySignMessage(sign){
|
getDataListBySignMessage(sign) {
|
||||||
sign.sex = sign.sex === 0 ? `男` : "女";
|
sign.sex = sign.sex === 0 ? `男` : "女";
|
||||||
sign.position = sign.position === 0 ? `南方` : "北方";
|
sign.position = sign.position === 0 ? `南方` : "北方";
|
||||||
sign.signStr = this.getSignString(sign.signList);
|
sign.signStr = this.getSignString(sign.signList);
|
||||||
@ -305,82 +488,138 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
//对健康评估信息进行处理
|
//对健康评估信息进行处理
|
||||||
getDataListByHealthyMessage(healthy){
|
getDataListByHealthyMessage(healthy) {
|
||||||
let detailHealthy = this.dealHealthy(healthy);
|
let detailHealthy = this.dealHealthy(healthy);
|
||||||
//性别
|
//性别
|
||||||
detailHealthy.sex = detailHealthy.sex == 0 ? "男" : (detailHealthy.sex == 1 ? "女" : "未知");
|
detailHealthy.sex =
|
||||||
|
detailHealthy.sex == 0 ? "男" : detailHealthy.sex == 1 ? "女" : "未知";
|
||||||
detailHealthy.position = detailHealthy.position == 0 ? "南方" : "北方";
|
detailHealthy.position = detailHealthy.position == 0 ? "南方" : "北方";
|
||||||
detailHealthy.rebound = detailHealthy.rebound == 0 ? "否" : "是";
|
detailHealthy.rebound = detailHealthy.rebound == 0 ? "否" : "是";
|
||||||
detailHealthy.crux = detailHealthy.crux == 0 ? "否" : "是";
|
detailHealthy.crux = detailHealthy.crux == 0 ? "否" : "是";
|
||||||
//调味品
|
//调味品
|
||||||
detailHealthy.condiment += detailHealthy.otherCondiment ? (","+detailHealthy.otherCondiment) : "";
|
detailHealthy.condiment += detailHealthy.otherCondiment
|
||||||
|
? "," + detailHealthy.otherCondiment
|
||||||
|
: "";
|
||||||
//烹饪
|
//烹饪
|
||||||
let cookingStyleRate = "";
|
let cookingStyleRate = "";
|
||||||
if(detailHealthy.cookingStyleRate != null){
|
if (detailHealthy.cookingStyleRate != null) {
|
||||||
detailHealthy.cookingStyleRate.split(",").forEach(function(item, index){
|
detailHealthy.cookingStyleRate
|
||||||
cookingStyleRate += (cookingStyleRate != "" ? "," : "") + (healthyData["cookingStyleRateArray"][index])+item +"次";
|
.split(",")
|
||||||
|
.forEach(function (item, index) {
|
||||||
|
cookingStyleRate +=
|
||||||
|
(cookingStyleRate != "" ? "," : "") +
|
||||||
|
healthyData["cookingStyleRateArray"][index] +
|
||||||
|
item +
|
||||||
|
"次";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
detailHealthy.cookingStyleRate = cookingStyleRate;
|
detailHealthy.cookingStyleRate = cookingStyleRate;
|
||||||
//洗菜方式
|
//洗菜方式
|
||||||
detailHealthy.washVegetablesStyle += detailHealthy.otherWashVegetablesStyle ? (","+detailHealthy.otherWashVegetablesStyle) : "";
|
detailHealthy.washVegetablesStyle += detailHealthy.otherWashVegetablesStyle
|
||||||
|
? "," + detailHealthy.otherWashVegetablesStyle
|
||||||
|
: "";
|
||||||
//素菜占比
|
//素菜占比
|
||||||
detailHealthy.vegetableRate += "成";
|
detailHealthy.vegetableRate += "成";
|
||||||
|
|
||||||
let makeFoodTypeOption = healthyData["makeFoodTypeArray"].find(opt => opt.value == detailHealthy.makeFoodType+"");
|
let makeFoodTypeOption = healthyData["makeFoodTypeArray"].find(
|
||||||
detailHealthy.makeFoodType = makeFoodTypeOption ? makeFoodTypeOption.name : "";
|
(opt) => opt.value == detailHealthy.makeFoodType + ""
|
||||||
|
);
|
||||||
|
detailHealthy.makeFoodType = makeFoodTypeOption
|
||||||
|
? makeFoodTypeOption.name
|
||||||
|
: "";
|
||||||
//零食
|
//零食
|
||||||
detailHealthy.snacks += detailHealthy.otherSnacks ? ("," + detailHealthy.otherSnacks) : "";
|
detailHealthy.snacks += detailHealthy.otherSnacks
|
||||||
detailHealthy.healthProductsFlag = detailHealthy.healthProductsFlag == 1 ? "有" : "无";
|
? "," + detailHealthy.otherSnacks
|
||||||
detailHealthy.healthProductsWeekRate = detailHealthy.healthProductsDayRate+"次/天,"+detailHealthy.healthProductsWeekRate+"次/周";
|
: "";
|
||||||
|
detailHealthy.healthProductsFlag =
|
||||||
|
detailHealthy.healthProductsFlag == 1 ? "有" : "无";
|
||||||
|
detailHealthy.healthProductsWeekRate =
|
||||||
|
detailHealthy.healthProductsDayRate +
|
||||||
|
"次/天," +
|
||||||
|
detailHealthy.healthProductsWeekRate +
|
||||||
|
"次/周";
|
||||||
detailHealthy.waterNum += "毫升";
|
detailHealthy.waterNum += "毫升";
|
||||||
//饮品
|
//饮品
|
||||||
let drinksNumString = "";
|
let drinksNumString = "";
|
||||||
if(detailHealthy.drinksNum != null){
|
if (detailHealthy.drinksNum != null) {
|
||||||
detailHealthy.drinksNum.split(",").forEach(function(item, index){
|
detailHealthy.drinksNum.split(",").forEach(function (item, index) {
|
||||||
drinksNumString += (drinksNumString != "" ? "," : "") + (healthyData["drinksNumArray"][index])+item +"次";
|
drinksNumString +=
|
||||||
|
(drinksNumString != "" ? "," : "") +
|
||||||
|
healthyData["drinksNumArray"][index] +
|
||||||
|
item +
|
||||||
|
"次";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
detailHealthy.drinksNum = drinksNumString;
|
detailHealthy.drinksNum = drinksNumString;
|
||||||
detailHealthy.drinkWineClassify += detailHealthy.otherWineClassify ? (","+detailHealthy.otherWineClassify) : "";
|
detailHealthy.drinkWineClassify += detailHealthy.otherWineClassify
|
||||||
|
? "," + detailHealthy.otherWineClassify
|
||||||
|
: "";
|
||||||
let drinkWineAmountString = "";
|
let drinkWineAmountString = "";
|
||||||
if(detailHealthy.drinkWineAmount != null){
|
if (detailHealthy.drinkWineAmount != null) {
|
||||||
detailHealthy.drinkWineAmount.split(",").forEach(function(item, index){
|
detailHealthy.drinkWineAmount
|
||||||
drinkWineAmountString += (drinkWineAmountString != "" ? "," : "") + (healthyData["drinkWineAmountArray"][index])+item + healthyData["drinkWineAmountUnitArray"][index];
|
.split(",")
|
||||||
|
.forEach(function (item, index) {
|
||||||
|
drinkWineAmountString +=
|
||||||
|
(drinkWineAmountString != "" ? "," : "") +
|
||||||
|
healthyData["drinkWineAmountArray"][index] +
|
||||||
|
item +
|
||||||
|
healthyData["drinkWineAmountUnitArray"][index];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
detailHealthy.drinkWineAmount = drinkWineAmountString;
|
detailHealthy.drinkWineAmount = drinkWineAmountString;
|
||||||
detailHealthy.smokeFlag = detailHealthy.smokeFlag == 1 ? "是" : "否";
|
detailHealthy.smokeFlag = detailHealthy.smokeFlag == 1 ? "是" : "否";
|
||||||
detailHealthy.secondSmoke = detailHealthy.secondSmoke == 1 ? "是" : "否";
|
detailHealthy.secondSmoke = detailHealthy.secondSmoke == 1 ? "是" : "否";
|
||||||
let smokeRateString = "";
|
let smokeRateString = "";
|
||||||
if(detailHealthy.smokeRate != null){
|
if (detailHealthy.smokeRate != null) {
|
||||||
detailHealthy.smokeRate.split(",").forEach(function(item, index){
|
detailHealthy.smokeRate.split(",").forEach(function (item, index) {
|
||||||
smokeRateString += (smokeRateString != "" ? "," : "") + (healthyData["smokeRateArray"][index])+item + healthyData["smokeRateUnitArray"][index];
|
smokeRateString +=
|
||||||
|
(smokeRateString != "" ? "," : "") +
|
||||||
|
healthyData["smokeRateArray"][index] +
|
||||||
|
item +
|
||||||
|
healthyData["smokeRateUnitArray"][index];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
detailHealthy.smokeRate = smokeRateString;
|
detailHealthy.smokeRate = smokeRateString;
|
||||||
detailHealthy.defecationNum = detailHealthy.defecationNum + "次/天";
|
detailHealthy.defecationNum = detailHealthy.defecationNum + "次/天";
|
||||||
detailHealthy.motionDuration = detailHealthy.motionDuration +"分钟";
|
detailHealthy.motionDuration = detailHealthy.motionDuration + "分钟";
|
||||||
let motionStr = "";
|
let motionStr = "";
|
||||||
if(detailHealthy.aerobicMotionClassify != null){
|
if (detailHealthy.aerobicMotionClassify != null) {
|
||||||
detailHealthy.aerobicMotionClassify.split(",").forEach(function(item, index){
|
detailHealthy.aerobicMotionClassify
|
||||||
motionStr += item ? ((motionStr != "" ? "," : "") + item) : "";
|
.split(",")
|
||||||
|
.forEach(function (item, index) {
|
||||||
|
motionStr += item ? (motionStr != "" ? "," : "") + item : "";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(detailHealthy.anaerobicMotionClassify != null){
|
if (detailHealthy.anaerobicMotionClassify != null) {
|
||||||
detailHealthy.anaerobicMotionClassify.split(",").forEach(function(item, index){
|
detailHealthy.anaerobicMotionClassify
|
||||||
motionStr += item ? ((motionStr != "" ? "," : "") + item) : "";
|
.split(",")
|
||||||
|
.forEach(function (item, index) {
|
||||||
|
motionStr += item ? (motionStr != "" ? "," : "") + item : "";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(detailHealthy.anaerobicAerobicMotionClassify != null){
|
if (detailHealthy.anaerobicAerobicMotionClassify != null) {
|
||||||
detailHealthy.anaerobicAerobicMotionClassify.split(",").forEach(function(item, index){
|
detailHealthy.anaerobicAerobicMotionClassify
|
||||||
motionStr += item ? ((motionStr != "" ? "," : "") + item) : "";
|
.split(",")
|
||||||
|
.forEach(function (item, index) {
|
||||||
|
motionStr += item ? (motionStr != "" ? "," : "") + item : "";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
detailHealthy.motion = this.trimComma(motionStr + (detailHealthy.otherMotionClassify ? ( ","+ detailHealthy.otherMotionClassify) : ""));
|
detailHealthy.motion = this.trimComma(
|
||||||
detailHealthy.motionField = this.trimComma(detailHealthy.motionField + (detailHealthy.otherMotionField ? (","+detailHealthy.otherMotionField) : ""));
|
motionStr +
|
||||||
detailHealthy.sleepDrugFlag = detailHealthy.sleepDrugFlag == 1 ? "有" : "无";
|
(detailHealthy.otherMotionClassify
|
||||||
detailHealthy.stayupLateFlag = detailHealthy.stayupLateFlag == 1 ? "有" : "无";
|
? "," + detailHealthy.otherMotionClassify
|
||||||
|
: "")
|
||||||
|
);
|
||||||
|
detailHealthy.motionField = this.trimComma(
|
||||||
|
detailHealthy.motionField +
|
||||||
|
(detailHealthy.otherMotionField
|
||||||
|
? "," + detailHealthy.otherMotionField
|
||||||
|
: "")
|
||||||
|
);
|
||||||
|
detailHealthy.sleepDrugFlag =
|
||||||
|
detailHealthy.sleepDrugFlag == 1 ? "有" : "无";
|
||||||
|
detailHealthy.stayupLateFlag =
|
||||||
|
detailHealthy.stayupLateFlag == 1 ? "有" : "无";
|
||||||
detailHealthy.stayupLateWeekNum += "次/周";
|
detailHealthy.stayupLateWeekNum += "次/周";
|
||||||
let physicalSigns = this.getSignString(detailHealthy.signList);
|
let physicalSigns = this.getSignString(detailHealthy.signList);
|
||||||
/*if(detailHealthy.signList != null && detailHealthy.signList.length > 0){
|
/*if(detailHealthy.signList != null && detailHealthy.signList.length > 0){
|
||||||
@ -388,101 +627,163 @@ export default {
|
|||||||
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 = this.trimComma(detailHealthy.familyIllnessHistory + ","+ (detailHealthy.otherFamilyIllnessHistory ? detailHealthy.otherFamilyIllnessHistory : ""));
|
detailHealthy.familyIllnessHistory = this.trimComma(
|
||||||
detailHealthy.operationHistory = this.trimComma(detailHealthy.operationHistory + ","+ (detailHealthy.otherOperationHistory ? detailHealthy.otherOperationHistory : ""));
|
detailHealthy.familyIllnessHistory +
|
||||||
detailHealthy.nearOperationFlag = detailHealthy.nearOperationFlag == 1 ? "有" : "无";
|
"," +
|
||||||
detailHealthy.longEatDrugFlag = detailHealthy.longEatDrugFlag == 1 ? "有" : "无";
|
(detailHealthy.otherFamilyIllnessHistory
|
||||||
detailHealthy.longEatDrugClassify = this.trimComma(detailHealthy.longEatDrugClassify + "," + (detailHealthy.otherLongEatDrugClassify ? detailHealthy.otherLongEatDrugClassify : ""));
|
? detailHealthy.otherFamilyIllnessHistory
|
||||||
|
: "")
|
||||||
|
);
|
||||||
|
detailHealthy.operationHistory = this.trimComma(
|
||||||
|
detailHealthy.operationHistory +
|
||||||
|
"," +
|
||||||
|
(detailHealthy.otherOperationHistory
|
||||||
|
? detailHealthy.otherOperationHistory
|
||||||
|
: "")
|
||||||
|
);
|
||||||
|
detailHealthy.nearOperationFlag =
|
||||||
|
detailHealthy.nearOperationFlag == 1 ? "有" : "无";
|
||||||
|
detailHealthy.longEatDrugFlag =
|
||||||
|
detailHealthy.longEatDrugFlag == 1 ? "有" : "无";
|
||||||
|
detailHealthy.longEatDrugClassify = this.trimComma(
|
||||||
|
detailHealthy.longEatDrugClassify +
|
||||||
|
"," +
|
||||||
|
(detailHealthy.otherLongEatDrugClassify
|
||||||
|
? detailHealthy.otherLongEatDrugClassify
|
||||||
|
: "")
|
||||||
|
);
|
||||||
detailHealthy.allergyFlag = detailHealthy.allergyFlag == 1 ? "有" : "无";
|
detailHealthy.allergyFlag = detailHealthy.allergyFlag == 1 ? "有" : "无";
|
||||||
detailHealthy.allergen = this.trimComma(detailHealthy.allergen + "," + (detailHealthy.otherAllergen ? detailHealthy.otherAllergen : ""));
|
detailHealthy.allergen = this.trimComma(
|
||||||
let medicalReportPathArray = detailHealthy.medicalReport ? detailHealthy.medicalReport.split(",") : [];
|
detailHealthy.allergen +
|
||||||
let medicalReportNameArray = detailHealthy.medicalReportName ? detailHealthy.medicalReportName.split(",") : [];
|
"," +
|
||||||
|
(detailHealthy.otherAllergen ? detailHealthy.otherAllergen : "")
|
||||||
|
);
|
||||||
|
let medicalReportPathArray = detailHealthy.medicalReport
|
||||||
|
? detailHealthy.medicalReport.split(",")
|
||||||
|
: [];
|
||||||
|
let medicalReportNameArray = detailHealthy.medicalReportName
|
||||||
|
? detailHealthy.medicalReportName.split(",")
|
||||||
|
: [];
|
||||||
this.medicalReportPathArray = medicalReportPathArray;
|
this.medicalReportPathArray = medicalReportPathArray;
|
||||||
detailHealthy.medicalReport_one = medicalReportPathArray.length > 0 ? (medicalReportNameArray.length > 0 ? medicalReportNameArray[0] : "体检报告(1)") : "";
|
detailHealthy.medicalReport_one =
|
||||||
detailHealthy.medicalReport_two = medicalReportPathArray.length > 1 ? (medicalReportNameArray.length > 1 ? medicalReportNameArray[1] : "体检报告(2)") : "";
|
medicalReportPathArray.length > 0
|
||||||
detailHealthy.medicalReport_three = medicalReportPathArray.length > 2 ? (medicalReportNameArray.length > 2 ? medicalReportNameArray[2] : "体检报告(3)") : "";
|
? medicalReportNameArray.length > 0
|
||||||
|
? medicalReportNameArray[0]
|
||||||
|
: "体检报告(1)"
|
||||||
|
: "";
|
||||||
|
detailHealthy.medicalReport_two =
|
||||||
|
medicalReportPathArray.length > 1
|
||||||
|
? medicalReportNameArray.length > 1
|
||||||
|
? medicalReportNameArray[1]
|
||||||
|
: "体检报告(2)"
|
||||||
|
: "";
|
||||||
|
detailHealthy.medicalReport_three =
|
||||||
|
medicalReportPathArray.length > 2
|
||||||
|
? medicalReportNameArray.length > 2
|
||||||
|
? medicalReportNameArray[2]
|
||||||
|
: "体检报告(3)"
|
||||||
|
: "";
|
||||||
this.detailHealthy = detailHealthy;
|
this.detailHealthy = detailHealthy;
|
||||||
for(let i = 0; i < this.healthyTitleData.length; i++){
|
for (let i = 0; i < this.healthyTitleData.length; i++) {
|
||||||
let stepArray = [];
|
let stepArray = [];
|
||||||
for(let j= 0; j < this.healthyTitleData[i].length; j++){
|
for (let j = 0; j < this.healthyTitleData[i].length; j++) {
|
||||||
stepArray[j] = ({"attr_name_one": this.healthyTitleData[i][j][0],"value_one": detailHealthy[this.healthyValueData[i][j][0]],"attr_name_two": this.healthyTitleData[i][j][1],"value_two": detailHealthy[this.healthyValueData[i][j][1]],"attr_name_three": this.healthyTitleData[i][j][2],"value_three": detailHealthy[this.healthyValueData[i][j][2]]});
|
stepArray[j] = {
|
||||||
|
attr_name_one: this.healthyTitleData[i][j][0],
|
||||||
|
value_one: detailHealthy[this.healthyValueData[i][j][0]],
|
||||||
|
attr_name_two: this.healthyTitleData[i][j][1],
|
||||||
|
value_two: detailHealthy[this.healthyValueData[i][j][1]],
|
||||||
|
attr_name_three: this.healthyTitleData[i][j][2],
|
||||||
|
value_three: detailHealthy[this.healthyValueData[i][j][2]],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
this.dataList[i] = stepArray;
|
this.dataList[i] = stepArray;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//健康信息处理,将数组转为字符串
|
//健康信息处理,将数组转为字符串
|
||||||
dealHealthy(customerHealthy){
|
dealHealthy(customerHealthy) {
|
||||||
let array = healthyData["needAttrName"];
|
let array = healthyData["needAttrName"];
|
||||||
for(let i = 0; i < array.length; i++){
|
for (let i = 0; i < array.length; i++) {
|
||||||
customerHealthy[array[i]] = this.getHealthyStringByArray(array[i]+"Array", customerHealthy[array[i]]);
|
customerHealthy[array[i]] = this.getHealthyStringByArray(
|
||||||
|
array[i] + "Array",
|
||||||
|
customerHealthy[array[i]]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return customerHealthy;
|
return customerHealthy;
|
||||||
},
|
},
|
||||||
//将数组中的value值转为name
|
//将数组中的value值转为name
|
||||||
getHealthyStringByArray(key, valueArray){
|
getHealthyStringByArray(key, valueArray) {
|
||||||
var str = "";
|
var str = "";
|
||||||
if(valueArray != null && valueArray.split(",").length > 0){
|
if (valueArray != null && valueArray.split(",").length > 0) {
|
||||||
valueArray.split(",").forEach(function (item, index) {
|
valueArray.split(",").forEach(function (item, index) {
|
||||||
let data = healthyData[key].find(opt => opt.value == item);
|
let data = healthyData[key].find((opt) => opt.value == item);
|
||||||
if(data != null){
|
if (data != null) {
|
||||||
str += (str != "" ? "," : "") + data.name;
|
str += (str != "" ? "," : "") + data.name;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
},
|
},
|
||||||
getSignString(signList){
|
getSignString(signList) {
|
||||||
if(signList == null){
|
if (signList == null) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
let signStr = "";
|
let signStr = "";
|
||||||
for(let i in signList){
|
for (let i in signList) {
|
||||||
signStr += ","+signList[i].name;
|
signStr += "," + signList[i].name;
|
||||||
}
|
}
|
||||||
return signList.length > 0 ? signStr.substring(1) : signStr;
|
return signList.length > 0 ? signStr.substring(1) : signStr;
|
||||||
},
|
},
|
||||||
downloadFile(fileName){
|
downloadFile(fileName) {
|
||||||
this.downloadResource(fileName);
|
this.downloadResource(fileName);
|
||||||
},
|
},
|
||||||
generateReport(){
|
generateReport() {
|
||||||
let data = this.detailHealthy;
|
let data = this.detailHealthy;
|
||||||
if(!this.guidanceList[0].guidanceValue || this.guidanceList[0].guidanceValue.length == 0){
|
if (
|
||||||
|
!this.guidanceList[0].guidanceValue ||
|
||||||
|
this.guidanceList[0].guidanceValue.length == 0
|
||||||
|
) {
|
||||||
this.$confirm("该客户还未添加减脂指导,是否确认下载报告?", "警告", {
|
this.$confirm("该客户还未添加减脂指导,是否确认下载报告?", "警告", {
|
||||||
confirmButtonText: "确定", cancelButtonText: "取消", type: "warning"
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
})
|
})
|
||||||
.then(function(){
|
.then(function () {
|
||||||
return generateHealthyReport(data);
|
return generateHealthyReport(data);
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if(response.code == 200 && response.path != null){
|
if (response.code == 200 && response.path != null) {
|
||||||
this.download(response.path);
|
this.download(response.path);
|
||||||
}
|
}
|
||||||
}).catch(function () {});
|
})
|
||||||
}else{
|
.catch(function () {});
|
||||||
|
} else {
|
||||||
generateHealthyReport(data).then((res) => {
|
generateHealthyReport(data).then((res) => {
|
||||||
if(res.code == 200 && res.path != null){
|
if (res.code == 200 && res.path != null) {
|
||||||
this.download(res.path);
|
this.download(res.path);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
trimComma(str){
|
trimComma(str) {
|
||||||
if(str.startsWith(",") || str.startsWith(",")){
|
if (str.startsWith(",") || str.startsWith(",")) {
|
||||||
str = str.substring(1,str.length);
|
str = str.substring(1, str.length);
|
||||||
}
|
}
|
||||||
if(str.endsWith(",") || str.endsWith(",")){
|
if (str.endsWith(",") || str.endsWith(",")) {
|
||||||
str = str.substring(0,str.length-1);
|
str = str.substring(0, str.length - 1);
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
},
|
},
|
||||||
handleCopy() {
|
handleCopy() {
|
||||||
this.copyValue = window.location.origin.replace('manage', 'sign') + "/subhealthyInvestigation/"+this.data.encId;
|
new Clipboard(".copyBtn");
|
||||||
const btnCopy = new Clipboard('.copyBtn');
|
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '拷贝成功',
|
message: "拷贝成功",
|
||||||
type: 'success'
|
type: "success",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 删除健康信息操作 */
|
/** 删除健康信息操作 */
|
||||||
@ -496,35 +797,46 @@ export default {
|
|||||||
cancelButtonText: "取消",
|
cancelButtonText: "取消",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}
|
}
|
||||||
).then(function () {
|
)
|
||||||
|
.then(function () {
|
||||||
return delCustomerHealthy(ids);
|
return delCustomerHealthy(ids);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
this.msgSuccess("删除成功");
|
this.msgSuccess("删除成功");
|
||||||
}).catch(function () {});
|
})
|
||||||
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
handleEditHealthyClick() {
|
handleEditHealthyClick() {
|
||||||
//console.log(JSON.stringify(this.healthyData));
|
//console.log(JSON.stringify(this.healthyData));
|
||||||
this.$refs["physicalSignsEditDialog"].showDialog(this.data, this.healthyData);
|
this.$refs["physicalSignsEditDialog"].showDialog(
|
||||||
|
this.data,
|
||||||
|
this.healthyData
|
||||||
|
);
|
||||||
|
},
|
||||||
|
handleEditRemarkClick() {
|
||||||
|
this.$refs["physicalSignsRemarkDialog"].showDialog(
|
||||||
|
this.data,
|
||||||
|
this.healthyData
|
||||||
|
);
|
||||||
|
},
|
||||||
|
handleEditGuidanceClick() {
|
||||||
|
this.$refs["physicalSignsGuidanceDialog"].showDialog(
|
||||||
|
this.data,
|
||||||
|
this.healthyData
|
||||||
|
);
|
||||||
},
|
},
|
||||||
handleEditRemarkClick(){
|
|
||||||
this.$refs["physicalSignsRemarkDialog"].showDialog(this.data, this.healthyData);
|
|
||||||
},
|
},
|
||||||
handleEditGuidanceClick(){
|
|
||||||
this.$refs["physicalSignsGuidanceDialog"].showDialog(this.data, this.healthyData);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.margin-top-20{
|
.margin-top-20 {
|
||||||
margin-top:20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
.p_title_1{
|
.p_title_1 {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -28,7 +28,9 @@ const oriState = {
|
|||||||
startNum: 0,
|
startNum: 0,
|
||||||
endNum: 0,
|
endNum: 0,
|
||||||
reviewStatus: 0,
|
reviewStatus: 0,
|
||||||
templateInfo: undefined
|
templateInfo: undefined,
|
||||||
|
copyData: undefined,
|
||||||
|
fontSize: 12
|
||||||
};
|
};
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
@ -37,7 +39,10 @@ const mutations = {
|
|||||||
obj => obj.id === payload.id
|
obj => obj.id === payload.id
|
||||||
);
|
);
|
||||||
if (tarDishes) {
|
if (tarDishes) {
|
||||||
if (tarDishes.dishesId !== payload.dishesId) {
|
if (
|
||||||
|
payload.dishesId !== tarDishes.dishesId ||
|
||||||
|
payload.type !== undefined
|
||||||
|
) {
|
||||||
// 替换菜品
|
// 替换菜品
|
||||||
Object.keys(payload).forEach(key => {
|
Object.keys(payload).forEach(key => {
|
||||||
if (key === "num") {
|
if (key === "num") {
|
||||||
@ -55,6 +60,9 @@ const mutations = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
updateFontSize(state, payload) {
|
||||||
|
state.fontSize = payload.fontSize;
|
||||||
|
},
|
||||||
addRecipesDishes(state, payload) {
|
addRecipesDishes(state, payload) {
|
||||||
state.recipesData[payload.num].dishes.push(payload.data);
|
state.recipesData[payload.num].dishes.push(payload.data);
|
||||||
},
|
},
|
||||||
@ -282,6 +290,7 @@ const actions = {
|
|||||||
// console.log(params);
|
// console.log(params);
|
||||||
},
|
},
|
||||||
async addDishes({ commit, state }, payload) {
|
async addDishes({ commit, state }, payload) {
|
||||||
|
console.log(payload);
|
||||||
const tarDishesList = state.recipesData[payload.num].dishes.filter(
|
const tarDishesList = state.recipesData[payload.num].dishes.filter(
|
||||||
obj => obj.type === payload.data.type
|
obj => obj.type === payload.data.type
|
||||||
);
|
);
|
||||||
@ -367,27 +376,35 @@ const actions = {
|
|||||||
);
|
);
|
||||||
if (tarDishes) {
|
if (tarDishes) {
|
||||||
const mTarDishes = JSON.parse(JSON.stringify(tarDishes));
|
const mTarDishes = JSON.parse(JSON.stringify(tarDishes));
|
||||||
const tarIgd = mTarDishes.igdList.find(obj => obj.id === payload.igdId);
|
let params = {
|
||||||
|
id: mTarDishes.id
|
||||||
|
};
|
||||||
|
if (payload.type !== undefined) {
|
||||||
|
// 修改餐类
|
||||||
|
params.type = payload.type;
|
||||||
|
} else {
|
||||||
|
// 修改食材
|
||||||
|
const tarIgd = mTarDishes.igdList.find(
|
||||||
|
obj => obj.id === payload.igdId
|
||||||
|
);
|
||||||
if (tarIgd) {
|
if (tarIgd) {
|
||||||
payload.weight && (tarIgd.weight = payload.weight);
|
payload.weight && (tarIgd.weight = payload.weight);
|
||||||
payload.cusWeight && (tarIgd.cusWeight = payload.cusWeight);
|
payload.cusWeight && (tarIgd.cusWeight = payload.cusWeight);
|
||||||
payload.cusUnit && (tarIgd.cusUnit = payload.cusUnit);
|
payload.cusUnit && (tarIgd.cusUnit = payload.cusUnit);
|
||||||
|
|
||||||
const params = {
|
params.detail = mTarDishes.igdList.map(igd => ({
|
||||||
id: mTarDishes.id,
|
|
||||||
detail: mTarDishes.igdList.map(igd => ({
|
|
||||||
id: igd.id,
|
id: igd.id,
|
||||||
weight: igd.weight,
|
weight: igd.weight,
|
||||||
cus_unit: igd.cusUnit,
|
cus_unit: igd.cusUnit,
|
||||||
cus_weight: igd.cusWeight
|
cus_weight: igd.cusWeight
|
||||||
}))
|
}));
|
||||||
};
|
}
|
||||||
|
}
|
||||||
const result = await updateDishesDetailApi(params);
|
const result = await updateDishesDetailApi(params);
|
||||||
if (result.code === 200) {
|
if (result.code === 200) {
|
||||||
commit("updateRecipesDishesDetail", payload);
|
commit("updateRecipesDishesDetail", payload);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
commit("updateRecipesDishesDetail", payload);
|
commit("updateRecipesDishesDetail", payload);
|
||||||
}
|
}
|
||||||
@ -408,7 +425,21 @@ const actions = {
|
|||||||
commit("deleteSomeDayDishes", payload);
|
commit("deleteSomeDayDishes", payload);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async deleteMenu({ commit }, payload) {}
|
async deleteMenu({ commit }, payload) {},
|
||||||
|
async setCopyData({ commit, state }, payload) {
|
||||||
|
return new Promise((res, rej) => {
|
||||||
|
const tarDishes = state.recipesData[payload.num].dishes.find(
|
||||||
|
obj => obj.id === payload.id
|
||||||
|
);
|
||||||
|
if (tarDishes) {
|
||||||
|
commit("updateStateData", { copyData: tarDishes });
|
||||||
|
|
||||||
|
res("复制成功");
|
||||||
|
} else {
|
||||||
|
rej("复制失败");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getters = {
|
const getters = {
|
||||||
|
@ -187,7 +187,7 @@
|
|||||||
prop="updateTime"
|
prop="updateTime"
|
||||||
width="180"
|
width="180"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="合同地址" align="center" prop="path" width="80">
|
<el-table-column label="合同地址" align="center" prop="path">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
@ -197,6 +197,16 @@
|
|||||||
:data-clipboard-text="copyValue"
|
:data-clipboard-text="copyValue"
|
||||||
>复制
|
>复制
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-popover placement="top" trigger="click">
|
||||||
|
<VueQr :text="copyValue" :logoSrc="logo" />
|
||||||
|
<el-button
|
||||||
|
slot="reference"
|
||||||
|
icon="el-icon-picture-outline"
|
||||||
|
type="text"
|
||||||
|
@click="handleCopy(scope.row.path)"
|
||||||
|
>二维码</el-button
|
||||||
|
>
|
||||||
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark" width="120" />
|
<el-table-column label="备注" align="center" prop="remark" width="120" />
|
||||||
@ -320,9 +330,14 @@ import { addContract, delContract, listContract } from "@/api/custom/contract";
|
|||||||
import Clipboard from "clipboard";
|
import Clipboard from "clipboard";
|
||||||
|
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
|
import VueQr from "vue-qr";
|
||||||
|
const logo = require("@/assets/logo/logo_b.png");
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Contract",
|
name: "Contract",
|
||||||
|
components: {
|
||||||
|
VueQr,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
const checkServePromise = (rule, value, callback) => {
|
const checkServePromise = (rule, value, callback) => {
|
||||||
if (this.form.projectId == 0 && !value) {
|
if (this.form.projectId == 0 && !value) {
|
||||||
@ -331,6 +346,7 @@ export default {
|
|||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
logo,
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
|
@ -4,6 +4,22 @@
|
|||||||
:style="`height: ${collapse ? 30 : 200}px`"
|
:style="`height: ${collapse ? 30 : 200}px`"
|
||||||
>
|
>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
|
<span class="font_size_style">
|
||||||
|
字体大小:
|
||||||
|
<el-select
|
||||||
|
v-model="mFontSize"
|
||||||
|
size="mini"
|
||||||
|
style="width: 80px"
|
||||||
|
@change="handleOnSizeChange"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="size in fontSizeOpts"
|
||||||
|
:key="size.value"
|
||||||
|
:label="size.label"
|
||||||
|
:value="size.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</span>
|
||||||
<el-button size="mini" v-if="!recipesId" @click="handleOnBack"
|
<el-button size="mini" v-if="!recipesId" @click="handleOnBack"
|
||||||
>返回</el-button
|
>返回</el-button
|
||||||
>
|
>
|
||||||
@ -91,16 +107,32 @@ export default {
|
|||||||
PieChart,
|
PieChart,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
mFontSize: 12,
|
||||||
|
fontSizeOpts: [
|
||||||
|
{ value: 12, label: "12" },
|
||||||
|
{ value: 14, label: "14" },
|
||||||
|
{ value: 16, label: "16" },
|
||||||
|
{ value: 18, label: "18" },
|
||||||
|
],
|
||||||
|
};
|
||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
// console.log(this.data);
|
// console.log(this.data);
|
||||||
},
|
},
|
||||||
props: ["collapse", "data"],
|
props: ["collapse", "data"],
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["recipesId", "reviewStatus", "healthyData"]),
|
...mapState(["recipesId", "reviewStatus", "healthyData", "fontSize"]),
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
fontSize(val) {
|
||||||
|
this.mFontSize = val;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleOnSizeChange(fontSize) {
|
||||||
|
this.updateFontSize({ fontSize });
|
||||||
|
},
|
||||||
handleCollapseClick() {
|
handleCollapseClick() {
|
||||||
this.$emit("update:collapse", !this.collapse);
|
this.$emit("update:collapse", !this.collapse);
|
||||||
},
|
},
|
||||||
@ -121,7 +153,7 @@ export default {
|
|||||||
this.updateStateData({ recipesData: [] });
|
this.updateStateData({ recipesData: [] });
|
||||||
},
|
},
|
||||||
...mapActions(["saveRecipes", "updateReviewStatus"]),
|
...mapActions(["saveRecipes", "updateReviewStatus"]),
|
||||||
...mapMutations(["updateStateData"]),
|
...mapMutations(["updateStateData", "updateFontSize"]),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -138,6 +170,13 @@ export default {
|
|||||||
transition: all 0.3s;
|
transition: all 0.3s;
|
||||||
transform-origin: center center;
|
transform-origin: center center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.font_size_style {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-right: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
@ -92,13 +92,14 @@ export default {
|
|||||||
data.name
|
data.name
|
||||||
}」`;
|
}」`;
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
|
this.type = data.type;
|
||||||
} else if (type) {
|
} else if (type) {
|
||||||
this.title = `添加第${numDay}天${this.typeDict[type]}菜品`;
|
this.title = `添加第${numDay}天${this.typeDict[type]}菜品`;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.dishesRef.getList({ type });
|
this.$refs.dishesRef.getList({ type: this.type });
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleOnClosed(done) {
|
handleOnClosed(done) {
|
||||||
@ -114,6 +115,7 @@ export default {
|
|||||||
this.active = 1;
|
this.active = 1;
|
||||||
this.dishesTypeOptions = (this.type || data.type)
|
this.dishesTypeOptions = (this.type || data.type)
|
||||||
.split(",")
|
.split(",")
|
||||||
|
.sort((a, b) => a - b)
|
||||||
.reduce((arr, cur, idx) => {
|
.reduce((arr, cur, idx) => {
|
||||||
if (idx === 0) {
|
if (idx === 0) {
|
||||||
this.selDishes.type = cur;
|
this.selDishes.type = cur;
|
||||||
|
@ -0,0 +1,98 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="visible"
|
||||||
|
width="320px"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<div v-loading="loading" @click="handleClick" class="reuse_dialog_wrapper">
|
||||||
|
<div style="margin-bottom: 12px">餐类</div>
|
||||||
|
<el-radio-group v-model="type">
|
||||||
|
<el-radio
|
||||||
|
style="padding: 8px 0"
|
||||||
|
v-for="item in menuTypeOptions"
|
||||||
|
:key="item.dictValue"
|
||||||
|
:label="item.dictValue"
|
||||||
|
>
|
||||||
|
{{ item.dictLabel }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { createNamespacedHelpers } from "vuex";
|
||||||
|
const { mapState } = createNamespacedHelpers("recipes");
|
||||||
|
import { getDishes } from "@/api/custom/dishes";
|
||||||
|
export default {
|
||||||
|
name: "DishesSettingDialog",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
loading: false,
|
||||||
|
data: undefined,
|
||||||
|
type: "",
|
||||||
|
menuTypeOptions: [],
|
||||||
|
title: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
},
|
||||||
|
showDialog({ numDay, data }) {
|
||||||
|
if (!data) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.data = data;
|
||||||
|
this.visible = true;
|
||||||
|
this.loading = true;
|
||||||
|
this.type = data.type;
|
||||||
|
this.title = `修改第${numDay}天「${data.name}」菜品`;
|
||||||
|
getDishes(data.dishesId).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.loading = false;
|
||||||
|
this.menuTypeOptions = res.data.type
|
||||||
|
.split(",")
|
||||||
|
.sort((a, b) => a - b)
|
||||||
|
.reduce((arr, cur) => {
|
||||||
|
const tarOpt = this.typeOptions.find(
|
||||||
|
(obj) => obj.dictValue === cur
|
||||||
|
);
|
||||||
|
if (tarOpt) {
|
||||||
|
arr.push(tarOpt);
|
||||||
|
}
|
||||||
|
return arr;
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.visible = false;
|
||||||
|
this.data = undefined;
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit("onConfirm", { type: this.type, id: this.data.id });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["typeOptions"]),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.reuse_dialog_wrapper {
|
||||||
|
.item {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu_type {
|
||||||
|
padding: 8px 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -95,6 +95,14 @@ export default {
|
|||||||
this.mUnit = value;
|
this.mUnit = value;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
weight(val) {
|
||||||
|
this.mWeight = val;
|
||||||
|
},
|
||||||
|
unit(val) {
|
||||||
|
this.mUnit = val;
|
||||||
|
},
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
unitWeight() {
|
unitWeight() {
|
||||||
return (
|
return (
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'ReuseDialog',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
visible: false,
|
|
||||||
data: undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showDialog() {
|
|
||||||
this.visible = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -7,12 +7,28 @@
|
|||||||
:cell-style="{ padding: '2px 0' }"
|
:cell-style="{ padding: '2px 0' }"
|
||||||
:header-cell-style="{ padding: '4px 0', height: 'unset' }"
|
:header-cell-style="{ padding: '4px 0', height: 'unset' }"
|
||||||
size="mini"
|
size="mini"
|
||||||
:style="`outline: ${currentDay === num ? '1px solid #d96969' : 'none'}`"
|
header-row-class-name="recipes_header"
|
||||||
|
:cell-class-name="cellClassName"
|
||||||
|
:style="`outline: ${currentDay === num ? '1px solid #d53950' : 'none'}`"
|
||||||
>
|
>
|
||||||
<el-table-column prop="type" :width="100" align="center">
|
<el-table-column prop="type" :width="100" align="center">
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
<div class="num_day" @click="handleOnResetCurrentDay">
|
<el-popover placement="top" trigger="hover" v-if="!!copyData">
|
||||||
<div>{{ `第${numDay}天` }}</div>
|
<div>
|
||||||
|
<el-button size="mini" type="primary" @click="handleOnPaste"
|
||||||
|
>粘贴</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
slot="reference"
|
||||||
|
class="num_day"
|
||||||
|
@click="handleOnResetCurrentDay"
|
||||||
|
>
|
||||||
|
{{ `第${numDay}天` }}
|
||||||
|
</div>
|
||||||
|
</el-popover>
|
||||||
|
<div v-else>
|
||||||
|
{{ `第${numDay}天` }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -44,6 +60,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-popover placement="right" trigger="hover" :title="scope.row.name">
|
<el-popover placement="right" trigger="hover" :title="scope.row.name">
|
||||||
<div>
|
<div>
|
||||||
|
<div style="margin-bottom: 8px">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -62,6 +79,24 @@
|
|||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-document-copy"
|
||||||
|
class="fun_button"
|
||||||
|
@click="handleOnCopy(scope.row)"
|
||||||
|
>复制</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-document-copy"
|
||||||
|
class="fun_button"
|
||||||
|
@click="handleOnSetting(scope.row)"
|
||||||
|
>修改餐类</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<span class="num_day" slot="reference">{{ scope.row.name }}</span>
|
<span class="num_day" slot="reference">{{ scope.row.name }}</span>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</template>
|
</template>
|
||||||
@ -172,7 +207,13 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="做法" prop="methods" />
|
<el-table-column label="做法" prop="methods" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<!-- 添加菜品抽屉 -->
|
||||||
<AddDishesDrawer ref="drawerRef" @onConfirm="handleOnDishesConfirm" />
|
<AddDishesDrawer ref="drawerRef" @onConfirm="handleOnDishesConfirm" />
|
||||||
|
<!-- 菜品复用菜单 -->
|
||||||
|
<DishesSettingDialog
|
||||||
|
ref="settingDialogRef"
|
||||||
|
@onConfirm="handleOnSettingConfirm"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -187,6 +228,8 @@ const {
|
|||||||
import EditableText from "./EditableText";
|
import EditableText from "./EditableText";
|
||||||
import EditableUnit from "./EditableUnit";
|
import EditableUnit from "./EditableUnit";
|
||||||
import AddDishesDrawer from "./AddDishesDrawer";
|
import AddDishesDrawer from "./AddDishesDrawer";
|
||||||
|
import DishesSettingDialog from "./DishesSettingDialog";
|
||||||
|
import VueScrollTo from "vue-scrollto";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RecipesCom",
|
name: "RecipesCom",
|
||||||
@ -213,6 +256,7 @@ export default {
|
|||||||
EditableText,
|
EditableText,
|
||||||
EditableUnit,
|
EditableUnit,
|
||||||
AddDishesDrawer,
|
AddDishesDrawer,
|
||||||
|
DishesSettingDialog,
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// console.log(this.data);
|
// console.log(this.data);
|
||||||
@ -313,12 +357,23 @@ export default {
|
|||||||
return mData;
|
return mData;
|
||||||
},
|
},
|
||||||
...mapGetters(["typeDict"]),
|
...mapGetters(["typeDict"]),
|
||||||
...mapState(["currentDay"]),
|
...mapState(["currentDay", "copyData", "fontSize"]),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
cellClassName({ row, column, rowIndex, columnIndex }) {
|
||||||
|
// console.log({ row, column, rowIndex, columnIndex });
|
||||||
|
if (!columnIndex) {
|
||||||
|
return "recipes_first_col";
|
||||||
|
} else {
|
||||||
|
return `recipes_cell recipes_cell_${this.fontSize}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
handleParentClick(e) {
|
handleParentClick(e) {
|
||||||
// 校验某天
|
// 校验某天
|
||||||
this.setCurrentDay({ currentDay: this.num });
|
this.setCurrentDay({ currentDay: this.num });
|
||||||
|
VueScrollTo.scrollTo(`#recipes${this.num}`, 500, {
|
||||||
|
container: "#recipes_content",
|
||||||
|
});
|
||||||
},
|
},
|
||||||
spanMethod({ row, column, rowIndex, columnIndex }) {
|
spanMethod({ row, column, rowIndex, columnIndex }) {
|
||||||
if (columnIndex === 0) {
|
if (columnIndex === 0) {
|
||||||
@ -351,6 +406,27 @@ export default {
|
|||||||
// console.log(data);
|
// console.log(data);
|
||||||
this.deleteDishes({ num: this.num, id: data.id });
|
this.deleteDishes({ num: this.num, id: data.id });
|
||||||
},
|
},
|
||||||
|
handleOnCopy(data) {
|
||||||
|
// console.log(data);
|
||||||
|
this.setCopyData({ num: this.num, id: data.id })
|
||||||
|
.then((msg) => {
|
||||||
|
this.$message.success(msg);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.$message.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleOnPaste() {
|
||||||
|
// console.log(this.copyData);
|
||||||
|
if (this.copyData) {
|
||||||
|
this.addDishes({
|
||||||
|
num: this.num,
|
||||||
|
data: this.copyData,
|
||||||
|
}).catch((err) => {
|
||||||
|
this.$message.error(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
handleOnWeightChange(data, weight) {
|
handleOnWeightChange(data, weight) {
|
||||||
// console.log({ data, weight });
|
// console.log({ data, weight });
|
||||||
this.updateDishes({
|
this.updateDishes({
|
||||||
@ -390,6 +466,16 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleOnSetting(data) {
|
||||||
|
this.$refs.settingDialogRef.showDialog({ numDay: this.numDay, data });
|
||||||
|
},
|
||||||
|
handleOnSettingConfirm({ type, id }) {
|
||||||
|
this.updateDishes({
|
||||||
|
num: this.num,
|
||||||
|
id,
|
||||||
|
type,
|
||||||
|
});
|
||||||
|
},
|
||||||
handleOnMenuTypeClick(data) {
|
handleOnMenuTypeClick(data) {
|
||||||
this.$refs.drawerRef.showDrawer({ type: data.type, numDay: this.numDay });
|
this.$refs.drawerRef.showDrawer({ type: data.type, numDay: this.numDay });
|
||||||
},
|
},
|
||||||
@ -398,6 +484,7 @@ export default {
|
|||||||
"addDishes",
|
"addDishes",
|
||||||
"deleteDishes",
|
"deleteDishes",
|
||||||
"replaceDishes",
|
"replaceDishes",
|
||||||
|
"setCopyData",
|
||||||
]),
|
]),
|
||||||
...mapMutations(["setCurrentDay", "resetCurrentDay"]),
|
...mapMutations(["setCurrentDay", "resetCurrentDay"]),
|
||||||
},
|
},
|
||||||
@ -419,4 +506,36 @@ export default {
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.recipes_header {
|
||||||
|
& > th {
|
||||||
|
background: #d53950 !important;
|
||||||
|
color: white !important;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.recipes_first_col {
|
||||||
|
background: #d53950 !important;
|
||||||
|
color: white !important;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recipes_cell {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #595959;
|
||||||
|
}
|
||||||
|
|
||||||
|
.recipes_cell_12 {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.recipes_cell_14 {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.recipes_cell_16 {
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.recipes_cell_18 {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user