From 3761229f2141027f5982c8c0d574d4186565bf57 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期六, 09 九月 2023 16:58:06 +0800
Subject: [PATCH] #项目管理添加产品类型

---
 src/main/resources/mapper/OrderMapper.xml                                      |    1 
 src/main/java/com/zy/crm/manager/controller/OrderProductTypeController.java    |  125 +++++++++
 src/main/java/com/zy/crm/manager/entity/OrderProductType.java                  |  187 ++++++++++++++
 src/main/java/com/zy/crm/manager/service/OrderProductTypeService.java          |    8 
 src/main/java/com/zy/crm/manager/service/impl/OrderProductTypeServiceImpl.java |   12 
 src/main/resources/mapper/OrderProductTypeMapper.xml                           |   20 +
 src/main/webapp/static/js/orderProductType/orderProductType.js                 |  258 +++++++++++++++++++
 src/main/webapp/views/orderProductType/orderProductType.html                   |  118 +++++++++
 src/main/webapp/static/js/order/order.js                                       |    1 
 src/main/java/com/zy/crm/manager/entity/Order.java                             |   20 +
 src/main/java/com/zy/crm/manager/mapper/OrderProductTypeMapper.java            |   12 
 src/main/webapp/views/order/order.html                                         |   13 
 12 files changed, 773 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/controller/OrderProductTypeController.java b/src/main/java/com/zy/crm/manager/controller/OrderProductTypeController.java
