From 15ebc22984451692804856e5d6f97d5c28c41111 Mon Sep 17 00:00:00 2001
From: wangyi <2946747746@qq.com>
Date: 星期二, 27 一月 2026 14:43:10 +0800
Subject: [PATCH] 1
---
WebTM/views/PublicPage/Gy_Maintain.html | 125 +++++++++++++++++++++++++----------------
1 files changed, 76 insertions(+), 49 deletions(-)
diff --git a/WebTM/views/PublicPage/Gy_Maintain.html b/WebTM/views/PublicPage/Gy_Maintain.html
index 5118664..a686e77 100644
--- a/WebTM/views/PublicPage/Gy_Maintain.html
+++ b/WebTM/views/PublicPage/Gy_Maintain.html
@@ -30,10 +30,10 @@
<div class="layui-colla-item">
<div class="layui-form-item" style="border-top: solid 1px #F6F6F6;">
<div class="layui-row" style="padding:10px 0">
- <div class="layui-col-xs3 layui-inline" style="width: 23%;">
+ <div class="layui-col-xs3 layui-inline" style="width: 23%;display:none;">
<div id="treeMaintain" lay-filter="treeMaintain" class="demo-tree demo-tree-box" style="height: 580px; overflow: scroll;"></div>
</div>
- <div class="layui-col-xs9 layui-inline">
+ <div class="layui-col-xs12 layui-inline">
<div class="layui-row">
<div class="layui-inline">
<label class="layui-form-label">浠g爜</label>
@@ -90,52 +90,70 @@
var sWhere = " where HStopFlag=0 and HEndFlag<>'1' "; //鏍戝瀷
var sWhere1 = " where HStopFlag=0 and HEndFlag=1 "; //鍒楄〃
- tree.render({
- elem: '#treeMaintain',
- data: getData(sWhere),
- showCheckbox: false, //鏄惁鏄剧ず澶嶉�夋
- id: 'demoId',
- isJump: false, //鏄惁鍏佽鐐瑰嚮鑺傜偣鏃跺脊鍑烘柊绐楀彛璺宠浆
- showLine: true,//鏄惁寮�鍚繛鎺ョ嚎
- onlyIconControl: true, //鐐瑰嚮鍚庝笉鏀剁缉
- click: function (obj) {
- //鐐瑰嚮楂樺厜
- if (obj.data.id !== treeCkData.id) {
- $('div[data-id="' + obj.data.id + '"] span').eq(1).last().addClass("custom-tree-item-clicked");
- $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked');
- treeCkData = obj.data;
- TagId = obj.data.id;
- TagParentId = obj.data.ParentID;
- }
- else {
- $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked');
- treeCkData = { id: 0 };
- TagId = "";
- TagParentId = "";
- }
+ //tree.render({
+ // elem: '#treeMaintain',
+ // data: getData(sWhere),
+ // showCheckbox: false, //鏄惁鏄剧ず澶嶉�夋
+ // id: 'demoId',
+ // isJump: false, //鏄惁鍏佽鐐瑰嚮鑺傜偣鏃跺脊鍑烘柊绐楀彛璺宠浆
+ // showLine: true,//鏄惁寮�鍚繛鎺ョ嚎
+ // onlyIconControl: true, //鐐瑰嚮鍚庝笉鏀剁缉
+ // click: function (obj) {
+ // //鐐瑰嚮楂樺厜
+ // if (obj.data.id !== treeCkData.id) {
+ // $('div[data-id="' + obj.data.id + '"] span').eq(1).last().addClass("custom-tree-item-clicked");
+ // $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked');
+ // treeCkData = obj.data;
+ // TagId = obj.data.id;
+ // TagParentId = obj.data.ParentID;
+ // }
+ // else {
+ // $('div[data-id="' + treeCkData.id + '"] span').eq(1).last().removeClass('custom-tree-item-clicked');
+ // treeCkData = { id: 0 };
+ // TagId = "";
+ // TagParentId = "";
+ // }
- $.ajax({
- url: GetWEBURL() + '/Gy_MaintenanceMode/MaintainCX',
- type: "GET",
- data: { "HInterID": obj.data.id },
- success: function (data1) {
- if (data1.count == 1) {
- option.data = data1.data;
- table.render(option);
- layer.close(index);
- } else {
- layer.close(index);
- layer.alert(data1.code + data1.Message, { icon: 5 });
- }
- }, error: function () {
- layer.close(index);
- layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
- }
- });
+ // $.ajax({
+ // url: GetWEBURL() + '/Gy_MaintenanceMode/MaintainCX',
+ // type: "GET",
+ // data: { "HInterID": obj.data.id },
+ // success: function (data1) {
+ // if (data1.count == 1) {
+ // option.data = data1.data;
+ // table.render(option);
+ // layer.close(index);
+ // } else {
+ // layer.close(index);
+ // layer.alert(data1.code + data1.Message, { icon: 5 });
+ // }
+ // }, error: function () {
+ // layer.close(index);
+ // layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+ // }
+ // });
+ // }
+ //});
+
+ table.on('row(mainTable)', function (obj) {
+ //閫変腑琛屾敼鍙橀鑹�
+ var flag = !obj.tr.find(':checkbox:first').prop('checked');
+ obj.tr.find(':checkbox').prop('checked', flag);
+ if (flag) {
+ obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked'); //璁剧疆澶嶉�夋閫変腑鏍峰紡
+ $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//鏀瑰彉褰撳墠tr鑳屾櫙棰滆壊鍜屽瓧浣撻鑹�
+ } else {
+ obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//鍙栨秷澶嶉�夋閫変腑鏍峰紡
+ $(obj.tr.selector).attr({ "style": "background:" });//鍙栨秷褰撳墠tr棰滆壊
}
- });
-
+ //mainTable 涓鸿〃鏍糏D 娉ㄦ剰姝ゅ濡傛灉ID涓嶆纭皢瀵艰嚧浣犲湪鐩戝惉澶嶉�夋鏃惰幏鍙栦笉鍒颁綘閫夋嫨鐨勬暟鎹紝鍓嶉潰鐨勫彧鏄坊鍔犳垨鍒犻櫎閫変腑鏈�変腑鏍峰紡浠ュ強璁剧疆鑳屾櫙鑹诧紝瀛椾綋棰滆壊
+ layui.each(table.cache.mainTable, function (i, l) {
+ if (obj.tr.index() == l.LAY_TABLE_INDEX) {
+ l.LAY_CHECKED = flag;
+ }
+ });
+ })
var option = {
elem: '#mainTable'
@@ -144,7 +162,7 @@
, page: true
, cellMinWidth: 90
, cols: [[
- { type: 'radio', fixed: 'left' }
+ { type: 'checkbox', fixed: 'left' }
, { field: 'HItemID', title: 'HItemID', sort: true, hide: true }
, { field: 'ParentID', title: 'ParentID', sort: true, hide: true }
, { field: 'HNumber', title: '淇濆吇椤圭洰浠g爜' }
@@ -176,18 +194,25 @@
//鏌ヨ鎸夐挳
form.on('submit(btnSearch)', function (data) {
-
+ var HNumber = $("#HNumber").val();
+ var HName = $("#HName").val();
+ if (HNumber) {
+ sWhere += " and HNumber like '%" + HNumber + "%'";
+ }
+ if (HName) {
+ sWhere += " and HName like '%" + HName + "%'";
+ }
$.ajax({
url: GetWEBURL() + '/PublicPageMethod/MaintainList',
type: "GET",
- data: { "sWhere": SeachFilter(sWhere1) },
+ data: { "sWhere": sWhere },
success: function (data1) {
if (data1.count == 1) {
option.data = data1.data;
table.render(option);
layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
} else {
- layer.alert(data1.code + data1.Message, { icon: 5 });
+ layer.alert("鏆傛棤璁板綍", { icon: 5 });
}
}, error: function () {
layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
@@ -235,6 +260,8 @@
}
})
return treeData;
+
+
}
function SeachFilter(sWhere1) {
--
Gitblit v1.9.1