客户档案的合同添加、复制健康调查链接

This commit is contained in:
xiezhijun
2021-02-01 19:13:41 +08:00
parent f3a4fa40a8
commit e3d8a9fa12
32 changed files with 621 additions and 1102 deletions

View File

@ -68,3 +68,12 @@ export function getCustomerPhysicalSignsByCusId(id) {
method: "get"
});
}
// 删除客户健康评估信息或体征信息
export function delCustomerHealthy(id) {
return request({
url: "/custom/customer/delCustomerHealthy/" + id,
method: "get"
});
}

View File

@ -34,3 +34,12 @@ export function addCustomerHealthy(data) {
data: data
})
}
// 根据加密客户ID获取对应客户信息
export function getCustomerBaseMessage(id) {
return request({
url: '/investigate/getCustomerBaseMessage/' + id,
method: 'get'
})
}

View File

@ -0,0 +1,180 @@
<template>
<!-- 添加或修改合同对话框 -->
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="调理项目" prop="projectId">
<el-select v-model="form.projectId" placeholder="请选择调理项目" filterable clearable size="small">
<el-option v-for="dict in conditioningProjectIdOption"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"/>
</el-select>
</el-form-item>
<!--<el-form-item label="客户姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入客户姓名"/>
</el-form-item>-->
<el-form-item label="金额" prop="amount" style="width: 300px;">
<el-input v-model="form.amount" placeholder="请输入金额"/>
</el-form-item>
<el-form-item label="服务承诺" prop="servePromise" v-show="form.projectId == 0" >
<el-input style="width: 200px;" v-model="form.servePromise" placeholder="请输入服务承诺"/><span style="margin-left: 5px;"></span>
</el-form-item>
<el-form-item label="营养师" prop="nutritionistId">
<el-select v-model="form.nutritionistId" placeholder="请选择营养师" clearable size="small">
<el-option v-for="dict in nutritionistIdOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"/>
</el-select>
</el-form-item>
<el-form-item label="服务时间" prop="serveTime">
<el-select v-model="form.serveTime" placeholder="请选择服务时间">
<el-option
v-for="dict in serveTimeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {addContract} from "@/api/custom/contract";
import {getOptions} from "@/api/custom/order";
export default {
name: "ContractAdd",
components: {
},
props: {},
data() {
const checkServePromise = (rule, value, callback) => {
if (this.form.projectId == 0 && !value) {
return callback(new Error('请输入服务承诺'))
}
callback();
};
return {
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
callback: undefined,
// 表单参数
form: {},
// 表单校验
rules: {
projectId:[
{required: true, message: "请选择调理项目", trigger: "blur"}
],
/*name: [
{required: true, message: "请输入客户姓名", trigger: "blur"}
],*/
amount: [
{required: true, message: "请输入签订金额", trigger: "blur"},
{
required: true,
trigger: "blur",
pattern: /^[1-9]\d*$/,
message: "签订金额格式不正确",
},
],
servePromise: [
{required: true, trigger: "blur", validator: checkServePromise}
],
serveTime: [
{required: true, message: "请选择服务时间", trigger: "blur"}
],
nutritionistId: [
{required: true, message: "请选择营养师", trigger: "blur"}
]
},
conditioningProjectIdOption:[],
serveTimeOptions:[],
nutritionistIdOptions:[]
};
},
created() {
getOptions().then(response => {
const options = response.data.reduce((opts, cur) => {
if (!opts[cur.postCode]) {
opts[cur.postCode] = [];
}
opts[cur.postCode].push({dictValue: cur.userId, dictLabel: cur.userName, remark: cur.remark})
return opts;
}, {})
this.nutritionistIdOptions = options['nutri'] || [];
})
this.getDicts("cus_serve_time").then(response => {
this.serveTimeOptions = response.data;
});
this.getDicts("conditioning_project").then(response => {
this.conditioningProjectIdOption = response.data;
});
},
methods: {
showDialog(data, callback) {
this.callback = callback;
this.reset(data);
this.title = "新增"+`${data.customer}」客户合同`;
this.open = true;
},
// 表单重置
reset(obj) {
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.dictValue === obj.nutritionistId);
const defaultProjectIdOption = this.conditioningProjectIdOption.find(opt => opt.remark === 'default');
this.form = {
id: null,
customerId: obj.customerId,
projectId: defaultProjectIdOption ? parseInt(defaultProjectIdOption.dictValue) : null,
name: obj.customer,
phone: null,
serveTime: null,
amount: null,
path: null,
createBy: null,
nutritionistId: defaultNutritionist ? parseInt(defaultNutritionist.dictValue) : null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null
};
this.resetForm("form");
},
// 取消按钮
cancel() {
this.open = false;
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.tutor = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId)
if(this.form.projectId != 0){
this.form.servePromise = null;
}
addContract(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.callback && this.callback();
}
});
}
});
}
}
};
</script>

