客户档案的体征、合同展示

This commit is contained in:
xiezhijun
2021-01-30 19:26:56 +08:00
parent 1c58b13bcf
commit 9470aa6b5e
18 changed files with 754 additions and 384 deletions

View File

@ -0,0 +1,129 @@
<template>
<el-dialog
title="合同详情"
:visible.sync="visible"
width="1000px"
append-to-body
@closed="onClosed"
>
<el-table
:show-header="false"
:data="contractDetailList"
border
:cell-style="columnStyle"
style="width: 100%"
>
<el-table-column width="120" prop="attr_name_one"> </el-table-column>
<el-table-column prop="value_one">
<template slot-scope="scope">
<auto-hide-message :data="scope.row.value_one == null ? '' : scope.row.value_one + ''" :maxLength="20"/>
</template>
</el-table-column>
<el-table-column width="120" prop="attr_name_two"></el-table-column>
<el-table-column prop="value_two">
<template slot-scope="scope">
<el-tag v-if="scope.row.attr_name_two === '合同状态'" :type="scope.row.value_two === 'yes' ? 'success' : 'danger'">
{{ scope.row.value_two === "yes" ? "已签订" : "未签订" }}
</el-tag>
<el-button v-else-if="scope.row.attr_name_two === '合同地址'" type="text" icon="el-icon-copy-document" @click="handleCopy(scope.row.value_two)" class="copyBtn"
:data-clipboard-text="copyValue">复制
</el-button>
<auto-hide-message v-else :data="scope.row.value_two == null ? '' : scope.row.value_two + ''" :maxLength="20"/>
</template>
</el-table-column>
<el-table-column width="120" prop="attr_name_three"></el-table-column>
<el-table-column prop="value_three">
<template slot-scope="scope">
<auto-hide-message :data="scope.row.value_three == null ? '' : scope.row.value_three + ''" :maxLength="20"/>
</template>
</el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import AutoHideMessage from "@/components/AutoHideMessage";
import { getContract } from "@/api/custom/contract";
import Clipboard from 'clipboard';
export default {
name: "ContractDialog",
components: {
"auto-hide-message": AutoHideMessage,
},
props: {},
data() {
return {
contractDetailList: [],
visible: false,
copyValue: "",
//合同详情的标题,按竖显示
contractTitleData: [
["合同编号", "合同状态", "客户姓名"],
["证件号", "电话", "服务时间"],
["服务承诺", "金额", "调理项目"],
["签订时间", "合同地址", "备注"]
],
//合同详情的属性名称,与标题对应,按竖显示
contractValueData: [
["id", "status", "name"],
["cusId", "phone", "serveTime"],
["servePromise", "amount", "projectName"],
["updateTime", "path", "remark"]
],
};
},
created() {},
methods: {
// 自定义列背景色
columnStyle({ row, column, rowIndex, columnIndex }) {
if (
columnIndex == 0 ||
columnIndex == 2 ||
columnIndex == 4 ||
columnIndex == 6
) {
//第三第四列的背景色就改变了2和3都是列数的下标
return "background:#f3f6fc;font-weight:bold";
} else {
return "background:#ffffff;";
}
},
showDialog(id) {
getContract(id).then((response) => {
let contractDetail = response.data;
contractDetail.serveTime = contractDetail.serveTime/30 + "个月";
contractDetail.servePromise += contractDetail.servePromise ? "斤" : "";
for (let i = 0; i < this.contractTitleData.length; i++) {
this.contractDetailList.push({
attr_name_one: this.contractTitleData[i][0],
value_one: response.data[this.contractValueData[i][0]],
attr_name_two: this.contractTitleData[i][1],
value_two: response.data[this.contractValueData[i][1]],
attr_name_three: this.contractTitleData[i][2],
value_three: response.data[this.contractValueData[i][2]]
});
}
this.visible = true;
});
},
onClosed() {
this.contractDetailList = [];
},
handleCopy(path) {
this.copyValue = window.location.origin.replace('manage', 'sign') + path;
const btnCopy = new Clipboard('.copyBtn');
this.$message({
message: '拷贝成功',
type: 'success'
});
// btnCopy.destroy();
}
},
watch: {
// visible: function (val, oldVal) {
// console.log({val, oldVal})
// }
},
};
</script>

