From 27afdc9418c5e1c7f4bbe9ed7f0dd88e5d9b7103 Mon Sep 17 00:00:00 2001 From: "DESKTOP-ESU4BDD\\WeiZhiQiang" <598748873@qq.com> Date: Fri, 1 Dec 2023 21:05:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=98=E5=B7=A5=E5=AE=B6=E5=BA=AD=E6=88=90?= =?UTF-8?q?=E5=91=98=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86=E6=89=98=E7=AE=A1?= =?UTF-8?q?=E5=88=B0=E8=A1=A8=E5=8D=95=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/sysStaffFamily/sysStaffFamilyAdd.js | 53 ----- .../js/sysStaffFamily/sysStaffFamilyEdit.js | 68 ------ .../js/sysStaffFamily/sysStaffFamilyList.js | 219 +++++++++--------- .../js/sysStaffFamily/sysStaffFamilyMyList.js | 144 ------------ .../tpl/sysStaffFamily/sysStaffFamilyAdd.html | 91 -------- .../sysStaffFamily/sysStaffFamilyEdit.html | 97 -------- .../sysStaffFamily/sysStaffFamilyList.html | 82 ++----- .../sysStaffFamily/sysStaffFamilyMyList.html | 33 --- .../js/sysEveUserStaff/userStaffManage.js | 2 +- 9 files changed, 137 insertions(+), 652 deletions(-) delete mode 100644 ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyAdd.js delete mode 100644 ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyEdit.js delete mode 100644 ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyMyList.js delete mode 100644 ehr/src/main/resources/template/tpl/sysStaffFamily/sysStaffFamilyAdd.html delete mode 100644 ehr/src/main/resources/template/tpl/sysStaffFamily/sysStaffFamilyEdit.html delete mode 100644 ehr/src/main/resources/template/tpl/sysStaffFamily/sysStaffFamilyMyList.html diff --git a/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyAdd.js b/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyAdd.js deleted file mode 100644 index 35d3adf78..000000000 --- a/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyAdd.js +++ /dev/null @@ -1,53 +0,0 @@ - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'jquery', 'winui', 'textool'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$, - textool = layui.textool; - - // 家庭成员关系 - sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["employeeFamilySituation"]["key"], 'select', "relationshipId", '', form); - - // 证件类型 - sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["employeeDocumentType"]["key"], 'select', "cardType", '', form); - - // 政治面貌 - sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["employeesPoliticalOutlook"]["key"], 'select', "politicId", '', form); - - matchingLanguage(); - form.render(); - form.on('submit(formAddBean)', function (data) { - if (winui.verifyForm(data.elem)) { - var params = { - name: $("#name").val(), - sex: $("input[name='userSex']:checked").val(), - relationshipId: $("#relationshipId").val(), - cardType: $("#cardType").val(), - cardNumber: $("#cardNumber").val(), - politicId: $("#politicId").val(), - workUnit: $("#workUnit").val(), - job: $("#job").val(), - emergencyContact: $("#emergencyContact").val(), - staffId: parent.staffId - }; - - AjaxPostUtil.request({url: sysMainMation.ehrBasePath + "sysstafffamily002", params: params, type: 'json', callback: function (json) { - parent.layer.close(index); - parent.refreshCode = '0'; - }}); - } - return false; - }); - - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); - - }); -}); \ No newline at end of file diff --git a/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyEdit.js b/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyEdit.js deleted file mode 100644 index 288cf71a2..000000000 --- a/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyEdit.js +++ /dev/null @@ -1,68 +0,0 @@ - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'jquery', 'winui', 'textool'], function (exports) { - winui.renderColor(); - layui.use(['form'], function (form) { - var index = parent.layer.getFrameIndex(window.name); - var $ = layui.$, - textool = layui.textool; - - showGrid({ - id: "showForm", - url: sysMainMation.ehrBasePath + "sysstafffamily003", - params: {rowId: parent.rowId}, - pagination: false, - method: "GET", - template: $("#beanTemplate").html(), - ajaxSendLoadBefore: function(hdb) {}, - ajaxSendAfter:function (json) { - $("input:radio[name=userSex][value=" + json.bean.sex + "]").attr("checked", true); - $("#emergencyContact").val(json.bean.emergencyContact); - - // 家庭成员关系 - sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["employeeFamilySituation"]["key"], 'select', "relationshipId", json.bean.relationshipId, form); - - // 证件类型 - sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["employeeDocumentType"]["key"], 'select', "cardType", json.bean.cardType, form); - - // 政治面貌 - sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["employeesPoliticalOutlook"]["key"], 'select', "politicId", json.bean.politicId, form); - - matchingLanguage(); - form.render(); - form.on('submit(formEditBean)', function (data) { - if (winui.verifyForm(data.elem)) { - var params = { - name: $("#name").val(), - sex: $("input[name='userSex']:checked").val(), - relationshipId: $("#relationshipId").val(), - cardType: $("#cardType").val(), - cardNumber: $("#cardNumber").val(), - politicId: $("#politicId").val(), - workUnit: $("#workUnit").val(), - job: $("#job").val(), - emergencyContact: $("#emergencyContact").val(), - rowId: parent.rowId - }; - - AjaxPostUtil.request({url: sysMainMation.ehrBasePath + "sysstafffamily004", params: params, type: 'json', callback: function (json) { - parent.layer.close(index); - parent.refreshCode = '0'; - }}); - } - return false; - }); - form.render(); - } - }); - - $("body").on("click", "#cancle", function() { - parent.layer.close(index); - }); - - }); -}); \ No newline at end of file diff --git a/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyList.js b/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyList.js index c641172ef..0d9414ae8 100644 --- a/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyList.js +++ b/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyList.js @@ -1,132 +1,143 @@ -var rowId = ""; +var objectKey = ""; +var objectId = ""; layui.config({ - base: basePath, - version: skyeyeVersion + base: basePath, + version: skyeyeVersion }).extend({ window: 'js/winui.window' }).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { - winui.renderColor(); - var $ = layui.$, - form = layui.form, - table = layui.table; - - initTable(); - function initTable(){ - table.render({ - id: 'messageTable', - elem: '#messageTable', - method: 'post', - url: sysMainMation.ehrBasePath + 'sysstafffamily001', - where: getTableParams(), - even: true, - page: true, - limits: getLimits(), - limit: getLimit(), - cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, - { field: 'name', title: '名称', align: 'left', width: 100 }, - { field: 'relationshipName', title: '与本人关系', width: 100}, - { field: 'sex', title: '性别', width: 80, templet: function (d) { - if(d.sex == '0'){ - return "保密"; - } else if (d.sex == '1'){ - return "男"; - } else if (d.sex == '2'){ - return "女"; - } - }}, - { field: 'cardTypeName', title: '证件类型', width: 100}, - { field: 'cardNumber', title: '证件编号', width: 150 }, - { field: 'politicName', title: '政治面貌', width: 100}, - { field: 'workUnit', title: '工作单位', width: 140}, - { field: 'job', title: '职务', width: 120}, - { field: 'jobNumber', title: '员工工号', align: 'left', width: 80 }, - { field: 'userName', title: '员工姓名', align: 'left', width: 100 }, - { field: 'state', title: '员工状态', align: 'center', width: 80, templet: function (d) { - if(d.state == '1'){ - return "在职"; - } else if (d.state == '2'){ - return "离职"; - } else if (d.state == '3'){ - return "见习"; - } else if (d.state == '4'){ - return "试用"; - } else if (d.state == '5'){ - return "退休"; - } - }}, - { field: 'createTime', title: systemLanguage["com.skyeye.entryTime"][languageType], align: 'center', width: 100}, - { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 100, toolbar: '#tableBar'} - ]], - done: function(json) { - matchingLanguage(); - } - }); - - table.on('tool(messageTable)', function (obj) { - var data = obj.data; - var layEvent = obj.event; - if (layEvent === 'edit') { // 编辑 - edit(data); - } else if (layEvent === 'delete') { // 删除 - deleteRow(data); - } - }); + winui.renderColor(); + var $ = layui.$, + form = layui.form, + table = layui.table; + objectKey = GetUrlParam("objectKey"); + objectId = GetUrlParam("objectId"); + if (isNull(objectKey) || isNull(objectId)) { + winui.window.msg("请传入适用对象信息", {icon: 2, time: 2000}); + return false; } - - form.render(); - - // 编辑 + + table.render({ + id: 'messageTable', + elem: '#messageTable', + method: 'post', + url: sysMainMation.ehrBasePath + 'queryFamilyList', + where: getTableParams(), + even: true, + page: true, + limits: getLimits(), + limit: getLimit(), + cols: [[ + { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, + { field: 'name', title: '姓名', align: 'left', width: 160, templet: function (d) { + return '' + d.name + ''; + }}, + { field: 'workUnit', title: '工作单位', width: 150 }, + { field: 'job', title: '岗位', width: 100 }, + { field: 'sex', title: '性别', width: 100, templet: function (d) { + return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("sexEnum", 'id', d.sex, 'name'); + }}, + { field: 'emergencyContact', title: '紧急联系人', width: 140, templet: function (d) { + return skyeyeClassEnumUtil.getEnumDataNameByCodeAndKey("whetherEnum", 'id', d.emergencyContact, 'name'); + }}, + { field: 'relationshipId', title: '与本人关系', width: 140, templet: function (d) { + return sysDictDataUtil.getDictDataNameByCodeAndKey("EMPLOYEE_FAMILY_SITUATION", d.relationshipId); + }}, + { field: 'cardType', title: '证件类型', width: 150, templet: function (d) { + return sysDictDataUtil.getDictDataNameByCodeAndKey("EMPLOYEE_DOCUMENT_TYPE", d.cardType); + }}, + { field: 'cardNumber', title: '证件号码', width: 150 }, + { field: 'politicId', title: '政治面貌', width: 120, templet: function (d) { + return sysDictDataUtil.getDictDataNameByCodeAndKey("EMPLOYEES_POLITICAL_OUTLOOK", d.politicId); + }}, + { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], align: 'left', width: 120 }, + { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, + { field: 'lastUpdateName', title: systemLanguage["com.skyeye.lastUpdateName"][languageType], align: 'left', width: 120 }, + { field: 'lastUpdateTime', title: systemLanguage["com.skyeye.lastUpdateTime"][languageType], align: 'center', width: 150 }, + { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 100, toolbar: '#tableBar'} + ]], + done: function(json) { + matchingLanguage(); + initTableSearchUtil.initAdvancedSearch(this, json.searchFilter, form, "请输入姓名", function () { + table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); + }); + } + }); + + table.on('tool(messageTable)', function (obj) { + var data = obj.data; + var layEvent = obj.event; + if (layEvent === 'edit') { //编辑 + edit(data); + } else if (layEvent === 'details') { //详情 + details(data); + } else if (layEvent === 'del') { //删除 + del(data); + } + }); + + // 新增 + $("body").on("click", "#addBean", function() { + parent._openNewWindows({ + url: systemCommonUtil.getUrl('FP2023120100001&objectId=' + objectId + '&objectKey=' + objectKey, null), + title: systemLanguage["com.skyeye.addPageTitle"][languageType], + pageId: "sysStaffArchivesAdd", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); + loadTable(); + }}); + }); + + // 编辑 function edit(data) { - rowId = data.id; - _openNewWindows({ - url: "../../tpl/sysStaffFamily/sysStaffFamilyEdit.html", - title: systemLanguage["com.skyeye.editPageTitle"][languageType], - pageId: "sysStaffFamilyEdit", + parent._openNewWindows({ + url: systemCommonUtil.getUrl('FP2023120100002&objectId=' + objectId + '&objectKey=' + objectKey + '&id=' + data.id, null), + title: systemLanguage["com.skyeye.editPageTitle"][languageType], + pageId: "sysStaffArchivesEdit", area: ['90vw', '90vh'], - callBack: function (refreshCode) { + callBack: function (refreshCode) { winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); loadTable(); - } - }); - } - - // 删除 - function deleteRow(data) { + } + }); + } + + // 详情 + function details(data) { + parent._openNewWindows({ + url: systemCommonUtil.getUrl('FP2023120100003&objectId=' + objectId + '&objectKey=' + objectKey + '&id=' + data.id, null), + title: systemLanguage["com.skyeye.detailsPageTitle"][languageType], + pageId: "sysStaffArchivesDetails", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + }}); + } + + // 删除 + function del(data, obj) { layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) { layer.close(index); - AjaxPostUtil.request({url: sysMainMation.ehrBasePath + "sysstafffamily005", params: {rowId: data.id}, type: 'json', method: "DELETE", callback: function (json) { + AjaxPostUtil.request({url: sysMainMation.ehrBasePath + "deleteFamilyById", params: {id: data.id}, type: 'json', method: 'DELETE', callback: function (json) { winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); loadTable(); }}); }); } - // 搜索表单 - $("body").on("click", "#formSearch", function() { - table.reloadData("messageTable", {page: {curr: 1}, where: getTableParams()}); - }); - - // 刷新数据 + form.render(); $("body").on("click", "#reloadTable", function() { - loadTable(); + loadTable(); }); - function loadTable() { table.reloadData("messageTable", {where: getTableParams()}); } function getTableParams() { - return { - name: $("#name").val(), - workUnit: $("#workUnit").val(), - userName: $("#userName").val(), - jobNumber: $("#jobNumber").val(), - state: $("#state").val() - }; - } - + return $.extend(true, {objectKey: objectKey, objectId: objectId}, initTableSearchUtil.getSearchValue("messageTable")); + } + exports('sysStaffFamilyList', {}); }); diff --git a/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyMyList.js b/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyMyList.js deleted file mode 100644 index 7c031a414..000000000 --- a/ehr/src/main/resources/template/js/sysStaffFamily/sysStaffFamilyMyList.js +++ /dev/null @@ -1,144 +0,0 @@ - -var rowId = ""; - -var staffId = ""; - -layui.config({ - base: basePath, - version: skyeyeVersion -}).extend({ - window: 'js/winui.window' -}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) { - winui.renderColor(); - var $ = layui.$, - form = layui.form, - table = layui.table; - - authBtn('1601785417437'); - // 获取当前登录员工信息 - systemCommonUtil.getSysCurrentLoginUserMation(function (data) { - staffId = data.bean.staffId; - }); - initTable(); - - function initTable(){ - table.render({ - id: 'messageTable', - elem: '#messageTable', - method: 'post', - url: sysMainMation.ehrBasePath + 'sysstafffamily006', - where: getTableParams(), - even: true, - page: true, - limits: getLimits(), - limit: getLimit(), - cols: [[ - { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, - { field: 'name', title: '名称', align: 'left', width: 100 }, - { field: 'relationshipName', title: '与本人关系', width: 100}, - { field: 'sex', title: '性别', width: 80, templet: function (d) { - if(d.sex == '0'){ - return "保密"; - } else if (d.sex == '1'){ - return "男"; - } else if (d.sex == '2'){ - return "女"; - } - }}, - { field: 'cardTypeName', title: '证件类型', width: 100}, - { field: 'cardNumber', title: '证件编号', width: 150 }, - { field: 'politicName', title: '政治面貌', width: 100}, - { field: 'workUnit', title: '工作单位', width: 140}, - { field: 'job', title: '职务', width: 120}, - { field: 'jobNumber', title: '员工工号', align: 'left', width: 80 }, - { field: 'userName', title: '员工姓名', align: 'left', width: 100 }, - { field: 'state', title: '员工状态', align: 'center', width: 80, templet: function (d) { - if(d.state == '1'){ - return "在职"; - } else if (d.state == '2'){ - return "离职"; - } else if (d.state == '3'){ - return "见习"; - } else if (d.state == '4'){ - return "试用"; - } else if (d.state == '5'){ - return "退休"; - } - }}, - { field: 'createTime', title: systemLanguage["com.skyeye.entryTime"][languageType], align: 'center', width: 100}, - { title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 100, toolbar: '#tableBar'} - ]], - done: function(json) { - matchingLanguage(); - } - }); - - table.on('tool(messageTable)', function (obj) { - var data = obj.data; - var layEvent = obj.event; - if (layEvent === 'edit') { // 编辑 - edit(data); - } else if (layEvent === 'delete') { // 删除 - deleteRow(data); - } - }); - } - - form.render(); - - // 录入家庭成员 - $("body").on("click", "#addBean", function() { - _openNewWindows({ - url: "../../tpl/sysStaffFamily/sysStaffFamilyAdd.html", - title: "录入家庭成员", - pageId: "sysStaffFamilyAdd", - area: ['90vw', '90vh'], - callBack: function (refreshCode) { - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - }); - - // 编辑 - function edit(data) { - rowId = data.id; - _openNewWindows({ - url: "../../tpl/sysStaffFamily/sysStaffFamilyEdit.html", - title: systemLanguage["com.skyeye.editPageTitle"][languageType], - pageId: "sysStaffFamilyEdit", - area: ['90vw', '90vh'], - callBack: function (refreshCode) { - winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000}); - loadTable(); - } - }); - } - - // 删除 - function deleteRow(data) { - layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function (index) { - layer.close(index); - AjaxPostUtil.request({url: sysMainMation.ehrBasePath + "sysstafffamily005", params: {rowId: data.id}, type: 'json', method: "DELETE", callback: function (json) { - winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000}); - loadTable(); - }}); - }); - } - - // 刷新数据 - $("body").on("click", "#reloadTable", function() { - loadTable(); - }); - - function loadTable() { - table.reloadData("messageTable", {where: getTableParams()}); - } - - function getTableParams() { - return { - staffId: staffId - }; - } - - exports('sysStaffFamilyMyList', {}); -}); diff --git a/ehr/src/main/resources/template/tpl/sysStaffFamily/sysStaffFamilyAdd.html b/ehr/src/main/resources/template/tpl/sysStaffFamily/sysStaffFamilyAdd.html deleted file mode 100644 index 0abf9b40f..000000000 --- a/ehr/src/main/resources/template/tpl/sysStaffFamily/sysStaffFamilyAdd.html +++ /dev/null @@ -1,91 +0,0 @@ - - -
- -