Browse Source

业务查询

Administrator 2 weeks ago
parent
commit
9f6e1e62f3
21 changed files with 642 additions and 60 deletions
  1. 3 1
      src/main/java/com/zjt/mapper/ProductionVarietyDetailColourMapper.java
  2. 4 0
      src/main/java/com/zjt/mapper/ProductionVarietyDetailMapper.java
  3. 3 1
      src/main/java/com/zjt/mapper/ProductionVarietyMapper.java
  4. 3 1
      src/main/java/com/zjt/service/IProductionVarietyDetailColourService.java
  5. 4 1
      src/main/java/com/zjt/service/IProductionVarietyDetailService.java
  6. 7 0
      src/main/java/com/zjt/service/IProductionVarietyService.java
  7. 7 0
      src/main/java/com/zjt/service/impl/ProductionVarietyDetailColourServiceImpl.java
  8. 18 0
      src/main/java/com/zjt/service/impl/ProductionVarietyDetailServiceImpl.java
  9. 67 1
      src/main/java/com/zjt/service/impl/ProductionVarietyServiceImpl.java
  10. 1 1
      src/main/java/com/zjt/web/ProductionVarietyAddController.java
  11. 20 2
      src/main/java/com/zjt/web/ProductionVarietyDetailController.java
  12. 48 3
      src/main/java/com/zjt/web/ProductionheaderController.java
  13. 0 1
      src/main/java/com/zjt/web/UserController.java
  14. 9 1
      src/main/resources/mapper/ProductionVarietyAddMapper.xml
  15. 10 0
      src/main/resources/mapper/ProductionVarietyDetailColourMapper.xml
  16. 31 0
      src/main/resources/mapper/ProductionVarietyDetailMapper.xml
  17. 8 1
      src/main/resources/mapper/ProductionVarietyMapper.xml
  18. 4 1
      src/main/resources/mapper/ProductionheaderMapper.xml
  19. 42 45
      src/main/resources/templates/mypackage/test.ftl
  20. 273 0
      src/main/resources/templates/mypackage/varietyList.ftl
  21. 80 0
      src/main/resources/templates/variety/user.ftl

+ 3 - 1
src/main/java/com/zjt/mapper/ProductionVarietyDetailColourMapper.java

@@ -3,6 +3,8 @@ package com.zjt.mapper;
3 3
 import com.zjt.entity.ProductionVarietyDetailColour;
4 4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 5
 
6
+import java.util.List;
7
+
6 8
 /**
7 9
  * <p>
8 10
  *  Mapper 接口
@@ -12,5 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
12 14
  * @since 2025-09-25
13 15
  */
14 16
 public interface ProductionVarietyDetailColourMapper extends BaseMapper<ProductionVarietyDetailColour> {
15
-
17
+    public List<ProductionVarietyDetailColour> selectvarietyDetailsColour(long varietyId);
16 18
 }

+ 4 - 0
src/main/java/com/zjt/mapper/ProductionVarietyDetailMapper.java

@@ -3,6 +3,8 @@ package com.zjt.mapper;
3 3
 import com.zjt.entity.ProductionVarietyDetail;
4 4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 5
 
6
+import java.util.List;
7
+
6 8
 /**
7 9
  * <p>
8 10
  *  Mapper 接口
@@ -12,5 +14,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
12 14
  * @since 2025-09-25
13 15
  */
14 16
 public interface ProductionVarietyDetailMapper extends BaseMapper<ProductionVarietyDetail> {
17
+    public List<ProductionVarietyDetail> selectvarietyDetails(long varietyId);
18
+    public List<ProductionVarietyDetail> selectvarietyList();
15 19
 
16 20
 }

+ 3 - 1
src/main/java/com/zjt/mapper/ProductionVarietyMapper.java

@@ -3,6 +3,8 @@ package com.zjt.mapper;
3 3
 import com.zjt.entity.ProductionVariety;
4 4
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5 5
 
6
+import java.util.List;
7
+
6 8
 /**
7 9
  * <p>
8 10
  *  Mapper 接口
@@ -12,5 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
12 14
  * @since 2025-09-25
13 15
  */
14 16
 public interface ProductionVarietyMapper extends BaseMapper<ProductionVariety> {
15
-
17
+    public List<ProductionVariety> selectVariety();
16 18
 }

+ 3 - 1
src/main/java/com/zjt/service/IProductionVarietyDetailColourService.java

@@ -3,6 +3,8 @@ package com.zjt.service;
3 3
 import com.zjt.entity.ProductionVarietyDetailColour;
4 4
 import com.baomidou.mybatisplus.extension.service.IService;
5 5
 
6
+import java.util.List;
7
+
6 8
 /**
7 9
  * <p>
8 10
  *  服务类
@@ -12,5 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
12 14
  * @since 2025-09-25
13 15
  */
14 16
 public interface IProductionVarietyDetailColourService extends IService<ProductionVarietyDetailColour> {
15
-
17
+public List<ProductionVarietyDetailColour> selectvarietyDetailsColour(long varietyId);
16 18
 }

+ 4 - 1
src/main/java/com/zjt/service/IProductionVarietyDetailService.java

@@ -3,6 +3,8 @@ package com.zjt.service;
3 3
 import com.zjt.entity.ProductionVarietyDetail;
4 4
 import com.baomidou.mybatisplus.extension.service.IService;
5 5
 
6
+import java.util.List;
7
+
6 8
 /**
7 9
  * <p>
8 10
  *  服务类
@@ -12,5 +14,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
12 14
  * @since 2025-09-25
13 15
  */
14 16
 public interface IProductionVarietyDetailService extends IService<ProductionVarietyDetail> {
15
-
17
+    List<ProductionVarietyDetail> selectvarietyList();
18
+    List<ProductionVarietyDetail> selectvarietyDetails(long varietyId);
16 19
 }

+ 7 - 0
src/main/java/com/zjt/service/IProductionVarietyService.java

@@ -3,6 +3,8 @@ package com.zjt.service;
3 3
 import com.zjt.entity.ProductionVariety;