View File

@ -8,17 +8,18 @@
size="40%"
>
<div class="app-container">
<!--<el-row :gutter="10" class="mb8">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
v-hasPermi="['custom:contract:add']"
@click="handleAdd"
>创建合同
</el-button>
</el-col>
</el-row>-->
</el-row>
<el-table :data="contractList">
<el-table-column label="合同编号" align="center" prop="id" width="150"/>
@ -71,7 +72,7 @@
</div>
</el-drawer>
<!--<create-order-dialog ref="cusCreateOrderDialogRef" />-->
<add-contract ref="cusAddContractDialogRef" />
<contract-detail ref="contractDetailRef" />
</div>
@ -80,11 +81,13 @@
import {delContract, listContract} from "@/api/custom/contract";
import ContractDetail from "@/components/ContractDetail";
import Clipboard from 'clipboard';
import ContractAdd from "@/components/ContractAdd";
export default {
name: "CustomerContractDrawer",
components: {
'contract-detail': ContractDetail
'contract-detail': ContractDetail,
'add-contract':ContractAdd
},
data() {
return {
@ -111,17 +114,14 @@ export default {
});
},
handleAdd() {
this.$refs.cusCreateOrderDialogRef.showDialog(
this.$refs.cusAddContractDialogRef.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,
customerId: this.data.id,
nutritionistId: this.data.mainDietitian
},
() => {
this.fetchOrderList(this.data.id);
this.fetchContractList(this.data.id);
}
);
},

View File

@ -14,6 +14,7 @@
type="primary"
icon="el-icon-plus"
size="mini"
v-hasPermi="['custom:order:add']"
@click="handleAdd"
>创建订单
</el-button>
@ -73,12 +74,14 @@
size="mini"
type="text"
@click="handleOnEditClick(scope.row)"
v-hasPermi="['custom:order:edit']"
>修改</el-button
>
<el-button
v-if="scope.row.orderType === 'main'"
size="mini"
type="text"
v-hasPermi="['custom:order:remove']"
@click="handleOnDeleteClick(scope.row)"
>删除</el-button
>

View File

