Browse Source

付款计划保存系统总金额计算错误问题,合同添加导出列表项

梁世豪 4 months ago
parent
commit
8df18543fb

+ 2 - 0
src/main/java/com/liang/controller/PrjPayplanController.java

@@ -16,6 +16,7 @@ import org.springframework.data.domain.Page;
16 16
 import org.springframework.data.domain.PageRequest;
17 17
 import org.springframework.http.ResponseEntity;
18 18
 import org.springframework.stereotype.Controller;
19
+import org.springframework.transaction.annotation.Transactional;
19 20
 import org.springframework.ui.Model;
20 21
 import org.springframework.web.bind.annotation.*;
21 22
 
@@ -153,6 +154,7 @@ public class PrjPayplanController extends BaseController {
153 154
 
154 155
     @ResponseBody
155 156
     @RequestMapping(value = "/doAdd1", method = RequestMethod.POST)
157
+    @Transactional
156 158
         public BaseResult doAdd( @RequestBody String data,
157 159
                             @RequestParam(required = false,value = "htje")Double htje) {
158 160
         List<PrjPayplan> prjPayplanList = JsonTool.parseArray(data, PrjPayplan.class);

+ 2 - 1
src/main/resources/mapper/PrjContractDao.xml

@@ -174,7 +174,8 @@
174 174
                 ZT = #{zt},
175 175
             </if>
176 176
                 KSSJ = #{kssj},
177
-                JSSJ = #{jssj}
177
+                JSSJ = #{jssj},
178
+                YSSJ = #{yssj}
178 179
         </set>
179 180
         where ID = #{id}
180 181
     </update>

+ 6 - 3
src/main/resources/templates/prjcontract/add.html

@@ -54,10 +54,10 @@
54 54
                             <div class="layui-input-inline" style="width: 25%">
55 55
                                 <input type="text" id="zbpc" name="zbpc" autocomplete="off" class="layui-input" lay-verify="required" lay-reqtext="招标批次不能为空!">
56 56
                             </div>
57
-                            <label class="layui-form-label required " style="width: 15%">中选单位</label>
57
+                            <label class="layui-form-label  " style="width: 15%">中选单位</label>
58 58
                             <div class="layui-input-inline" style="width: 35%">
59 59
                                 <input type="text" id="zxdw" name="zxdw" class="layui-input"
60
-                                       autocomplete="off" lay-verify="required" lay-reqtext="中标单位不能为空!">
60
+                                       autocomplete="off">
61 61
                             </div>
62 62
                         </div>
63 63
 
@@ -814,13 +814,15 @@
814 814
             var htje =parseFloat($("#htje").val())
815 815
             var prjPayplanList =[];
816 816
             var count = 0;
817
+            var sum =0;
817 818
             if (!subTopics && subTopics.length === 0) {
818 819
                 Message.warning("请先创建付款计划!!!", 1500);
819 820
                 return;
820 821
             }
821 822
             for (let i = 0; i < subTopics.length; i++) {
822
-                count += parseFloat(subTopics[i].zfje) || 0;
823
+                sum += parseFloat(subTopics[i].zfje*10000) || 0;
823 824
             }
825
+            count = sum/10000;
824 826
             for (const item of subTopics) {
825 827
                 var prjPayplan = {
826 828
                     "fkxx": item.fkxx,
@@ -833,6 +835,7 @@
833 835
                 };
834 836
                 prjPayplanList.push(prjPayplan);
835 837
             }
838
+            console.log(sum)
836 839
             console.log(count)
837 840
             console.log(htje)
838 841
             console.log(subTopics)

+ 11 - 0
src/main/resources/templates/prjcontract/list.html

@@ -173,11 +173,22 @@
173 173
                     {field: 'htje', width: '8%', title: '合同金额(万元)', align: 'right'},
174 174
                     {field: 'yfje',width: '10%',title: '已付金额(万元)',align: 'right'},
175 175
                     {field: 'htmc', width: '20%', title: '合同名称'},
176
+                    {field: 'zbpc', width: '8%', title: '招标批次'},
177
+                    {field: 'zxdw', width: '8%', title: '中选单位'},
178
+                    {field: 'sfsxtndw', width: '8%', title: '是否系统内单位', align: 'center', templet: function (d) {
179
+                            if (0 == d.sfsxtndw) {
180
+                                return '<span class="layui-badge layui-bg-blue">是</span>';
181
+                            } else {
182
+                                return '<span class="layui-badge layui-bg-orange">否</span>';
183
+                            }
184
+                        }
185
+                    },
176 186
                     {field: 'zq', width: '6%',title: '周期(月)',align: 'left'},
177 187
                     {field: 'kssj',width: '10%',title: '执行周期(开始)',align: 'center'},
178 188
                     {field: 'jssj',width: '10%',title: '执行周期(结束)',align: 'center'},
179 189
                     {field: 'cjrxm', width: '8%', title: '创建人', align: 'center'},
180 190
                     {field: 'cjsj', width: '10%', title: '创建时间', align: 'center'},
191
+                    {field: 'yssj', width: '10%', title: '验收时间', align: 'center'},
181 192
                     {title: '操作',width: '5%',toolbar:'#cz',align: 'center',fixed: 'right'}
182 193
                 ]
183 194
             ],

