From 29fbeff08ec332db9bc6257e106b81d21c8d4534 Mon Sep 17 00:00:00 2001
From: 付煜 <fuyu3103346691@163.com>
Date: 星期二, 12 四月 2022 09:44:07 +0800
Subject: [PATCH] 系统周报添加字段
---
force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js | 42 +++++++++++++-------
force-app/main/default/classes/WeeklyReportCmp.cls | 16 ++++----
force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp | 9 +++-
3 files changed, 41 insertions(+), 26 deletions(-)
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
index 0dc1c71..d55fc0e 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReport.cmp
@@ -433,9 +433,12 @@
<!-- <force:inputField value="{!v.data.Product_Category3__c}" aura:id="input-product-category3"/> -->
<ui:inputSelect aura:id="select_Product3" class="slds-select" change="{!c.productcategoryChange3}"/>
</div>
- <!--SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start-->
- <!-- 鏀彺闇�姹� -->
-
+ <!--SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start-->
+ <!-- 鏀彺闇�姹� change="{!c.SupportNeeds__c}"-->
+ <div class="slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--1-of-5 slds-large-size--1-of-6">
+ {!v.fieldsmap.SupportNeeds__c}
+ <ui:inputSelect aura:id="SupportNeeds__c" class="slds-select" />
+ </div>
<!--SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end-->
<div aura:id="result" class="disp_none slds-p-horizontal--small slds-size--1-of-1 slds-medium-size--3-of-12 slds-large-size--3-of-12">
{!v.fieldsmap.Result__c}
diff --git a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
index 07de2a6..154a13b 100644
--- a/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
+++ b/force-app/main/default/aura/WeeklyReport/WeeklyReportHelper.js
@@ -20,7 +20,7 @@
component.find('select_result').set('v.options', this.conv_selected(res.allselectlist.Result__c));
component.find('select_stageName').set('v.options', this.conv_selected(res.allselectlist.StageName__c));
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- // component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c));
+ component.find('SupportNeeds__c').set('v.options', this.conv_selected(res.allselectlist.SupportNeeds__c));
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
component.set('v.selected_agency_person', res.allselectlist.AgencyPerson__c[0].label);
component.set('v.dialog_type', '鏂板缓');
@@ -373,7 +373,12 @@
this.set_selected(component, 'select_purpose_type', select_data['Purpose_Type__c']);
this.select_purpose_type(component);
}
-
+ //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+ // 鏀彺闇�姹�
+ if (select_data['SupportNeeds__c'] != '') {
+ this.set_selected(component, 'SupportNeeds__c', select_data['SupportNeeds__c']);
+ }
+ //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
// 绲愭灉
if (select_data['Result__c'] != '' && typeof select_data['Result__c'] !== "undefined") {
component.find('select_result').set('v.value', select_data['Result__c']);
@@ -448,6 +453,7 @@
var Department_Cateogy__c = component.find('select_department').get('v.value');
var doctor2__c = component.find('select_doctor').get('v.value');
var Purpose_Type__c = component.find('select_purpose_type').get('v.value');
+ var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value');
var Opportunity__c = component.get('v.data.Opportunity__c');
var Product_Category1__c = component.find('select_Product1').get('v.value');
var Product_Category2__c = component.find('select_Product2').get('v.value');
@@ -481,6 +487,7 @@
!Department_Cateogy__c &&
!doctor2__c &&
!Purpose_Type__c &&
+ !SupportNeeds__c&&//WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
!Opportunity__c &&
!Product_Category1__c &&
!Product_Category2__c &&
@@ -502,6 +509,7 @@
select_report_data['Department_Cateogy__c'] == Department_Cateogy__c &&
select_report_data['doctor2__c'] == doctor2__c &&
select_report_data['Purpose_Type__c'] == Purpose_Type__c &&
+ select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
select_report_data['Opportunity__c'] == Opportunity__c &&
select_report_data['Product_Category1__c'] == Product_Category1__c &&
select_report_data['Product_Category2__c'] == Product_Category2__c &&
@@ -523,6 +531,7 @@
select_report_data['Department_Cateogy__c'] == Department_Cateogy__c &&
select_report_data['doctor2__c'] == doctor2__c &&
select_report_data['Purpose_Type__c'] == Purpose_Type__c &&
+ select_report_data['SupportNeeds__c'] == SupportNeeds__c &&//WAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔�
select_report_data['Opportunity__c'] == Opportunity__c &&
select_report_data['Product_Category1__c'] == Product_Category1__c &&
select_report_data['Product_Category2__c'] == Product_Category2__c &&
@@ -704,7 +713,7 @@
var Purpose_Type__c = component.find('select_purpose_type').get('v.value');
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
// 鏀彺闇�姹� SupportNeeds__c
- // var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value');
+ var SupportNeeds__c = component.find('SupportNeeds__c').get('v.value');
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
// 璇环 Opportunity__c
var Opportunity__c = component.get('v.data.Opportunity__c');
@@ -781,7 +790,7 @@
"Department_Cateogy" : Department_Cateogy__c,
"Purpose_Type" : Purpose_Type__c,
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- // "SupportNeedsc" : SupportNeeds__c,
+ "SupportNeedsc" : SupportNeeds__c,
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
"Agency_Report_Header" : Agency_Report_Header__c,
"Agency_Hospital" : Agency_Hospital__c,
@@ -849,7 +858,7 @@
"Department_Cateogy" : Department_Cateogy__c,
"Purpose_Type" : Purpose_Type__c,
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- // "SupportNeedsc" : SupportNeeds__c,
+ "SupportNeedsc" : SupportNeeds__c,
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
"Agency_Report_Header" : Agency_Report_Header__c,
"Agency_Hospital" : Agency_Hospital__c,
@@ -945,6 +954,9 @@
component.set('v.doctor_title', '');
component.find('select_department').set('v.options', this.conv_selected(component.get('v.allselectlist.Department_Cateogy__c')));
component.find('select_purpose_type').set('v.options', this.conv_selected(component.get('v.allselectlist.Purpose_Type__c')));
+ //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+ component.find('SupportNeeds__c').set('v.options', this.conv_selected(component.get('v.allselectlist.SupportNeeds__c')));
+ //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
// ToDo闇�瑕佹祴璇曟墜鏈轰笂鑳借繍琛屼笉
component.set('v.data.Opportunity__c', '');
component.find('select_Product1').set('v.value','');
@@ -1945,8 +1957,8 @@
columnDivider = ',';
lineDivider = '\n';
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start ,'SupportNeeds__c' ,'鏀彺闇�姹�'
- keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c'];
- thkeys = ['鍛�','鎷呭綋','娲诲姩鏃�','鍖婚櫌','绉戝','鎷滆浜�','鑱屼綅','浜у搧鍖哄垎1','浜у搧鍖哄垎2','浜у搧鍖哄垎3','娲诲姩鍖哄垎','缁撴灉']
+ keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c'];
+ thkeys = ['鍛�','鎷呭綋','娲诲姩鏃�','鍖婚櫌','绉戝','鎷滆浜�','鑱屼綅','浜у搧鍖哄垎1','浜у搧鍖哄垎2','浜у搧鍖哄垎3','娲诲姩鍖哄垎','缁撴灉','鏀彺闇�姹�']
csvStringResult = '';
csvStringResult += thkeys.join(columnDivider);
csvStringResult += lineDivider;
@@ -1975,9 +1987,9 @@
}else if(skey == 'Product_Category3__c'){
csvStringResult += '"'+ objectRecords[i].Product_Category3__r.Name+'"';
}
- // else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- // csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"';
- // }
+ else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+ csvStringResult += '"'+ objectRecords[i].SupportNeeds__c+'"';
+ }
else{
csvStringResult += '"'+ objectRecords[i][skey]+'"';
}
@@ -1993,8 +2005,8 @@
},
showExportDate : function(component,objectRecords){
console.log('杩涘叆showexceportdate'+objectRecords);//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start ,'SupportNeeds__c' ,'鏀彺闇�姹�'
- var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c'];
- var headers = ['鍛�','鎷呭綋','娲诲姩鏃�','鍖婚櫌','绉戝','鎷滆浜�','鑱屼綅','浜у搧鍖哄垎1','浜у搧鍖哄垎2','浜у搧鍖哄垎3','娲诲姩鍖哄垎','缁撴灉']
+ var keys = ['Submit_date__c','Person_In_Charge2__c','Report_Date__c','Agency_Hospital__c','Department_Cateogy__c','doctor2__c','visitor_title__c','Product_Category1__c','Product_Category2__c','Product_Category3__c','Purpose_Type__c','Result__c','SupportNeeds__c'];
+ var headers = ['鍛�','鎷呭綋','娲诲姩鏃�','鍖婚櫌','绉戝','鎷滆浜�','鑱屼綅','浜у搧鍖哄垎1','浜у搧鍖哄垎2','浜у搧鍖哄垎3','娲诲姩鍖哄垎','缁撴灉','鏀彺闇�姹�']
var content = "<table class=\"table slds-table slds-table--bordered slds-table--cell-buffer\">";
content += "<thead><tr class=\"slds-text-title--caps\">";
for(i=0;i<headers.length; i++){
@@ -2026,9 +2038,9 @@
}else if(skey == 'Product_Category3__c'){
content += '<td>'+ objectRecords[i].Product_Category3__r.Name+'</td>';
}
- // else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- // content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>';
- // }
+ else if(skey == 'SupportNeeds__c'){//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
+ content += '<td>'+ objectRecords[i].SupportNeeds__c+'</td>';
+ }
else{
content += '<td>'+ objectRecords[i][skey]+'</td>';
}
diff --git a/force-app/main/default/classes/WeeklyReportCmp.cls b/force-app/main/default/classes/WeeklyReportCmp.cls
index 9ffb987..9e5871e 100644
--- a/force-app/main/default/classes/WeeklyReportCmp.cls
+++ b/force-app/main/default/classes/WeeklyReportCmp.cls
@@ -130,7 +130,7 @@
this.allselectlist.put('StageName__c', WeeklyReportCmp.getPicklistValues('Agency_Opportunity__c','StageName__c'));
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
// 鏀彺闇�姹� SupportNeeds__c
- // this.allselectlist.put('SupportNeeds__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','SupportNeeds__c'));
+ this.allselectlist.put('SupportNeeds__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','SupportNeeds__c'));
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
// 鑱屼綅
// this.allselectlist.put('visitor_title__c', WeeklyReportCmp.getPicklistValues('Agency_Report__c','visitor_title__c'));
@@ -374,7 +374,7 @@
@RemoteAction
@AuraEnabled//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeedsc ,String SupportNeedsc
- public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,
+ public static String saveAgencyReport(String Department_Cateogy, String Purpose_Type,String SupportNeedsc, String Agency_Report_Header,
String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
String Product_Category1, String Product_Category2, String Product_Category3,
String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date)
@@ -382,7 +382,7 @@
Agency_Report__c agency_report = makeAgencyReport(Department_Cateogy, Purpose_Type, Agency_Report_Header,
Agency_Hospital, Person_In_Charge2, doctor, Submit_date,
Product_Category1, Product_Category2, Product_Category3,//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeedsc ,SupportNeedsc
- Result, Opportunity, StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date);
+ Result, Opportunity, StageName, oppAmount, oppOCMPrice, Close_Forecasted_Date, Report_Date,SupportNeedsc);
agency_report = LightningUtil.insertAgencyReport(agency_report);
return agency_report.Id;
@@ -390,7 +390,7 @@
public static Agency_Report__c makeAgencyReport(String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,
String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
String Product_Category1, String Product_Category2, String Product_Category3,//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c ,String SupportNeedsc
- String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date)
+ String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date,String SupportNeedsc)
{
Agency_Report__c agency_report = new Agency_Report__c();
Date week = Date.valueOf(Submit_date);
@@ -420,7 +420,7 @@
if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; }
if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; }
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start
- // if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; }
+ if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; }
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� end
if (Agency_Report_Header != '') { agency_report.Agency_Report_Header__c = Agency_Report_Header; }
if (Agency_Hospital != '') { agency_report.Agency_Hospital__c = Agency_Hospital; }
@@ -458,7 +458,7 @@
@RemoteAction
@AuraEnabled
- public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy, String Purpose_Type, String Agency_Report_Header,
+ public static String editAgencyReport(String Agency_Report_Id, String Department_Cateogy, String Purpose_Type,String SupportNeedsc, String Agency_Report_Header,
String Agency_Hospital, String Person_In_Charge2, String doctor, String Submit_date,
String Product_Category1, String Product_Category2, String Product_Category3, //SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c ,String SupportNeedsc
String Result, String Opportunity, String StageName, String oppAmount, String oppOCMPrice, String Close_Forecasted_Date, String Report_Date)
@@ -466,7 +466,7 @@
if (String.isBlank(Agency_Report_Id)) {
return null;
}//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c ,SupportNeeds__c
- Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c, Agency_Hospital__c,
+ Agency_Report__c agency_report = [select Id, Name, Department_Cateogy__c, Purpose_Type__c,SupportNeeds__c, Agency_Hospital__c,
Person_In_Charge2__c, doctor2__c, Submit_date__c, Product_Category__c, Result__c, visitor_title__c, Opportunity__c
from Agency_Report__c where id=:Agency_Report_Id];
Date week = Date.valueOf(Submit_date);
@@ -492,7 +492,7 @@
if (Department_Cateogy != '') { agency_report.Department_Cateogy__c = Department_Cateogy; } else { agency_report.Department_Cateogy__c = null; }
if (Purpose_Type != '') { agency_report.Purpose_Type__c = Purpose_Type; } else { agency_report.Purpose_Type__c = null; }
//SWAG-CBX68C fy 銆愬鎵樸�慏AMS绯荤粺鍛ㄦ姤妯″潡鍐呭闇�姹傚鍔� start SupportNeeds__c
- // if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } else { agency_report.SupportNeeds__c = null; }
+ if (SupportNeedsc != '') { agency_report.SupportNeeds__c = SupportNeedsc; } else { agency_report.SupportNeeds__c = null; }
if (Agency_Hospital != '') { agency_report.Agency_Hospital__c = Agency_Hospital; } else { agency_report.Agency_Hospital__c = null; }
if (Product_Category1 != '') { agency_report.Product_Category1__c = Product_Category1; } else { agency_report.Product_Category1__c = null; }
if (Product_Category2 != '') { agency_report.Product_Category2__c = Product_Category2; } else { agency_report.Product_Category2__c = null; }
--
Gitblit v1.9.1