tanghaolin
2022-08-31 244c4241427b9f3316f06f1e0ae2ee571edc1a23
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
<template>
  <div class="pumpList_box">
    <!-- 头部导航栏 -->
    <van-nav-bar style="background-color: #528abe">
      <template #left>
        <div @click="pageBack" style="display: flex; align-items: center">
          <van-icon name="arrow-left" size="18" />
          <span>{{$t('selectPage.previous.TR')}}</span>
        </div>
      </template>
      <template #title>
        <label>{{$t('selectPage.productSeries.TR')}}</label>
      </template>
      <template #right>
        <div @click="goHome" style="display: flex; align-items: center">
          <span style="margin-right: 5px">{{$t('selectPage.index.TR')}}</span>
          <van-icon name="home-o" size="18" />
        </div>
      </template>
    </van-nav-bar>
    <div class="pumpList_main">
      <div
        class="pump_cell"
        @click="toDetail(item)"
        v-for="(item, index) in listData"
        :key="item.PumpID"
        :style="index % 2 == 0 ? 'background: #fafafa;' : 'background: #fffff;'"
      >
        <div class="pump_content">
          <div class="pump_name">
            <div>{{ item.PumpName }} </div> <div class="corpName"> <van-tag round type="primary" color="#528abe">{{item.CorpName}}</van-tag></div>
          </div>
          <div class="pump_detail">
            <div class="prop_item" style="margin-right: 10px; width: 30%">
              <span>{{$t('selectPage.efficiency.TR')}}:</span>
              <span>{{ item.WorkPtE }}%</span>
            </div>
            <div class="prop_item">
              <span>{{$t('selectPage.speed.TR')}}:</span>
              <span>{{ item.WorkSpeed }}</span>
            </div>
          </div>
        </div>
        <div style="width: 80px; height: 65px">
          <img :src="item.SpectrumPict" style="width: 100%; height: 100%" />
        </div>
      </div>
    </div>
    <transition name="van-slide-left">
      <div class="poptips" v-show="showPopover">{{$t('selectPage.seriesTips.TR')}}</div>
    </transition>
  </div>
</template>
 
<script>
import UnitHelper from "@/utils/unit";
import ConstParas from "@/utils/constParas";
import languageMixin from "@/mixin/language.js";
 
