lyh
2025-06-27 82b238214db913000a12fc037c5e0f101a7b9d73
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
<!--
 Description: 工作流-NC审签处理页面 List
 Author: 作者 liuyh
 Date:   2025-02-27
-->
<template>
  <a-modal
    :title="title"
    :width="width"
    :visible="visible"
    :footer="null"
    @cancel="handCancel"
  >
    <a-card :bordered="false">
      <div>
        <b>{{ selectShenpiData.description }}</b>
        <br>
        <br>
        <a-tag color="blue">
          当前处理人 {{ selectShenpiData.assignee_dictText }}
        </a-tag>
        <a-tag color="blue">
          任务创建时间 {{ selectShenpiData.createTime }}
        </a-tag>
        <br>
        <br>
        <button @click="fetchAndShowBmp" class="btn-custom">打开流程图</button>
        <div v-if="imageSrc">
          <img :src="imageSrc" alt="Fetched Image" />
        </div>
        <hr class="shallow-hr">
      </div>
      <div>
        <b>审签详情</b>
        <br>
        <a-form :form='form'>
          <a-spin :spinning="spinning">
            <a-tabs default-active-key='1' @change='callback'>
              <a-tab-pane key='1' tab='基本信息'>
                <a-form-model ref='form' :model='tableRowRecord' :rules='validatorRules'>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item label='文档名称' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='docName'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.docName'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='文档版本' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='publishVersion'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.publishVersion'></a-input>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item label='文档后缀' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='docSuffix'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.docSuffix'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='系统指定版本' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='componentId'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.componentName'></a-input>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                  <a-row>
                    <a-col :span='span'>
                      <a-form-model-item label='出库状态' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='pullStatus_dictText'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.pullStatus_dictText'></a-input>
                      </a-form-model-item>
                    </a-col>
                    <a-col :span='span'>
                      <a-form-model-item label='出库人' :labelCol='labelCol' :wrapperCol='wrapperCol' prop='pullUser_dictText'>
                        <a-input :disabled='coldisabled' v-model='tableRowRecord.pullUser_dictText'></a-input>
                      </a-form-model-item>
                    </a-col>
                  </a-row>
                </a-form-model>
              </a-tab-pane>
              <a-tab-pane key='2' tab='流程节点'>
                <a-card>
                  <a-timeline style="padding:0 1% 0 12%" >
                    <a-timeline-item color='white' v-for="(item,index1) in hitaskDataSource" :key="index1">
                      <div class="bottom">
                        <p>处理人:{{item.assignee_dictText}}</p>
                        <p v-if="index1 !==0">处理时长:{{item.duration}}</p>
                        <p v-if="item.name !== '提交申请'">处理类型:{{item.sequenceFlowName}}</p>
                        <p v-if="item.description != null">处理意见:{{item.description}}</p>
                        <div class="left_qiu"><span>{{item.taskName}}</span></div>
                      </div>
                    </a-timeline-item>
                  </a-timeline>
                </a-card>
              </a-tab-pane>
            </a-tabs>
          </a-spin>
        </a-form>
      </div>
      <div>
        <hr class="shallow-hr">
        <br>
        <b>审批详情</b>
        <br>
        <a-form-model ref="form" :model="approveData" :rules="validatorRules" slot="detail">
          <a-row>
            <a-col ::span='span' v-if="selectShenpiData.taskDefKey ==='task_proofread'" class="btxx">
              <a-form-model-item  label="处理类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop='status'>
                <j-dict-select-tag  type='list' v-model='assignFileStream.status' dictCode='nc_sq_handle_type_jd' placeholder="请选择处理类型"  />
              </a-form-model-item >
            </a-col>
            <a-col ::span='span' v-if="selectShenpiData.taskDefKey ==='task_approve' || selectShenpiData.taskDefKey ==='Activity_0ocot6b'|| selectShenpiData.taskDefKey ==='task_cut' || selectShenpiData.taskDefKey ==='task_finalize'" class="btxx">
              <a-form-model-item  label="处理类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop='status'>
                <j-dict-select-tag  type='list' v-model='assignFileStream.status' dictCode='nc_sq_handle_type' placeholder="请选择处理类型"  />
              </a-form-model-item >
            </a-col>
            <a-col :span="24" class="btxx">
              <a-form-model-item  label="处理意见" :labelCol="labelCol" :wrapperCol="wrapperCol">
                <a-textarea v-model="assignFileStream.approveContent" rows="4" placeholder="请输入处理意见"/>
              </a-form-model-item >
            </a-col>
          </a-row>
          <div class="table-operator" style="text-align: right;">
            <a-button
              @click="handleQueXiaoTask"
              icon="close"
              :disabled="isSubmitting"
              :class="{'disabled-btn': isSubmitting}"
            >取消</a-button>
            <a-button
              @click="submitForm"
              type="primary"
              :disabled="isSubmitting"
              :loading="isSubmitting"
            >
              提 交
            </a-button>
          </div>
        </a-form-model>
      </div>
    </a-card>
 
 
  </a-modal>
