unknown
2023-07-06 1affe0019aa91c71fa167cfc88b21b362a072864
出库指示

出库指示 耗材申请 按钮
3个文件已添加
105 ■■■■■ 已修改文件
force-app/main/default/lwc/lexLoanerArrangedEmailConsumApply/lexLoanerArrangedEmailConsumApply.html 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLoanerArrangedEmailConsumApply/lexLoanerArrangedEmailConsumApply.js 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLoanerArrangedEmailConsumApply/lexLoanerArrangedEmailConsumApply.js-meta.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
force-app/main/default/lwc/lexLoanerArrangedEmailConsumApply/lexLoanerArrangedEmailConsumApply.html
New file
@@ -0,0 +1,3 @@
<template>
</template>
force-app/main/default/lwc/lexLoanerArrangedEmailConsumApply/lexLoanerArrangedEmailConsumApply.js
New file
@@ -0,0 +1,91 @@
import { LightningElement, track, wire, api } from 'lwc';
import { CurrentPageReference,NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { CloseActionScreenEvent } from 'lightning/actions';
import init from '@salesforce/apex/lexConsumApplyController.init';
import approvalCheck from '@salesforce/apex/ConsumApplyWebService.approvalCheck';
import setShipment_request from '@salesforce/apex/ConsumApplyWebService.setShipment_request';
import getLength1 from '@salesforce/apex/lexConsumApplyController.getLength1';
import getLength2 from '@salesforce/apex/lexConsumApplyController.getLength2';
export default class lexLoanerArrangedEmailConsumApply extends LightningElement {
    @api recordId;
    @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(res=>{
            if(res.weiAssignedCnt > 0){
                this.showToast('申请单内存在未分配的耗材,请分配或分割申请单','warning');
                return;
            }else if(res.consumApplyStatus == '取消'){
                this.showToast('学会取消,不可出库指示','warning');
                return;
            }else if(res.consumApplyStatus == '已出库指示' && res.assignedNotShipment == 0){
                this.showToast('所有的耗材备品Set一览都进行过出库指示了','warning');
                return;
            }else if(res.assignedNotShipment == 0){
                this.showToast('没有可以出库指示的明细','warning');
                return;
            }else{
                approvalCheck({
                    ConsumApplyId: this.recordId
                }).then(rs1=>{
                    if(rs1 != '1'){
                        this.showToast(rs1,'warning');
                    }else{
                        setShipment_request({
                            raid: this.recordId
                        }).then(result=>{
                            if(result == '状态更新到已出库指示'){
                                this.showToast('状态更新到已出库指示','success');
                                window.open('/apex/ConsumTrialPDF?id={!Consum_Apply__c.Id}');
                                return;
                                // if(res.bollowDate!= '' || res.bollowDate != null){
                                //     getLength1({recordId:this.recordId}).then(result1=>{
                                //         window.open('/apex/ConsumTrialPDF?id={!Consum_Apply__c.Id}');
                                //     })
                                // }
                            }else{
                                this.showToast(result,'warning');
                                return;
                            }
                        })
                    }
                })
            }
        })
    }
    print(){
    }
    showToast(msg,type) {
        const event = new ShowToastEvent({
            message: msg,
            variant: type
        });
        if(type == 'success'){
            this.updateRecordView(this.recordId);
        }
        this.dispatchEvent(event);
        this.dispatchEvent(new CloseActionScreenEvent());
    }
    updateRecordView(recordId) {
        updateRecord({fields: { Id: recordId }});
    }
}
force-app/main/default/lwc/lexLoanerArrangedEmailConsumApply/lexLoanerArrangedEmailConsumApply.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="lexLoanerArrangedEmailConsumApply">
    <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>