@ -1,5 +1,9 @@
<template>
<el-dialog :visible.sync="visible" :title="title" append-to-body @closed="onClosed">
<div style="float:right;margin-top:-10px;margin-bottom: 10px;" v-show="dataList.length > 0">
<!--<el-button v-hasPermi="['custom:healthy:edit']" @click="" plain>修改信息</el-button>-->
<el-button type="danger" v-hasPermi="['custom:healthy:remove']" @click="handleDelete()" plain>删除信息</el-button>
</div>
<!-- 客户健康评估 -->
<div v-if="dataList.length > 0 && dataType == 0">
<!-- 基础信息 -->
@ -46,15 +50,18 @@
<!-- 客户体征 -->
<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>
<p v-show="dataList.length == 0" style="font-size: 20px;text-align:center;">暂无数据
<el-button icon="el-icon-share" size="small" title="点击复制链接" class="copyBtn" type="primary" :data-clipboard-text="copyValue" @click="handleCopy()">健康评估表链接</el-button>
</p>
</div>
</el-dialog>
</template>
<script>
import { getCustomerPhysicalSignsByCusId } from "@/api/custom/customer";
import { getCustomerPhysicalSignsByCusId,delCustomerHealthy } from "@/api/custom/customer";
import TableDetailMessage from "@/components/TableDetailMessage";
import AutoHideMessage from "@/components/AutoHideMessage";
import * as healthyData from "@/utils/healthyData";
import Clipboard from 'clipboard';
export default {
name: "PhysicalSignsDialog",
@ -66,6 +73,7 @@ export default {
return {
visible: false,
title: "",
data: null,
dataList: [],
dataType: 0,
// 体征标题
@ -171,8 +179,9 @@ export default {
[
["medicalReport_one","medicalReport_two","medicalReport_three"]
]
]
],
copyValue: "",
enc_id: ""
};
},
methods: {
@ -186,6 +195,7 @@ export default {
}
},
showDialog(data) {
this.data = data;
this.title = `${data.name}`;
getCustomerPhysicalSignsByCusId(data.id).then((res) => {
if (res.data.customerHealthy) {
@ -198,11 +208,15 @@ export default {
}
}
this.title += (this.dataType == 0 ? "客户健康评估信息" : "客户体征信息");
this.enc_id = res.data.enc_id;
this.visible = true;
});
},
onClosed() {
this.dataList = [];
this.data = null;
this.enc_id = "";
this.copyValue = "";
},
//对体征信息进行处理
getDataListBySignMessage(sign){
@ -383,8 +397,34 @@ export default {
str = str.substring(0,str.length-1);
}
return str;
}
},
},
handleCopy() {
this.copyValue = window.location.origin.replace('manage', 'sign') + "/subhealthyInvestigation/"+this.enc_id;
const btnCopy = new Clipboard('.copyBtn');
this.$message({
message: '拷贝成功',
type: 'success'
});
},
/** 删除健康信息操作 */
handleDelete() {
const ids = this.data.id;
this.$confirm(
'是否确认删除客户姓名为为"' + this.data.name + '"的体征信息?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
).then(function () {
return delCustomerHealthy(ids);
}).then(() => {
this.dataList = [];
this.msgSuccess("删除成功");
}).catch(function () {});
},
}
};
</script>

View File

