From 96b21945d6b4a31c2fdce5be787864bf81c126a3 Mon Sep 17 00:00:00 2001 From: weizhiqiang <598748873@qq.com> Date: Thu, 6 Jan 2022 22:18:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E8=AE=A1=E7=A7=91=E7=9B=AE=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BD=99=E9=A2=9D=E6=96=B9=E5=90=91=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../js/ifsAccountSubject/ifsAccountSubjectAdd.js | 5 +++++ .../ifsAccountSubject/ifsAccountSubjectDetails.js | 1 + .../js/ifsAccountSubject/ifsAccountSubjectEdit.js | 8 +++++++- .../js/ifsAccountSubject/ifsAccountSubjectList.js | 11 ++++++++++- .../ifsAccountSubjectListChoose.js | 5 ++++- .../tpl/ifsAccountSubject/ifsAccountSubjectAdd.html | 6 ++++++ .../ifsAccountSubject/ifsAccountSubjectDetails.html | 6 ++++++ .../ifsAccountSubject/ifsAccountSubjectEdit.html | 6 ++++++ .../assets/lib/layui/customer/accountSubjectUtil.js | 12 +++++++----- .../assets/lib/layui/customer/sysIfsUtil.js | 9 +++++++++ .../resources/template/assets/lib/winui/winui.js | 13 +++++++++++-- .../template/tpl/template/radio-property.tpl | 3 +++ 12 files changed, 75 insertions(+), 10 deletions(-) create mode 100644 web/src/main/resources/template/tpl/template/radio-property.tpl diff --git a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectAdd.js b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectAdd.js index 82c753a44..eff1ff94b 100644 --- a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectAdd.js +++ b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectAdd.js @@ -10,9 +10,13 @@ layui.config({ var $ = layui.$, textool = layui.textool; var selTemplate = getFileContent('tpl/template/select-option.tpl'); + var radioTemplate = getFileContent('tpl/template/radio-property.tpl'); $("#type").html(getDataUseHandlebars(selTemplate, {rows: accountSubjectUtil.accountSubjectType})); + // 余额方向 + $("#amountDirectionBox").html(getDataUseHandlebars(radioTemplate, {rows: sysIfsUtil.amountDirection})); + textool.init({ eleId: 'remark', maxlength: 200, @@ -26,6 +30,7 @@ layui.config({ var params = { name: $("#name").val(), state: $("input[name='state']:checked").val(), + amountDirection: $("input[name='radioProperty']:checked").val(), num: $("#num").val(), type: $("#type").val(), remark: $("#remark").val() diff --git a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectDetails.js b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectDetails.js index 96cc17a37..a6a54b841 100644 --- a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectDetails.js +++ b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectDetails.js @@ -18,6 +18,7 @@ layui.config({ template: $("#simpleTemplate").html(), ajaxSendAfter:function(json){ $("#state").html(json.bean.state == "1" ? "启用" : "停用"); + $("#amountDirectionBox").html(sysIfsUtil.getAmountDirectionById(json.bean.amountDirection)); $("#type").html(getInPoingArr(accountSubjectUtil.accountSubjectType, "id", json.bean.type, "name")); matchingLanguage(); form.render(); diff --git a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectEdit.js b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectEdit.js index da12eb545..343e6a115 100644 --- a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectEdit.js +++ b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectEdit.js @@ -9,6 +9,8 @@ layui.config({ var index = parent.layer.getFrameIndex(window.name); var $ = layui.$, textool = layui.textool; + var selTemplate = getFileContent('tpl/template/select-option.tpl'); + var radioTemplate = getFileContent('tpl/template/radio-property.tpl'); showGrid({ id: "showForm", @@ -27,10 +29,13 @@ layui.config({ tools: ['count', 'copy', 'reset', 'clear'] }); - var selTemplate = getFileContent('tpl/template/select-option.tpl'); $("#type").html(getDataUseHandlebars(selTemplate, {rows: accountSubjectUtil.accountSubjectType})); $("#type").val(json.bean.type); + // 余额方向 + $("#amountDirectionBox").html(getDataUseHandlebars(radioTemplate, {rows: sysIfsUtil.amountDirection})); + $("input:radio[name=radioProperty][value=" + json.bean.amountDirection + "]").attr("checked", true); + $("input:radio[name=state][value=" + json.bean.state + "]").attr("checked", true); matchingLanguage(); @@ -41,6 +46,7 @@ layui.config({ rowId: parent.rowId, name: $("#name").val(), state: $("input[name='state']:checked").val(), + amountDirection: $("input[name='radioProperty']:checked").val(), num: $("#num").val(), type: $("#type").val(), remark: $("#remark").val() diff --git a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectList.js b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectList.js index a463de8c5..be774d4d2 100644 --- a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectList.js +++ b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectList.js @@ -36,7 +36,16 @@ layui.config({ { field: 'type', title: '类型', align: 'center', width: 120, templet: function(d){ return getInPoingArr(accountSubjectUtil.accountSubjectType, "id", d.type, "name"); }}, - { field: 'state', title: '状态', align: 'center', width: 80}, + { field: 'amountDirection', title: '余额方向', align: 'center', width: 80, templet: function(d){ + return sysIfsUtil.getAmountDirectionById(d.amountDirection); + }}, + { field: 'state', title: '状态', align: 'center', width: 80, templet: function(d){ + if(d.state == 1){ + return "启用"; + }else { + return "停用"; + } + }}, { field: 'remark', title: '备注', align: 'left', width: 200}, { field: 'createName', title: systemLanguage["com.skyeye.createName"][languageType], width: 100 }, { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }, diff --git a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectListChoose.js b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectListChoose.js index c57d3a530..0be79c57d 100644 --- a/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectListChoose.js +++ b/ifs/src/main/resources/template/js/ifsAccountSubject/ifsAccountSubjectListChoose.js @@ -37,6 +37,9 @@ layui.config({ { field: 'type', title: '类型', align: 'center', width: 120, templet: function(d){ return getInPoingArr(accountSubjectUtil.accountSubjectType, "id", d.type, "name"); }}, + { field: 'amountDirection', title: '余额方向', align: 'center', width: 80, templet: function(d){ + return sysIfsUtil.getAmountDirectionById(d.amountDirection); + }}, { field: 'remark', title: '备注', align: 'left', width: 200} ]], done: function(res, curr, count){ @@ -89,7 +92,7 @@ layui.config({ function getTableParams(){ return { name: $("#name").val(), - state: 1, + state: 1, // 已启用 type: $("#type").val() }; } diff --git a/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectAdd.html b/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectAdd.html index af7c250d5..546ccacfc 100644 --- a/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectAdd.html +++ b/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectAdd.html @@ -36,6 +36,12 @@ +
+ +
+ +
+
diff --git a/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectDetails.html b/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectDetails.html index c9fff810c..283ee4798 100644 --- a/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectDetails.html +++ b/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectDetails.html @@ -39,6 +39,12 @@
+
+ +
+ +
+
diff --git a/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectEdit.html b/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectEdit.html index e982b5794..7bacfad3d 100644 --- a/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectEdit.html +++ b/ifs/src/main/resources/template/tpl/ifsAccountSubject/ifsAccountSubjectEdit.html @@ -42,6 +42,12 @@
+
+ +
+ +
+
diff --git a/web/src/main/resources/template/assets/lib/layui/customer/accountSubjectUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/accountSubjectUtil.js index 0fefdf1d7..a6e30f767 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/accountSubjectUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/accountSubjectUtil.js @@ -3,11 +3,13 @@ var accountSubjectUtil = { // 会计科目所属类型JSON串 accountSubjectType: [ - {"id": "1", "name": "资产类"}, - {"id": "2", "name": "负债类"}, - {"id": "3", "name": "权益类"}, - {"id": "4", "name": "成本类"}, - {"id": "5", "name": "损益类"} + {"id": "1", "name": "资产"}, + {"id": "2", "name": "负债"}, + {"id": "3", "name": "权益"}, + {"id": "4", "name": "成本"}, + {"id": "5", "name": "损益"}, + {"id": "6", "name": "共同"}, + {"id": "7", "name": "其他"} ] } \ No newline at end of file diff --git a/web/src/main/resources/template/assets/lib/layui/customer/sysIfsUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/sysIfsUtil.js index 192183ad9..8796fda54 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/sysIfsUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/sysIfsUtil.js @@ -71,4 +71,13 @@ var sysIfsUtil = { }}); }, + // 余额方向 + amountDirection: [ + {"id": "1", "name": "借"}, + {"id": "2", "name": "贷"} + ], + getAmountDirectionById: function (id){ + return getInPoingArr(sysIfsUtil.amountDirection, "id", id, "name"); + } + } \ No newline at end of file diff --git a/web/src/main/resources/template/assets/lib/winui/winui.js b/web/src/main/resources/template/assets/lib/winui/winui.js index 550a35fd9..3d2344ed8 100644 --- a/web/src/main/resources/template/assets/lib/winui/winui.js +++ b/web/src/main/resources/template/assets/lib/winui/winui.js @@ -443,11 +443,20 @@ $("body").append(maskReqStr); layui.each(verifyElem, function (index, item) { var othis = $(this), ver = othis.attr('win-verify').split('|'); - var tips = '', value = othis.val(); + var tips = ''; + var value = othis.val(); + // 如果是单选,则获取单选的值 + if(othis.hasClass("winui-radio")){ + value = othis.find("input:checked").val(); + if(value === undefined){ + value = ""; + } + } othis.removeClass(DANGER); layui.each(ver, function (_, thisVer) { var isFn = typeof that.verify[thisVer] === 'function'; - if (that.verify[thisVer] && (isFn ? tips = that.verify[thisVer](value, item) : !that.verify[thisVer][0].test(value))) { + if (that.verify[thisVer] + && (isFn ? tips = that.verify[thisVer](value, item) : !that.verify[thisVer][0].test(value))) { layer.msg(tips || that.verify[thisVer][1], { icon: 5, shift: 6 diff --git a/web/src/main/resources/template/tpl/template/radio-property.tpl b/web/src/main/resources/template/tpl/template/radio-property.tpl new file mode 100644 index 000000000..b195c0cd3 --- /dev/null +++ b/web/src/main/resources/template/tpl/template/radio-property.tpl @@ -0,0 +1,3 @@ +{{#each rows}} + +{{/each}} \ No newline at end of file -- GitLab