合并主分支内容

This commit is contained in:
xiezhijun 2021-03-03 16:19:02 +08:00
commit 4943af635f
28 changed files with 541 additions and 643 deletions

View File

@ -27,7 +27,7 @@ import com.stdiet.common.core.page.TableDataInfo;
* @date 2021-01-07
*/
@RestController
@RequestMapping("/orderPause/pause")
@RequestMapping("/recipes/pause")
public class SysOrderPauseController extends BaseController
{
@Autowired
@ -36,7 +36,7 @@ public class SysOrderPauseController extends BaseController
/**
* 查询订单服务暂停列表
*/
@PreAuthorize("@ss.hasPermi('orderPause:pause:query')")
@PreAuthorize("@ss.hasPermi('recipes:pause:query')")
@GetMapping("/list")
public TableDataInfo list(SysOrderPause sysOrderPause)
{
@ -48,7 +48,7 @@ public class SysOrderPauseController extends BaseController
/**
* 导出订单服务暂停列表
*/
@PreAuthorize("@ss.hasPermi('orderPause:pause:export')")
@PreAuthorize("@ss.hasPermi('recipes:pause:export')")
@Log(title = "订单服务暂停", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SysOrderPause sysOrderPause)
@ -61,7 +61,7 @@ public class SysOrderPauseController extends BaseController
/**
* 获取订单服务暂停详细信息
*/
@PreAuthorize("@ss.hasPermi('orderPause:pause:query')")
@PreAuthorize("@ss.hasPermi('recipes:pause:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
@ -71,7 +71,7 @@ public class SysOrderPauseController extends BaseController
/**
* 新增订单服务暂停
*/
@PreAuthorize("@ss.hasPermi('orderPause:pause:add')")
@PreAuthorize("@ss.hasPermi('recipes:pause:add')")
@Log(title = "订单服务暂停", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SysOrderPause sysOrderPause)
@ -80,13 +80,18 @@ public class SysOrderPauseController extends BaseController
if(count > 0){
return AjaxResult.error("时间范围重叠,请检查时间");
}
long orderId = sysOrderPauseService.selectNearMainOrderIdByCusId(sysOrderPause.getCusId());
if(orderId < 0) {
return AjaxResult.error("找不到对应的订单信息");
}
sysOrderPause.setOrderId(orderId);
return toAjax(sysOrderPauseService.insertSysOrderPause(sysOrderPause));
}
/**
* 修改订单服务暂停
*/
@PreAuthorize("@ss.hasPermi('orderPause:pause:edit')")
@PreAuthorize("@ss.hasPermi('recipes:pause:edit')")
@Log(title = "订单服务暂停", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysOrderPause sysOrderPause)
@ -101,7 +106,7 @@ public class SysOrderPauseController extends BaseController
/**
* 删除订单服务暂停
*/
@PreAuthorize("@ss.hasPermi('orderPause:pause:remove')")
@PreAuthorize("@ss.hasPermi('recipes:pause:remove')")
@Log(title = "订单服务暂停", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)

View File

@ -31,7 +31,7 @@ public class SysRecipesPlanController extends BaseController
/**
* 查询食谱计划列表
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:list')")
@PreAuthorize("@ss.hasPermi('recipes:plan:list')")
@GetMapping("/list")
public TableDataInfo list(SysRecipesPlan sysRecipesPlan)
{
@ -48,7 +48,7 @@ public class SysRecipesPlanController extends BaseController
/**
* 根据订单查询完整食谱计划列表
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:list')")
@PreAuthorize("@ss.hasPermi('recipes:plan:list')")
@GetMapping("/getAllPlanByOrderId")
public TableDataInfo getAllPlanByOrderId(SysRecipesPlan sysRecipesPlan)
{
@ -57,7 +57,7 @@ public class SysRecipesPlanController extends BaseController
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:list')")
@PreAuthorize("@ss.hasPermi('recipes:plan:list')")
@GetMapping(value = "/list/{cusId}")
public AjaxResult getAllPlanByCusId(@PathVariable Long cusId) {
return AjaxResult.success(sysRecipesPlanService.selectPlanListByCusId(cusId));
@ -66,7 +66,7 @@ public class SysRecipesPlanController extends BaseController
/**
* 获取食谱计划详细信息
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:query')")
@PreAuthorize("@ss.hasPermi('recipes:plan:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
@ -76,7 +76,7 @@ public class SysRecipesPlanController extends BaseController
/**
* 修改食谱计划
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:edit')")
@PreAuthorize("@ss.hasPermi('recipes:plan:edit')")
@Log(title = "食谱计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SysRecipesPlan sysRecipesPlan)
@ -87,7 +87,7 @@ public class SysRecipesPlanController extends BaseController
/**
* 导出食谱计划列表
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesPlan:export')")
@PreAuthorize("@ss.hasPermi('recipes:plan:export')")
@Log(title = "食谱计划", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SysRecipesPlan sysRecipesPlan)

View File

@ -26,7 +26,7 @@ public class SysRecipesTemplateController extends BaseController {
/**
* 查询
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:list')")
@PreAuthorize("@ss.hasPermi('recipes:template:list')")
@GetMapping("/list")
public TableDataInfo list(SysRecipesTemplate sysRecipesTemplate) {
startPage();
@ -34,7 +34,7 @@ public class SysRecipesTemplateController extends BaseController {
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:list')")
@PreAuthorize("@ss.hasPermi('recipes:template:list')")
@GetMapping(value = "/{id}")
public AjaxResult detail(@PathVariable Long id) {
return AjaxResult.success(iSysRecipesTemplateService.getRecipesTemplateById(id));
@ -43,7 +43,7 @@ public class SysRecipesTemplateController extends BaseController {
/**
* 添加
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:edit')")
@PreAuthorize("@ss.hasPermi('recipes:template:edit')")
@PostMapping("/add")
public AjaxResult add(@RequestBody SysRecipesTemplate sysRecipesTemplate) {
return toAjax(iSysRecipesTemplateService.insertRecipsesTemplate(sysRecipesTemplate));
@ -52,7 +52,7 @@ public class SysRecipesTemplateController extends BaseController {
/**
* 更新
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:list')")
@PreAuthorize("@ss.hasPermi('recipes:template:list')")
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody SysRecipesTemplate sysRecipesTemplate) {
return toAjax(iSysRecipesTemplateService.updateRecipesTemplate(sysRecipesTemplate));
@ -61,7 +61,7 @@ public class SysRecipesTemplateController extends BaseController {
/**
* 删除
*/
@PreAuthorize("@ss.hasPermi('recipes:recipesTemplate:query')")
@PreAuthorize("@ss.hasPermi('recipes:template:query')")
@DeleteMapping(value = "/delete/{id}")
public AjaxResult delete(@PathVariable("id") Long id) {
return AjaxResult.success(iSysRecipesTemplateService.removeRecipesTemplate(id));

View File

@ -1,11 +1,12 @@
package com.stdiet.custom.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.stdiet.common.annotation.Excel;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.stdiet.common.annotation.Excel;
import com.stdiet.common.core.domain.BaseEntity;
import java.util.Date;
/**
* 订单服务暂停对象 sys_order_pause
@ -13,115 +14,59 @@ import com.stdiet.common.core.domain.BaseEntity;
* @author xzj
* @date 2021-01-07
*/
public class SysOrderPause extends BaseEntity
{
private static final long serialVersionUID = 1L;
@Data
public class SysOrderPause {
/** $column.columnComment */
/**
* $column.columnComment
*/
private Long id;
/** 订单id */
/**
* 订单id
*/
private Long orderId;
/** 服务暂停开始时间 */
private Long cusId;
/**
* 服务暂停开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "服务暂停开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date pauseStartDate;
/** 服务暂停结束时间 */
/**
* 服务暂停结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "服务暂停结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date pauseEndDate;
/** 服务暂停理由 */
/**
* 服务暂停理由
*/
@Excel(name = "服务暂停理由")
private String reason;
/** 备注 */
/**
* 备注
*/
@Excel(name = "备注")
private String remarks;
/** 删除标识 0未删除 1已删除默认0 */
/**
* 删除标识 0未删除 1已删除默认0
*/
private Integer delFlag;
public void setId(Long id)
{
this.id = id;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
public Long getId()
{
return id;
}
public void setOrderId(Long orderId)
{
this.orderId = orderId;
}
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public Long getOrderId()
{
return orderId;
}
public void setPauseStartDate(Date pauseStartDate)
{
this.pauseStartDate = pauseStartDate;
}
private String createBy;
public Date getPauseStartDate()
{
return pauseStartDate;
}
public void setPauseEndDate(Date pauseEndDate)
{
this.pauseEndDate = pauseEndDate;
}
public Date getPauseEndDate()
{
return pauseEndDate;
}
public void setReason(String reason)
{
this.reason = reason;
}
public String getReason()
{
return reason;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public void setDelFlag(Integer delFlag)
{
this.delFlag = delFlag;
}
public Integer getDelFlag()
{
return delFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("orderId", getOrderId())
.append("pauseStartDate", getPauseStartDate())
.append("pauseEndDate", getPauseEndDate())
.append("reason", getReason())
.append("remarks", getRemarks())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("delFlag", getDelFlag())
.toString();
}
private String updateBy;
}

View File

@ -74,6 +74,8 @@ public interface SysOrderPauseMapper
*/
int deletePauseByOrderId(Long[] orderIds);
long selectNearMainOrderIdByCusId(Long cusId);
/**
* 根据订单ID获取暂停计划
* @param orderId

View File

@ -79,4 +79,6 @@ public interface ISysOrderPauseService
* @return
*/
List<SysOrderPause> getPauseListByOrderId(Long orderId);
long selectNearMainOrderIdByCusId(Long cusId);
}

View File

@ -149,4 +149,9 @@ public class SysOrderPauseServiceImpl implements ISysOrderPauseService
public List<SysOrderPause> getPauseListByOrderId(Long orderId){
return sysOrderPauseMapper.getPauseListByOrderId(orderId);
}
@Override
public long selectNearMainOrderIdByCusId(Long cusId) {
return sysOrderPauseMapper.selectNearMainOrderIdByCusId(cusId);
}
}

View File

@ -41,6 +41,7 @@ public class SysRecipesTemplateServiceImpl implements ISysRecipesTemplateService
sysRecipesPlan.setStartNumDay(1);
sysRecipesPlan.setEndNumDay(7);
sysRecipesPlan.setType(1);
sysRecipesPlan.setCusId(0L);
sysRecipesPlanMapper.insertSysRecipesPlan(sysRecipesPlan);
if (!StringUtils.isNull(sysRecipesPlan.getId())) {
sysRecipesTemplate.setCreateBy(SecurityUtils.getUsername());
@ -60,7 +61,15 @@ public class SysRecipesTemplateServiceImpl implements ISysRecipesTemplateService
@Override
public int removeRecipesTemplate(Long id) {
return sysRecipesTemplateMapper.removeRecipesTemplate(id);
SysRecipesTemplate sysRecipesTemplate= sysRecipesTemplateMapper.getRecipesTemplateById(id);
if(StringUtils.isNull(sysRecipesTemplate)) {
return 0;
}
int rows = sysRecipesTemplateMapper.removeRecipesTemplate(sysRecipesTemplate.getId());
if(rows > 0) {
return sysRecipesPlanMapper.deleteSysRecipesPlanById(sysRecipesTemplate.getPlanId());
}
return 0;
}
@Override

View File

@ -44,6 +44,7 @@
<if test="reviewStatus != null and type != ''"> and review_status = #{reviewStatus}</if>
<if test="isMain != null and type != ''"> and is_main = #{isMain}</if>
</where>
order by id desc
</select>
<sql id="selectSysIngreditentsByIdVo">

View File

@ -5,39 +5,41 @@
<mapper namespace="com.stdiet.custom.mapper.SysOrderPauseMapper">
<resultMap type="SysOrderPause" id="SysOrderPauseResult">
<result property="id" column="id" />
<result property="orderId" column="order_id" />
<result property="pauseStartDate" column="pause_start_date" />
<result property="pauseEndDate" column="pause_end_date" />
<result property="reason" column="reason" />
<result property="remarks" column="remarks" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="delFlag" column="del_flag" />
<result property="id" column="id"/>
<result property="orderId" column="order_id"/>
<result property="cusId" column="cus_id"/>
<result property="pauseStartDate" column="pause_start_date"/>
<result property="pauseEndDate" column="pause_end_date"/>
<result property="reason" column="reason"/>
<result property="remarks" column="remarks"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="delFlag" column="del_flag"/>
</resultMap>
<sql id="baseSelectField">
id, order_id, pause_start_date, pause_end_date, reason, remarks, create_time, create_by, update_time, update_by, del_flag
id, order_id, cus_id, pause_start_date, pause_end_date, reason, remarks, create_time, create_by, update_time, update_by, del_flag
</sql>
<sql id="selectSysOrderPauseVo">
select id, order_id, pause_start_date, pause_end_date, reason, remarks, create_time, create_by, update_time, update_by, del_flag from sys_order_pause sop
select id, order_id, cus_id, pause_start_date, pause_end_date, reason, remarks, create_time, create_by, update_time, update_by, del_flag from sys_recipes_pause sop
</sql>
<select id="selectSysOrderPauseList" parameterType="SysOrderPause" resultMap="SysOrderPauseResult">
<!--select sop.id, sop.order_id, sop.pause_start_date, sop.pause_end_date, sop.reason, sop.remarks, sop.create_time, sop.create_by, sop.update_time, sop.update_by, sop.del_flag,
so.customer,so.order_time
from sys_order_pause sop
from sys_recipes_pause sop
left join sys_order so on so.order_id = sop.order_id-->
<include refid="selectSysOrderPauseVo"></include>
where sop.del_flag = 0
<if test="orderId != null "> and sop.order_id = #{orderId}</if>
<if test="pauseStartDate != null "> and sop.pause_start_date = #{pauseStartDate}</if>
<if test="pauseEndDate != null "> and sop.pause_end_date = #{pauseEndDate}</if>
<if test="reason != null and reason != ''"> and sop.reason = #{reason}</if>
<if test="remarks != null and remarks != ''"> and sop.remarks = #{remarks}</if>
<if test="orderId != null ">and sop.order_id = #{orderId}</if>
<if test="cusId != null ">and sop.cus_id = #{cusId}</if>
<if test="pauseStartDate != null ">and sop.pause_start_date = #{pauseStartDate}</if>
<if test="pauseEndDate != null ">and sop.pause_end_date = #{pauseEndDate}</if>
<if test="reason != null and reason != ''">and sop.reason = #{reason}</if>
<if test="remarks != null and remarks != ''">and sop.remarks = #{remarks}</if>
</select>
<select id="selectSysOrderPauseById" parameterType="Long" resultMap="SysOrderPauseResult">
@ -46,9 +48,10 @@
</select>
<insert id="insertSysOrderPause" parameterType="SysOrderPause" useGeneratedKeys="true" keyProperty="id">
insert into sys_order_pause
insert into sys_recipes_pause
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">order_id,</if>
<if test="cusId != null">cus_id,</if>
<if test="pauseStartDate != null">pause_start_date,</if>
<if test="pauseEndDate != null">pause_end_date,</if>
<if test="reason != null">reason,</if>
@ -61,6 +64,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
<if test="cusId != null">#{cusId},</if>
<if test="pauseStartDate != null">#{pauseStartDate},</if>
<if test="pauseEndDate != null">#{pauseEndDate},</if>
<if test="reason != null">#{reason},</if>
@ -74,9 +78,10 @@
</insert>
<update id="updateSysOrderPause" parameterType="SysOrderPause">
update sys_order_pause
update sys_recipes_pause
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if>
<if test="cusId != null">cus_id = #{cusId},</if>
<if test="pauseStartDate != null">pause_start_date = #{pauseStartDate},</if>
<if test="pauseEndDate != null">pause_end_date = #{pauseEndDate},</if>
<if test="reason != null">reason = #{reason},</if>
@ -91,11 +96,11 @@
</update>
<update id="deleteSysOrderPauseById" parameterType="Long">
update sys_order_pause set del_flag = 1 where id = #{id}
update sys_recipes_pause set del_flag = 1 where id = #{id}
</update>
<update id="deleteSysOrderPauseByIds" parameterType="String">
update sys_order_pause set del_flag = 1 where id in
update sys_recipes_pause set del_flag = 1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
@ -103,7 +108,7 @@
<!-- 根据订单ID、时间范围查询数量 -->
<select id="getCountByOrderIdAndPauseDate" parameterType="SysOrderPause" resultType="int">
select count(id) from sys_order_pause where del_flag = 0 and order_id = #{orderId}
select count(id) from sys_recipes_pause where del_flag = 0 and order_id = #{orderId}
AND (#{pauseStartDate} >= pause_start_date AND pause_end_date >= #{pauseStartDate}
OR #{pauseEndDate} >= pause_start_date AND pause_end_date >= #{pauseEndDate})
<if test="id != null">
@ -114,12 +119,20 @@
<!-- 根据订单ID删除暂停记录 -->
<update id="deletePauseByOrderId" parameterType="String">
update sys_order_pause set del_flag = 1 where order_id in
update sys_recipes_pause set del_flag = 1 where order_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{orderId}
</foreach>
</update>
<select id="selectNearMainOrderIdByCusId" parameterType="Long" resultType="Long">
SELECT order_id
FROM sys_order
WHERE cus_id=#{cusId} AND del_flag = 0 AND order_type IN(0, 1) AND after_sale_commiss_order = 0
AND order_money_type IN(0, 2) AND main_order_id=0 AND server_end_time > NOW()
ORDER BY server_end_time ASC LIMIT 1
</select>
<!-- 根据订单ID获取暂停记录根据暂停开始时间排序用于生成食谱计划不能随意修改排序方式 -->
<select id="getPauseListByOrderId" parameterType="Long" resultMap="SysOrderPauseResult">
<include refid="selectSysOrderPauseVo"></include>

View File

@ -217,7 +217,7 @@
<!-- 根据cusId查询食谱计划-->
<select id="selectPlanListByCusId" parameterType="Long" resultMap="SysRecipesPlanResult">
select id, out_id, start_date, end_date, start_num_day, end_num_day, recipes_id, review_status from sys_recipes_plan
where cus_id=#{cusId} and del_flag = 0 order by id desc
where cus_id=#{cusId} and del_flag = 0 order by id asc
</select>
<select id="getCusIdByOutId" parameterType="String" resultType="Long">

View File

@ -2,7 +2,7 @@ import request from "@/utils/request";
export function addRecipesApi(data) {
return request({
url: "/custom/recipes/",
url: "/custom/recipes",
method: "post",
data
});

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询订单服务暂停列表
export function listPause(query) {
return request({
url: '/orderPause/pause/list',
url: '/recipes/pause/list',
method: 'get',
params: query
})
@ -12,7 +12,7 @@ export function listPause(query) {
// 查询订单服务暂停详细
export function getPause(id) {
return request({
url: '/orderPause/pause/' + id,
url: '/recipes/pause/' + id,
method: 'get'
})
}
@ -20,7 +20,7 @@ export function getPause(id) {
// 新增订单服务暂停
export function addPause(data) {
return request({
url: '/orderPause/pause',
url: '/recipes/pause',
method: 'post',
data: data
})
@ -29,7 +29,7 @@ export function addPause(data) {
// 修改订单服务暂停
export function updatePause(data) {
return request({
url: '/orderPause/pause',
url: '/recipes/pause',
method: 'put',
data: data
})
@ -38,7 +38,7 @@ export function updatePause(data) {
// 删除订单服务暂停
export function delPause(id) {
return request({
url: '/orderPause/pause/' + id,
url: '/recipes/pause/' + id,
method: 'delete'
})
}
@ -46,7 +46,7 @@ export function delPause(id) {
// 导出订单服务暂停
export function exportPause(query) {
return request({
url: '/orderPause/pause/export',
url: '/recipes/pause/export',
method: 'get',
params: query
})

View File

@ -0,0 +1,367 @@
<template>
<el-drawer
:title="drawerTitle"
:append-to-body="true"
:close-on-press-escape="false"
:visible.sync="visible"
size="35%"
>
<div class="plan_pause_drawer_wrapper">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['orderPause:pause:add']"
>新增</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['orderPause:pause:export']"
>导出</el-button
>
</el-col>
</el-row>
<el-table v-loading="loading" :data="pauseList" height="80%">
<el-table-column label="时间" align="center" width="120">
<template slot-scope="scope">
<div>
{{ scope.row.pauseStartDate }}
</div>
<div>
{{ scope.row.pauseEndDate }}
</div>
</template>
</el-table-column>
<el-table-column label="暂停理由" align="center" prop="reason">
<template slot-scope="scope">
<el-popover
v-if="scope.row.reason != null && scope.row.reason.length > 10"
placement="top"
title="事由"
width="200"
trigger="hover"
:content="scope.row.reason"
>
<el-button slot="reference" type="text">详情 </el-button>
</el-popover>
<span v-else>{{ scope.row.reason }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remarks">
<template slot-scope="scope">
<el-popover
v-if="scope.row.remarks != null && scope.row.remarks.length > 10"
placement="top"
title="备注"
width="200"
trigger="hover"
:content="scope.row.remarks"
>
<el-button slot="reference" type="text">详情 </el-button>
</el-popover>
<span v-else>{{ scope.row.remarks }}</span>
</template>
</el-table-column>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
width="120"
>
<template slot-scope="scope">
<div v-for="str in scope.row.createTime.split(' ')" :key="str">
{{ str }}
</div>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="120"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['orderPause:pause:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['orderPause:pause:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
layout="total, slot, prev, pager, next, jumper"
/>
<!-- 添加或修改订单服务暂停对话框 -->
<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-item label="时间范围" prop="dateScope">
<el-date-picker
v-model="dateScope"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
:picker-options="orderPickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="事由" prop="reason">
<el-input
type="textarea"
placeholder="请输入暂停事由"
v-model="form.reason"
maxlength="200"
show-word-limit
rows="5"
></el-input>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input
type="textarea"
placeholder="请输入备注"
v-model="form.remarks"
maxlength="200"
show-word-limit
rows="5"
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</el-drawer>
</template>
<script>
import {
listPause,
getPause,
delPause,
addPause,
updatePause,
exportPause,
} from "@/api/custom/recipesPause";
import dayjs from "dayjs";
const beginTime = dayjs().startOf("month").format("YYYY-MM-DD");
const endTime = dayjs().format("YYYY-MM-DD");
export default {
name: "Pause",
data() {
const checkcDateScope = (rule, value, callback) => {
if (
this.dateScope == null ||
this.dateScope == undefined ||
this.dateScope.length == 0
) {
return callback(new Error("日期范围不能为空"));
}
callback();
};
return {
//
loading: true,
drawerTitle: "",
//
visible: false,
data: undefined,
//
total: 0,
//
pauseList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
cusId: undefined,
},
//
form: {},
dateScope: [beginTime, endTime],
//
rules: {
dateScope: [
{ required: true, trigger: "blur", validator: checkcDateScope },
],
reason: [
{ required: true, message: "暂停理由不能为空", trigger: "blur" },
],
},
orderPickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
},
},
};
},
methods: {
/** 查询订单服务暂停列表 */
getList() {
this.loading = true;
listPause(this.queryParams).then((response) => {
this.pauseList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
pauseStartDate: null,
pauseEndDate: null,
reason: null,
remarks: null,
};
this.resetForm("form");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.dateScope = [];
this.open = true;
this.title = "添加暂停记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
getPause(row.id).then((response) => {
this.form = response.data;
this.dateScope = [];
this.dateScope[0] = this.form.pauseStartDate;
this.dateScope[1] = this.form.pauseEndDate;
this.open = true;
this.title = "修改暂停记录";
});
},
showDrawer(data) {
// console.log(data);
if (!data) {
return;
}
this.data = data;
this.visible = true;
this.drawerTitle = `${this.data.name}」暂停记录`;
this.queryParams.cusId = this.data.id;
this.getList();
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.pauseStartDate = this.dateScope[0];
this.form.pauseEndDate = this.dateScope[1];
this.form.cusId = this.data.id;
if (this.form.id != null) {
updatePause(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addPause(this.form).then((response) => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$confirm('是否确认删除暂停编号为"' + row.id + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return delPause(row.id);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有暂停记录数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return exportPause(queryParams);
})
.then((response) => {
this.download(response.msg);
})
.catch(function () {});
},
},
};
</script>
<style lang="scss" scoped>
.plan_pause_drawer_wrapper {
padding: 20px;
height: calc(100vh - 77px);
overflow: auto;
}
</style>

View File

@ -4,7 +4,7 @@
:close-on-press-escape="false"
:visible.sync="visible"
@closed="handleOnClosed"
size="40%"
size="45%"
>
<div class="app-container recipes_plan_drawer_wrapper">
<el-row :gutter="10" class="mb8">
@ -26,7 +26,7 @@
</el-col>
</el-row>
<el-table :data="planList" v-loading="planLoading" height="90%">
<el-table :data="planList" v-loading="planLoading" height="80%">
<el-table-column label="审核状态" align="center" width="80">
<template slot-scope="scope">
<el-tag :type="scope.row.reviewStatus ? 'success' : 'danger'">{{
@ -60,41 +60,23 @@
</el-table>
<!-- 暂停记录抽屉 -->
<el-drawer
:title="innerTitle"
:append-to-body="true"
:close-on-press-escape="false"
:visible.sync="innerVisible"
@closed="handleOnInnerClosed"
>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleInnerOpen"
>增加暂停记录
</el-button>
</el-col>
</el-row>
</div>
</el-drawer>
<PlanPauseDrawer ref="planPauseRef" />
</div>
</el-drawer>
</template>
<script>
import Clipboard from "clipboard";
import { listRecipesPlanByCusId } from "@/api/custom/recipesPlan";
import PlanPauseDrawer from "./PlanPauseDrawer";
export default {
name: "RecipesPlanDrawer",
components: {
PlanPauseDrawer,
},
data() {
return {
visible: false,
innerVisible: false,
title: "",
innerTitle: "",
cusOutId: "",
copyValue: "",
planLoading: false,
@ -119,7 +101,7 @@ export default {
}
return str;
}, "");
console.log(this.planList);
// console.log(this.planList);
this.planLoading = false;
});
},
@ -128,6 +110,7 @@ export default {
this.cusOutId = "";
},
handleInnerOpen() {
this.$refs["planPauseRef"].showDrawer(this.data);
this.innerVisible = true;
this.innerTitle = `${this.data.name}」暂停记录`;
},
@ -142,7 +125,6 @@ export default {
type: "success",
});
},
handleOnInnerClosed() {},
handleOnRecipesEditClick(data) {
// console.log(data);
const { id, name } = this.data;

View File

@ -71,20 +71,6 @@ export const constantRoutes = [
}
]
},
{
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,

View File

@ -34,7 +34,7 @@ const oriState = {
const mutations = {
updateRecipesDishesDetail(state, payload) {
const tarDishes = state.recipesData[payload.num].dishes.find(
obj => obj.dishesId === payload.dishesId
obj => obj.id === payload.id
);
if (tarDishes) {
const tarIgd = tarDishes.igdList.find(obj => obj.id === payload.igdId);
@ -95,7 +95,6 @@ const actions = {
startNum: startNumDay,
endNum: endNumDay
});
getDicts("cus_cus_unit").then(response => {
commit("updateStateData", { cusUnitOptions: response.data });
});
@ -260,15 +259,20 @@ const actions = {
dispatch("getRecipesInfo", { recipesId });
payload.callback &&
payload.callback({
recipesId: result.data,
name: state.healthyData.name,
cusId: state.cusId,
planId: state.planId
});
}
// console.log(params);
},
async addDishes({ commit, state }, payload) {
const tarDishesList = state.recipesData[payload.num].dishes.filter(
obj => obj.type === payload.type
);
if (tarDishesList.some(obj => obj.dishesId === payload.dishesId)) {
console.log("目标餐类已有相同的菜品");
throw new Error("目标餐类已有相同的菜品");
}
if (state.recipesId) {
const tarRecipesObj = state.recipesData[payload.num];
if (tarRecipesObj && payload.data) {
@ -301,7 +305,7 @@ const actions = {
// console.log(payload);
if (state.recipesId) {
const tarDishes = state.recipesData[payload.num].dishes.find(
obj => obj.dishesId === payload.dishesId
obj => obj.id === payload.id
);
if (tarDishes) {
const mTarDishes = JSON.parse(JSON.stringify(tarDishes));

View File

@ -208,7 +208,7 @@
<el-table-column
label="食谱计划"
align="center"
v-hasPermi="['recipes:recipesPlan:list']"
v-hasPermi="['recipes:plan:list']"
>
<template slot-scope="scope">
<el-button

View File

@ -191,7 +191,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否主食" prop="type">
<el-form-item label="是否主食" prop="isMain">
<el-radio-group v-model="form.isMain">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
@ -296,8 +296,6 @@
</el-table-column>
<el-table-column prop="carbonRatio" label="碳水/100g">
</el-table-column>
<!-- <el-table-column prop="remark" label="备注">
</el-table-column> -->
</el-table>
</el-form-item>
</el-col>
@ -525,7 +523,7 @@ export default {
updateBy: null,
updateTime: null,
igdList: [],
isMain: 0,
isMain: 1,
};
this.selIngIds = [];
this.selIngList = [];

View File

@ -407,14 +407,14 @@
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
<!-- <el-button
size="mini"
type="text"
icon="el-icon-s-data"
@click="orderPauseManage(scope.row)"
v-hasPermi="['orderPause:pause:query']"
>暂停记录管理
</el-button>
</el-button> -->
<el-button
size="mini"
v-if="
@ -445,22 +445,6 @@
>
</pagination>
<!-- 暂停记录管理 -->
<el-dialog
:title="pauseTitle"
v-if="openPause"
:visible.sync="openPause"
width="900px"
append-to-body
>
<span style="color: #e6a23c; font-family: PingFang SC">
注意事项
<br />1日期包含当天2021-01-01到2021-01-07总共暂停七天2021-01-08继续服务
<br />2每条暂停记录的时间范围不能重叠</span
>
<orderPause v-bind:orderPauseId="orderPauseId"></orderPause>
</el-dialog>
<!-- 订单详情 -->
<order-detail ref="orderDetailRef" />
<!-- 订单修改 -->
@ -471,7 +455,6 @@
<script>
import { delOrder, exportOrder, listOrder } from "@/api/custom/order";
import dayjs from "dayjs";
import orderPause from "./orderPause";
import * as orderTypeData from "@/utils/orderType";
import OrderDetail from "@/components/OrderDetail";
import OrderEdit from "@/components/OrderEdit";
@ -486,7 +469,6 @@ const endTime = dayjs().format("YYYY-MM-DD");
export default {
name: "Order",
components: {
orderPause,
"auto-hide-message": AutoHideMessage,
"order-detail": OrderDetail,
"order-edit": OrderEdit,

View File

@ -1,415 +0,0 @@
<template>
<div class="app-container">
<!--<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="订单id" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入订单id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createDate" label-width="120px">
<el-date-picker
v-model="queryParams.createDate"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<!--<el-form-item label="服务暂停理由" prop="reason">
<el-input
v-model="queryParams.reason"
placeholder="请输入服务暂停理由"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input
v-model="queryParams.remarks"
placeholder="请输入备注"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['orderPause:pause:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['orderPause:pause:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['orderPause:pause:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['orderPause:pause:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="pauseList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="订单成交时间" align="center" prop="orderTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="客户姓名" align="center" prop="customer" />-->
<el-table-column label="暂停开始日期" align="center" prop="pauseStartDate" width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.pauseStartDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="暂停结束日期" align="center" prop="pauseEndDate" width="120">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.pauseEndDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="暂停理由" align="center" prop="reason">
<template slot-scope="scope">
<el-button v-show="scope.row.reason != null && scope.row.reason.length > 10" type="text" @click="openFormDialog('暂停理由', scope.row.reason)">点击查看</el-button>
<span v-show="scope.row.reason == null || scope.row.reason.length <= 10">{{scope.row.reason}}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remarks">
<template slot-scope="scope">
<el-button v-show="scope.row.remarks != null && scope.row.remarks.length > 10" type="text" @click="openFormDialog('备注', scope.row.remarks)">点击查看</el-button>
<span v-show="scope.row.remarks == null || scope.row.remarks.length <= 10">{{scope.row.remarks}}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['orderPause:pause:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['orderPause:pause:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:page-sizes="[5,10]"
@pagination="getList"
/>
<el-dialog :title="formDialog.title" :visible.sync="formDialog.show" width="30%" append-to-body center>
<span>{{formDialog.content}}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="formDialog.show = false"> </el-button>
<!--<el-button type="primary" @click="experience_dialog = false"> </el-button>-->
</span>
</el-dialog>
<!-- 添加或修改订单服务暂停对话框 -->
<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-item label="订单id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入订单id" />
</el-form-item>-->
<el-form-item label="暂停日期范围" prop="dateScope" label-width="120px">
<el-date-picker
v-model="dateScope"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
<!--<el-date-picker clearable size="small" style="width: 200px"
v-model="form.pauseStartDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择服务暂停开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="暂停结束时间" prop="pauseEndDate">
<el-date-picker clearable size="small" style="width: 200px"
v-model="form.pauseEndDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择服务暂停结束时间">
</el-date-picker>-->
</el-form-item>
<el-form-item label="暂停理由" prop="reason" label-width="120px">
<el-input type="textarea" placeholder="请输入暂停理由" v-model="form.reason" maxlength="200" show-word-limit rows="5"></el-input>
<!--<el-input v-model="form.reason" placeholder="请输入暂停理由" />-->
</el-form-item>
<el-form-item label="备注" prop="remarks" label-width="120px">
<el-input type="textarea" placeholder="请输入备注" v-model="form.remarks" maxlength="200" show-word-limit rows="5"></el-input>
<!--<el-input v-model="form.remarks" placeholder="请输入备注" />-->
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listPause, getPause, delPause, addPause, updatePause, exportPause } from "@/api/custom/orderPause";
import dayjs from 'dayjs';
const beginTime = dayjs().startOf('month').format('YYYY-MM-DD');
const endTime = dayjs().format('YYYY-MM-DD');
export default {
name: "Pause",
data() {
const checkcDateScope = (rule, value, callback) => {
if (this.dateScope == null || this.dateScope == undefined || this.dateScope.length == 0) {
return callback(new Error('日期范围不能为空'))
}
callback();
}
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
pauseList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 5,
orderId: null,
createDate: null,
pauseEndDate: null
//reason: null,
//remarks: null,
},
orderId: null,
//
form: {
},
dateScope:[beginTime, endTime],
//
rules: {
dateScope: [
{required: true, trigger: "blur", validator: checkcDateScope}
],
reason: [
{required: true, message: "暂停理由不能为空", trigger: "blur"}
]
},
//
formDialog:{
title: "",
show: false,
content: ""
}
};
},
props: {
orderPauseId: {
type: Number,
default: 0
},
},
created() {
this.getList();
},
mounted() {
this.orderId = this.orderPauseId;
this.queryParams.orderId = this.orderPauseId;
},
methods: {
/** 查询订单服务暂停列表 */
getList() {
this.loading = true;
listPause(this.queryParams).then(response => {
this.pauseList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
orderId: null,
pauseStartDate: null,
pauseEndDate: null,
reason: null,
remarks: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
// console.log(this.queryParams.pauseStartDate);
//this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.dateScope = [];
this.open = true;
this.title = "添加暂停记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getPause(id).then(response => {
this.form = response.data;
this.dateScope = [];
this.dateScope[0] = this.form.pauseStartDate;
this.dateScope[1] = this.form.pauseEndDate;
this.open = true;
this.title = "修改暂停记录";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.pauseStartDate = dayjs(this.dateScope[0]).format("YYYY-MM-DD");
this.form.pauseEndDate = dayjs(this.dateScope[1]).format("YYYY-MM-DD");
// console.log(this.form.pauseStartDate + "-" + this.form.pauseEndDate);
if (this.form.id != null) {
updatePause(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
this.form.orderId = this.orderId;
addPause(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除订单服务暂停编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delPause(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function() {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有订单服务暂停数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportPause(queryParams);
}).then(response => {
this.download(response.msg);
}).catch(function() {});
},
openFormDialog(title, content){
this.formDialog.title = title;
this.formDialog.content = content;
this.formDialog.show = true;
}
}
};
</script>

View File

@ -12,7 +12,7 @@
trigger="click"
title="修改审核状态"
style="margin-right: 12px"
v-hasPermi="['recipes:recipesPlan:review']"
v-hasPermi="['recipes:plan:review']"
>
<div>
<el-button size="mini" type="success" @click="hanldeOnReveiwChange(2)"
@ -72,7 +72,9 @@
import BarChart from "./BarChart";
import PieChart from "./PieChart";
import { createNamespacedHelpers } from "vuex";
const { mapActions, mapState } = createNamespacedHelpers("recipes");
const { mapActions, mapState, mapMutations } = createNamespacedHelpers(
"recipes"
);
export default {
name: "RecipesAspectCom",
components: {
@ -96,8 +98,10 @@ export default {
handleOnSave() {
this.saveRecipes({
callback: (query) => {
console.log(query);
this.$router.replace({ path: "/recipes/build", query });
// console.log(query);
this.$router.replace({
path: "/recipes/build/" + query.name + "/" + query.planId,
});
},
});
},
@ -105,9 +109,10 @@ export default {
this.updateReviewStatus({ reviewStatus });
},
handleOnBack() {
this.updateReviewStatus({ recipesData: [] });
this.updateStateData({ recipesData: [] });
},
...mapActions(["saveRecipes", "updateReviewStatus"]),
...mapMutations(["updateStateData"]),
},
};
</script>

View File

@ -99,9 +99,7 @@ export default {
if (idx === 0) {
this.selDishes.type = cur;
}
const tarOpt = this.typeOptions.find(
(obj) => obj.dictValue === cur
);
const tarOpt = this.typeOptions.find((obj) => obj.dictValue === cur);
if (tarOpt) {
arr.push(tarOpt);
}
@ -134,7 +132,7 @@ export default {
igdList,
} = this.selDishes;
this.$emit("onConfirm", {
id: -1,
id: new Date().getTime(),
dishesId: id,
methods,
name,

View File

@ -9,6 +9,7 @@
:step="5"
:value="value"
@blur="handleOnBlur"
@keyup.enter="handleEnterClick"
/>
</div>
</template>
@ -34,7 +35,7 @@ export default {
const { value } = e.target;
if (value > 0) {
this.editing = false;
const mValue = parseFloat(value)
const mValue = parseFloat(value);
if (mValue !== parseFloat(this.value)) {
this.$emit("onChange", mValue);
}
@ -42,6 +43,9 @@ export default {
this.$message.error("数字必须大于0");
}
},
handleEnterClick(e) {
e.target.blur();
},
},
};
</script>

View File

@ -327,9 +327,10 @@ export default {
this.deleteDishes({ num: this.num, id: data.id });
},
handleOnWeightChange(data, weight) {
console.log({ data, weight });
// console.log({ data, weight });
this.updateDishes({
num: this.num,
id: data.id,
dishesId: data.dishesId,
igdId: data.igdId,
weight,
@ -339,6 +340,7 @@ export default {
// console.log({ data, cusWeight, cusUnit });
this.updateDishes({
num: this.num,
id: data.id,
dishesId: data.dishesId,
igdId: data.igdId,
cusWeight,
@ -350,6 +352,8 @@ export default {
this.addDishes({
num: this.num,
data,
}).catch((err) => {
this.$message.error(err.message);
});
},
...mapActions(["updateDishes", "addDishes", "deleteDishes"]),

View File

@ -95,7 +95,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['recipes:recipesPlan:export']"
v-hasPermi="['recipes:plan:export']"
>导出
</el-button>
</el-col>
@ -164,7 +164,7 @@
<el-button
size="mini"
type="text"
v-hasPermi="['recipes:recipesPlan:edit']"
v-hasPermi="['recipes:plan:edit']"
:icon="`${
scope.row.recipesId ? 'el-icon-edit' : 'el-icon-edit-outline'
}`"

View File

@ -152,7 +152,7 @@
<el-button
size="mini"
type="text"
v-hasPermi="['recipes:recipesTemplate:edit']"
v-hasPermi="['recipes:template:edit']"
:icon="`${
scope.row.recipesId ? 'el-icon-edit' : 'el-icon-edit-outline'
}`"
@ -430,6 +430,7 @@ export default {
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.cusId = 0;
if (this.form.id != null) {
updateRecipesTemplate(this.form).then((response) => {
if (response.code === 200) {

View File

@ -34,7 +34,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8091`,
target: `http://localhost:8090`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''