瀏覽代碼

积分兑换限时预定活动功能 - 功能补全

xianwait 2 年之前
父節點
當前提交
fddabf9362
共有 20 個文件被更改,包括 1164 次插入45 次删除
  1. 16 16
      willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsGiftOrderController.java
  2. 44 0
      willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGift.java
  3. 22 18
      willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGiftOrder.java
  4. 42 0
      willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGiftOrderDetail.java
  5. 13 0
      willalp-canteen/src/main/java/com/willalp/canteen/domain/resp/OrderResp.java
  6. 6 1
      willalp-canteen/src/main/java/com/willalp/canteen/domain/vo/UserShopCarJsonDoMainVo.java
  7. 9 0
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/HsGiftMapper.java
  8. 42 1
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftMapper.xml
  9. 5 0
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftOrderDetailMapper.xml
  10. 2 0
      willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftOrderMapper.xml
  11. 8 4
      willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftServiceImpl.java
  12. 10 0
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventMapper.java
  13. 13 1
      willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventMapper.xml
  14. 7 0
      willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventService.java
  15. 5 0
      willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventServiceImpl.java
  16. 53 0
      willalp-ui/src/api/canteen/giftDetail.js
  17. 121 0
      willalp-ui/src/api/canteen/giftOrder.js
  18. 3 4
      willalp-ui/src/views/canteen/gift/index.vue
  19. 253 0
      willalp-ui/src/views/canteen/gift/order/detail/index.vue
  20. 490 0
      willalp-ui/src/views/canteen/gift/order/index.vue

+ 16 - 16
willalp-admin/src/main/java/com/willalp/web/controller/canteen/HsGiftOrderController.java