new file mode 100644
index 0000000..13c6ed1
--- /dev/null
+++ b/src/main/java/com/zy/crm/manager/controller/OrderProductTypeController.java
@@ -0,0 +1,125 @@
+package com.zy.crm.manager.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
+import com.baomidou.mybatisplus.plugins.Page;
+import com.core.annotations.ManagerAuth;
+import com.core.common.BaseRes;
+import com.core.common.Cools;
+import com.core.common.DateUtils;
+import com.core.common.R;
+import com.zy.crm.common.web.BaseController;
+import com.zy.crm.manager.entity.OrderProductType;
+import com.zy.crm.manager.service.OrderProductTypeService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+public class OrderProductTypeController extends BaseController {
+
+    @Autowired
+    private OrderProductTypeService orderProductTypeService;
+
+    @RequestMapping(value = "/orderProductType/{id}/auth")
+    @ManagerAuth
+    public R get(@PathVariable("id") String id) {
+        return R.ok(orderProductTypeService.selectById(String.valueOf(id)));
+    }
+
+    @RequestMapping(value = "/orderProductType/list/auth")
+    @ManagerAuth
+    public R list(@RequestParam(defaultValue = "1")Integer curr,
+                  @RequestParam(defaultValue = "10")Integer limit,
+                  @RequestParam(required = false)String orderByField,
+                  @RequestParam(required = false)String orderByType,
+                  @RequestParam Map<String, Object> param){
+        EntityWrapper<OrderProductType> wrapper = new EntityWrapper<>();
+        excludeTrash(param);
+        convert(param, wrapper);
+        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+        return R.ok(orderProductTypeService.selectPage(new Page<>(curr, limit), wrapper));
+    }
+
+    private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
+        for (Map.Entry<String, Object> entry : map.entrySet()){
+            String val = String.valueOf(entry.getValue());
+            if (val.contains(RANGE_TIME_LINK)){
+                String[] dates = val.split(RANGE_TIME_LINK);
+                wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
+                wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
+            } else {
+                wrapper.like(entry.getKey(), val);
+            }
+        }
+    }
+
+    @RequestMapping(value = "/orderProductType/add/auth")
+    @ManagerAuth
+    public R add(OrderProductType orderProductType) {
+        orderProductTypeService.insert(orderProductType);
+        return R.ok();
+    }
+
+	@RequestMapping(value = "/orderProductType/update/auth")
+	@ManagerAuth
+    public R update(OrderProductType orderProductType){
+        if (Cools.isEmpty(orderProductType) || null==orderProductType.getId()){
+            return R.error();
+        }
+        orderProductTypeService.updateById(orderProductType);
+        return R.ok();
+    }
+
+    @RequestMapping(value = "/orderProductType/delete/auth")
+    @ManagerAuth
+    public R delete(@RequestParam(value="ids[]") Long[] ids){
+         for (Long id : ids){
+            orderProductTypeService.deleteById(id);
+        }
+        return R.ok();
+    }
+
+    @RequestMapping(value = "/orderProductType/export/auth")
+    @ManagerAuth
+    public R export(@RequestBody JSONObject param){
+        EntityWrapper<OrderProductType> wrapper = new EntityWrapper<>();
+        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
+        Map<String, Object> map = excludeTrash(param.getJSONObject("orderProductType"));
+        convert(map, wrapper);
+        List<OrderProductType> list = orderProductTypeService.selectList(wrapper);
+        return R.ok(exportSupport(list, fields));
+    }
+
+    @RequestMapping(value = "/orderProductTypeQuery/auth")
+    @ManagerAuth
+    public R query(String condition) {
+        EntityWrapper<OrderProductType> wrapper = new EntityWrapper<>();
+        wrapper.like("name", condition);
+        Page<OrderProductType> page = orderProductTypeService.selectPage(new Page<>(0, 10), wrapper);
+        List<Map<String, Object>> result = new ArrayList<>();
+        for (OrderProductType orderProductType : page.getRecords()){
+            Map<String, Object> map = new HashMap<>();
+            map.put("id", orderProductType.getId());
+            map.put("value", orderProductType.getName());
+            result.add(map);
+        }
+        return R.ok(result);
+    }
+
+    @RequestMapping(value = "/orderProductType/check/column/auth")
+    @ManagerAuth
+    public R query(@RequestBody JSONObject param) {
+        Wrapper<OrderProductType> wrapper = new EntityWrapper<OrderProductType>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
+        if (null != orderProductTypeService.selectOne(wrapper)){
+            return R.parse(BaseRes.REPEAT).add(getComment(OrderProductType.class, String.valueOf(param.get("key"))));
+        }
+        return R.ok();
+    }
+
+}
diff --git a/src/main/java/com/zy/crm/manager/entity/Order.java b/src/main/java/com/zy/crm/manager/entity/Order.java
index a114a16..c0814e0 100644
--- a/src/main/java/com/zy/crm/manager/entity/Order.java
+++ b/src/main/java/com/zy/crm/manager/entity/Order.java
@@ -8,6 +8,7 @@
 import com.core.common.SpringUtils;
 import com.zy.crm.manager.service.CompanyService;
 import com.zy.crm.manager.service.CstmrService;
+import com.zy.crm.manager.service.OrderProductTypeService;
 import com.zy.crm.system.entity.Dept;
 import com.zy.crm.system.entity.Dic;
 import com.zy.crm.system.entity.Host;
@@ -190,9 +191,16 @@
     @ApiModelProperty(value= "棰勮鎴愪氦鐜�")
     private String transactionRate;
 
+    /**
+     * 娣诲姞浜哄憳
+     */
+    @ApiModelProperty(value= "浜у搧绫诲瀷")
+    @TableField("order_product_type_id")
+    private Long orderProductTypeId;
+
     public Order() {}
 
-    public Order(Long id, Long hostId, Long deptId, Long userId, Long cstmrId, String uuid, String name, Double money, Long company, String remarks, Long director, String province, String city, String district, String town, String addr, String files, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, int step, String memo, String transactionRate, String pcd) {
+    public Order(Long id, Long hostId, Long deptId, Long userId, Long cstmrId, String uuid, String name, Double money, Long company, String remarks, Long director, String province, String city, String district, String town, String addr, String files, Integer status, Long createBy, Date createTime, Long updateBy, Date updateTime, int step, String memo, String transactionRate, String pcd,Long orderProductTypeId) {
         this.id = id;
         this.hostId = hostId;
         this.deptId = deptId;
@@ -219,6 +227,7 @@
         this.memo = memo;
         this.transactionRate = transactionRate;
         this.pcd = pcd;
+        this.orderProductTypeId = orderProductTypeId;
     }
 
 //    Order order = new Order(
@@ -255,6 +264,15 @@
         return null;
     }
 