</template>
 
<script>
 
import '@assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { getAction, deleteAction, postAction, downFile, httpAction } from '@api/manage'
export default {
  name: 'FlowShenPi',
  mixins: [mixinDevice],
  props: {
    selectShenpiData: {
      type: Object,
      required: true
    }
  },
 
  data() {
    return {
      form: this.$form.createForm(this),
      span: 12,
      span1: 8,
      coldisabled: true,
      spinning: false,
      tableRowRecord: {},
      assignFileStream:{},
      tableDataSource: [],
      usageDataSource: [],
      hitaskDataSource:[],
      bomForm: {},
      approveContent:"",
      imageSrc: null,
      drawerVisible: true,
      labelCol: {
        xs: { span: 24 },
        sm: { span: 5 }
      },
      wrapperCol: {
        xs: { span: 30 },
        sm: { span: 16 }
      },
      validatorRules: {
        status: {
          rules: [
            { required: true, message: '请选择审批状态!'},
          ]
        },
      },
      approveData: {},
      flowData: {},
      title: '详情页面',
      width: 1000,
      visible: false,
      // 表头
      url: {
        diagramView: '/assign/flow/diagramView',
        queryHisTaskList:'/dncFlow/dispatchFile/queryHisTaskList',
        approve:"/dncFlow/dispatchFile/approval",
        saveDispatchFile:"/dncFlow/dispatchFile/saveDispatchFile",
        queryDocInfoByFlowDataId:'/dncFlow/dispatchFile/queryDocInfoByFlowDataId'
      },
      dictOptions: {},
      superFieldList: [],
      workflowSource: [],
      isSubmitting: false,
    }
  },
  created() {
  },
  computed: {},
  methods: {
    callback() {
    },
    handCancel() {
      this.visible = false
    },
    clearTableSource() {
      this.tableDataSource = []
      this.usageDataSource = []
    },
    fetchAndShowBmp() {
      console.log('flowData----->', this.flowData)
      try {
        let parm = {
          processDefinitionId: this.flowData.processDefinitionId,
          processInstanceId:this.flowData.processInstanceId,
          TaskDefinitionKey:this.flowData.processDefinitionKey
        }
        downFile(this.url.diagramView,parm,'get').then((res=>{
          console.log('Pica------>',res)
          const urlObject = window.URL.createObjectURL(new Blob([res]))
          this.imageSrc = urlObject
        }))
      } catch (error) {
        console.error('Error fetching image blob:', error)
        alert('无法加载图片,请稍后再试。')
      }
    },
    handleQueXiaoTask() {
      // 如果正在提交,阻止取消操作
      if (this.isSubmitting) return;
      this.visible = false;
      this.routeReload();
    },
    submitForm () {
      // 如果正在提交,阻止重复点击
      if (this.isSubmitting) return;
 
      // 开启全局禁选
      this.isSubmitting = true;
      document.body.classList.add('submitting');
 
      const that = this;
 
      // 定义一个恢复状态的函数
      const resetState = () => {
        that.isSubmitting = false;
        document.body.classList.remove('submitting');
      };
      console.log('selectShenpiData---->',that.selectShenpiData)
      if (that.selectShenpiData.taskDefKey ==='task_prepare'){
        // 触发表单验证-重新启动
        this.form.validateFields((err, values) => {
          if (err) {
            resetState(); // 验证失败,恢复状态
            return;
          }else {
            that.confirmLoading = true;
            let url=this.url.saveDispatchFile;
            let method = 'post';
            let flowTaskVo = {}
            flowTaskVo.comment =that.assignFileStream.approveContent;
            flowTaskVo.dataId = this.selectShenpiData.dataId
            flowTaskVo.instanceId = this.selectShenpiData.procInstId
            flowTaskVo.taskId = this.selectShenpiData.id
            console.log("表单提交数据",flowTaskVo)
            httpAction(url,flowTaskVo,method).then((res)=>{
              if(res.success){
                that.$message.success(res.message);
                that.visible = false
                //刷新表格
                that.$emit('searchReset')
              }else{
                that.$message.warning(res.message);
              }
            }).catch((error) => {
              console.error(error);
              that.$message.error('提交失败');
            })
              .finally(() => {
                that.confirmLoading = false;
                resetState(); // 请求结束,恢复状态
              });
          }
        })
        //跳出方法
        return false;
      }else {
        if (!that.assignFileStream.status==null || that.assignFileStream.status===undefined){
          this.$message.warning('请选择处理类型!')
          resetState();
          return false;
        }
      }
      if (!that.assignFileStream.approveContent==null || that.assignFileStream.approveContent===undefined) {
        this.$message.warning('请输入处理意见!')
        resetState();
        return false;
      }
      // 触发表单验证
      this.form.validateFields((err, values) => {
        if (err) {
          resetState();
          return;
        }
        if (!err) {
          that.confirmLoading = true;
          let url=this.url.approve
          let method = 'post';
          let handle =that.assignFileStream.status === '1';
          let flowTaskVo = {}
          switch (that.selectShenpiData.taskDefKey){
            case "task_approve":
              flowTaskVo.ratify=handle;
              break;
            case "task_cut":
              flowTaskVo.cut=handle;
              break;
            case "task_finalize":
              flowTaskVo.stereotype=handle;
              break;
          }
          if (that.selectShenpiData.taskDefKey ==='task_proofread'){
            flowTaskVo.proofreadStatus =that.assignFileStream.status;
          }
          flowTaskVo.comment =that.assignFileStream.approveContent;
          flowTaskVo.dataId = this.selectShenpiData.dataId
          flowTaskVo.taskId = this.selectShenpiData.id
          flowTaskVo.userId = this.selectShenpiData.assignee
          flowTaskVo.instanceId = this.selectShenpiData.procInstId
          flowTaskVo.values = this.selectShenpiData.variables
          console.log("表单提交数据",flowTaskVo)
          httpAction(url,flowTaskVo,method).then((res)=>{
            if(res.success){
              that.$message.success(res.message);
              that.visible = false
              //刷新表格
              that.$emit('searchReset')
            }else{
              that.$message.warning(res.message);
            }
          }).finally(() => {
            that.confirmLoading = false;
            resetState();
          })
        }
      })
    },
    async getAllApproveData(item) {
      console.log('selectShenpiData----->', this.selectShenpiData)
      this.flowData = item
      let param = {
        'dataId': item.dataId
      }
      let parmhis={
        'procInstId': item.procInstId
      }
      const hitaskDataList = await getAction(this.url.queryHisTaskList,parmhis)
      if(hitaskDataList.success){
        this.hitaskDataSource=hitaskDataList.result
      }
      const docInforResult = await getAction(this.url.queryDocInfoByFlowDataId,param)
      if(docInforResult.success){
        this.tableRowRecord = docInforResult.result
        this.visible=true
      }
    }
  }
}
</script>
<style scoped>
/* 全局禁选样式 - 作用于整个页面 */
html.submitting,
html.submitting body {
  pointer-events: none !important;
  cursor: wait !important;
}
 
