From 86586ac59fef9b677deaf15136e1f44d3d2204be Mon Sep 17 00:00:00 2001 From: LSH Date: 星期五, 29 三月 2024 10:40:30 +0800 Subject: [PATCH] #周计划 --- src/main/webapp/static/js/weekly/weekly.js | 88 +++++++++++++++++++++++++++++++++++++------ 1 files changed, 75 insertions(+), 13 deletions(-) diff --git a/src/main/webapp/static/js/weekly/weekly.js b/src/main/webapp/static/js/weekly/weekly.js index afa0435..abe1977 100644 --- a/src/main/webapp/static/js/weekly/weekly.js +++ b/src/main/webapp/static/js/weekly/weekly.js @@ -3,6 +3,8 @@ var treeCond; var htmlCstme; var htmlCstmrData; +var indexS = "9999,8888"; +var indexDelSign = 0; layui.config({ base: baseUrl + "/static/layui/lay/modules/" }).extend({ @@ -363,17 +365,18 @@ cols: [[ {type: 'numbers'} ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'} - ,{field: 'workContent', title: '宸ヤ綔鍐呭', edit:true} - ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:true} - ,{field: 'comment', title: '璇勮', edit:true} - ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', edit:true} + ,{field: 'dailyTime$', align: 'center',title: '鏃ユ湡'} + ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:false} + ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false} + ,{field: 'comment', title: '璇勮', edit:false} + ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', edit:false} // ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'} // ,{field: 'settleMsg', align: 'center',title: '瀹℃牳杩涘害'} // ,{field: 'director', align: 'center',title: '璐熻矗浜�'} // ,{field: 'settleSize', align: 'center',title: '娴佺▼闀垮害'} // ,{field: 'settleCurrent', align: 'center',title: '褰撳墠杩涘害'} - ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID', templet: '#cstmrId'}//, templet: function () { return htmlCstme;} - ,{field: 'memo', align: 'center',title: '澶囨敞', edit:true} + ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID'}//, templet: function () { return htmlCstme;} + ,{field: 'memo', align: 'center',title: '澶囨敞', edit:false} ]], request: { pageName: 'curr', @@ -425,17 +428,18 @@ cols: [[ {type: 'numbers'} ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'} - ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:true} - ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:true} - ,{field: 'comment', title: '璇勮', edit:true} - ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', edit:true} + ,{field: 'dailyTime$', align: 'center',title: '鏃ユ湡'} + ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:false} + ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false} + ,{field: 'comment', title: '璇勮', edit:false} + ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', edit:false} // ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'} // ,{field: 'settleMsg', align: 'center',title: '瀹℃牳杩涘害'} // ,{field: 'director', align: 'center',title: '璐熻矗浜�'} // ,{field: 'settleSize', align: 'center',title: '娴佺▼闀垮害'} // ,{field: 'settleCurrent', align: 'center',title: '褰撳墠杩涘害'} - ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID', templet: '#cstmrId'}//, templet: function () { return htmlCstme;} - ,{field: 'memo', align: 'center',title: '澶囨敞', edit:true} + ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID'}//, templet: function () { return htmlCstme;} + ,{field: 'memo', align: 'center',title: '澶囨敞', edit:false} ]], request: { pageName: 'curr', @@ -568,12 +572,67 @@ $(".layui-table-cell").css('overflow', 'visible');//瑙e喅layui鏁版嵁琛ㄦ牸涓祵濂椾笅鎷夋鏄剧ず闂 $(layero).find('.layui-table-view').css('margin', '0'); var options = this; - + var indexSign = 0; // 鑾峰彇褰撳墠琛屾暟鎹� table.getRowData = function(elem){ var index = $(elem).closest('tr').data('index'); + console.log("index-----") + console.log(index) + var indexArray = indexS.split(","); // 灏嗗瓧绗︿覆鎷嗗垎涓烘暟缁� + // 閬嶅巻鏁扮粍涓殑姣忎釜鍏冪礌 + for (var i = 0; i < indexArray.length; i++) { + var element = Number(indexArray[i]); + // 杩涜鐩稿簲鐨勬搷浣� + console.log("element-----"); + console.log(element); + if (element===index){ + indexSign = 1; + } + } + if (indexSign === 0){ + indexS = indexS+","+index; + console.log("indexS-----") + console.log(indexS) + } return table.cache[options.id][index] || {}; }; + + if (indexSign === 0 && indexDelSign === 0){ + console.log("娓叉煋") + // 娓叉煋鎼滅储妯℃澘 + $.ajax({ + url: baseUrl+"/cstmr/all/get/kv", + headers: {'token': localStorage.getItem('token')}, + data: { + limit: 9999 + }, + method: 'POST', + // async: false, // 璁剧疆涓哄悓姝ユ墽琛� + success: function (res) { + console.log(res) + console.log($("#cstmrId").html()) + res.data.forEach((item) => { + $("#cstmrId").append("<option value='" + item.value + "'>" + item.name + "</option>") + }) + // htmlCstme = "<select id=\"select_cstmr\" name=\"select_cstmr\" lay-vertype=\"tips\" lay-verify=\"required\" required=\"\">" + // htmlCstme = htmlCstme + + // " <option style=\"display: none\"></option>\n" + // if (res.code === 200){ + // for (var val in res.data) { + // var cstmrVal = res.data[val] + // console.log(cstmrVal) + // htmlCstme = htmlCstme + + // " <option value = \""+cstmrVal.value+"\"+\n" + + // " > "+cstmrVal.name+" </option>\n" + // } + // } else { + // htmlCstme = htmlCstme + + // "<option value=\"0\">寮傚父</option>" + // } + // htmlCstme = htmlCstme + "\n" + " </select>"; + } + }) + } $('.select-cstmr').on('change', function(){ console.log("cstmrId") @@ -687,6 +746,9 @@ title: (exp ? '淇敼' : '娣诲姞') + '鏄庣粏', content: $('#matEditDialog').html(), success: function (layero, dIndex) { + if (!exp){ + indexDelSign = 1; + } // 鍥炴樉鏁版嵁 form.val('matEditForm', exp); // 琛ㄥ崟鎻愪氦浜嬩欢 -- Gitblit v1.9.1