View File

@ -0,0 +1,177 @@
<template>
<div>
<el-drawer
:title="title"
:close-on-press-escape="false"
:visible.sync="visible"
@closed="handleOnClosed"
size="40%"
>
<div class="app-container">
<!--<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>创建合同
</el-button>
</el-col>
</el-row>-->
<el-table :data="contractList">
<el-table-column label="合同编号" align="center" prop="id" width="150"/>
<el-table-column label="合同状态" align="center" prop="status" width="80" >
<template slot-scope="scope">
<el-tag
:type="scope.row.status === 'yes' ? 'success' : 'danger'"
disable-transitions>
{{scope.row.status === 'yes' ? '已签订':'未签订'}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="客户姓名" align="center" prop="name" width="200"/>
<el-table-column label="合同地址" align="center" prop="path" width="80">
<template slot-scope="scope">
<el-button type="text" icon="el-icon-copy-document" @click="handleCopy(scope.row.path)" class="copyBtn"
:data-clipboard-text="copyValue">复制
</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="handleOnDetailClick(scope.row)"
>详情
</el-button>
<el-button
v-if="scope.row.status==='yes'"
size="mini"
type="text"
icon="el-icon-view"
@click="handleLook(scope.row.path)"
>查看
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleOnDeleteClick(scope.row)"
v-hasPermi="['custom:contract:remove']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-drawer>
<!--<create-order-dialog ref="cusCreateOrderDialogRef" />-->
<contract-detail ref="contractDetailRef" />
</div>
</template>
<script>
import {delContract, listContract} from "@/api/custom/contract";
import ContractDetail from "@/components/ContractDetail";
import Clipboard from 'clipboard';
export default {
name: "CustomerContractDrawer",
components: {
'contract-detail': ContractDetail
},
data() {
return {
visible: false,
title: "",
data: undefined,
copyValue:"",
contractList: [],
};
},
methods: {
showDrawer(data) {
this.data = data;
if (!this.data) {
return;
}
this.title = `${this.data.name}」合同列表`;
this.fetchContractList(data.id);
},
fetchContractList(cusId) {
listContract({"customerId": cusId }).then((res) => {
this.contractList = res.rows;
this.visible = true;
});
},
handleAdd() {
this.$refs.cusCreateOrderDialogRef.showDialog(
{
customer: this.data.name,
cusId: this.data.id,
preSaleId: this.data.salesman,
afterSaleId: this.data.afterDietitian,
nutritionistId: this.data.mainDietitian,
nutriAssisId: this.data.assistantDietitian,
},
() => {
this.fetchOrderList(this.data.id);
}
);
},
handleOnClosed() {
this.data = undefined;
},
handleOnDetailClick(data) {
this.$refs.contractDetailRef.showDialog(data.id);
},
handleOnEditClick(data) {
},
handleOnDeleteClick(data) {
const contractIds = data.id;
this.$confirm(
'是否确认删除姓名为"' + data.name + '"的合同信息?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delContract(contractIds);
})
.then(() => {
this.fetchContractList(this.data.id);
this.msgSuccess("删除成功");
})
.catch(function () {});
},
handleCopy(path) {
this.copyValue = window.location.origin.replace('manage', 'sign') + path;
const btnCopy = new Clipboard('.copyBtn');
this.$message({
message: '拷贝成功',
type: 'success'
});
},
handleLook(path) {
const url = window.location.origin.replace('manage', 'sign') + path;
// const url = "http://stsign.busyinn.com" + path;
window.open(url, '_blank');
}
},
};
</script>
<style lang="scss" scoped>
/deep/ :focus {
outline: 0;
}
</style>

View File