4 4
 import com.baomidou.mybatisplus.extension.service.IService;
5 5
 
6
+import java.util.List;
7
+
6 8
 /**
7 9
  * <p>
8 10
  *  服务类
@@ -12,5 +14,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
12 14
  * @since 2025-09-25
13 15
  */
14 16
 public interface IProductionVarietyService extends IService<ProductionVariety> {
17
+    public String VarietyList(String materialTypeCode);
18
+
19
+    List<ProductionVariety> varietyList();
15 20
 
21
+    public String updateVariety(String materialTypeCode);
22
+    public String deleteVariety(String materialTypeCode);
16 23
 }

+ 7 - 0
src/main/java/com/zjt/service/impl/ProductionVarietyDetailColourServiceImpl.java

@@ -6,6 +6,9 @@ import com.zjt.service.IProductionVarietyDetailColourService;
6 6
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 7
 import org.springframework.stereotype.Service;
8 8
 
9
+import java.util.Collections;
10
+import java.util.List;
11
+
9 12
 /**
10 13
  * <p>
11 14
  *  服务实现类
@@ -17,4 +20,8 @@ import org.springframework.stereotype.Service;
17 20
 @Service
18 21
 public class ProductionVarietyDetailColourServiceImpl extends ServiceImpl<ProductionVarietyDetailColourMapper, ProductionVarietyDetailColour> implements IProductionVarietyDetailColourService {
19 22
 
23
+    @Override
24
+    public List<ProductionVarietyDetailColour> selectvarietyDetailsColour(long varietyId) {
25
+        return Collections.emptyList();
26
+    }
20 27
 }

+ 18 - 0
src/main/java/com/zjt/service/impl/ProductionVarietyDetailServiceImpl.java

@@ -2,10 +2,15 @@ package com.zjt.service.impl;
2 2
 
3 3
 import com.zjt.entity.ProductionVarietyDetail;
4 4
 import com.zjt.mapper.ProductionVarietyDetailMapper;
5
+import com.zjt.mapper.ProductionVarietyMapper;
5 6
 import com.zjt.service.IProductionVarietyDetailService;
6 7
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 8
 import org.springframework.stereotype.Service;
8 9
 
10
+import javax.annotation.Resource;
11
+import java.util.Collections;
12
+import java.util.List;
13
+
9 14
 /**
10 15
  * <p>
11 16
  *  服务实现类
@@ -17,4 +22,17 @@ import org.springframework.stereotype.Service;
17 22
 @Service
18 23
 public class ProductionVarietyDetailServiceImpl extends ServiceImpl<ProductionVarietyDetailMapper, ProductionVarietyDetail> implements IProductionVarietyDetailService {
19 24
 
25
+    @Resource
26
+    ProductionVarietyDetailMapper ProductionVarietyDetailMapper;
27
+    @Override
28
+    public List<ProductionVarietyDetail> selectvarietyList() {
29
+        List<ProductionVarietyDetail> productionVarietyDetails = ProductionVarietyDetailMapper.selectvarietyList();
30
+        return productionVarietyDetails;
31
+    }
32
+
33
+    @Override
34
+    public List<ProductionVarietyDetail> selectvarietyDetails(long  varietyId) {
35
+        List<ProductionVarietyDetail> productionVarietyDetails = ProductionVarietyDetailMapper.selectvarietyDetails(varietyId);
36
+        return productionVarietyDetails;
37
+    }
20 38
 }

+ 67 - 1
src/main/java/com/zjt/service/impl/ProductionVarietyServiceImpl.java

@@ -1,14 +1,23 @@
1 1
 package com.zjt.service.impl;
2 2
 
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
3 5
 import com.zjt.entity.ProductionVariety;
4 6
 import com.zjt.mapper.ProductionVarietyMapper;
5 7
 import com.zjt.service.IProductionVarietyService;
6 8
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
+import org.slf4j.Logger;
10
+import org.slf4j.LoggerFactory;
11
+import org.springframework.beans.factory.annotation.Autowired;
7 12
 import org.springframework.stereotype.Service;
8 13
 
14
+import javax.annotation.Resource;
15
+import java.util.ArrayList;
16
+import java.util.List;
17
+
9 18
 /**
10 19
  * <p>
11
- *  服务实现类
20
+ * 服务实现类
12 21
  * </p>
13 22
  *
14 23
  * @author xxu
@@ -17,4 +26,61 @@ import org.springframework.stereotype.Service;
17 26
 @Service
18 27
 public class ProductionVarietyServiceImpl extends ServiceImpl<ProductionVarietyMapper, ProductionVariety> implements IProductionVarietyService {
19 28
 
29
+    private static final Logger logger = LoggerFactory.getLogger(ProductionVarietyServiceImpl.class);
30
+    @Resource
31
+    ProductionVarietyMapper ProductionVarietyMapper;
32
+
33
+    @Override
34
+    public String VarietyList(String materialTypeCode) {
35
+        return "";
36
+    }
37
+
38
+    @Override
39
+    public List<ProductionVariety> varietyList() {
40
+        try {
41
+            List<ProductionVariety> productionVarieties = ProductionVarietyMapper.selectVariety();
42
+            return productionVarieties;
43
+        } catch (Exception e) {
44
+            return new ArrayList<>();
45
+        }
46
+    }
47
+
48
+
49
+    @Override
50
+    public String updateVariety(String materialTypeCode) {
51
+        if (!validateMaterialTypeCode(materialTypeCode, "更新品种")) {
52
+            return "";
53
+        }
54
+        try {
55
+            // TODO: 实现具体的业务逻辑
56
+            logger.info("更新品种,materialTypeCode: {}", materialTypeCode);
57
+            return "";
58
+        } catch (Exception e) {
59
+            logger.error("更新品种异常,materialTypeCode: {}", materialTypeCode, e);
60
+            return "";
61
+        }
62
+    }
63
+
64
+    @Override
65
+    public String deleteVariety(String materialTypeCode) {
66
+        if (!validateMaterialTypeCode(materialTypeCode, "删除品种")) {
67
+            return "";
68
+        }
69
+        try {
70
+            // TODO: 实现具体的业务逻辑
71
+            logger.info("删除品种,materialTypeCode: {}", materialTypeCode);
72
+            return "";
73
+        } catch (Exception e) {
74
+            logger.error("删除品种异常,materialTypeCode: {}", materialTypeCode, e);
75
+            return "";
76
+        }
77
+    }
78
+
79
+    private boolean validateMaterialTypeCode(String materialTypeCode, String operation) {
80
+        if (StringUtils.isBlank(materialTypeCode)) {
81
+            logger.warn("{}时materialTypeCode参数为空", operation);
82
+            return false;
83
+        }
84
+        return true;
85
+    }
20 86
 }

+ 1 - 1
src/main/java/com/zjt/web/ProductionVarietyAddController.java

@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
14 14
  * @since 2025-09-25
15 15
  */