export default {
  mixins: [languageMixin],
  data() {
    return {
 
      detailPageQueryModel: {}, //用于传送给下一个页面的类
 
      SelDesignPtQUnit: 0,
      SelDesignPtQUnitName: "m³/h",
 
      SelDesignPtHUnit: 1,
      SelDesignPtHUnitName: "m",
 
      SelDesignPtPUnit: 1,
      SelDesignPtPUnitName: "kW",
 
      listData: [],
      showPopover: false,//是否弹出提示框
    };
  },
  mounted() {
    let _this = this;
    //弹出提示框
    _this.showPopover = true;
    setTimeout(function() {
      _this.showPopover = false;
    }, 2500);
 
 
    document.title = "泵管家";
 
    let prvePathDataObj = this.$store.state.instante.select.ByParas.filterData;
    //console.log(prvePathDataObj,75)
    if (prvePathDataObj == null) return;
    if (prvePathDataObj.DesignInfo == null) return;
 
    var selDesignPtQ = prvePathDataObj.DesignInfo.DpQ;
    var selDesignPtQUnit = prvePathDataObj.DesignInfo.UnitQ;
    var selDesignPtH = prvePathDataObj.DesignInfo.DpH;
    var selDesignPtHUnit = prvePathDataObj.DesignInfo.UnitH;
 
    this.SelDesignPtQUnit = selDesignPtQUnit;
    this.SelDesignPtQUnitName = UnitHelper.GetUnitNameQ(selDesignPtQUnit);
    this.SelDesignPtQ_StdUnit = UnitHelper.ConvertQ_toM3H(
      selDesignPtQUnit,
      selDesignPtQ
    );
 
    this.SelDesignPtHUnit = selDesignPtHUnit;
    this.SelDesignPtHUnitName = UnitHelper.GetUnitNameH(selDesignPtHUnit);
    this.SelDesignPtH_StdUnit = UnitHelper.ConvertH_toM(
      selDesignPtHUnit,
      selDesignPtH
    );
 
    this.initData(prvePathDataObj);
    //console.log(prvePathDataObj);
  },
  methods: {
    initData(prvePathDataObj) {
      let that = this;
      let Toast = that.$toast; //提示框实例
      Toast.loading({
        duration: 0, //为0时 不关闭toast框
        message: "Loading...",
        forbidClick: true
      });
      //console.log(prvePathDataObj, 401);
      let postRequestData = {
        //介质
        JieZhi: {
          ID: prvePathDataObj.JieZhi.ID, //介质id
          Name: prvePathDataObj.JieZhi.Name, //介质名称
          CalcDensity: prvePathDataObj.JieZhi.CalcDensity, //密度
          CalcViscosity: prvePathDataObj.JieZhi.CalcViscosity //粘度
        },
        //筛选信息
        FilterInfo: {
          DriveType: prvePathDataObj.FilterInfo.DriveType, //设备类型 0电机 3柴油机
          KeyWord: prvePathDataObj.FilterInfo.KeyWord, //关键字 暂时默认空
          FirePumpType: prvePathDataObj.FilterInfo.FirePumpType, // 消防泵类型
          MotorPoleNum: prvePathDataObj.FilterInfo.MotorPoleNum, //电机效率等级 暂时为空
          DieselSpeed: prvePathDataObj.FilterInfo.DieselSpeed, //柴油机转速 暂时默认
          MotorStandard: prvePathDataObj.FilterInfo.MotorStandard,
          MotorFrequence: prvePathDataObj.FilterInfo.MotorFrequence //电机赫兹
        },
        //设计点参数
        DesignInfo: {
          UnitQ: prvePathDataObj.DesignInfo.UnitQ, //流量单位
          UnitH: prvePathDataObj.DesignInfo.UnitH, //扬程单位
          DpQ: prvePathDataObj.DesignInfo.DpQ, //输入的流量的值
          DpH: prvePathDataObj.DesignInfo.DpH, //输入的扬程的值
          PointTolerance: prvePathDataObj.DesignInfo.PointTolerance, // 点容差范围 默认空
          IsVisCorrect: prvePathDataObj.DesignInfo.IsVisCorrect //是否修正粘度 默认false
        },
        SeriesID: prvePathDataObj.FilterInfo.SeriesID, //泵系列ID
        CatalogID: prvePathDataObj.FilterInfo.CatalogID, //泵类型id
        UID: that.$store.state.instante.account.UserID,
        UType: that.$store.state.instante.account.UserType,
        Lang: that.getCurrentLanguageType(),
        SoftType: that.$globalConfig.SoftType,
        SystemInfo: "",
        TargetCorpID:0
      };
      // console.log(postRequestData,140)
      //console.log(this.requireData,2738)
 
      this.detailPageQueryModel = {
        //用于点击表格详情传出的参数
        SID: "",
        PID: "",
        from: ConstParas.DetailPageFrom.ByParas,
        pur: ConstParas.DetailPagePurpose.ByParas, //XPumpByParas = 1,
        SubID: 0,
        DpQ: postRequestData.DesignInfo.DpQ,
        DpH: postRequestData.DesignInfo.DpH,
        DpQu: postRequestData.DesignInfo.UnitQ,
        DpHu: postRequestData.DesignInfo.UnitH,
        jzid: postRequestData.JieZhi.ID,
        jzmd: postRequestData.JieZhi.CalcDensity,
        jznd: postRequestData.JieZhi.CalcViscosity,
        jzmz: postRequestData.JieZhi.Name,
        isndc: prvePathDataObj.DesignInfo.IsVisCorrect,
        fpt: prvePathDataObj.FilterInfo.FirePumpType,
        TGrade: postRequestData.DesignInfo.PointTolerance.ToleranceGrade,
        TRatioMinQ: postRequestData.DesignInfo.PointTolerance.RatioMinQ,
        TRatioMaxQ: postRequestData.DesignInfo.PointTolerance.RatioMaxQ,
        TRatioMinH: postRequestData.DesignInfo.PointTolerance.RatioMinH,
        TRatioMaxH: postRequestData.DesignInfo.PointTolerance.RatioMaxH,
 
      };
      var selDesignPtQUnit = that.SelDesignPtQUnit;
      var selDesignPtHUnit = that.SelDesignPtHUnit;
      var selDesignPtPUnit = that.SelDesignPtPUnit;
      // console.log(postRequestData,194)
      that
        .$axios({
          method: "post",
          url:
            that.$globalConfig.WebApiUrl.MainUrl +
            "v1/Mobile/SelectByParas/GetPageList",
          data: postRequestData
        })
        .then(res => {
          Toast.clear(); //关闭toast加载提示
          console.log(res, 134);
          // console.log(postRequestData,207)
          let result = res.data;
          if (result.Code != 0) {
            if (result.Code == -3) {
              Toast.fail({
                duration: 4000, //为0时 不关闭toast框
                message: "未查找到相关型号,请修改相关选型参数",
                forbidClick: true
              });
              setTimeout(() => {
                that.$router.go(-1); //请求不到数据返回上一页
              }, 5000);
 
              return;
            } else {
              Toast.fail({
                duration: 3000, //为0时 不关闭toast框
                message: "未查找到相关型号,将在三秒后返回上一页",
                forbidClick: true
              });
              setTimeout(() => {
                that.$router.go(-1); //请求不到数据返回上一页
              }, 3000);
            }
 
            return;
          }
          let itemList = result.Data.ItemList;
          var listData = [];
          for (let i = 0; i < itemList.length; i++) {
             
            let tableItem = {
              CorpName:itemList[i].CorpName,
              CatalogID: itemList[i].CatalogID, //类型id
              ChartType: itemList[i].ChartType,
              SeriesID: itemList[i].SeriesID, //系列id
              PumpID: itemList[i].PumpID, //泵id
              ThumbnailImage:
                that.$globalConfig.WebApiUrl.FileUrl +
                itemList[i].ThumbnailImage, //实物图路径
              SereisName: itemList[i].SereisName, //系列
              PumpName: itemList[i].PumpName, //泵型号
 
              WorkSpeed: itemList[i].WorkSpeed, //转速
              WorkD2: itemList[i].WorkD2, //叶轮直径
              Note: itemList[i].Note, //备注
              PlaceAngle: itemList[i].PlaceAngle, //安放角
              QPerQBep: itemList[i].QPerQBep, //选型点和高效点的百分比
              Ratedn: itemList[i].Ratedn, //原始额定转速(默认不显示)
              OrginD2: itemList[i].OrginD2, //原始叶轮直径(默认不显示)
 
              CutRatio: itemList[i].CutRatio, //切割率(默认不显示)
              StageNumber: itemList[i].StageNumber, //泵级数(默认不显示)
              ShutoffHead: itemList[i].ShutoffHead, //关死点扬程(默认不显示)
              SalePrice: itemList[i].SalePrice, //销售价(折扣后)
              OriginSalePrice: itemList[i].OriginSalePrice, //指导价(原始)
              ChartObjects: itemList[i].ChartObjects, //工作曲线
              SpectrumPict: "data:image/png;base64," + itemList[i].SpectrumPict //曲线图
            };
            if (itemList[i].WorkPtNPSH)
              tableItem.WorkPtNPSH = itemList[i].WorkPtNPSH.toFixed(1);
            if (itemList[i].CutRatio)
              tableItem.CutRatio = parseFloat(itemList[i].CutRatio).toFixed(1);
            if (itemList[i].WorkPtQ)
              tableItem.WorkPtQ = UnitHelper.getDispValueQ(
                UnitHelper.ConvertQ_fromM3H(
                  selDesignPtQUnit,
                  itemList[i].WorkPtQ
                )
              );
 
            if (itemList[i].WorkPtH)
              tableItem.WorkPtH = UnitHelper.getDispValueH(
                UnitHelper.ConvertH_fromM(selDesignPtHUnit, itemList[i].WorkPtH)
              );
            if (itemList[i].WorkPtE) tableItem.WorkPtE = itemList[i].WorkPtE;
            if (itemList[i].WorkPtP)
              tableItem.WorkPtP = UnitHelper.getDispValueP(
                UnitHelper.ConvertP_fromKW(
                  selDesignPtPUnit,
                  itemList[i].WorkPtH
                )
              );
 
            listData.push(tableItem);
          }
          that.listData = listData;
          //console.log(resultImg,262);
        })
        .catch(err => {
          console.log(err);
        });
    },
    //跳转到详情界面
    toDetail(item) {
      // console.log(item, 262);
      this.detailPageQueryModel.SID = item.SeriesID;
      this.detailPageQueryModel.PID = item.PumpID;
      let query = this.detailPageQueryModel;
      this.gotoPage("/byParas/Index", query, null);
    },
    //返回上一页
    pageBack() {
      this.$router.go(-1);
    },
    goHome() {
      this.gotoPage("/Index", "", null);
    }
  }
};
</script>
 