+    public String getOrderProductTypeId$(){
+        OrderProductTypeService orderProductTypeService = SpringUtils.getBean(OrderProductTypeService.class);
+        OrderProductType orderProductType = orderProductTypeService.selectById(this.orderProductTypeId);
+        if (!Cools.isEmpty(orderProductType)){
+            return String.valueOf(orderProductType.getName());
+        }
+        return null;
+    }
+
     public String getDeptId$(){
         DeptService service = SpringUtils.getBean(DeptService.class);
         Dept dept = service.selectById(this.deptId);
diff --git a/src/main/java/com/zy/crm/manager/entity/OrderProductType.java b/src/main/java/com/zy/crm/manager/entity/OrderProductType.java
new file mode 100644
index 0000000..2050a65
--- /dev/null
+++ b/src/main/java/com/zy/crm/manager/entity/OrderProductType.java
@@ -0,0 +1,187 @@
+package com.zy.crm.manager.entity;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.baomidou.mybatisplus.enums.IdType;
+import com.core.common.Cools;
+import com.core.common.SpringUtils;
+import com.zy.crm.system.entity.Host;
+import com.zy.crm.system.entity.User;
+import com.zy.crm.system.service.HostService;
+import com.zy.crm.system.service.UserService;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+@Data
+@TableName("man_order_product_type")
+public class OrderProductType implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @ApiModelProperty(value= "ID")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 鎵�灞炲晢鎴�
+     */
+    @ApiModelProperty(value= "鎵�灞炲晢鎴�")
+    @TableField("host_id")
+    private Long hostId;
+
+    /**
+     * 鍚嶇О
+     */
+    @ApiModelProperty(value= "鍚嶇О")
+    private String name;
+
+    /**
+     * 鍖哄垎 1: 璐ф灦  2: 闆嗘垚  
+     */
+    @ApiModelProperty(value= "鍖哄垎 1: 璐ф灦  2: 闆嗘垚  ")
+    private Integer type;
+
+    /**
+     * 鐘舵�� 1: 姝e父  0: 绂佺敤  
+     */
+    @ApiModelProperty(value= "鐘舵�� 1: 姝e父  0: 绂佺敤  ")
+    private Integer status;
+
+    /**
+     * 娣诲姞浜哄憳
+     */
+    @ApiModelProperty(value= "娣诲姞浜哄憳")
+    @TableField("create_by")
+    private Long createBy;
+
+    /**
+     * 娣诲姞鏃堕棿
+     */
+    @ApiModelProperty(value= "娣诲姞鏃堕棿")
+    @TableField("create_time")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /**
+     * 淇敼浜哄憳
+     */
+    @ApiModelProperty(value= "淇敼浜哄憳")
+    @TableField("update_by")
+    private Long updateBy;
+
+    /**
+     * 淇敼鏃堕棿
+     */
+    @ApiModelProperty(value= "淇敼鏃堕棿")
+    @TableField("update_time")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 澶囨敞
+     */
+    @ApiModelProperty(value= "澶囨敞")
+    private String memo;
+
+    public OrderProductType() {}
+
+    public OrderProductType(Long hostId,String name,Integer type,Integer status,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
+        this.hostId = hostId;
+        this.name = name;
+        this.type = type;
+        this.status = status;
+        this.createBy = createBy;
+        this.createTime = createTime;
+        this.updateBy = updateBy;
+        this.updateTime = updateTime;
+        this.memo = memo;
+    }
+
+//    OrderProductType orderProductType = new OrderProductType(
+//            null,    // 鎵�灞炲晢鎴�
+//            null,    // 鍚嶇О[闈炵┖]
+//            null,    // 鍖哄垎
+//            null,    // 鐘舵��
+//            null,    // 娣诲姞浜哄憳
+//            null,    // 娣诲姞鏃堕棿
+//            null,    // 淇敼浜哄憳
+//            null,    // 淇敼鏃堕棿
+//            null    // 澶囨敞
+//    );
+
+    public String getHostId$(){
+        HostService service = SpringUtils.getBean(HostService.class);
+        Host host = service.selectById(this.hostId);
+        if (!Cools.isEmpty(host)){
+            return String.valueOf(host.getName());
+        }
+        return null;
+    }
+
+    public String getType$(){
+        if (null == this.type){ return null; }
+        switch (this.type){
+            case 1:
+                return "璐ф灦";
+            case 2:
+                return "闆嗘垚";
+            default:
+                return String.valueOf(this.type);
+        }
+    }
+
+    public String getStatus$(){
+        if (null == this.status){ return null; }
+        switch (this.status){
+            case 1:
+                return "姝e父";
+            case 0:
+                return "绂佺敤";
+            default:
+                return String.valueOf(this.status);
+        }
+    }
+
+    public String getCreateBy$(){
+        UserService service = SpringUtils.getBean(UserService.class);
+        User user = service.selectById(this.createBy);
+        if (!Cools.isEmpty(user)){
+            return String.valueOf(user.getNickname());
+        }
+        return null;
+    }
+
+    public String getCreateTime$(){
+        if (Cools.isEmpty(this.createTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
+    }
+
+    public String getUpdateBy$(){
+        UserService service = SpringUtils.getBean(UserService.class);
+        User user = service.selectById(this.updateBy);
+        if (!Cools.isEmpty(user)){
+            return String.valueOf(user.getNickname());
+        }
+        return null;
+    }
+
+    public String getUpdateTime$(){
+        if (Cools.isEmpty(this.updateTime)){
+            return "";
+        }
+        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime);
+    }
+
+
+}
diff --git a/src/main/java/com/zy/crm/manager/mapper/OrderProductTypeMapper.java b/src/main/java/com/zy/crm/manager/mapper/OrderProductTypeMapper.java
new file mode 100644
index 0000000..7d35fad
--- /dev/null
+++ b/src/main/java/com/zy/crm/manager/mapper/OrderProductTypeMapper.java
@@ -0,0 +1,12 @@
+package com.zy.crm.manager.mapper;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.zy.crm.manager.entity.OrderProductType;
+import org.apache.ibatis.annotations.Mapper;
+import org.springframework.stereotype.Repository;
+
+@Mapper
+@Repository
+public interface OrderProductTypeMapper extends BaseMapper<OrderProductType> {
+
+}
diff --git a/src/main/java/com/zy/crm/manager/service/OrderProductTypeService.java b/src/main/java/com/zy/crm/manager/service/OrderProductTypeService.java
new file mode 100644
index 0000000..96a3147
--- /dev/null
+++ b/src/main/java/com/zy/crm/manager/service/OrderProductTypeService.java
@@ -0,0 +1,8 @@
+package com.zy.crm.manager.service;
+
+import com.baomidou.mybatisplus.service.IService;
+import com.zy.crm.manager.entity.OrderProductType;
+
+public interface OrderProductTypeService extends IService<OrderProductType> {
+
+}
diff --git a/src/main/java/com/zy/crm/manager/service/impl/OrderProductTypeServiceImpl.java b/src/main/java/com/zy/crm/manager/service/impl/OrderProductTypeServiceImpl.java
new file mode 100644
index 0000000..63f23f6
--- /dev/null
+++ b/src/main/java/com/zy/crm/manager/service/impl/OrderProductTypeServiceImpl.java
@@ -0,0 +1,12 @@
+package com.zy.crm.manager.service.impl;
+
+import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.zy.crm.manager.entity.OrderProductType;
+import com.zy.crm.manager.mapper.OrderProductTypeMapper;
+import com.zy.crm.manager.service.OrderProductTypeService;
+import org.springframework.stereotype.Service;
+
+@Service("orderProductTypeService")
+public class OrderProductTypeServiceImpl extends ServiceImpl<OrderProductTypeMapper, OrderProductType> implements OrderProductTypeService {
+
+}
diff --git a/src/main/resources/mapper/OrderMapper.xml b/src/main/resources/mapper/OrderMapper.xml
index 091faa1..c506b2b 100644
--- a/src/main/resources/mapper/OrderMapper.xml
+++ b/src/main/resources/mapper/OrderMapper.xml
@@ -28,6 +28,7 @@
         <result column="update_time" property="updateTime" />
         <result column="memo" property="memo" />
         <result column="transaction_rate" property="transactionRate" />
+        <result column="order_product_type_id" property="orderProductTypeId" />
 
     </resultMap>
 
diff --git a/src/main/resources/mapper/OrderProductTypeMapper.xml b/src/main/resources/mapper/OrderProductTypeMapper.xml
new file mode 100644
index 0000000..dd5d38f
--- /dev/null
+++ b/src/main/resources/mapper/OrderProductTypeMapper.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zy.crm.manager.mapper.OrderProductTypeMapper">
+
+    <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
+    <resultMap id="BaseResultMap" type="com.zy.crm.manager.entity.OrderProductType">
+        <id column="id" property="id" />
+        <result column="host_id" property="hostId" />
+        <result column="name" property="name" />
+        <result column="type" property="type" />
+        <result column="status" property="status" />
+        <result column="create_by" property="createBy" />
+        <result column="create_time" property="createTime" />
+        <result column="update_by" property="updateBy" />
+        <result column="update_time" property="updateTime" />
+        <result column="memo" property="memo" />
+
+    </resultMap>
+
+</mapper>
diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js
index f215400..9ed24f6 100644
--- a/src/main/webapp/static/js/order/order.js
+++ b/src/main/webapp/static/js/order/order.js
@@ -151,6 +151,7 @@
             ,{field: 'remarks', align: 'left',title: '澶囨敞', templet:function(d){return emptyShow(d.remarks)}}
             ,{field: 'createTime$', align: 'left',title: '娣诲姞鏃堕棿'}
             ,{field: 'company$', align: 'left',title: '鎵�灞炲叕鍙�', hide: true}
+            ,{field: 'orderProductTypeId$', align: 'left',title: '浜у搧绫诲瀷', hide: false}
             ,{field: 'province', align: 'left',title: '鐪�', hide: true}
             ,{field: 'city', align: 'left',title: '甯�', hide: true}
             ,{field: 'district', align: 'left',title: '鍘�', hide: true}
diff --git a/src/main/webapp/static/js/orderProductType/orderProductType.js b/src/main/webapp/static/js/orderProductType/orderProductType.js
new file mode 100644
index 0000000..04a2c06
--- /dev/null
+++ b/src/main/webapp/static/js/orderProductType/orderProductType.js
@@ -0,0 +1,258 @@
+var pageCurr;
+layui.config({
+    base: baseUrl + "/static/layui/lay/modules/"
+}).use(['table','laydate', 'form', 'admin'], function(){
+    var table = layui.table;
+    var $ = layui.jquery;
+    var layer = layui.layer;
+    var layDate = layui.laydate;
+    var form = layui.form;
+    var admin = layui.admin;
+
+    // 鏁版嵁娓叉煋
+    tableIns = table.render({
+        elem: '#orderProductType',
+        headers: {token: localStorage.getItem('token')},
+        url: baseUrl+'/orderProductType/list/auth',
+        page: true,
+        limit: 15,
+        limits: [15, 30, 50, 100, 200, 500],
+        toolbar: '#toolbar',
+        cellMinWidth: 50,
+        height: 'full-120',
+        cols: [[
+            // {type: 'checkbox'},
+            {field: 'id', align: 'center',title: 'ID',hide : true}
+            ,{field: 'name', align: 'center',title: '鍚嶇О'}
+            ,{field: 'type$', align: 'center',title: '鍖哄垎'}
+            ,{field: 'status$', align: 'center',title: '鐘舵��'}
+            ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳'}
+            ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿'}
+            ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳'}
+            ,{field: 'updateTime$', align: 'center',title: '淇敼鏃堕棿'}
+            ,{field: 'memo', align: 'center',title: '澶囨敞'}
+
+            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120}
+        ]],
+        request: {
+            pageName: 'curr',
+            pageSize: 'limit'
+        },
+        parseData: function (res) {
+            return {
+                'code': res.code,
+                'msg': res.msg,
+                'count': res.data.total,
+                'data': res.data.records
+            }
+        },
+        response: {
+            statusCode: 200
+        },
+        done: function(res, curr, count) {
+            if (res.code === 403) {
+                top.location.href = baseUrl+"/";
+            }
+            pageCurr=curr;
+            limit();
+        }
+    });
+
+    // 鐩戝惉鎺掑簭浜嬩欢
+    table.on('sort(orderProductType)', function (obj) {
+        var searchData = {};
+        $.each($('#search-box [name]').serializeArray(), function() {
+            searchData[this.name] = this.value;
+        });
+        searchData['orderByField'] = obj.field;
+        searchData['orderByType'] = obj.type;
+        tableIns.reload({
+            where: searchData,
+            page: {curr: 1}
+        });
+    });
+
+    // 鐩戝惉澶村伐鍏锋爮浜嬩欢
+    table.on('toolbar(orderProductType)', function (obj) {
+        var checkStatus = table.checkStatus(obj.config.id).data;
+        switch(obj.event) {
+            case 'addData':
+                showEditModel();
+                break;
+            case 'deleteData':
+               if (checkStatus.length === 0) {
+                   layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+                   return;
+               }
+               del(checkStatus.map(function (d) {
+                   return d.id;
+               }));
+               break;
+            case 'exportData':
+                admin.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function(){
+                    var titles=[];
+                    var fields=[];
+                    obj.config.cols[0].map(function (col) {
+                        if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
+                            titles.push(col.title);
+                            fields.push(col.field);
+                        }
+                    });
+                    var exportData = {};
+                    $.each($('#search-box [name]').serializeArray(), function() {
+                        exportData[this.name] = this.value;
+                    });
+                    var param = {
+                        'orderProductType': exportData,
+                        'fields': fields
+                    };
+                    $.ajax({
+                        url: baseUrl+"/orderProductType/export/auth",
+                        headers: {'token': localStorage.getItem('token')},
+                        data: JSON.stringify(param),
+                        dataType:'json',
+                        contentType:'application/json;charset=UTF-8',
+                        method: 'POST',
+                        success: function (res) {
+                            layer.closeAll();
+                            if (res.code === 200) {
+                                table.exportFile(titles,res.data,'xls');
+                            } else if (res.code === 403) {
+                                top.location.href = baseUrl+"/";
+                            } else {
+                                layer.msg(res.msg, {icon: 2})
+                            }
+                        }
+                    });
+                });
+                break;
+        }
+    });
+
+    // 鐩戝惉琛屽伐鍏蜂簨浠�
+    table.on('tool(orderProductType)', function(obj){
+        var data = obj.data;
+        switch (obj.event) {
+            case 'edit':
+                showEditModel(data);
+                break;
+            case "del":
+                del([data.id]);
+                break;
+        }
+    });
+
+    /* 寮圭獥 - 鏂板銆佷慨鏀� */
+    function showEditModel(mData) {
+        admin.open({
+            type: 1,
+            area: '600px',
+            title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
+            content: $('#editDialog').html(),
+            success: function (layero, dIndex) {
+                layDateRender(mData);
+                form.val('detail', mData);
+                form.on('submit(editSubmit)', function (data) {
+                    var loadIndex = layer.load(2);
+                    $.ajax({
+                        url: baseUrl+"/orderProductType/"+(mData?'update':'add')+"/auth",
+                        headers: {'token': localStorage.getItem('token')},
+                        data: data.field,
+                        method: 'POST',
+                        success: function (res) {
+                            layer.close(loadIndex);
+                            if (res.code === 200){
+                                layer.close(dIndex);
+                                layer.msg(res.msg, {icon: 1});
+                                tableReload();
+                            } else if (res.code === 403){
+                                top.location.href = baseUrl+"/";
+                            }else {
+                                layer.msg(res.msg, {icon: 2});
+                            }
+                        }
+                    })
+                    return false;
+                });
+                $(layero).children('.layui-layer-content').css('overflow', 'visible');
+                layui.form.render('select');
+            }
+        });
+    }
+
+    /* 鍒犻櫎 */
+    function del(ids) {
+        layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
+            skin: 'layui-layer-admin',
+            shade: .1
+        }, function (i) {
+            layer.close(i);
+            var loadIndex = layer.load(2);
+            $.ajax({
+                url: baseUrl+"/orderProductType/delete/auth",
+                headers: {'token': localStorage.getItem('token')},
+                data: {ids: ids},
+                method: 'POST',
+                success: function (res) {
+                    layer.close(loadIndex);
+                    if (res.code === 200){
+                        layer.msg(res.msg, {icon: 1});
+                        tableReload();
+                    } else if (res.code === 403){
+                        top.location.href = baseUrl+"/";
+                    } else {
+                        layer.msg(res.msg, {icon: 2});
+                    }
+                }
+            })
+        });
+    }
+
+    // 鎼滅储
+    form.on('submit(search)', function (data) {
+        pageCurr = 1;
+        tableReload(false);
+    });
+
+    // 閲嶇疆
+    form.on('submit(reset)', function (data) {
+        pageCurr = 1;
+        clearFormVal($('#search-box'));
+        tableReload(false);
+    });
+
+    // 鏃堕棿閫夋嫨鍣�
+    function layDateRender(data) {
+        setTimeout(function () {
+            layDate.render({
+                elem: '#createTime\\$',
+                type: 'datetime',
+                value: data!==undefined?data['createTime\\$']:null
+            });
+            layDate.render({
+                elem: '#updateTime\\$',
+                type: 'datetime',
+                value: data!==undefined?data['updateTime\\$']:null
+            });
+
+        }, 300);
+    }
+    layDateRender();
+
+});
+
+// 鍏抽棴鍔ㄤ綔
+$(document).on('click','#data-detail-close', function () {
+    parent.layer.closeAll();
+});
+
+function tableReload(child) {
+    var searchData = {};
+    $.each($('#search-box [name]').serializeArray(), function() {
+        searchData[this.name] = this.value;
+    });
+    tableIns.reload({
+        where: searchData,
+        page: {curr: pageCurr}
+     });
+}
diff --git a/src/main/webapp/views/order/order.html b/src/main/webapp/views/order/order.html
index bc8d21c..fc63c32 100644
--- a/src/main/webapp/views/order/order.html
+++ b/src/main/webapp/views/order/order.html
@@ -152,7 +152,18 @@
                         </div>
                     </div>
                 </div>