16 16
 @RestController
17
-@RequestMapping("/entity/production-variety-add")
17
+@RequestMapping("/entity/varietyadd")
18 18
 public class ProductionVarietyAddController {
19 19
 
20 20
 }

+ 20 - 2
src/main/java/com/zjt/web/ProductionVarietyDetailController.java

@@ -1,10 +1,17 @@
1 1
 package com.zjt.web;
2 2
 
3 3
 
4
+import com.zjt.entity.ProductionVarietyDetail;
5
+import com.zjt.service.IProductionVarietyDetailService;
6
+import com.zjt.service.IProductionVarietyService;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Controller;
4 9
 import org.springframework.web.bind.annotation.RequestMapping;
5 10
 
6 11
 import org.springframework.web.bind.annotation.RestController;
7 12
 
13
+import java.util.List;
14
+
8 15
 /**
9 16
  * <p>
10 17
  *  前端控制器
@@ -14,7 +21,18 @@ import org.springframework.web.bind.annotation.RestController;
14 21
  * @since 2025-09-25
15 22
  */
16 23
 @RestController
17
-@RequestMapping("/entity/production-variety-detail")
24
+@RequestMapping("/entity")
18 25
 public class ProductionVarietyDetailController {
19
-
26
+    @Autowired
27
+    private IProductionVarietyDetailService productionVarietyDetailService;
28
+    @RequestMapping("varietyList")
29
+    public String selectvarietyList() {
30
+        productionVarietyDetailService.selectvarietyList();
31
+        return "success";
32
+    }
33
+    @RequestMapping("varietyDetailsList")
34
+    public String selectvarietyDetails() {
35
+        List<ProductionVarietyDetail> productionVarietyDetails = productionVarietyDetailService.selectvarietyDetails(1L);
36
+        return productionVarietyDetails.toString();
37
+    }
20 38
 }

+ 48 - 3
src/main/java/com/zjt/web/ProductionheaderController.java

@@ -1,9 +1,13 @@
1 1
 package com.zjt.web;
2 2
 
3
-
3
+import com.zjt.entity.ProductionVariety;
4
+import com.zjt.service.IProductionVarietyDetailService;
5
+import com.zjt.service.IProductionVarietyService;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.stereotype.Controller;
4 8
 import org.springframework.web.bind.annotation.RequestMapping;
5 9
 
6
-import org.springframework.web.bind.annotation.RestController;
10
+import javax.annotation.Resource;
7 11
 
8 12
 /**
9 13
  * <p>
@@ -13,8 +17,49 @@ import org.springframework.web.bind.annotation.RestController;
13 17
  * @author xxu
14 18
  * @since 2025-09-25
15 19
  */
16
-@RestController
20
+@Controller
17 21
 @RequestMapping("/entity/productionheader")
18 22
 public class ProductionheaderController {
19 23
 
24
+    private static final String VIEW_VARIETY_LIST = "mypackage/varietyList";
25
+
26
+    @Autowired
27
+    private IProductionVarietyService productionVarietyService;
28
+    @Autowired
29
+    private IProductionVarietyDetailService productionVarietyDetailService;
30
+
31
+    @RequestMapping("list")
32
+    public String selectVarietyAll() {
33
+        productionVarietyService.varietyList();
34
+        productionVarietyDetailService.selectvarietyList();
35
+        productionVarietyDetailService.selectvarietyDetails(1l);
36
+        return VIEW_VARIETY_LIST;
37
+    }
38
+
39
+    @RequestMapping("add")
40
+    public String varietyAdd(String materialTypeCode) {
41
+        if (materialTypeCode == null || materialTypeCode.isEmpty()) {
42
+            // 可以抛异常或返回错误页面,这里简化处理
43
+            return VIEW_VARIETY_LIST;
44
+        }
45
+        ProductionVariety productionVariety = createProductionVariety(materialTypeCode);
46
+        productionVarietyService.save(productionVariety);
47
+        return VIEW_VARIETY_LIST;
48
+    }
49
+
50
+    @RequestMapping("update")
51
+    public String varietyUpdate(String materialTypeCode) {
52
+        if (materialTypeCode == null || materialTypeCode.isEmpty()) {
53
+            return VIEW_VARIETY_LIST;
54
+        }
55
+        ProductionVariety productionVariety = createProductionVariety(materialTypeCode);
56
+        productionVarietyService.saveOrUpdate(productionVariety);
57
+        return VIEW_VARIETY_LIST;
58
+    }
59
+
60
+    private ProductionVariety createProductionVariety(String materialTypeCode) {
61
+        ProductionVariety productionVariety = new ProductionVariety();
62
+        productionVariety.setVariety(materialTypeCode);
63
+        return productionVariety;
64
+    }
20 65
 }

+ 0 - 1
src/main/java/com/zjt/web/UserController.java

@@ -17,7 +17,6 @@ import org.springframework.ui.Model;
17 17
 import org.springframework.validation.BindingResult;
18 18
 import org.springframework.web.bind.annotation.*;
19 19
 import tk.mybatis.mapper.entity.Example;
20
-import javax.servlet.http.HttpSession;
21 20
 
