jinlin
2024-01-15 ab888a5c9fcb6df31b159a222dbfdb2418019aa6
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
<template>
  <div>
    <!--    <zt-table-wraper ref="tableObj" query-url="/newPlan/taskCenter/page" :paging="false" :lazy="true" v-slot="{ table }"
                         paging-layout="total, prev, pager, next">-->
    <el-form :inline="true" :model="dataForm" @keyup.enter.native="getQuery()">
      <el-input type="text" v-model="dataForm.djxlSystem" v-if="false"/>
    </el-form>
    <el-table ref="table"
              :height="getTransformHeight()"
              v-loading="dataLoading"
              :data="dataList"
              style='margin-top:10px;transition: .5s;'
              class="alreadyTaskPushTable  table-is__left-tz"
              border highlight-current-row>
      <el-table-column prop="index" width="60" label="序号" align="center">
        <template slot-scope="scope">
          <span v-html="indexFormat(scope.$index)"></span>
        </template>
      </el-table-column>
      <el-table-column align="left" prop="topic" label="工程" width="150"/>
      <!--        <el-table-column align="left" prop="title" label="流程名称" width="180"/>-->
      <el-table-column align="left" prop="remark" label="摘要"/>
 
      <el-table-column align="center" prop="stepName" label="当前环节" width="150px"/>
      <el-table-column align="center" prop="receiveTime" label="上一环节办理时间" width="180px"/>
      <el-table-column align="center" prop="senderName" label="上一环节办理人" width="160px"/>
      <el-table-column align="center" prop="finishTime" label="计划完成时间" width="160px"/>
      <!--        <el-table-column align="center" prop="statusName" label="状态" width="100px"/>-->
      <el-table-column align="center" prop="idleDays" label="停留时间(天)" width="150px"/>
      <zt-table-column-handle fixed="right" :table="table" :has-edit="false" :has-delete="false" :has-view="false"
                              width="120px">
        <template v-slot="{ row }">
          <zt-table-button
            v-if="row.stepMarker!='hxsy_czsp'&&row.stepMarker!='hxsy_bzsp'&&row.stepMarker!='xbsy_czsp'&&row.stepMarker!='xbsy_bzsp'"
            @click="createTask(row)">办理
          </zt-table-button>
          <zt-table-button
            v-if="row.stepMarker=='hxsy_czsp'||row.stepMarker=='hxsy_bzsp'||row.stepMarker=='xbsy_czsp'||row.stepMarker=='xbsy_bzsp'"
            @click="createTask(row)">查阅
          </zt-table-button>
          <zt-table-button @click="flowChart(row)">流程图</zt-table-button>
          <zt-table-button v-if="row.flowCode === 'yearPlan2'" @click="getFlowTrack (row)">流程轨迹</zt-table-button>
        </template>
      </zt-table-column-handle>
      <infinite-loading
        spinner="bubbles"
        distance="200"
        slot="append"
        identifier="infiniteId"
        @infinite="infiniteHandler"
        ref="infiniteLoading"
        force-use-infinite-wrapper=".alreadyTaskPushTable .el-table__body-wrapper">
        <div slot="no-more" style="margin-top: 10px;margin-bottom: 10px;"><span v-if="dataListAll.length > pageSize">没有更多了</span>
        </div>
      </infinite-loading>
    </el-table>
    <!-- 待办任务弹窗弹窗, 新增 / 修改 -->
    <ItemCirculatOrder ref="itemCirculatOrder" @refreshDataList="getQuery()"></ItemCirculatOrder>
    <ConfigItemWarehouse ref="configItemWarehouse" @refreshDataList="getQuery()"></ConfigItemWarehouse>
    <ConfigItemChange ref="configItemChange" @refreshDataList="getQuery()"></ConfigItemChange>
    <ConfigItemOutbound ref="configItemOutbound" @refreshDataList="getQuery()"></ConfigItemOutbound>
    <TestCheckOrder ref="testCheckOrder" @refreshDataList="getQuery()"></TestCheckOrder>
    <BaselineRelease ref="baselineRelease" @refreshDataList="getQuery()"></BaselineRelease>
    <QaAuditReport ref="qaAuditReport" @refreshDataList="getQuery()"></QaAuditReport>
    <!--    </zt-table-wraper>-->
  </div>
</template>
 
