Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev
| New file |
| | |
| | | public class OppSubmitController { |
| | | @AuraEnabled |
| | | public static InitData initSubmitButton (String recordId){ |
| | | InitData res = new initData(); |
| | | try{ |
| | | // Request_tedner_doc__c report = [SELECT OwnerId,Id,Product_discription__c,Status__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | Request_tedner_doc__c report = [SELECT OwnerId,Id FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | res.OwnerId = report.OwnerId; |
| | | res.Id = report.Id; |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | }catch(Exception e){ |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | //授权申请的提交按钮 |
| | | @AuraEnabled |
| | | public static String submit(String recordId) { |
| | | try { |
| | | // Request_tedner_doc__c rac = [SELECT Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c,Request_target__c,Document_format__c,Bid_distributor__c,Product_discription__c,Tedner_date__c,Tender_active_day__c,tender_inactive_date__c,Tender_request_reason__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | Request_tedner_doc__c rac = [SELECT Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | rac.Status__c = '已提交'; |
| | | rac.RecordTypeId = '01210000000RNXn'; |
| | | rac.Submit_check_flag__c = true; |
| | | rac.Submit_time__c = Datetime.now(); |
| | | update rac; |
| | | return '1'; |
| | | } catch (Exception ex) { |
| | | System.debug(LoggingLevel.INFO, '*** xu: ' + ex); |
| | | return ex.getMessage(); |
| | | // return ex.getMessage().split(',')[1]; |
| | | } finally { |
| | | |
| | | } |
| | | } |
| | | |
| | | //授权申请的取消提交按钮 |
| | | @AuraEnabled |
| | | public static String submitCancel(String recordId) { |
| | | try { |
| | | Request_tedner_doc__c report = [SELECT Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1]; |
| | | report.Status__c = '草案中'; |
| | | report.RecordTypeId = '01210000000RNXi'; |
| | | report.Submit_check_flag__c = false; |
| | | report.Submit_time__c = null; |
| | | update report; |
| | | return '1'; |
| | | } catch (Exception ex) { |
| | | System.debug(LoggingLevel.INFO, '*** cancelXu: ' + ex); |
| | | return ex.getMessage(); |
| | | } finally { |
| | | |
| | | } |
| | | } |
| | | |
| | | //获取当前登录人的 id |
| | | @AuraEnabled |
| | | public static UserResult UserInfo_Owner() { |
| | | UserResult result = new UserResult(); |
| | | ID myUserID = UserInfo.getUserId(); |
| | | |
| | | try { |
| | | User tempUser = |
| | | [select id from user where id = : myUserID ]; |
| | | result.id = tempUser.id; |
| | | } catch (exception e) { |
| | | |
| | | result.result = e.getMessage(); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String Id; |
| | | @AuraEnabled |
| | | public String OwnerId; |
| | | } |
| | | public class UserResult { |
| | | @AuraEnabled |
| | | public string result; |
| | | public UserResult( ) { |
| | | result = 'Success'; |
| | | } |
| | | @AuraEnabled |
| | | public string id; |
| | | //20210105 CHAN-BWX3YU you end |
| | | } |
| | | } |
| | | |
| | | // if("{!Request_tedner_doc__c.OwnerId}" == "{!$User.Id}") { |
| | | // var rac = new sforce.SObject("Request_tedner_doc__c"); |
| | | // rac.Id = "{!Request_tedner_doc__c.Id}"; |
| | | // rac.Status__c = "已提交"; |
| | | // rac.Submit_check_flag__c = "true"; |
| | | // rac.RecordTypeId = "01210000000RNXn"; |
| | | // var serverTimestamp = sforce.connection.getServerTimestamp(); |
| | | // rac.Submit_time__c = serverTimestamp.timestamp; |
| | |
| | | /* |
| | | 用于给lwc的js初始化数据和对记录进行dml操作,此controller属于报告书 |
| | | */ |
| | | public with sharing class ReportController { |
| | | //给VOC完毕相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static InitData initForVOCFinishButton (String recordId) { |
| | | InitData res = new initData(); |
| | |
| | | } |
| | | return res; |
| | | } |
| | | //给VOC判定相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static InitData initForVOCCheckButton (String recordId) { |
| | | InitData res = new initData(); |
| | |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | //给VOC提出相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static Initdata initForVOCSubmitButton(String recordId){ |
| | | InitData res = new InitData(); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | //给VOC回答相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static Initdata initForVOCAnswerButton(String recordId){ |
| | | InitData res = new InitData(); |
| | |
| | | return res; |
| | | } |
| | | |
| | | |
| | | //给取消相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static InitData initForCancelButton(String recordId){ |
| | | InitData res = new InitData(); |
| | |
| | | return res; |
| | | } |
| | | |
| | | |
| | | //给OCSM不要报告相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static InitData initForOCSMNoToReportButton(String recordId){ |
| | | InitData res = new InitData(); |
| | |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | |
| | | //给SIStoOPD相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static InitData initForSIStoOPDButton(String recordId){ |
| | | InitData res = new InitData(); |
| | |
| | | return res; |
| | | } |
| | | |
| | | |
| | | //给OCSM要报告相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static InitData initForOCSMToReportButton(String recordId){ |
| | | InitData res = new InitData(); |
| | |
| | | return res; |
| | | } |
| | | |
| | | |
| | | //给提交(对手活动报告)相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static InitData initForSubmitCompetitorReportButton(String recordId){ |
| | | InitData res = null; |
| | |
| | | return res; |
| | | } |
| | | |
| | | |
| | | //给提交相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static void updateForSubmitButton(String reocrdId){ |
| | | try { |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static void updateForOPDtoSISButton(String recordId){ |
| | | public static void updateForOPDtoSISButton(String recordId,String recordTypeId){ |
| | | try { |
| | | Report__c rac = new Report__c(); |
| | | rac.Id = recordId; |
| | | rac.RecordTypeId = '01210000000RLTi'; |
| | | rac.RecordTypeId = recordTypeId; |
| | | update rac; |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | } |
| | | |
| | | |
| | | //取消提交操作更新相应数据 |
| | | @AuraEnabled |
| | | public static void updateForCancelSubmitReportButton(String recordId){ |
| | | try { |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static void updateForCompleteButton(String recordId){ |
| | | public static void updateForCompleteButton(String recordId,String recordTypeId){ |
| | | Report__c rac = new Report__c(); |
| | | try { |
| | | rac.Id = recordId; |
| | | rac.Status__c = '完毕'; |
| | | rac.RecordTypeId = '01210000000Qeky'; |
| | | rac.RecordTypeId = recordTypeId; |
| | | update rac; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | //OCSM要报告操作更新相应数据 |
| | | @AuraEnabled |
| | | public static void updateForOCSMToReportButton(String recordId){ |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //SIStoOPD操作更新相应数据 |
| | | @AuraEnabled |
| | | public static void updateForSIStoOPDButton(String recordId){ |
| | | public static String updateForSIStoOPDButton(String recordId,String recordTypeId){ |
| | | Report__c rac = new Report__c(); |
| | | try { |
| | | rac.Id = recordId; |
| | | rac.RecordTypeId = '01210000000Qekj'; |
| | | rac.RecordTypeId = recordTypeId; |
| | | update rac; |
| | | return null; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | |
| | | //DispatchOCSMQARA操作更新相应数据 |
| | | @AuraEnabled |
| | | public static void updateForDispatchOCSMQARAButton(String recordId){ |
| | | try { |
| | |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | } |
| | | |
| | | //OCSM不要报告操作更新相应数据 |
| | | @AuraEnabled |
| | | public static void updateForOCSMNoToReportButton(String recordId){ |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //取消操作更新相应数据 |
| | | @AuraEnabled |
| | | public static void updateForCancelButton(String recordId){ |
| | | try { |
| | |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | } |
| | | |
| | | //VOC回答更新相应数据 |
| | | @AuraEnabled |
| | | public static String updateForVOCAnswerButton(String recordId){ |
| | | try { |
| | |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | |
| | | return exc; |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | } |
| | | } |
| | | |
| | |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | } |
| | | } |
| | | |
| | | //VOC回答更新相应数据 |
| | | @AuraEnabled |
| | | public static void updateForVOCSubmitButton(String recordId ,String createdById){ |
| | | try { |
| New file |
| | |
| | | <template> |
| | | <div class="CancelSubmitHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/ApplicationButtonController.initSubmitButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | import submitCancel from '@salesforce/apex/ApplicationButtonController.submitCancel'; |
| | | import UserInfo_Owner from '@salesforce/apex/ApplicationButtonController.UserInfo_Owner'; |
| | | export default class Submit extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId; |
| | | monthlyReportId; |
| | | IsLoading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str:"+str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.ownerId = result.OwnerId; |
| | | this.monthlyReportId = result.Id; |
| | | this.cancelSubmit(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | cancelSubmit(){ |
| | | UserInfo_Owner({}).then(result=>{ |
| | | console.log(result,'获取当前登陆人id') |
| | | if(this.ownerId == result.id){ |
| | | submitCancel({ |
| | | recordId: this.recordId |
| | | }).then(requst=>{ |
| | | if(requst == '1'){ |
| | | this.showToast("取消提交授权信息成功","success"); |
| | | } |
| | | if(requst != "1"){ |
| | | var messageage = ""; |
| | | messageage = requst.split(',')[1]; |
| | | this.showToast(messageage,"error"); |
| | | } |
| | | }) |
| | | }else{ |
| | | this.showToast("只授权申请书所有人可以取消提交","error"); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(event); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="CancelSubmitHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement,wire,track,api} from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import { NavigationMixin } from 'lightning/navigation'; |
| | | import init from '@salesforce/apex/ApplicationButtonController.initSubmitButton'; |
| | | import UserInfo_Owner from '@salesforce/apex/ApplicationButtonController.UserInfo_Owner'; |
| | | import submit from '@salesforce/apex/ApplicationButtonController.submit'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class Submit extends LightningElement { |
| | | @api recordId;//OwnerId |
| | | ownerId;//所有人id |
| | | id;//返回值的id |
| | | IsLoading = true; |
| | | arrMessage = []; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(currentPageReference,'666666666666'); |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str:"+str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result,"请求成功了吗") |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.ownerId = result.OwnerId; |
| | | this.id = result.Id; |
| | | this.Submit(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"+error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | } |
| | | |
| | | Submit(){ |
| | | this.arrMessage = []; |
| | | //获取获取当前登陆人 |
| | | UserInfo_Owner({}).then(result=>{ |
| | | console.log(result,'获取当前登陆人id') |
| | | if(this.ownerId == result.id){ |
| | | submit({ |
| | | recordId: this.recordId |
| | | }).then(requst=>{ |
| | | if(requst == '1'){ |
| | | this.showToast("提交授权信息成功","success"); |
| | | } |
| | | if(requst != "1"){ |
| | | var messageage = ""; |
| | | for(let i=0;i<this.arrMessage.length;i++){ |
| | | if(this.arrMessage.length-1 == i){ |
| | | break; |
| | | } |
| | | messageage += this.arrMessage[i+1]; |
| | | } |
| | | // if(requst.split(',')[1].slice(-1) == '式'){ |
| | | // messageage = requst.split(',')[1] + "," + requst.split(',')[2] + "," + requst.split(',')[3] + "," + requst.split(',')[4] + "," + requst.split(',')[5] + "," + requst.split(',')[6]; |
| | | // }else{ |
| | | // messageage = requst.split(',')[1]; |
| | | // } |
| | | this.showToast(messageage,"error"); |
| | | } |
| | | }) |
| | | }else{ |
| | | this.showToast("只授权申请书所有人可以提交","error"); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | updateRecordView() { |
| | | updateRecord({fields: { Id: this.recordId }}); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | console.log(msg,type); |
| | | const event = new ShowToastEvent({ |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | console.log('走到这里了吗'); |
| | | if(type == 'success'){ |
| | | this.updateRecordView(); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .cancelHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="cancelHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ReportController.initForCancelButton'; |
| | | import updateForCancelButton from '@salesforce/apex/ReportController.updateForCancelButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexCancel extends LightningElement { |
| | | @api recordId; |
| | | status; |
| | | IsLoading = true; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.status = result.status; |
| | | console.log(this.status); |
| | | this.cancel(); |
| | | |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | cancel () { |
| | | if (this.status == "取消") { |
| | | ShowToastEvent("已经取消!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.status == "批准") { |
| | | ShowToastEvent("已经批准,不能删除!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.status == "完毕") { |
| | | ShowToastEvent("已经完毕,不能删除!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if (this.status == "提交") { |
| | | ShowToastEvent("已经提交,不能删除!","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | updateForCancelButton({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | this.showToast("取消成功!","success"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .dispatchOCSMQARAHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="dispatchOCSMQARAHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import updateForDispatchOCSMQARAButton from '@salesforce/apex/ReportController.updateForDispatchOCSMQARAButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexDispatchOCSMQARA extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | this.IsLoading = false; |
| | | this.DispatchOCSMQARA(); |
| | | |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | DispatchOCSMQARA () { |
| | | updateForDispatchOCSMQARAButton({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | this.showToast("成功","success"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | <template> |
| | | <div class="reportHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ReportController.initForOCSMNoToReportButton'; |
| | | import updateForOCSMNoToReportButton from '@salesforce/apex/ReportController.updateForOCSMNoToReportButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexOCSMNoToReportForReport extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | OCSMAdministrativeReportNumber; |
| | | OCSMAdministrativeReportDate; |
| | | AwareDate; |
| | | |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.OCSMAdministrativeReportDate = result.OCSMAdministrativeReportDate; |
| | | this.OCSMAdministrativeReportNumber = result.OCSMAdministrativeReportNumber; |
| | | this.AwareDate = result.awareDate; |
| | | this.noToReport(); |
| | | }); |
| | | } |
| | | |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | noToReport(){ |
| | | if (!confirm("不要报告后无法撤回,是否继续?")) { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if(this.OCSMAdministrativeReportNumber != undefined || this.OCSMAdministrativeReportDate != undefined ){ |
| | | this.showToast("已经报告的QIS,不可以点击OCSM不要报告。","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | if(this.AwareDate != undefined ){ |
| | | updateForOCSMNoToReportButton({ |
| | | recordId: this.recordId |
| | | }).then(result=>{ |
| | | this.showToast("OCSM不要报告成功","success"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | }else{ |
| | | this.showToast("没有AwareDate或已经OCSM行政报告,请确认。","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .toReportHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="toReportHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/ReportController.initForOCSMToReportButton'; |
| | | import updateForOCSMToReportButton from '@salesforce/apex/ReportController.updateForOCSMToReportButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexOCSMToReport extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | OCSMAdministrativeReportStatus; |
| | | awareDate; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.OCSMAdministrativeReportStatus = result.OCSMAdministrativeReportStatus; |
| | | this.awareDate = result.awareDate; |
| | | this.toReport(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | toReport () { |
| | | if (!confirm("报告后无法撤回,是否继续?")) { |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | |
| | | if(this.OCSMAdministrativeReportStatus == undefined && this.awareDate != undefined ){ |
| | | updateForOCSMToReportButton({ |
| | | recordId: this.recordId |
| | | }).then(result =>{ |
| | | this.showToast("成功","success"); |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | }else{ |
| | | this.showToast("没有AwareDate或已经OCSM行政报告,请确认。","error"); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | return; |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .sisToOPDHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="sisToOPDHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { api, wire,LightningElement } from 'lwc'; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from 'lightning/actions'; |
| | | import updateForSIStoOPDButton from '@salesforce/apex/ReportController.updateForSIStoOPDButton'; |
| | | import init from '@salesforce/apex/ReportController.initForSIStoOPDButton'; |
| | | import { updateRecord } from 'lightning/uiRecordApi'; |
| | | import UserInfo_Owner from '@salesforce/apex/TaskFeedbackController.UserInfo_Owner'; |
| | | import { ShowToastEvent } from 'lightning/platformShowToastEvent'; |
| | | export default class LexSIStoOPD extends LightningElement { |
| | | @api recordId; |
| | | IsLoading = true; |
| | | ownerId; |
| | | status; |
| | | userId; |
| | | recordTypeId = '01210000000Qekj'; |
| | | errorMsg; |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | connectedCallback(){ |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.ownerId = result.ownerId; |
| | | this.status = result.status; |
| | | this.userId = result.userId; |
| | | this.SIStoOPD(); |
| | | } |
| | | }).catch(error => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }).finally(() => { |
| | | console.log(this.errorMsg); |
| | | if(this.errorMsg){ |
| | | this.showToast(this.errorMsg,"error"); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | showToast(msg,type) { |
| | | const event = new ShowToastEvent({ |
| | | title: '', |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({fields: { Id: recordId }}); |
| | | } |
| | | |
| | | SIStoOPD () { |
| | | if(this.ownerId == this.userId && this.status == "草案中") { |
| | | updateForSIStoOPDButton({ |
| | | recordId: this.recordId, |
| | | recordTypeId: this.recordTypeId |
| | | }).then(result=>{ |
| | | if(result){ |
| | | this.showToast(result,"error"); |
| | | }else{ |
| | | this.updateRecordView(this.recordId); |
| | | } |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | // ifError(result){ |
| | | // console.log(result); |
| | | // if(result){ |
| | | // this.showToast(result,"error"); |
| | | // } |
| | | |
| | | // } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |
| New file |
| | |
| | | .answerHolder{ |
| | | position: relative; |
| | | display: inline-block; |
| | | width: 80px; |
| | | height: 80px; |
| | | text-align: center; |
| | | } |
| | | .container .uiContainerManager{ |
| | | display: none !important; |
| | | } |
| New file |
| | |
| | | <template> |
| | | <div class="answerHolder" if:true={IsLoading}> |
| | | <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner> |
| | | <lightning-button label="Show Toast" onclick={ShowToastEvent}></lightning-button> |
| | | |
| | | </div> |
| | | </template> |
| New file |
| | |
| | | import { LightningElement, wire, track, api } from "lwc"; |
| | | import { CurrentPageReference } from "lightning/navigation"; |
| | | import { CloseActionScreenEvent } from "lightning/actions"; |
| | | import { NavigationMixin } from "lightning/navigation"; |
| | | import init from "@salesforce/apex/ReportController.initForVOCAnswerButton"; |
| | | import updateForVOCAnswerButton from "@salesforce/apex/ReportController.updateForVOCAnswerButton"; |
| | | import { updateRecord } from "lightning/uiRecordApi"; |
| | | import { ShowToastEvent } from "lightning/platformShowToastEvent"; |
| | | export default class LexVOCAnswer extends LightningElement { |
| | | @api recordId; |
| | | status; |
| | | Isloading = true; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | | console.log(111); |
| | | console.log(currentPageReference); |
| | | |
| | | if (currentPageReference) { |
| | | const urlValue = currentPageReference.state.recordId; |
| | | if (urlValue) { |
| | | let str = `${urlValue}`; |
| | | console.log("str"); |
| | | console.log(str); |
| | | this.recordId = str; |
| | | } |
| | | } |
| | | } |
| | | |
| | | connectedCallback() { |
| | | console.log(this.recordId); |
| | | init({ |
| | | recordId: this.recordId, |
| | | }) |
| | | .then((result) => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.Isloading = false; |
| | | this.status = result.status; |
| | | this.update(); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log("error"); |
| | | console.log(error); |
| | | }) |
| | | .finally(() => {}); |
| | | //window.location.replace("https://ocsm--partial.sandbox.lightning.force.com/lightning/r/Report__c/" + this.recordId + "/view"); |
| | | } |
| | | |
| | | showToast(msg, type) { |
| | | const event = new ShowToastEvent({ |
| | | title: "", |
| | | message: msg, |
| | | variant: type |
| | | }); |
| | | this.dispatchEvent(event); |
| | | } |
| | | |
| | | updateRecordView(recordId) { |
| | | updateRecord({ fields: { Id: recordId } }); |
| | | } |
| | | |
| | | update() { |
| | | if (this.status != "已分配") { |
| | | this.showToast("不是已分配不能点击", "error"); |
| | | return; |
| | | } |
| | | updateForVOCAnswerButton({ |
| | | recordId: this.recordId |
| | | }).then(result => { |
| | | if (result == null) { |
| | | this.showToast("成功", "success"); |
| | | } else { |
| | | console.log(result); |
| | | this.showToast(result,"error"); |
| | | } |
| | | this.updateRecordView(this.recordId); |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | }).catch(error=>{ |
| | | console.log(error); |
| | | }); |
| | | } |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata"> |
| | | <apiVersion>54.0</apiVersion> |
| | | <isExposed>true</isExposed> |
| | | <targets> |
| | | <target>lightning__RecordPage</target> |
| | | <target>lightning__AppPage</target> |
| | | <target>lightning__HomePage</target> |
| | | <target>lightning__RecordAction</target> |
| | | </targets> |
| | | </LightningComponentBundle> |