22 21
 import javax.annotation.Resource;
23 22
 import javax.servlet.http.HttpSession;

+ 9 - 1
src/main/resources/mapper/ProductionVarietyAddMapper.xml

@@ -1,5 +1,13 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.zjt.mapper.ProductionVarietyAddMapper">
4
-
4
+<resultMap id="BaseResultMap" type="com.zjt.entity.ProductionVarietyAdd">
5
+    <result column="tdId" jdbcType="BIGINT" property="tdId" />
6
+    <result column="add" jdbcType="VARCHAR" property="add" />
7
+</resultMap>
8
+    <select id="selectById" resultMap="BaseResultMap">
9
+        select *
10
+        from production_variety_add
11
+        where tdId = #{id}
12
+    </select>
5 13
 </mapper>

+ 10 - 0
src/main/resources/mapper/ProductionVarietyDetailColourMapper.xml

@@ -1,5 +1,15 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.zjt.mapper.ProductionVarietyDetailColourMapper">
4
+    <resultMap id="BaseResultMap" type="com.zjt.entity.ProductionVarietyDetailColour">
5
+        <id column="variety_details_id" jdbcType="FLOAT" property="varietyDetailsId" />
6
+        <result column="colour" jdbcType="VARCHAR" property="colour" />
7
+        <result column="variety_details_id" jdbcType="FLOAT" property="varietyDetailsId" />
8
+    </resultMap>
9
+
10
+    <select id="selectvarietyDetailsColour">
11
+        select * from production_variety_detail_colour
12
+        where variety_details_id=#{varietyId}
13
+    </select>
4 14
 
5 15
 </mapper>

+ 31 - 0
src/main/resources/mapper/ProductionVarietyDetailMapper.xml

@@ -1,5 +1,36 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.zjt.mapper.ProductionVarietyDetailMapper">
4
+    <resultMap id="BaseResultMap" type="com.zjt.entity.ProductionVarietyDetail">
5
+        <id column="variety_id" jdbcType="FLOAT" property="varietyId" />
6
+        <result column="variety" jdbcType="VARCHAR" property="variety" />
7
+        <result column="variety_details" jdbcType="VARCHAR" property="varietyDetails" />
8
+        <result column="variety_id" jdbcType="FLOAT" property="varietyId" />
9
+    </resultMap>
4 10
 
11
+    <sql id="Base_Column_List">
12
+        variety_id, variety, variety_details
13
+    </sql>
14
+    <select id="selectList" resultMap="BaseResultMap">
15
+        select
16
+        <include refid="Base_Column_List" />
17
+        from production_variety_detail
18
+    </select>
19
+    <select id="selectById" resultMap="BaseResultMap">
20
+        select
21
+        <include refid="Base_Column_List" />
22
+        from production_variety_detail
23
+        where variety_id = #{varietyId}
24
+    </select>
25
+    <insert id="insert" parameterType="com.zjt.entity.ProductionVarietyDetail">
26
+    </insert>
27
+    <select id="selectvarietyList" resultMap="BaseResultMap">
28
+        select variety_id,variety
29
+        from production_variety_detail
30
+    </select>
31
+    <select id="selectvarietyDetails" resultMap="BaseResultMap">
32
+        select <include refid="Base_Column_List" />
33
+        from production_variety_detail
34
+        where variety_id = #{varietyId}
35
+    </select>
5 36
 </mapper>

+ 8 - 1
src/main/resources/mapper/ProductionVarietyMapper.xml

@@ -1,5 +1,12 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.zjt.mapper.ProductionVarietyMapper">
4
-
4
+    <!-- 通用查询结果映射 -->
5
+    <resultMap id="BaseResultMap" type="com.zjt.entity.ProductionVariety">
6
+        <!--<id column="id" property="id" jdbcType="BIGINT" />-->
7
+        <result column="variety" property="variety" jdbcType="VARCHAR" />
8
+    </resultMap>
9
+    <select id="selectVariety" resultMap="BaseResultMap">
10
+        SELECT variety FROM `production_variety`
11
+    </select>
5 12
 </mapper>

+ 4 - 1
src/main/resources/mapper/ProductionheaderMapper.xml

@@ -1,5 +1,8 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.zjt.mapper.ProductionheaderMapper">
4
-
4
+    <!-- 通用查询结果映射 -->
5
+    <resultMap id="BaseResultMap" type="com.zjt.entity.Productionheader">
6
+        <!-- 请根据实际实体类字段进行配置 -->
7
+    </resultMap>
5 8
 </mapper>

+ 42 - 45
src/main/resources/templates/mypackage/test.ftl

@@ -19,9 +19,9 @@
19 19
 <body>
20 20
 <hr>
21 21
 <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
22
-        <legend>订单信息</legend>
23
-        <div class="layui-form" style="width: 100%; margin-top: 20px;">
24
-            <center>
22
+    <legend>订单信息</legend>
23
+    <div class="layui-form" style="width: 100%; margin-top: 20px;">
24
+        <center>
25 25
             <form class="layui-form" action="">
26 26
                 <div class="layui-form-item" id="materialchoose">
27 27
                     <div class="layui-form-label">物料信息</div>
@@ -56,16 +56,16 @@
56 56
                         </select>
57 57
                     </div>
58 58
                     <div class="layui-input-inline" style="width: 100px;">
59
-                    <a class="layui-btn layui-btn add" onclick="addtable()">添加</a>
59
+                        <a class="layui-btn layui-btn add" onclick="addtable()">添加</a>
60 60
                     </div>
61 61
                 </div>
62 62
             </form>
63
-            </center>
64
-        </div>
63
+        </center>
64
+    </div>
65 65
 
66
-        <form class="layui-form" method="post" >
67
-            <div class="layui-form-item" style="width:5000px;">
68
-                <center>
66
+    <form class="layui-form" method="post" >
67
+        <div class="layui-form-item" style="width:5000px;">
68
+            <center>
69 69
                 <table class="layui-table" style ="width:5000px; overflow:scroll;" id="table" lay-filter="table" border="1">
