食谱制作界面
This commit is contained in:
@ -1,10 +1,10 @@
|
|||||||
import Vue from 'vue'
|
import Vue from "vue";
|
||||||
import Router from 'vue-router'
|
import Router from "vue-router";
|
||||||
|
|
||||||
Vue.use(Router)
|
Vue.use(Router);
|
||||||
|
|
||||||
/* Layout */
|
/* Layout */
|
||||||
import Layout from '@/layout'
|
import Layout from "@/layout";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note: 路由配置项
|
* Note: 路由配置项
|
||||||
@ -27,35 +27,35 @@ import Layout from '@/layout'
|
|||||||
// 公共路由
|
// 公共路由
|
||||||
export const constantRoutes = [
|
export const constantRoutes = [
|
||||||
{
|
{
|
||||||
path: '/redirect',
|
path: "/redirect",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/redirect/:path(.*)',
|
path: "/redirect/:path(.*)",
|
||||||
component: (resolve) => require(['@/views/redirect'], resolve)
|
component: resolve => require(["@/views/redirect"], resolve)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: "/login",
|
||||||
component: (resolve) => require(['@/views/login'], resolve),
|
component: resolve => require(["@/views/login"], resolve),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/404',
|
path: "/404",
|
||||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
component: resolve => require(["@/views/error/404"], resolve),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/401',
|
path: "/401",
|
||||||
component: (resolve) => require(['@/views/error/401'], resolve),
|
component: resolve => require(["@/views/error/401"], resolve),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '',
|
path: "",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: 'index',
|
redirect: "index",
|
||||||
children: [
|
children: [
|
||||||
// {
|
// {
|
||||||
// path: 'index',
|
// path: 'index',
|
||||||
@ -64,101 +64,120 @@ export const constantRoutes = [
|
|||||||
// meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
|
// meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
|
||||||
// }
|
// }
|
||||||
{
|
{
|
||||||
path: 'index',
|
path: "index",
|
||||||
component: (resolve) => require(['@/views/custom/order'], resolve),
|
component: resolve => require(["@/views/custom/order"], resolve),
|
||||||
name: '订单',
|
name: "订单",
|
||||||
meta: { title: '订单管理', icon: 'build', noCache: true, affix: true }
|
meta: { title: "订单管理", icon: "build", noCache: true, affix: true }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/order',
|
path: "/order",
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'orderPause/:orderId',
|
|
||||||
component: (resolve) => require(['@/views/custom/order/orderPause'], resolve),
|
|
||||||
name: 'orderPause',
|
|
||||||
meta: { title: '订单暂停记录'}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/user',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
redirect: 'noredirect',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'profile',
|
|
||||||
component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
|
|
||||||
name: 'Profile',
|
|
||||||
meta: { title: '个人中心', icon: 'user' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '/dict',
|
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'type/data/:dictId(\\d+)',
|
path: "orderPause/:orderId",
|
||||||
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
component: resolve =>
|
||||||
name: 'Data',
|
require(["@/views/custom/order/orderPause"], resolve),
|
||||||
meta: { title: '字典数据', icon: '' }
|
name: "orderPause",
|
||||||
|
meta: { title: "订单暂停记录" }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/job',
|
path: "/user",
|
||||||
|
component: Layout,
|
||||||
|
hidden: true,
|
||||||
|
redirect: "noredirect",
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "profile",
|
||||||
|
component: resolve =>
|
||||||
|
require(["@/views/system/user/profile/index"], resolve),
|
||||||
|
name: "Profile",
|
||||||
|
meta: { title: "个人中心", icon: "user" }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/dict",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'log',
|
path: "type/data/:dictId(\\d+)",
|
||||||
component: (resolve) => require(['@/views/monitor/job/log'], resolve),
|
component: resolve => require(["@/views/system/dict/data"], resolve),
|
||||||
name: 'JobLog',
|
name: "Data",
|
||||||
meta: { title: '调度日志' }
|
meta: { title: "字典数据", icon: "" }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/gen',
|
path: "/job",
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'edit/:tableId(\\d+)',
|
path: "log",
|
||||||
component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
|
component: resolve => require(["@/views/monitor/job/log"], resolve),
|
||||||
name: 'GenEdit',
|
name: "JobLog",
|
||||||
meta: { title: '修改生成配置' }
|
meta: { title: "调度日志" }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/f/contract/:id(\\d+)',
|
path: "/gen",
|
||||||
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
component: (resolve) => require(['@/views/custom/signContract'], resolve),
|
children: [
|
||||||
meta: { title: '合同' }
|
{
|
||||||
|
path: "edit/:tableId(\\d+)",
|
||||||
|
component: resolve => require(["@/views/tool/gen/editTable"], resolve),
|
||||||
|
name: "GenEdit",
|
||||||
|
meta: { title: "修改生成配置" }
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/question',
|
path: "/recipes",
|
||||||
component: (resolve) => require(['@/views/custom/investigate/questionnaire'], resolve),
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: '营养体征调查问卷'}
|
children: [
|
||||||
},
|
{
|
||||||
{
|
path: "build/:cusId/:id(\\d+)",
|
||||||
path: '/subhealthyInvestigation/:id',
|
component: resolve =>
|
||||||
component: (resolve) => require(['@/views/custom/subhealthy/investigation'], resolve),
|
require(["@/views/custom/recipesPlan/build"], resolve),
|
||||||
hidden: true,
|
name: "RecipiesBuild",
|
||||||
meta: { title: '胜唐体控健康评估表'}
|
props: true,
|
||||||
}
|
meta: { title: "食谱制作" }
|
||||||
]
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/f/contract/:id(\\d+)",
|
||||||
|
hidden: true,
|
||||||
|
component: resolve => require(["@/views/custom/signContract"], resolve),
|
||||||
|
meta: { title: "合同" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/question",
|
||||||
|
component: resolve =>
|
||||||
|
require(["@/views/custom/investigate/questionnaire"], resolve),
|
||||||
|
hidden: true,
|
||||||
|
meta: { title: "营养体征调查问卷" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/subhealthyInvestigation/:id",
|
||||||
|
component: resolve =>
|
||||||
|
require(["@/views/custom/subhealthy/investigation"], resolve),
|
||||||
|
hidden: true,
|
||||||
|
meta: { title: "胜唐体控健康评估表" }
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
export default new Router({
|
export default new Router({
|
||||||
mode: 'history', // 去掉url中的#
|
mode: "history", // 去掉url中的#
|
||||||
scrollBehavior: () => ({ y: 0 }),
|
scrollBehavior: () => ({ y: 0 }),
|
||||||
routes: constantRoutes
|
routes: constantRoutes
|
||||||
})
|
});
|
||||||
|
38
stdiet-ui/src/views/custom/recipesPlan/build.vue
Normal file
38
stdiet-ui/src/views/custom/recipesPlan/build.vue
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="content">
|
||||||
|
<div class="left"></div>
|
||||||
|
<div class="right"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getRecipesPlan } from "@/api/custom/recipesPlan";
|
||||||
|
import { getOrder } from "@/api/custom/order";
|
||||||
|
import { getCustomerPhysicalSignsByCusId } from "@/api/custom/customer";
|
||||||
|
export default {
|
||||||
|
name: "BuildRecipies",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
healthyData: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
getOrder(this.cusId).then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
getCustomerPhysicalSignsByCusId(res.data.cusId).then((iRes) => {
|
||||||
|
this.healthyData = iRes.data;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
components: {},
|
||||||
|
props: ["id", "cusId"],
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.content .left {
|
||||||
|
}
|
||||||
|
.content .right {
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
|
<el-form
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryForm"
|
||||||
|
:inline="true"
|
||||||
|
v-show="showSearch"
|
||||||
|
>
|
||||||
<el-form-item label="客户信息" prop="customer">
|
<el-form-item label="客户信息" prop="customer">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.customer"
|
v-model="queryParams.customer"
|
||||||
@ -9,17 +14,27 @@
|
|||||||
size="small"
|
size="small"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="食谱开始日期范围" prop="planStartDateScope" label-width="130px">
|
<el-form-item
|
||||||
|
label="食谱开始日期范围"
|
||||||
|
prop="planStartDateScope"
|
||||||
|
label-width="130px"
|
||||||
|
>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="planStartDateScope"
|
v-model="planStartDateScope"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期">
|
end-placeholder="结束日期"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<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
|
<el-option
|
||||||
v-for="dict in nutritionistIdOptions"
|
v-for="dict in nutritionistIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -29,7 +44,12 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="营养师助理" prop="nutritionistAssisId">
|
<el-form-item label="营养师助理" prop="nutritionistAssisId">
|
||||||
<el-select v-model="queryParams.nutritionistAssisId" placeholder="请选择营养师助理" clearable size="small">
|
<el-select
|
||||||
|
v-model="queryParams.nutritionistAssisId"
|
||||||
|
placeholder="请选择营养师助理"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in nutriAssisIdOptions"
|
v-for="dict in nutriAssisIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -39,14 +59,25 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</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
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div><span style="color:#E6A23C;font-family:PingFang SC">
|
<div>
|
||||||
注意事项:
|
<span style="color: #e6a23c; font-family: PingFang SC">
|
||||||
<br/>1、2021年1月开始的订单才会自动生成食谱计划</span></div>
|
注意事项:
|
||||||
<el-row :gutter="10" class="mb8" style="margin-top:10px;">
|
<br />1、2021年1月开始的订单才会自动生成食谱计划</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<el-row :gutter="10" class="mb8" style="margin-top: 10px">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
@ -55,7 +86,7 @@
|
|||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['recipes:recipesPlan:edit']"
|
v-hasPermi="['recipes:recipesPlan:edit']"
|
||||||
>修改
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@ -65,39 +96,68 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['recipes:recipesPlan:export']"
|
v-hasPermi="['recipes:recipesPlan:export']"
|
||||||
>导出
|
>导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!--<div><span style="margin-left:10px;font-size:16px;color:#E6A23C;font-family:PingFang SC">备注:2021年1月开始的订单才会自动生成食谱计划</span></div>-->
|
<!--<div><span style="margin-left:10px;font-size:16px;color:#E6A23C;font-family:PingFang SC">备注:2021年1月开始的订单才会自动生成食谱计划</span></div>-->
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
@queryTable="getList"
|
||||||
|
></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="recipesPlanList" @selection-change="handleSelectionChange">
|
<el-table
|
||||||
<el-table-column type="selection" width="55" align="center"/>
|
v-loading="loading"
|
||||||
<el-table-column label="客户姓名" align="center" prop="customer"/>
|
:data="recipesPlanList"
|
||||||
<el-table-column label="客户手机号" align="center" prop="hidePhone" width="180"/>
|
@selection-change="handleSelectionChange"
|
||||||
<el-table-column label="食谱日期范围" align="center" prop="scopeDate" width="200"/>
|
>
|
||||||
<el-table-column label="营养师" align="center" prop="nutritionist"/>
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="营养师助理" align="center" prop="nutritionistAssis" width="180"/>
|
<el-table-column label="客户姓名" align="center" prop="customer" />
|
||||||
|
<el-table-column
|
||||||
|
label="客户手机号"
|
||||||
|
align="center"
|
||||||
|
prop="hidePhone"
|
||||||
|
width="180"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="食谱日期范围"
|
||||||
|
align="center"
|
||||||
|
prop="scopeDate"
|
||||||
|
width="200"
|
||||||
|
/>
|
||||||
|
<el-table-column label="营养师" align="center" prop="nutritionist" />
|
||||||
|
<el-table-column
|
||||||
|
label="营养师助理"
|
||||||
|
align="center"
|
||||||
|
prop="nutritionistAssis"
|
||||||
|
width="180"
|
||||||
|
/>
|
||||||
<el-table-column label="是否发送" align="center" prop="sendFlag">
|
<el-table-column label="是否发送" align="center" prop="sendFlag">
|
||||||
<!--<template slot-scope="scope">
|
<!--<template slot-scope="scope">
|
||||||
<span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span>
|
<span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span>
|
||||||
</template>(.sendFlag == 1) ? 'success' : 'warning'-->
|
</template>(.sendFlag == 1) ? 'success' : 'warning'-->
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag
|
<el-tag :type="getTagType(scope.row)" disable-transitions>
|
||||||
:type="getTagType(scope.row)"
|
{{ scope.row.sendFlag == 1 ? "已发送" : "未发送" }}
|
||||||
disable-transitions>
|
|
||||||
{{scope.row.sendFlag == 1 ? "已发送" : "未发送"}}
|
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="食谱发送时间" align="center" prop="sendTime" width="180">
|
<el-table-column
|
||||||
|
label="食谱发送时间"
|
||||||
|
align="center"
|
||||||
|
prop="sendTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.sendTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.sendTime, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300">
|
<el-table-column
|
||||||
|
label="操作"
|
||||||
|
align="center"
|
||||||
|
class-name="small-padding fixed-width"
|
||||||
|
width="300"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -105,14 +165,17 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['recipes:recipesPlan:edit']"
|
v-hasPermi="['recipes:recipesPlan:edit']"
|
||||||
>修改
|
>修改
|
||||||
</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="allRecipesPlanQueryParam.orderId = scope.row.orderId; getAllPlanByOrderId()"
|
@click="
|
||||||
>查看完整计划
|
allRecipesPlanQueryParam.orderId = scope.row.orderId;
|
||||||
|
getAllPlanByOrderId();
|
||||||
|
"
|
||||||
|
>查看完整计划
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -120,7 +183,7 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="getOrderDetail(scope.row)"
|
@click="getOrderDetail(scope.row)"
|
||||||
v-hasPermi="['custom:order:query']"
|
v-hasPermi="['custom:order:query']"
|
||||||
>查看订单
|
>查看订单
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -128,21 +191,21 @@
|
|||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="getCustomerSign(scope.row)"
|
@click="getCustomerSign(scope.row)"
|
||||||
v-hasPermi="['custom:customer:query']"
|
v-hasPermi="['custom:customer:query']"
|
||||||
>查看体征
|
>查看体征
|
||||||
</el-button>
|
</el-button>
|
||||||
<!--<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-delete"
|
icon="el-icon-edit"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleBuild(scope.row)"
|
||||||
v-hasPermi="['recipes:recipesPlan: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"
|
||||||
@ -152,10 +215,14 @@
|
|||||||
<!-- 添加或修改食谱计划对话框 -->
|
<!-- 添加或修改食谱计划对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="食谱是否已发送" prop="sendFlag" label-width="120px">
|
<el-form-item
|
||||||
|
label="食谱是否已发送"
|
||||||
|
prop="sendFlag"
|
||||||
|
label-width="120px"
|
||||||
|
>
|
||||||
<el-select v-model="form.sendFlag" placeholder="请选择">
|
<el-select v-model="form.sendFlag" placeholder="请选择">
|
||||||
<el-option label="否" :value="parseInt('0')"/>
|
<el-option label="否" :value="parseInt('0')" />
|
||||||
<el-option label="是" :value="parseInt('1')"/>
|
<el-option label="是" :value="parseInt('1')" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -166,47 +233,73 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 查看完整计划 -->
|
<!-- 查看完整计划 -->
|
||||||
<el-dialog title="食谱计划表" v-if="allRecipesPlanOpen" :visible.sync="allRecipesPlanOpen" width="800px" append-to-body>
|
<el-dialog
|
||||||
<el-form :model="allRecipesPlanQueryParam" ref="allPlanQueryFrom" :inline="true">
|
title="食谱计划表"
|
||||||
|
v-if="allRecipesPlanOpen"
|
||||||
|
:visible.sync="allRecipesPlanOpen"
|
||||||
|
width="800px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
:model="allRecipesPlanQueryParam"
|
||||||
|
ref="allPlanQueryFrom"
|
||||||
|
:inline="true"
|
||||||
|
>
|
||||||
<el-form-item label="发送状态" prop="sendFlag">
|
<el-form-item label="发送状态" prop="sendFlag">
|
||||||
<el-select v-model="allRecipesPlanQueryParam.sendFlag" placeholder="请选择">
|
<el-select
|
||||||
<el-option label="全部" :value="null"/>
|
v-model="allRecipesPlanQueryParam.sendFlag"
|
||||||
<el-option label="未发送" :value="parseInt('0')"/>
|
placeholder="请选择"
|
||||||
<el-option label="已发送" :value="parseInt('1')"/>
|
>
|
||||||
|
<el-option label="全部" :value="null" />
|
||||||
|
<el-option label="未发送" :value="parseInt('0')" />
|
||||||
|
<el-option label="已发送" :value="parseInt('1')" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="getAllPlanByOrderId()">搜索</el-button>
|
<el-button
|
||||||
|
type="cyan"
|
||||||
|
icon="el-icon-search"
|
||||||
|
size="mini"
|
||||||
|
@click="getAllPlanByOrderId()"
|
||||||
|
>搜索</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="allRecipesPlanList" width="700px">
|
<el-table v-loading="loading" :data="allRecipesPlanList" width="700px">
|
||||||
<el-table-column label="客户姓名" align="center" prop="customer"/>
|
<el-table-column label="客户姓名" align="center" prop="customer" />
|
||||||
<!--<el-table-column label="营养师名称" align="center" prop="nutritionist" />
|
<!--<el-table-column label="营养师名称" align="center" prop="nutritionist" />
|
||||||
<el-table-column label="营养师助理名称" align="center" prop="nutritionistAssis" />-->
|
<el-table-column label="营养师助理名称" align="center" prop="nutritionistAssis" />-->
|
||||||
|
|
||||||
<el-table-column label="食谱时间范围" align="center" prop="scopeDate" width="250"/>
|
<el-table-column
|
||||||
|
label="食谱时间范围"
|
||||||
|
align="center"
|
||||||
|
prop="scopeDate"
|
||||||
|
width="250"
|
||||||
|
/>
|
||||||
<el-table-column label="食谱是否发送" align="center" prop="sendFlag">
|
<el-table-column label="食谱是否发送" align="center" prop="sendFlag">
|
||||||
<!--<template slot-scope="scope">
|
<!--<template slot-scope="scope">
|
||||||
<span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span>
|
<span>{{ scope.row.sendFlag == 1 ? "已发送" : "未发送"}}</span>
|
||||||
</template>(.sendFlag == 1) ? 'success' : 'warning'-->
|
</template>(.sendFlag == 1) ? 'success' : 'warning'-->
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag
|
<el-tag :type="getTagType(scope.row)" disable-transitions>
|
||||||
:type="getTagType(scope.row)"
|
{{ scope.row.sendFlag == 1 ? "已发送" : "未发送" }}
|
||||||
disable-transitions>
|
|
||||||
{{scope.row.sendFlag == 1 ? "已发送" : "未发送"}}
|
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="食谱发送时间" align="center" prop="sendTime" width="180">
|
<el-table-column
|
||||||
|
label="食谱发送时间"
|
||||||
|
align="center"
|
||||||
|
prop="sendTime"
|
||||||
|
width="180"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.sendTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.sendTime, "{y}-{m}-{d}") }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="allRecipesPlanTotal>0"
|
v-show="allRecipesPlanTotal > 0"
|
||||||
:total="allRecipesPlanTotal"
|
:total="allRecipesPlanTotal"
|
||||||
:page.sync="allRecipesPlanQueryParam.pageNum"
|
:page.sync="allRecipesPlanQueryParam.pageNum"
|
||||||
:limit.sync="allRecipesPlanQueryParam.pageSize"
|
:limit.sync="allRecipesPlanQueryParam.pageSize"
|
||||||
@ -218,266 +311,306 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 查看订单 -->
|
<!-- 查看订单 -->
|
||||||
<order-dialog ref="orderDialog"/>
|
<order-dialog ref="orderDialog" />
|
||||||
<!-- 查看体征 -->
|
<!-- 查看体征 -->
|
||||||
<body_sign_dialog ref="bodySignDialog"/>
|
<body_sign_dialog ref="bodySignDialog" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {exportRecipesPlan, getRecipesPlan, listRecipesPlan, updateRecipesPlan} from "@/api/custom/recipesPlan";
|
import {
|
||||||
import {getOptions} from "@/api/custom/order";
|
exportRecipesPlan,
|
||||||
import OrderDetail from '@/components/OrderDetail';
|
getRecipesPlan,
|
||||||
import BodySignDetail from '@/components/BodySignDetail';
|
listRecipesPlan,
|
||||||
import dayjs from 'dayjs';
|
updateRecipesPlan,
|
||||||
import store from "@/store";
|
} from "@/api/custom/recipesPlan";
|
||||||
|
import { getOptions } from "@/api/custom/order";
|
||||||
|
import OrderDetail from "@/components/OrderDetail";
|
||||||
|
import BodySignDetail from "@/components/BodySignDetail";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import store from "@/store";
|
||||||
|
|
||||||
const nextDate = dayjs().add(1, 'day').format("YYYY-MM-DD");
|
const nextDate = dayjs().add(1, "day").format("YYYY-MM-DD");
|
||||||
const weekDate = dayjs().add(6, 'day').format("YYYY-MM-DD");
|
const weekDate = dayjs().add(6, "day").format("YYYY-MM-DD");
|
||||||
const userId = store.getters && store.getters.userId;
|
const userId = store.getters && store.getters.userId;
|
||||||
export default {
|
export default {
|
||||||
name: "recipesPlan",
|
name: "recipesPlan",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
single: true,
|
single: true,
|
||||||
// 非多个禁用
|
// 非多个禁用
|
||||||
multiple: true,
|
multiple: true,
|
||||||
// 显示搜索条件
|
// 显示搜索条件
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
// 总条数
|
// 总条数
|
||||||
total: 0,
|
total: 0,
|
||||||
// 食谱计划表格数据
|
// 食谱计划表格数据
|
||||||
recipesPlanList: [],
|
recipesPlanList: [],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
orderDialog: undefined,
|
orderDialog: undefined,
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
customer: null,
|
customer: null,
|
||||||
startDate: null,
|
startDate: null,
|
||||||
endDate: null,
|
endDate: null,
|
||||||
nutritionistId: null,
|
nutritionistId: null,
|
||||||
nutritionistAssisId: null
|
nutritionistAssisId: null,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {},
|
rules: {},
|
||||||
//食谱开始时间范围
|
//食谱开始时间范围
|
||||||
planStartDateScope: [nextDate, nextDate],
|
planStartDateScope: [nextDate, nextDate],
|
||||||
//订单对于所有计划安排数据
|
//订单对于所有计划安排数据
|
||||||
allRecipesPlanList: [],
|
allRecipesPlanList: [],
|
||||||
//订单弹窗状态
|
//订单弹窗状态
|
||||||
allRecipesPlanOpen: false,
|
allRecipesPlanOpen: false,
|
||||||
//订单弹窗中查询参数
|
//订单弹窗中查询参数
|
||||||
allRecipesPlanQueryParam: {
|
allRecipesPlanQueryParam: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orderId: null,
|
orderId: null,
|
||||||
sendFlag: 0
|
sendFlag: 0,
|
||||||
},
|
},
|
||||||
//订单弹窗中列表数据的总条数
|
//订单弹窗中列表数据的总条数
|
||||||
allRecipesPlanTotal: 0,
|
allRecipesPlanTotal: 0,
|
||||||
//营养师
|
//营养师
|
||||||
nutritionistIdOptions: [],
|
nutritionistIdOptions: [],
|
||||||
//营养师助理
|
//营养师助理
|
||||||
nutriAssisIdOptions: [],
|
nutriAssisIdOptions: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
"order-dialog": OrderDetail,
|
||||||
|
body_sign_dialog: BodySignDetail,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
getOptions().then((response) => {
|
||||||
|
const options = response.data.reduce((opts, cur) => {
|
||||||
|
if (!opts[cur.postCode]) {
|
||||||
|
opts[cur.postCode] = [
|
||||||
|
{ dictValue: null, dictLabel: "全部", remark: null },
|
||||||
|
];
|
||||||
|
}
|
||||||
|
opts[cur.postCode].push({
|
||||||
|
dictValue: cur.userId,
|
||||||
|
dictLabel: cur.userName,
|
||||||
|
remark: cur.remark,
|
||||||
|
});
|
||||||
|
return opts;
|
||||||
|
}, {});
|
||||||
|
this.nutritionistIdOptions = options["nutri"] || [];
|
||||||
|
this.nutriAssisIdOptions = options["nutri_assis"] || [];
|
||||||
|
const defaultNutritionist = this.nutritionistIdOptions.find(
|
||||||
|
(opt) => opt.dictValue == userId
|
||||||
|
);
|
||||||
|
const defaultNutriAssisId = this.nutriAssisIdOptions.find(
|
||||||
|
(opt) => opt.dictValue == userId
|
||||||
|
);
|
||||||
|
if (defaultNutritionist) {
|
||||||
|
this.queryParams.nutritionistId = userId;
|
||||||
|
}
|
||||||
|
if (defaultNutriAssisId) {
|
||||||
|
this.queryParams.nutritionistAssisId = userId;
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询食谱计划列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
if (
|
||||||
|
this.planStartDateScope != null &&
|
||||||
|
this.planStartDateScope.length > 0
|
||||||
|
) {
|
||||||
|
this.queryParams.startDate = dayjs(this.planStartDateScope[0]).format(
|
||||||
|
"YYYY-MM-DD"
|
||||||
|
);
|
||||||
|
this.queryParams.endDate = dayjs(this.planStartDateScope[1]).format(
|
||||||
|
"YYYY-MM-DD"
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.queryParams.startDate = null;
|
||||||
|
this.queryParams.endDate = null;
|
||||||
|
}
|
||||||
|
listRecipesPlan(this.queryParams).then((response) => {
|
||||||
|
this.recipesPlanList = response.rows;
|
||||||
|
this.recipesPlanList.forEach(function (item, index) {
|
||||||
|
item.scopeDate =
|
||||||
|
dayjs(item.startDate).format("YYYY-MM-DD") +
|
||||||
|
" 到 " +
|
||||||
|
dayjs(item.endDate).format("YYYY-MM-DD");
|
||||||
|
});
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 查询客户体征 */
|
||||||
|
getCustomerSign(row) {
|
||||||
|
this.$refs.bodySignDialog.showDialog(row.phone);
|
||||||
|
},
|
||||||
|
getAllPlanByOrderId() {
|
||||||
|
if (this.allRecipesPlanQueryParam.sendFlag === "") {
|
||||||
|
this.allRecipesPlanQueryParam.sendFlag = null;
|
||||||
|
}
|
||||||
|
listRecipesPlan(this.allRecipesPlanQueryParam).then((response) => {
|
||||||
|
this.allRecipesPlanList = response.rows;
|
||||||
|
this.allRecipesPlanList.forEach(function (item, index) {
|
||||||
|
item.scopeDate =
|
||||||
|
dayjs(item.startDate).format("YYYY-MM-DD") +
|
||||||
|
" 到 " +
|
||||||
|
dayjs(item.endDate).format("YYYY-MM-DD");
|
||||||
|
});
|
||||||
|
this.allRecipesPlanOpen = true;
|
||||||
|
this.allRecipesPlanTotal = response.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getOrderDetail(row) {
|
||||||
|
this.$refs.orderDialog.showDialog(row.orderId);
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
orderId: null,
|
||||||
|
startDate: null,
|
||||||
|
endDate: null,
|
||||||
|
recipesId: null,
|
||||||
|
sendFlag: null,
|
||||||
|
sendTime: null,
|
||||||
|
createTime: null,
|
||||||
|
createBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
delFlag: null,
|
||||||
};
|
};
|
||||||
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
components: {
|
/** 搜索按钮操作 */
|
||||||
"order-dialog": OrderDetail,
|
handleQuery() {
|
||||||
"body_sign_dialog": BodySignDetail
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
},
|
},
|
||||||
created() {
|
/** 重置按钮操作 */
|
||||||
getOptions().then(response => {
|
resetQuery() {
|
||||||
const options = response.data.reduce((opts, cur) => {
|
this.resetForm("queryForm");
|
||||||
if (!opts[cur.postCode]) {
|
this.planStartDateScope = [nextDate, nextDate];
|
||||||
opts[cur.postCode] = [{dictValue: null, dictLabel: '全部', remark: null}];
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map((item) => item.id);
|
||||||
|
this.single = selection.length !== 1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids;
|
||||||
|
getRecipesPlan(id).then((response) => {
|
||||||
|
this.form.id = response.data.id;
|
||||||
|
this.form.sendFlag = response.data.sendFlag;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改食谱计划";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateRecipesPlan(this.form).then((response) => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
opts[cur.postCode].push({dictValue: cur.userId, dictLabel: cur.userName, remark: cur.remark})
|
|
||||||
return opts;
|
|
||||||
}, {})
|
|
||||||
this.nutritionistIdOptions = options['nutri'] || [];
|
|
||||||
this.nutriAssisIdOptions = options['nutri_assis'] || [];
|
|
||||||
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.dictValue == userId);
|
|
||||||
const defaultNutriAssisId = this.nutriAssisIdOptions.find(opt => opt.dictValue == userId);
|
|
||||||
if (defaultNutritionist) {
|
|
||||||
this.queryParams.nutritionistId = userId;
|
|
||||||
}
|
}
|
||||||
if (defaultNutriAssisId) {
|
});
|
||||||
this.queryParams.nutritionistAssisId = userId;
|
},
|
||||||
}
|
/** 导出按钮操作 */
|
||||||
this.getList();
|
handleExport() {
|
||||||
|
const queryParams = this.queryParams;
|
||||||
|
this.$confirm("是否确认导出所有食谱计划数据项?", "警告", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
})
|
})
|
||||||
},
|
.then(function () {
|
||||||
methods: {
|
|
||||||
/** 查询食谱计划列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
if (this.planStartDateScope != null && this.planStartDateScope.length > 0) {
|
|
||||||
this.queryParams.startDate = dayjs(this.planStartDateScope[0]).format('YYYY-MM-DD');
|
|
||||||
this.queryParams.endDate = dayjs(this.planStartDateScope[1]).format('YYYY-MM-DD');
|
|
||||||
} else {
|
|
||||||
this.queryParams.startDate = null;
|
|
||||||
this.queryParams.endDate = null;
|
|
||||||
}
|
|
||||||
listRecipesPlan(this.queryParams).then(response => {
|
|
||||||
this.recipesPlanList = response.rows;
|
|
||||||
this.recipesPlanList.forEach(function (item, index) {
|
|
||||||
item.scopeDate = dayjs(item.startDate).format("YYYY-MM-DD") + " 到 " + dayjs(item.endDate).format("YYYY-MM-DD")
|
|
||||||
});
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 查询客户体征 */
|
|
||||||
getCustomerSign(row) {
|
|
||||||
this.$refs.bodySignDialog.showDialog(row.phone);
|
|
||||||
},
|
|
||||||
getAllPlanByOrderId() {
|
|
||||||
if (this.allRecipesPlanQueryParam.sendFlag === "") {
|
|
||||||
this.allRecipesPlanQueryParam.sendFlag = null;
|
|
||||||
}
|
|
||||||
listRecipesPlan(this.allRecipesPlanQueryParam).then(response => {
|
|
||||||
this.allRecipesPlanList = response.rows;
|
|
||||||
this.allRecipesPlanList.forEach(function (item, index) {
|
|
||||||
item.scopeDate = dayjs(item.startDate).format("YYYY-MM-DD") + " 到 " + dayjs(item.endDate).format("YYYY-MM-DD")
|
|
||||||
});
|
|
||||||
this.allRecipesPlanOpen = true;
|
|
||||||
this.allRecipesPlanTotal = response.total;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getOrderDetail(row) {
|
|
||||||
this.$refs.orderDialog.showDialog(row.orderId);
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
orderId: null,
|
|
||||||
startDate: null,
|
|
||||||
endDate: null,
|
|
||||||
recipesId: null,
|
|
||||||
sendFlag: null,
|
|
||||||
sendTime: null,
|
|
||||||
createTime: null,
|
|
||||||
createBy: null,
|
|
||||||
updateTime: null,
|
|
||||||
updateBy: null,
|
|
||||||
delFlag: null
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.planStartDateScope = [nextDate, nextDate];
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.id)
|
|
||||||
this.single = selection.length !== 1
|
|
||||||
this.multiple = !selection.length
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getRecipesPlan(id).then(response => {
|
|
||||||
this.form.id = response.data.id;
|
|
||||||
this.form.sendFlag = response.data.sendFlag;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改食谱计划";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateRecipesPlan(this.form).then(response => {
|
|
||||||
if (response.code === 200) {
|
|
||||||
this.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
const queryParams = this.queryParams;
|
|
||||||
this.$confirm('是否确认导出所有食谱计划数据项?', "警告", {
|
|
||||||
confirmButtonText: "确定",
|
|
||||||
cancelButtonText: "取消",
|
|
||||||
type: "warning"
|
|
||||||
}).then(function () {
|
|
||||||
return exportRecipesPlan(queryParams);
|
return exportRecipesPlan(queryParams);
|
||||||
}).then(response => {
|
})
|
||||||
|
.then((response) => {
|
||||||
this.download(response.msg);
|
this.download(response.msg);
|
||||||
}).catch(function () {
|
})
|
||||||
});
|
.catch(function () {});
|
||||||
},
|
},
|
||||||
getTagType(row) {
|
getTagType(row) {
|
||||||
if (row.sendFlag == 1) {
|
if (row.sendFlag == 1) {
|
||||||
return "success";
|
return "success";
|
||||||
}
|
}
|
||||||
return "danger";
|
return "danger";
|
||||||
/* if(dayjs(row.startDate+"").diff(dayjs(),'day') <= 1){
|
/* if(dayjs(row.startDate+"").diff(dayjs(),'day') <= 1){
|
||||||
return "danger";
|
return "danger";
|
||||||
}
|
}
|
||||||
return '';*/
|
return '';*/
|
||||||
},
|
},
|
||||||
// 自定义列背景色
|
// 自定义列背景色
|
||||||
columnStyle({row, column, rowIndex, columnIndex}) {
|
columnStyle({ row, column, rowIndex, columnIndex }) {
|
||||||
if (columnIndex == 0 || columnIndex == 2 || columnIndex == 4 || columnIndex == 6) {
|
if (
|
||||||
//第三第四列的背景色就改变了2和3都是列数的下标
|
columnIndex == 0 ||
|
||||||
return "background:#f3f6fc;font-weight:bold";
|
columnIndex == 2 ||
|
||||||
|
columnIndex == 4 ||
|
||||||
|
columnIndex == 6
|
||||||
|
) {
|
||||||
|
//第三第四列的背景色就改变了2和3都是列数的下标
|
||||||
|
return "background:#f3f6fc;font-weight:bold";
|
||||||
|
} else {
|
||||||
|
return "background:#ffffff;";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 和并列
|
||||||
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||||
|
if (columnIndex === 0) {
|
||||||
|
if (rowIndex % 4 === 0) {
|
||||||
|
return {
|
||||||
|
rowspan: 4,
|
||||||
|
colspan: 1,
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
return "background:#ffffff;";
|
return {
|
||||||
}
|
rowspan: 0,
|
||||||
},
|
colspan: 0,
|
||||||
// 和并列
|
};
|
||||||
objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
|
||||||
if (columnIndex === 0) {
|
|
||||||
if (rowIndex % 4 === 0) {
|
|
||||||
return {
|
|
||||||
rowspan: 4,
|
|
||||||
colspan: 1
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
rowspan: 0,
|
|
||||||
colspan: 0
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
handleBuild(data) {
|
||||||
|
this.$router.push({
|
||||||
|
name: "RecipiesBuild",
|
||||||
|
params: { id: data.id, cusId: data.orderId },
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user