From a4c3b21c467deb00129668aa0716425b4a3c6c82 Mon Sep 17 00:00:00 2001 From: kgdxpr Date: Mon, 17 Jun 2024 14:50:16 +0800 Subject: [PATCH] 'commit' --- WebRoot/view/tb/zbdc/cgzb_cz.html | 809 +++++++++++++++++++++--------- WebRoot/view/tb/zbdc/cgzb_xx.html | 145 +++--- 2 files changed, 641 insertions(+), 313 deletions(-) diff --git a/WebRoot/view/tb/zbdc/cgzb_cz.html b/WebRoot/view/tb/zbdc/cgzb_cz.html index 8fd88064..854f42b4 100644 --- a/WebRoot/view/tb/zbdc/cgzb_cz.html +++ b/WebRoot/view/tb/zbdc/cgzb_cz.html @@ -99,38 +99,38 @@ -
+
-
物理实验室
+
物理
-
-
-
@@ -140,69 +140,101 @@
-
-
-
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
-
-
化学实验室
+ +
化学
-
-
-
@@ -212,68 +244,99 @@
-
-
-
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+
-
+
- -
生物实验室
+
生物
-
-
-
@@ -283,40 +346,77 @@
-
-
-
-
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ + + + +
音乐
@@ -325,8 +425,8 @@
- +
@@ -335,7 +435,7 @@
-
@@ -345,13 +445,14 @@
- +
-
+
+
@@ -363,8 +464,8 @@
- +
@@ -373,17 +474,17 @@
- +
- +
- + @@ -392,97 +493,144 @@
-
-
- +
+ +
+ +
+
- - - - -
劳技
-
-
+
-
-
-
- -
- + +
+ +
+ + +
+ +
劳动教育
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
-
+
+ +
+ + + + +
+ +
图书馆
+
+
-
-
-
@@ -493,30 +641,30 @@
-
-
-
@@ -524,38 +672,36 @@
-
-
图书馆
-
-
+
+
-
-
-
@@ -563,150 +709,210 @@
+
-
+
+ +
+
+ +
+ + +
+ + + +
+ +
心理辅导室
+
+
-
-
+
+
-
其他
+
卫生室
- -
+
-
-
+
+ +
+
+ +
+ + + +
其他
+
+
-
- -
-
-
-
+
+ +
+
-
+
+ +
+
+ +
-
+
+ + +
护眼灯
+
+
-
-
-
-
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+
@@ -735,105 +941,232 @@ var form = layui.form; var $ = layui.jquery; + + $.ajax({ type: "GET", async: false, url: "/QingLong/zbdc/getSchoolCgzb", success: function (res) { - if (res.hasOwnProperty('ty_gs')) { - form.val("myForm", { - "wl_cgss": res.wl_cgss - , "wl_cgmj": res.wl_cgmj - , "wl_tjss": res.wl_tjss - , "wl_tjmj": res.wl_tjmj - , "wl_yqsss": res.wl_yqsss - , "wl_yqsmj": res.wl_yqsmj - - , "hx_cgss": res.hx_cgss - , "hx_cgmj": res.hx_cgmj - , "hx_tjss": res.hx_tjss - , "hx_tjmj": res.hx_tjmj - , "hx_yqsss": res.hx_yqsss - , "hx_yqsmj": res.hx_yqsmj - - , "sw_cgss": res.sw_cgss - , "sw_cgmj": res.sw_cgmj - , "sw_tjss": res.sw_tjss - , "sw_tjmj": res.sw_tjmj - , "sw_yqsss": res.sw_yqsss - , "sw_yqsmj": res.sw_yqsmj - - , "dljs": res.dljs - , "lsjs": res.lsjs - , "tyjsjs": res.tyjsjs - , "xlfds": res.xlfds - , "aqtyjs": res.aqtyjs - , "yy_jssj": res.yy_jssj - , "yy_mj": res.yy_mj - , "yy_qckjs": res.yy_qckjs - , "yy_qcyppz": res.yy_qcyppz - , "yy_qcypjs": res.yy_qcypjs - , "ty_gs": res.ty_gs - , "ty_qckjs": res.ty_qckjs - , "ty_qcyppz": res.ty_qcyppz - , "ty_qcypj": res.ty_qcypj - , "ms_jsss": res.ms_jsss - , "ms_qckjs": res.ms_qckjs - , "ms_qcyppz": res.ms_qcyppz - , "ms_qcypj": res.ms_qcypj - , "sfjs": res.sfjs - , "wsbj": res.wsbj - , "lj_qjywsss": res.lj_qjywsss - , "lj_zlysnss": res.lj_zlysnss - , "lj_pryyyss": res.lj_pryyyss - , "lj_jyqjsyywhss": res.lj_jyqjsyywhss - , "lj_nyscldss": res.lj_nyscldss - , "lj_ctgyzzss": res.lj_ctgyzzss - , "lj_gyscldss": res.lj_gyscldss - , "lj_xjstyyyyss": res.lj_xjstyyyyss - , "lj_xdfwyldss": res.lj_xdfwyldss - , "tsg_cssss": res.tsg_cssss - , "tsg_zztscs": res.tsg_zztscs - , "tsg_dztscs": res.tsg_dztscs - , "tsg_jsylsss": res.tsg_jsylsss - , "tsg_xsylsss": res.tsg_xsylsss - , "tsg_dzylsss": res.tsg_dzylsss - , "hyd_ygzjss": res.hyd_ygzjss - , "hyd_wgzjss": res.hyd_wgzjss - , "xxkx_cgss": res.xxkx_cgss - , "xxkx_cgmj": res.xxkx_cgmj - , "xxkx_yqsss": res.xxkx_yqsss - , "xxkx_yqsmj": res.xxkx_yqsmj - + if (!typeof res.cz_wllshshshu === 'undefined') { + + var arr = ["cz_ldjyqlhwsrshu", "cz_ldjyzyhwsrshu", "cz_ldjyprwywsrshu", "cz_ldjyjyqyqsyyh", "cz_ldjynyscld", "cz_ldjyccgyz", "cz_ldjygyscld", "cz_ldjyxjstyyyy", "cz_ldjyxdfwyld"]; + var ljRes = arr.filter(function (key) { + return res[key] !== 0 && res[key] !== null; }); + if (ljRes.length > 0) { + ljRes.forEach(function (item, index) { + if (index == 0) { + $('#defaultSelect').val(item); + $('#defaultInput').val(res[item]); + form.render(); + } else { + var id = generateRandomString(); + appendLjItem(id); + $('#select_' + id).val(item); + $('#input_' + id).val(res[item]); + } + }); + form.render(); + } } + + form.val("myForm", { + "cz_wllshshshu": res.cz_wllshshshu == null ? 0 : res.cz_wllshshshu + , "cz_wllsysjsny": res.cz_wllsysjsny == null ? 0 : res.cz_wllsysjsny + , "cz_wllsmj": res.cz_wllsmj == null ? 0 : res.cz_wllsmj + , "cz_wllyqshshu": res.cz_wllyqshshu == null ? 0 : res.cz_wllyqshshu + , "cz_wllyqsmj": res.cz_wllyqsmj == null ? 0 : res.cz_wllyqsmj + , "cz_wllzbrshshu": res.cz_wllzbrshshu == null ? 0 : res.cz_wllzbrshshu + , "cz_wllzbrsmj": res.cz_wllzbrsmj == null ? 0 : res.cz_wllzbrsmj + , "cz_wltgsmjshshu": res.cz_wltgsmjshshu == null ? 0 : res.cz_wltgsmjshshu + , "cz_wltgsmjmj": res.cz_wltgsmjmj == null ? 0 : res.cz_wltgsmjmj + , "cz_hxlshshshu": res.cz_hxlshshshu == null ? 0 : res.cz_hxlshshshu + , "cz_hxsysjsny": res.cz_hxsysjsny == null ? 0 : res.cz_hxsysjsny + , "cz_hxsysmj": res.cz_hxsysmj == null ? 0 : res.cz_hxsysmj + , "cz_hxyqshshu": res.cz_hxyqshshu == null ? 0 : res.cz_hxyqshshu + , "cz_hxyqsmj": res.cz_hxyqsmj == null ? 0 : res.cz_hxyqsmj + , "cz_hxzbrshshu": res.cz_hxzbrshshu == null ? 0 : res.cz_hxzbrshshu + , "cz_hxzbrsmj": res.cz_hxzbrsmj == null ? 0 : res.cz_hxzbrsmj + , "cz_hxtgsmjshshu": res.cz_hxtgsmjshshu == null ? 0 : res.cz_hxtgsmjshshu + , "cz_hxtgsmjmj": res.cz_hxtgsmjmj == null ? 0 : res.cz_hxtgsmjmj + , "cz_swlshshshu": res.cz_swlshshshu == null ? 0 : res.cz_swlshshshu + , "cz_swlsysjsny": res.cz_swlsysjsny == null ? 0 : res.cz_swlsysjsny + , "cz_swlsmj": res.cz_swlsmj == null ? 0 : res.cz_swlsmj + , "cz_swyqshshu": res.cz_swyqshshu == null ? 0 : res.cz_swyqshshu + , "cz_swyqsmj": res.cz_swyqsmj == null ? 0 : res.cz_swyqsmj + , "cz_swzbrshshu": res.cz_swzbrshshu == null ? 0 : res.cz_swzbrshshu + , "cz_swzbrsmj": res.cz_swzbrsmj == null ? 0 : res.cz_swzbrsmj + , "cz_swtgsmjshshu": res.cz_swtgsmjshshu == null ? 0 : res.cz_swtgsmjshshu + , "cz_swtgsmjmj": res.cz_swtgsmjmj == null ? 0 : res.cz_swtgsmjmj + , "cz_yqjtrshshu": res.cz_yqjtrshshu == null ? 0 : res.cz_yqjtrshshu + , "cz_yqjtrmj": res.cz_yqjtrmj == null ? 0 : res.cz_yqjtrmj + , "cz_yqqjkkjshu": res.cz_yqqjkkjshu == null ? 0 : res.cz_yqqjkkjshu + , "cz_msfsjtrmj": res.cz_msfsjtrmj == null ? 0 : res.cz_msfsjtrmj + , "cz_msfsjtrshshu": res.cz_msfsjtrshshu == null ? 0 : res.cz_msfsjtrshshu + , "cz_tygyshshu": res.cz_tygyshshu == null ? 0 : res.cz_tygyshshu + , "cz_tyqjkkjshu": res.cz_tyqjkkjshu == null ? 0 : res.cz_tyqjkkjshu + , "cz_msjtrshshu": res.cz_msjtrshshu == null ? 0 : res.cz_msjtrshshu + , "cz_msjtrmj": res.cz_msjtrmj == null ? 0 : res.cz_msjtrmj + , "cz_msqjkkjshu": res.cz_msqjkkjshu == null ? 0 : res.cz_msqjkkjshu + , "cz_tsgcsshshu": res.cz_tsgcsshshu == null ? 0 : res.cz_tsgcsshshu + , "cz_tsgcssmj": res.cz_tsgcssmj == null ? 0 : res.cz_tsgcssmj + , "cz_tsgzjtsjcshu": res.cz_tsgzjtsjcshu == null ? 0 : res.cz_tsgzjtsjcshu + , "cz_tsgdztsjcshu": res.cz_tsgdztsjcshu == null ? 0 : res.cz_tsgdztsjcshu + , "cz_tsglsyysrshu": res.cz_tsglsyysrshu == null ? 0 : res.cz_tsglsyysrshu + , "cz_tsglsyysmj": res.cz_tsglsyysmj == null ? 0 : res.cz_tsglsyysmj + , "cz_tsgsyysrshu": res.cz_tsgsyysrshu == null ? 0 : res.cz_tsgsyysrshu + , "cz_tsgsyysmj": res.cz_tsgsyysmj == null ? 0 : res.cz_tsgsyysmj + , "cz_tsgdzyysrshu": res.cz_tsgdzyysrshu == null ? 0 : res.cz_tsgdzyysrshu + , "cz_tsgdzyysmj": res.cz_tsgdzyysmj == null ? 0 : res.cz_tsgdzyysmj + , "cz_xldfshshu": res.cz_xldfshshu == null ? 0 : res.cz_xldfshshu + , "cz_xldfsmj": res.cz_xldfsmj == null ? 0 : res.cz_xldfsmj + , "cz_wsrshu": res.cz_wsrshu == null ? 0 : res.cz_wsrshu + , "cz_wsrmj": res.cz_wsrmj == null ? 0 : res.cz_wsrmj + , "cz_qdljtrshshu": res.cz_qdljtrshshu == null ? 0 : res.cz_qdljtrshshu + , "cz_qdljtrmj": res.cz_qdljtrmj == null ? 0 : res.cz_qdljtrmj + , "cz_lsjtrshshu": res.cz_lsjtrshshu == null ? 0 : res.cz_lsjtrshshu + , "cz_lsjtrmj": res.cz_lsjtrmj == null ? 0 : res.cz_lsjtrmj + , "cz_hjddjzsks": res.cz_hjddjzsks == null ? 0 : res.cz_hjddjzsks + , "cz_hjddwjzsks": res.cz_hjddwjzsks == null ? 0 : res.cz_hjddwjzsks + , "cz_hjddjzgnqshu": res.cz_hjddjzgnqshu == null ? 0 : res.cz_hjddjzgnqshu + , "cz_hjddwjzgnqshu": res.cz_hjddwjzgnqshu == null ? 0 : res.cz_hjddwjzgnqshu + }); } }); form.on('submit(save)', function (data) { - $.ajax({ - url: '/QingLong/zbdc/saveCgzb', - data: data.field, - type: 'post', - success: function (result) { - if (result.success) { - layer.msg("保存成功!", { - icon: 1, - time: 1300 - }); - } else { - layer.msg(result.message, { - icon: 2, - time: 2000 - }); - } - } + + var selectValues = []; + var inputValues = []; + + $('select').each(function () { + var selectedValue = $(this).val(); + selectValues.push(selectedValue); }); + + $('input[temp="ljCount"]').each(function () { + var inputValue = $(this).val(); + inputValues.push(inputValue); + }); + + if (hasDuplicates(selectValues)) { + layer.msg('劳技中的教室分类重复!', { + icon: 2, + time: 3000 + }); + } else { + var ljResult = selectValues.reduce(function (obj, key, index) { + obj[key] = inputValues[index]; + return obj; + }, {}); + + + var result = Object.assign({}, data.field, ljResult); + + result.stage_id = "4"; + + $.ajax({ + url: '/QingLong/zbdc/saveCgzb', + data: result, + type: 'post', + success: function (result) { + if (result.success) { + layer.msg("保存成功!", { + icon: 1, + time: 1300 + }); + } else { + layer.msg(result.message, { + icon: 2, + time: 2000 + }); + } + } + }); + + } + return false; }); + + + + $(document).on('click', 'i', function () { + if (this.id != 'addLjItem') { + $('#div_' + this.id).remove(); + } + }); + + $("#addLjItem").click(function () { + var id = generateRandomString(); + appendLjItem(id); + + }); + + function appendLjItem(id) { + + var str = '
' + + '
' + + '
' + + '' + + '
' + + '' + + '
' + + '
' + + '
' + + '
' + + '
' + + '' + + '
' + + '' + + '
' + + '
' + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + + '
' + + $('#ljItmes').append(str); + + form.render(); + } + + function generateRandomString() { + let result = ''; + let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; + let charactersLength = characters.length; + for (let i = 0; i < 10; i++) { + result += characters.charAt(Math.floor(Math.random() * charactersLength)); + } + return result; + } + + function hasDuplicates(array) { + return (new Set(array)).size !== array.length; + } + + }); diff --git a/WebRoot/view/tb/zbdc/cgzb_xx.html b/WebRoot/view/tb/zbdc/cgzb_xx.html index 370d3698..355d564a 100644 --- a/WebRoot/view/tb/zbdc/cgzb_xx.html +++ b/WebRoot/view/tb/zbdc/cgzb_xx.html @@ -336,14 +336,13 @@
- - @@ -356,7 +355,7 @@
-
@@ -540,7 +539,7 @@
卫生室
-
+