70 70
                     <colgroup>
71 71
                         <col width="150">
@@ -114,20 +114,17 @@
114 114
                     <tbody style="text-align: center">
115 115
                     </tbody>
116 116
                 </table>
117
-                </center>
118
-                <div class="layui-form-item">
119
-                    <div class="layui-input-block">
120
-                        <button class="layui-btn" lay-submit lay-filter="formDemo" onclick="adddata()">立即提交</button>
121
-                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
122
-                    </div>
117
+            </center>
118
+            <div class="layui-form-item">
119
+                <div class="layui-input-block">
120
+                    <button class="layui-btn" lay-submit lay-filter="formDemo" onclick="adddata(); return false;">立即提交</button>
121
+                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
123 122
                 </div>
124 123
             </div>
125
-
126
-        </form>
127
-
124
+        </div>
125
+    </form>
128 126
 </fieldset>
129 127
 
130
-
131 128
 <script>
132 129
     layui.use('form', function(){
133 130
         var form = layui.form;
@@ -150,8 +147,8 @@
150 147
                     $("#materialType").append("<option value=\""+obj.brandCode+"\">"+obj.brandName+"</option>");
151 148
                 });
152 149
                 layui.form.render("select");
153
-            },error:function () {
154
-                layer.alert('请求失败');
150
+            },error:function (xhr, status, error) {
151
+                layer.alert('请求失败: ' + error);
155 152
             }});
156 153
         form.on('select(materialType)', function(data){
157 154
             $.ajax({
@@ -166,8 +163,8 @@
166 163
                     });
167 164
 
168 165
                     layui.form.render("select");
169
-                },error:function () {
170
-                    layer.alert('请求失败');
166
+                },error:function (xhr, status, error) {
167
+                    layer.alert('请求失败: ' + error);
171 168
                 }});
172 169
         });
173 170
         form.on('select(brand)', function(data){
@@ -183,8 +180,8 @@
183 180
                     });
184 181
 
185 182
                     layui.form.render("select");
186
-                },error:function () {
187
-                    layer.alert('请求失败');
183
+                },error:function (xhr, status, error) {
184
+                    layer.alert('请求失败: ' + error);
188 185
                 }});
189 186
         });
190 187
         form.on('select(materialGroup)', function(data){
@@ -199,8 +196,8 @@
199 196
                         $("#materialdetil").append("<option value=\""+obj.materialCode+"\">"+obj.materialName+"</option>");
200 197
                     });
201 198
                     layui.form.render("select");
202
-                },error:function () {
203
-                    layer.alert('请求失败');
199
+                },error:function (xhr, status, error) {
200
+                    layer.alert('请求失败: ' + error);
204 201
                 }});
205 202
         });
206 203
 
@@ -217,8 +214,8 @@
217 214
                         $("#materialRealPrice").append("<option value=\""+obj.retailPrice+"\">"+obj.retailPrice+"</option>");
218 215
                     });
219 216
                     layui.form.render("select");
220
-                },error:function () {
221
-                    layer.alert('请求失败');
217
+                },error:function (xhr, status, error) {
218
+                    layer.alert('请求失败: ' + error);
222 219
                 }});
223 220
         });
224 221
 
@@ -310,21 +307,21 @@
310 307
             }
311 308
             var json=JSON.stringify(arrayObj);
312 309
             json = json.replace(/[+]/g, '+');
313
-        $.ajax({
314
-            url: 'insert',
315
-            type: 'post',
316
-            data: "list="+json,
317
-            async: false,
318
-            dataType: "json",
319
-            success: function (data) {
320
-                layer.msg('提交成功!', {
321
-                    time : 5000
322
-                });
323
-            }, error: function () {
324
-                layer.alert('请求失败!');
325
-            }
326
-        });
327
-    }
310
+            $.ajax({
311
+                url: 'insert',
312
+                type: 'post',
313
+                data: "list="+json,
314
+                async: false,
315
+                dataType: "json",
316
+                success: function (data) {
317
+                    layer.msg('提交成功!', {
318
+                        time : 5000
319
+                    });
320
+                }, error: function (xhr, status, error) {
321
+                    layer.alert('请求失败: ' + error);
322
+                }
323
+            });
324
+        }
328 325
         form.on('submit(login)', function (data) {
329 326
             //alert(data.value);
330 327
         });
@@ -333,4 +330,4 @@
333 330
 </script>
334 331
 
335 332
 </body>
336
-</html>
333
+</html>

+ 273 - 0
src/main/resources/templates/mypackage/varietyList.ftl