/* 蒙层效果增强 */
html.submitting::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.5);
  z-index: 9998;
}
 
/* 加载指示器 - 更明显的视觉反馈 */
html.submitting::after {
  content: '提交中...';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1890ff;
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 9999;
}
 
/* 禁用状态按钮样式 */
.disabled-btn {
  opacity: 0.6;
  cursor: not-allowed !important;
}
 
.shallow-hr {
  border: 0;
  height: 1px; /* 分界线的高度 */
  background-color: rgba(0, 0, 0, 0.1); /* 使用 RGBA 颜色,并设置较低的透明度 */
  margin: 20px 0; /* 分界线上下的外边距 */
}
.btn-custom {
  background-color: #4CAF50; /* 绿色背景 */
  color: white; /* 白色文字 */
  border: none; /* 无边框 */
  padding: 5px 15px; /* 内边距 */
  text-align: center; /* 文字居中 */
  text-decoration: none; /* 无下划线 */
  display: inline-block; /* 行内块元素 */
  font-size: 12px; /* 字体大小 */
  margin: 4px 2px; /* 外边距 */
  cursor: pointer; /* 鼠标悬停时显示手型 */
  border-radius: 4px; /* 圆角边框 */
}
 
.bold-large-label {
  font-weight: bold;
  font-size: 20px; /* 或你需要的任何大小 */
}
.left_qiu{
  position: absolute;
  left: -74px;
  top: 0;
  width:54px;
  border-radius: 50%;
  height:54px;
  font-size: 13px;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  background: #0099ff;
  transform: translate(0, 0);
}
/deep/ .ant-timeline-item-tail{
  left: -29px !important;
}
.left_qiu span{
  width: 3em;
  display: block;
  color: #fff;
  text-align: center;
}
.img{
  width: 75%;
}
 
.wrap{
  clear: both;
  width: 100%;
  display: flex;
  height: 50px;
  border: 1px solid #ccc;
  /* background-color: aqua; */
}
.box{
  width:21%;
  height:50px;
  border-right: 1px solid #ccc;
  line-height: 50px;
  /* background: red; */
  text-align:center;
  margin: auto;
}
 
@import '~@assets/less/common.less';
</style>