| | |
| | | } from 'lightning/actions'; |
| | | import init from '@salesforce/apex/buttonRepairQuotationCtl.init'; |
| | | import updateRepairQuotation03 from '@salesforce/apex/buttonRepairQuotationCtl.updateRepairQuotation03'; |
| | | |
| | | import initSelectProfile from '@salesforce/apex/buttonRepairQuotationCtl.initSelectProfile'; |
| | | import { |
| | | ShowToastEvent |
| | | } from 'lightning/platformShowToastEvent'; |
| | |
| | | RentalApplyDiscountStatusC; |
| | | LoanerRepairSysC; |
| | | profileId; |
| | | profileName; |
| | | |
| | | @wire(CurrentPageReference) |
| | | getStateParameters(currentPageReference) { |
| | |
| | | this.RentalApplyDiscountStatusC = result.RentalApplyDiscountStatusC; |
| | | this.LoanerRepairSysC = result.LoanerRepairSysC; |
| | | |
| | | this.RentalApplyDiscountApproval(); |
| | | |
| | | initSelectProfile({ |
| | | profileId: this.profileId |
| | | }).then(result => { |
| | | console.log(result); |
| | | if (result != null) { |
| | | this.IsLoading = false; |
| | | this.profileName = result[0].Name; |
| | | this.RentalApplyDiscountApproval(); |
| | | } |
| | | }) |
| | | this.dispatchEvent(new CloseActionScreenEvent()); |
| | | } |
| | | }).catch(error => { |
| | |
| | | |
| | | // 备品减价申请 |
| | | RentalApplyDiscountApproval() { |
| | | var power = this.profileId; |
| | | // 2B2_备品中心检测&仓库管理 00e10000000xnoY |
| | | if (power != '00e10000000xnoY') { |
| | | var power = this.profileName; |
| | | |
| | | if (power != '2B2_备品中心检测&仓库管理') { |
| | | this.ShowToastEvent("对不起,您没有权限提交此申请!", "error"); |
| | | // alert('对不起,您没有权限提交此申请!'); |
| | | return; |
| | | } |
| | | |
| | | var status = this.RentalApplyDiscountStatusC; |
| | | if (status == '审批中') { |
| | | this.ShowToastEvent("审批提交成功,当前正在审批请勿再提交!", "error"); |
| | | // alert("审批提交成功,当前正在审批请勿再提交!"); |
| | | return; |
| | | } |
| | | if (status == '批准') { |
| | | this.ShowToastEvent("审批已批准,请勿再提交!", "error"); |
| | | // alert("审批已批准,请勿再提交!"); |
| | | return; |
| | | } |
| | | if (status == '草案中' || status == undefined || status == '驳回') { |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | this.ShowToastEvent("请先填写备品减价金额!", "error"); |
| | | // alert("请先填写备品减价金额!"); |
| | | this.ShowToastEvent("提交失败", "error"); |
| | | return; |
| | | } |
| | | } |
| | | location.reload(); |
| | | } |
| | | |
| | | // 弹窗 |