<template>
|
<div class="PumpDetailIndex" v-loading="state.m_isShowLoadingFrm">
|
<div style="width: 100%; margin: 0 auto; height: calc(100% - 0px)" class="page-content">
|
<div class="nav_header_box">
|
<div class="nav_header flex">
|
<div style="cursor: pointer" class="nav_header_a" @click="gotoHomePage">
|
{{ state.m_corpShortName }}
|
</div>
|
<div style="cursor: pointer" class="nav_header_a">
|
{{ state.m_pumpBaseInfo.CatalogName }}
|
</div>
|
<div style="cursor: pointer" class="nav_header_a">
|
{{ state.m_pumpBaseInfo.SeriesName }}
|
</div>
|
<div class="nav_header_a">
|
{{ state.m_pumpBaseInfo.DispPumpName }}
|
</div>
|
<!-- 跑马灯部分 -->
|
<div v-if="state.m_dispErrorTip" class="flex" style="flex: 1; margin-left: 1.1em; justify-content: flex-end">
|
<Marquee
|
v-if="state.m_dispErrorTip"
|
direction="normal"
|
:delay="0.5"
|
:pauseOnHover="true"
|
:duration="20"
|
:gradient="false"
|
:animateOnOverflowOnly="false"
|
>
|
<span style="color: red" v-for="(text, index) in state.m_errorTips" :key="index">{{ text }}</span>
|
</Marquee>
|
</div>
|
</div>
|
</div>
|
<div style="width: 100; height: calc(100% - 38px)" class="homeBox">
|
<pumpDetailBody
|
ref="detailBodyRef"
|
@cbOpenDetailIndexErrorTips="cbOpenDetailIndexErrorTips"
|
@cbCloseDetailIndexErrorTips="cbCloseDetailIndexErrorTips"
|
></pumpDetailBody>
|
</div>
|
</div>
|
<!-- 成本分析 -->
|
<el-dialog ref="lccDialogCtrl" :title="t('detailPage.costAnalysis.TR')" v-model="state.isShowLccDialog" width="1100px">
|
<LCC ref="LccCtrl"></LCC>
|
</el-dialog>
|
<!-- 报告弹框 -->
|
<el-dialog
|
ref="reportDialogCtrl"
|
:title="t('detailPage.selectionReport.TR')"
|
v-model="state.isShowReportDialog"
|
width="50%"
|
:align-center="true"
|
:modal="true"
|
:close-on-click-modal="false"
|
:close-on-press-escape="false"
|
@open="opendReportDialog"
|
>
|
<reportGeneral ref="generalReportCtrl" :cbCloseReportDialog="closeReportDialog"></reportGeneral>
|
</el-dialog>
|
<!-- 询价弹框 -->
|
<el-dialog
|
:title="t('detailPage.productInquiry.TR')"
|
v-model="state.isShowInQuiryPriceDialog"
|
width="30%"
|
:modal="true"
|
:close-on-click-modal="false"
|
:close-on-press-escape="false"
|
>
|
<inQuiryPrice ref="inQuiryPriceCtrl" @cbClosePriceDialog="closePriceDialog"></inQuiryPrice>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script setup name="pumpDetail">
|
import { onMounted, ref, reactive, nextTick, provide } from 'vue';
|
import { useRoute, useRouter } from 'vue-router';
|
import { ElDialog, ElButton, ElMessage } from 'element-plus';
|
import pumpDetailBody from './components/detailBody.vue';
|
import { useI18n } from 'vue-i18n';
|
import inQuiryPrice from './components/InQuiryPrice.vue';
|
import LCC from './components/LCCByParas.vue';
|
import reportGeneral from './components/report/selectReport.vue';
|
import ConstParas from '@/utils/constParas.js';
|
import { InitialInfo } from '@/api/detail';
|
|
import { useLogin } from '@/stores/useLogin';
|
const loginStore = useLogin();
|
const userInfo = loginStore.getUserInfo();
|
const Token = userInfo.Token;
|
const route = useRoute();
|
const router = useRouter();
|
const pageHeadCtrl = ref('');
|
const detailBodyRef = ref();
|
const footerCtrl = ref('');
|
const LccCtrl = ref();
|
const generalReportCtrl = ref();
|
const inQuiryPriceCtrl = ref();
|
const { t } = useI18n();
|
|
const m_currentLanguage = 0;
|
|
let state = reactive({
|
m_corpShortName: '', //公司名称
|
dispPropTabPane: false,
|
dispMaterialTabPane: false,
|
isShowLccCmd: true,
|
isShowLccDialog: false,
|
isShowShareCmd: true,
|
isShowShareDialog: false,
|
isShowReportDialog: false,
|
isShowInQuiryPriceDialog: false,
|
m_motorAllowMaxPtDict: null, //不同电机 对应不同最大运行区域点
|
m_pageFrom: 0, //页面来源
|
m_pagePurpose: 0, //打开的目的
|
|
m_userUnitSetting: null, //用户全局单位配置 Q H E P D2 这几个变量
|
m_pumpInfoData: {
|
BaseInfo: {
|
SeriesID: 0,
|
PumpID: 0,
|
},
|
}, //泵信息
|
m_pumpBaseInfo: {
|
DispPumpName: '',
|
PumpName: '',
|
SeriesName: '',
|
CatalogName: '',
|
},
|
|
m_pumpStyle: 0, //当前泵的类型 0表示离心泵 1 表示轴流泵
|
m_calcMotorPowerPtPosi: 5, //电机功率匹配方式 5 设计点功率乘以一个系数(固定) 7 产品编号和切割型号名简单匹配
|
|
m_isShowLoadingFrm: true, //等待框
|
|
jieZhiParas: {
|
ID: 0,
|
MiDu: 1000,
|
NianDu: 1,
|
Name: 'water',
|
isNdCor: false,
|
},
|
|
ChartPointGridQuery: [], //接口返回的参数信息
|
|
m_toleranceParas: null, //容差
|
|
isShowOSPage: false, //显示选型选项页面
|
m_IsShowRight: {
|
report: false,
|
share: false,
|
lcc: false,
|
}, //头部按钮是否显示在右边
|
m_IsInitPropData: false, //判断是否初始化了属性数据
|
|
m_dispErrorTip: false, //显示错误提示
|
m_errorTips: [], //错误提示
|
});
|
onMounted(() => {
|
state.m_isShowLoadingFrm = true;
|
settingPageDefaultData();
|
});
|
// 设置界面默认数据
|
const settingPageDefaultData = () => {
|
state.m_corpShortName = '工效汇聚';
|
let headerConfig = window.pageConfig.PumpDetailPage.HeaderConfig;
|
if (headerConfig) {
|
state.m_IsShowRight.report = headerConfig?.IsShowRight.report | false;
|
state.m_IsShowRight.share = headerConfig?.IsShowRight.share | false;
|
state.m_IsShowRight.lcc = headerConfig?.IsShowRight.lcc | false;
|
}
|
//判断是否登录
|
var cToken = userInfo.Token;
|
if (window.pageConfig.PumpDetailPage.IsMustLogin) {
|
if (cToken == null || cToken == '') {
|
state.m_isShowLoadingFrm = false;
|
gotoLoginPage();
|
return;
|
}
|
}
|
//设置控件配置
|
// setCtrlConfig();
|
//获取ID
|
var pid = 0;
|
var sid = 0;
|
var series_id_from_route = route.params.sid;
|
var pump_id_from_route = route.params.pid;
|
var is_from_rounte = false;
|
if (series_id_from_route != null && pump_id_from_route != null) {
|
is_from_rounte = true; //参数来源路由
|
pid = pump_id_from_route;
|
sid = series_id_from_route;
|
} else {
|
is_from_rounte = false; //参数来源query
|
pid = route.query.PID;
|
sid = route.query.SID;
|
|
if (pid == '' || sid == '') {
|
state.m_isShowLoadingFrm = false;
|
ElMessage.error('路径非法');
|
return;
|
}
|
}
|
//初始化数据
|
nextTick(() => {
|
intialPageDetailData(is_from_rounte, sid, pid);
|
});
|
};
|
//获取整个页面初始的详情数据 is_from_rounte 参数来源路由 还是query
|
const intialPageDetailData = (is_from_rounte, sid, pid) => {
|
if (sid == null || pid == null) return;
|
if (is_from_rounte) {
|
state.m_pageFrom = ConstParas.DetailPageFrom.EBook;
|
state.m_pagePurpose = ConstParas.DetailPagePurpose.EBook; //来源电子样本
|
} else {
|
state.m_pageFrom = route.query.from;
|
state.m_pagePurpose = route.query.pur;
|
}
|
|
let isAllowSpeed = true;
|
let isAllowCut = true;
|
|
if (route.query.isspeed != undefined) {
|
isAllowSpeed = Number(route.query.isspeed) ? true : false;
|
}
|
if (route.query.iscut != undefined) {
|
isAllowCut = Number(route.query.iscut) ? true : false;
|
}
|
|
//console.log(_this.m_currentLanguage);
|
var waterName = 'water';
|
if (m_currentLanguage == 0) {
|
waterName = '清水';
|
}
|
|
var jieZhiParas = {
|
ID: 0,
|
MiDu: 1000,
|
NianDu: 1,
|
Name: waterName,
|
isNdCor: false,
|
};
|
|
jieZhiParas.ID = route.query.jzid || '0';
|
jieZhiParas.MiDu = route.query.jzmd || 1000;
|
jieZhiParas.NianDu = route.query.jznd || 1;
|
jieZhiParas.Name = route.query.jzmz || waterName;
|
jieZhiParas.isNdCor = route.query.isndc || false;
|
|
state.jieZhiParas = jieZhiParas;
|
|
var partId = 0;
|
if (route.query.PartID) partId = route.query.PartID;
|
|
let requestData = {
|
Purpose: state.m_pagePurpose,
|
SID: sid,
|
PID: pid, //可能是子型号,后台会判断,并返回主型号ID过来
|
PartID: partId,
|
|
DpQ: route.query.DpQ || '',
|
DpH: route.query.DpH || '',
|
DpQu: route.query.DpQu,
|
DpHu: route.query.DpHu,
|
|
FirePumpType: route.query.fpt || '0', //消防类型
|
DriveType: route.query.drive || '', //驱动方式
|
DriveSpeed: route.query.speed || '', //柴油机转速
|
|
jzID: jieZhiParas.ID,
|
jzMiDu: jieZhiParas.MiDu,
|
jzNianDu: jieZhiParas.NianDu,
|
jzName: jieZhiParas.Name,
|
isNdCor: jieZhiParas.isNdCor,
|
|
TolGrade: route.query.TGrade || 0,
|
TolRatioMinQ: route.query.TRatioMinQ || 0,
|
TolRatioMaxQ: route.query.TRatioMaxQ || 0,
|
TolRatioMinH: route.query.TRatioMinH || 0,
|
TolRatioMaxH: route.query.TRatioMaxH || 0,
|
SoftType: 12,
|
SystemInfo: '',
|
IsAllowSpeed: isAllowSpeed,
|
IsAllowCut: isAllowCut,
|
};
|
if (requestData.TolGrade > 0) {
|
let m_toleranceParas = {};
|
m_toleranceParas.Grade = requestData.TolGrade;
|
m_toleranceParas.RatioMinQ = requestData.TolRatioMinQ;
|
m_toleranceParas.RatioMaxQ = requestData.TolRatioMaxQ;
|
m_toleranceParas.RatioMinH = requestData.TolRatioMinH;
|
m_toleranceParas.RatioMaxH = requestData.TolRatioMaxH;
|
|
state.m_toleranceParas = m_toleranceParas;
|
}
|
|
InitialInfo(requestData)
|
.then(function (res) {
|
state.m_isShowLoadingFrm = false;
|
let resdata = res.data;
|
if (resdata.Code != 0) {
|
ElMessage(resdata.Message);
|
return;
|
}
|
|
var pumpInfoData = resdata.Data; //泵详细所有数据
|
// console.log(pumpInfoData, 624)
|
if (pumpInfoData == null) {
|
ElMessage('数据获取失败');
|
return;
|
}
|
state.m_pumpInfoData = pumpInfoData;
|
let pumpBaseInfo = pumpInfoData.BaseInfo;
|
|
if (pumpBaseInfo == null) {
|
ElMessage('数据获取失败');
|
return;
|
}
|
var pumpBaseInfo_g = {};
|
pumpBaseInfo_g.SeriesID = pumpBaseInfo.SeriesID;
|
pumpBaseInfo_g.PumpID = pumpBaseInfo.PumpID; //主ID
|
pumpBaseInfo_g.SubID = pumpBaseInfo.SubID; //切割
|
pumpBaseInfo_g.CatalogName = pumpBaseInfo.CatalogName || '';
|
pumpBaseInfo_g.SeriesName = pumpBaseInfo.SeriesName || '';
|
pumpBaseInfo_g.PumpName = pumpBaseInfo.PumpName || '';
|
pumpBaseInfo_g.FirePumpType = pumpBaseInfo.FirePumpType || 0;
|
pumpBaseInfo_g.DriveType = requestData.DriveType; //驱动方式
|
pumpBaseInfo_g.DriveSpeed = requestData.DriveSpeed; //柴油机转速
|
pumpBaseInfo_g.PumpStyle = pumpBaseInfo.PumpStyle;
|
pumpBaseInfo_g.IsMainModel = pumpBaseInfo.IsMainModel;
|
pumpBaseInfo_g.SubPumpName = pumpBaseInfo.SubPumpName;
|
pumpBaseInfo_g.DispPumpName = pumpBaseInfo.PumpName;
|
pumpBaseInfo_g.ReportSetting = pumpInfoData.ReportSetting;
|
state.m_pumpBaseInfo = pumpBaseInfo_g;
|
detailBodyRef.value.initDetailPageData(pumpInfoData);
|
|
setPageHeaderInfo();
|
|
footerCtrl.value && footerCtrl.value.getPumpName(pumpBaseInfo.PumpName);
|
})
|
.catch((err) => {
|
console.log(err, 785);
|
});
|
};
|
//到登陆界面
|
const gotoLoginPage = () => {
|
loginStore.preLoginPageRoute(route.fullPath);
|
loginStore.login(route.fullPath);
|
};
|
//设置控件配置
|
const setCtrlConfig = () => {
|
//判断是否有分享功能
|
if (window.globalConfig.CorpInfo.WeChatUrl) {
|
state.isShowShareCmd = true;
|
} else {
|
state.isShowShareCmd = false;
|
}
|
};
|
//设置头部组件信息
|
const setPageHeaderInfo = () => {
|
const propCtrl = detailBodyRef.value.getPropCtrl();
|
pageHeadCtrl.value &&
|
pageHeadCtrl.value.initialData(state.m_pumpBaseInfo, () => {
|
if (propCtrl == null) return { Part: null };
|
return {
|
Part: propCtrl.GetCurrentPartEntity(),
|
Prop: propCtrl.GetPartProp4Store(),
|
};
|
});
|
};
|
//关闭报告窗体
|
const closeReportDialog = (url) => {
|
state.isShowReportDialog = false;
|
};
|
//打开选型报告
|
const opendReportDialog = () => {
|
const {
|
reportLangType,
|
pumpBaseInfo,
|
partEntity,
|
partPropList4Store,
|
jieZhi,
|
designParas,
|
chartPointParas,
|
material_info,
|
userUnitSetting,
|
equip_curve,
|
disp_style,
|
ToleranceParas,
|
AssemFileSysDispStatus,
|
variableSpeedCurve,
|
assemDynFileSysInfo,
|
} = getReportInitData();
|
nextTick(() => {
|
generalReportCtrl.value.initialData(
|
reportLangType,
|
pumpBaseInfo,
|
partEntity,
|
partPropList4Store,
|
jieZhi,
|
designParas,
|
chartPointParas,
|
material_info,
|
userUnitSetting,
|
equip_curve,
|
disp_style,
|
ToleranceParas,
|
AssemFileSysDispStatus,
|
variableSpeedCurve,
|
assemDynFileSysInfo
|
);
|
});
|
};
|
const getReportInitData = () => {
|
//产品
|
let partPropList4Store = detailBodyRef.value.GetPartProp4Store();
|
let partEntity = detailBodyRef.value.GetCurrentPartEntity();
|
let assemDynFileSysInfo = detailBodyRef.value.GetAssemDynFileSys();
|
// 选型点 和图表点
|
let chartPointParas = null; //图表点(都是标准单位)
|
let designParas = null; //含选型点的用户单位
|
let equip_curve = null;
|
let disp_style = null;
|
let variableSpeedCurve = null; //变速曲线
|
|
if (state.m_pumpBaseInfo.PumpStyle == ConstParas.PumpStyle.LXP) {
|
designParas = detailBodyRef.value.getDesignParasByLXB() || {};
|
designParas.FirePumpType = route.query.fpt || 0;
|
chartPointParas = detailBodyRef.value.getConstantPtValue4StoreByLXB();
|
equip_curve = detailBodyRef.value.getEquipCurveInfo();
|
disp_style = detailBodyRef.value.getChartDispStyleByLXB();
|
variableSpeedCurve = detailBodyRef.value.getMultiSpeedCurveList();
|
} else if (state.m_pumpBaseInfo.PumpStyle == ConstParas.PumpStyle.ZLP) {
|
designParas = detailBodyRef.value.getDesignParasByZLB() || {};
|
chartPointParas = detailBodyRef.value.getConstantPtValue4StoreByZLB();
|
//variableSpeedCurve = detailBodyRef.value.getMultiSpeedCurveList();
|
}
|
let isAllowSpeed = true;
|
let isAllowCut = true;
|
|
if (route.query.isspeed != undefined) {
|
isAllowSpeed = Number(route.query.isspeed) ? true : false;
|
}
|
if (route.query.iscut != undefined) {
|
isAllowCut = Number(route.query.iscut) ? true : false;
|
}
|
designParas.isAllowSpeed = isAllowSpeed;
|
designParas.isAllowCut = isAllowCut;
|
|
//用户全局单位配置
|
var userUnitSetting = state.m_userUnitSetting;
|
//console.log(userUnitSetting,"userUnitSetting");
|
//材质
|
var material_info = null;
|
if (detailBodyRef.value.getMaterialDispStatus()) {
|
material_info = detailBodyRef.value.getParas4StoreByMateria();
|
material_info.GrpName = detailBodyRef.value.getPropCtrl().getOrderModel();
|
}
|
|
//介质
|
var jieZhi = state.jieZhiParas;
|
let reportLangType = m_currentLanguage;
|
return {
|
reportLangType: reportLangType,
|
pumpBaseInfo: state.m_pumpBaseInfo,
|
partEntity: partEntity,
|
partPropList4Store: partPropList4Store,
|
jieZhi: jieZhi,
|
designParas: designParas,
|
chartPointParas: chartPointParas,
|
material_info: material_info,
|
userUnitSetting: {
|
Standard: 0, //单位标准(0表示工制)
|
Flow: -1,
|
Head: -1,
|
Power: -1,
|
NPSH: 0,
|
D2: -1,
|
},
|
equip_curve: equip_curve,
|
disp_style: disp_style,
|
ToleranceParas: state.m_toleranceParas,
|
AssemFileSysDispStatus: detailBodyRef.value.getAssemFileSysDispStatus(),
|
variableSpeedCurve: variableSpeedCurve,
|
assemDynFileSysInfo: assemDynFileSysInfo,
|
};
|
};
|
// 获取导出CAD需要的数据
|
const cbGetExportCADData = () => {
|
return getReportInitData();
|
};
|
|
//显示询价页面
|
const clickInQuiryPrice = () => {
|
state.isShowInQuiryPriceDialog = true;
|
let UserName = userInfo.RealName;
|
let formData = {
|
CustomerName: '',
|
CustomerContact: '',
|
PumpID: state.m_pumpBaseInfo.PumpID,
|
PumpName: state.m_pumpBaseInfo.PumpName,
|
Note: '',
|
Title: '',
|
UserID: '',
|
UserName: UserName && UserName != '' ? UserName : '',
|
PumpNumber: 1,
|
};
|
nextTick(() => {
|
inQuiryPriceCtrl.value.initFormData(formData);
|
});
|
};
|
// 关闭询价弹框
|
const closePriceDialog = () => {
|
state.isShowInQuiryPriceDialog = false;
|
};
|
|
//跳转页面(主页)
|
const gotoHomePage = () => {
|
let routerPath = `/`;
|
router.push({ path: routerPath });
|
};
|
|
//跳转页面(电子样本)
|
const gotoCatalogPage = () => {
|
let BackCatalogPageUrl = window.pageConfig.PumpDetailPage.BackCatalogPageUrl;
|
let routerPath = BackCatalogPageUrl;
|
let sid = state.m_pumpInfoData.BaseInfo.SeriesID;
|
router.push({ path: routerPath, query: { SID: sid } });
|
};
|
|
//跳转页面(系列详细)
|
const gotoSeriesPage = () => {
|
let routerPath = `/Series/Index/` + state.m_pumpBaseInfo.SeriesID;
|
router.push({ path: routerPath });
|
};
|
|
/**
|
*
|
* @param arr
|
* @param dispStatus
|
*/
|
const cbOpenDetailIndexErrorTips = (arr = []) => {
|
state.m_errorTips = arr;
|
state.m_dispErrorTip = true;
|
resetMarqueeAnimation();
|
};
|
const cbCloseDetailIndexErrorTips = () => {
|
state.m_errorTips = [];
|
state.m_dispErrorTip = false;
|
};
|
const resetMarqueeAnimation = () => {
|
let element = document.getElementsByClassName('vue3-marquee');
|
if (element && element.length > 0) {
|
nextTick(() => {
|
element[0].style.removeProperty('--loops');
|
setTimeout(() => {
|
element[0].style.setProperty('--loops', 'infinite');
|
}, 500);
|
});
|
}
|
};
|
provide('cbGetExportCADData', cbGetExportCADData);
|
</script>
|
<style lang="scss">
|
.PumpDetailIndex {
|
width: 100%;
|
min-width: 1366px;
|
height: 780px;
|
|
button {
|
border: 0;
|
}
|
|
.el-dialog__header {
|
border-bottom: 1px solid #ccc;
|
margin-right: unset;
|
|
.el-dialog__headerbtn {
|
&:focus {
|
outline: unset;
|
}
|
}
|
}
|
|
.el-dialog__body {
|
padding: 10px;
|
}
|
|
.page-content {
|
width: 100%;
|
height: 100%;
|
margin-top: 0px;
|
padding: 0px;
|
background-color: #fff;
|
}
|
}
|
</style>
|
|
<style scope>
|
.vue3-marquee.horizontal > .marquee {
|
justify-content: flex-end;
|
}
|
</style>
|