暂存
This commit is contained in:
parent
abf4cf2dc2
commit
58f276922f
@ -1,148 +1,155 @@
|
|||||||
/**
|
/**
|
||||||
* 通用js方法封装处理
|
* 通用js方法封装处理
|
||||||
* Copyright (c) 2019 ruoyi
|
* Copyright (c) 2019 ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const baseURL = process.env.VUE_APP_BASE_API
|
const baseURL = process.env.VUE_APP_BASE_API
|
||||||
|
|
||||||
// 日期格式化
|
// 日期格式化
|
||||||
export function parseTime(time, pattern) {
|
export function parseTime(time, pattern) {
|
||||||
if (arguments.length === 0 || !time) {
|
if (arguments.length === 0 || !time) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||||
let date
|
let date
|
||||||
if (typeof time === 'object') {
|
if (typeof time === 'object') {
|
||||||
date = time
|
date = time
|
||||||
} else {
|
} else {
|
||||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||||
time = parseInt(time)
|
time = parseInt(time)
|
||||||
} else if (typeof time === 'string') {
|
} else if (typeof time === 'string') {
|
||||||
time = time.replace(new RegExp(/-/gm), '/');
|
time = time.replace(new RegExp(/-/gm), '/');
|
||||||
}
|
}
|
||||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||||
time = time * 1000
|
time = time * 1000
|
||||||
}
|
}
|
||||||
date = new Date(time)
|
date = new Date(time)
|
||||||
}
|
}
|
||||||
const formatObj = {
|
const formatObj = {
|
||||||
y: date.getFullYear(),
|
y: date.getFullYear(),
|
||||||
m: date.getMonth() + 1,
|
m: date.getMonth() + 1,
|
||||||
d: date.getDate(),
|
d: date.getDate(),
|
||||||
h: date.getHours(),
|
h: date.getHours(),
|
||||||
i: date.getMinutes(),
|
i: date.getMinutes(),
|
||||||
s: date.getSeconds(),
|
s: date.getSeconds(),
|
||||||
a: date.getDay()
|
a: date.getDay()
|
||||||
}
|
}
|
||||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||||
let value = formatObj[key]
|
let value = formatObj[key]
|
||||||
// Note: getDay() returns 0 on Sunday
|
// Note: getDay() returns 0 on Sunday
|
||||||
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
|
if (key === 'a') {
|
||||||
if (result.length > 0 && value < 10) {
|
return ['日', '一', '二', '三', '四', '五', '六'][value]
|
||||||
value = '0' + value
|
}
|
||||||
}
|
if (result.length > 0 && value < 10) {
|
||||||
return value || 0
|
value = '0' + value
|
||||||
})
|
}
|
||||||
return time_str
|
return value || 0
|
||||||
}
|
})
|
||||||
|
return time_str
|
||||||
// 表单重置
|
}
|
||||||
export function resetForm(refName) {
|
|
||||||
if (this.$refs[refName]) {
|
// 表单重置
|
||||||
this.$refs[refName].resetFields();
|
export function resetForm(refName) {
|
||||||
}
|
if (this.$refs[refName]) {
|
||||||
}
|
this.$refs[refName].resetFields();
|
||||||
|
}
|
||||||
// 添加日期范围
|
}
|
||||||
export function addDateRange(params, dateRange) {
|
|
||||||
var search = params;
|
// 添加日期范围
|
||||||
search.beginTime = "";
|
export function addDateRange(params, dateRange) {
|
||||||
search.endTime = "";
|
var search = params;
|
||||||
if (null != dateRange && '' != dateRange) {
|
search.beginTime = "";
|
||||||
search.beginTime = this.dateRange[0];
|
search.endTime = "";
|
||||||
search.endTime = this.dateRange[1];
|
if (null != dateRange && '' != dateRange) {
|
||||||
}
|
search.beginTime = this.dateRange[0];
|
||||||
return search;
|
search.endTime = this.dateRange[1];
|
||||||
}
|
}
|
||||||
|
return search;
|
||||||
// 回显数据字典
|
}
|
||||||
export function selectDictLabel(datas, value) {
|
|
||||||
var actions = [];
|
// 回显数据字典
|
||||||
Object.keys(datas).some((key) => {
|
export function selectDictLabel(datas, value) {
|
||||||
if (datas[key].dictValue == ('' + value)) {
|
if (value === null || value === undefined) {
|
||||||
actions.push(datas[key].dictLabel);
|
return '';
|
||||||
return true;
|
}
|
||||||
}
|
var actions = [];
|
||||||
})
|
Object.keys(datas).some((key) => {
|
||||||
return actions.join('');
|
if (datas[key].dictValue == ('' + value)) {
|
||||||
}
|
actions.push(datas[key].dictLabel);
|
||||||
|
return true;
|
||||||
// 回显数据字典(字符串数组)
|
}
|
||||||
export function selectDictLabels(datas, value, separator) {
|
})
|
||||||
var actions = [];
|
return actions.join('');
|
||||||
var currentSeparator = undefined === separator ? "," : separator;
|
}
|
||||||
var temp = value.split(currentSeparator);
|
|
||||||
Object.keys(value.split(currentSeparator)).some((val) => {
|
// 回显数据字典(字符串数组)
|
||||||
Object.keys(datas).some((key) => {
|
export function selectDictLabels(datas, value, separator) {
|
||||||
if (datas[key].dictValue == ('' + temp[val])) {
|
var actions = [];
|
||||||
actions.push(datas[key].dictLabel + currentSeparator);
|
var currentSeparator = undefined === separator ? "," : separator;
|
||||||
}
|
var temp = value.split(currentSeparator);
|
||||||
})
|
Object.keys(value.split(currentSeparator)).some((val) => {
|
||||||
})
|
Object.keys(datas).some((key) => {
|
||||||
return actions.join('').substring(0, actions.join('').length - 1);
|
if (datas[key].dictValue == ('' + temp[val])) {
|
||||||
}
|
actions.push(datas[key].dictLabel + currentSeparator);
|
||||||
|
}
|
||||||
// 通用下载方法
|
})
|
||||||
export function download(fileName) {
|
})
|
||||||
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
return actions.join('').substring(0, actions.join('').length - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 字符串格式化(%s )
|
// 通用下载方法
|
||||||
export function sprintf(str) {
|
export function download(fileName) {
|
||||||
var args = arguments, flag = true, i = 1;
|
window.location.href = baseURL + "/common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
|
||||||
str = str.replace(/%s/g, function () {
|
}
|
||||||
var arg = args[i++];
|
|
||||||
if (typeof arg === 'undefined') {
|
// 字符串格式化(%s )
|
||||||
flag = false;
|
export function sprintf(str) {
|
||||||
return '';
|
var args = arguments, flag = true, i = 1;
|
||||||
}
|
str = str.replace(/%s/g, function () {
|
||||||
return arg;
|
var arg = args[i++];
|
||||||
});
|
if (typeof arg === 'undefined') {
|
||||||
return flag ? str : '';
|
flag = false;
|
||||||
}
|
return '';
|
||||||
|
}
|
||||||
// 转换字符串,undefined,null等转化为""
|
return arg;
|
||||||
export function praseStrEmpty(str) {
|
});
|
||||||
if (!str || str == "undefined" || str == "null") {
|
return flag ? str : '';
|
||||||
return "";
|
}
|
||||||
}
|
|
||||||
return str;
|
// 转换字符串,undefined,null等转化为""
|
||||||
}
|
export function praseStrEmpty(str) {
|
||||||
|
if (!str || str == "undefined" || str == "null") {
|
||||||
/**
|
return "";
|
||||||
* 构造树型结构数据
|
}
|
||||||
* @param {*} data 数据源
|
return str;
|
||||||
* @param {*} id id字段 默认 'id'
|
}
|
||||||
* @param {*} parentId 父节点字段 默认 'parentId'
|
|
||||||
* @param {*} children 孩子节点字段 默认 'children'
|
/**
|
||||||
* @param {*} rootId 根Id 默认 0
|
* 构造树型结构数据
|
||||||
*/
|
* @param {*} data 数据源
|
||||||
export function handleTree(data, id, parentId, children, rootId) {
|
* @param {*} id id字段 默认 'id'
|
||||||
id = id || 'id'
|
* @param {*} parentId 父节点字段 默认 'parentId'
|
||||||
parentId = parentId || 'parentId'
|
* @param {*} children 孩子节点字段 默认 'children'
|
||||||
children = children || 'children'
|
* @param {*} rootId 根Id 默认 0
|
||||||
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
|
*/
|
||||||
//对源数据深度克隆
|
export function handleTree(data, id, parentId, children, rootId) {
|
||||||
const cloneData = JSON.parse(JSON.stringify(data))
|
id = id || 'id'
|
||||||
//循环所有项
|
parentId = parentId || 'parentId'
|
||||||
const treeData = cloneData.filter(father => {
|
children = children || 'children'
|
||||||
let branchArr = cloneData.filter(child => {
|
rootId = rootId || Math.min.apply(Math, data.map(item => {
|
||||||
//返回每一项的子级数组
|
return item[parentId]
|
||||||
return father[id] === child[parentId]
|
})) || 0
|
||||||
});
|
//对源数据深度克隆
|
||||||
branchArr.length > 0 ? father.children = branchArr : '';
|
const cloneData = JSON.parse(JSON.stringify(data))
|
||||||
//返回第一层
|
//循环所有项
|
||||||
return father[parentId] === rootId;
|
const treeData = cloneData.filter(father => {
|
||||||
});
|
let branchArr = cloneData.filter(child => {
|
||||||
return treeData != '' ? treeData : data;
|
//返回每一项的子级数组
|
||||||
}
|
return father[id] === child[parentId]
|
||||||
|
});
|
||||||
|
branchArr.length > 0 ? father.children = branchArr : '';
|
||||||
|
//返回第一层
|
||||||
|
return father[parentId] === rootId;
|
||||||
|
});
|
||||||
|
return treeData != '' ? treeData : data;
|
||||||
|
}
|
||||||
|
@ -14,17 +14,17 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="4">
|
<!-- <el-col :span="4">-->
|
||||||
<el-form-item label="电话" prop="phone">
|
<!-- <el-form-item label="电话" prop="phone">-->
|
||||||
<el-input
|
<!-- <el-input-->
|
||||||
v-model="queryParams.phone"
|
<!-- v-model="queryParams.phone"-->
|
||||||
placeholder="请输入电话"
|
<!-- placeholder="请输入电话"-->
|
||||||
clearable
|
<!-- clearable-->
|
||||||
size="small"
|
<!-- size="small"-->
|
||||||
@keyup.enter.native="handleQuery"
|
<!-- @keyup.enter.native="handleQuery"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
|
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item label="收款方式" prop="payTypeId">
|
<el-form-item label="收款方式" prop="payTypeId">
|
||||||
@ -60,8 +60,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item label="营养师" prop="nutritionistId">
|
<el-form-item label="主营养师" prop="nutritionistId">
|
||||||
<el-select v-model="queryParams.nutritionistId" placeholder="请选择营养师" clearable size="small">
|
<el-select v-model="queryParams.nutritionistId" placeholder="请选择主营养师" clearable size="small">
|
||||||
<el-option v-for="dict in nutritionistIdOptions"
|
<el-option v-for="dict in nutritionistIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
@ -176,28 +176,28 @@
|
|||||||
>新增
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">-->
|
||||||
<el-button
|
<!-- <el-button-->
|
||||||
type="success"
|
<!-- type="success"-->
|
||||||
icon="el-icon-edit"
|
<!-- icon="el-icon-edit"-->
|
||||||
size="mini"
|
<!-- size="mini"-->
|
||||||
:disabled="single"
|
<!-- :disabled="single"-->
|
||||||
@click="handleUpdate"
|
<!-- @click="handleUpdate"-->
|
||||||
v-hasPermi="['custom:order:edit']"
|
<!-- v-hasPermi="['custom:order:edit']"-->
|
||||||
>修改
|
<!-- >修改-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<el-col :span="1.5">
|
<!-- <el-col :span="1.5">-->
|
||||||
<el-button
|
<!-- <el-button-->
|
||||||
type="danger"
|
<!-- type="danger"-->
|
||||||
icon="el-icon-delete"
|
<!-- icon="el-icon-delete"-->
|
||||||
size="mini"
|
<!-- size="mini"-->
|
||||||
:disabled="multiple"
|
<!-- :disabled="multiple"-->
|
||||||
@click="handleDelete"
|
<!-- @click="handleDelete"-->
|
||||||
v-hasPermi="['custom:order:remove']"
|
<!-- v-hasPermi="['custom:order:remove']"-->
|
||||||
>删除
|
<!-- >删除-->
|
||||||
</el-button>
|
<!-- </el-button>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
@ -212,28 +212,28 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
<!-- <el-table-column type="selection" width="55" align="center"/>-->
|
||||||
<el-table-column label="编号" align="center" prop="orderId"/>
|
<!-- <el-table-column label="编号" align="center" prop="orderId"/>-->
|
||||||
<el-table-column label="客户姓名" align="center" prop="customer"/>
|
<el-table-column label="成交日期" align="center" prop="orderTime" width="150" fixed="left">
|
||||||
<el-table-column label="电话" align="center" prop="phone"/>
|
|
||||||
<el-table-column label="金额" align="center" prop="amount"/>
|
|
||||||
<el-table-column label="收款方式" align="center" prop="payType"/>
|
|
||||||
<el-table-column label="售前" align="center" prop="preSale"/>
|
|
||||||
<el-table-column label="售后" align="center" prop="afterSale"/>
|
|
||||||
<el-table-column label="营养师" align="center" prop="nutritionist"/>
|
|
||||||
<el-table-column label="助理营养师" align="center" prop="nutriAssis"/>
|
|
||||||
<el-table-column label="账号" align="center" prop="account"/>
|
|
||||||
<el-table-column label="策划" align="center" prop="planner"/>
|
|
||||||
<el-table-column label="策划助理" align="center" prop="plannerAssis"/>
|
|
||||||
<el-table-column label="运营" align="center" prop="operator"/>
|
|
||||||
<el-table-column label="推荐人" align="center" prop="recommender"/>
|
|
||||||
<el-table-column label="成交日期" align="center" prop="orderTime" width="180">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark"/>
|
<el-table-column label="客户姓名" align="center" prop="customer" width="120" fixed="left"/>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="金额" align="center" prop="amount" width="120" fixed="left"/>
|
||||||
|
<el-table-column label="电话" align="center" prop="phone" width="120"/>
|
||||||
|
<el-table-column label="收款方式" align="center" prop="payType" width="120"/>
|
||||||
|
<el-table-column label="售前" align="center" prop="preSale" width="120"/>
|
||||||
|
<el-table-column label="售后" align="center" prop="afterSale" width="120"/>
|
||||||
|
<el-table-column label="主营养师" align="center" prop="nutritionist" width="120"/>
|
||||||
|
<el-table-column label="助理营养师" align="center" prop="nutriAssis" width="120"/>
|
||||||
|
<el-table-column label="账号" align="center" prop="account" width="120"/>
|
||||||
|
<el-table-column label="策划" align="center" prop="planner" width="120"/>
|
||||||
|
<el-table-column label="策划助理" align="center" prop="plannerAssis" width="120"/>
|
||||||
|
<el-table-column label="运营" align="center" prop="operator" width="120"/>
|
||||||
|
<el-table-column label="推荐人" align="center" prop="recommender" width="120"/>
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" width="120"/>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -289,7 +289,7 @@
|
|||||||
v-for="dict in payTypeIdOptions"
|
v-for="dict in payTypeIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -303,7 +303,7 @@
|
|||||||
v-for="dict in preSaleIdOptions"
|
v-for="dict in preSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -316,20 +316,20 @@
|
|||||||
v-for="dict in afterSaleIdOptions"
|
v-for="dict in afterSaleIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="营养师" prop="nutritionistId">
|
<el-form-item label="主营养师" prop="nutritionistId">
|
||||||
<el-select v-model="form.nutritionistId" placeholder="请选择营养师">
|
<el-select v-model="form.nutritionistId" placeholder="请选择主营养师">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in nutritionistIdOptions"
|
v-for="dict in nutritionistIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -342,7 +342,7 @@
|
|||||||
v-for="dict in nutriAssisIdOptions"
|
v-for="dict in nutriAssisIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -356,7 +356,7 @@
|
|||||||
v-for="dict in plannerIdOptions"
|
v-for="dict in plannerIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -369,7 +369,7 @@
|
|||||||
v-for="dict in plannerAssisIdOptions"
|
v-for="dict in plannerAssisIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -382,7 +382,7 @@
|
|||||||
v-for="dict in operatorIdOptions"
|
v-for="dict in operatorIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -395,7 +395,7 @@
|
|||||||
v-for="dict in accountIdOptions"
|
v-for="dict in accountIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
:label="dict.dictLabel"
|
:label="dict.dictLabel"
|
||||||
:value="dict.dictValue"
|
:value="parseInt(dict.dictValue)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -462,7 +462,7 @@
|
|||||||
preSaleIdOptions: [],
|
preSaleIdOptions: [],
|
||||||
// 售后字典
|
// 售后字典
|
||||||
afterSaleIdOptions: [],
|
afterSaleIdOptions: [],
|
||||||
// 营养师字典
|
// 主营养师字典
|
||||||
nutritionistIdOptions: [],
|
nutritionistIdOptions: [],
|
||||||
// 助理营养师字典
|
// 助理营养师字典
|
||||||
nutriAssisIdOptions: [],
|
nutriAssisIdOptions: [],
|
||||||
@ -502,6 +502,9 @@
|
|||||||
amount: [
|
amount: [
|
||||||
{required: true, message: "金额不能为空", trigger: "blur"}
|
{required: true, message: "金额不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
|
orderTime: [
|
||||||
|
{required: true, message: "成交日期不能为空", trigger: "blur"}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -556,7 +559,7 @@
|
|||||||
afterSaleIdFormat(row, column) {
|
afterSaleIdFormat(row, column) {
|
||||||
return this.selectDictLabel(this.afterSaleIdOptions, row.afterSaleId);
|
return this.selectDictLabel(this.afterSaleIdOptions, row.afterSaleId);
|
||||||
},
|
},
|
||||||
// 营养师字典翻译
|
// 主营养师字典翻译
|
||||||
nutritionistIdFormat(row, column) {
|
nutritionistIdFormat(row, column) {
|
||||||
return this.selectDictLabel(this.nutritionistIdOptions, row.nutritionistId);
|
return this.selectDictLabel(this.nutritionistIdOptions, row.nutritionistId);
|
||||||
},
|
},
|
||||||
@ -683,6 +686,19 @@
|
|||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
||||||
|
console.log(this.form)
|
||||||
|
|
||||||
|
this.form.payType = this.selectDictLabel(this.payTypeIdOptions, this.form.payTypeId);
|
||||||
|
this.form.preSale = this.selectDictLabel(this.preSaleIdOptions, this.form.preSaleId);
|
||||||
|
this.form.afterSale = this.selectDictLabel(this.afterSaleIdOptions, this.form.afterSaleId);
|
||||||
|
this.form.nutritionist = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId);
|
||||||
|
this.form.nutriAssis = this.selectDictLabel(this.nutriAssisIdOptions, this.form.nutriAssisId);
|
||||||
|
this.form.account = this.selectDictLabel(this.accountIdOptions, this.form.accountId);
|
||||||
|
this.form.planner = this.selectDictLabel(this.plannerIdOptions, this.form.plannerId);
|
||||||
|
this.form.plannerAssis = this.selectDictLabel(this.plannerAssisIdOptions, this.form.plannerAssisId);
|
||||||
|
this.form.operator = this.selectDictLabel(this.operatorIdOptions, this.form.operatorId);
|
||||||
|
|
||||||
if (this.form.orderId != null) {
|
if (this.form.orderId != null) {
|
||||||
updateOrder(this.form).then(response => {
|
updateOrder(this.form).then(response => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
|
@ -1,181 +1,181 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-row :gutter="40" class="panel-group">
|
<el-row :gutter="40" class="panel-group">
|
||||||
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
<!-- <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">-->
|
||||||
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
|
<!-- <div class="card-panel" @click="handleSetLineChartData('newVisitis')">-->
|
||||||
<div class="card-panel-icon-wrapper icon-people">
|
<!-- <div class="card-panel-icon-wrapper icon-people">-->
|
||||||
<svg-icon icon-class="peoples" class-name="card-panel-icon" />
|
<!-- <svg-icon icon-class="peoples" class-name="card-panel-icon" />-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="card-panel-description">
|
<!-- <div class="card-panel-description">-->
|
||||||
<div class="card-panel-text">
|
<!-- <div class="card-panel-text">-->
|
||||||
访客
|
<!-- 访客-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />
|
<!-- <count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
<!-- <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">-->
|
||||||
<div class="card-panel" @click="handleSetLineChartData('messages')">
|
<!-- <div class="card-panel" @click="handleSetLineChartData('messages')">-->
|
||||||
<div class="card-panel-icon-wrapper icon-message">
|
<!-- <div class="card-panel-icon-wrapper icon-message">-->
|
||||||
<svg-icon icon-class="message" class-name="card-panel-icon" />
|
<!-- <svg-icon icon-class="message" class-name="card-panel-icon" />-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="card-panel-description">
|
<!-- <div class="card-panel-description">-->
|
||||||
<div class="card-panel-text">
|
<!-- <div class="card-panel-text">-->
|
||||||
消息
|
<!-- 消息-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num" />
|
<!-- <count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num" />-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
||||||
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
<div class="card-panel" @click="handleSetLineChartData('purchases')">
|
||||||
<div class="card-panel-icon-wrapper icon-money">
|
<div class="card-panel-icon-wrapper icon-money">
|
||||||
<svg-icon icon-class="money" class-name="card-panel-icon" />
|
<svg-icon icon-class="money" class-name="card-panel-icon" />
|
||||||
</div>
|
</div>
|
||||||
<div class="card-panel-description">
|
<div class="card-panel-description">
|
||||||
<div class="card-panel-text">
|
<div class="card-panel-text">
|
||||||
金额
|
金额
|
||||||
</div>
|
</div>
|
||||||
<count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num" />
|
<count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
|
||||||
<div class="card-panel" @click="handleSetLineChartData('shoppings')">
|
<div class="card-panel" @click="handleSetLineChartData('shoppings')">
|
||||||
<div class="card-panel-icon-wrapper icon-shopping">
|
<div class="card-panel-icon-wrapper icon-shopping">
|
||||||
<svg-icon icon-class="shopping" class-name="card-panel-icon" />
|
<svg-icon icon-class="shopping" class-name="card-panel-icon" />
|
||||||
</div>
|
</div>
|
||||||
<div class="card-panel-description">
|
<div class="card-panel-description">
|
||||||
<div class="card-panel-text">
|
<div class="card-panel-text">
|
||||||
订单
|
订单
|
||||||
</div>
|
</div>
|
||||||
<count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" />
|
<count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CountTo from 'vue-count-to'
|
import CountTo from 'vue-count-to'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
CountTo
|
CountTo
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSetLineChartData(type) {
|
handleSetLineChartData(type) {
|
||||||
this.$emit('handleSetLineChartData', type)
|
this.$emit('handleSetLineChartData', type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.panel-group {
|
.panel-group {
|
||||||
margin-top: 18px;
|
margin-top: 18px;
|
||||||
|
|
||||||
.card-panel-col {
|
.card-panel-col {
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-panel {
|
.card-panel {
|
||||||
height: 108px;
|
height: 108px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
color: #666;
|
color: #666;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
|
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
|
||||||
border-color: rgba(0, 0, 0, .05);
|
border-color: rgba(0, 0, 0, .05);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.card-panel-icon-wrapper {
|
.card-panel-icon-wrapper {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-people {
|
.icon-people {
|
||||||
background: #40c9c6;
|
background: #40c9c6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-message {
|
.icon-message {
|
||||||
background: #36a3f7;
|
background: #36a3f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-money {
|
.icon-money {
|
||||||
background: #f4516c;
|
background: #f4516c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-shopping {
|
.icon-shopping {
|
||||||
background: #34bfa3
|
background: #34bfa3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-people {
|
.icon-people {
|
||||||
color: #40c9c6;
|
color: #40c9c6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-message {
|
.icon-message {
|
||||||
color: #36a3f7;
|
color: #36a3f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-money {
|
.icon-money {
|
||||||
color: #f4516c;
|
color: #f4516c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-shopping {
|
.icon-shopping {
|
||||||
color: #34bfa3
|
color: #34bfa3
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-panel-icon-wrapper {
|
.card-panel-icon-wrapper {
|
||||||
float: left;
|
float: left;
|
||||||
margin: 14px 0 0 14px;
|
margin: 14px 0 0 14px;
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
transition: all 0.38s ease-out;
|
transition: all 0.38s ease-out;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-panel-icon {
|
.card-panel-icon {
|
||||||
float: left;
|
float: left;
|
||||||
font-size: 48px;
|
font-size: 48px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-panel-description {
|
.card-panel-description {
|
||||||
float: right;
|
float: right;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 26px;
|
margin: 26px;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
|
|
||||||
.card-panel-text {
|
.card-panel-text {
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
color: rgba(0, 0, 0, 0.45);
|
color: rgba(0, 0, 0, 0.45);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-panel-num {
|
.card-panel-num {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width:550px) {
|
@media (max-width:550px) {
|
||||||
.card-panel-description {
|
.card-panel-description {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-panel-icon-wrapper {
|
.card-panel-icon-wrapper {
|
||||||
float: none !important;
|
float: none !important;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
|
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 14px auto !important;
|
margin: 14px auto !important;
|
||||||
float: none !important;
|
float: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,98 +1,98 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dashboard-editor-container">
|
<div class="dashboard-editor-container">
|
||||||
|
|
||||||
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
<panel-group @handleSetLineChartData="handleSetLineChartData" />
|
||||||
|
|
||||||
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
|
||||||
<line-chart :chart-data="lineChartData" />
|
<line-chart :chart-data="lineChartData" />
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row :gutter="32">
|
<!-- <el-row :gutter="32">-->
|
||||||
<el-col :xs="24" :sm="24" :lg="8">
|
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
|
||||||
<div class="chart-wrapper">
|
<!-- <div class="chart-wrapper">-->
|
||||||
<raddar-chart />
|
<!-- <raddar-chart />-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<el-col :xs="24" :sm="24" :lg="8">
|
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
|
||||||
<div class="chart-wrapper">
|
<!-- <div class="chart-wrapper">-->
|
||||||
<pie-chart />
|
<!-- <pie-chart />-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
<el-col :xs="24" :sm="24" :lg="8">
|
<!-- <el-col :xs="24" :sm="24" :lg="8">-->
|
||||||
<div class="chart-wrapper">
|
<!-- <div class="chart-wrapper">-->
|
||||||
<bar-chart />
|
<!-- <bar-chart />-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</el-col>
|
<!-- </el-col>-->
|
||||||
</el-row>
|
<!-- </el-row>-->
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PanelGroup from './dashboard/PanelGroup'
|
import PanelGroup from './dashboard/PanelGroup'
|
||||||
import LineChart from './dashboard/LineChart'
|
import LineChart from './dashboard/LineChart'
|
||||||
import RaddarChart from './dashboard/RaddarChart'
|
import RaddarChart from './dashboard/RaddarChart'
|
||||||
import PieChart from './dashboard/PieChart'
|
import PieChart from './dashboard/PieChart'
|
||||||
import BarChart from './dashboard/BarChart'
|
import BarChart from './dashboard/BarChart'
|
||||||
|
|
||||||
const lineChartData = {
|
const lineChartData = {
|
||||||
newVisitis: {
|
newVisitis: {
|
||||||
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
expectedData: [100, 120, 161, 134, 105, 160, 165],
|
||||||
actualData: [120, 82, 91, 154, 162, 140, 145]
|
actualData: [120, 82, 91, 154, 162, 140, 145]
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
expectedData: [200, 192, 120, 144, 160, 130, 140],
|
||||||
actualData: [180, 160, 151, 106, 145, 150, 130]
|
actualData: [180, 160, 151, 106, 145, 150, 130]
|
||||||
},
|
},
|
||||||
purchases: {
|
purchases: {
|
||||||
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
expectedData: [80, 100, 121, 104, 105, 90, 100],
|
||||||
actualData: [120, 90, 100, 138, 142, 130, 130]
|
actualData: [120, 90, 100, 138, 142, 130, 130]
|
||||||
},
|
},
|
||||||
shoppings: {
|
shoppings: {
|
||||||
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
expectedData: [130, 140, 141, 142, 145, 150, 160],
|
||||||
actualData: [120, 82, 91, 154, 162, 140, 130]
|
actualData: [120, 82, 91, 154, 162, 140, 130]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Index',
|
name: 'Index',
|
||||||
components: {
|
components: {
|
||||||
PanelGroup,
|
PanelGroup,
|
||||||
LineChart,
|
LineChart,
|
||||||
RaddarChart,
|
RaddarChart,
|
||||||
PieChart,
|
PieChart,
|
||||||
BarChart
|
BarChart
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
lineChartData: lineChartData.newVisitis
|
lineChartData: lineChartData.newVisitis
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSetLineChartData(type) {
|
handleSetLineChartData(type) {
|
||||||
this.lineChartData = lineChartData[type]
|
this.lineChartData = lineChartData[type]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.dashboard-editor-container {
|
.dashboard-editor-container {
|
||||||
padding: 32px;
|
padding: 32px;
|
||||||
background-color: rgb(240, 242, 245);
|
background-color: rgb(240, 242, 245);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.chart-wrapper {
|
.chart-wrapper {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 16px 16px 0;
|
padding: 16px 16px 0;
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width:1024px) {
|
@media (max-width:1024px) {
|
||||||
.chart-wrapper {
|
.chart-wrapper {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user