import { LightningElement, track } from 'lwc';
|
import GetInspectById from '@salesforce/apex/InspectCheckController.GetInspectById';
|
import SaveDataYB from '@salesforce/apex/InspectCheckController.SaveDataYB';
|
import ChangeDataYB from '@salesforce/apex/InspectCheckController.ChangeDataYB';
|
import GetIrresponsibleReason from '@salesforce/apex/InspectCheckController.GetIrresponsibleReason';
|
import GetproInvolvedManual from '@salesforce/apex/InspectCheckController.GetproInvolvedManual';
|
|
import CheckOwnerRequest from '@salesforce/apex/InspectCheckController.CheckOwner';
|
|
export default class Yb extends LightningElement {
|
|
//提示
|
Tongzhishow=false; //提示显示的标识
|
SaveShowText="操作成功"; //提示显示的文本
|
TongzhiIcon = 'standard:account' //提示显示的标签
|
IsLeftStyle = "" //提示显示的样式
|
BgColorStyle = ""
|
Alert(content,error = false,left = false){
|
this.SaveShowText = content;
|
this.Tongzhishow = true;
|
// setTimeout(()=>{
|
// this.Tongzhishow = false;
|
// this.SaveShowText = "";
|
// },3000)
|
if (error) {
|
this.TongzhiIcon = "standard:first_non_empty";
|
this.BgColorStyle = "background-color:#f88568";
|
}else{
|
this.TongzhiIcon = "standard:account";
|
this.BgColorStyle = "background-color:#69e669";
|
}
|
if (left) {
|
this.IsLeftStyle = "left: 0.25rem;"
|
}else{
|
this.IsLeftStyle = ""
|
}
|
}
|
|
CloseAlert()
|
{
|
if (this.Tongzhishow == true) {
|
this.Tongzhishow = false;
|
}
|
if (this.SaveShowText != "") {
|
this.SaveShowText = "";
|
}
|
|
}
|
|
getQueryVariable(variable)
|
{
|
var query = window.location.search.substring(1);
|
var vars = query.split("&");
|
for (var i=0;i<vars.length;i++) {
|
var pair = vars[i].split("=");
|
if(pair[0] == variable){return pair[1];}
|
}
|
return(false);
|
}
|
ParamIdStr = ''
|
connectedCallback(){
|
var paramId = this.getQueryVariable('id');
|
if (paramId == null || paramId == '') {
|
return ;
|
}
|
this.ParamIdStr= paramId;
|
|
this.GetInspectByIdFn(paramId);
|
// this.CheckOwner(paramId);
|
this.GetIrresponsibleReasonFn();
|
//20220913 you SWAG-CJ3DS5 start
|
this.GetproInvolvedManualFn();
|
}
|
|
CheckResult = false;
|
CheckOwner(Id)
|
{
|
debugger;
|
CheckOwnerRequest({Id:Id}).then(result=>{
|
var resultArr = result.split("==");
|
if (resultArr[0] == resultArr[1]) {
|
this.CheckResult = false;
|
}else{
|
this.CheckResult = true;
|
}
|
|
if (this.CheckResult) {
|
this.InspectData.IsBid__c = '是';
|
this.InspectData.irresponsibleReason__c = '';
|
this.InspectData.irresponsibleReasonOther__c = '';
|
//20220914 you SWAG-CJ3DS5 start
|
this.InspectData.proInvolvedManual__c = '';
|
this.InspectData.proInvolved__c = '';
|
//20220914 you SWAG-CJ3DS5 end
|
this.irresponsibleReasonShow = false;
|
this.otherShow = false;
|
this.IsBC= false;
|
this.BCIsShow = false;
|
this.YSJEIsShow = false;
|
this.IsYSJE = false;
|
this.IsSQZ = true;
|
}else{
|
this.IsSQZ = false;
|
}
|
// this.ShowText = result;
|
})
|
}
|
ShowText = '';
|
IrresponsibleReasons = []; //选项列表展示的列
|
GetIrresponsibleReasonFn()
|
{
|
GetIrresponsibleReason().then(result=>{
|
var response=JSON.parse(result);
|
this.IrresponsibleReasons = response;
|
})
|
|
}
|
//20220913 you SWAG-CJ3DS5 start
|
GetproInvolvedManuals = []; //选项列表展示的列
|
GetproInvolvedManualFn()
|
{
|
GetproInvolvedManual().then(result=>{
|
var response=JSON.parse(result);
|
this.GetproInvolvedManuals = response;
|
})
|
|
}
|
//20220913 you SWAG-CJ3DS5 end
|
|
|
@track InspectData = {}; //数据
|
IsSQZ = false; //申请中的标识
|
IsSQZButton = false;
|
GetInspectByIdFn(Id)
|
{
|
GetInspectById({Id:Id}).then(result=>{
|
var response=JSON.parse(result);
|
if (response!=undefined && response.length == 1) {
|
var tempData = response[0];
|
tempData.IsBid__c = '否';
|
debugger;
|
if (tempData.InvolveBudgetAmount__c != undefined) {
|
this.YSJEIsContent = tempData.InvolveBudgetAmount__c;
|
}else
|
{
|
if (tempData.BudgetAmountNumber__c != undefined) {
|
this.YSJEIsContent = tempData.BudgetAmountNumber__c;
|
}
|
}
|
|
if (tempData.proInvolved__c != undefined) {
|
this.SJCPIsContent = tempData.proInvolved__c;
|
}else{
|
tempData.proInvolved__c = '';
|
}
|
//20220913 you SWAG-CJ3DS5 start
|
// if (tempData.irresponsibleReason__c == "招标产品与我司不匹配") {
|
// this.SJCPIsShow = true;
|
// }else{
|
// this.SJCPIsShow = false;
|
// }GetproInvolvedManualShow
|
|
if (tempData.irresponsibleReason__c == "招标产品与我司不匹配") {
|
this.GetproInvolvedManualShow = true;
|
}else{
|
this.GetproInvolvedManualShow = false;
|
}
|
if (tempData.proInvolvedManual__c == "其他") {
|
this.SJCPIsShow = true;
|
}else{
|
this.SJCPIsShow = false;
|
}
|
//20220913 you SWAG-CJ3DS5 end
|
tempData.InvolveBudgetAmount__c = this.YSJEIsContent ;
|
|
if(this.YSJEIsContent == 0 || this.YSJEIsContent == '')
|
{
|
this.YSJEIsShow = false;
|
}
|
|
if (tempData.IsBid__c != undefined && tempData.IsBid__c == '否') {
|
this.irresponsibleReasonShow = true;
|
this.BCIsShow = true;
|
// this.YSJEIsShow = true;
|
}else{
|
this.irresponsibleReasonShow = false;
|
}
|
if (tempData.IsBid__c != undefined && tempData.IsBid__c == '否' && tempData.irresponsibleReason__c != undefined && tempData.irresponsibleReason__c == '其他(可手动填写)') {
|
this.otherShow = true;
|
}else{
|
this.otherShow = false;
|
}
|
|
|
if (tempData.irresponsibleReason__c == undefined) {
|
tempData.irresponsibleReason__c = '';
|
}
|
|
if (tempData.RepsExtraContent__c == undefined) {
|
tempData.RepsExtraContent__c = '';
|
}
|
|
if (tempData.irresponsibleReasonOther__c == undefined) {
|
tempData.irresponsibleReasonOther__c = '';
|
}
|
//20220914 you SWAG-CJ3DS5 start
|
if (tempData.proInvolvedManual__c == undefined) {
|
tempData.proInvolvedManual__c = '';
|
}
|
if (tempData.proInvolved__c == undefined) {
|
tempData.proInvolved__c = '';
|
}
|
//20220914 you SWAG-CJ3DS5 end
|
debugger;
|
if (tempData.NotBidApprovalStatus__c == '申请中') {
|
setTimeout(()=>{
|
this.IsSQZ = true;
|
this.IsSQZButton = true;
|
this.IsBC = true;
|
this.IsYSJE = true;
|
this.IsSJCP = true;
|
},1000)
|
|
}
|
|
this.InspectData =tempData;
|
}
|
|
})
|
}
|
|
|
|
IsBidArr=[
|
{label :"是",value:"是"},
|
{label :"否",value:"否"},
|
]
|
//选项列表展示的列
|
irresponsibleReasonShow = false;
|
handleChange(event) {
|
var value = event.detail.value;
|
|
this.InspectData.IsBid__c = value;
|
if (value == "否") {
|
|
this.irresponsibleReasonShow = true;
|
this.BCIsShow = true;
|
// this.YSJEIsShow = true;
|
if( this.InspectData.irresponsibleReason__c != undefined && this.InspectData.irresponsibleReason__c == '其他(可手动填写)')
|
{
|
this.otherShow = true;
|
}
|
|
}else{
|
// this.InspectData.irresponsibleReason__c = '';
|
// this.InspectData.irresponsibleReasonOther__c = '';
|
this.irresponsibleReasonShow = false;
|
this.otherShow = false;
|
this.IsBC= false;
|
this.BCIsShow = false;
|
this.YSJEIsShow = false;
|
this.IsYSJE = false;
|
}
|
}
|
|
//输入框 未输入展示的值
|
bxgLy ="slds-form-element"; //error = slds-form-element slds-has-error
|
bxgLyFlag = false;
|
|
otherShow = false; //是否是其他输入
|
handleIrresponsibleReasonsFn(event)
|
{
|
this.SJCPIsShow =false;//20220914 you SWAG-CJ3DS5
|
var value = event.target.value;
|
this.InspectData.irresponsibleReason__c = value;
|
if (value == "其他(可手动填写)") {
|
this.otherShow = true;
|
}else{
|
this.InspectData.irresponsibleReasonOther__c = '';
|
this.otherShow = false;
|
debugger;
|
}
|
//20220913 you SWAG-CJ3DS5 start
|
// if (value == "招标产品与我司不匹配") {
|
// this.SJCPIsShow = true;
|
// }else{
|
// this.SJCPIsShow = false;
|
// }
|
//20220913 you SWAG-CJ3DS5 start
|
if (value == "招标产品与我司不匹配") {
|
this.GetproInvolvedManualShow = true;
|
}else{
|
this.InspectData.proInvolvedManual__c = '';
|
this.InspectData.proInvolved__c = '';
|
this.GetproInvolvedManualShow = false;
|
}
|
//20220913 you SWAG-CJ3DS5 end
|
}
|
//20220913 you SWAG-CJ3DS5 start
|
bxgLy1 ="slds-form-element"; //error = slds-form-element slds-has-error
|
handleIrresponsibleReasonsFn1(event)
|
{
|
var value = event.target.value;
|
this.InspectData.proInvolvedManual__c = value;
|
if (value == "其他") {
|
this.SJCPIsShow = true;
|
}else{
|
this.InspectData.proInvolved__c = '';
|
this.SJCPIsShow = false;
|
debugger;
|
}
|
}
|
//20220913 you SWAG-CJ3DS5 end
|
//输入框 未输入展示的值
|
qtLy="slds-form-element";
|
qtLyFlag = false;
|
//20220914 you SWAG-CJ3DS5 start
|
qtLy1="slds-form-element";
|
qtLyFlag1 = false;
|
//20220914 you SWAG-CJ3DS5 end
|
handleOtherIrrelevantFn(event)
|
{
|
var value = event.target.value;
|
this.InspectData.irresponsibleReasonOther__c = value;
|
|
}
|
//输入框 未输入展示的值
|
BCIsShow = false;
|
IsBC = false;
|
handleBCSMFn(event)
|
{
|
var value = event.target.value;
|
this.InspectData.RepsExtraContent__c = value;
|
|
}
|
|
|
//
|
YSJEIsShow = false;
|
YSJEIsContent = '';
|
IsYSJE = false;
|
handleYSJEFn(event)
|
{
|
var value = event.target.value;
|
this.YSJEIsContent = value;
|
this.InspectData.InvolveBudgetAmount__c = value;
|
|
}
|
|
//涉及产品
|
//
|
SJCPIsShow = false;
|
SJCPIsContent = '';
|
IsSJCP = false;
|
handleSJCPFN(event)
|
{
|
var value = event.target.value;
|
this.SJCPIsContent = value;
|
this.InspectData.proInvolved__c = value;
|
|
}
|
//数据保存方法
|
saveFn(event,temp){
|
|
|
var flag = true;
|
|
if (this.InspectData.IsBid__c == "否" && (this.InspectData.irresponsibleReason__c == undefined || this.InspectData.irresponsibleReason__c == "" )) {
|
this.bxgLy = "slds-form-element slds-has-error"
|
this.bxgLyFlag = true;
|
flag = false;
|
}else{
|
this.bxgLy = "slds-form-element"
|
this.bxgLyFlag = false;
|
}
|
|
|
if (this.InspectData.irresponsibleReason__c == "其他(可手动填写)" && (this.InspectData.irresponsibleReasonOther__c == undefined || this.InspectData.irresponsibleReasonOther__c == "" )) {
|
this.qtLy = "slds-form-element slds-has-error"
|
this.qtLyFlag = true;
|
flag = false;
|
}else{
|
this.qtLy = "slds-form-element"
|
this.qtLyFlag = false;
|
}
|
//20220913 you SWAG-CJ3DS5 start
|
if (this.InspectData.proInvolvedManual__c == "其他" && (this.InspectData.proInvolved__c == undefined || this.InspectData.proInvolved__c == "" )) {
|
this.qtLy1 = "slds-form-element slds-has-error"
|
this.qtLyFlag1 = true;
|
flag = false;
|
}else{
|
this.qtL1y = "slds-form-element"
|
this.qtLyFlag1 = false;
|
}
|
//20220913 you SWAG-CJ3DS5 end
|
if (flag) {
|
if (temp == 1) {
|
ChangeDataYB({JsonData:JSON.stringify(this.InspectData)}).then((response)=>{
|
if (response=="成功") {
|
this.Alert("提交成功");
|
this.IsSQZ = true;
|
this.IsSQZButton = true;
|
this.IsBC = true;
|
this.IsYSJE = true;
|
window.location.hash = "Refresh"+"=="+this.ParamIdStr;
|
}else{
|
this.Alert(response,true);
|
}
|
});
|
}else
|
{
|
SaveDataYB({JsonData:JSON.stringify(this.InspectData)}).then((response)=>{
|
if (response=="成功") {
|
this.Alert("保存成功",false,true);
|
window.location.hash = "Refresh"+"=="+this.ParamIdStr;
|
}else{
|
this.Alert(response,true);
|
}
|
});
|
}
|
}
|
}
|
|
CheckFn()
|
{
|
this.saveFn(null,1);
|
|
}
|
}
|