<script>
  import Cookies from "js-cookie";
  import InfiniteLoading from 'vue-infinite-loading'
  import ItemCirculatOrder from '@/views/modules/itemCirculatOrder/ItemCirculatOrder-AddOrUpdate'
  import ConfigItemWarehouse from '@/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate'
  import TestCheckOrder from '@/views/modules/testCheckOrder/TestCheckOrder-AddOrUpdate'
  import ConfigItemChange from '@/views/modules/configItemChange/ConfigItemChange-AddOrUpdate'
  import ConfigItemOutbound from '@/views/modules/configItemOutbound/ConfigItemOutbound-AddOrUpdate'
  import BaselineRelease from '@/views/modules/baselineRelease/BaselineRelease-AddOrUpdate'
  import QaAuditReport from '@/views/modules/qaAuditReport/QaAuditReport-AddOrUpdate'
 
  export default {
    data() {
      return {
        page: 1,
        pageSize: 30,
        dataLoading: false,
        dataList: [],
        dataListAll: [],
        dataForm: {
          djxlSystem: ''
        },
        dialogVisible: false,
        existConstructionInfo: false
      }
    },
    props: {
      system: {
        type: String
      },
      transformHeight: {
        type: Boolean,
        default: false
      }
    },
    watch: {
      '$route.params.projectId'() {
        //this.dataForm.projectId = this.$route.params.projectId
        // this.getIsExistConstructionInfo()
        this.getQuery()
      },
      'tableBottomOffset'() {
        console.log(this.tableBottomOffset, 'tableBottomOffset')
      }
    },
    computed: {},
    components: {
      InfiniteLoading,
      ItemCirculatOrder,
      ConfigItemWarehouse,
      TestCheckOrder,
      ConfigItemChange,
      ConfigItemOutbound,
      BaselineRelease,
      QaAuditReport
    },
    created() {
      if (this.$route.path.indexOf('taskCenter') > 0 || this.system == 'smj') {
        this.transformHeight = true
      } else {
        this.transformHeight = false
      }
    },
    mounted() {
      if (this.$route.params.projectId) {
        this.dataForm.projectId = this.$route.params.projectId
      }
      this.dataForm.djxlSystem = Cookies.get('djxlSystem')
      this.getQuery()
      this.$EventBus.$on('newProject', () => {
        this.getQuery()
      })
    },
    methods: {
      async infiniteHandler($state) {
        console.log('in infiniteHandler--------')
        if ((this.page * this.pageSize) < this.dataListAll.length) {
          this.page++
          // let begin = (this.page - 1) * this.pageSize
          let end = this.page * this.pageSize
          if (end > this.dataListAll.length) {
            end = this.dataListAll.length
          }
          this.dataList = this.dataListAll.slice(0, end)
          console.log(this.dataList.length, 'infiniteHandler:this.dataList.length')
          console.log(this.page, 'infiniteHandler:this.page')
          setTimeout(() => {
            $state.loaded()
          }, 100)
        } else {
          $state.loaded()
          console.log("$state.complete()", this.page)
          this.page = 1;
          $state.complete()
          console.log(this.page, 'infiniteHandler:this.page')
        }
      },
      handleInfiniteLoadingBeforeGet() {
        this.page = 1;
        this.dataListAll = []
        this.dataList = []
      },
      handleInfiniteLoadingAfterGet(res) {
        this.dataListAll = res.data
        console.log(this.dataListAll.length, 'handleInfiniteLoadingAfterGet:this.dataListAll.length')
        // let begin = (this.page - 1) * this.pageSize
        let end = this.page * this.pageSize
        if (end > this.dataListAll.length) {
          end = this.dataListAll.length
        }
        this.dataList = this.dataListAll.slice(0, end)
        console.log(this.dataList.length, 'handleInfiniteLoadingAfterGet:this.dataList.length')
        console.log(this.page, 'handleInfiniteLoadingAfterGet:this.page')
        this.$nextTick(() => {
          this.$refs.infiniteLoading.$emit('$InfiniteLoading:reset');
        });
      },
      async getQuery() {
        this.handleInfiniteLoadingBeforeGet()
        this.dataLoading = true
        let params = {
          djxlSystem: this.dataForm.djxlSystem,
        }
        let res = await this.$http.get(`/task/taskCenter/page`, {
          params: params
        })
        if (res.success) {
          this.dataLoading = false
          this.handleInfiniteLoadingAfterGet(res)
          console.log(this.dataList, 'getQuery:this.dataList')
        } else {
          this.dataLoading = true
        }
      },
      getTransformHeight() {
        let Height = document.documentElement.clientHeight
          return Height - (650 - 403)
      },
      async reCall(row) {
        if (await this.$tip.confirm('确定要进行撤回吗?')) {
          this.$http.get(`/wf/reCallFlow`, {params: row}).then(a => {
          })
        }
      },
      getStayTask() {
        this.getQuery()
      },
      flowChart(row) {
        this.$emit('fatherMethod', row)
      },
      async getFlowTrack(row) {
        console.log(row, 'getFlowTrack row')
        if (row) {
          let params = {
            flowCode: row.flowCode,
            bizId: row.bizId
          }
          this.$refs.processTrajectory.$refs.dialog.init(params)
        }
      },
      async createTask(row) {
        console.log(row, "task row");
        if (row.flowCode === 'wplz') {
          this.$refs.itemCirculatOrder.$refs.dialog.init(row.bizId, row)
        } else if (row.flowCode === 'pzxrk') {
          this.$refs.configItemWarehouse.$refs.dialog.init(row.bizId, row)
        }else if (row.flowCode === 'csjcd') {
          this.$refs.testCheckOrder.$refs.dialog.init(row.bizId, row)
        } else if (row.flowCode === 'pzxbg') {
          this.$refs.configItemChange.$refs.dialog.init(row.bizId, row)
        }else if (row.flowCode === 'pzxck') {
          this.$refs.configItemOutbound.$refs.dialog.init(row.bizId, row)
        }else if (row.flowCode === 'jxfb') {
          this.$refs.baselineRelease.$refs.dialog.init(row.bizId, row)
        }else if (row.flowCode === 'qashbg') {
          this.$refs.qaAuditReport.$refs.dialog.init(row.bizId, row)
        }else {
          if (row.stepRouterId === null) {
            this.$tip.alert("没有配置菜单id")
            return;
          }
          let route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(item => item.meta.menuId === row.stepRouterId)[0]
          if (route === undefined) {
            this.$tip.alert("没有配置菜单权限")
            return;
          }
          let params = {
            id: row.bizId,
            projectId: row.bizGroupId,
            pageCode: row.stepMarker,
            pageRead: 'no',
            productId: row.productId,
            approveType: ''
          }
          console.log(route.meta.params, 'route.meta.params')
 
          if (Object.keys(route.meta.params).length > 0) {
            params = Object.assign(params, route.meta.params);
          }
          console.log(params, 'params')
          this.$router.push({
            name: row.stepRouterId,
            params: params
          })
        }
      },
      indexFormat(index) {
        let indexs = index + 1
        return '<span>' + indexs + '</span>'
      },
    },
  }
</script>
 
<style scoped>
 
</style>