@@ -0,0 +1,273 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+    <meta charset="utf-8">
5
+    <title>采购页面</title>
6
+    <meta name="renderer" content="webkit">
7
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
8
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
9
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
10
+    <meta name="apple-mobile-web-app-capable" content="yes">
11
+    <meta name="format-detection" content="telephone=no">
12
+    <link rel="icon" href="${basePath!}/static/logo.png">
13
+    <link rel="stylesheet" href="${basePath!}/static/layui/css/layui.css" media="all" />
14
+    <link rel="stylesheet" href="${basePath!}/static/css/public.css" media="all" />
15
+    <script src="${basePath!}/static/layui/layui.js" charset="utf-8"></script>
16
+    <script src="${basePath!}/static/layui/layui.all.js" charset="utf-8"></script>
17
+    <script src="${basePath!}/static/layui/lay/modules/jquery.js"></script>
18
+</head>
19
+<body>
20
+<hr>
21
+<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
22
+    <legend>订单信息</legend>
23
+    <div class="layui-form" style="width: 100%; margin-top: 20px;">
24
+        <center>
25
+            <form class="layui-form" action="">
26
+                <div class="layui-form-item" id="materialchoose">
27
+                    <div class="layui-form-label">物料信息</div>
28
+                    <div class="layui-input-inline" style="width: 100px;">
29
+                        <select name="materialType" id="materialType" class="province-selector" data-value="品类" lay-filter="materialType" onclick="dele()" lay-search="">
30
+                            <option value="">品类</option>
31
+                        </select>
32
+                    </div>
33
+                    <div class="layui-input-inline" style="width: 100px;">
34
+                        <select name="brand" id ="brand" class="city-selector" data-value="品牌" lay-filter="brand" onclick="selectbrand()" lay-search="">
35
+                            <option value="">品牌</option>
36
+                        </select>
37
+                    </div>
38
+                    <div class="layui-input-inline" style="width: 200px;">
39
+                        <select name="materialGroup" id ="materialGroup" class="county-selector" data-value="物料组" lay-filter="materialGroup"  lay-search="">
40
+                            <option value="">物料组</option>
41
+                        </select>
42
+                    </div>
43
+                    <div class="layui-input-inline" style="width: 400px;">
44
+                        <select name="materialdetil" id ="materialdetil" class="county-selector" data-value="物料描述" lay-filter="materialdetil">
45
+                            <option value="">物料描述</option>
46
+                        </select>
47
+                    </div>
48
+                    <div class="layui-input-inline" style="width: 200px;">
49
+                        <select name="materialCode" id ="materialCode" class="county-selector" data-value="物料编码" lay-filter="materialCode">
50
+                            <option value="">物料编码</option>
51
+                        </select>
52
+                    </div>
53
+                    <div class="layui-input-inline" style="width: 100px;">
54
+                        <select name="materialRealPrice" id ="materialRealPrice" class="county-selector" data-value="物料价格" lay-filter="materialRealPrice">
55
+                            <option value="">物料价格</option>
56
+                        </select>
57
+                    </div>
58
+                    <div class="layui-input-inline" style="width: 100px;">
59
+                        <a class="layui-btn layui-btn add" onclick="addtable()">添加</a>
60
+                    </div>
61
+                </div>
62
+            </form>
63
+        </center>
64
+    </div>
65
+
66
+</fieldset>
67
+
68
+<script>
69
+    layui.use('form', function(){
70
+        var form = layui.form;
71
+        form.render();
72
+    });
73
+    layui.use(['form', 'table', "laydate", 'layer','jquery'], function () {
74
+        var materialdetil=null;
75
+        var materialRealPrice=null;
76
+        var material=null;
77
+        var form = layui.form;
78
+        var table = layui.table;
79
+        var $ = layui.$ //重点处
80
+            ,layer = layui.layer;
81
+        $.ajax({
82
+            url: 'type',
83
+            type: 'get',
84
+            success: function (data) {
85
+                $("#materialType").empty();
86
+                $.each($.parseJSON(data), function(idx, obj) {
87
+                    $("#materialType").append("<option value=\""+obj.brandCode+"\">"+obj.brandName+"</option>");
88
+                });
89
+                layui.form.render("select");
90
+            },error:function (xhr, status, error) {
91
+                layer.alert('请求失败: ' + error);
92
+            }});
93
+        form.on('select(materialType)', function(data){
94
+            $.ajax({
95
+                url: 'brand',
96
+                type: 'post',
97
+                data:{'materialTypeCode':data.value},
98
+                success: function (data) {
99
+                    $("#brand").empty();
100
+                    $("#brand").append('<option value="">品牌</option>');
101
+                    $.each($.parseJSON(data), function(idx, obj) {
102
+                        $("#brand").append("<option value=\""+obj.brandCode+"\">"+obj.brandName+"</option>");
103
+                    });
104
+
105
+                    layui.form.render("select");
106
+                },error:function (xhr, status, error) {
107
+                    layer.alert('请求失败: ' + error);
108
+                }});
109
+        });
110
+        form.on('select(brand)', function(data){
111
+            $.ajax({
112
+                url: 'group',
113
+                type: 'post',
114
+                data:{'brand':data.value},
115
+                success: function (data) {
116
+                    $("#materialGroup").empty();
117
+                    $("#materialGroup").append('<option value="">物料组</option>');
118
+                    $.each($.parseJSON(data), function(idx, obj) {
119
+                        $("#materialGroup").append("<option value=\""+obj.materialGroupCode+"\">"+obj.materialGroupName+"</option>");
120
+                    });
121
+
122
+                    layui.form.render("select");
123
+                },error:function (xhr, status, error) {
124
+                    layer.alert('请求失败: ' + error);
125
+                }});
126
+        });
127
+        form.on('select(materialGroup)', function(data){
128
+            $.ajax({
129
+                url: 'price',
130
+                type: 'post',
131
+                data:{'group':data.value},
132
+                success: function (data) {
133
+                    $("#materialdetil").empty();
134
+                    $("#materialdetil").append('<option value="">物料描述</option>');
135
+                    $.each($.parseJSON(data), function(idx, obj) {
136
+                        $("#materialdetil").append("<option value=\""+obj.materialCode+"\">"+obj.materialName+"</option>");
137
+                    });
138
+                    layui.form.render("select");
139
+                },error:function (xhr, status, error) {
140
+                    layer.alert('请求失败: ' + error);
141
+                }});
142
+        });
143
+
144
+        form.on('select(materialdetil)', function(data){
145
+            $.ajax({
146
+                url: 'code',
147
+                type: 'post',
148
+                data:{'code':data.value},
149
+                success: function (data) {
150
+                    $("#materialCode").empty();
151
+                    $("#materialRealPrice").empty();
152
+                    $.each($.parseJSON(data), function(idx, obj) {
153
+                        $("#materialCode").append("<option value=\""+obj.materialCode+"\">"+obj.materialCode+"</option>");
154
+                        $("#materialRealPrice").append("<option value=\""+obj.retailPrice+"\">"+obj.retailPrice+"</option>");
155
+                    });
156
+                    layui.form.render("select");
157
+                },error:function (xhr, status, error) {
158
+                    layer.alert('请求失败: ' + error);
159
+                }});
160
+        });
161
+
162
+        //因为动态添加的元素class属性是无效的,所以不能用$('.add').click(function(){});
163
+        window.addtable= function(){
164
+            var html = '<tr>'+
165
+                '<td style = "width: 100px"><input type="button" class="layui-btn layui-btn-radius" onclick="dele(this)" value="删除" /></td>'+
166
+                '<td style="width:200px">'+
167
+                '<select name="WZ" lay-verify="required">'+
168
+                '<option value="">--请选择--</option>'+
169
+                '<option value="L">L</option>'+
170
+                '<option value="R">R</option>'+
171
+                '</select></td>'+
172
+                '<td style="width:300px">'+
173
+                '<select name="LY" lay-verify="required">'+
174
+                '<option value="">--请选择--</option>'+
175
+                '<option value="C">采购</option>'+
176
+                '<option value="T">退货</option>'+
177
+                '</select></td>'+
178
+                '<td style = "width: 200px"> <input type="text" name="username" required lay-verify="required"   placeholder="用户名字" autocomplete="off" class="layui-input" readonly="true" value="${currentUser.userName!}"+"/></td>'+
179
+                '<td style = "width: 200px"> <input type="text" name="materialCode" required lay-verify="required"   placeholder="物料编码" autocomplete="off" class="layui-input"  readonly="true" value="'+ $('#materialCode option:selected').text()+'"/></td>'+
180
+                '<td style = "width: 800px"> <input type="text" name="materialDetile"  required lay-verify="required"  placeholder="物料描述" autocomplete="off" class="layui-input"  readonly="true" value="'+$('#materialdetil option:selected').text()+'"/></td>'+
181
+                '<td style = "width: 200px"> <input type="text" name="price" required lay-verify="required"   placeholder="价格" autocomplete="off" class="layui-input"  readonly="true" value="'+$('#materialRealPrice option:selected').text()+'"/></td>'+
182
+                '<td style = "width: 100px"> <input type="text" name="NUM" required lay-verify="required"   placeholder="数量" autocomplete="off" class="layui-input" value ="1"/></td>'+
183
+                '<td style = "width: 300px"> <input type="text" name="SPH"    placeholder="球镜" autocomplete="off" class="layui-input"></td>'+
184
+                '<td style = "width: 300px"> <input type="text" name="CYL"    placeholder="柱镜" autocomplete="off" class="layui-input"></td>'+
185
+                '<td style = "width: 300px"> <input type="text" name="AXIS"    placeholder="轴位" autocomplete="off" class="layui-input"></td>'+
186
+                '<td style = "width: 300px"> <input type="text" name="PDFOD"    placeholder="瞳距" autocomplete="off" class="layui-input"></td>'+
187
+                '<td style = "width: 300px"> <input type="text" name="PH"    placeholder="瞳高" autocomplete="off" class="layui-input"></td>'+
188
+                '<td style = "width: 300px"> <input type="text" name="XADD"    placeholder="下加光" autocomplete="off" class="layui-input"></td>'+
189
+                '<td style = "width: 300px"> <input type="text" name="YULIU1"    placeholder="通道" autocomplete="off" class="layui-input"></td>'+
190
+                '<td style = "width: 300px"> <input type="text" name="PRISM"    placeholder="棱镜" autocomplete="off" class="layui-input"></td>'+
191
+                '<td style = "width: 300px"> <input type="text" name="CVA"    placeholder="镜片度数" autocomplete="off" class="layui-input"></td>'+
192
+                '<td style = "width: 300px"> <input type="text" name="OPTICBC"    placeholder="镜片型号/基弧" autocomplete="off" class="layui-input"></td>'+
193
+                '<td style = "width: 300px"> <input type="text" name="RS"    placeholder="是否染色" autocomplete="off" class="layui-input"></td>'+
194
+                '<td style = "width: 300px"> <input type="text" name="SD"    placeholder="色度" autocomplete="off" class="layui-input"></td>'+
195
+                '<td style = "width: 300px"> <input type="text" name="LRS"    placeholder="来板染色" autocomplete="off" class="layui-input"></td>'+
196
+                '<td style = "width: 300px"> <input type="text" name="CRS"    placeholder="厂家色板" autocomplete="off" class="layui-input"></td>'+
197
+                '<td style = "width: 300px"> <input type="text" name="BRS"    placeholder="标准色号" autocomplete="off" class="layui-input"></td>'+
198
+                '<td style = "width: 300px"> <input type="text" name="MPRO"    placeholder="美薄加工" autocomplete="off" class="layui-input"></td>'+
199
+                '<td style = "width: 300px"> <input type="text" name="LBPO"    placeholder="丽薄加工" autocomplete="off" class="layui-input"></td>'+
200
+                '<td style = "width: 300px"> <input type="text" name="FRAMESHAPE"    placeholder="镜架框形" autocomplete="off" class="layui-input"></td>'+
201
+                '<td style = "width: 300px"> <input type="text" name="FRAMEHEIGHT"    placeholder="镜架高度" autocomplete="off" class="layui-input"></td>'+
202
+                '<td style = "width: 300px"> <input type="text" name="FRAMEBRIDGEWIDTH"    placeholder="鼻梁间距" autocomplete="off" class="layui-input"></td>'+
203
+                '<td style = "width: 300px"> <input type="text" name="SPK"    placeholder="水平宽度" autocomplete="off" class="layui-input"></td>'+
204
+                '<td style = "width: 300px"> <input type="text" name="JFRAMESHAPE"    placeholder="加工镜架框形" autocomplete="off" class="layui-input"></td>'+
205
+                '<td style = "width: 300px"> <input type="text" name="COLOR"    placeholder="颜色" autocomplete="off" class="layui-input"></td>'+
206
+                '<td style = "width: 300px"> <input type="text" name="lEN_DIAMETER"    placeholder="直径" autocomplete="off" class="layui-input"></td>'+
207
+                '<td style = "width: 300px"> <input type="text" name="PX"    placeholder="片型" autocomplete="off" class="layui-input"></td>'+
208
+                '<td style = "width: 300px"> <input type="text" name="PS"    placeholder="片色" autocomplete="off" class="layui-input"></td>'+
209
+                '<td style = "width: 300px"> <input type="text" name="MARK"    placeholder="备注" autocomplete="off" class="layui-input"></td>'+
210
+                '</tr>';
211
+            //添加到表格最后
212
+            $(html).appendTo($('#table tbody:last'));
213
+            form.render();
214
+        }
215
+        window.dele= function (obj){
216
+            debugger;
217
+            var otr = obj.parentNode.parentNode;
218
+//			var tab = document.getElementById("tab");
219
+//			tab.deleteRow(otr.rowIndex)
220
+            var tab =  otr.parentNode; //自己的父节点 就是table
221
+            tab.removeChild(otr);
222
+        }
223
+        window.deltable= function() {
224
+            if ($('#table tbody tr').length === 1) {
225
+                layer.msg('只有一条不允许删除。', {
226
+                    time : 2000
227
+                });
228
+            } else {
229
+                //删除当前按钮所在的tr
230
+                $(this).closest('tr').remove();
231
+            }
232
+        };
233
+        window.adddata= function() {
234
+            table=document.getElementById("table");
235
+            let tr=table.getElementsByTagName("tr");
236
+            var arrayObj = new Array();
237
+            for (var i=0; i<tr.length; i++){
238
+                let target=tr[i].querySelectorAll("[name]"),obj={};
239
+                for (var j=0; j<target.length; j++){
240
+                    if(target[j].value){
241
+                        obj[target[j].getAttribute("name")]=target[j].value;
242
+                    }else{
243
+                        obj[target[j].getAttribute("name")]=target[j].getAttribute("value");
244
+                    }
245
+                }
246
+                arrayObj.push(obj);
247
+            }
248
+            var json=JSON.stringify(arrayObj);
249
+            json = json.replace(/[+]/g, '+');
250
+            $.ajax({
251
+                url: 'insert',
252
+                type: 'post',
253
+                data: "list="+json,
254
+                async: false,
255
+                dataType: "json",
256
+                success: function (data) {
257
+                    layer.msg('提交成功!', {
258
+                        time : 5000
259
+                    });
260
+                }, error: function (xhr, status, error) {
261
+                    layer.alert('请求失败: ' + error);
262
+                }
263
+            });
264
+        }
265
+        form.on('submit(login)', function (data) {
266
+            //alert(data.value);
267
+        });
268
+    });
269
+
270
+</script>
271
+
272
+</body>
273
+</html>

