tanghaolin
2025-03-07 d9e68c8234a79ecaa9fb3304caadbc99607715c9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
<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>