From 52f525cda84531f2110b4cb745a9e403bac75946 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Thu, 1 Jun 2023 08:34:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E8=88=AC=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E6=97=B6=E7=BB=84=E5=90=88=E5=87=BA=E5=BA=93=E6=97=B6?= =?UTF-8?q?=E4=BB=A3=E9=A2=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/group/applicationOutForGroup.html | 146 +++++++++++++++++- 1 file changed, 143 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/pages/group/applicationOutForGroup.html b/src/main/resources/templates/pages/group/applicationOutForGroup.html index b27383cb..17cc9699 100644 --- a/src/main/resources/templates/pages/group/applicationOutForGroup.html +++ b/src/main/resources/templates/pages/group/applicationOutForGroup.html @@ -60,6 +60,44 @@
+
+
+ +
+ +
+
+ + +
+ +
@@ -128,6 +166,15 @@ function selectCodeForGroup(obj) { } + function selectUser(){ + + } + + function SelectTheUser(){ + + } + + // 用于标志是否为第一次提交 let flagForForm = false; @@ -214,6 +261,24 @@ }); + + // 监听开关 + form.on('switch()', function (data) { + let isAgency = data.elem.checked; //开关是否开启,true或者false + let id = data.elem.id; + if (isAgency) { + // 如果开启了代领功能 + $("#agencyItem" + id).show(); + // 添加必填 + $("#agencyUid" + id).attr("lay-verify", "required"); + + } else { + $("#agencyItem" + id).hide(); + // 删除必填 + $("#agencyUid" + id).removeAttr("lay-verify"); + + } + }); $('.pre').click(function () { step.pre('#stepForm2'); }); @@ -799,11 +864,86 @@ } return result; } + // 用于选择代领用户 + selectUser = function (obj) { + let id = obj.id; + if (id.indexOf("ForGroup") !== -1) { + id = "ForGroup"; + } + let name = obj.value; + if (name !== "") { + let req = {}; + req.name = name; + req.scope = "department"; + $.ajax({ + url: "/sys/findUserByName", + type: "post", + data: JSON.stringify(req), + dataType: 'json', + contentType: "application/json;charset=utf-8", + beforeSend: function () { + this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); + }, + success: function (res) { + layer.close(this.layerIndex); + let data = res.data; + let count = res.count; + if (count === 0) { + layer.msg("部门中不存在该用户,请重试", { + icon: 0, + time: 1000 + }, function () { + $("#adminorgId" + id).val(""); + $("#agencyAdminorg" + id).val(""); + $("#agencyUid" + id).val(""); + $("#agencyUser" + id).val(""); + }) + } else if (count > 1) { + + let content = ``; + $.each(data, function (index, item) { + let listItem = `
+ +
`; + content += listItem; + }); + selectUserIfame = layer.open({ + type: 1, + title: false, + area: ["70%", "70%"], + content: content + }) + } else { + let user = data[0]; + $("#adminorgId" + id).val(user.maindeparment); + $("#agencyAdminorg" + id).val(user.maindeparmentname); + $("#agencyUid" + id).val(user.id); + $("#agencyUser" + id).val(user.name); + } + } + }) + } + }; + // 用于选定人员 + SelectTheUser = function (obj) { + let data = $(obj); + let isGroup = data.attr("isGroup"); + if (isGroup !== "ForGroup") { + isGroup = ""; + } + + let adminorg = data.attr("adminorg"); + let adminorgName = data.attr("adminorgname"); + let id = data.attr("id"); + let name = data.attr("name"); + $("#adminorgId" + isGroup).val(adminorg); + $("#agencyAdminorg" + isGroup).val(adminorgName); + $("#agencyUid" + isGroup).val(id); + $("#agencyUser" + isGroup).val(name); + layer.close(selectUserIfame) + }; - $('body').on('click', '[data-refresh]', function () { - location.reload(); - }) })