+ 80 - 0
src/main/resources/templates/variety/user.ftl

@@ -0,0 +1,80 @@
1
+<!DOCTYPE html>
2
+<html xmlns:th="http://www.w3.org/1999/xhtml">
3
+<head>
4
+    <meta charset="utf-8">
5
+    <title>采购页面</title>
6
+    <meta name="renderer" content="webkit">
7
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
8
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
9
+    <meta name="apple-mobile-web-app-status-bar-style" content="black">
10
+    <meta name="apple-mobile-web-app-capable" content="yes">
11
+    <meta name="format-detection" content="telephone=no">
12
+    <link rel="icon" href="${basePath!}/static/logo.png">
13
+    <link rel="stylesheet" href="${basePath!}/static/layui/css/layui.css" media="all" />
14
+    <link rel="stylesheet" href="${basePath!}/static/css/public.css" media="all" />
15
+    <script src="${basePath!}/static/layui/layui.js" charset="utf-8"></script>
16
+    <script src="${basePath!}/static/layui/layui.all.js" charset="utf-8"></script>
17
+    <script src="${basePath!}/static/layui/lay/modules/jquery.js"></script>
18
+</head>
19
+<body>
20
+<hr>
21
+<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
22
+    <center>
23
+        <div class="layui-input-inline" style="width: 100%; margin-top: 20px;">
24
+            <form class="layui-form" action="list" method="POST" class="layui-input-inline">
25
+                <div class="layui-form-item" id="materialchoose">
26
+                    <div class="layui-form-label">查询条件:</div>
27
+                    <div class="layui-input-inline" style = "width: 300px"  > <!-- 注意:这一层元素并不是必须的 -->
28
+                        <input type="text" name="createtime" class="layui-input" id="select"  placeholder="订单时间" autocomplete="off">
29
+                        <select name="receive" id ="receive" class="county-selector" data-value="采购/退货" lay-filter="materialGroup">
30
+                            <option value=""> --请选择--</option>
31
+                            <option value="C">采购</option>
32
+                            <option value="T">退货</option>
33
+                        </select>
34
+                        <input type="text" name="storeCode"  id ="storeCode" placeholder="门店编码"  class="layui-input">
35
+                        <input type="text" name="id" id ="id" placeholder="订单号" class="layui-input">
36
+                        <button type="submit" class="layui-btn layui-btn-primary" style = "width: 300px">查询</button>
37
+                    </div>
38
+                </div>
39
+            </form>
40
+        </div>
41
+    </center>
42
+</fieldset>
43
+
44
+
45
+<script>
46
+    layui.use('form', function(){
47
+        var form = layui.form;
48
+        form.render();
49
+    });
50
+    layui.use(['form', 'table', "laydate", 'layer','jquery','laydate'], function () {
51
+        var laydate = layui.laydate;
52
+        var form = layui.form;
53
+        var table = layui.table;
54
+        var $ = layui.$ //重点处
55
+            ,layer = layui.layer;
56
+        window.selectDate= function() {
57
+            debugger;
58
+            $.post({
59
+                url: 'list',
60
+                type: 'post',
61
+                data: {'store':document.getElementById("storeCode").value,'date':document.getElementById("select").value},
62
+                success: function (data) {
63
+                }, error: function (data) {
64
+                    layer.alert('请求失败');
65
+                }
66
+            });
67
+        }
68
+        var laydate = layui.laydate;
69
+        laydate.render({
70
+            elem: '#select'
71
+            ,type: 'datetime'
72
+            ,range: true //或 range: '~' 来自定义分割字符
73
+        });
74
+        //执行一个laydate实例
75
+    });
76
+
77
+</script>
78
+
79
+</body>
80
+</html>