zz
2023-05-16 c2713cba356b49f7ff316774b582ece5a85fbafa
签收单 验收确认(经销商)
3个文件已添加
111 ■■■■■ 已修改文件
force-app/main/default/lwc/lexESignAcceptanceFranchiser/lexESignAcceptanceFranchiser.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexESignAcceptanceFranchiser/lexESignAcceptanceFranchiser.js 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexESignAcceptanceFranchiser/lexESignAcceptanceFranchiser.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexESignAcceptanceFranchiser/lexESignAcceptanceFranchiser.html
New file
@@ -0,0 +1,4 @@
<template>
    <div class="lexESignAcceptanceHospital" if:true={IsLoding}>
    <lightning-spinner alternative-text="Loading" size="medium">  </lightning-spinner> </div>
</template>
force-app/main/default/lwc/lexESignAcceptanceFranchiser/lexESignAcceptanceFranchiser.js
New file
@@ -0,0 +1,96 @@
import { LightningElement,wire,track,api} from 'lwc';
import { CurrentPageReference } from "lightning/navigation";
import { CloseActionScreenEvent } from 'lightning/actions';
import  init  from '@salesforce/apex/ESignController.ESignController';
import  OcsmResult  from '@salesforce/apex/ESignController.OcsmResult';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class lexESignAcceptanceFranchiser extends LightningElement {
    @api recordId;//OwnerId
    IsLoading = true;
    profileId = '';//当前登录人的权限
    GrouppurchasePCL = null; //是否集采询价
    OCMManProvinceCus = null; //OCSM管理省
    agencyAutoSignUpStatus = null; //经销商状态
    agencySignUpDate = null;// 经销商签收日
    userId; // 当前登录人
    systemProfileId;//系统管理员
    OBA4_sinFor;//OBA4_签收管理
    @wire(CurrentPageReference)
     getStateParameters(currentPageReference) {
         if (currentPageReference) {
           const urlValue = currentPageReference.state.recordId;
           if (urlValue) {
             let str = `${urlValue}`;
             this.recordId = str;
           }
         }
     }
    connectedCallback(){
        init({
            recordId: this.recordId
        }).then(result => {
            console.log(result.agencyAutoSignUpStatus);
            this.GrouppurchasePCL = result.GrouppurchasePCL;
            this.OCMManProvinceCus = result.OCMManProvinceCus;
            this.agencyAutoSignUpStatus = result.agencyAutoSignUpStatus;
            this.agencySignUpDate = result.agencySignUpDate;
            this.profileId = result.profileId;
            this.userId = result.userId;
            this.systemProfileId = result.systemProfileId;
            this.OBA4_sinFor = result.OBA4_sinFor;
            this.IsLoading = false;
            this.AcceptanceFranchiser();
            this.dispatchEvent(new CloseActionScreenEvent());
        })
    }
    //签收单 验收确认(经销商)
    AcceptanceFranchiser(){
    var Group_purchase_PCL ;
    if(this.GrouppurchasePCL == 1){
        Group_purchase_PCL = '集采课';
    }else{
        Group_purchase_PCL = this.OCMManProvinceCus;
    }
    //检索OCSM管理省 上的营业管理部担当
    OcsmResult({GrouppurchasePCL:Group_purchase_PCL}).then(res=>{
        //营业管理部担当id
        var salesManage;
        console.log(res[0].SalesManage__c);
        salesManage = res[0].SalesManage__c;
        //电子签收单id
        var id = this.recordId
        //new 一个对象
        var eSignForm;
        //经销商状态
        var status = this.agencyAutoSignUpStatus;
        if (salesManage || this.profileId == this.systemProfileId) {
            if (salesManage != this.userId && this.profileId != this.systemProfileId && this.profileId != this.OBA4_sinFor) {
                // alert('您只能审批营业管理部担当是自己的签收单!');
                this.showToast("您只能审批营业管理部担当是自己的签收单!","error");
                return;
            } else if (status != '申请中') {
                // alert('您只能审批申请中的签收单!')
                this.showToast("您只能审批申请中的签收单!","error");
                return;
            } else if (this.agencySignUpDate == undefined || this.agencySignUpDate == null || this.agencySignUpDate == "") {
                // alert('经销商签收日为空时,不可以确认!');
                this.showToast("经销商签收日为空时,不可以确认!","error");
                return;
            }else{
                window.open ('/apex/AgencyConfirmPage?id='+this.recordId, '经销商确认',
                'height=440, width=750, top=150, left=300, toolbar=no, menubar=no, scrollbars=no, location=no, status=no');
            }
        }
    })
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
}
force-app/main/default/lwc/lexESignAcceptanceFranchiser/lexESignAcceptanceFranchiser.js-meta.xml
New file
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="lexEquipmentSetRental_Order">
    <apiVersion>51.0</apiVersion>
    <isExposed>true</isExposed>
     <targets>
        <target>lightning__AppPage</target>
        <target>lightning__RecordPage</target>
        <target>lightning__HomePage</target>
        <target>lightning__RecordAction</target>
    </targets>
</LightningComponentBundle>