From cca92679ebebf35a6cbff4da9c6181ea7204a841 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期二, 16 五月 2023 18:01:46 +0800
Subject: [PATCH] 修改列表按钮
---
force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.js | 68 +++++++++++
force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.css | 22 +++
force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.js | 103 +++++++++++++++++
force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.css | 22 +++
force-app/main/default/lwc/lexOPDReportFlowLwc/__tests__/lexOPDReportFlowLwc.test.js | 25 ++++
force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.js-meta.xml | 36 ++++++
force-app/main/default/lwc/lexOPDReportConsumFlowLwc/__tests__/lexOPDReportConsumFlowLwc.test.js | 25 ++++
force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.js-meta.xml | 32 +++++
force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.html | 13 ++
force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.html | 13 ++
10 files changed, 359 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/__tests__/lexOPDReportConsumFlowLwc.test.js b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/__tests__/lexOPDReportConsumFlowLwc.test.js
new file mode 100644
index 0000000..8f50b12
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/__tests__/lexOPDReportConsumFlowLwc.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexOPDReportConsumFlowLwc from 'c/lexOPDReportConsumFlowLwc';
+
+describe('c-lex-opd-report-consum-flow-lwc', () => {
+ afterEach(() => {
+ // The jsdom instance is shared across test cases in a single file so reset the DOM
+ while (document.body.firstChild) {
+ document.body.removeChild(document.body.firstChild);
+ }
+ });
+
+ it('TODO: test case generated by CLI command, please fill in test logic', () => {
+ // Arrange
+ const element = createElement('c-lex-opd-report-consum-flow-lwc', {
+ is: LexOPDReportConsumFlowLwc
+ });
+
+ // Act
+ document.body.appendChild(element);
+
+ // Assert
+ // const div = element.shadowRoot.querySelector('div');
+ expect(1).toBe(1);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.css b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.css
new file mode 100644
index 0000000..95c1c55
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.css
@@ -0,0 +1,22 @@
+.holder{
+ position: relative;
+ display: inline-block;
+ width: 80px;
+ height: 80px;
+ text-align: center;
+}
+
+.container .uiContainerManager{
+ display : none !important;
+}
+.toast{
+ border: 1px solid #c9c9c9;
+ border-radius: 10px;
+ width: 50%;
+ margin: 0 auto;
+ font-size: 18px;
+ font-weight: bold;
+ padding: 10px 20px;
+ background: #feb75d;
+ display: flex;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.html b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.html
new file mode 100644
index 0000000..fc31dc4
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.html
@@ -0,0 +1,13 @@
+<template>
+ <div class="holder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+ <div if:false={IsLoading} class="toast">
+ <span style="padding: 10px;">{msg}</span>
+ <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;">
+ <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small"
+ title="Close" style="color: black;"></lightning-icon>
+ <span class="slds-assistive-text">Close</span>
+ </button>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.js b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.js
new file mode 100644
index 0000000..07117fe
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.js
@@ -0,0 +1,68 @@
+/*
+ * @Description:
+ * @version:
+ * @Author: chen jing wu
+ * @Date: 2023-05-16 13:37:44
+ * @LastEditors: chen jing wu
+ * @LastEditTime: 2023-05-16 15:18:25
+ */
+import { LightningElement,api, track, wire } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { NavigationMixin } from 'lightning/navigation';
+export default class LexOPDReportConsumFlowLwc extends LightningElement {
+ @api recordId;
+ @api raStatus;
+ @api productCategory;
+ @api name;
+ @api hospitalId;
+ @api hospital;
+ @api strategicDeptId;
+ @api strategicDept;
+ @api accountId;
+ @api account;
+ @api rentalApplyId;
+ msg;
+ Isloading = true;
+ connectedCallback(){
+ console.log(this.recordId);
+ var status = this.raStatus;
+ if(status != "宸插嚭搴�" && status != "鐢宠鑰呭凡鏀惰揣" && status != "寰呮秷鑰�" && status != "宸插洖瀵�" && status != "瀹屼簡"){
+ this.msg = "鑰楁潗鍊熷嚭鐘舵��:" + status + "锛屼笉鑳藉垱寤烘姤鍛婁功锛�";
+ this.Isloading = false;
+ return;
+ }
+ var Product_category = this.productCategory;
+ var strs ;
+ var url
+ if(Product_category =='ET'){
+ strs='&RecordType=01210000000NPDz'
+ }else if(Product_category =='DISP'){
+ strs='&RecordType=01210000000NPDp'
+ }else{
+ strs = '';
+ }
+ if(strs.length<=0){
+ url = '/setup/ui/recordtypeselect.jsp?retURL=%2F'
+ + this.rentalApplyId
+ + '&save_new_url=%2Fa0B%2Fe%3FretURL%3D%252Fa0B%252Fo';
+ }else{
+ url = '/a0B/e?retURL=%2Fa0B%2Fo' + strs;
+ }
+ url += '&CF00N100000098rY2=' + this.name +
+ '&CF00N100000098rY2_lkid=' + this.recordId +
+ '&CF00N10000002DPUD=' + this.hospital +
+ '&CF00N10000002DPUD_lkid=' + this.hospitalId +
+ '&CF00N10000002Dh0f=' + this.strategicDept +
+ '&CF00N10000002Dh0f_lkid=' + this.strategicDeptId +
+ '&CF00N10000002CWW4=' + this.account +
+ '&CF00N10000002CWW4_lkid=' + this.accountId +'&ent=01I10000000SWfe';
+ window.open(url);
+ this.closeAction();
+ }
+ closeAction() {
+ //杩斿洖褰撳墠鐨勫鍝佺敵璇�
+ window.open("/"+this.recordId,'_self');
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.js-meta.xml b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.js-meta.xml
new file mode 100644
index 0000000..269bd57
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportConsumFlowLwc/lexOPDReportConsumFlowLwc.js-meta.xml
@@ -0,0 +1,32 @@
+<?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__AppPage</target>
+ <target>lightning__RecordPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ <!-- 灞忓箷娴侀厤缃� -->
+ <target>lightning__FlowScreen</target>
+ </targets>
+
+ <!-- 瀹氫箟鍙橀噺 -->
+
+ <targetConfigs>
+ <targetConfig targets="lightning__FlowScreen">
+ <!-- name js涓娇鐢ㄧ殑鍙橀噺锛屼粠灞忓箷娴佷腑鑾峰彇鍙傛暟 label 鍦ㄥ睆骞曟祦鐨勮LWC鐨勮缃腑鏄剧ず -->
+ <property name="recordId" type="String" label="recordId"/>
+ <property name="raStatus" type="String" label="raStatus"/>
+ <property name="productCategory" type="String" label="productCategory"/>
+ <property name="name" type="String" label="name"/>
+ <property name="hospitalId" type="String" label="hospitalId"/>
+ <property name="strategicDeptId" type="String" label="strategicDeptId"/>
+ <property name="accountId" type="String" label="accountId"/>
+ <property name="rentalApplyId" type="String" label="rentalApplyId"/>
+ <property name="account" type="String" label="account"/>
+ <property name="strategicDept" type="String" label="strategicDept"/>
+ <property name="hospital" type="String" label="hospital"/>
+ </targetConfig>
+ </targetConfigs>
+</LightningComponentBundle>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReportFlowLwc/__tests__/lexOPDReportFlowLwc.test.js b/force-app/main/default/lwc/lexOPDReportFlowLwc/__tests__/lexOPDReportFlowLwc.test.js
new file mode 100644
index 0000000..75fe30d
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportFlowLwc/__tests__/lexOPDReportFlowLwc.test.js
@@ -0,0 +1,25 @@
+import { createElement } from 'lwc';
+import LexOPDReportFlowLwc from 'c/lexOPDReportFlowLwc';
+
+describe('c-lex-opd-report-flow-lwc', () => {
+ afterEach(() => {
+ // The jsdom instance is shared across test cases in a single file so reset the DOM
+ while (document.body.firstChild) {
+ document.body.removeChild(document.body.firstChild);
+ }
+ });
+
+ it('TODO: test case generated by CLI command, please fill in test logic', () => {
+ // Arrange
+ const element = createElement('c-lex-opd-report-flow-lwc', {
+ is: LexOPDReportFlowLwc
+ });
+
+ // Act
+ document.body.appendChild(element);
+
+ // Assert
+ // const div = element.shadowRoot.querySelector('div');
+ expect(1).toBe(1);
+ });
+});
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.css b/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.css
new file mode 100644
index 0000000..95c1c55
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.css
@@ -0,0 +1,22 @@
+.holder{
+ position: relative;
+ display: inline-block;
+ width: 80px;
+ height: 80px;
+ text-align: center;
+}
+
+.container .uiContainerManager{
+ display : none !important;
+}
+.toast{
+ border: 1px solid #c9c9c9;
+ border-radius: 10px;
+ width: 50%;
+ margin: 0 auto;
+ font-size: 18px;
+ font-weight: bold;
+ padding: 10px 20px;
+ background: #feb75d;
+ display: flex;
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.html b/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.html
new file mode 100644
index 0000000..fc31dc4
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.html
@@ -0,0 +1,13 @@
+<template>
+ <div class="holder" if:true={IsLoading}>
+ <lightning-spinner alternative-text="Loading" size="medium"></lightning-spinner>
+ </div>
+ <div if:false={IsLoading} class="toast">
+ <span style="padding: 10px;">{msg}</span>
+ <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse" onclick={closeAction} title="Close" style="background-color: #e5e4e2;margin-top: 15px;">
+ <lightning-icon class="greyIcon" icon-name="utility:close" alternative-text="Connected" variant="inverse" size="small"
+ title="Close" style="color: black;"></lightning-icon>
+ <span class="slds-assistive-text">Close</span>
+ </button>
+ </div>
+</template>
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.js b/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.js
new file mode 100644
index 0000000..4ff21f4
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.js
@@ -0,0 +1,103 @@
+import { LightningElement,api, track, wire } from 'lwc';
+import {CurrentPageReference} from 'lightning/navigation';
+import { CloseActionScreenEvent } from 'lightning/actions';
+import { ShowToastEvent } from 'lightning/platformShowToastEvent';
+import { NavigationMixin } from 'lightning/navigation';
+
+export default class LexOPDReportFlowLwc extends NavigationMixin(LightningElement) {
+ @api recordId;
+ @api assetReturnDay2;
+ @api demoPurpose2;
+ @api followUPOpp;
+ @api followUPOppId;
+ @api opdPlan;
+ @api opdPlanId;
+ @api raStatus;
+ @api name;
+ @api hospitalId;
+ @api hospital;
+ @api strategicDeptId;
+ @api strategicDept;
+ @api accountId;
+ @api account;
+ msg;
+ Isloading = true;
+ connectedCallback(){
+ var status = this.raStatus;
+ if(status != "宸插嚭搴�" && status != "鐢宠鑰呭凡鏀惰揣" && status != "鍖婚櫌宸茶鏈虹‘璁�" && status != "宸插洖瀵�" && status != "宸插洖鏀�" && status != "瀹屼簡" && status != "娆犲搧涓�"){
+ this.msg = "澶囧搧鍊熷嚭鐘舵��:" + status + "锛屼笉鑳藉垱寤烘姤鍛婁功锛�";
+ this.Isloading = false;
+ return;
+ }
+
+ //var d = new Date("{!Rental_Apply__c.Asset_return_day2__c}");
+ //var d15 = new Date("{!Rental_Apply__c.Asset_return_day2__c}");
+ //d15.setDate(d.getDate()+7);
+ //if(status == "宸插洖瀵�" && ( new Date()< d || new Date() > d15)){
+ // alert("澶囧搧鍊熷嚭鐘舵��:" + status + "锛屼絾涓嶅湪鍥炲瘎鏃ヤ箣鍚�7澶╀箣鍐咃紝涓嶈兘鍒涘缓鎶ュ憡涔︼紒");
+ // return;
+ //}
+ //2021/7/15 fxk Start
+ var str;
+ var url;
+
+ str='&RecordType=01210000000RLTi';
+ url = '/a0B/e?retURL=%2Fa0B%2Fo'+str;
+
+ //2021/7/15 fxk End
+
+ //SWAG-BVW8CW 20201217 璁﹗ser鑷繁閫夋嫨recordtype
+ //鐩殑2涓�---璇曠敤锛堟湁璇环锛� 甯﹁浠�
+ var demo_purpose2 = this.demoPurpose2;
+ var strs ;
+ if(demo_purpose2=='璇曠敤锛堟湁璇环锛�'){
+ strs='&CF00N10000002DT68=' + this.followUPOpp +
+ '&CF00N10000002DT68_lkid=' + this.followUPOppId +
+ '&00N10000002DHk5=璺熻繘璇环'
+ }
+ //window.open('/a0B/e?retURL=%2F{!Rental_Apply__c.Id}'+
+ //'&RecordType=01210000000Qekj&ent=01I10000000SWfe'+
+
+ //Before Update by LiJun 20220321 start
+ /*window.open(url +=
+ '&CF00N10000004maf3={!Rental_Apply__c.Name}' +
+ '&CF00N10000004maf3_lkid={!Rental_Apply__c.Id}' +
+ '&CF00N10000002DPUD={!Rental_Apply__c.Hospital__c}'+
+ '&CF00N10000002DPUD_lkid={!Rental_Apply__c.HospitalId__c}'+
+ '&CF00N10000002Dh0f={!Rental_Apply__c.Strategic_dept__c}' +
+ '&CF00N10000002Dh0f_lkid={!Rental_Apply__c.Strategic_deptId__c}'+
+ '&CF00N10000008ps6d={!Rental_Apply__c.OPDPlan__c}' +
+ '&CF00N10000008ps6d_lkid={!Rental_Apply__c.OPDPlanId__c}'+
+ '&CF00N10000002CWW4={!Rental_Apply__c.Account__c}'+
+ '&CF00N10000002CWW4_lkid={!Rental_Apply__c.AccountId__c}'+strs)
+ }*/
+ //Before Update by LiJun 20220321 end
+ //After Update by LiJun 20220321 start
+ url = url + '&CF00N10000004maf3=' + this.name +
+ '&CF00N10000004maf3_lkid=' + this.recordId +
+ '&CF00N10000002DPUD=' + this.hospital +
+ '&CF00N10000002DPUD_lkid=' + this.hospitalId +
+ '&CF00N10000002Dh0f=' + this.strategicDept +
+ '&CF00N10000002Dh0f_lkid='+ this.strategicDeptId +
+ '&CF00N10000008ps6d=' + this.opdPlan +
+ '&CF00N10000008ps6d_lkid=' + this.opdPlanId +
+ '&CF00N10000002CWW4=' + this.account +
+ '&CF00N10000002CWW4_lkid=' + this.accountId;
+ if(strs){
+ url= url+strs;
+ }
+ window.open(url);
+ this.closeAction();
+ //After Update by LiJun 20220321 end
+ }
+ closeAction() {
+ //杩斿洖褰撳墠鐨勫鍝佺敵璇�
+ this[NavigationMixin.Navigate]({
+ type: 'standard__recordPage',
+ attributes: {
+ recordId: this.recordId,
+ actionName: 'view'
+ }
+ });
+ }
+}
\ No newline at end of file
diff --git a/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.js-meta.xml b/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.js-meta.xml
new file mode 100644
index 0000000..c2f16ac
--- /dev/null
+++ b/force-app/main/default/lwc/lexOPDReportFlowLwc/lexOPDReportFlowLwc.js-meta.xml
@@ -0,0 +1,36 @@
+<?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__AppPage</target>
+ <target>lightning__RecordPage</target>
+ <target>lightning__HomePage</target>
+ <target>lightning__RecordAction</target>
+ <!-- 灞忓箷娴侀厤缃� -->
+ <target>lightning__FlowScreen</target>
+ </targets>
+
+ <!-- 瀹氫箟鍙橀噺 -->
+
+ <targetConfigs>
+ <targetConfig targets="lightning__FlowScreen">
+ <!-- name js涓娇鐢ㄧ殑鍙橀噺锛屼粠灞忓箷娴佷腑鑾峰彇鍙傛暟 label 鍦ㄥ睆骞曟祦鐨勮LWC鐨勮缃腑鏄剧ず -->
+ <property name="recordId" type="String" label="recordId"/>
+ <property name="raStatus" type="String" label="raStatus"/>
+ <property name="name" type="String" label="name"/>
+ <property name="hospitalId" type="String" label="hospitalId"/>
+ <property name="strategicDeptId" type="String" label="strategicDeptId"/>
+ <property name="accountId" type="String" label="accountId"/>
+ <property name="account" type="String" label="account"/>
+ <property name="strategicDept" type="String" label="strategicDept"/>
+ <property name="hospital" type="String" label="hospital"/>
+ <property name="assetReturnDay2" type="String" label="assetReturnDay2"/>
+ <property name="demoPurpose2" type="String" label="demoPurpose2"/>
+ <property name="followUPOpp" type="String" label="followUPOpp"/>
+ <property name="followUPOppId" type="String" label="followUPOppId"/>
+ <property name="opdPlan" type="String" label="opdPlan"/>
+ <property name="opdPlanId" type="String" label="opdPlanId"/>
+ </targetConfig>
+ </targetConfigs>
+</LightningComponentBundle>
\ No newline at end of file
--
Gitblit v1.9.1