Browse Source

合同添加限制禁止超过项目总预算

梁世豪 3 months ago
parent
commit
ee3e285b17

+ 2 - 0
src/main/java/com/liang/entity/PrjContract.java

@@ -93,6 +93,8 @@ public class PrjContract implements Serializable {
93 93
     private Date yqrq;
94 94
     private String  xmmc;
95 95
 
96
+    private Integer sfys;
97
+
96 98
     public void setYqrq(String yqrqStr) {
97 99
         if (yqrqStr!= null &&!yqrqStr.isEmpty()) {
98 100
             try {

+ 11 - 2
src/main/resources/templates/prjcontract/add.html

@@ -204,17 +204,16 @@
204 204
         var htId = -1;
205 205
         var kssj = '',
206 206
             jssj = '';
207
-            yssj = '';
208 207
             yqrq = '';
209 208
             rwsqssj='';
210 209
             rwswcsj='';
210
+        var xmzys = '';
211 211
         //申请时间
212 212
         laydate.render({
213 213
             elem: '#kssj',
214 214
             done: function (value, date, endDate) {
215 215
                 sqsj1 = $("#kssj").val();
216 216
                 sqsj2 = $("#jssj").val();
217
-                yssj = $("#yssj").val();
218 217
                 if (rwsqssj ==''||rwswcsj==''){
219 218
                     layer.msg('请先选择任务书!',{icon:8});
220 219
                     $("#kssj").val("");
@@ -355,6 +354,7 @@
355 354
                         rwsId = localStorage.getItem("rws");
356 355
                         rwsqssj = localStorage.getItem("rwsqssj");
357 356
                         rwswcsj = localStorage.getItem("rwswcsj");
357
+                        xmzys = localStorage.getItem("jf");
358 358
                         var updateflag = localStorage.getItem("updateflag");
359 359
                         if (updateflag == "1") {
360 360
                             var rwsmc = localStorage.getItem("rwsmc");
@@ -529,6 +529,15 @@
529 529
 
530 530
         // 监听确认按钮(常规)
531 531
         form.on('submit(saveBtn)', function (data) {
532
+            var htje =data.field.htje;
533
+            if (xmzys == null || xmzys == ''){
534
+                alert('保存失败,当前任务书项目总预算为空,请完善当前任务书的子课题!')
535
+                return false;
536
+            }
537
+            if (htje > xmzys/10000){//校验合同金额是否大于项目总预算
538
+                alert('保存失败,填写的合同金额大于任务书项目总预算,项目总预算为:'+xmzys/10000+'万元');
539
+                return false;
540
+            }
532 541
             //合同文件
533 542
             var dataWB_Htwj = [];
534 543
             for (const item of dataHtwj) {

+ 2 - 2
src/main/resources/templates/prjcontract/list_project.html

@@ -146,7 +146,6 @@
146 146
         table.on('row(currentTableFilter)', function (obj) {
147 147
             project = obj.data;
148 148
             obj.tr.addClass('layui-bg-blue').siblings().removeClass('layui-bg-blue');
149
-
150 149
             localStorage.setItem("rws", project.id);
151 150
             localStorage.setItem("rwsmc", project.zwmc);
152 151
             localStorage.setItem("rwsqssj", project.qs);
@@ -161,13 +160,13 @@
161 160
             localStorage.setItem("xmfzrxm", project.xmfzrxm == null ? '' : project.xmfzrxm);
162 161
             localStorage.setItem("ssbm", project.ssbm == null ? '' : project.ssbm);
163 162
             localStorage.setItem("ssbmmc", project.ssbmmc == null ? '' : project.ssbmmc);
163
+            localStorage.setItem("jf", project.jf == null ? '' : project.jf);
164 164
         });
165 165
 
166 166
         //双击
167 167
         table.on('rowDouble(currentTableFilter)', function (obj) {
168 168
             project = obj.data;
169 169
             obj.tr.addClass('layui-bg-blue').siblings().removeClass('layui-bg-blue');
170
-
171 170
             localStorage.setItem("rws", project.id);
172 171
             localStorage.setItem("rwsmc", project.zwmc);
173 172
             localStorage.setItem("xmzxq", project.qs + ' 至 ' + project.wc);
@@ -180,6 +179,7 @@
180 179
             localStorage.setItem("xmfzrxm", project.xmfzrxm == null ? '' : project.xmfzrxm);
181 180
             localStorage.setItem("ssbm", project.ssbm == null ? '' : project.ssbm);
182 181
             localStorage.setItem("ssbmmc", project.ssbmmc == null ? '' : project.ssbmmc);
182
+            localStorage.setItem("jf", project.jf == null ? '' : project.jf);
183 183
             localStorage.setItem("updateflag", "1");
184 184
 
185 185
             parent.layer.close(parent.layer.getFrameIndex(window.name));// 关闭子窗口