+ 29 - 4
src/main/resources/templates/prjcontract/update.html

@@ -99,9 +99,9 @@
99 99
                             <div class="layui-input-inline" style="width: 25%">
100 100
                                 <input type="text" id="zbpc" name="zbpc" autocomplete="off" class="layui-input" lay-verify="required" lay-reqtext="招标批次不能为空" th:value="${contract.zbpc}">
101 101
                             </div>
102
-                            <label class="layui-form-label required" style="width: 15%">中选单位</label>
102
+                            <label class="layui-form-label" style="width: 15%">中选单位</label>
103 103
                             <div class="layui-input-inline" style="width: 35%">
104
-                                <input type="text" id="zxdw" name="zxdw" class="layui-input" autocomplete="off" th:value="${contract.zxdw}" lay-verify="required" lay-reqtext="中选单位不能为空" >
104
+                                <input type="text" id="zxdw" name="zxdw" class="layui-input" autocomplete="off" th:value="${contract.zxdw}" >
105 105
                             </div>
106 106
                         </div>
107 107
 
@@ -126,9 +126,11 @@
126 126
                             </div>
127 127
                             <label class="layui-form-label required" style="width: 15%">是否是系统内单位</label>
128 128
                             <div class="layui-input-inline" style="width: 10%">
129
-                                <input type="text" name="sfsxtndw" id="sfsxtndw" placeholder="终止时间" class="layui-input" lay-verify="required" lay-reqtext="结束不能为空"
129
+                                <input type="text" name="display_sfsxtndw" id="display_sfsxtndw" placeholder="终止时间" class="layui-input" lay-verify="required" lay-reqtext="结束不能为空"
130 130
                                        th:value="${contract.sfsxtndw == 0?'是':'否'}"
131 131
                                        readonly>
132
+                                <input type="hidden" name="sfsxtndw" id="sfsxtndw"
133
+                                       th:value="${contract.sfsxtndw}">
132 134
                             </div>
133 135
                         </div>
134 136
 
@@ -328,6 +330,26 @@
328 330
 
329 331
             }
330 332
         });
333
+        laydate.render({
334
+            elem: '#yssj',
335
+            done: function (value, date, endDate) {
336
+                sqsj1 = $("#kssj").val();
337
+                sqsj2 = $("#jssj").val();
338
+                yssj = $("#yssj").val();
339
+                if (sqsj1 != '' && yssj != ''){
340
+                    if (yssj <= sqsj1){
341
+                        layer.msg('验收时间不能早于或等于合同开始时间!',{icon:2});
342
+                        $("#yssj").val("");
343
+
344
+                    }
345
+                }else {
346
+                    layer.msg('请先填写执行周期!',{icon:8});
347
+                    $("#yssj").val("");
348
+                }
349
+
350
+            }
351
+        });
352
+
331 353
         // 用于存放表格数据
332 354
         var dataHtwj = new Array();
333 355
         if ([[${contract.wj}]] != null && [[${contract.wj}]] != "") {
@@ -794,13 +816,15 @@
794 816
             var htje =parseFloat($("#htje").val())
795 817
             var prjPayplanList =[];
796 818
             var count = 0;
819
+            var sum = 0;
797 820
             if (!subTopics && subTopics.length === 0) {
798 821
                 Message.warning("请先创建付款计划!!!", 1500);
799 822
                 return;
800 823
             }
801 824
             for (let i = 0; i < subTopics.length; i++) {
802
-                count += parseFloat(subTopics[i].zfje) || 0;
825
+                sum += parseFloat(subTopics[i].zfje*10000) || 0;
803 826
             }
827
+            count =sum/10000;
804 828
             for (const item of subTopics) {
805 829
                 var prjPayplan = {
806 830
                     "fkxx": item.fkxx,
@@ -813,6 +837,7 @@
813 837
                 };
814 838
                 prjPayplanList.push(prjPayplan);
815 839
             }
840
+            console.log(sum)
816 841
             console.log(count)
817 842
             console.log(htje)
818 843
             console.log(subTopics)