commit
243bffffee
@ -38,6 +38,18 @@ public class SysRecipesPlanController extends BaseController
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单查询完整食谱计划列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:list')")
|
||||||
|
@GetMapping("/getAllPlanByOrderId")
|
||||||
|
public TableDataInfo getAllPlanByOrderId(SysRecipesPlan sysRecipesPlan)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<SysRecipesPlan> list = sysRecipesPlanService.selectPlanListByOrderId(sysRecipesPlan);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取食谱计划详细信息
|
* 获取食谱计划详细信息
|
||||||
*/
|
*/
|
||||||
|
@ -29,6 +29,7 @@ public class SysRecipesPlan extends BaseEntity
|
|||||||
private String customer;
|
private String customer;
|
||||||
|
|
||||||
//非持久化字段,客户手机号
|
//非持久化字段,客户手机号
|
||||||
|
@Excel(name = "客户手机号")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
/** 食谱开始日期 */
|
/** 食谱开始日期 */
|
||||||
|
@ -79,4 +79,11 @@ public interface SysRecipesPlanMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SysRecipesPlan> selectPlanListByCondition(SysRecipesPlan sysRecipesPlan);
|
List<SysRecipesPlan> selectPlanListByCondition(SysRecipesPlan sysRecipesPlan);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID查询食谱计划
|
||||||
|
* @param sysRecipesPlan
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysRecipesPlan> selectPlanListByOrderId(SysRecipesPlan sysRecipesPlan);
|
||||||
}
|
}
|
@ -80,4 +80,11 @@ public interface ISysRecipesPlanService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SysRecipesPlan> selectPlanListByCondition(SysRecipesPlan sysRecipesPlan);
|
List<SysRecipesPlan> selectPlanListByCondition(SysRecipesPlan sysRecipesPlan);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID查询食谱计划
|
||||||
|
* @param sysRecipesPlan
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysRecipesPlan> selectPlanListByOrderId(SysRecipesPlan sysRecipesPlan);
|
||||||
}
|
}
|
@ -123,6 +123,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
|||||||
}
|
}
|
||||||
commissionMonthSet.addAll(sysOrderCommisionDayDetail.getEveryYearMonthServerMoney().keySet());
|
commissionMonthSet.addAll(sysOrderCommisionDayDetail.getEveryYearMonthServerMoney().keySet());
|
||||||
}
|
}
|
||||||
|
//System.out.println("总提成:"+sysCommissionDayDetail.getNickName()+"-"+orderAmount.get("20211"));
|
||||||
//获取提成比例以及计算提成
|
//获取提成比例以及计算提成
|
||||||
Map<String, Float> rateMap = getRateByAmount(sysCommissionDayDetail.getUserId(), sysCommissionDayDetail.getPostId(), orderAmount);
|
Map<String, Float> rateMap = getRateByAmount(sysCommissionDayDetail.getUserId(), sysCommissionDayDetail.getPostId(), orderAmount);
|
||||||
|
|
||||||
@ -225,10 +226,10 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
|||||||
//整理出每个用户对应的订单List
|
//整理出每个用户对应的订单List
|
||||||
Map<Long, List<SysOrderCommisionDayDetail>> userOrderResultMap = new HashMap<>();
|
Map<Long, List<SysOrderCommisionDayDetail>> userOrderResultMap = new HashMap<>();
|
||||||
for (SysOrder sysOrder : orderList) {
|
for (SysOrder sysOrder : orderList) {
|
||||||
//建档时间为空、售后人员ID为空、营养师ID为空、订单金额为空或小于0,都视为异常订单
|
//开始时间为空、售后人员ID为空、营养师ID都为空、订单金额为空,都视为异常订单
|
||||||
if(sysOrder.getOrderTime() == null || sysOrder.getStartTime() == null || sysOrder.getServeTimeId() == null
|
if(sysOrder.getOrderTime() == null || sysOrder.getStartTime() == null || sysOrder.getServeTimeId() == null
|
||||||
|| (sysOrder.getAfterSaleId() == null && sysOrder.getNutritionistId() == null)
|
|| (sysOrder.getAfterSaleId() == null && sysOrder.getNutritionistId() == null)
|
||||||
|| sysOrder.getAmount() == null || sysOrder.getAmount().doubleValue() < 0){
|
|| sysOrder.getAmount() == null){
|
||||||
//System.out.println("客户:"+ sysOrder.getCustomer() +",营养师:"+sysOrder.getNutritionist() + ",售后" + sysOrder.getAfterSale());
|
//System.out.println("客户:"+ sysOrder.getCustomer() +",营养师:"+sysOrder.getNutritionist() + ",售后" + sysOrder.getAfterSale());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -436,7 +437,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
|||||||
* double转为BigDecimal,保留一位小数,向下舍去
|
* double转为BigDecimal,保留一位小数,向下舍去
|
||||||
* */
|
* */
|
||||||
public BigDecimal getMoney(Double money, int n){
|
public BigDecimal getMoney(Double money, int n){
|
||||||
return new BigDecimal(money).setScale(n, BigDecimal.ROUND_HALF_UP);
|
return new BigDecimal(money.toString()).setScale(n, BigDecimal.ROUND_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -459,7 +460,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
|||||||
nf.setRoundingMode(RoundingMode.DOWN);
|
nf.setRoundingMode(RoundingMode.DOWN);
|
||||||
System.out.println(Double.parseDouble(nf.format(s)));
|
System.out.println(Double.parseDouble(nf.format(s)));
|
||||||
System.out.println( new BigDecimal(nf.format(s)).doubleValue());*/
|
System.out.println( new BigDecimal(nf.format(s)).doubleValue());*/
|
||||||
System.out.println(new BigDecimal(s).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue());
|
/*System.out.println(new BigDecimal(s).setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||||
|
|
||||||
LocalDate localDate = LocalDate.of(2020, 1, 15);
|
LocalDate localDate = LocalDate.of(2020, 1, 15);
|
||||||
System.out.println(ChronoUnit.MONTHS.between(localDate, LocalDate.now()));
|
System.out.println(ChronoUnit.MONTHS.between(localDate, LocalDate.now()));
|
||||||
@ -467,6 +468,14 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
|||||||
System.out.println(localDate.getDayOfWeek());
|
System.out.println(localDate.getDayOfWeek());
|
||||||
System.out.println(localDate.getDayOfYear());
|
System.out.println(localDate.getDayOfYear());
|
||||||
|
|
||||||
System.out.println(ChronoUnit.DAYS.between(LocalDate.of(2021, 1,14), LocalDate.now()));
|
System.out.println(ChronoUnit.DAYS.between(LocalDate.of(2021, 1,14), LocalDate.now()));*/
|
||||||
|
|
||||||
|
/*System.out.println(ts(109792.8 * 6 / 100D, 1));
|
||||||
|
System.out.println(ts(6587.8,2).doubleValue());*/
|
||||||
|
System.out.println(ts(1.919,1).doubleValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BigDecimal ts(Double money, int n){
|
||||||
|
return new BigDecimal(money.toString()).setScale(n, BigDecimal.ROUND_DOWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.stdiet.custom.service.impl;
|
package com.stdiet.custom.service.impl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -196,7 +197,8 @@ public class SysOrderServiceImpl implements ISysOrderService {
|
|||||||
* @param sysOrder
|
* @param sysOrder
|
||||||
*/
|
*/
|
||||||
private void setOrderServerEndDate(SysOrder sysOrder){
|
private void setOrderServerEndDate(SysOrder sysOrder){
|
||||||
sysOrder.setServerEndTime(DateUtils.localDateToDate(sysCommissionDayService.getServerEndDate(sysOrder)));
|
LocalDate serverEndDate = sysCommissionDayService.getServerEndDate(sysOrder);
|
||||||
|
sysOrder.setServerEndTime(serverEndDate != null ? DateUtils.localDateToDate(serverEndDate) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -133,10 +133,11 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SysOrder sysOrder = sysOrderService.selectSysOrderById(orderId);
|
SysOrder sysOrder = sysOrderService.selectSysOrderById(orderId);
|
||||||
//订单为空、金额小于0不进行食谱生成、更新
|
//订单为空、金额小于0不进行食谱生成、更新,只对2021年开始的订单进行食谱计划生成
|
||||||
if(sysOrder == null){
|
if(sysOrder == null && DateUtils.dateToLocalDate(sysOrder.getOrderTime()).getYear() > 2020){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
System.out.println(DateUtils.dateToLocalDate(sysOrder.getOrderTime()).getYear());
|
||||||
try{
|
try{
|
||||||
//获取redis中该订单对应的锁
|
//获取redis中该订单对应的锁
|
||||||
if(synchrolockUtil.lock(String.format(generateRecipesPlanLockKey, orderId))){
|
if(synchrolockUtil.lock(String.format(generateRecipesPlanLockKey, orderId))){
|
||||||
@ -281,4 +282,14 @@ public class SysRecipesPlanServiceImpl implements ISysRecipesPlanService
|
|||||||
public List<SysRecipesPlan> selectPlanListByCondition(SysRecipesPlan sysRecipesPlan){
|
public List<SysRecipesPlan> selectPlanListByCondition(SysRecipesPlan sysRecipesPlan){
|
||||||
return sysRecipesPlanMapper.selectPlanListByCondition(sysRecipesPlan);
|
return sysRecipesPlanMapper.selectPlanListByCondition(sysRecipesPlan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID查询食谱计划
|
||||||
|
* @param sysRecipesPlan
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysRecipesPlan> selectPlanListByOrderId(SysRecipesPlan sysRecipesPlan){
|
||||||
|
return sysRecipesPlanMapper.selectPlanListByOrderId(sysRecipesPlan);
|
||||||
|
}
|
||||||
}
|
}
|
@ -96,11 +96,11 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteSysRecipesPlanById" parameterType="Long">
|
<delete id="deleteSysRecipesPlanById" parameterType="Long">
|
||||||
update sys_recipes_plan set del_flag = 1 where id = #{id}
|
delete from sys_recipes_plan where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteSysRecipesPlanByIds" parameterType="String">
|
<delete id="deleteSysRecipesPlanByIds" parameterType="String">
|
||||||
update sys_recipes_plan set del_flag = 1 where id in
|
delete from sys_recipes_plan where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
@ -118,7 +118,7 @@
|
|||||||
|
|
||||||
<!-- 根据订单ID删除对应食谱计划 -->
|
<!-- 根据订单ID删除对应食谱计划 -->
|
||||||
<update id="delRecipesPlanByOrderId" parameterType="String">
|
<update id="delRecipesPlanByOrderId" parameterType="String">
|
||||||
update sys_recipes_plan set del_flag = 1 where order_id in
|
delete from sys_recipes_plan where order_id in
|
||||||
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||||||
#{orderId}
|
#{orderId}
|
||||||
</foreach>
|
</foreach>
|
||||||
@ -133,10 +133,38 @@
|
|||||||
LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sr.nutri_assis_id AND su_nutritionist_assis.del_flag = 0
|
LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sr.nutri_assis_id AND su_nutritionist_assis.del_flag = 0
|
||||||
WHERE srp.del_flag = 0
|
WHERE srp.del_flag = 0
|
||||||
<if test="orderId != null">AND srp.order_id = #{orderId}</if>
|
<if test="orderId != null">AND srp.order_id = #{orderId}</if>
|
||||||
<if test="customer != null and customer != ''">AND sr.customer like concat('%',#{customer},'%')</if>
|
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if>
|
||||||
|
<if test="customer != null and customer != ''">AND (sr.customer like concat('%',#{customer},'%') OR sr.phone like concat('%',#{customer},'%'))</if>
|
||||||
<if test="nutritionistId != null">AND su_nutritionist.user_id = #{nutritionistId}</if>
|
<if test="nutritionistId != null">AND su_nutritionist.user_id = #{nutritionistId}</if>
|
||||||
<if test="nutritionistAssisId != null">AND su_nutritionist_assis.user_id = #{nutritionistAssisId}</if>
|
<if test="nutritionistAssisId != null">AND su_nutritionist_assis.user_id = #{nutritionistAssisId}</if>
|
||||||
<if test="startDate != null and endDate != null ">AND srp.start_date BETWEEN date_format(#{startDate},'%y%m%d') AND date_format(#{endDate},'%y%m%d') </if>
|
<if test="startDate != null and endDate != null ">AND srp.start_date BETWEEN date_format(#{startDate},'%y%m%d') AND date_format(#{endDate},'%y%m%d') </if>
|
||||||
ORDER BY srp.order_id DESC,srp.id ASC
|
ORDER BY srp.order_id DESC,srp.id ASC
|
||||||
</select>
|
</select>
|
||||||
|
<!-- 食谱计划、订单表联查 -->
|
||||||
|
<!--<select id="selectPlanListByCondition" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
|
||||||
|
SELECT sr.order_id,sr.customer,sr.phone,su_nutritionist.nick_name nutritionist,su_nutritionist_assis.nick_name AS nutritionist_assis,sr.start_time,sr.server_end_time
|
||||||
|
FROM sys_order sr
|
||||||
|
LEFT JOIN sys_user su_nutritionist ON su_nutritionist.user_id = sr.nutritionist_id AND su_nutritionist.del_flag = 0
|
||||||
|
LEFT JOIN sys_user su_nutritionist_assis ON su_nutritionist_assis.user_id = sr.nutri_assis_id AND su_nutritionist_assis.del_flag = 0
|
||||||
|
<where>
|
||||||
|
<if test="orderId != null">AND sr.order_id = #{orderId}</if>
|
||||||
|
<if test="customer != null and customer != ''">AND (sr.customer like concat('%',#{customer},'%') OR sr.phone like concat('%',#{customer},'%'))</if>
|
||||||
|
<if test="nutritionistId != null">AND su_nutritionist.user_id = #{nutritionistId}</if>
|
||||||
|
<if test="nutritionistAssisId != null">AND su_nutritionist_assis.user_id = #{nutritionistAssisId}</if>
|
||||||
|
<if test="startDate != null and endDate != null ">
|
||||||
|
AND sr.order_id IN ( SELECT order_id FROM sys_recipes_plan srp WHERE srp.del_flag = 0 AND srp.start_date BETWEEN date_format(#{startDate},'%y%m%d') AND date_format(#{endDate},'%y%m%d'))
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY sr.order_id DESC
|
||||||
|
</select>-->
|
||||||
|
|
||||||
|
<!-- 根据订单ID查询食谱计划 -->
|
||||||
|
<select id="selectPlanListByOrderId" parameterType="SysRecipesPlan" resultMap="SysRecipesPlanResult">
|
||||||
|
SELECT srp.id,srp.order_id,sr.customer,sr.phone, srp.start_date,srp.end_date,srp.send_flag,srp.send_time
|
||||||
|
FROM sys_recipes_plan srp
|
||||||
|
LEFT JOIN sys_order sr ON sr.order_id = srp.order_id
|
||||||
|
WHERE srp.del_flag = 0 AND srp.order_id = #{orderId}
|
||||||
|
<if test="sendFlag != null">AND srp.send_flag = #{sendFlag}</if>
|
||||||
|
ORDER BY srp.id ASC
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
BIN
stdiet-ui/src/assets/logo/st_logo2.png
Normal file
BIN
stdiet-ui/src/assets/logo/st_logo2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
@ -14,7 +14,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import logoImg from '@/assets/logo/logo.png'
|
import logoImg from '@/assets/logo/st_logo2.png'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SidebarLogo',
|
name: 'SidebarLogo',
|
||||||
@ -26,7 +26,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '管理系统',
|
title: '胜唐管理系统',
|
||||||
logo: logoImg
|
logo: logoImg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,10 @@
|
|||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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">
|
||||||
<el-row :gutter="10" class="mb8">
|
注意事项:
|
||||||
|
<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="warning"
|
type="warning"
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<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"
|
||||||
placeholder="请输入客户姓名"
|
placeholder="请输入客户姓名或手机号"
|
||||||
clearable
|
clearable
|
||||||
size="small"
|
size="small"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="食谱开始日期范围" prop="planStartDateScope" label-width="150px">
|
<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"
|
||||||
@ -17,16 +17,36 @@
|
|||||||
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-select v-model="queryParams.nutritionistId" placeholder="请选择营养师" clearable size="small">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in nutritionistIdOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="dict.dictValue"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="营养师助理" prop="nutritionistAssisId">
|
||||||
|
<el-select v-model="queryParams.nutritionistAssisId" placeholder="请选择营养师助理" clearable size="small">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in nutriAssisIdOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="dict.dictValue"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</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 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-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">
|
||||||
<el-row :gutter="10" class="mb8">
|
注意事项:
|
||||||
|
<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"
|
||||||
@ -46,12 +66,14 @@
|
|||||||
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>-->
|
||||||
<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 v-loading="loading" :data="recipesPlanList" @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="customer" />
|
<el-table-column label="客户姓名" align="center" prop="customer" />
|
||||||
|
<el-table-column label="客户手机号" align="center" prop="phone" />
|
||||||
<el-table-column label="食谱日期范围" align="center" prop="scopeDate" width="200"/>
|
<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="nutritionist" />
|
||||||
<el-table-column label="营养师助理" align="center" prop="nutritionistAssis" />
|
<el-table-column label="营养师助理" align="center" prop="nutritionistAssis" />
|
||||||
@ -139,6 +161,19 @@
|
|||||||
|
|
||||||
<!-- 查看完整计划 -->
|
<!-- 查看完整计划 -->
|
||||||
<el-dialog title="食谱计划表" v-if="allRecipesPlanOpen" :visible.sync="allRecipesPlanOpen" width="800px" append-to-body>
|
<el-dialog 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-select v-model="allRecipesPlanQueryParam.sendFlag" placeholder="请选择">
|
||||||
|
<el-option label="全部" :value="null" />
|
||||||
|
<el-option label="未发送" :value="parseInt('0')" />
|
||||||
|
<el-option label="已发送" :value="parseInt('1')" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="cyan" icon="el-icon-search" size="mini" @click="getAllPlanByOrderId()">搜索</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</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" />
|
||||||
@ -171,9 +206,9 @@
|
|||||||
:limit.sync="allRecipesPlanQueryParam.pageSize"
|
:limit.sync="allRecipesPlanQueryParam.pageSize"
|
||||||
@pagination="getAllPlanByOrderId"
|
@pagination="getAllPlanByOrderId"
|
||||||
/>
|
/>
|
||||||
<div slot="footer" class="dialog-footer">
|
<!--<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="allRecipesPlanOpen = false">取 消</el-button>
|
<el-button @click="allRecipesPlanOpen = false">关 闭</el-button>
|
||||||
</div>
|
</div>-->
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
@ -292,9 +327,9 @@
|
|||||||
<el-table-column label="减脂遇到的困难" align="center" prop="sign.difficulty" ></el-table-column>
|
<el-table-column label="减脂遇到的困难" align="center" prop="sign.difficulty" ></el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="sign.comments"></el-table-column>
|
<el-table-column label="备注" align="center" prop="sign.comments"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div slot="footer" class="dialog-footer">
|
<!--<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="customerOpen = false">取 消</el-button>
|
<el-button @click="customerOpen = false">关 闭</el-button>
|
||||||
</div>
|
</div>-->
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 查看订单 -->
|
<!-- 查看订单 -->
|
||||||
@ -376,9 +411,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark"/>
|
<el-table-column label="备注" align="center" prop="remark"/>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div slot="footer" class="dialog-footer">
|
<!--<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="orderDetailOpen = false">取 消</el-button>
|
<el-button @click="orderDetailOpen = false">关 闭</el-button>
|
||||||
</div>
|
</div>-->
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -386,10 +421,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import { listRecipesPlan, getRecipesPlan, updateRecipesPlan,exportRecipesPlan } from "@/api/custom/recipesPlan";
|
import { listRecipesPlan, getRecipesPlan, updateRecipesPlan,exportRecipesPlan } from "@/api/custom/recipesPlan";
|
||||||
import { getCustomerAndSignByPhone } from "@/api/custom/customer";
|
import { getCustomerAndSignByPhone } from "@/api/custom/customer";
|
||||||
import {getInfoDetail} from "@/api/custom/order";
|
import {getInfoDetail,getOptions} from "@/api/custom/order";
|
||||||
import dayjs from 'dayjs';
|
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;
|
||||||
export default {
|
export default {
|
||||||
name: "recipesPlan",
|
name: "recipesPlan",
|
||||||
data() {
|
data() {
|
||||||
@ -418,7 +455,9 @@
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
customer: null,
|
customer: null,
|
||||||
startDate: null,
|
startDate: null,
|
||||||
endDate: null
|
endDate: null,
|
||||||
|
nutritionistId: null,
|
||||||
|
nutritionistAssisId: null
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
@ -439,18 +478,42 @@
|
|||||||
allRecipesPlanQueryParam: {
|
allRecipesPlanQueryParam: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orderId: null
|
orderId: null,
|
||||||
|
sendFlag: 0
|
||||||
},
|
},
|
||||||
//订单弹窗中列表数据的总条数
|
//订单弹窗中列表数据的总条数
|
||||||
allRecipesPlanTotal: 0,
|
allRecipesPlanTotal: 0,
|
||||||
//订单详情数据
|
//订单详情数据
|
||||||
orderDetailList:[],
|
orderDetailList:[],
|
||||||
//订单详情弹窗
|
//订单详情弹窗
|
||||||
orderDetailOpen:false
|
orderDetailOpen:false,
|
||||||
|
//营养师
|
||||||
|
nutritionistIdOptions:[],
|
||||||
|
//营养师助理
|
||||||
|
nutriAssisIdOptions:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
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();
|
this.getList();
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询食谱计划列表 */
|
/** 查询食谱计划列表 */
|
||||||
@ -490,6 +553,11 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getAllPlanByOrderId(){
|
getAllPlanByOrderId(){
|
||||||
|
//console.log(this.allRecipesPlanQueryParam.sendFlag);
|
||||||
|
//console.log(this.allRecipesPlanQueryParam.sendFlag === "");
|
||||||
|
if(this.allRecipesPlanQueryParam.sendFlag === ""){
|
||||||
|
this.allRecipesPlanQueryParam.sendFlag = null;
|
||||||
|
}
|
||||||
listRecipesPlan(this.allRecipesPlanQueryParam).then(response => {
|
listRecipesPlan(this.allRecipesPlanQueryParam).then(response => {
|
||||||
this.allRecipesPlanList = response.rows;
|
this.allRecipesPlanList = response.rows;
|
||||||
this.allRecipesPlanList.forEach(function(item, index){
|
this.allRecipesPlanList.forEach(function(item, index){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user