<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>
|