Browse Source

统计报表(材料费),材料费录入 重构,材料费数据字段增加,批量/条件导出逻辑调整

ly 5 months ago
parent
commit
96e8fd129c

+ 1 - 1
pom.xml

@@ -28,7 +28,7 @@
28 28
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
29 29
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
30 30
         <mybatis.version>2.2.0</mybatis.version>
31
-        <pagehelper.version>1.2.13</pagehelper.version>
31
+        <pagehelper.version>1.3.0</pagehelper.version>
32 32
         <druid.version>1.2.8</druid.version>
33 33
         <knife4j.version>2.0.5</knife4j.version>
34 34
         <swagger-ui>2.9.2</swagger-ui>

+ 1 - 1
src/main/java/com/liang/controller/StaBudgetapprovalController.java

@@ -126,7 +126,7 @@ public class StaBudgetapprovalController extends BaseController {
126 126
 
127 127
     @ResponseBody
128 128
     @RequestMapping(value = "/exportExcel/{fromdata}", method = RequestMethod.POST)
129
-    public BaseResult exportExcel(@PathVariable String fromdata)throws Exception{
129
+    public BaseResult exportExcel(@PathVariable(required = false) String fromdata)throws Exception{
130 130
         SysUserInfo userInfo = getSysUserInfo();
131 131
         List<String> postName = sysUserInfoService.getPostNameByUserId(userInfo.getUserId());
132 132
         ObjectMapper objectMapper = new ObjectMapper();

File diff suppressed because it is too large
+ 60 - 2
src/main/java/com/liang/controller/StaMaterialController.java


+ 2 - 1
src/main/java/com/liang/dao/StaMaterialDao.java

@@ -6,6 +6,7 @@ import org.springframework.data.domain.Pageable;
6 6
 
7 7
 import java.util.HashMap;
8 8
 import java.util.List;
9
+import java.util.Map;
9 10
 
10 11
 /**
11 12
  * 材料费(StaMaterial)表数据库访问层
@@ -111,5 +112,5 @@ public interface StaMaterialDao {
111 112
      * @param JZRQ 创建结束日期
112 113
      * @return
113 114
      */
114
-    List<HashMap<String, Object>> searchMaterialCost(String MC, String CLMC, String WLBM, String BZ, String QSRQ, String JZRQ);
115
+    List<HashMap<String, Object>> searchMaterialCost(Map map);
115 116
 }

+ 31 - 0
src/main/java/com/liang/entity/StaMaterial.java

@@ -24,6 +24,37 @@ public class StaMaterial implements Serializable {
24 24
     private Double hsje;
25 25
     //备注
26 26
     private String bz;
27
+    // 申请金额
28
+    private Double sqje;
29
+    // 税率
30
+    private Double sl;
31
+
32
+    private String xh;
33
+
34
+
35
+    public String getXh() {
36
+        return xh;
37
+    }
38
+
39
+    public void setXh(String xh) {
40
+        this.xh = xh;
41
+    }
42
+
43
+    public Double getSqje() {
44
+        return sqje;
45
+    }
46
+
47
+    public void setSqje(Double sqje) {
48
+        this.sqje = sqje;
49
+    }
50
+
51
+    public Double getSl() {
52
+        return sl;
53
+    }
54
+
55
+    public void setSl(Double sl) {
56
+        this.sl = sl;
57
+    }
27 58
 
28 59
     public int getId() {
29 60
         return id;

+ 109 - 0
src/main/java/com/liang/entity/UtilEntity.java

@@ -0,0 +1,109 @@
1
+package com.liang.entity;
2
+
3
+import com.fasterxml.jackson.annotation.JsonProperty;
4
+
5
+import java.io.Serializable;
6
+
7
+/**
8
+ * @Author ly
9
+ * @Date 2024/7/3 23:29
10
+ * @Version 1.0
11
+ */
12
+public class UtilEntity implements Serializable {
13
+    @JsonProperty("XMMC")
14
+    private String xmmc;
15
+
16
+    @JsonProperty("QSRQ")
17
+    private String qsrq;
18
+
19
+    @JsonProperty("JSRQ")
20
+    private String jsrq;
21
+
22
+    @JsonProperty("ERPBH")
23
+    private String erpbh;
24
+    @JsonProperty("NF")
25
+    private String nf;
26
+    @JsonProperty("FYSQBH")
27
+    private String fysqbh;
28
+
29
+    @JsonProperty("WLBM")
30
+    private  String wlbm;
31
+
32
+    @JsonProperty("CLMC")
33
+    private  String clmc;
34
+    @JsonProperty("BZ")
35
+    private  String bz;
36
+
37
+
38
+    public String getXmmc() {
39
+        return xmmc;
40
+    }
41
+
42
+    public void setXmmc(String xmmc) {
43
+        this.xmmc = xmmc;
44
+    }
45
+
46
+    public String getQsrq() {
47
+        return qsrq;
48
+    }
49
+
50
+    public void setQsrq(String qsrq) {
51
+        this.qsrq = qsrq;
52
+    }
53
+
54
+    public String getJsrq() {
55
+        return jsrq;
56
+    }
57
+
58
+    public void setJsrq(String jsrq) {
59
+        this.jsrq = jsrq;
60
+    }
61
+
62
+    public String getErpbh() {
63
+        return erpbh;
64
+    }
65
+
66
+    public void setErpbh(String erpbh) {
67
+        this.erpbh = erpbh;
68
+    }
69
+
70
+    public String getNf() {
71
+        return nf;
72
+    }
73
+
74
+    public void setNf(String nf) {
75
+        this.nf = nf;
76
+    }
77
+
78
+    public String getFysqbh() {
79
+        return fysqbh;
80
+    }
81
+
82
+    public void setFysqbh(String fysqbh) {
83
+        this.fysqbh = fysqbh;
84
+    }
85
+
86
+    public String getWlbm() {
87
+        return wlbm;
88
+    }
89
+
90
+    public void setWlbm(String wlbm) {
91
+        this.wlbm = wlbm;
92
+    }
93
+
94
+    public String getClmc() {
95
+        return clmc;
96
+    }
97
+
98
+    public void setClmc(String clmc) {
99
+        this.clmc = clmc;
100
+    }
101
+
102
+    public String getBz() {
103
+        return bz;
104
+    }
105
+
106
+    public void setBz(String bz) {
107
+        this.bz = bz;
108
+    }
109
+}

+ 2 - 1
src/main/java/com/liang/service/StaMaterialService.java

@@ -6,6 +6,7 @@ import org.springframework.data.domain.PageRequest;
6 6
 
7 7
 import java.util.HashMap;
8 8
 import java.util.List;
9
+import java.util.Map;
9 10
 
10 11
 /**
11 12
  * 材料费(StaMaterial)表服务接口
@@ -94,5 +95,5 @@ public interface StaMaterialService {
94 95
      * @param jzrq 创建结束日期
95 96
      * @return
96 97
      */
97
-    List<HashMap<String, Object>> searchMaterialCost(String mc, String clmc, String wlbm, String bz, String qsrq, String jzrq);
98
+    List<HashMap<String, Object>> searchMaterialCost(Map map);
98 99
 }

+ 3 - 2
src/main/java/com/liang/service/impl/StaMaterialServiceImpl.java

@@ -11,6 +11,7 @@ import org.springframework.stereotype.Service;
11 11
 import javax.annotation.Resource;
12 12
 import java.util.HashMap;
13 13
 import java.util.List;
14
+import java.util.Map;
14 15
 
15 16
 /**
16 17
  * 材料费(StaMaterial)表服务实现类
@@ -98,7 +99,7 @@ public class StaMaterialServiceImpl implements StaMaterialService {
98 99
     }
99 100
 
100 101
     @Override
101
-    public List<HashMap<String, Object>> searchMaterialCost(String mc, String clmc, String wlbm, String bz, String qsrq, String jzrq) {
102
-        return this.staMaterialDao.searchMaterialCost(mc, clmc, wlbm, bz, qsrq, jzrq);
102
+    public List<HashMap<String, Object>> searchMaterialCost(Map map) {
103
+        return this.staMaterialDao.searchMaterialCost(map);
103 104
     }
104 105
 }

+ 56 - 40
src/main/resources/mapper/StaMaterialDao.xml

@@ -107,11 +107,11 @@
107 107
     </insert>
108 108
 
109 109
     <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
110
-        insert into sta_Material(ZB, FYSQ, CLMC, WLBM, CGDJ, BHSJE, HSJE, BZ)
110
+        insert into sta_Material(ZB, FYSQ, CLMC, WLBM, CGDJ, BHSJE, HSJE, BZ,SQJE,SL,XH)
111 111
         values
112 112
         <foreach collection="entities" item="entity" separator=",">
113 113
             (#{entity.zb}, #{entity.fysq}, #{entity.clmc}, #{entity.wlbm}, #{entity.cgdj}, #{entity.bhsje},
114
-            #{entity.hsje}, #{entity.bz})
114
+            #{entity.hsje}, #{entity.bz},#{entity.sqje},#{entity.sl},#{entity.xh})
115 115
         </foreach>
116 116
     </insert>
117 117
 
@@ -196,51 +196,67 @@
196 196
     </delete>
197 197
 
198 198
     <!--统计报表(材料费)查询 -->
199
-    <select id="searchMaterialCost" resultType="Map">
200
-        SELECT sta_Material.ID,
201
-        sys_dept_info.dept_name AS BM,
202
-        prj_Project.BM AS XMBH,
203
-        sta_BudgetApproval.XMMC,
204
-        base_ProjectType.XMLXMC,
205
-        sta_Material.FYSQ,
206
-        sta_Material.CLMC,
207
-        sta_Material.WLBM,
208
-        sta_Material.CGDJ,
209
-        sta_Material.BHSJE,
210
-        sta_Material.HSJE,
199
+    <select id="searchMaterialCost" resultType="HashMap">
200
+        SELECT
201
+        m.ID,
202
+        d.dept_name AS BM,
203
+        p.ERPBH AS XMBH,
204
+        b.XMMC,
205
+        pt.XMLXMC,
206
+        b.ERPBH,
207
+        b.BH,
208
+        b.NF,
209
+        m.FYSQ,
210
+        m.CLMC,
211
+        m.WLBM,
212
+        m.CGDJ,
213
+        m.BHSJE,
214
+        m.HSJE,
211 215
         CASE
212
-        WHEN sta_BudgetApproval.SFBYJ = 0 THEN '否'
213
-        WHEN sta_BudgetApproval.SFBYJ = 1 THEN '是'
214
-        ELSE CAST(sta_BudgetApproval.SFBYJ AS varchar(11))
216
+        WHEN b.SFBYJ = 0 THEN '否'
217
+        WHEN b.SFBYJ = 1 THEN '是'
218
+        ELSE CAST(b.SFBYJ AS varchar(11))
215 219
         END AS SFBYJ,
216
-        sta_Material.BZ,
217
-        CAST(sta_BudgetApproval.SQSJ AS date) AS SQSJ
218
-        FROM sta_Material,
219
-        sta_BudgetApproval,
220
-        prj_Project,
221
-        base_ProjectType,
222
-        sys_dept_info
223
-        WHERE sta_Material.ZB = sta_BudgetApproval.ID
224
-        AND sta_BudgetApproval.XMID = prj_Project.ID
225
-        AND sta_BudgetApproval.SSBM = sys_dept_info.dept_id
226
-        AND sta_BudgetApproval.XMLX = base_ProjectType.XMLX
227
-        <if test="MC != null and MC != ''">
228
-            AND sta_BudgetApproval.XMMC LIKE '%${MC}%'
220
+        m.BZ,
221
+        CAST(b.SQSJ AS date) AS SQSJ
222
+        FROM
223
+        sta_Material m
224
+        LEFT JOIN
225
+        sta_BudgetApproval b ON m.ZB = b.ID
226
+        LEFT JOIN
227
+        prj_Project p ON b.XMID = p.ID
228
+        LEFT JOIN
229
+        base_ProjectType pt ON b.XMLX = pt.XMLX
230
+        LEFT JOIN
231
+        sys_dept_info d ON b.SSBM = d.dept_id
232
+        WHERE
233
+        b.SPZT != '作废'
234
+        <if test="xmmc != null and xmmc != ''">
235
+            AND b.XMMC LIKE '%'+#{xmmc}+'%'
236
+        </if>
237
+        <if test="clmc != null and clmc != ''">
238
+            AND m.CLMC LIKE '%'+#{clmc}+'%'
239
+        </if>
240
+        <if test="wlbm != null and wlbm != ''">
241
+            AND m.WLBM LIKE '%'+#{wlbm}+'%'
242
+        </if>
243
+        <if test="bz != null and bz != ''">
244
+            AND m.BZ LIKE '%'+#{bz}+'%'
229 245
         </if>
230
-        <if test="CLMC != null and CLMC != ''">
231
-            AND sta_Material.CLMC LIKE '%${CLMC}%'
246
+        <if test="qsrq != null and qsrq != ''">
247
+            AND b.SQSJ  <![CDATA[>= ]]> #{qsrq}
232 248
         </if>
233
-        <if test="WLBM != null and WLBM != ''">
234
-            AND sta_Material.WLBM LIKE '%${WLBM}%'
249
+        <if test="jsrq != null and jsrq != ''">
250
+            AND b.SQSJ  <![CDATA[<= ]]> #{jsrq}
235 251
         </if>
236
-        <if test="BZ != null and BZ != ''">
237
-            AND sta_Material.BZ LIKE '%${BZ}%'
252
+        <if test="erpbh != null and erpbh !=''">
253
+            AND b.ERPBH LIKE '%'+#{erpbh}+'%'
238 254
         </if>
239
-        <if test="QSRQ != null and QSRQ != ''">
240
-            AND sta_BudgetApproval.SQSJ  <![CDATA[>= ]]> #{QSRQ}
255
+        <if test="fysqbh != null and fysqbh != ''">
256
+            AND b.BH LIKE '%'+#{fysqbh}+'%'
241 257
         </if>
242
-        <if test="JZRQ != null and JZRQ != ''">
243
-            AND sta_BudgetApproval.SQSJ  <![CDATA[<= ]]> #{JZRQ}
258
+        <if test="nf != null and nf !=''">
259
+            AND b.NF = #{nf}
244 260
         </if>
245 261
     </select>
246 262
 

+ 1 - 1
src/main/resources/templates/lsuserinfo/list.html

@@ -72,7 +72,7 @@
72 72
                 <button class="layui-btn layui-btn-sm data-add-btn" lay-event="add" style="background-color: #00a2d4">
73 73
                     <i class="layui-icon layui-icon-addition" style="font-size: 10px;"></i>新增
74 74
                 </button>
75
-                <button class="layui-btn layui-btn-sm" lay-event="export" >
75
+                <button class="layui-btn layui-btn-sm" lay-event="export" style="background-color: #2f363c" >
76 76
                     <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>批量导出
77 77
                 </button>
78 78
                 <button class="layui-btn layui-btn-sm" lay-event="download"  style="background-color: purple">

+ 5 - 4
src/main/resources/templates/stabudgetapproval/list_apply.html

@@ -152,8 +152,8 @@
152 152
                 <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="nullify">
153 153
                     <i class="layui-icon layui-icon-delete" style="font-size: 10px;"></i>作废
154 154
                 </button>
155
-                <button class="layui-btn layui-btn-sm" lay-event="exportExcel">
156
-                    <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>导出
155
+                <button class="layui-btn layui-btn-sm" lay-event="exportExcel" style="background-color: #2f363c" >
156
+                    <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>批量导出
157 157
                 </button>
158 158
             </div>
159 159
         </script>
@@ -683,12 +683,13 @@
683 683
                 AjaxUtil.post({
684 684
                     url: AjaxUtil.ctx + "staBudgetapproval/exportExcel/" + formDataString,
685 685
                     contentType: "application/json",
686
+                    timeout: 15000, //大批量导出时会出现超时问题
686 687
                     success: function (res) {
688
+                        console.log(res);
687 689
                         table.exportFile('currentTableId', res.data, 'xlsx');
688 690
                     },
689 691
                     error: function (error) {
690
-
691
-
692
+                        layui.error('服务器睡着了!');
692 693
                     }
693 694
                 });
694 695
                 console.log('进来了');

+ 24 - 14
src/main/resources/templates/stabudgetapproval/update_apply.html

@@ -2767,10 +2767,13 @@
2767 2767
                     {type: "checkbox", align: 'center'},
2768 2768
                     {field: 'xh', title: '序号', align: 'center', width: '7%'},
2769 2769
                     {field: 'clmc', title: '材料名称', width: '30%'},
2770
-                    {field: 'gghxh', title: '规格或型号', width: '20%'},
2771
-                    {field: 'jldw', title: '计量单位', width: '11%'},
2772
-                    {field: 'dj', title: '单价(万元)', width: '13%'},
2773
-                    {field: 'clfy', title: '材料费用', width: '15%'}
2770
+                    {field: 'wlbm', title: '物料编码', width: '20%'},
2771
+                    {field: 'cgdj', title: '采购单价(万元)', width: '11%'},
2772
+                    {field: 'bhsje', title: '不含税金额(元))', width: '13%'},
2773
+                    {field: 'hsje', title: '含税金额(元))', width: '13%'},
2774
+                    {field: 'sqje', title: '申请金额', width: '15%'},
2775
+                    {field: 'sl',title: '税率',width: '10%'},
2776
+                    {field: 'bz', title: '备注', width: '15%'}
2774 2777
                 ]
2775 2778
             ],
2776 2779
             autoSort: false,
@@ -2822,11 +2825,13 @@
2822 2825
                 materialCost = {
2823 2826
                     "xh": data[0].xh,
2824 2827
                     "clmc": data[0].clmc,
2825
-                    "gghxh": data[0].gghxh,
2826
-                    "jldw": data[0].jldw,
2827
-                    "dj": data[0].dj,
2828
-                    "clfy": data[0].clfy,
2829
-                    "jflz": data[0].jflz
2828
+                    "sqje": data[0].sqje,
2829
+                    "bhsje": data[0].bhsje,
2830
+                    "cgdj": data[0].cgdj,
2831
+                    "hsje": data[0].hsje,
2832
+                    "sl": data[0].sl,
2833
+                    "bz":data[0].bz,
2834
+                    "wlbm":data[0].wlbm
2830 2835
                 };
2831 2836
                 layer.open({
2832 2837
                     title: '编辑材料费',
@@ -2873,11 +2878,13 @@
2873 2878
                 materialCost = {
2874 2879
                     "xh": data[0].xh,
2875 2880
                     "clmc": data[0].clmc,
2876
-                    "gghxh": data[0].gghxh,
2877
-                    "jldw": data[0].jldw,
2878
-                    "dj": data[0].dj,
2879
-                    "clfy": data[0].clfy,
2880
-                    "jflz": data[0].jflz
2881
+                    "sqje": data[0].sqje,
2882
+                    "bhsje": data[0].bhsje,
2883
+                    "cgdj": data[0].cgdj,
2884
+                    "hsje": data[0].hsje,
2885
+                    "sl": data[0].sl,
2886
+                    "bz":data[0].bz,
2887
+                    "wlbm":data[0].wlbm
2881 2888
                 };
2882 2889
                 layer.open({
2883 2890
                     title: '浏览材料费',
@@ -3793,6 +3800,9 @@
3793 3800
                                 for (const item of curData) {
3794 3801
                                     var cost = {
3795 3802
                                         "zb": fyId,
3803
+                                        "xh": item.xh,
3804
+                                        "sqje": item.sqje,
3805
+                                        "sl":item.sl,
3796 3806
                                         "clmc": item.clmc,
3797 3807
                                         "wlbm": item.wlbm,
3798 3808
                                         "fysq": item.fysq,

+ 9 - 5
src/main/resources/templates/stabudgetapproval/view_apply.html

@@ -707,11 +707,15 @@
707 707
             cols: [
708 708
                 [
709 709
                     {type: "checkbox", align: 'center'},
710
-                    {type: 'numbers', align: 'center'},
711
-                    {field: 'clmc', title: '材料名称', width: '11%'},
712
-                    {field: 'wlbm', title: '物料编码', width: '11%'},
713
-                    {field: 'cgdj', title: '单价(万元)', width: '13%'},
714
-                    {field: 'bz', title: '备注', width: '50%'}
710
+                    {field: 'xh', title: '序号', align: 'center', width: '7%'},
711
+                    {field: 'clmc', title: '材料名称', width: '30%'},
712
+                    {field: 'wlbm', title: '物料编码', width: '20%'},
713
+                    {field: 'cgdj', title: '采购单价(万元)', width: '11%'},
714
+                    {field: 'bhsje', title: '不含税金额(元))', width: '13%'},
715
+                    {field: 'hsje', title: '含税金额(元))', width: '13%'},
716
+                    {field: 'sqje', title: '申请金额', width: '15%'},
717
+                    {field: 'sl',title: '税率',width: '10%'},
718
+                    {field: 'clfy', title: '备注', width: '15%'}
715 719
                 ]
716 720
             ],
717 721
             autoSort: false,

+ 28 - 22
src/main/resources/templates/stamaterial/add.html

@@ -19,44 +19,50 @@
19 19
         <div class="layui-form-item layui-inline" style="width: 100%">
20 20
             <label class="layui-form-label required" style="width: 70px">材料名称</label>
21 21
             <div class="layui-input-inline" style="width: 640px">
22
-                <input type="text" id="clmc" name="clmc" lay-verify="required" lay-reqtext="设备名称不能为空"
22
+                <input type="text" id="clmc" name="clmc" lay-verify="required" lay-reqtext="材料名称不能为空"
23 23
                        class="layui-input">
24 24
             </div>
25 25
         </div>
26 26
         <div class="layui-form-item layui-inline" style="width: 100%">
27 27
             <label class="layui-form-label required" style="width: 70px">物料编码</label>
28 28
             <div class="layui-input-inline" style="width: 640px">
29
-                <input type="text" id="wlbm" name="wlbm" lay-verify="required" lay-reqtext="设备型号不能为空"
29
+                <input type="text" id="wlbm" name="wlbm" lay-verify="required" lay-reqtext="物料编码不能为空"
30 30
                        class="layui-input">
31 31
             </div>
32 32
         </div>
33
-        <!--        <div class="layui-form-item layui-inline" style="width: 100%">-->
34
-        <!--            <label class="layui-form-label required" style="width: 70px">序号</label>-->
35
-        <!--            <div class="layui-input-inline" style="width: 265px">-->
36
-        <!--                <input type="number" id="xh" name="xh" min = "0" autocomplete="off" lay-verify="required" lay-reqtext="序号不能为空" class="layui-input">-->
37
-        <!--            </div>-->
38
-        <!--            <label class="layui-form-label required" style="width: 70px">申请金额</label>-->
39
-        <!--            <div class="layui-input-inline" style="width: 265px">-->
40
-        <!--                <input type="text" id="fysq" name="fysq" lay-verify="required" lay-reqtext="申请金额" autocomplete="off" class="layui-input">-->
41
-        <!--            </div>-->
42
-        <!--        </div>-->
33
+                <div class="layui-form-item layui-inline" style="width: 100%">
34
+                    <label class="layui-form-label required" style="width: 70px">序号</label>
35
+                    <div class="layui-input-inline" style="width: 265px">
36
+                        <input type="number" id="xh" name="xh" min = "0" autocomplete="off" lay-verify="required" lay-reqtext="序号不能为空" class="layui-input">
37
+                    </div>
38
+                    <label class="layui-form-label required" style="width: 70px">申请金额</label>
39
+                    <div class="layui-input-inline" style="width: 265px">
40
+                        <input type="text" id="sqje" name="sqje" lay-verify="required" lay-reqtext="申请金额不能为空" autocomplete="off" class="layui-input">
41
+                    </div>
42
+                </div>
43 43
         <div class="layui-form-item layui-inline" style="width: 100%">
44 44
             <label class="layui-form-label required" style="width: 70px">单价(万元)</label>
45 45
             <div class="layui-input-inline" style="width: 265px">
46 46
                 <input type="number" id="cgdj" name="cgdj" min="0" lay-verify="required" lay-reqtext="单价不能为空"
47 47
                        autocomplete="off" class="layui-input">
48 48
             </div>
49
-            <!--            <label class="layui-form-label required" style="width: 70px">不含税金额</label>-->
50
-            <!--            <div class="layui-input-inline" style="width: 265px">-->
51
-            <!--                <input type="number" id="bhsje" name="bhsje" class="layui-input" min = "0" lay-verify="required" lay-reqtext="材料费用不能为空" autocomplete="off">-->
52
-            <!--            </div>-->
49
+                        <label class="layui-form-label required" style="width: 70px">不含税金额</label>
50
+                        <div class="layui-input-inline" style="width: 265px">
51
+                            <input type="number" id="bhsje" name="bhsje" class="layui-input" min = "0" lay-verify="required" lay-reqtext="不含税金额不能为空" autocomplete="off">
52
+                        </div>
53
+        </div>
54
+                <div class="layui-form-item layui-inline" style="width: 100%">
55
+                    <label class="layui-form-label required" style="width: 70px">含税金额</label>
56
+                    <div class="layui-input-inline" style="width: 640px">
57
+                        <input type="number" id="hsje" name="hsje" class="layui-input" min="0" lay-verify="requird" lay-reqtext="含税金额不能为空" autocomplete="off">
58
+                    </div>
59
+                </div>
60
+        <div class="layui-form-item layui-inline" style="width: 100%">
61
+            <label class="layui-form-label required" style="width: 70px">税率</label>
62
+            <div class="layui-input-inline" style="width: 640px">
63
+                <input type="text" id="sl" name="sl" class="layui-input" min="0" lay-verify="requird" lay-reqtext="税率不能为空" autocomplete="off">
64
+            </div>
53 65
         </div>
54
-        <!--        <div class="layui-form-item layui-inline" style="width: 100%">-->
55
-        <!--            <label class="layui-form-label" style="width: 70px">含税金额</label>-->
56
-        <!--            <div class="layui-input-inline" style="width: 640px">-->
57
-        <!--                <input type="text" id="hsje" name="hsje" class="layui-input">-->
58
-        <!--            </div>-->
59
-        <!--        </div>-->
60 66
         <div class="layui-form-item layui-inline" style="width: 100%">
61 67
             <label class="layui-form-label" style="width: 70px">备注</label>
62 68
             <div class="layui-input-inline" style="width: 640px">

+ 33 - 24
src/main/resources/templates/stamaterial/update.html

@@ -19,44 +19,50 @@
19 19
         <div class="layui-form-item layui-inline" style="width: 100%">
20 20
             <label class="layui-form-label required" style="width: 70px">材料名称</label>
21 21
             <div class="layui-input-inline" style="width: 640px">
22
-                <input type="text" id="clmc" name="clmc" lay-verify="required" lay-reqtext="设备名称不能为空"
22
+                <input type="text" id="clmc" name="clmc" lay-verify="required" lay-reqtext="材料名称不能为空"
23 23
                        class="layui-input">
24 24
             </div>
25 25
         </div>
26 26
         <div class="layui-form-item layui-inline" style="width: 100%">
27 27
             <label class="layui-form-label required" style="width: 70px">物料编码</label>
28 28
             <div class="layui-input-inline" style="width: 640px">
29
-                <input type="text" id="wlbm" name="wlbm" lay-verify="required" lay-reqtext="设备型号不能为空"
29
+                <input type="text" id="wlbm" name="wlbm" lay-verify="required" lay-reqtext="物料编码不能为空"
30 30
                        class="layui-input">
31 31
             </div>
32 32
         </div>
33
-        <!--        <div class="layui-form-item layui-inline" style="width: 100%">-->
34
-        <!--            <label class="layui-form-label required" style="width: 70px">序号</label>-->
35
-        <!--            <div class="layui-input-inline" style="width: 265px">-->
36
-        <!--                <input type="number" id="xh" name="xh" min = "0" autocomplete="off" lay-verify="required" lay-reqtext="序号不能为空" class="layui-input">-->
37
-        <!--            </div>-->
38
-        <!--            <label class="layui-form-label required" style="width: 70px">申请金额</label>-->
39
-        <!--            <div class="layui-input-inline" style="width: 265px">-->
40
-        <!--                <input type="text" id="fysq" name="fysq" lay-verify="required" lay-reqtext="申请金额" autocomplete="off" class="layui-input">-->
41
-        <!--            </div>-->
42
-        <!--        </div>-->
33
+        <div class="layui-form-item layui-inline" style="width: 100%">
34
+            <label class="layui-form-label required" style="width: 70px">序号</label>
35
+            <div class="layui-input-inline" style="width: 265px">
36
+                <input type="number" id="xh" name="xh" min = "0" autocomplete="off" lay-verify="required" lay-reqtext="序号不能为空" class="layui-input">
37
+            </div>
38
+            <label class="layui-form-label required" style="width: 70px">申请金额</label>
39
+            <div class="layui-input-inline" style="width: 265px">
40
+                <input type="text" id="sqje" name="sqje" lay-verify="required" lay-reqtext="申请金额不能为空" autocomplete="off" class="layui-input">
41
+            </div>
42
+        </div>
43 43
         <div class="layui-form-item layui-inline" style="width: 100%">
44 44
             <label class="layui-form-label required" style="width: 70px">单价(万元)</label>
45 45
             <div class="layui-input-inline" style="width: 265px">
46 46
                 <input type="number" id="cgdj" name="cgdj" min="0" lay-verify="required" lay-reqtext="单价不能为空"
47 47
                        autocomplete="off" class="layui-input">
48 48
             </div>
49
-            <!--            <label class="layui-form-label required" style="width: 70px">不含税金额</label>-->
50
-            <!--            <div class="layui-input-inline" style="width: 265px">-->
51
-            <!--                <input type="number" id="bhsje" name="bhsje" class="layui-input" min = "0" lay-verify="required" lay-reqtext="材料费用不能为空" autocomplete="off">-->
52
-            <!--            </div>-->
49
+            <label class="layui-form-label required" style="width: 70px">不含税金额</label>
50
+            <div class="layui-input-inline" style="width: 265px">
51
+                <input type="number" id="bhsje" name="bhsje" class="layui-input" min = "0" lay-verify="required" lay-reqtext="不含税金额不能为空" autocomplete="off">
52
+            </div>
53
+        </div>
54
+        <div class="layui-form-item layui-inline" style="width: 100%">
55
+            <label class="layui-form-label required" style="width: 70px">含税金额</label>
56
+            <div class="layui-input-inline" style="width: 640px">
57
+                <input type="number" id="hsje" name="hsje" class="layui-input" min="0" lay-verify="requird" lay-reqtext="含税金额不能为空" autocomplete="off">
58
+            </div>
59
+        </div>
60
+        <div class="layui-form-item layui-inline" style="width: 100%">
61
+            <label class="layui-form-label required" style="width: 70px">税率</label>
62
+            <div class="layui-input-inline" style="width: 640px">
63
+                <input type="text" id="sl" name="sl" class="layui-input" min="0" lay-verify="requird" lay-reqtext="税率不能为空" autocomplete="off">
64
+            </div>
53 65
         </div>
54
-        <!--        <div class="layui-form-item layui-inline" style="width: 100%">-->
55
-        <!--            <label class="layui-form-label" style="width: 70px">含税金额</label>-->
56
-        <!--            <div class="layui-input-inline" style="width: 640px">-->
57
-        <!--                <input type="text" id="hsje" name="hsje" class="layui-input">-->
58
-        <!--            </div>-->
59
-        <!--        </div>-->
60 66
         <div class="layui-form-item layui-inline" style="width: 100%">
61 67
             <label class="layui-form-label" style="width: 70px">备注</label>
62 68
             <div class="layui-input-inline" style="width: 640px">
@@ -85,15 +91,18 @@
85 91
     AjaxUtil.ctx = /*[[@{/}]]*/'';
86 92
     layui.use(['form', 'tableSelect', 'laydate'], function () {
87 93
         var form = layui.form;
88
-
89 94
         var materialCost = parent.getMatCost();
95
+        console.log(materialCost);
96
+
90 97
         $("#clmc").val(materialCost.clmc);
91 98
         $("#wlbm").val(materialCost.wlbm);
92
-        $("#fysq").val(materialCost.fysq);
99
+        $("#sqje").val(materialCost.sqje);
93 100
         $("#cgdj").val(materialCost.cgdj);
94 101
         $("#bhsje").val(materialCost.bhsje);
95 102
         $("#hsje").val(materialCost.hsje);
96 103
         $("#bz").val(materialCost.bz);
104
+        $("#xh").val(materialCost.xh);
105
+        $("#sl").val(materialCost.sl);
97 106
 
98 107
         //监听提交
99 108
         form.on('submit(saveBtn)', function (data) {

+ 39 - 28
src/main/resources/templates/stamaterial/view.html

@@ -19,44 +19,50 @@
19 19
         <div class="layui-form-item layui-inline" style="width: 100%">
20 20
             <label class="layui-form-label required" style="width: 70px">材料名称</label>
21 21
             <div class="layui-input-inline" style="width: 640px">
22
-                <input type="text" id="clmc" name="clmc" lay-verify="required" lay-reqtext="设备名称不能为空"
23
-                       class="layui-input">
22
+                <input type="text" id="clmc" name="clmc" lay-verify="required" lay-reqtext="材料名称不能为空"
23
+                       class="layui-input" disabled >
24 24
             </div>
25 25
         </div>
26 26
         <div class="layui-form-item layui-inline" style="width: 100%">
27 27
             <label class="layui-form-label required" style="width: 70px">物料编码</label>
28 28
             <div class="layui-input-inline" style="width: 640px">
29
-                <input type="text" id="wlbm" name="wlbm" lay-verify="required" lay-reqtext="设备型号不能为空"
30
-                       class="layui-input">
29
+                <input type="text" id="wlbm" name="wlbm" lay-verify="required" lay-reqtext="物料编码不能为空"
30
+                       class="layui-input" disabled>
31
+            </div>
32
+        </div>
33
+        <div class="layui-form-item layui-inline" style="width: 100%">
34
+            <label class="layui-form-label required" style="width: 70px">序号</label>
35
+            <div class="layui-input-inline" style="width: 265px">
36
+                <input type="number" id="xh" name="xh" min = "0" autocomplete="off" lay-verify="required" lay-reqtext="序号不能为空" class="layui-input" disabled>
37
+            </div>
38
+            <label class="layui-form-label required" style="width: 70px">申请金额</label>
39
+            <div class="layui-input-inline" style="width: 265px">
40
+                <input type="text" id="sqje" name="sqje" lay-verify="required" lay-reqtext="申请金额不能为空" autocomplete="off" class="layui-input" disabled>
31 41
             </div>
32 42
         </div>
33
-        <!--        <div class="layui-form-item layui-inline" style="width: 100%">-->
34
-        <!--            <label class="layui-form-label required" style="width: 70px">序号</label>-->
35
-        <!--            <div class="layui-input-inline" style="width: 265px">-->
36
-        <!--                <input type="number" id="xh" name="xh" min = "0" autocomplete="off" lay-verify="required" lay-reqtext="序号不能为空" class="layui-input">-->
37
-        <!--            </div>-->
38
-        <!--            <label class="layui-form-label required" style="width: 70px">申请金额</label>-->
39
-        <!--            <div class="layui-input-inline" style="width: 265px">-->
40
-        <!--                <input type="text" id="fysq" name="fysq" lay-verify="required" lay-reqtext="申请金额" autocomplete="off" class="layui-input">-->
41
-        <!--            </div>-->
42
-        <!--        </div>-->
43 43
         <div class="layui-form-item layui-inline" style="width: 100%">
44 44
             <label class="layui-form-label required" style="width: 70px">单价(万元)</label>
45 45
             <div class="layui-input-inline" style="width: 265px">
46 46
                 <input type="number" id="cgdj" name="cgdj" min="0" lay-verify="required" lay-reqtext="单价不能为空"
47
-                       autocomplete="off" class="layui-input">
47
+                       autocomplete="off" class="layui-input" disabled>
48
+            </div>
49
+            <label class="layui-form-label required" style="width: 70px">不含税金额</label>
50
+            <div class="layui-input-inline" style="width: 265px">
51
+                <input type="number" id="bhsje" name="bhsje" class="layui-input" disabled min = "0" lay-verify="required" lay-reqtext="不含税金额不能为空" autocomplete="off">
52
+            </div>
53
+        </div>
54
+        <div class="layui-form-item layui-inline" style="width: 100%">
55
+            <label class="layui-form-label required" style="width: 70px">含税金额</label>
56
+            <div class="layui-input-inline" style="width: 640px">
57
+                <input type="number" id="hsje" name="hsje" class="layui-input" disabled min="0" lay-verify="requird" lay-reqtext="含税金额不能为空" autocomplete="off">
58
+            </div>
59
+        </div>
60
+        <div class="layui-form-item layui-inline" style="width: 100%">
61
+            <label class="layui-form-label required" style="width: 70px">税率</label>
62
+            <div class="layui-input-inline" style="width: 640px">
63
+                <input type="text" id="sl" name="sl" class="layui-input" disabled min="0" lay-verify="requird" lay-reqtext="税率不能为空" autocomplete="off">
48 64
             </div>
49
-            <!--            <label class="layui-form-label required" style="width: 70px">不含税金额</label>-->
50
-            <!--            <div class="layui-input-inline" style="width: 265px">-->
51
-            <!--                <input type="number" id="bhsje" name="bhsje" class="layui-input" min = "0" lay-verify="required" lay-reqtext="材料费用不能为空" autocomplete="off">-->
52
-            <!--            </div>-->
53 65
         </div>
54
-        <!--        <div class="layui-form-item layui-inline" style="width: 100%">-->
55
-        <!--            <label class="layui-form-label" style="width: 70px">含税金额</label>-->
56
-        <!--            <div class="layui-input-inline" style="width: 640px">-->
57
-        <!--                <input type="text" id="hsje" name="hsje" class="layui-input">-->
58
-        <!--            </div>-->
59
-        <!--        </div>-->
60 66
         <div class="layui-form-item layui-inline" style="width: 100%">
61 67
             <label class="layui-form-label" style="width: 70px">备注</label>
62 68
             <div class="layui-input-inline" style="width: 640px">
@@ -65,8 +71,11 @@
65 71
         </div>
66 72
         <!-- 右侧悬浮按钮 -->
67 73
         <div class="right-bottom-btn">
74
+            <button type="button" class="layui-btn" lay-submit lay-filter="saveBtn">
75
+                <i class="layui-icon layui-icon-ok"></i>确定
76
+            </button>
68 77
             <button class="layui-btn" lay-filter="cancleBtn">
69
-                <i class="layui-icon layui-icon-close"></i>关闭
78
+                <i class="layui-icon layui-icon-close"></i>取消
70 79
             </button>
71 80
         </div>
72 81
     </div>
@@ -84,14 +93,16 @@
84 93
         var form = layui.form;
85 94
 
86 95
         var materialCost = parent.getMatCost();
96
+        console.log(materialCost);
87 97
         $("#clmc").val(materialCost.clmc);
88 98
         $("#wlbm").val(materialCost.wlbm);
89
-        $("#fysq").val(materialCost.fysq);
99
+        $("#sqje").val(materialCost.sqje);
90 100
         $("#cgdj").val(materialCost.cgdj);
91 101
         $("#bhsje").val(materialCost.bhsje);
92 102
         $("#hsje").val(materialCost.hsje);
93 103
         $("#bz").val(materialCost.bz);
94
-
104
+        $("#xh").val(materialCost.xh);
105
+        $("#sl").val(materialCost.sl);
95 106
         // 监听取消按钮
96 107
         $("button[lay-filter='cancleBtn']").click(function () {
97 108
             var iframeIndex = parent.layer.getFrameIndex(window.name);

+ 49 - 17
src/main/resources/templates/statistical/material.html

@@ -27,26 +27,31 @@
27 27
                         <div class="layui-inline" style="margin-right: 10px;">
28 28
                             <label class="layui-form-label" style="width: 80px;">项目名称</label>
29 29
                             <div class="layui-input-inline" style="width: 224px;">
30
-                                <input type="text" id="xmmc" name="xmmc" autocomplete="off" class="layui-input">
30
+                                <input type="text" id="XMMC" name="XMMC" autocomplete="off" class="layui-input">
31 31
                             </div>
32 32
                         </div>
33 33
                         <div class="layui-inline" style="margin-right: 10px;">
34 34
                             <label class="layui-form-label" style="width: 80px;">erp编号</label>
35 35
                             <div class="layui-input-inline" style="width: 140px;">
36
-                                <input type="text" id="erpbh" name="erpbh" autocomplete="off" class="layui-input">
36
+                                <input type="text" id="ERPBH" name="ERPBH" autocomplete="off" class="layui-input">
37 37
                             </div>
38 38
                         </div>
39 39
                         <div class="layui-inline" style="margin-right: 10px;">
40 40
                             <label class="layui-form-label" style="width: 80px;">费用申请号</label>
41 41
                             <div class="layui-input-inline" style="width: 140px;">
42
-                                <input type="text" id="fysqbh" name="fysqbh" autocomplete="off" class="layui-input">
42
+                                <input type="text" id="FYSQBH" name="FYSQBH" autocomplete="off" class="layui-input">
43 43
                             </div>
44 44
                         </div>
45 45
                         <div class="layui-inline" style="margin-right: 10px;">
46
-                            <label class="layui-form-label" style="width: 60px;">年度</label>
47
-                            <div class="layui-input-inline" style="width: 140px;">
48
-                                <input type="text" id="nf" name="nf" autocomplete="off" class="layui-input">
46
+                            <label class="layui-form-label" style="width: 60px">年份</label>
47
+                            <div class="layui-input-inline" style="width: 150px">
48
+                                <select name="NF" id="NF" lay-filter="status">
49
+                                    <option value="">全部</option>
50
+                                    <option th:each="item:${yearList}" th:text="${item.nf}"
51
+                                            th:value="${item.nf}"></option>
52
+                                </select>
49 53
                             </div>
54
+
50 55
                         </div>
51 56
                     </div>
52 57
 
@@ -58,7 +63,7 @@
58 63
                             </div>
59 64
                             <div class="layui-form-mid">-</div>
60 65
                             <div class="layui-input-inline" style="width: 100px;">
61
-                                <input type="text" name="JZRQ" id="JZRQ" placeholder="结束日期" class="layui-input" readonly>
66
+                                <input type="text" name="JSRQ" id="JSRQ" placeholder="结束日期" class="layui-input" readonly>
62 67
                             </div>
63 68
                         </div>
64 69
                         <div class="layui-inline">
@@ -97,7 +102,9 @@
97 102
         </fieldset>
98 103
 
99 104
         <script type="text/html" id="toolbarDemo">
100
-
105
+            <button class="layui-btn layui-btn-sm" lay-event="export" style="background-color: #2f363c" >
106
+                <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>批量导出
107
+            </button>
101 108
         </script>
102 109
 
103 110
         <input type="hidden" id="userId" name="userId" class="layui-input" th:value="${userId}">
@@ -139,7 +146,7 @@
139 146
             elem: '#QSRQ'
140 147
         });
141 148
         laydate.render({
142
-            elem: '#JZRQ'
149
+            elem: '#JSRQ'
143 150
         });
144 151
 
145 152
         var currTable = table.render({
@@ -154,6 +161,8 @@
154 161
                     {type: 'numbers', align: 'center',title: '序号'},
155 162
                     {field: 'BM', width: '7%', title: '所属部门'},
156 163
                     {field: 'XMBH', width: '7%', title: '项目编号'},
164
+                    {field: 'NF',width: '5%',title:'年份'},
165
+                    {field: 'BH',width: '7%',title: '费用申请编号'},
157 166
                     {field: 'XMMC', width: '15%', title: '项目名称', sort: true},
158 167
                     {field: 'XMLXMC', width: '10%', title: '项目类型'},
159 168
                     {field: 'CLMC', width: '10%', title: '材料名称'},
@@ -207,11 +216,15 @@
207 216
         form.on('submit(data-reset-btn)', function (data) {
208 217
             form.val("search-form", {
209 218
                 "XMMC": '',
210
-                "CLMC": '',
211
-                'WLBM': '',
212
-                'BZ': '',
219
+                "ERPBH": '',
220
+                'NF': '',
213 221
                 'QSRQ': '',
214
-                'JZRQ': ''
222
+                'JSSJ': '',
223
+                'CLMC':'',
224
+                'WLBM':'',
225
+                'FYSQBH':'',
226
+                'BZ':''
227
+
215 228
             });
216 229
             // 执行搜索重载
217 230
             currTable.reload({
@@ -233,10 +246,29 @@
233 246
                 }
234 247
             });
235 248
         });
236
-        var cancelIndex;
237
-        /**
238
-         * toolbar监听事件
239
-         */
249
+
250
+
251
+        table.on('toolbar(currentTableFilter)', function (obj) {
252
+            if (obj.event ==='export'){
253
+                var formData = form.val('search-form');
254
+                console.log(formData);
255
+                var formDataString = JSON.stringify(formData);
256
+                AjaxUtil.post({
257
+                    url:AjaxUtil.ctx +'staMaterial/getAll/'+formDataString,
258
+                    contentType: "application/json",
259
+                    timeout: 15000, //大批量导出时会出现超时问题
260
+                    success: function(res){
261
+                        console.log(res);
262
+                        table.exportFile('currentTableId',res.data,'xlsx');
263
+                    },
264
+                    error:function (error) {
265
+                        Message.error(error,2000)
266
+
267
+                    }
268
+                });
269
+            }
270
+
271
+        });
240 272
     });
241 273
 
242 274