duhuizhe
2023-10-16 3aa55dd3f62cee2c1c4c0aa74e1570acf83f8927
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
<template>
  <win2 :title="setting.title" @close="close">
    <div class="app-container">
      <el-row :gutter="15">
        <el-col :span="5">
          <el-card shadow="never" class="com-box">
            <div>
              <div class="f-r">
                <div class="img-box f-r f-r-center">
                  <img src="@/assets/images/project/icon-gj-lv.png" alt="" class="type-img"/>
                </div>
                <div>
                  <div class="font-18 font-bold color-333">{{info.projectName}}</div>
                  <el-progress :percentage="info.progressRate" style="width: 100%;margin-top: 5px"
                               :show-text="false"></el-progress>
                  <div class="m-t-10 f-r f-r-between">
                    <el-tag :type="getStatusText(info.status).type">{{ getStatusText(info.status).text }}</el-tag>
                    <div class="font-13 color-999">
                      当前进度
                      <span class="color-red">{{ info.progressRate }}%</span>
                    </div>
                  </div>
                </div>
              </div>
              <div class="cont-box">
                <div class="font-14 color-666">主要建设内容</div>
                <div class="font-14 color-333 m-t-5 line-24">
                  {{info.detail}}
                </div>
              </div>
              <div class="e-p-v-15">
                <el-form label-width="80px" label-position="left">
                  <el-form-item label="建设地址">
                    <div class="font-14 color-333 line-24">{{info.addr}}</div>
                  </el-form-item>
                  <el-form-item label="项目编号">
                    <div class="font-14 color-333 line-24">{{info.projectCode}}</div>
                  </el-form-item>
                  <el-form-item label="项目分类">
                    <div class="font-14 color-333 line-24" style="color: #235686">{{info.projectCategoryName}}</div>
                  </el-form-item>
                  <el-form-item label="建设单位">
                    <div class="font-14 color-333 line-24">{{info.buildOrgName}}</div>
                  </el-form-item>
                  <el-form-item label="项目经理">
                    <div class="font-14 color-333 line-24">{{info.projectManager}}</div>
                  </el-form-item>
                  <el-form-item label="起止年限">
                    <div class="font-14 color-333 line-24">{{info.buildYearStart}}-{{info.buildYearEnd}}</div>
                  </el-form-item>
                  <el-form-item label="项目批次">
                    <div class="font-14 color-333 line-24">{{info.projectBatchName}}</div>
                  </el-form-item>
                  <el-form-item label="批复时间">
                    <div class="font-14 color-333 line-24">{{info.approvalDate}}</div>
                  </el-form-item>
                  <el-form-item label="创建时间">
                    <div class="font-14 color-333 line-24">{{info.createTime}}</div>
                  </el-form-item>
                  <el-form-item label="投资专业">
                    <div class="font-14 color-333 line-24">{{info.investMajorName}}</div>
                  </el-form-item>
                  <el-form-item label="项目投资">
                    <div class="font-14 color-333 line-24">总资产{{info.totalInvest}}万元 / 已下达<span class="color-red">{{info.totalReleaseInvest}}</span>万元</div>
                    <div v-for="(item, i) in info.pReleaseInvestInfoList"
                         :key="item.id"
                         class="font-14 color-333 line-24">
                      第{{i + 1}}次下达<span class="color-red">{{item.releaseInvest}}</span>万元
                    </div>
                  </el-form-item>
                </el-form>
              </div>
            </div>
          </el-card>
        </el-col>
        <el-col :span="10" class="com-box">
          <el-card shadow="never">
            <div class="font-18 color-333 font-bold m-b-15">节点进度</div>
            <div class="f-r f-r-between f-r-top">
              <!--左侧-->
              <div class="com-c-box">
                <div v-for="(c,j) in projectStage" :key="j" class="jd-item" :class="{'jd-active':c.pstageId===curId}" @click="changeJd(c,j)">
                  {{ c.pstageName }}
                </div>
              </div>
              <!--右侧-->
              <div class="f-1 node-list com-c-box">
                <el-timeline>
                  <el-timeline-item
                    v-for="(node, index) in nodeList"
                    :key="index"
                    icon="el-icon-check"
                    type="success"
                    size="large"
                    :hide-timestamp="false">
                    <div class="node-item f-r f-r-between">
                      <div>
                        <div class="font-16 color-333">{{ node.nodeName }}</div>
                        <div class="m-t-5 font-14 color-333">{{ formatterDate(node.nodeStart) }}至{{ formatterDate(node.nodeEnd) }}</div>
                      </div>
                      <div>