@ -1,65 +1,75 @@
<template>
<el-dialog
:visible.sync="visible"
:title="title"
append-to-body
@closed="onClosed"
>
<el-table
:show-header="false"
:data="dataList"
border
:cell-style="columnStyle"
style="width: 100%"
>
<el-table-column width="120" prop="attr_name_one"> </el-table-column>
<el-table-column prop="value_one">
<template slot-scope="scope">
<auto-hide-message
:data="scope.row.value_one == null ? '' : scope.row.value_one + ''"
:maxLength="20"
/>
</template>
</el-table-column>
<el-table-column width="120" prop="attr_name_two"></el-table-column>
<el-table-column prop="value_two">
<template slot-scope="scope">
<auto-hide-message
:data="scope.row.value_two == null ? '' : scope.row.value_two + ''"
:maxLength="20"
/>
</template>
</el-table-column>
<el-table-column width="120" prop="attr_name_three"></el-table-column>
<el-table-column prop="value_three">
<template slot-scope="scope">
<auto-hide-message
:data="
scope.row.value_three == null ? '' : scope.row.value_three + ''
"
:maxLength="20"
/>
</template>
</el-table-column>
</el-table>
<el-dialog :visible.sync="visible" :title="title" append-to-body @closed="onClosed">
<!-- 客户健康评估 -->
<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>
<p class="p_title_1" style="margin-top: 5px;">{{titleArray[index]}}</p>
<table-detail-message :data="item" ></table-detail-message>
</div>
</div>
<!-- 其他信息 -->
<div style="height:400px;overflow: auto">
<div v-for="(item,index) in dataList.slice(1,10)" style="margin-bottom: 50px;" :key="index">
<div>
<p class="p_title_1" style="margin-top: 5px;">{{titleArray[index+1]}}</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>
<el-table-column prop="value_one">
<template slot-scope="scope">
<auto-hide-message :data="scope.row.value_one == null ? '' : (scope.row.value_one+'')" :maxLength="20"/>
<el-button type="primary" v-show="scope.row.value_one" @click="downloadFile(medicalReportPathArray[0])">下载</el-button>
</template>
</el-table-column>
<el-table-column width="140" prop="attr_name_two"></el-table-column>
<el-table-column prop="value_two">
<template slot-scope="scope">
<auto-hide-message :data="scope.row.value_two == null ? '' : (scope.row.value_two+'')" :maxLength="20"/>
<el-button type="primary" v-show="scope.row.value_two" @click="downloadFile(medicalReportPathArray[1])">下载</el-button>
</template>
</el-table-column>
<el-table-column width="140" prop="attr_name_three"></el-table-column>
<el-table-column prop="value_three">
<template slot-scope="scope">
<auto-hide-message :data="scope.row.value_three == null ? '' : (scope.row.value_three+'')" :maxLength="20"/>
<el-button type="primary" v-show="scope.row.value_three" @click="downloadFile(medicalReportPathArray[2])">下载</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
<!-- 客户体征 -->
<div v-else>
<table-detail-message v-show="dataList.length > 0" :data="dataList" ></table-detail-message>
<p v-show="dataList.length == 0" style="font-size: 20px;text-align:center">暂无数据</p>
</div>
</el-dialog>
</template>
<script>
import { getCustomerPhysicalSignsByCusId } from "@/api/custom/customer";
import TableDetailMessage from "@/components/TableDetailMessage";
import AutoHideMessage from "@/components/AutoHideMessage";
import * as healthyData from "@/utils/healthyData";
export default {
name: "PhysicalSignsDialog",
components: {
"auto-hide-message": AutoHideMessage,
"table-detail-message": TableDetailMessage
},
data() {
return {
visible: false,
title: "",
dataList: [],
// 标题
titleData: [
dataType: 0,
// 体征标题
signTitleData: [
["创建时间", "姓名", "年龄"],
["性别", "手机号", "身高(cm)"],
["体重(斤)", "地域", "病史"],
@ -71,11 +81,11 @@ export default {
["方便沟通时间", "湿气数据", "气血数据"],
["减脂经历", "减脂遇到的困难", "备注"],
],
// 属性
valueData: [
// 体征属性
signValueData: [
["createTime", "name", "age"],
["sex", "phone", "tall"],
["weight", "position", "singList"],
["weight", "position", "signStr"],
["dishesIngredientId", "constipation", "staylate"],
["motion", "makeFoodType", "remarks"],
["makeFoodTaste", "vocation", "night"],
@ -84,6 +94,85 @@ export default {
["connectTime", "bloodData", "moistureDate"],
["experience", "difficulty", "comments"],
],
//健康评估每个模板标题,与调查表保持一致
titleArray: healthyData['titleArray'],
// 健康评估标题
healthyTitleData:[
[
["创建时间","客户姓名","手机号"],["调理项目","性别","年龄"],["身高(厘米)","体重(斤)","位置"]
],
[
["减脂经历","减脂遇到的困难","减脂是否反弹"],["是否意识到生活习惯是减脂关键","",""]
],
[
["调味品种","烹调方式","烹调频次"],["洗菜方式","",""]
],
[
["早餐习惯","早餐吃的食物","午餐习惯"],["晚餐习惯","正餐中素菜占比","最常吃的肉类"],
["晚餐时间","每周吃夜宵次数","夜宵通常吃的食物"],["食物的冷热偏好","食物的口味偏好","平均每周吃生菜几次"],
["每周吃生菜的频次类型","平均每天吃水果次数","吃水果的时间段"],["平时吃水果的频次","一餐吃几碗饭","吃几成饱"],
["吃饭速度","饮食特点","常吃的零食"],["有无服用营养保健品","营养保健品品牌名","营养保健品产品名"],
["服用营养保健品频次","忌口过敏食物",""]
],
[
["每天的饮水量","喜欢喝什么水","喝水习惯"],["常喝的饮品的每周频次","是否喝酒","喝酒种类"],["对应酒的量","是否抽烟","抽烟频次和烟龄"],
["是否经常抽二手烟","工作行业","工作性质"],["排便次数","排便时间段","排便的形状"],["排便的气味","排便的速度","排便的颜色"]
],
[
["每周运动次数","每次运动的时长","每天运动的时间"],
["运动","运动场地",""]
],
[
["睡觉时间","睡眠质量","是否有辅助入睡药物"],
["辅助睡眠类药物名称","是否经常熬夜","熬夜频次"]
],
[
["病史体征","湿气数据","气血数据"],
["家族疾病史","手术史","近期是否做过手术"],
["手术恢复情况","是否长期服用药物","长期服用的药物"],
["是否出现过过敏症状","过敏症状","过敏源"]
],
[
["体检报告(1)","体检报告(2)","体检报告(3)"]
]
],
// 健康评估属性
healthyValueData:[
[["createTime","name","phone"],["conditioningProject","sex","age"],["tall","weight","position"]],
[
["experience","difficulty","rebound"],["crux","",""]
],
[["condiment","cookingStyle","cookingStyleRate"],["washVegetablesStyle","",""]],
[
["breakfastType","breakfastFood","lunchType"],["dinner","vegetableRate","commonMeat"],
["dinnerTime","supperNum","supperFood"],["dietHotAndCold","dietFlavor","vegetablesNum"],
["vegetablesRateType","fruitsNum","fruitsTime"],["fruitsRate","riceNum","riceNum"],
["eatingSpeed","makeFoodType","snacks"],
["healthProductsFlag","healthProductsBrand","healthProductsName"],
["healthProductsWeekRate","dishesIngredient",""]
],
[
["waterNum","waterType","waterHabit"],["drinksNum","drinkWineFlag","drinkWineClassify"],["drinkWineAmount","smokeFlag","smokeRate"],
["secondSmoke","workIndustry","workType"],["defecationNum","defecationTime","defecationShape"],["defecationSmell","defecationSpeed","defecationColor"]
],
[
["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"]
]
]
};
},
methods: {
@ -97,46 +186,215 @@ export default {
}
},
showDialog(data) {
this.title = `${data.name}客户体征`;
this.title = `${data.name}`;
getCustomerPhysicalSignsByCusId(data.id).then((res) => {
if (!res.data) {
this.visible = true;
return;
if (res.data.customerHealthy) {
//判断是体征还是健康评估
this.dataType = res.data.type;
if(this.dataType == 0){
this.getDataListByHealthyMessage(res.data.customerHealthy);
}else{
this.getDataListBySignMessage(res.data.customerHealthy)
}
}
const sign = res.data;
sign.sex = sign.sex === 0 ? `` : "女";
sign.position = sign.position === 0 ? `南方` : "北方";
sign.signString = sign.signList.join("");
sign.constipation = sign.constipation === 0 ? "是" : "否";
sign.staylate = sign.staylate === 0 ? "是" : "否";
sign.motion = sign.motion === 0 ? "是" : "否";
sign.makeFoodType = sign.makeFoodType === 0 ? `自己做` : "外面吃";
sign.makeFoodTaste = sign.makeFoodTaste === 0 ? "清淡" : "重口味";
sign.night = sign.night === 0 ? `` : "否";
sign.walk = sign.walk === 0 ? `久坐多` : "走动多";
sign.weakness = sign.weakness === 0 ? `` : "否";
sign.rebound = sign.rebound === 0 ? `` : "否";
sign.crux = sign.crux === 0 ? `` : "否";
sign.sleepTime = sign.sleepTime + "点";
sign.getupTime = sign.getupTime + "点";
sign.connectTime = sign.connectTime + "点";
for (let i = 0; i < this.titleData.length; i++) {
this.dataList.push({
attr_name_one: this.titleData[i][0],
value_one: sign[this.valueData[i][0]],
attr_name_two: this.titleData[i][1],
value_two: sign[this.valueData[i][1]],
attr_name_three: this.titleData[i][2],
value_three: sign[this.valueData[i][2]],
});
}
this.title += (this.dataType == 0 ? "客户健康评估信息" : "客户体征信息");
this.visible = true;
});
},
onClosed() {
this.dataList = [];
},
//对体征信息进行处理
getDataListBySignMessage(sign){
sign.sex = sign.sex === 0 ? `` : "女";
sign.position = sign.position === 0 ? `南方` : "北方";
sign.signStr = this.getSignString(sign.signList);
sign.constipation = sign.constipation === 0 ? "是" : "否";
sign.staylate = sign.staylate === 0 ? "是" : "否";
sign.motion = sign.motion === 0 ? "是" : "否";
sign.makeFoodType = sign.makeFoodType === 0 ? `自己做` : "外面吃";
sign.makeFoodTaste = sign.makeFoodTaste === 0 ? "清淡" : "重口味";
sign.night = sign.night === 0 ? `` : "否";
sign.walk = sign.walk === 0 ? `久坐多` : "走动多";
sign.weakness = sign.weakness === 0 ? `` : "否";
sign.rebound = sign.rebound === 0 ? `` : "否";
sign.crux = sign.crux === 0 ? `` : "否";
sign.sleepTime = sign.sleepTime + "点";
sign.getupTime = sign.getupTime + "点";
sign.connectTime = sign.connectTime + "点";
for (let i = 0; i < this.signTitleData.length; i++) {
this.dataList.push({
attr_name_one: this.signTitleData[i][0],
value_one: sign[this.signValueData[i][0]],
attr_name_two: this.signTitleData[i][1],
value_two: sign[this.signValueData[i][1]],
attr_name_three: this.signTitleData[i][2],
value_three: sign[this.signValueData[i][2]],
});
}
},
//对健康评估信息进行处理
getDataListByHealthyMessage(healthy){
let detailHealthy = this.dealHealthy(healthy);
//性别
detailHealthy.sex = detailHealthy.sex == 0 ? "男" : (detailHealthy.sex == 1 ? "女" : "未知");
detailHealthy.position = detailHealthy.position == 0 ? "南方" : "北方";
detailHealthy.rebound = detailHealthy.rebound == 0 ? "否" : "是";
detailHealthy.crux = detailHealthy.crux == 0 ? "否" : "是";
//调味品
detailHealthy.condiment += detailHealthy.otherCondiment ? (""+detailHealthy.otherCondiment) : "";
//烹饪
let cookingStyleRate = "";
if(detailHealthy.cookingStyleRate != null){
detailHealthy.cookingStyleRate.split(",").forEach(function(item, index){
cookingStyleRate += (cookingStyleRate != "" ? "" : "") + (healthyData["cookingStyleRateArray"][index])+item +"次";
});
}
detailHealthy.cookingStyleRate = cookingStyleRate;
//洗菜方式
detailHealthy.washVegetablesStyle += detailHealthy.otherWashVegetablesStyle ? (""+detailHealthy.otherWashVegetablesStyle) : "";
//素菜占比
detailHealthy.vegetableRate += "成";
let makeFoodTypeOption = healthyData["makeFoodTypeArray"].find(opt => opt.value == detailHealthy.makeFoodType+"");
detailHealthy.makeFoodType = makeFoodTypeOption ? makeFoodTypeOption.name : "";
//零食
detailHealthy.snacks += detailHealthy.otherSnacks ? ("" + detailHealthy.otherSnacks) : "";
detailHealthy.healthProductsFlag = detailHealthy.healthProductsFlag == 1 ? "有" : "无";
detailHealthy.healthProductsWeekRate = detailHealthy.healthProductsDayRate+"次/天,"+detailHealthy.healthProductsWeekRate+"次/周";
detailHealthy.waterNum += "毫升";
//饮品
let drinksNumString = "";
if(detailHealthy.drinksNum != null){
detailHealthy.drinksNum.split(",").forEach(function(item, index){
drinksNumString += (drinksNumString != "" ? "" : "") + (healthyData["drinksNumArray"][index])+item +"次";
});
}
detailHealthy.drinksNum = drinksNumString;
detailHealthy.drinkWineClassify += detailHealthy.otherWineClassify ? (""+detailHealthy.otherWineClassify) : "";
let drinkWineAmountString = "";
if(detailHealthy.drinkWineAmount != null){
detailHealthy.drinkWineAmount.split(",").forEach(function(item, index){
drinkWineAmountString += (drinkWineAmountString != "" ? "" : "") + (healthyData["drinkWineAmountArray"][index])+item + healthyData["drinkWineAmountUnitArray"][index];
});
}
detailHealthy.drinkWineAmount = drinkWineAmountString;
detailHealthy.smokeFlag = detailHealthy.smokeFlag == 1 ? "是" : "否";
detailHealthy.secondSmoke = detailHealthy.secondSmoke == 1 ? "是" : "否";
let smokeRateString = "";
if(detailHealthy.smokeRate != null){
detailHealthy.smokeRate.split(",").forEach(function(item, index){
smokeRateString += (smokeRateString != "" ? "" : "") + (healthyData["smokeRateArray"][index])+item + healthyData["smokeRateUnitArray"][index];
});
}
detailHealthy.smokeRate = smokeRateString;
detailHealthy.defecationNum = detailHealthy.defecationNum + "次/天";
detailHealthy.motionDuration = detailHealthy.motionDuration +"分钟";
let motionStr = "";
if(detailHealthy.aerobicMotionClassify != null){
detailHealthy.aerobicMotionClassify.split(",").forEach(function(item, index){
motionStr += item ? ((motionStr != "" ? "" : "") + item) : "";
});
}
if(detailHealthy.anaerobicMotionClassify != null){
detailHealthy.anaerobicMotionClassify.split(",").forEach(function(item, index){
motionStr += item ? ((motionStr != "" ? "" : "") + item) : "";
});
}
if(detailHealthy.anaerobicAerobicMotionClassify != null){
detailHealthy.anaerobicAerobicMotionClassify.split(",").forEach(function(item, index){
motionStr += item ? ((motionStr != "" ? "" : "") + item) : "";
});
}
detailHealthy.motion = this.trimComma(motionStr + (detailHealthy.otherMotionClassify ? ( ""+ detailHealthy.otherMotionClassify) : ""));
detailHealthy.motionField += this.trimComma(detailHealthy.otherMotionField ? (""+detailHealthy.otherMotionField) : "");
detailHealthy.sleepDrugFlag = detailHealthy.sleepDrugFlag == 1 ? "有" : "无";
detailHealthy.stayupLateFlag = detailHealthy.stayupLateFlag == 1 ? "有" : "无";
detailHealthy.stayupLateWeekNum += "次/周";
let physicalSigns = this.getSignString(detailHealthy.signList);
/*if(detailHealthy.signList != null && detailHealthy.signList.length > 0){
detailHealthy.signList.forEach(function (sign, index) {
physicalSigns += "" + sign.name;
})
}*/
physicalSigns += "" + (detailHealthy.otherPhysicalSigns ? detailHealthy.otherPhysicalSigns : "");
detailHealthy.physicalSigns = this.trimComma(physicalSigns);
detailHealthy.familyIllnessHistory += this.trimComma(detailHealthy.otherFamilyIllnessHistory ? ("" + detailHealthy.otherFamilyIllnessHistory) : "");
detailHealthy.operationHistory += this.trimComma(detailHealthy.otherOperationHistory ? ("" + detailHealthy.otherOperationHistory) : "");
detailHealthy.nearOperationFlag = detailHealthy.nearOperationFlag == 1 ? "有" : "无";
detailHealthy.longEatDrugFlag = detailHealthy.longEatDrugFlag == 1 ? "有" : "无";
detailHealthy.longEatDrugClassify += detailHealthy.otherLongEatDrugClassify ? ("" + detailHealthy.otherLongEatDrugClassify) : "";
detailHealthy.allergyFlag = detailHealthy.allergyFlag == 1 ? "有" : "无";
detailHealthy.allergen += detailHealthy.otherAllergen ? ("" +detailHealthy.otherAllergen) : "";
detailHealthy.allergen = this.trimComma(detailHealthy.allergen);
let medicalReportPathArray = detailHealthy.medicalReport ? detailHealthy.medicalReport.split(",") : [];
let medicalReportNameArray = detailHealthy.medicalReportName ? detailHealthy.medicalReportName.split(",") : [];
this.medicalReportPathArray = medicalReportPathArray;
detailHealthy.medicalReport_one = medicalReportPathArray.length > 0 ? (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") : "";
for(let i = 0; i < this.healthyTitleData.length; i++){
let stepArray = [];
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]]});
}
this.dataList[i] = stepArray;
}
},
//健康信息处理,将数组转为字符串
dealHealthy(customerHealthy){
let array = healthyData["needAttrName"];
for(let i = 0; i < array.length; i++){
customerHealthy[array[i]] = this.getHealthyStringByArray(array[i]+"Array", customerHealthy[array[i]]);
}
return customerHealthy;
},
//将数组中的value值转为name
getHealthyStringByArray(key, valueArray){
var str = "";
if(valueArray != null && valueArray.split(",").length > 0){
valueArray.split(",").forEach(function (item, index) {
let data = healthyData[key].find(opt => opt.value == item);
if(data != null){
str += (str != "" ? "" : "") + data.name;
}
})
}
return str;
},
getSignString(signList){
if(signList == null){
return "";
}
let signStr = "";
for(let i in signList){
signStr += ""+signList[i].name;
}
return signList.length > 0 ? signStr.substring(1) : signStr;
},
downloadFile(fileName){
this.downloadResource(fileName);
},
trimComma(str){
if(str.startsWith("") || str.startsWith(",")){
str = str.substring(1,str.length);
}
if(str.endsWith("") || str.endsWith(",")){
str = str.substring(0,str.length-1);
}
return str;
}
},
};
</script>
<style>
.margin-top-20{
margin-top:20px;
}
.p_title_1{
font-size: 18px;
font-weight: bold;
margin-top: 20px;
}
</style>

