| | |
| | | "**/node_modules": true, |
| | | "**/bower_components": true, |
| | | "**/.sfdx": true |
| | | } |
| | | }, |
| | | "editor.suggest.snippetsPreventQuickSuggestions": false |
| | | } |
| | |
| | | public static final String CN_NO = '否'; |
| | | public static final String VOC_NAME = 'VOC'; |
| | | public static final String OK = 'OK'; |
| | | public static final String LU_SHENG_NAME = '陆 胜'; |
| | | public static final String HU_DI_AN_NAME = '胡 迪安'; |
| | | public static final String SYSTEM_PROFILE_NAME = '系统管理员'; |
| | | public static final String SOBJECT_NAME_OF_REPORT_SHARE ='Report__Share'; |
| | | public static final String SOBJECT_NAME_OF_VOC_SHARE = 'VOCShare__c'; |
| | | public static final String REPAIR_FIELD_DOJ_STATUS_NOT_OBJECT = '非对象'; |
| | |
| | | InitData res = new initData(); |
| | | try{ |
| | | Monthly_Report__c report = [SELECT OwnerId,Id,Next_week_plan__c FROM Monthly_Report__c WHERE Id = :recordId LIMIT 1]; |
| | | res.OwnerId = report.OwnerId; |
| | | res.ownerId = report.OwnerId; |
| | | res.userId = UserInfo.getUserId(); |
| | | res.Id = report.Id; |
| | | res.nextWeekPlan = report.Next_week_plan__c; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String OwnerId; |
| | | public String ownerId; |
| | | @AuraEnabled |
| | | public String ownerEmail; |
| | | @AuraEnabled |
| | |
| | | public String drSumUrl; |
| | | @AuraEnabled |
| | | public String userEmail; |
| | | @AuraEnabled |
| | | public String userId; |
| | | } |
| | | } |
| | |
| | | Report__c report = [select Status__c from Report__c where Id = :recordId]; |
| | | res.status = report.Status__c; |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.userId = UserInfo.getUserId(); |
| | | res.luShengId = getUserIdByName(LightingButtonConstant.LU_SHENG_NAME); |
| | | res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME); |
| | | res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | res.isVOC = report.IsVOC__c; |
| | | res.personId = report.Responsible_Person__r.Id; |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.userId = UserInfo.getUserId(); |
| | | res.luShengId = getUserIdByName(LightingButtonConstant.LU_SHENG_NAME); |
| | | res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME); |
| | | res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | |
| | | //给提交相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static String updateForSubmitButton(String reocrdId){ |
| | | public static String updateForSubmitButton(String recordId){ |
| | | try { |
| | | Report__c rac = new Report__c(); |
| | | rac.Id = reocrdId; |
| | | rac.Id = recordId; |
| | | rac.Status__c = LightingButtonConstant.RECORD_TYPE_NAME_BY_SUBMIT; |
| | | rac.Submit_time__c = Datetime.now(); |
| | | rac.Submit_report_day__c = Date.today(); |
| | |
| | | return eMessage.substring(left,right); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | | public static string getUserIdByName(String name){ |
| | | User user = null; |
| | | try { |
| | | user = [select Id from User where Name =:name]; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | return user.Id; |
| | | } |
| | | @AuraEnabled |
| | | public static string getProfileIdByName(String name){ |
| | | Profile profile = null; |
| | | try { |
| | | profile = [select Id from Profile where Name =:name]; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | return profile.Id; |
| | | } |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String status; |
| | |
| | | public String DeveloperName; |
| | | @AuraEnabled |
| | | public String userId; |
| | | |
| | | @AuraEnabled |
| | | public String luShengId; |
| | | @AuraEnabled |
| | | public String huDiAnId; |
| | | @AuraEnabled |
| | | public String systemProfileId; |
| | | |
| | | |
| | | |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-07 09:02:03 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:17:24 |
| | | * @LastEditTime: 2023-05-09 17:42:28 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | @api recordId;//OwnerId |
| | | ownerId; |
| | | monthlyReportId; |
| | | userId; |
| | | IsLoading = true; |
| | | |
| | | |
| | |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.ownerId = result.ownerId; |
| | | this.userId = result.userId; |
| | | this.monthlyReportId = result.Id; |
| | | this.cancelSubmit(); |
| | | console.log("end"); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Monthly_Report__c/" + this.monthlyReportId + "/view"); |
| | | } |
| | | }).catch(error => { |
| | |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | cancelSubmit () { |
| | | //需要完善 |
| | | if(this.ownerId == UserInfo_Owner.Id) { |
| | | if(this.ownerId == this.userId) { |
| | | cancel({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-28 15:59:44 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:24:51 |
| | | * @LastEditTime: 2023-05-09 15:20:58 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | import updateForOCSMNoToReportButton from '@salesforce/apex/ReportController.updateForOCSMNoToReportButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import insertAwareDate from '@salesforce/apex/ReportController.updateForOCSMNoToReportButton'; |
| | | export default class LexOCSMNoToReportForReport extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | this.AwareDate = Date.now(); |
| | | if(this.AwareDate != undefined ){ |
| | | updateForOCSMNoToReportButton({ |
| | | recordId: this.recordId |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-27 14:05:59 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:30:45 |
| | | * @LastEditTime: 2023-05-09 10:21:25 |
| | | */ |
| | | import { LightningElement, wire, track, api } from "lwc"; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | update() { |
| | | if (this.status != "已分配") { |
| | | this.showToast("不是已分配不能点击", "error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | updateForVOCAnswerButton({ |
| | |
| | | if (result) { |
| | | this.showToast(result,"error"); |
| | | } else { |
| | | this.showToast("成功", "success"); |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.Isloading = false; |
| | |
| | | import VOCCheck from '@salesforce/apex/ReportController.updateForVOCCheckButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | |
| | | import getUserIdByName from '@salesforce/apex/ReportController.getUserIdByName'; |
| | | import getProfileIdByName from '@salesforce/apex/ReportController.getProfileIdByName'; |
| | | export default class LexVOCCheck extends LightningElement { |
| | | |
| | | @api recordId; |
| | |
| | | isVOC; |
| | | personId; |
| | | profileId; |
| | | userId; |
| | | systemProfileId; |
| | | luShengId; |
| | | huDiAnId; |
| | | Isloading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | |
| | | this.userId = result.userId; |
| | | this.status = result.status; |
| | | this.isVOC = result.isVOC; |
| | | this.personId = result.personId; |
| | | this.profileId = result.profileId; |
| | | this.systemProfileId = result.systemProfileId; |
| | | this.luShengId = result.luShengId; |
| | | this.huDiAnId = result.huDiAnId; |
| | | console.log(this.status); |
| | | this.check(); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view"); |
| | |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | getUserId(userName){ |
| | | getUserIdByName({ |
| | | name : userName |
| | | }).then(reuslt=>{ |
| | | return reuslt; |
| | | }); |
| | | } |
| | | getProfileId(profileName){ |
| | | getProfileIdByName({ |
| | | name : profileName |
| | | }).then(reuslt=>{ |
| | | return reuslt; |
| | | }); |
| | | } |
| | | check (){ |
| | | // 陆胜,胡迪安,系统管理员可点(需要调整) |
| | | if (UserInfo_Owner.Id != "00510000000gWAE" && UserInfo_Owner.Id != "00510000004reg2" && this.profileId != "00e10000000Y3o5AAC") { |
| | | if (this.userId != this.luShengId && this.userId != this.huDiAnId && this.profileId != this.systemProfileId) { |
| | | this.showToast("你没有判定VOC的权限","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.showToast("成功","success"); |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.Isloading = false; |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-27 14:08:56 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:33:01 |
| | | * @LastEditTime: 2023-05-09 10:04:33 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.updateRecordView(this.recordId); |
| | | this.showToast("成功","success"); |
| | | } |
| | | this.Isloading = false; |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-27 14:11:17 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:34:01 |
| | | * @LastEditTime: 2023-05-09 17:10:14 |
| | | */ |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ReportController.initForVOCFinishButton'; |
| | | import update from '@salesforce/apex/ReportController.updateForVOCFinishButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexVOCFinish extends LightningElement { |
| | |
| | | status; |
| | | IsLoading = true; |
| | | profileId; |
| | | luShengId; |
| | | userId; |
| | | huDiAnId; |
| | | systemProfileId; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | if (result != null) { |
| | | this.status = result.status; |
| | | this.profileId = result.profileId; |
| | | this.userId = result.userId; |
| | | this.luShengId = result.luShengId; |
| | | this.huDiAnId = result.huDiAnId; |
| | | this.systemProfileId = result.systemProfileId; |
| | | this.VOCFinish(); |
| | | } |
| | | }).catch(error => { |
| | |
| | | } |
| | | |
| | | VOCFinish () { |
| | | if (UserInfo_Owner.Id != "00510000000gWAE" && UserInfo_Owner.Id != "00510000004reg2" && this.profileId != "00e10000000Y3o5AAC") { |
| | | if (this.userId != this.luShengId && this.userId != this.huDiAnId && this.profileId != this.systemProfileId) { |
| | | this.showToast("你没有完毕VOC的权限","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-03-27 13:39:23 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-04-11 11:35:31 |
| | | * @LastEditTime: 2023-05-09 10:15:43 |
| | | */ |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.showToast("成功","success"); |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.IsLoading = false; |