<!--                        <div class="font-12 color-999">{{ node.nodeCompleteDate }}</div>-->
                        <el-button type="primary" size="mini" class="m-t-5 float-right" @click="lookNode(node.nodeId)">查看</el-button>
                      </div>
                    </div>
                  </el-timeline-item>
                </el-timeline>
              </div>
            </div>
          </el-card>
        </el-col>
        <el-col :span="9">
          <el-card shadow="never">
            <div class="font-18 color-333 font-bold m-b-15">全部进度</div>
            <div class="com-c-box" style="padding-left: 5px" :loading="nodeLoading">
              <el-timeline>
                <!-- recList-->
                <el-timeline-item
                  v-for="(cs, index) in 10"
                  :key="index"
                  size="large"
                  :hide-timestamp="false">
                  <div class="info-item">
                    <div class="font-14 m-b-15">
                      完成了<span class="color-0D9">立项/可研</span>阶段的审查节点
                    </div>
                    <div class="info-box">
                      <div class="f-r f-r-between m-b-15">
                        <div class="font-14 color-333">周星星</div>
                        <div class="font-12 color-999">2023-09-04 12:31</div>
                      </div>
                      <!-- 图片-->
                      <div class="f-r">
                        <el-image
                          v-for="(iItem,iIndex) in cs.imgs"
                          class="info-img"
                          :src="iItem"
                          :preview-src-list="imgList">
                        </el-image>
                      </div>
                      <!-- 附件 -->
                      <div class="m-b-15" v-if="cs.files && cs.files.length>0">
                        <div class="font-14 color-666">附件</div>
                        <div class="f-r f-r-between file-item" v-for="(file,fIndex) in cs.files">
                          <div class="f-r f-1">
                            <img :src="getFileIcon(file.fileName)" alt="下载" class="file-icon"/>
                            <div class="file-name" @click="downLoadFile(file.url)">
                              {{ file.fileName }}
                            </div>
                          </div>
                          <div class="down-enter">查看</div>
                        </div>
                      </div>
                      <!-- 当前项目进度 -->
                      <div>
                        <div class="font-14 color-666">当前项目进度</div>
                        <div class="font-14 color-333 m-t-5 line-24">
                          在中台产品的研发过程中,会出现不同的设计规范和实现方式,但其中往往存在很多类似的页面和组件,这些类似的组件会被抽离成一套标准规范。
                        </div>
                      </div>
                    </div>
                  </div>
                </el-timeline-item>
              </el-timeline>
            </div>
          </el-card>
        </el-col>
      </el-row>
      <!--  节点进度 -->
      <nodeProgress v-if="nodeShow" :nodeId="nodeId" @close="nodeShow=false"></nodeProgress>
    </div>
  </win2>
</template>
 
