Parcourir la source

feat: 数据后台,配置定额库弹窗,下拉选项应只显示未配置的定额库(GLY-5907)

zhangweicheng il y a 1 mois
Parent
commit
86fdd75c6e
1 fichiers modifiés avec 19 ajouts et 0 suppressions
  1. 19 0
      web/users/js/compilation.js

+ 19 - 0
web/users/js/compilation.js

@@ -173,6 +173,25 @@ $(document).ready(function () {
     $("#addTaxGroup").modal("hide");
   });
 
+  $("#addRatioBtn").click(function () {
+    let rationLibData = rationList === undefined ? [] : JSON.parse(rationList);
+    let unSelectLibs = [];
+    for (let lib of rationLibData) {
+      if (
+        $("input:hidden[name=ration_lib][data-id = " + lib.id + "]").length > 0
+      ) {
+        continue;
+      }
+      unSelectLibs.push(lib);
+    }
+    let html = "";
+    for (let tmp of unSelectLibs) {
+      let tmpHtml = '<option value="' + tmp.id + '">' + tmp.name + "</option>";
+      html += tmpHtml;
+    }
+    $("select[name='ration_lib']").html(html);
+  });
+
   $("#ration_lib-search-box").on("input", function () {
     var keyword = $(this).val().toLowerCase().trim(); // 获取输入的关键字并转为小写
     // 遍历所有option元素