From 0a16f029198c4f914b6a19062f03c412415ec312 Mon Sep 17 00:00:00 2001
From: zhaoxiaohao <279049017@qq.com>
Date: Tue, 01 Dec 2020 09:57:02 +0800
Subject: [PATCH] 修改 页面的bug

---
 kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html       |   19 +++++++++++++++++++
 kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/rechargeupdate.html |   22 ++++++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html
index 8c2e17b..5d99749 100644
--- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html
+++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/recharge.html
@@ -641,6 +641,8 @@
                     return false;
                 } else {
                     contractNum = $("#contractNum").val();
+                    //将自定义的读片量赋值
+                    $("#custom_ailightCount").val($("#contractNum").val()-listNum);
                 }
             })
             //自定义的确定
@@ -699,6 +701,8 @@
                 if (!strUtil.isEmpty(obj.data.id)) {
                     delTempDataById(obj.data.id);
                     obj.del();
+                    //将自定义的数量赋值
+                    zidingyiNum()
                 }
             }
         });
@@ -771,6 +775,8 @@
                         data.id = data.id + '';
                         tempDataList(data);
                         waitRecharge();
+                        //将自定义的数量赋值
+                        zidingyiNum()
                     } else {
                         layer.msg("结束时间必须大于开始时间!");
                         return false;
@@ -781,6 +787,19 @@
                 }
             }
         });
+        //将自定义的数量重新赋值
+        function zidingyiNum(){
+            var listData = admin.getTempData("t_tempProduct");
+            var listNum = 0;
+            if (!strUtil.isEmpty(listData)) {
+                listData.forEach(item => {
+                    if(item.proType==1){
+                        listNum += item.ailightCount;
+                    }
+                })
+            }
+            $("#custom_ailightCount").val($("#contractNum").val()-listNum);     
+        }
         function isthenNum(num) {
             if (num <= 0) {
                 return "请输入合同读片充值量大于0";
diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/rechargeupdate.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/rechargeupdate.html
index 3fb6097..cb8cf26 100644
--- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/rechargeupdate.html
+++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/rechargeupdate.html
@@ -407,6 +407,19 @@
                 ]
             });
         }
+         //将自定义的数量重新赋值
+         function zidingyiNum(){
+            var listData = admin.getTempData("t_tempProduct");
+            var listNum = 0;
+            if (!strUtil.isEmpty(listData)) {
+                listData.forEach(item => {
+                    if(item.proType==1){
+                        listNum += item.ailightCount;
+                    }
+                })
+            }
+            $("#custom_ailightCount").val($("#contractNum_not").val()-listNum);     
+        }
         //待充值列表
         var nowContract = function () {
             table.render({
@@ -481,6 +494,8 @@
                         }
                     });
                     $("#contractNum_not").val($("#contractNum").val() - num);
+                     //将自定义的数量赋值
+                    zidingyiNum();
                 }
             });
         }
@@ -551,12 +566,14 @@
 
                 }, "get")
         }
+        
 
         //回显医院基本数据
         let hospitalData = admin.getTempData('t_hospital');
 
         if (hospitalData != null) {
             nowContract();
+            
             admin.req('api-user/sysdepartment/getPayMes?departmentId=' + hospitalData.departmentId, {},
                 function (data) {
                     layer.closeAll('loading');
@@ -809,6 +826,8 @@
                 if (!strUtil.isEmpty(obj.data.id)) {
                     delTempDataById(obj.data.id);
                     obj.del();
+                    //将自定义的数量赋值
+                    zidingyiNum();
                 }
             }
         });
@@ -881,6 +900,8 @@
                         data.id = data.id + '';
                         tempDataList(data);
                         waitRecharge();
+                        //将自定义的数量赋值
+                        zidingyiNum()
                     } else {
                         layer.msg("结束时间必须大于开始时间!");
                         return false;
@@ -891,6 +912,7 @@
                 }
             }
         });
+       
         // $("#contractNum_not").val($("#contractNum").val() - num);
         function isthenNum(num) {
             if (num <= 0) {

--
Gitblit v1.8.0