<script>
import win2 from '@/components/win2/index'
import {getDownUrl} from '@/utils/base';
import nodeProgress from '@/views/projectManage/information/nodeProgress'
import * as info from '@/api/projectManage/info'
import * as DateFormatter from '@/utils/DateFormatter';
export default {
  name: "detail",
  components: {win2,nodeProgress},
  props: {
    setting: {
      type: Object,
      default: () => {
      }
    }
  },
  data() {
    return {
      info: {},
      files: [
        {url: '2222.txt', fileName: '最项目进度设计方案.xsl'},
        {url: '2222.txt', fileName: '最项目进度设计方案.ppt'},
        {url: '2222.txt', fileName: '最项目进度设计方案.pdf'},
        {url: '2222.txt', fileName: '最项目进度设计方案.xls'},
        {url: '2222.txt', fileName: '最项目进度设计方案.xsl'}
      ],
      projectStage: [], // 节点列表
      curId: null, // 当前选中阶段id
      nodeId: null, // 当前选中节点id
      nodeList: [],
      recList: [],  // 进度列表
      imgList: [],  // 图片预览
      nodeShow:false, // 节点进度
      nodeLoading:false // 右侧加载loading
    }
  },
  created() {
    if (this.setting.id) {
      this.getInfo(this.setting.id)
    }
  },
  methods: {
    formatterDate(time){
      return DateFormatter.LongToDate(time)
    },
    getInfo(id) {
      info.getInfo({id: id}).then(res => {
        if (res) {
          this.info = res
          this.info.approvalDate = DateFormatter.LongToDate(this.info.approvalDate)
          this.info.createTime = DateFormatter.LongToDateTime(this.info.createTime)
          this.projectStage = res.pTempStageResults
          if(this.projectStage.length>0){
            this.curId = this.projectStage[0].pstageId
            this.nodeList = this.projectStage[0].pStageNodeResults
          }
        }
      })
    },
    // 查看节点进度
    lookNode(nodeId){
      this.nodeId = nodeId
      this.nodeShow = true
    },
    // 切换节点
    changeJd(c,index){
      this.curId = c.pstageId
      this.nodeList = this.projectStage[index].pStageNodeResults
      this.$forceUpdate()
    },
    getStatusText(state) {
      // 0 未开工 1 进行中 2 已完成 3 已取消 4 已延期
      let obj = {
        text: '',
        type: 'success'
      }
      switch (state) {
        case 0:
          obj.text = '未开工'
          obj.type = 'info'
          break
        case 1:
          obj.text = '进行中'
          obj.type = 'primary'
          break
        case 2:
          obj.text = '已完成'
          obj.type = 'success'
          break
        case 3:
          obj.text = '已取消'
          obj.type = 'warning'
          break
        case 4:
          obj.text = '已延期'
          obj.type = 'danger'
          break
      }
      return obj
    },
    // 下载文件
    downLoadFile(item) {
      const loadingInstance = this.$loading({
        lock: true,
        text: '正在下载...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)',
      });
      let info = JSON.parse(item)[0];
      if (info.url.indexOf('http') !== 0) {
        info.url = getDownUrl() + info.url;
      }
      // window.open(decodeURI(info.url))
      var doc = document.createElement('a');
      doc.href = info.url;
      doc.download = info.fileName;
      doc.target = '_blank';
      doc.click();
      loadingInstance.close();
    },
    getFileIcon(item) {
      const arr = item.split('.');
      if (arr[arr.length - 1] === 'doc' || arr[arr.length - 1] === 'docx') {
        return require('@/assets/images/project/word.png');
      } else if (arr[arr.length - 1] === 'pdf') {
        return require('@/assets/images/project/pdf.png');
      } else if (arr[arr.length - 1] === 'txt') {
        return require('@/assets/images/project/txt.png');
      } else if (arr[arr.length - 1] === 'xls' || arr[arr.length - 1] === 'xlsx') {
        return require('@/assets/images/project/xls.png');
      } else if (arr[arr.length - 1] === 'ppt' || arr[arr.length - 1] === 'pptx') {
        return require('@/assets/images/project/ppt.png');
      } else {
        return require('@/assets/images/project/no-file.png');
      }
    },
    close() {
      this.$emit('close')
    }
  },
}
</script>
 
<style scoped>
.com-box {
  overflow-y: auto;
  max-height: calc(100vh - 256px);
}
 
.com-c-box {
  overflow-y: auto;
  max-height: calc(100vh - 310px);
}
 
.com-c-box::-webkit-scrollbar {
  display: none;
}
 
.com-box::-webkit-scrollbar {
  width: 4px;
}
 
.com-box::-webkit-scrollbar-thumb {
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}
 
.m-t-10 {
  margin-top: 10px;
}
 
.m-t-5 {
  margin-top: 5px;
}
 
.m-b-15 {
  margin-bottom: 15px;
}
 
.img-box {
  min-width: 56px;
  max-width: 56px;
  height: 56px;
  border-radius: 4px;
  border: 1px solid #eeeeee;
  margin-right: 5px;
}
 
.type-img {
  width: 38px;
  height: 38px;
}
 
.cont-box {
  padding: 15px 0;
  border-bottom: 1px solid #f5f5f5;
}
 
.line-24 {
  line-height: 24px;
}
 
>>> .el-form-item__label {
  line-height: 24px;
}
 
>>> .el-form-item {
  margin-bottom: 10px;
}
 
.e-p-v-15 {
  padding: 15px 0;
}
 
.jd-item {
  width: 150px;
  height: 45px;
  line-height: 45px;
  text-align: center;
  border-radius: 4px;
  font-size: 16px;
  border: 1px solid #e6e6e6;
  cursor: pointer;
  margin-bottom: 15px;
}
 
.jd-item:hover {
  color: #FFFFFF;
  background-color: #0d997c;
}
 
.jd-active {
  color: #FFFFFF;
  background-color: #0d997c;
}
 
.node-list {
  padding-left: 25px;
}
 
.node-item {
  padding-top: 5px;
}
 
.float-right {
  float: right;
}
 
.color-0D9 {
  color: #0D997C;
}
 
.info-item {
  padding-top: 5px;
}
 
.info-box {
  padding: 8px;
  border-radius: 4px;
  background: #f8faf9;
}
 
.info-img {
  width: 92px;
  height: 92px;
  border-radius: 4px;
  margin-right: 10px;
}
 
.file-item {
  padding: 10px 0;
}
.file-icon{
  width: 16px;
  height: 16px;
  margin-right: 5px;
}
.file-name{
  font-size: 14px;
  color: #333333;
}
.file-name:hover{
  cursor: pointer;
  color: #0d997c;
}
.down-enter{
  cursor: pointer;
  color: #1890ff;
  font-size: 14px;
  text-decoration: underline;
}
</style>