@ -49,7 +49,7 @@ router.beforeEach((to, from, next) => {
}
} else {
// 没有token
if (whiteList.indexOf(to.path) !== -1 || to.path.startsWith('/f/contract/')) {
if (whiteList.indexOf(to.path) !== -1 || to.path.startsWith('/f/contract/') || to.path.startsWith('/subhealthyInvestigation/')) {
// 在免登录白名单,直接进入
next()
} else {

View File

@ -150,7 +150,7 @@ export const constantRoutes = [
meta: { title: '营养体征调查问卷'}
},
{
path: '/subhealthyInvestigation',
path: '/subhealthyInvestigation/:id',
component: (resolve) => require(['@/views/custom/subhealthy/investigation'], resolve),
hidden: true,
meta: { title: '胜唐体控健康评估表'}

View File

@ -12,7 +12,7 @@
</el-select>
</el-form-item>
<el-form-item label="业务员" prop="userId">
<el-select v-model="queryParams.userId" placeholder="请选择业务员" clearable size="small">
<el-select v-model="queryParams.userId" filterable placeholder="请选择业务员" clearable size="small">
<el-option
v-for="dict in searchUserIdOptions"
:key="dict.dictValue"

View File

@ -12,7 +12,7 @@
</el-select>
</el-form-item>
<el-form-item label="业务员" prop="userId">
<el-select v-model="queryParams.userId" placeholder="请选择业务员" clearable size="small">
<el-select v-model="queryParams.userId" filterable placeholder="请选择业务员" clearable size="small">
<el-option
v-for="dict in searchUserIdOptions"
:key="dict.dictValue"
@ -21,14 +21,14 @@
/>
</el-select>
</el-form-item>
<!--<el-form-item label="月份" prop="month">
<el-form-item label="月份" prop="month">
<el-date-picker
v-model="month"
@change="monthRangeChange"
type="month"
placeholder="选择月">
placeholder="选择月">
</el-date-picker>
</el-form-item>-->
</el-form-item>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@ -239,7 +239,7 @@
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
//this.handleQuery();
this.searchUserIdOptions = this.totalUserIdOptions.slice();
},
// 多选框选中数据

View File

@ -54,14 +54,14 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
<!--<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['custom:contract:add']"
>新增
</el-button>
</el-button>-->
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->

View File

@ -25,7 +25,7 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="主营养师" prop="mainDietitian">
<!--<el-form-item label="主营养师" prop="mainDietitian">
<el-input
v-model="queryParams.mainDietitian"
placeholder="请输入主营养师"
@ -60,7 +60,7 @@
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-form-item>-->
<el-form-item>
<el-button
type="cyan"
@ -149,7 +149,7 @@
prop="salesman"
:formatter="preSaleIdFormat"
/>
<el-table-column label="订单" align="center">
<el-table-column label="订单" align="center" v-hasPermi="['custom:order:list']">
<template slot-scope="scope">
<el-button
size="mini"
@ -159,7 +159,7 @@
</el-button>
</template>
</el-table-column>
<el-table-column label="合同" align="center">
<el-table-column label="合同" align="center" v-hasPermi="['custom:contract:list']">
<template slot-scope="scope">
<el-button
size="mini"
@ -169,7 +169,7 @@
</el-button>
</template>
</el-table-column>
<el-table-column label="健康评估" align="center">
<el-table-column label="健康评估" align="center" v-hasPermi="['custom:healthy:list']">
<template slot-scope="scope">
<el-button
size="mini"
@ -179,7 +179,7 @@
</el-button>
</template>
</el-table-column>
<el-table-column label="食谱计划" align="center">
<el-table-column label="食谱计划" align="center" v-hasPermi="['recipes:recipesPlan:list']">
<template slot-scope="scope">
<el-button
size="mini"

View File

@ -76,6 +76,7 @@
v-model="queryParams.preSaleId"
placeholder="请选择售前"
clearable
filterable
size="small"
>
<el-option
@ -93,6 +94,7 @@
v-model="queryParams.afterSaleId"
placeholder="请选择售后"
clearable
filterable
size="small"
>
<el-option
@ -110,6 +112,7 @@
v-model="queryParams.nutritionistId"
placeholder="请选择主营养师"
clearable
filterable
size="small"
>
<el-option
@ -131,6 +134,7 @@
v-model="queryParams.nutriAssisId"
placeholder="请选择营养师助理"
clearable
filterable
style="width: 170px"
size="small"
>
@ -149,6 +153,7 @@
v-model="queryParams.plannerId"
placeholder="请选择策划"
clearable
filterable
size="small"
>
<el-option
@ -166,6 +171,7 @@
v-model="queryParams.plannerAssisId"
placeholder="请选择策划助理"
clearable
filterable
size="small"
>
<el-option
@ -183,6 +189,7 @@
v-model="queryParams.operatorId"
placeholder="请选择运营"
clearable
filterable
size="small"
>
<el-option
@ -200,6 +207,7 @@
v-model="queryParams.operatorAssisId"
placeholder="请选择运营助理"
clearable
filterable
size="small"
>
<el-option
@ -250,7 +258,6 @@
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
@ -379,14 +386,14 @@
v-hasPermi="['custom:order:edit']"
>修改
</el-button>
<!-- <el-button
<el-button
size="mini"
type="text"
icon="el-icon-s-data"
@click="orderPauseManage(scope.row)"
v-hasPermi="['orderPause:pause:query']"
>暂停记录管理
</el-button> -->
</el-button>
<el-button
size="mini"
type="text"

View File

@ -10,10 +10,14 @@
</div>
<el-form ref="form" label-position="top" :model="form" :rules="rules" label-width="100px" style="padding: 16px">
<div v-show="stepArray[0]">
<p class="p_title_1" style="margin-top: 5px;">{{healthyData['titleArray'][0]}}</p>
<el-form-item label="真实姓名" prop="name" style="padding-top: 10px;">
<el-input v-model="form.name" placeholder="请输入真实姓名" maxlength="20"/>
<p class="p_title_1" style="margin-top: 10px;">{{healthyData['titleArray'][0]}}</p>
<p style="font-size: 15px; margin-bottom: 12px;margin-top: 10px;">请您确认下方姓名手机号是否正确</p>
<el-form-item label="真实姓名" prop="name">
<el-input v-model="form.name" :readonly="true" placeholder="请输入真实姓名" maxlength="20"/>
</el-form-item>
<el-form-item label="手机号" prop="phone" >
<el-input type="number" :readonly="true" v-model="form.phone" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="form.sex" size="small" >
<el-radio :label="parseInt('0')" border></el-radio>
@ -29,10 +33,6 @@
<el-form-item label="体重(斤)" prop="weight" >
<el-input type="number" v-model="form.weight" placeholder="请输入体重" autocomplete="off" ></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phone" >
<el-input type="number" v-model="form.phone" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="调理项目" prop="conditioningProjectId">
<el-select v-model="form.conditioningProjectId" filterable clearable placeholder="请选择">
<el-option
@ -652,7 +652,7 @@
</section>
</template>
<script>
import { getDictData,addCustomerHealthy,physicalSignsList } from "@/api/custom/customerInvestigation";
import { getDictData,addCustomerHealthy,physicalSignsList,getCustomerBaseMessage } from "@/api/custom/customerInvestigation";
import * as healthyData from "@/utils/healthyData";
const logo = require("@/assets/logo/st_logo.png");
export default {
@ -665,6 +665,8 @@ export default {
callback();
};
return {
//客户是否存在标识
customerExistFlag:false,
healthyData:healthyData,
logo,
submitFlag: false,
@ -675,6 +677,7 @@ export default {
stepArray: [true,false,false,false,false,false,false,false,false],
stepActive: 0,
form: {
customerEncId: null,
name: null,
phone: null,
conditioningProjectId: 0,
@ -801,10 +804,10 @@ export default {
},
timer: null,
rules: {
name: [
/*name: [
{ required: true, trigger: "blur", message: "请填写姓名" },
{ min: 1, max: 20, trigger: "blur", message: "姓名过长" },
],
],*/
sex: [{ required: true, trigger: "blur", message: "请选择性别" }],
age: [
{ required: true, trigger: "blur", message: "请填写年龄" },
@ -833,7 +836,7 @@ export default {
message: "体重格式不正确",
},
],
phone: [
/*phone: [
{ required: true, trigger: "blur", message: "请填写手机号" },
{ required: true, trigger: "blur", message: "请填写正确的手机号" },
{
@ -842,7 +845,7 @@ export default {
pattern: /^[0-9]{5,11}$/,
message: "手机号格式不正确",
},
],
],*/
conditioningProjectId:[
{ required: true, trigger: "blur", message: "请选择调理项目" }
],
@ -853,6 +856,24 @@ export default {
};
},
methods: {
//根据用户ID获取用户基本信息手机号、姓名
getCustomerBase(id){
if(id == null || id == undefined){
return;
}
getCustomerBaseMessage(id).then((response) => {
if (response.code === 200) {
if(response.data){
console.log(response.data);
this.customerExistFlag = true;
this.form.name = response.data.name;
this.form.phone = response.data.phone;
}
}
}).catch(function() {
console.log("error");
});
},
submit(){
if (this.submitFlag) {
this.$message({
@ -885,7 +906,7 @@ export default {
this.healthyData['arrayName'].forEach(function (item, index) {
cusMessage[item] = cusMessage[item] != null ? cusMessage[item].join(",") : null;
});
this.timer = setTimeout(this.fail,1000*60);
//this.timer = setTimeout(this.fail,1000*60);
addCustomerHealthy(cusMessage).then((response) => {
if (response.code === 200) {
this.$notify({
@ -899,11 +920,14 @@ export default {
});
},
fail(){
console.log("fail");
this.submitFlag = false;
this.upload.isUploading = false;
},
nextStep(step){
if(!this.customerExistFlag){
this.$message.error('客户不存在');
return;
}
this.$refs.form.validate((valid) => {
if(valid || step < 0){
this.stepArray[this.stepActive] = false;
@ -928,15 +952,6 @@ export default {
},
//监控上传文件列表
handleFileChange(file, fileList) {
/*console.log("------------")
let existFile = fileList.slice(0, fileList.length - 1).find(f => f.name === file.name);
if (existFile) {
this.$message({
message: "当前文件已经存在",
type: "warning",
});
fileList.pop();
}*/
let sizeFlag = file.size > this.upload.fileSize;
if (sizeFlag) {
this.$message({
@ -1000,6 +1015,8 @@ export default {
},
},
created() {
this.form.customerEncId = this.$route.params.id;
this.getCustomerBase(this.form.customerEncId);
this.getDict("conditioning_project");
this.getPhysicalSignsList();
this.getMoistureDictData();