@@ -22,7 +22,7 @@ import java.util.*;
 import java.util.stream.Collectors;
 
 /**
- * 食堂订单Controller
+ * 礼品订单Controller
  *
  * @author songyu
  * @date 2021-12-03
@@ -37,7 +37,7 @@ public class HsGiftOrderController extends BaseController {
     private IHsOrderProcessService orderProcessService;
 
     /**
-     * 查询食堂订单列表
+     * 查询礼品订单列表
      */
     @GetMapping("/list")
     public TableDataInfo list(HsGiftOrder hsGiftOrder) {
@@ -73,18 +73,18 @@ public class HsGiftOrderController extends BaseController {
     }
 
     /**
-     * 导出食堂订单列表
+     * 导出礼品订单列表
      */
-    @Log(title = "食堂订单", businessType = BusinessType.EXPORT)
+    @Log(title = "礼品订单", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(HsGiftOrder hsGiftOrder) {
         List<HsGiftOrder> list = hsCanteenOrderService.selectHsCanteenOrderList(hsGiftOrder);
         ExcelUtil<HsGiftOrder> util = new ExcelUtil<HsGiftOrder>(HsGiftOrder.class);
-        return util.exportExcel(list, "食堂订单数据");
+        return util.exportExcel(list, "礼品订单数据");
     }
 
     /**
-     * 获取食堂订单详细信息
+     * 获取礼品订单详细信息
      */
     @GetMapping(value = "/{orderId}")
     public AjaxResult getInfo(@PathVariable("orderId") String orderId) {
@@ -92,9 +92,9 @@ public class HsGiftOrderController extends BaseController {
     }
 
     /**
-     * 新增食堂订单
+     * 新增礼品订单
      */
-    @Log(title = "食堂订单", businessType = BusinessType.INSERT)
+    @Log(title = "礼品订单", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody HsGiftOrder hsGiftOrder) {
         while (true) {
@@ -109,9 +109,9 @@ public class HsGiftOrderController extends BaseController {
     }
 
     /**
-     * 修改食堂订单
+     * 修改礼品订单
      */
-    @Log(title = "食堂订单", businessType = BusinessType.UPDATE)
+    @Log(title = "礼品订单", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody HsGiftOrder hsGiftOrder) {
         HsGiftOrder byId = hsCanteenOrderService.getById(hsGiftOrder.getOrderId());
@@ -120,9 +120,9 @@ public class HsGiftOrderController extends BaseController {
     }
 
     /**
-     * 因错退还食堂订单
+     * 因错退还礼品订单
      */
-    @Log(title = "食堂订单因错退还", businessType = BusinessType.UPDATE)
+    @Log(title = "礼品订单因错退还", businessType = BusinessType.UPDATE)
     @RequestMapping("/partback")
     @PostMapping
     public AjaxResult partback(@RequestBody HsGiftOrder hsGiftOrder) {
@@ -144,16 +144,16 @@ public class HsGiftOrderController extends BaseController {
 
 
     /**
-     * 删除食堂订单
+     * 删除礼品订单
      */
-    @Log(title = "食堂订单", businessType = BusinessType.DELETE)
+    @Log(title = "礼品订单", businessType = BusinessType.DELETE)
     @DeleteMapping("/{orderIds}")
     public AjaxResult remove(@PathVariable String[] orderIds) {
         return toAjax(hsCanteenOrderService.removeByIds(Arrays.asList(orderIds)));
     }
 
     /**
-     * 作废食堂订单
+     * 作废礼品订单
      */
     @RequestMapping("/back")
     @ResponseBody
@@ -162,7 +162,7 @@ public class HsGiftOrderController extends BaseController {
     }
 
     /**
-     * 查询每日食堂订单量
+     * 查询每日礼品订单量
      */
     @GetMapping("/lists")
     public Map lists(HsGiftOrder hsGiftOrder) {

+ 44 - 0
willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGift.java

@@ -4,12 +4,15 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.willalp.common.annotation.Excel;
 import com.willalp.common.core.domain.BaseEntity;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * 礼品登记对象 hs_gift
@@ -75,6 +78,23 @@ public class HsGift extends BaseEntity {
     @TableField(exist = false)
     private Integer num;
 
+    /** 事件ID */
+    @TableField(exist = false)
+    @Excel(name = "事件ID")
+    private String eventId;
+
+    /** 事件名称 */
+    @TableField(exist = false)
+    @Excel(name = "事件名称")
+    private String eventName;
+
+    /** 事件时间 */
+    @TableField(exist = false)
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @Excel(name = "事件时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
+    private Date eventTime;
+
     /**
      * 启用标志 0-启用 1-禁用
      */
@@ -93,6 +113,30 @@ public class HsGift extends BaseEntity {
     @TableLogic
     private Integer isDelete;
 
+    public String getEventId() {
+        return eventId;
+    }
+
+    public void setEventId(String eventId) {
+        this.eventId = eventId;
+    }
+
+    public String getEventName() {
+        return eventName;
+    }
+
+    public void setEventName(String eventName) {
+        this.eventName = eventName;
+    }
+
+    public Date getEventTime() {
+        return eventTime;
+    }
+
+    public void setEventTime(Date eventTime) {
+        this.eventTime = eventTime;
+    }
+
     public void setGiftId(String giftId) {
         this.giftId = giftId;
     }

+ 22 - 18
willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGiftOrder.java

@@ -35,17 +35,22 @@ public class HsGiftOrder {
     @Excel(name = "订单编号")
     private String orderNumber;
 
+    /**
+     * 用户编号
+     */
+    @Excel(name = "用户编号")
+    private String userNumber;
+
+
+    @Excel(name = "账户名称")
+    private String userName;
+
     /**
      * 手机号
      */
     @Excel(name = "手机号")
     private String phone;
 
-    /**
-     * 用户编号
-     */
-    @Excel(name = "用户编号")
-    private String userNumber;
 
 
     /**
@@ -57,37 +62,34 @@ public class HsGiftOrder {
     /**
      * 设备编号
      */
-    @Excel(name = "设备编号")
     private String deviceNumber;
 
     /**
      * 设备名称
      */
-    @Excel(name = "设备名称")
     private String deviceName;
 
+    @TableField(exist = false)
+    private String eventId;
 
     /**
      * 付款时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @Excel(name = "付款时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "付款时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date paytime;
 
     /**
      * 接单时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @Excel(name = "接单时间", width = 30, dateFormat = "yyyy-MM-dd")
     private Date zfsj;
 
     /**
      * 是否接单
      */
-    @Excel(name = "是否接单")
     private Integer zfbz;
 
-    @Excel(name = "机构代码")
     private String jgid;
 
     /**
@@ -115,20 +117,15 @@ public class HsGiftOrder {
     @TableLogic
     private Integer isDelete;
 
-    @Excel(name = "账户名称")
-    private String userName;
-
-
     /**
      * 0消费 1记账
      */
-    @Excel(name = "是否消费")
     private Integer consumeSign;
 
     @TableField(exist = false)
     private Integer patternId;
 
-    @Excel(name = "发货地址")
+    @Excel(name = "领取地点")
     private String placeNumber;
 
     @TableField(exist = false)
@@ -150,6 +147,14 @@ public class HsGiftOrder {
     @TableField(exist = false)
     private Map<String, Object> params;
 
+    public String getEventId() {
+        return eventId;
+    }
+
+    public void setEventId(String eventId) {
+        this.eventId = eventId;
+    }
+
     public String getRemark() {
         return remark;
     }
@@ -158,7 +163,6 @@ public class HsGiftOrder {
         this.remark = remark;
     }
 
-
     public String getPhone() {
         return phone;
     }

+ 42 - 0
willalp-canteen/src/main/java/com/willalp/canteen/domain/HsGiftOrderDetail.java

@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.willalp.common.annotation.Excel;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 /**
  * 食堂订单明细对象 hs_canteen_order_detail
@@ -97,12 +100,51 @@ public class HsGiftOrderDetail {
     @TableField(exist = false)
     private String cuisinePictrue;
 
+    /** 事件ID */
+    private String eventId;
+
+    /** 事件名称 */
+    @TableField(exist = false)
+    @Excel(name = "事件名称")
+    private String eventName;
+
+    /** 事件时间 */
+    @TableField(exist = false)
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @Excel(name = "事件时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
+    private Date eventTime;
+
     /**
      * 是否删除(0.未删除;1.已删除)
      */
     @TableLogic
     private Integer isDelete;
 
+    public String getEventId() {
+        return eventId;
+    }
+
+    public void setEventId(String eventId) {
+        this.eventId = eventId;
+    }
+
+    public String getEventName() {
+        return eventName;
+    }
+
+    public void setEventName(String eventName) {
+        this.eventName = eventName;
+    }
+
+    public Date getEventTime() {
+        return eventTime;
+    }
+
+    public void setEventTime(Date eventTime) {
+        this.eventTime = eventTime;
+    }
+
     public void setDetailId(String detailId) {
         this.detailId = detailId;
     }

+ 13 - 0
willalp-canteen/src/main/java/com/willalp/canteen/domain/resp/OrderResp.java

@@ -1,9 +1,12 @@
 package com.willalp.canteen.domain.resp;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.willalp.common.annotation.Excel;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.math.BigDecimal;
+import java.util.Date;
 
 @Data
 public class OrderResp {
@@ -30,4 +33,14 @@ public class OrderResp {
     @Excel(name = "数量")
     private Integer amount;
 
+    /** 事件名称 */
+    @Excel(name = "活动名称")
+    private String eventName;
+
+    /** 事件时间 */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
+    @Excel(name = "活动时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm")
+    private Date eventTime;
+
 }

+ 6 - 1
willalp-canteen/src/main/java/com/willalp/canteen/domain/vo/UserShopCarJsonDoMainVo.java

@@ -18,7 +18,6 @@ import lombok.Data;
  */
 @Data
 public class UserShopCarJsonDoMainVo {
-
     @JsonProperty("amount")
     private Integer amount;
     @JsonProperty("giftId")
@@ -35,5 +34,11 @@ public class UserShopCarJsonDoMainVo {
     private Integer num;
     @JsonProperty("plusOrMinus")
     private Integer plusOrMinus;
+    @JsonProperty("eventId")
+    private String eventId;
+    @JsonProperty("eventName")
+    private String eventName;
+    @JsonProperty("eventTime")
+    private String eventTime;
 }
  

+ 9 - 0
willalp-canteen/src/main/java/com/willalp/canteen/mapper/HsGiftMapper.java

@@ -28,4 +28,13 @@ public interface HsGiftMapper extends BaseMapper<HsGift>
      * @return
      */
     public List<HsGift> appSelectedHsGiftListByType(@Param("code") String code);
+
+    /**
+     * 根据事件查询对应礼品集合
+     *
+     * @return
+     * @param code1
+     * @param code2
+     */
+    List<HsGift> appSelectedHsGiftByEvent(@Param("code1") String code1,@Param("code2") String code2);
 }

+ 42 - 1
willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftMapper.xml

@@ -40,7 +40,7 @@
                update_by,
                update_time,
                remark
-        from hs_gift
+        from hs_gift hg
     </sql>
 
     <select id="selectHsGiftList" parameterType="HsGift" resultMap="HsGiftResult">
@@ -68,4 +68,45 @@
             gift_type in (select id from hs_gift_type where parent_id = #{code})
         </where>
     </select>
+    <select id="appSelectedHsGiftByEvent" resultType="com.willalp.canteen.domain.HsGift">
+        SELECT
+        gift_id,
+        gift_number,
+        gift_content,
+        gift_name,
+        gift_pictrue,
+        gift_price,
+        amount,
+        qybz,
+        jgid,
+        gift_type,
+        he.id eventId,
+        he.event_name,
+        he.event_time
+        FROM
+        hs_gift hg
+        LEFT JOIN hs_gift_type hgt ON hgt.id = hg.gift_type
+        LEFT JOIN hs_event_business_relation hebr ON hebr.business_id = hg.gift_id
+        LEFT JOIN hs_event he ON he.id = hebr.event_id
+        <where>
+            hg.is_delete = 0 AND hg.qybz = '0'
+            <if test="code1 != null and code1 != ''">
+                AND ght.parent_id = #{code1}
+            </if>
+            <if test="code2 != null and code2 != ''">
+                AND hg.gift_type = #{code2}
+            </if>
+            AND hebr.event_id IN (
+            SELECT
+            id
+            FROM
+            hs_event
+            WHERE
+            is_delete = 0
+            AND start_time &lt; NOW()
+            AND NOW() &lt; end_time
+            AND event_type='1'
+            )
+        </where>
+    </select>
 </mapper>

+ 5 - 0
willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftOrderDetailMapper.xml

@@ -12,6 +12,7 @@
         <result property="giftNumber" column="gift_number"/>
         <result property="giftName" column="gift_name"/>
         <result property="cuisineName" column="cuisine_name"/>
+        <result property="eventId" column="event_id"/>
         <result property="amount" column="amount"/>
         <result property="price" column="price"/>
         <result property="total" column="total"/>
@@ -28,6 +29,7 @@
                a.cuisine_number,
                a.gift_number,
                a.cuisine_name,
+               a.event_id,
                a.gift_name,
                a.amount,
                a.price,
@@ -43,9 +45,12 @@
         a.gift_name name,
         a.amount,
         a.total price,
+        he.event_name,
+        he.event_time,
         hg.gift_pictrue pictrue
         from hs_gift_order_detail a
         LEFT JOIN hs_gift hg ON hg.gift_number = a.gift_number
+        LEFT JOIN hs_event he ON a.event_id = he.id
         <where>
             a.is_delete = 0 and a.order_number = #{orderNumber}
             <if test="menuNumber != null  and menuNumber != ''">and a.menu_number like concat('%', #{menuNumber}, '%')

+ 2 - 0
willalp-canteen/src/main/java/com/willalp/canteen/mapper/xml/HsGiftOrderMapper.xml

@@ -56,6 +56,7 @@
 
     <select id="selectHsCanteenOrderList" parameterType="HsGiftOrder" resultMap="HsCanteenOrderResult">
         <include refid="selectHsCanteenOrderVo"/>
+        LEFT JOIN hs_gift_order_detail b on a.order_number = b.order_number
         <where>
             a.is_delete = 0
             <if test="orderNumber != null  and orderNumber != ''">and a.order_number = #{orderNumber}</if>
@@ -68,6 +69,7 @@
                 and paytime between #{params.beginPaytime} and #{params.endPaytime}
             </if>
             <if test="zfbz != null ">and a.zfbz = #{zfbz}</if>
+            <if test="eventId != null ">and b.event_id = #{eventId}</if>
             <if test="jgid != null and jgid != ''">and a.jgid = #{jgid}</if>
             <if test="placeNumber != null and placeNumber != ''">and a.place_number = #{placeNumber}</if>
         </where>

+ 8 - 4
willalp-canteen/src/main/java/com/willalp/canteen/service/impl/HsGiftServiceImpl.java

@@ -2,11 +2,12 @@ package com.willalp.canteen.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.willalp.common.enums.SysOrgCodeEnum;
 import com.willalp.canteen.domain.HsGift;
 import com.willalp.canteen.mapper.HsGiftMapper;
 import com.willalp.canteen.service.IHsGiftService;
 import com.willalp.canteen.service.IHsGiftTypeService;
+import com.willalp.common.enums.SysOrgCodeEnum;
+import com.willalp.event.service.IHsEventService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -25,6 +26,8 @@ public class HsGiftServiceImpl extends ServiceImpl<HsGiftMapper, HsGift> impleme
 
     @Resource
     private IHsGiftTypeService giftTypeService;
+    @Resource
+    private IHsEventService eventService;
 
     /**
      * 查询礼品登记列表
@@ -42,11 +45,12 @@ public class HsGiftServiceImpl extends ServiceImpl<HsGiftMapper, HsGift> impleme
         QueryWrapper<HsGift> queryWrapper = new QueryWrapper<HsGift>()
                 .eq("jgid", SysOrgCodeEnum.HuiJiFen.getCode())
                 .eq("qybz", 0);
+        //List<HsEvent> nowEventList = eventService.getNowEventList(null);
+        //List<String> collect = nowEventList.stream().map(HsEvent::getId).collect(Collectors.toList());
         if (type == 1) {
-            return baseMapper.appSelectedHsGiftListByType(code);
+            return baseMapper.appSelectedHsGiftByEvent(code, null);
         } else if (type == 2) {
-            return baseMapper.selectList(queryWrapper
-                    .eq("gift_type", code));
+            return baseMapper.appSelectedHsGiftByEvent(null, code);
         }
         return null;
     }

+ 10 - 0
willalp-clocking-in/src/main/java/com/willalp/event/mapper/HsEventMapper.java

@@ -20,4 +20,14 @@ public interface HsEventMapper extends BaseMapper<HsEvent>
      * @return 活动配置集合
      */
     List<HsEvent> selectHsEventList(HsEvent hsEvent);
+
+    /**
+     * 获取当前时间满足的事件
+     *
+     * @param hsEvent
+     * @return
+     */
+    List<HsEvent> getNowEventList(HsEvent hsEvent);
+
+
 }

+ 13 - 1
willalp-clocking-in/src/main/java/com/willalp/event/mapper/xml/HsEventMapper.xml

@@ -40,7 +40,7 @@
                update_by,
                update_time,
                remark
-        from hs_event
+            from hs_event
     </sql>
 
     <select id="selectHsEventList" parameterType="HsEvent" resultMap="HsEventResult">
@@ -73,4 +73,16 @@
             </if>
         </where>
     </select>
+    <select id="getNowEventList" resultType="com.willalp.event.domain.HsEvent">
+        <include refid="selectHsEventVo"/>
+            WHERE
+            is_delete = 0
+            AND
+            end_time &gt; NOW()
+            AND
+            start_time &lt; NOW();
+            AND
+            event_type = '2'
+    </select>
 </mapper>
+

+ 7 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/IHsEventService.java

@@ -20,4 +20,11 @@ public interface IHsEventService extends IService<HsEvent>
      * @return 活动配置集合
      */
     public List<HsEvent> selectHsEventList(HsEvent hsEvent);
+    /**
+     * 获取当前时间满足的事件
+     *
+     * @param hsEvent
+     * @return
+     */
+    List<HsEvent> getNowEventList(HsEvent hsEvent);
 }

+ 5 - 0
willalp-clocking-in/src/main/java/com/willalp/event/service/impl/HsEventServiceImpl.java

@@ -32,4 +32,9 @@ public class HsEventServiceImpl extends ServiceImpl<HsEventMapper, HsEvent>  imp
     {
         return hsEventMapper.selectHsEventList(hsEvent);
     }
+
+    @Override
+    public List<HsEvent> getNowEventList(HsEvent hsEvent) {
+        return hsEventMapper.getNowEventList(hsEvent);
+    }
 }

+ 53 - 0
willalp-ui/src/api/canteen/giftDetail.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询食堂订单明细列表
+export function listDetail(query) {
+  return request({
+    url: '/gift/detail/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询食堂订单明细详细
+export function getDetail(detailId) {
+  return request({
+    url: '/gift/detail/' + detailId,
+    method: 'get'
+  })
+}
+
+// 新增食堂订单明细
+export function addDetail(data) {
+  return request({
+    url: '/gift/detail',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改食堂订单明细
+export function updateDetail(data) {
+  return request({
+    url: '/gift/detail',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除食堂订单明细
+export function delDetail(detailId) {
+  return request({
+    url: '/gift/detail/' + detailId,
+    method: 'delete'
+  })
+}
+
+// 导出食堂订单明细
+export function exportDetail(query) {
+  return request({
+    url: '/gift/detail/export',
+    method: 'get',
+    params: query
+  })
+}

+ 121 - 0
willalp-ui/src/api/canteen/giftOrder.js

@@ -0,0 +1,121 @@
+import request from '@/utils/request'
+
+// 查询订单列表
+export function payMiwp(data) {
+  return request({
+    url: '/gift/order/payMiwp',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询订单列表
+export function listOrder(query) {
+  return request({
+    url: '/gift/order/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询订单列表
+export function getPlace(data) {
+  return request({
+    url: '/app/getPlace',
+    method: 'post',
+    data: data
+  })
+}
+
+
+// 查询订单详细
+export function getOrder(orderId) {
+  return request({
+    url: '/gift/order/' + orderId,
+    method: 'get'
+  })
+}
+// 修改订单
+export function updateOrder(data) {
+  return request({
+    url: '/gift/order',
+    method: 'put',
+    data: data
+  })
+}
+
+// 修改订单
+export function takeOrder(data) {
+  return request({
+    url: '/gift/order/takeOrder',
+    method: 'post',
+    data: data
+  })
+}
+// 因错退还订单
+export function partbackOrder(data) {
+  return request({
+    url: '/gift/order/partback',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除订单
+export function delOrder(orderId) {
+  return request({
+    url: '/gift/order/' + orderId,
+    method: 'delete'
+  })
+}
+// 导出订单
+export function tjdcExport(query) {
+  return request({
+    url: '/gift/order/tjdcExport',
+    method: 'get',
+    params: query
+  })
+}
+
+// 导出订单
+export function exportOrder(query) {
+  return request({
+    url: '/gift/order/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 作废订单
+export function backOrder(data) {
+  return request({
+    url: '/gift/order/back' ,
+    method: 'post',
+    data:data
+  })
+}
+
+// 查询订单汇总
+export function listOrders(query) {
+  return request({
+    url: '/gift/order/lists',
+    method: 'get',
+    params: query
+  })
+}
+
+export function sumOrderPay(query) {
+  return request({
+    url: '/gift/order/sumpay',
+    method: 'get',
+    params: query
+  })
+}
+
+export function sumOrderNum(query) {
+  return request({
+    url: '/gift/order/sumordernum',
+    method: 'get',
+    params: query
+  })
+}

+ 3 - 4
willalp-ui/src/views/canteen/gift/index.vue

@@ -103,7 +103,7 @@
           size="mini"
           :loading="exportLoading"
           @click="eventShow"
-        >领取时间配置
+        >兑换事件配置
         </el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -224,12 +224,12 @@
       </div>
     </el-dialog>
     <!-- 添加或修改礼品登记对话框 -->
-    <el-dialog title="领取时间配置" :visible.sync="eventForm.open" width="1600px" append-to-body>
+    <el-dialog title="兑换事件配置" :visible.sync="eventForm.open" width="1600px" append-to-body>
       <eventConfig ref="event" :id="eventGiftForm.eventId"></eventConfig>
     </el-dialog>
 
     <!-- 绑定活动礼品话框 -->
-    <el-dialog title="领取时间配置" :visible.sync="eventGiftForm.open" width="1600px" append-to-body>
+    <el-dialog title="兑换事件配置" :visible.sync="eventGiftForm.open" width="1600px" append-to-body>
       <el-table v-loading="loading" :data="giftList" @selection-change="handleSelectionChange2">
         <el-table-column type="selection" width="55" align="center"/>
         <el-table-column label="礼品id" align="center" prop="giftId" v-if="false"/>
@@ -368,7 +368,6 @@ export default {
       submitBindingRelation(this.eventGiftForm).then(re => {
         if (re.code === 200) {
           this.$modal.msgSuccess("绑定成功");
-          this.eventGiftForm.open = false
         }
       })
     },

+ 253 - 0
willalp-ui/src/views/canteen/gift/order/detail/index.vue

@@ -0,0 +1,253 @@
+<template>
+  <div class="app-container">
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['canteen:detail:export']"
+        >导出
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="detailList" @selection-change="handleSelectionChange"
+              :show-summary="true">
+      <el-table-column label="订单编号" align="center" prop="orderNumber" width="110"/>
+      <el-table-column label="礼品名称" align="center" prop="name"/>
+      <el-table-column label="数量" align="center" prop="amount"/>
+      <el-table-column label="单价" align="center" prop="price"/>
+<!--      <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="['canteen:detail:edit']"-->
+<!--          >修改-->
+<!--          </el-button>-->
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-delete"-->
+<!--            @click="handleDelete(scope.row)"-->
+<!--            v-hasPermi="['canteen:detail: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"
+    />
+
+    <!-- 添加或修改订单明细对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules">
+        <el-form-item label="名称" prop="cuisineName">
+          <el-input v-model="form.giftName" placeholder="请输入菜品名称"/>
+        </el-form-item>
+        <el-form-item label="数量" prop="amount">
+          <el-input v-model="form.amount" placeholder="请输入数量"/>
+        </el-form-item>
+        <el-form-item label="单价" prop="price">
+          <el-input v-model="form.price" 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 {listDetail, getDetail, delDetail, addDetail, updateDetail, exportDetail} from "@/api/canteen/giftDetail";
+
+export default {
+  name: "Detail",
+  dicts: ['consumption_pattern'],
+  props: {
+    orderNo: String
+  },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单明细表格数据
+      detailList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 3,
+        orderNumber: null,
+        menuNumber: null,
+        cuisineNumber: null,
+        cuisineName: null,
+        jgid: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {}
+    };
+  },
+  created() {
+    this.getRoute();
+    this.getList();
+  },
+  methods: {
+    getRoute() {
+      this.queryParams = {
+        orderNumber: this.$route.query.number,
+      }
+    },
+    /** 查询订单明细列表 */
+    getList() {
+      this.loading = true;
+      this.queryParams.orderNumber = this.orderNo
+      listDetail(this.queryParams).then(response => {
+        this.detailList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        detailId: null,
+        orderNumber: null,
+        menuNumber: null,
+        cuisineNumber: null,
+        cuisineName: null,
+        amount: null,
+        price: null,
+        total: null,
+        isDelete: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.detailId)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加订单明细";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      console.log(row)
+      const detailId = row.detailId || this.ids
+      getDetail(detailId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改订单明细";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.detailId != null) {
+            updateDetail(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addDetail(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const detailIds = row.detailId || this.ids;
+      this.$modal.confirm('是否确认删除订单明细编号为"' + detailIds + '"的数据项?').then(function () {
+        return delDetail(detailIds);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$modal.confirm('是否确认导出所有订单明细数据项?').then(() => {
+        this.exportLoading = true;
+        return exportDetail(queryParams);
+      }).then(response => {
+        this.$download.name(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+      });
+    }
+  },
+  watch: {
+    $route: {
+      handler() {
+        this.queryParams = {
+          orderNumber: this.$route.query.number
+        }
+        this.getList();
+      }
+
+    },
+    deep: true
+  }
+};
+</script>

+ 490 - 0
willalp-ui/src/views/canteen/gift/order/index.vue

@@ -0,0 +1,490 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
+      <el-form-item label="活动列表" prop="eventId">
+        <el-select v-model="queryParams.eventId" placeholder="请选择活动列表" clearable size="small">
+          <el-option
+            v-for="item in eventList"
+            :key="item.id"
+            :label="item.eventName"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="订单编号" prop="orderNumber">
+        <el-input
+          v-model="queryParams.orderNumber"
+          placeholder="请输入订单编号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <!--      <el-form-item label="用户姓名" prop="nickName">-->
+      <!--        <el-input-->
+      <!--          v-model="queryParams.nickName"-->
+      <!--          placeholder="请输入用户姓名"-->
+      <!--          clearable-->
+      <!--          size="small"-->
+      <!--          @keyup.enter.native="handleQuery"-->
+      <!--        />-->
+      <!--      </el-form-item>-->
+      <el-form-item label="付款时间">
+        <el-date-picker
+          v-model="daterangePaytime"
+          size="small"
+          style="width: 240px"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          type="datetimerange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
+      </el-form-item>
+      <!--      <el-form-item label="订单状态" prop="zfbz">-->
+      <!--        <el-select v-model="queryParams.zfbz" placeholder="请选择订单状态" clearable size="small">-->
+      <!--          <el-option-->
+      <!--            v-for="dict in dict.type.order_type"-->
+      <!--            :key="dict.value"-->
+      <!--            :label="dict.label"-->
+      <!--            :value="dict.value"-->
+      <!--          />-->
+      <!--        </el-select>-->
+      <!--      </el-form-item>-->
+      <el-form-item>
+        <el-button type="primary" 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="16">
+        <el-card class="box-card">
+          <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+              <el-button
+                type="warning"
+                plain
+                icon="el-icon-download"
+                size="mini"
+                :loading="exportLoading"
+                @click="handleExport"
+                v-hasPermi="['canteen:order:export']"
+              >导出
+              </el-button>
+            </el-col>
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+          </el-row>
+          <el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange"
+                    @row-click="openUpdaetText">
+            <el-table-column type="selection" width="55" align="center"/>
+            <el-table-column label="订单编号" align="center" prop="orderNumber" width="110"/>
+            <el-table-column label="用户编码" align="center" prop="userNumber"/>
+            <el-table-column label="交易时间" align="center" prop="paytime" width="95">
+              <template slot-scope="scope">
+                <span>{{ parseTime(scope.row.paytime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="订单总额" align="center" prop="orderTotal"/>
+            <el-table-column label="用户名称" align="center" prop="userName"/>
+            <el-table-column label="手机号" align="center" prop="phone"/>
+            <el-table-column label="地址" align="center" prop="placeNumber"/>
+            <el-table-column label="订单状态" align="center" prop="statusText"/>
+            <el-table-column label="" align="center" prop="isNewsUser">
+              <template slot-scope="scope">
+                <el-tag v-if="scope.row.isNewsUser === '1'" type="success">新消息</el-tag>
+              </template>
+            </el-table-column>
+            <!--            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
+            <!--              <template slot-scope="scope">-->
+            <!--                <el-button v-if="scope.row.zfbz!==3"-->
+            <!--                           size="mini"-->
+            <!--                           type="text"-->
+            <!--                           icon="el-icon-circle-ok"-->
+            <!--                           @click="takeOrder(scope.row,'已接单')"-->
+            <!--                >接单-->
+            <!--                </el-button>-->
+            <!--                &lt;!&ndash;              <el-button v-if="scope.row.zfbz!==3"&ndash;&gt;-->
+            <!--                &lt;!&ndash;                         size="mini"&ndash;&gt;-->
+            <!--                &lt;!&ndash;                         type="text"&ndash;&gt;-->
+            <!--                &lt;!&ndash;                         icon="el-icon-circle-ok"&ndash;&gt;-->
+            <!--                &lt;!&ndash;                         &ndash;&gt;-->
+            <!--                &lt;!&ndash;              >进度记录&ndash;&gt;-->
+            <!--                &lt;!&ndash;              </el-button>&ndash;&gt;-->
+            <!--              </template>-->
+            <!--            </el-table-column>-->
+          </el-table>
+          <pagination
+            v-show="total>0"
+            :total="total"
+            :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize"
+            @pagination="getList"
+          />
+        </el-card>
+      </el-col>
+      <el-col :span="8">
+        <el-card class="box-card">
+          <div class="item">
+            <Detail ref="detail" :orderNo="orderNo"></Detail>
+          </div>
+        </el-card>
+      </el-col>
+    </el-row>
+    <el-dialog :title="title" :visible.sync="openText" width="800px" append-to-body @cancel="cancel">
+    </el-dialog>
+  </div>
+</template>
+<script>
+
+
+import {
+  listOrder,
+  getOrder,
+  delOrder,
+  updateOrder,
+  exportOrder,
+  tjdcExport,
+  backOrder,
+  partbackOrder,
+  payMiwp, takeOrder
+} from '@/api/canteen/giftOrder'
+
+import {listEvent} from "@/api/eventConfig/event";
+// import OrderProcess from "../../service/orderProcess";
+import Detail from "./detail";
+
+export default {
+  name: 'Order',
+  dicts: ['consumption_period', 'consumption_pattern', 'consumption_period', 'yes_or_no', 'order_type', 'sys_normal_disable'],
+  components: {
+    // OrderProcess,
+    Detail
+  },
+  data() {
+    return {
+      tableHeight: document.documentElement.scrollHeight - 345 + 'px',
+      tjdcOpen: false,
+      tjdc: {
+        tjdcMenuCode: '',
+        tjdcTiele: ''
+      },
+      eventList: [],
+      orderNo: '',
+      openText: false,
+      text: '',
+      userList: [],
+      tjdcList: [],
+      menus: [],
+      wrong: false,
+      search: '',
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 食堂订单表格数据
+      orderList: [],
+      // 弹出层标题
+      title: '',
+      // 是否显示弹出层
+      open: false,
+      // 作废标志时间范围
+      daterangePaytime: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderNumber: null,
+        menuNumber: null,
+        eventId: null,
+        deviceNumber: null,
+        deviceName: null,
+        nickName: null,
+        placeNumber: null,
+        // periodId: null,
+        // patternId: null,
+        // consumerType: null,
+        paytime: new Date(),
+        zfbz: null,
+        jgid: null,
+        orderNo: ''
+      },
+      jcd: [],
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+      dataList: [],
+      baseUrl: process.env.VUE_APP_BASE_API,
+      registerList: [],
+      cuisine_ids: [],
+      orderProcessList: []
+    }
+  },
+  created() {
+    this.getList()
+    this.getListEvent()
+    //this.getPlaceList()
+    //this.queryNickName()
+  },
+  methods: {
+    openUpdaetText(row, column, event) {
+      //this.openText = true
+      this.orderNo = row.orderNumber
+      setTimeout(() => {
+        // this.$refs.orderPro.getList()
+        this.$refs.detail.getList()
+      }, 200)
+      row.isNewsUser = '0'
+      updateOrder(row)
+    },
+    subtext() {
+      this.form.cardCode = this.text
+      takeOrder(this.form).then(re => {
+        if (re.code === 200) {
+          this.$modal.msgSuccess('更新成功');
+          this.getList()
+        }
+      })
+      this.openText = false
+    },
+    takeOrder(data, text) {
+      if (data.zfbz === 2) {
+        this.$modal.msgError('请勿重复接单');
+        return
+      }
+      this.$modal.confirm('确认是否接单?').then(function () {
+        data.statusText = text
+        return takeOrder(data)
+      }).then(() => {
+        this.$modal.msgSuccess('接单成功');
+        this.getList()
+      }).catch(() => {
+      });
+    },
+    jcdChang(val) {
+      this.form.placeName = val.placeName
+    },
+    userChang(val) {
+      this.form.nickName = val.nickName
+    },
+    cuisineSelectionChange(selection) {
+      this.cuisine_ids = selection
+      let ls = 0
+      for (let i = 0; i < selection.length; i++) {
+        if (selection[i].cuisinePrice) {
+          ls += selection[i].cuisinePrice
+        }
+      }
+      this.form.list = selection
+      this.form.orderTotal = ls
+    },
+
+    changeMenu(val) {
+      console.dir(val)
+      if (val !== '') {
+        this.menus.map(item => {
+          if (item.menuNumber === val) {
+            this.tjdc.tjdcTiele = item.menuName
+          }
+        })
+      }
+    },
+    getListEvent() {
+      listEvent().then(result => {
+        this.eventList = result.rows
+      })
+    },
+    /** 查询食堂订单列表 */
+    getList() {
+      this.loading = true
+      this.queryParams.params = {}
+      if (null != this.daterangePaytime && '' !== this.daterangePaytime) {
+        this.queryParams.params['beginPaytime'] = this.daterangePaytime[0]
+        this.queryParams.params['endPaytime'] = this.daterangePaytime[1]
+      }
+      listOrder(this.queryParams).then(response => {
+        this.orderList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.openText = false;
+      this.wrong = false
+      this.getList()
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        orderId: null,
+        orderNumber: null,
+        menuNumber: null,
+        orderTotal: 0,
+        backTotal: null,
+        deviceNumber: null,
+        deviceName: null,
+        // periodId: null,
+        // patternId: null,
+        // consumerType: null,
+        paytime: null,
+        zfbz: null,
+        isDelete: null,
+        jgid: null
+      }
+      this.resetForm('form')
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.daterangePaytime = []
+      this.resetForm('queryForm')
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.orderId)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset()
+      const orderId = row.orderId || this.ids
+      getOrder(orderId).then(response => {
+        this.form = response.data
+        this.open = true
+        this.title = '修改食堂订单'
+      })
+    },
+
+    handlePartBack(row) {
+      this.reset()
+      const orderId = row.orderId || this.ids
+      getOrder(orderId).then(response => {
+        this.form = response.data
+        this.wrong = true
+        this.title = '退还订单详情'
+      })
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs['form'].validate(valid => {
+        if (valid) {
+          payMiwp(this.form).then(response => {
+            this.$modal.msgSuccess('成功')
+            this.open = false
+            this.getList()
+          })
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const orderIds = row.orderId || this.ids
+      this.$modal.confirm('是否确认删除食堂订单编号为"' + orderIds + '"的数据项?').then(function () {
+        return delOrder(orderIds)
+      }).then(() => {
+        this.getList()
+        this.$modal.msgSuccess('删除成功')
+      }).catch(() => {
+      })
+    },
+    /** 作废按钮操作 */
+    handleBack(row) {
+      const orderIds = row.orderId || this.ids
+      this.$modal.confirm('是否作废食堂订单编号为"' + orderIds + '"的数据项?').then(function () {
+        return backOrder(row)
+      }).then(() => {
+        this.getList()
+        this.$modal.msgSuccess('作废成功')
+      }).catch(() => {
+      })
+    },
+    // search: function(event) {
+    //   //方法一:直接通过event.data可以获得文本内容
+    //   if (event.data != null) {
+    //     this.form.leftTotal = parseFloat(this.form.orderTotal) - parseFloat(event.data)
+    //   }
+    // },
+    submitForm2() {
+      this.$refs['form'].validate(valid => {
+        if (valid) {
+          if (this.form.orderId != null) {
+            if (this.form.zfbz === 2) {
+              this.form.orderTotal = this.form.backTotal
+              partbackOrder(this.form).then(response => {
+                this.$modal.msgSuccess('退还成功')
+                this.open = false
+                this.wrong = false
+                this.getList()
+              })
+            } else {
+              this.$modal.msgError('订单未取餐,不可因错退还')
+            }
+          } else {
+            this.wrong = false
+            this.getList()
+          }
+        }
+      })
+    },
+
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams
+      this.$modal.confirm('是否确认导出所有食堂订单数据项?').then(() => {
+        this.exportLoading = true
+        return exportOrder(queryParams)
+      }).then(response => {
+        this.$download.name(response.msg)
+        this.exportLoading = false
+      }).catch(() => {
+      })
+    },
+    // orgFormatter(val) {
+    //   let name = ''
+    //     if (item.deptCode == val) {
+    //       name = item.deptName
+    //     }
+    //   })
+    //   return name
+    // }
+  }
+}
+</script>
+
+<style>
+.line-left-right {
+  line-height: 1px;
+  border-left: 510px solid rgb(221, 221, 221);
+  text-align: center;
+  height: 2px;
+}
+
+.redItem {
+  color: #fff;
+}
+</style>