<style lang="scss">
.corpName{
  font-size:12px;
  color:gray;
  padding-left:12px;
  position: absolute;
  right: 15px;
}
.pumpList_box {
  width: 100vw;
  height: 100vh;
  overflow: auto;
  .pumpList_main {
    width: 100%;
    height: calc(100% - 46px);
    overflow: auto;
    .pump_cell {
      display: flex;
      position: relative;
      width: 100%;
      box-sizing: border-box;
      height: 65px;
      .pump_content {
        width: calc(100% - 90px);
        height: 100%;
        display: flex;
        flex-direction: column;
        padding-left: 16px;
        .pump_name {
          width: 100%;
          height: 50%;
          /* text-align: center; */
          display: flex;
          justify-content: flex-start;
          align-items: center;
          font-size: 16px;
          font-weight: 600;
          position: relative;
        }
        .pump_detail {
          width: 100%;
          display: flex;
          height: 50%;
          align-items: center;
          .prop_item {
            width: 25%;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            span {
              font-size: 12px;
              line-height: 1.5;
              color: #808080;
            }
          }
        }
      }
    }
    .pump_cell::after {
      position: absolute;
      box-sizing: border-box;
      content: " ";
      pointer-events: none;
      right: 0px;
      bottom: 0;
      left: 0px;
      border-bottom: 1px solid #ebedf0;
      -webkit-transform: scaleY(0.5);
      transform: scaleY(0.5);
    }
  }
  .poptips {
    height: 18px;
    position: fixed;
    top: 32px;
    left: 10px;
    background-color: #000;
    color: #ffffff;
    z-index: 1;
    font-size: 12px;
    text-align: center;
    border-radius: 3px;
  }
}
</style>