| | |
| | | { |
| | | label: "创建日期", |
| | | fieldName: "taskCreateddate", |
| | | type: "date-local", |
| | | typeAttributes:{ |
| | | weekday: "long", |
| | | year: "numeric", |
| | | month: "long", |
| | | day: "2-digit" |
| | | }, |
| | | type: "text", |
| | | // type: "date-local", |
| | | // typeAttributes:{ |
| | | // weekday: "long", |
| | | // year: "numeric", |
| | | // month: "long", |
| | | // day: "2-digit" |
| | | // }, |
| | | sortable: true , |
| | | wrapText: true, |
| | | }, |
| | |
| | | label: '合并', |
| | | name: 'Merge', |
| | | title: '合并', |
| | | disabled: { fieldName: 'confirmButtonisDisabled'}, |
| | | disabled: { fieldName: 'mergeConfirmButtonisDisabled'}, |
| | | value: 'Merge' |
| | | }, |
| | | initialWidth: 76, |
| | |
| | | { |
| | | label: "创建日期", |
| | | fieldName: "taskCreateddate", |
| | | type: "date-local", |
| | | typeAttributes:{ |
| | | weekday: "long", |
| | | year: "numeric", |
| | | month: "long", |
| | | day: "2-digit" |
| | | }, |
| | | type: "text", |
| | | // type: "date-local", |
| | | // typeAttributes:{ |
| | | // weekday: "long", |
| | | // year: "numeric", |
| | | // month: "long", |
| | | // day: "2-digit" |
| | | // }, |
| | | sortable: true |
| | | }, |
| | | { |
| | |
| | | { |
| | | label: "创建日期", |
| | | fieldName: "taskCreateddate", |
| | | type: "date-local", |
| | | typeAttributes:{ |
| | | weekday: "long", |
| | | year: "numeric", |
| | | month: "long", |
| | | day: "2-digit" |
| | | }, |
| | | type: "text", |
| | | // type: "date-local", |
| | | // typeAttributes:{ |
| | | // weekday: "long", |
| | | // year: "numeric", |
| | | // month: "long", |
| | | // day: "2-digit" |
| | | // }, |
| | | sortable: true , |
| | | wrapText: true, |
| | | }, |
| | |
| | | label: '合并', |
| | | name: 'Merge', |
| | | title: '合并', |
| | | disabled: { fieldName: 'confirmButtonisDisabled'}, |
| | | disabled: { fieldName: 'mergeConfirmButtonisDisabled'}, |
| | | value: 'Merge' |
| | | }, |
| | | initialWidth: 76, |
| | |
| | | { |
| | | label: "创建日期", |
| | | fieldName: "taskCreateddate", |
| | | type: "date-local", |
| | | typeAttributes:{ |
| | | weekday: "long", |
| | | year: "numeric", |
| | | month: "long", |
| | | day: "2-digit" |
| | | }, |
| | | type: "text", |
| | | // type: "date-local", |
| | | // typeAttributes:{ |
| | | // weekday: "long", |
| | | // year: "numeric", |
| | | // month: "long", |
| | | // day: "2-digit" |
| | | // }, |
| | | sortable: true , |
| | | wrapText: true, |
| | | }, |
| | |
| | | label: '合并', |
| | | name: 'Merge', |
| | | title: '合并', |
| | | disabled: { fieldName: 'confirmButtonisDisabled'}, |
| | | disabled: { fieldName: 'mergeConfirmButtonisDisabled'}, |
| | | value: 'Merge' |
| | | }, |
| | | initialWidth: 76, |
| | |
| | | var state = response.getState(); |
| | | if (state === "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start |
| | | for(var rowIndex = 0 ;rowIndex<res.myTasks.length;rowIndex++){ |
| | | if (res.myTasks[rowIndex].taskType == '盘点检查计划' || res.myTasks[rowIndex].taskType == '温湿度检查计划') { |
| | | res.myTasks[rowIndex]['cancelButtonisDisabled'] = true ; |
| | | res.myTasks[rowIndex]['assignButtonisDisabled_Owner'] = true ; |
| | | res.myTasks[rowIndex]['mergeConfirmButtonisDisabled'] = true ; |
| | | } |
| | | }; |
| | | |
| | | for(var rowIndex = 0 ;rowIndex<res.subTasks.length;rowIndex++){ |
| | | if (res.subTasks[rowIndex].taskType == '盘点检查计划' || res.subTasks[rowIndex].taskType == '温湿度检查计划') { |
| | | res.subTasks[rowIndex]['cancelButtonisDisabled'] = true ; |
| | | res.subTasks[rowIndex]['assignButtonisDisabled_Owner'] = true ; |
| | | res.subTasks[rowIndex]['mergeConfirmButtonisDisabled'] = true ; |
| | | } |
| | | }; |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End |
| | | cmp.set('v.data',res.myTasks); |
| | | cmp.set('v.data2',res.subTasks); |
| | | cmp.set('v.dataCopy',res.myTasks); |
| | |
| | | //后台方法的回调函数 |
| | | }, |
| | | //20210105 CHAN-BWX3YU you end |
| | | |
| | | // 排序逻辑设定 |
| | | sortBy: function(field, reverse, primer) { |
| | | var key = primer ? function(x) { |
| | |
| | | if (state === "SUCCESS") { |
| | | var res = response.getReturnValue(); |
| | | |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start |
| | | for(var rowIndex = 0 ;rowIndex<res.myTasks.length;rowIndex++){ |
| | | if (res.myTasks[rowIndex].taskType == '盘点检查计划' || res.myTasks[rowIndex].taskType == '温湿度检查计划') { |
| | | res.myTasks[rowIndex]['cancelButtonisDisabled'] = true ; |
| | | res.myTasks[rowIndex]['assignButtonisDisabled_Owner'] = true ; |
| | | res.myTasks[rowIndex]['mergeConfirmButtonisDisabled'] = true ; |
| | | } |
| | | }; |
| | | cmp.set('v.data',res.myTasks); |
| | | cmp.set('v.dataCopy',res.myTasks); |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End |
| | | } |
| | | this.hideSpinner(cmp); |
| | | }); |
| | |
| | | Accept:function (cmp, row, action) { |
| | | cmp.set('v.ActivityDate',null); |
| | | cmp.set('v.feedbackPlanDate',null); |
| | | cmp.set('v.estimatedFinishDate', ''); |
| | | //除了记录类型为其他,且任务区分为上级分配任务时,其他都跳转事件页面 |
| | | if('其他'!=row.taskType){ |
| | | cmp.set("v.IsEventDefault", true); |
| | |
| | | } |
| | | //check end |
| | | //2021-10-19 mzy 任务管理改善 end |
| | | |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start |
| | | // var estimatedFinishDate = cmp.get("v.estimatedFinishDate"); |
| | | var estimatedFinishDate = new Date(cmp.get("v.estimatedFinishDate")); |
| | | if (row.taskType == '盘点检查计划' || row.taskType == '温湿度检查计划') { |
| | | var estimatedFinishDate = cmp.get("v.estimatedFinishDate"); |
| | | |
| | | if (!estimatedFinishDate) { |
| | | alert('请输入预计完成时间!'); |
| | | return; |
| | | } |
| | | |
| | | var latestFinishDate = row.latestFinishDate; |
| | | if (estimatedFinishDate > latestFinishDate) { |
| | | alert('预计完成时间不能超过最晚完成日('+latestFinishDate+')'); |
| | | return; |
| | | } |
| | | } |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End |
| | | |
| | | var action = cmp.get("c.confirmOrDelay"); |
| | | action.setParams({ |
| | | "taskID" : row.id, |
| | |
| | | "delayReason" : '', |
| | | "IsGeneratePlan":IsGeneratePlan, //2021-10-20 mzy 任务管理改善 |
| | | "ActivityDate" : activityDate, //2021-10-20 mzy 任务管理改善 |
| | | "feedbackPlanDate" : feedbackPlanDate |
| | | "feedbackPlanDate" : feedbackPlanDate, |
| | | "estimatedFinishDate" : estimatedFinishDate, |
| | | "delayReasonOther" : '' |
| | | }); |
| | | //2021-10-20 mzy 任务管理改善 start |
| | | //需要生成计划才会跳转到事件页面,将任务Id带到事件页面 |
| | | if(IsGeneratePlan==true){ |
| | | window.open('/apex/SimpleEventRegister?taskId=' + row.id,'_blank'); |
| | | if(IsGeneratePlan==true){ |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start |
| | | if (row.taskType != '盘点检查计划' && row.taskType != '温湿度检查计划') { |
| | | window.open('/apex/SimpleEventRegister?taskId=' + row.id,'_blank'); |
| | | } |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End |
| | | } |
| | | //2021-10-20 mzy 任务管理改善 end |
| | | this.showSpinner(cmp); |
| | |
| | | rows[rowIndex]['taskStatus'] = '02 接受' ; |
| | | rows[rowIndex]['cancelButtonisDisabled'] = true ; |
| | | rows[rowIndex]['confirmButtonisDisabled'] = true ; |
| | | rows[rowIndex]['mergeConfirmButtonisDisabled'] = true ; |
| | | rows[rowIndex]['delayButtonisDisabled'] = true ; |
| | | rows[rowIndex]['assignButtonisDisabled_Owner'] = true ; //2021-10-20 mzy 任务管理改善 |
| | | cmp.set('v.data', rows); |
| | |
| | | cmp.set('v.tempisFSE',row.isFSE); |
| | | cmp.set('v.delayReason', ''); |
| | | cmp.set('v.delayReasonOther', ''); |
| | | cmp.set('v.estimatedFinishDate', ''); |
| | | cmp.set('v.delayIsOpen', true); |
| | | }, |
| | | //确认取消 |
| | |
| | | rows[rowIndex]['taskStatus'] = '04 取消' ; |
| | | rows[rowIndex]['cancelButtonisDisabled'] = true ; |
| | | rows[rowIndex]['confirmButtonisDisabled'] = true ; |
| | | rows[rowIndex]['mergeConfirmButtonisDisabled'] = true ; |
| | | rows[rowIndex]['delayButtonisDisabled'] = true ; |
| | | rows[rowIndex]['assignButtonisDisabled_Owner'] = true ; //2021-10-20 mzy 任务管理改善 |
| | | cmp.set('v.data', rows); |
| | |
| | | if(delayReason == '其他' && !delayReasonOther){ |
| | | alert('延期理由(选项)为其他时请输入延期理由(其他)!'); |
| | | return; |
| | | |
| | | } |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start |
| | | // var estimatedFinishDate = cmp.get("v.estimatedFinishDate"); |
| | | var estimatedFinishDate = new Date(cmp.get("v.estimatedFinishDate")); |
| | | if (tempdata.taskType == '盘点检查计划' || tempdata.taskType == '温湿度检查计划') { |
| | | var estimatedFinishDate = cmp.get("v.estimatedFinishDate"); |
| | | |
| | | if (!estimatedFinishDate) { |
| | | alert('请输入延期至时间!'); |
| | | return; |
| | | } |
| | | |
| | | var createdAfter3Month = tempdata.createdAfter3Month; |
| | | if (estimatedFinishDate > createdAfter3Month) { |
| | | alert('延期至时间不能超过('+createdAfter3Month+')'); |
| | | return; |
| | | } |
| | | } |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End |
| | | |
| | | var action = cmp.get("c.confirmOrDelay"); |
| | | action.setParams({ |
| | | "taskID" : tempdata.id, |
| | | "isDelay" : true, |
| | | "delayReason" : delayReason, |
| | | "delayReasonOther" : delayReasonOther, |
| | | "estimatedFinishDate" : estimatedFinishDate, |
| | | }); |
| | | this.showSpinner(cmp); |
| | | action.setCallback(this, function(response) { |
| | |
| | | rows[rowIndex]['taskStatus'] = '05 延期' ; |
| | | rows[rowIndex]['cancelButtonisDisabled'] = true ; |
| | | rows[rowIndex]['confirmButtonisDisabled'] = true ; |
| | | rows[rowIndex]['mergeConfirmButtonisDisabled'] = true ; |
| | | rows[rowIndex]['delayButtonisDisabled'] = true ; |
| | | rows[rowIndex]['assignButtonisDisabled_Owner'] = true ; //2021-11-11 mzy 任务管理改善 |
| | | cmp.set('v.data', rows); |
| | |
| | | }); |
| | | $A.enqueueAction(action); |
| | | |
| | | |
| | | window.open('/apex/SimpleEventRegister?isDelay=true&taskId=' + tempdata.id ,'_blank'); |
| | | |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc Start |
| | | if (tempdata.taskType != '盘点检查计划' && tempdata.taskType != '温湿度检查计划') { |
| | | window.open('/apex/SimpleEventRegister?isDelay=true&taskId=' + tempdata.id ,'_blank'); |
| | | } |
| | | // 【FY24大及巨大课题】北京新法规项目对应 DB202307428742 20230804 by lc End |
| | | }, |
| | | // 确认重新分配 |
| | | ConfirmAssign: function(cmp, event) { |
| | |
| | | rows[rowIndex]['taskAssigneeName'] = res.assigneeName ; |
| | | rows[rowIndex]['cancelButtonisDisabled'] = true ; |
| | | rows[rowIndex]['confirmButtonisDisabled'] = true ; |
| | | rows[rowIndex]['mergeConfirmButtonisDisabled'] = true ; |
| | | rows[rowIndex]['delayButtonisDisabled'] = true ; |
| | | rows[rowIndex]['assignButtonisDisabled_Owner'] = true ; |
| | | cmp.set('v.data', rows); |
| | |
| | | //弹出 错误提示 |
| | | showErrorToast : function(cmp) { |
| | | $A.util.removeClass(cmp.find('errorDiv'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function() { |
| | | $A.util.addClass(cmp.find('errorDiv'), 'slds-hide'); |
| | | }), |
| | | 5000 |
| | | ); |
| | | // window.setTimeout($A.getCallback(function() { |
| | | // $A.util.addClass(cmp.find('errorDiv'), 'slds-hide'); |
| | | // }), |
| | | // 5000 |
| | | // ); |
| | | }, |
| | | //弹出 错误提示 文字较多,显示持续10秒 - 2021-11-12 yjk |
| | | showErrorToastLongTime : function(cmp) { |
| | | $A.util.removeClass(cmp.find('errorDiv'), 'slds-hide'); |
| | | window.setTimeout($A.getCallback(function() { |
| | | $A.util.addClass(cmp.find('errorDiv'), 'slds-hide'); |
| | | }), |
| | | 10000 |
| | | ); |
| | | // window.setTimeout($A.getCallback(function() { |
| | | // $A.util.addClass(cmp.find('errorDiv'), 'slds-hide'); |
| | | // }), |
| | | // 10000 |
| | | // ); |
| | | }, |
| | | // function automatic called by aura:waiting event |
| | | showSpinner: function(cmp) { |
| | |
| | | }, |
| | | //wangweipeng 获取url的参数 2021/09/27 start |
| | | getURLParameterValue: function() { |
| | | var querystring = location.search.substr(1); |
| | | var querystring = window.location.search.substr(1); |
| | | var paramValue = {}; |
| | | querystring.split("&").forEach(function(part) { |
| | | var param = part.split("="); |