三升排产,报表导出日期格式优化,添康日历批量更新优化
| | |
| | | <PropertyGroup> |
| | | <NameOfLastUsedPublishProfile>D:\æºäºè¿æ\MES\MES-WEB-LayUI\WebTM\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <NameOfLastUsedPublishProfile>D:\WorkBench\MES-WEB-LayUI\WebTM\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile> |
| | | <ProjectView>ShowAllFiles</ProjectView> |
| | | <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig> |
| | | <ProjectView>ProjectFiles</ProjectView> |
| | | <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> |
| | | <UseIISExpress>true</UseIISExpress> |
| | | <Use64BitIISExpress /> |
| | | <IISExpressSSLPort /> |
| | |
| | | //var WEBURL = "http://localhost:8082/LuBaoAPI/"; //æ¨ä¹æ¬å°é
ç½® |
| | | //var WEBURL = "http://localhost:8082/API/"; //æè´ºæ¬å°é
ç½® |
| | | //var WEBURL = "http://localhost:8082/API/"; //å¼ ç广æ¬å°é
ç½® |
| | | //var WEBURL = "http://localhost:81/API/" //ç¿æ¶æ¶æ¬å°é
ç½® |
| | | var WEBURL = "http://localhost:81/API/" //ç¿æ¶æ¶æ¬å°é
ç½® |
| | | //var WEBURL = "http://47.96.97.237/API/"; //æºäºæå¡å¨ |
| | | /* var WEBURL = "http://localhost:8082/LuBaoAPI/"; //ä½ææ°æ¬å°é
ç½®*/ |
| | | //var WEBURL = "http://localhost:8088/ARAPI/"; //ä½ææ°æ¬å°é
ç½®(å®ç) |
| | |
| | | columns.push({ field: 'éå®è®¢åå·', title: 'éå®è®¢åå·', width: 150, filter: true, sort: true}); |
| | | columns.push({ field: 'ç产订åå·', title: 'ç产订åå·', width: 150, style: 'background-color: #f9f9f9;', filter: true, sort: true }); |
| | | columns.push({ field: '客æ·è®¢åå·', title: '客æ·è®¢åå·', width: 150, style: 'background-color: #f9f9f9;', filter: true, sort: true }); |
| | | columns.push({ field: 'ç产ç»ç»', title: 'ç产ç»ç»', width: 150, filter: true, sort: true }); |
| | | columns.push({ field: 'ç产ç»ç»', title: 'ç产ç»ç»', width: 150, sort: true }); |
| | | columns.push({ field: 'ç©æä»£ç ', title: 'ç©æç¼ç ', width: 150, filter: true, sort: true}); |
| | | columns.push({ field: 'ç©æåç§°', title: 'ç©æåç§°', width: 150, filter: true, sort: true}); |
| | | columns.push({ field: 'è§æ ¼åå·', title: 'è§æ ¼åå·', width: 150, filter: true, sort: true }); |
| | |
| | | columns.push({ field: 'çäº§è®¢åæ¥æ', title: 'çäº§è®¢åæ¥æ', width: 150, templet: "<div>{{d.çäº§è®¢åæ¥æ ==null ?'':layui.util.toDateString(d.çäº§è®¢åæ¥æ, 'yyyy-MM-dd')}}</div>", filter: true, sort: true }); |
| | | |
| | | columns.push({ field: '计åç»ææ¥æ', title: '计åç»ææ¥æ', width: 150, templet: "<div>{{d.计åç»ææ¥æ ==null ?'':layui.util.toDateString(d.计åç»ææ¥æ, 'yyyy-MM-dd')}}</div>", event: "HPlanEndDate", filter: true, sort: true }); |
| | | columns.push({ field: '订å坿æ°é', title: '订å坿æ°é', width: 150, filter: true, sort: true}); |
| | | columns.push({ field: '订å坿æ°é', title: '订å坿æ°é', width: 150, sort: true}); |
| | | columns.push({ field: 'æåæ°é', title: 'æåæ°é', width: 150, edit: 'text', filter: true, sort: true }); |
| | | columns.push({ field: 'æ¨æ¥æ°é', title: 'æ¨æ¥æ°é', filter: true, sort: true }); |
| | | columns.push({ field: 'ä¼å
级', title: 'ä¼å
级', width: 150, edit: 'text', filter: true, sort: true }); |
| | |
| | | columns.push({ field: 'çäº§å¨æ', title: 'çäº§å¨æ', width: 150 }); |
| | | columns.push({ field: 'æè¿å¼å·¥æ¥æ', title: 'æè¿å¼å·¥æ¥æ', width: 150, templet: "<div>{{d.æè¿å¼å·¥æ¥æ =='' ?'':layui.util.toDateString(d.æè¿å¼å·¥æ¥æ, 'yyyy-MM-dd')}}</div>" }); |
| | | columns.push({ field: 'æè¿å®å·¥æ¥æ', title: 'æè¿å®å·¥æ¥æ', width: 150, templet: "<div>{{d.æè¿å®å·¥æ¥æ =='' ?'':layui.util.toDateString(d.æè¿å®å·¥æ¥æ, 'yyyy-MM-dd')}}</div>" }); |
| | | columns.push({ field: 'éå®è®¢åæ°é', title: 'éå®è®¢åæ°é', width: 150, filter: true, sort: true }); |
| | | columns.push({ field: 'éå®è®¢åæ°é', title: 'éå®è®¢åæ°é', width: 150, sort: true }); |
| | | columns.push({ field: 'ç产车é´', title: 'ç产车é´', width: 150 }); |
| | | columns.push({ field: 'æºå主å
ç ', title: 'æºå主å
ç ', width: 150 }); |
| | | columns.push({ field: 'æºååå
ç ', title: 'æºååå
ç ', width: 150 }); |
| | |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillList', |
| | | type: "GET", |
| | | async: false, |
| | | async: true, |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | |
| | | item[itemobj] = item[itemobj].toString().replace(/[\r\n]+/g, ''); // å°æ¢è¡ç¬¦æ¿æ¢ä¸ºç©ºå符串 |
| | | item[itemobj] = item[itemobj].toString().replace(/,/g, ''); // å°æ¢è¡ç¬¦æ¿æ¢ä¸ºç©ºå符串 |
| | | } |
| | | if (itemobj == "订å交æ") { |
| | | item[itemobj] = item[itemobj].toString().split('T')[0]; |
| | | } |
| | | if (itemobj == "æ¥è®¡åæ¥æ") { |
| | | item[itemobj] = item[itemobj].toString().split('T')[0]; |
| | | } |
| | | } |
| | | }); |
| | | |
| | |
| | | set_SaveBill(); |
| | | }) |
| | | |
| | | // ç嬿¥æéæ© |
| | | $('#HBeginDate').on('change', function () { |
| | | get_DisplayDate(); |
| | | // å¨è¿éå¤çæ¥æéæ©åçé»è¾ |
| | | }); |
| | | |
| | | $('#HEndDate').on('change', function () { |
| | | get_DisplayDate(); |
| | | // å¨è¿éå¤çæ¥æéæ©åçé»è¾ |
| | | }); |
| | | |
| | | //#region æ¥æé´é䏿å表çå¬ |
| | | form.on('select(HInitTimeCycle)', function (data) { |
| | |
| | | $("#HBeginDate").val(Format(new Date().setDate(new Date().getDate()), "yyyy-MM-dd"));//æ¬ ææ¥æ |
| | | $("#HEndDate").val(Format(new Date().setDate(new Date().getDate() + HInitTimeCycle), "yyyy-MM-dd"));//è³ |
| | | |
| | | //æ§è¡æ¥è¯¢æ¹æ³ |
| | | get_DisplayDate(); |
| | | } else { |
| | | //$('#HDate').prop('disabled', false); |
| | | //$('#HDate1').prop('disabled', false); |
| | |
| | | //è·åé»è®¤è½¦é´ |
| | | GetDefValByUser(); |
| | | //æ¥è¯¢ |
| | | get_DisplayDate(); |
| | | get_DisplaySource(); |
| | | } |
| | | //#endregion |
| | |
| | | , limits: [50, 500, 1000, 5000] |
| | | //, loading: false |
| | | , cols: [[ |
| | | { field: 'index', title: 'åºå·', width: 80, sort: true }, |
| | | { field: 'date', title: 'æ¥æ', width: 120 }, |
| | | { type: 'numbers', title: 'åºå·', width: 80}, |
| | | { field: 'week', title: 'ææ', width: 120 }, |
| | | { field: 'workHours', title: 'ä¸çæ¶é´', width: 120, edit: 'text' } |
| | | ]] |
| | | , data: [ |
| | | { "week": "æææ¥", "workHours": 0 }, |
| | | { "week": "ææä¸", "workHours": 0 }, |
| | | { "week": "ææäº", "workHours": 0 }, |
| | | { "week": "ææä¸", "workHours": 0 }, |
| | | { "week": "ææå", "workHours": 0 }, |
| | | { "week": "ææäº", "workHours": 0 }, |
| | | { "week": "ææå
", "workHours": 0 } |
| | | ] |
| | | , done: function (res, curr, count) { |
| | | soulTable.render(this); |
| | | } |
| | | }; |
| | | table.render(option); |
| | | sourceOption = { |
| | | elem: '#SourceTable' |
| | | //, toolbar: '#toolbarDemo' |
| | |
| | | } |
| | | }; |
| | | } |
| | | //#endregion |
| | | |
| | | //#region æ¥è¯¢ |
| | | function get_DisplayDate() { |
| | | var HBeginDate = $('#HBeginDate').val(); |
| | | var HEndDate = $('#HEndDate').val(); |
| | | |
| | | if (!HBeginDate || !HEndDate) { |
| | | layer.msg('è¯·éæ©å¼å§åç»ææ¥æ'); |
| | | return; |
| | | } |
| | | if (HBeginDate > HEndDate) { |
| | | return layer.msg("å¼å§æ¥æä¸è½å°äºç»ææ¥æ!"); |
| | | } |
| | | // è®¡ç®æ¥æå·®å¹¶çæè¡¨æ ¼æ°æ® |
| | | var dateArray = getDateRange(HBeginDate, HEndDate); |
| | | var tableData = []; |
| | | |
| | | for (var i = 0; i < dateArray.length; i++) { |
| | | tableData.push({ |
| | | index: i + 1, |
| | | date: dateArray[i].date, |
| | | week: dateArray[i].week, |
| | | workHours: 0 // é»è®¤ä¸çæ¶é´ä¸º0 |
| | | }); |
| | | } |
| | | option.data = tableData; |
| | | // 渲æè¡¨æ ¼ |
| | | table.render(option) |
| | | } |
| | | |
| | | function get_DisplaySource() { |
| | | var HDeptID = $("#HDeptID").val(); |
| | | if (HDeptID != 0 && HDeptID != "") { |
| | | var sWhere = " and ç¦ç¨æ è®° != 'Y' and HDeptID=" + HDeptID |
| | | //è¿å
¥é¡µé¢æ¾ç¤ºçç¼åå表 |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_Source/list', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | sourceOption.data = data1.data; |
| | | table.render(sourceOption); |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | //#endregion |
| | | |
| | | //#region ç产车é´éæ©æé® |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region è·å对åºè½¦é´çäº§èµæº |
| | | function get_DisplaySource() { |
| | | var HDeptID = $("#HDeptID").val(); |
| | | if (HDeptID != 0 && HDeptID != "") { |
| | | var sWhere = " and ç¦ç¨æ è®° != 'Y' and HDeptID=" + HDeptID |
| | | //è¿å
¥é¡µé¢æ¾ç¤ºçç¼åå表 |
| | | $.ajax({ |
| | | url: GetWEBURL() + '/Gy_Source/list', |
| | | type: "GET", |
| | | async: false, |
| | | data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] }, |
| | | success: function (data1) { |
| | | if (data1.count == 1) { |
| | | sourceOption.data = data1.data; |
| | | table.render(sourceOption); |
| | | } else { |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("æ¥å£è¯·æ±å¤±è´¥!", { icon: 5 }); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region åå§æ¥æé´é 䏿å表 |
| | | function setSelect_HInitTimeCycle() { |
| | | var valueList = [7,30, 45, 60]; |
| | |
| | | //#endregion |
| | | |
| | | //#region æ¶é´å表ç¸å
³å½æ° |
| | | function getDateRange(startDate, endDate) { |
| | | var dateArray = []; |
| | | var start = new Date(startDate.replace(/-/g, '/')); |
| | | var end = new Date(endDate.replace(/-/g, '/')); |
| | | function generateWorkHoursData(startDate, endDate, originalData) { |
| | | const result = []; |
| | | const currentDate = new Date(startDate); |
| | | const lastDate = new Date(endDate); |
| | | |
| | | while (start <= end) { |
| | | |
| | | var dateStr = Format(start,"yyyy-MM-dd"); |
| | | var weekStr = getWeekDay(start); |
| | | // å建ä¸ä¸ªæææ å°è¡¨ï¼ä¸æææå -> workHoursï¼ |
| | | const weekHoursMap = {}; |
| | | originalData.forEach(item => { |
| | | weekHoursMap[item.week] = item.workHours; |
| | | }); |
| | | |
| | | dateArray.push({ |
| | | date: dateStr, |
| | | week: weekStr |
| | | // é忥æèå´ |
| | | while (currentDate <= lastDate) { |
| | | const dayOfWeek = currentDate.toLocaleDateString('zh-CN', { weekday: 'long' }); // è·å䏿ææåï¼å¦ "ææä¸" |
| | | const formattedDate = currentDate.toISOString().split('T')[0]; // æ ¼å¼å为 YYYY-MM-DD |
| | | |
| | | result.push({ |
| | | date: formattedDate, |
| | | week: dayOfWeek, |
| | | workHours: weekHoursMap[dayOfWeek] || 0, // å¦ææ²¡æå¹é
çææï¼é»è®¤ 0 |
| | | }); |
| | | |
| | | start.setDate(start.getDate() + 1); |
| | | currentDate.setDate(currentDate.getDate() + 1); // ä¸ä¸å¤© |
| | | } |
| | | |
| | | return dateArray; |
| | | } |
| | | // è·åææå |
| | | function getWeekDay(date) { |
| | | var weekDays = ['æææ¥', 'ææä¸', 'ææäº', 'ææä¸', 'ææå', 'ææäº', 'ææå
']; |
| | | return weekDays[date.getDay()]; |
| | | return result; |
| | | } |
| | | //#endregion |
| | | |
| | |
| | | function set_SaveBill() { |
| | | var checkStatus = table.checkStatus('SourceTable') |
| | | , data = checkStatus.data; |
| | | var sSubStr = JSON.stringify(table.cache["mainTable"]); |
| | | var sMainSub = JSON.stringify(data) + ';' + sSubStr + ';' + sessionStorage["HUserName"]; |
| | | var sSubStr = table.cache["mainTable"]; |
| | | //æ ¹æ®å¼å§æ¶é´ç»ææ¥æçææ°æ°æ® |
| | | const newData = generateWorkHoursData($("#HBeginDate").val(), $("#HEndDate").val(), sSubStr); |
| | | if (newData.length == 0) { |
| | | return layer.msg("è¯·æ£æ¥å¼å§æ¶é´åç»ææ¥ææ¯å¦åç"); |
| | | } |
| | | var sMainSub = JSON.stringify(data) + ';' + JSON.stringify(newData) + ';' + sessionStorage["HUserName"]; |
| | | if (data.length > 0) { |
| | | $.ajax({ //弿¥è¯·æ± |
| | | type: "POST", //请æ±ç±»å |
| | |
| | | , title: "æ¹æ¹ä¸çå·¥æ¶" //æ é¢ |
| | | , closeBtn: 1 //çªä½å³ä¸è§å
³é ç æ ·å¼ |
| | | , shift: 2 //å¼¹åºå¨ç» |
| | | , area: ["50%", "80%"] //çªä½å¤§å° |
| | | , area: ["60%", "80%"] //çªä½å¤§å° |
| | | , maxmin: true //设置æå¤§æå°æé®æ¯å¦æ¾ç¤º |
| | | , content: ['./Sc_BulkEditWorkTimeNew.html', "yes"] |
| | | }) |