lyh
2025-02-28 1550ea7fb0f98762062833a37f716ba459b986df
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
<template>
  <a-card>
    <a-list
      class="demo-loadmore-list"
      :loading="loading"
      item-layout="horizontal"
      :data-source="carddata"
    >
 
      <a-list-item slot="renderItem" slot-scope="item, index">
        <a slot="actions" @click="handelDetial(item,index)">查看详情</a>
        <a-list-item-meta :description='item.createTime'>
          <a slot="title">{{ item.title }}</a>
          <a-avatar
            slot="avatar"
            src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
          />
        </a-list-item-meta>
        <div><b>{{ item.name }}</b></div>
      </a-list-item>
    </a-list>
 
 
    <FlowNcZpi ref="modalFormApproval" :selectShenpiData="selectShenpiData"></FlowNcZpi>
  </a-card>
</template>
<style>
.demo-loadmore-list {
  min-height: 350px;
}
</style>
 
<script>
import { getAction, deleteAction, postAction } from '@/api/manage'
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import store from '@/store'
import FlowNcZpi from './FlowNcZpi.vue'
 
 
export default {
  name: 'FlowMyTaskToDo',
  mixins: [mixinDevice],
  components: {
    FlowNcZpi
  },
  data() {
    return {
      jsonArr: {},
      infos: [],
      selectShenpiData: {},
      carddata: [],
      toTaskSelfData: [],
      toolsVisable: true,
      description: '审批待办页面',
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' 共' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      loading: false,
      // 表头
      selectedRowKeys: [],
      url: {
        toTaskBySelfList: '/nc/assign/flow/toTaskBySelf',
        complete: '/plmebomtechnicalordercreatebomapproval/plmEbomTechnicalorderCreatebomapproval/completeByDateId',
        reject: '/plmebomtechnicalordercreatebomapproval/plmEbomTechnicalorderCreatebomapproval/rejectTask',
        pdfSign: '/plmebomtechnicalordercreatebomapproval/plmEbomTechnicalorderCreatebomapproval/pdfSign',
        queryApproveJiJiaByDataId: '/plmmbomprocedurespecification/plmMbomProcedurespecification/queryApproveJiJiaByDataId',
        queryApproveLsByDataId: '/plmbomlsgy/plmMbomLsgy/queryApproveLsByDataId',
        queryApproveFxByDataId: '/plmmbomfxgy/plmMbomFxgy/queryApproveFxByDataId',
        queryByNumber: '/plmebompartmaster/plmEbomPartmaster/queryByNumber',
        getCaxaUrlJJ: '/plmmbomjijiagyapproval/plmMbomJijiagyApproval/getCaxaUrlJeecg',
        getCaxaUrlLS: '/plmbomlsgy/plmMbomLsgy/getCaxaUrlJeecg',
        getCaxaUrlFx: '/plmmbomfxgy/plmMbomFxgy/getCaxaUrlJeecg',
        queryApproveJiJiaById: '/plmmbomjijiagyapproval/plmMbomJijiagyApproval/queryApproveJiJiaById',
        signCxpFile: '/plmmbomjijiagyapproval/plmMbomJijiagyApproval/signCxpFile',
        queryApproveLsById: '/plmmbomapprovallsgy/plmMbomApprovalLsgy/queryApproveDataById',
        queryApproveFxById: '/plmmbomapprovalfxgy/plmMbomApprovalFxgy/queryApproveDataById',
        queryJjDataByJjggAprovalId: '/plmmbomprocedurespecification/plmMbomProcedurespecification/queryJjDataByJjggAprovalId',
        queryJjggByApprovalId: '/plmmbomjjgg/plmMbomJjgg/queryJjggByApprovalId',
        getCaxaUrlJjgg:'/plmmbomjjgg/plmMbomJjgg/getCaxaUrlJeecg',
        queryJjggApprovalByDataId:'/plmmbomjjggapproval/plmMbomJjggApproval/queryById'
      },
      dictOptions: {},
      superFieldList: [],
      workflowSource: []
    }
  },
  created() {
    this.toTaskBySelf()
    this.getSuperFieldList()
  },
  computed: {},
  methods: {
    toTaskBySelf() {
      let usercode = store.getters.userInfo.username
      let param = {
        'currentUserId': usercode
      }
      console.log('usercode--->', usercode)
 
      getAction(this.url.toTaskBySelfList, param).then((res => {
        if (res.success) {
          console.log('res---->', res)
          console.log('resresult---->', res.result)
          this.carddata = res.result
        }
      }))
      console.log('this.toTaskSelfData---->', this.toTaskSelfData)
    },
    handelDetial(item, index) {
      console.log('点击了详情')
      console.log('item----->', item)
      console.log('index----->', index)
      let approcesstype = this.splitAprocessType(item.title)
      console.log('approcesstype--->', approcesstype)
      switch (approcesstype) {
        case '指派NC文档到设备流程':
          this.handDrDetial(item)
          break
        default:
          alert('没找到该审批')
      }
    },
    handDrDetial(item) {
      this.selectShenpiData = item
      this.$refs.modalFormApproval.clearTableSource()
      this.$refs.modalFormApproval.getAllApproveData(item)
    },
    handCheckApprove(record,approcesstype){
      if(approcesstype === '指派NC文档到设备流程'){
 
      }else if(approcesstype === '机加审批流程'){
 
      }else if(approcesstype === '临时工艺审批流程'){
 
      }else if(approcesstype === '返修工艺审批流程'){
 
      }else if(approcesstype === '机加更改单审批流程'){
 
      }
    },
    handleCommonAgree(record) {
      console.log('record------>', record)
      let flowTaskVo = {}
      flowTaskVo.dataId = record.dataId
      flowTaskVo.taskId = record.id
      flowTaskVo.userId = record.assignee
      flowTaskVo.instanceId = record.procInstId
      flowTaskVo.targetKey = record.taskDefKey
      flowTaskVo.values = record.variables
      flowTaskVo.assignee = record.assignee
      postAction(this.url.complete, flowTaskVo).then((res => {
        if (res.success) {
          this.$message.success(res.result)
        } else {
          this.$message.warning(res.result)
        }
      }))
    },
    handleZhuanJiao(record) {
      let approcesstype = this.splitAprocessType(record.title)
      this.handleCommonZhuanJiao(record)
    },
    handleCommonZhuanJiao(record) {
      this.$refs.Flowzhuanjiao.openThis()
      this.$refs.Flowzhuanjiao.approveData = record
    },
    handleJjggpdfSign(record){
      let parm = {
        'id': record.dataId
      }
      console.log("parm===>",parm)
      getAction(this.url.queryJjggApprovalByDataId,parm).then(res=>{
        console.log("resres--->",res.result)
        let infos = {}
        let signInfos = []
        let signInfo = {
          'proc_bz': res.result.organization,
          'proc_bz_date': res.result.writeTime,
          // 'proc_jd': res.result.proofread,
          // 'proc_jd_date': res.result.proofreadTime,
          'proc_sh': res.result.examine,
          'proc_sh_date': res.result.examineTime,
          'proc_pz': res.result.ratify,
          'proc_pz_date': res.result.approveTime
        }
        signInfos.push(signInfo)
        let type = {
          'type': 'jjggd'
        }
        infos.signInfos = signInfos
        infos.type = type
        let parm2 = {
          'dataId': record.dataId
        }
        getAction(this.url.queryJjggByApprovalId,parm2).then(res2=>{
          let parm3 = {
            'signInfos': JSON.stringify(signInfos),
            'type': 'jjggd',
            'cxpFile': res2.result.filecxp,
            'number': res2.result.number
          }
          console.log('parm3---->', parm3)
          console.log('parm3---->', res2.result)
          getAction(this.url.signCxpFile, parm3).then(res3 => {
            console.log('res3---->', res3)
            this.$message.success('签名完成')
          })
        })
      })
    },
    handeditFxCapp(item) {
      console.log('item----->', item)
      let parm1 = {
        'dataId': item.dataId
      }
      getAction(this.url.queryApproveFxByDataId, parm1).then(res => {
        if (res.success) {
          let fileNo = this.splitAprocessNumber(item.title)
          this.jsonArr.userName = item.assignee
          this.jsonArr.partNumber = res.result.partnumber
          this.jsonArr.partName = res.result.partname
          this.jsonArr.drawingVision = res.result.editiondrawing
          this.jsonArr.fileNo = fileNo
          this.jsonArr.id = res.result.id
          let parm2 = {
            'number': res.result.partnumber
          }
          this.jsonArr.number = res.result.number
          this.jsonArr.cxpFilePath = res.result.attract
          // this.jsonArr.cxpFilePath = '/pdmCapp/航星机加工艺规程.cxp'
          getAction(this.url.queryByNumber, parm2).then(res2 => {
            this.jsonArr.partType = res2.result.partType
            this.infos.push(this.jsonArr)
            let infosJsonNew = JSON.stringify(this.infos)
            console.log('infosJson--->', infosJsonNew)
            let parm3 = {}
            parm3.infosJson = infosJsonNew
            console.log('infosJsonNew---->', infosJsonNew)
            getAction(this.url.getCaxaUrlFx, parm3).then(res => {
              console.log('执行了发送')
              if (res.status == 'SUCCESS') {
                console.log('resUrl------>', res)
                let beforeUrl = res.msg
                let afterBefore = this.jiexieUrl(beforeUrl)
                console.log('afterBefore---->', afterBefore)
                window.open(afterBefore, '_blank')
              }
            }).finally(
              this.jsonArr = {},
              this.infos = []
            )
          })
        }
      })
    },
    jiexieUrl(beforeUrl) {
      let afterBefore = beforeUrl.replaceAll('%3A', ':').replaceAll('%2F', '/').replaceAll('%23', '#').replaceAll('%7C', '|').replaceAll('%5C', '\\\\')
      return afterBefore
    },
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'id', text: '任务ID', dictCode: '' })
      fieldList.push({ type: 'string', value: 'rev', text: '版本号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'executionId', text: '执行实例ID', dictCode: '' })
      fieldList.push({ type: 'string', value: 'procInstId', text: '流程实例ID', dictCode: '' })
      fieldList.push({ type: 'string', value: 'procDefId', text: '流程定义ID', dictCode: '' })
      fieldList.push({ type: 'string', value: 'name', text: '任务名称', dictCode: '' })
      fieldList.push({ type: 'string', value: 'taskDefKey', text: '任务定义Key', dictCode: '' })
      fieldList.push({ type: 'string', value: 'assignee', text: '办理人', dictCode: 'unit_all' })
      fieldList.push({ type: 'string', value: 'priority', text: '优先级', dictCode: '' })
      fieldList.push({ type: 'string', value: 'createTime', text: '任务创建时间', dictCode: '' })
      fieldList.push({ type: 'string', value: 'suspensionState', text: '暂停状态', dictCode: '' })
      this.superFieldList = fieldList
    },
    splitAprocessType(title) {
      let parts = title.split(':') // 注意冒号是全角字符,使用对应的字进行分割
      let result = parts[0]
      return result
    },
    splitAprocessNumber(title) {
      let parts = title.split(':') // 注意冒号是全角字符,使用对应的字符进行分割
      let result = parts[1]
      return result
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>