-
+                <div class="layui-form-item">
+                    <label class="layui-form-label layui-form-required">浜у搧绫诲瀷: </label>
+                    <div class="layui-input-block cool-auto-complete">
+                        <input class="layui-input" name="orderProductTypeId" placeholder="璇疯緭鍏ヤ骇鍝佺被鍨�" style="display: none">
+                        <input id="orderProductTypeId$" name="orderProductTypeId$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="璇疯緭鍏ヤ骇鍝佺被鍨�" onfocus=this.blur()>
+                        <div class="cool-auto-complete-window">
+                            <input class="cool-auto-complete-window-input" data-key="orderProductTypeQueryBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))">
+                            <select class="cool-auto-complete-window-select" data-key="orderProductTypeQueryBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">
+                            </select>
+                        </div>
+                    </div>
+                </div>
                 <div class="layui-form-item">
                     <label class="layui-form-label layui-form-required">椤圭洰鐘舵�� : </label>
                     <div class="layui-input-block" >
diff --git a/src/main/webapp/views/orderProductType/orderProductType.html b/src/main/webapp/views/orderProductType/orderProductType.html
new file mode 100644
index 0000000..4e96c89
--- /dev/null
+++ b/src/main/webapp/views/orderProductType/orderProductType.html
@@ -0,0 +1,118 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all">
+    <link rel="stylesheet" href="../../static/css/cool.css" media="all">
+</head>
+<body>
+
+<div class="layui-fluid">
+    <div class="layui-card">
+        <div class="layui-card-body">
+            <div class="layui-form toolbar" id="search-box">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <label class="layui-form-label">缂栧彿:</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="id" placeholder="缂栧彿" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">&emsp;
+                        <button class="layui-btn icon-btn" lay-filter="search" lay-submit>
+                            <i class="layui-icon">&#xe615;</i>鎼滅储
+                        </button>
+                        <button class="layui-btn icon-btn" lay-filter="reset" lay-submit>
+                            <i class="layui-icon">&#xe666;</i>閲嶇疆
+                        </button>
+                    </div>
+                </div>
+            </div>
+            <table class="layui-hide" id="orderProductType" lay-filter="orderProductType"></table>
+        </div>
+    </div>
+</div>
+
+<script type="text/html" id="toolbar">
+    <div class="layui-btn-container">
+        <button class="layui-btn layui-btn-sm layui-card-body" id="btn-add" lay-event="addData">娣诲姞绫诲瀷</button>
+        <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
+        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">瀵煎嚭</button>
+    </div>
+</script>
+
+<script type="text/html" id="operate">
+    <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a>
+    <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a>
+</script>
+
+<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
+<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/orderProductType/orderProductType.js" charset="utf-8"></script>
+</body>
+<!-- 琛ㄥ崟寮圭獥 -->
+<script type="text/html" id="editDialog">
+    <form id="detail" lay-filter="detail" class="layui-form admin-form model-form">
+        <input name="id" type="hidden">
+        <div class="layui-row">
+            <div class="layui-col-md12">
+                <div class="layui-form-item">
+                    <label class="layui-form-label layui-form-required">绫诲瀷鍚嶇О</label>
+                    <div class="layui-input-block">
+                        <!--                    <input class="layui-input" name="name" placeholder="璇疯緭鍏ョ被鍨嬪悕绉�" lay-verType="tips" lay-verify="required" required/>-->
+                        <select name="name" lay-verType="tips" lay-verify="required" required>
+                            <option value="">璇烽�夋嫨绫诲瀷</option>
+                            <option value="绔嬩綋搴擄紙璐ф灦锛�">绔嬩綋搴擄紙璐ф灦锛�</option>
+                            <option value="绔嬩綋搴擄紙闆嗘垚锛�">绔嬩綋搴擄紙闆嗘垚锛�</option>
+                            <option value="鍥涘悜绌挎搴�/涓ゅ悜绌挎搴�">鍥涘悜绌挎搴�/涓ゅ悜绌挎搴�</option>
+                            <option value="闃佹ゼ璐ф灦/閽㈠钩鍙�">闃佹ゼ璐ф灦/閽㈠钩鍙�</option>
+                            <option value="鍛ㄨ浆瀹瑰櫒">鍛ㄨ浆瀹瑰櫒</option>
+                            <option value="骞冲簱">骞冲簱</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">鍖哄垎: </label>
+                    <div class="layui-input-block">
+                        <select name="type">
+                            <option value="">璇烽�夋嫨鍖哄垎</option>
+                            <option value="1">璐ф灦</option>
+                            <option value="2">闆嗘垚</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">鐘舵��: </label>
+                    <div class="layui-input-block">
+                        <select name="status">
+                            <option value="">璇烽�夋嫨鐘舵��</option>
+                            <option value="1">姝e父</option>
+                            <option value="0">绂佺敤</option>
+                        </select>
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">澶囨敞: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="memo" placeholder="璇疯緭鍏ュ娉�">
+                    </div>
+                </div>
+
+             </div>
+        </div>
+        <hr class="layui-bg-gray">
+        <div class="layui-form-item text-right">
+            <button class="layui-btn" lay-filter="editSubmit" lay-submit="">淇濆瓨</button>
+            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+        </div>
+    </form>
+</script>
+</html>
+

--
Gitblit v1.9.1