View File

@ -108,7 +108,7 @@
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: false,
showSearch: true,
// 总条数
total: 0,
//

View File

@ -36,7 +36,7 @@
</el-form>
<div><span style="color:#E6A23C;font-family:PingFang SC">
注意事项
<br/>12021年1月开始的订单才开始按天计算提成
<br/>12021年1月开始的订单才开始按天计算提成只计算已审核的订单
<br/>2发工资日期定为每月15号若当前日期大于15号则认定上个月的工资已发放
</span></div>
<el-row :gutter="10" class="mb8" style="margin-top:10px;">

View File

@ -309,6 +309,7 @@
<!-- 订单抽屉 -->
<order-drawer ref="cusOrderDrawerRef" />
<!-- 合同抽屉 -->
<contract-drawer ref="cusContractDrawerRef"></contract-drawer>
<!-- 健康评估弹窗 -->
<physical-signs-dialog ref="physicalSignsDialogRef" />
<!-- 食谱计划抽屉 -->
@ -331,12 +332,14 @@ import { getOptions } from "@/api/custom/order";
import OrderDrawer from "@/components/OrderDrawer";
import PhysicalSignsDialog from "@/components/PhysicalSignsDialog";
import ContractDrawer from "@/components/ContractDrawer";
export default {
name: "Customer",
components: {
"order-drawer": OrderDrawer,
"physical-signs-dialog": PhysicalSignsDialog,
"contract-drawer": ContractDrawer
},
data() {
const userId = store.getters && store.getters.userId;
@ -476,7 +479,7 @@ export default {
this.$refs["cusOrderDrawerRef"].showDrawer(row);
},
handleOnContractClick(row) {
console.log(row);
this.$refs["cusContractDrawerRef"].showDrawer(row);
},
handleOnBodySignClick(row) {
console.log(row);