Parcourir la source

bug修复方案更新

xtf il y a 8 mois
Parent
commit
e029d83da7
1 fichiers modifiés avec 10 ajouts et 5 suppressions
  1. 10 5
      src/js/qcScore.js

+ 10 - 5
src/js/qcScore.js

@@ -201,15 +201,19 @@ $(function () {
     return false;
   }
   //发送入院记录
-  function sendRuleWarn(msg, i) {
+  function sendRuleWarn(msg, i, this_flaw) {
 
+    // console.log(i, code);
 
     post(api.sendRuleWarn, {
       "behospitalCode": global_id,
       "msg": msg.msg
     }).then(function (res) {
       if (res.data.code === '0' && res.data.data === true) {
-        $(".send-flaw:eq(" + i + ")").text("已发送");
+        this_flaw.text("已发送")
+        this_flaw.off('click')
+        // $(".send-flaw:eq(" + i + ")").text("已发送");
+        // $(".send-flaw:eq(" + i + ")").off('click');
         // $(".ysend-flaw:eq(" + i + ")").css({
         //   "display": "inline"
         // });
@@ -531,7 +535,8 @@ $(function () {
       $("#flawTmpl").tmpl(data[k]).appendTo("#flaws .flaw-box");
     }
     showFlawList();
-    $(".flaw-item .oper a").unbind("click").click(function (e) {
+    $(".flaw-item .oper a").not(".ysend-flaw").unbind("click").click(function (e) {
+
       const i = $(".flaw-item[code=" + global_activeTab + "]").index($(this).parents(".flaw-item"));
       const code = $(this).attr("code");
       const isEdit = $(this).is(".edit-flaw");
@@ -557,7 +562,7 @@ $(function () {
           // const msg = $(".send-flaw:eq(" + i + ")").parent(".oper").parent(".opers").prev(".title").text();
           // console.log($(".send-flaw:eq(" + i + ")").parent(".oper").parent(".opers").prev(".title").text());
           // sendRuleWarn(msg.replace(/\s/g, ""), i)
-          showModal('4', code, i); //发送
+          showModal('4', $(this), i); //发送
         }
         else {
           showModal('1', code, i); //删除
@@ -904,7 +909,7 @@ $(function () {
       $("#delModal .modal-body").html('<p>确定要发送吗?</p>');
       $("#delModal .confirm").text("确定").unbind("click").click(function () {
 
-        sendRuleWarn(info, i)
+        sendRuleWarn(info, i, code)
 
       });
       $("#delModal .cancel").show().text("取消").unbind("click").click(function () {