| | |
| | | <!-- |
| | | * @Date: 2025-08-10 14:23:00 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2025-08-10 15:33:29 |
| | | * @LastEditTime: 2025-08-10 15:46:14 |
| | | * @FilePath: /mdmweb/src/views/flow/donelist.vue |
| | | --> |
| | | <template> |
| | |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" |
| | | @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange" |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" > |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" @click.stop="handleView(scope.row, scope.index)">查看</el-button> |
| | | <el-button type="primary" :disabled="scope.row.processIsFinished==='true' || (scope.row.currentTaskKeys.toLowerCase().indexOf('program')==-1 && scope.row.currentTaskKeys.toLowerCase().indexOf('useable')==-1)" v-if="permission.takeback_button" text size="default" @click.stop="handleTakeBack(scope.row, scope.index)">取回</el-button> |
| | | <el-button type="primary" :disabled="scope.row.processIsFinished==='true' || scope.row.currentTaskKeys.toLowerCase().indexOf('program')>-1" v-if="permission.withdraw_button" text size="default" @click.stop="handleWithdraw(scope.row, scope.index)">撤回</el-button> |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | <el-dialog title="查看详情" v-model="dialogVisible" width="60%"> |
| | | <avue-form v-model="viewRow" :option="viewFormOption" readonly class="viewRowForm"></avue-form> |
| | | <el-table :data="tableData" style="width: 100%"> |
| | | <el-table-column prop="assigneeName" label="执行人" /> |
| | | <el-table-column prop="taskName" label="任务名称" /> |
| | | <el-table-column prop="comment" label="批注" /> |
| | | <el-table-column prop="createTime" label="开始时间" /> |
| | | <el-table-column prop="endTime" label="完成时间" /> |
| | | </el-table> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | <script> |
| | | import { getDoneList} from '@/api/flow/todolist'; |
| | | import { getDoneList,todoChangeNotify} from '@/api/flow/todolist'; |
| | | import { mapGetters } from 'vuex'; |
| | | export default { |
| | | data() { |
| | | return { |
| | | tableData: [], |
| | | query:{}, |
| | | viewFormOption: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | menuBtn: false, |
| | | |
| | | labelWidth: 100, |
| | | span: 8, |
| | | column: [ |
| | | { |
| | | label: '流程类型', |
| | | prop: 'processDefinitionKey', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.processDefinitionKey) |
| | | }, |
| | | }, |
| | | { |
| | | label: '创建时间', |
| | | prop: 'createTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.createTime) |
| | | }, |
| | | }, |
| | | { |
| | | label: '标题', |
| | | prop: 'variables.title', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.title) |
| | | } |
| | | }, |
| | | { |
| | | label: '流程名称', |
| | | prop: 'processDefinitionName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.processDefinitionName) |
| | | } |
| | | }, |
| | | { |
| | | label: '批次号', |
| | | prop: 'variables.craftEdition', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.craftEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '工序号', |
| | | prop: 'processNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '工序名称', |
| | | prop: 'processName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processName || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '工序版次', |
| | | prop: 'processEdition', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processEdition || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '零组件号', |
| | | prop: 'drawingNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.drawingNo || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '任务车间', |
| | | prop: 'workshop', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.workshop || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '过程卡号', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processCard || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '图号', |
| | | prop: 'drawingNo', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.drawingNo) |
| | | } |
| | | }, |
| | | { |
| | | label: '产品型号', |
| | | prop: 'productModel', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.productModel) |
| | | } |
| | | }, |
| | | { |
| | | label: '机床', |
| | | prop: 'machineCode', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.machineCode) |
| | | } |
| | | }, |
| | | { |
| | | label: '创建人', |
| | | prop: 'startUserName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.startUserName) |
| | | } |
| | | }, |
| | | { |
| | | label: '创建时间', |
| | | prop: 'processCreateTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.processCreateTime) |
| | | } |
| | | }, |
| | | { |
| | | label: '当前节点', |
| | | prop: 'taskName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.taskName) |
| | | } |
| | | }, |
| | | { |
| | | label: '计划加工时间', |
| | | prop: 'planStartTime', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.planStartTime || ''); |
| | | } |
| | | }, |
| | | { |
| | | label: '程序包名', |
| | | prop: 'programPackageName', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.programPackageName || ''); |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | viewRow: {}, |
| | | dialogVisible: false, |
| | | loading: false, |
| | | option: { |
| | | rowKey: "taskId", |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | columnBtn: false, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchEnter:true, |
| | | searchMenuSpan: 6, |
| | | dialogWidth: '60%', |
| | | border: true, |
| | | index: true, |
| | | selection: false, |
| | | // viewBtn: true, |
| | | menu: false, |
| | | menuWidth: 100, |
| | | menu: true, |
| | | menuWidth: 120, |
| | | column: [ |
| | | { |
| | | label: '关键字', |
| | |
| | | search: true, |
| | | searchType: 'input', |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: '状态', |
| | | prop: 'status', |
| | | hide: true, |
| | | search: true, |
| | | type: 'select', |
| | | dicData: [ |
| | | { |
| | | label: '涉密网程序', |
| | | value: 1, |
| | | label:'进行中', |
| | | value:'1' |
| | | }, |
| | | { |
| | | label: '工控网车床程序', |
| | | value: 2, |
| | | label:'已结束', |
| | | value:'2' |
| | | }, |
| | | ], |
| | | labelKey: 'label', |
| | | |
| | | span: "8" |
| | | }, |
| | | { |
| | | label: '标题', |
| | | prop: '', |
| | | width: 100, |
| | | width: 200, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | |
| | | }, |
| | | { |
| | | label: '流程名称', |
| | | prop: 'processDefinitionName', |
| | | prop: '', |
| | | width: 100, |
| | | render: ({ row }) => { |
| | | return h('p', |
| | | { |
| | | attrs: {}, |
| | | class: {}, |
| | | style: {}, |
| | | }, row?.variables?.myProcessName) |
| | | } |
| | | },/* |
| | | { |
| | | label: '流程类型', |
| | |
| | | }, |
| | | { |
| | | label: '创建时间', |
| | | width: 200, |
| | | width: 100, |
| | | prop: 'processCreateTime', |
| | | type: 'datetime', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | |
| | | }, |
| | | { |
| | | label: '开始时间', |
| | | width: 200, |
| | | prop: '', |
| | | width: 100, |
| | | prop: 'createTime', |
| | | type: 'datetime', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | |
| | | }, |
| | | { |
| | | label: '结束时间', |
| | | width: 200, |
| | | prop: '', |
| | | width: 100, |
| | | prop: 'endTime', |
| | | type: 'datetime', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | sortable:true, |
| | | search: false, |
| | | searchRange: true, |
| | | searchSpan: 8, |
| | |
| | | }, |
| | | { |
| | | label: '任务名称', |
| | | width: 200, |
| | | prop: '', |
| | | width: 100, |
| | | prop: 'taskName', |
| | | }, |
| | | { |
| | | label: '文件', |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | handleView(row) { |
| | | console.log(row,1111) |
| | | this.viewRow = {...row}; |
| | | axios({ |
| | | url: '/blade-mdm/flow/mgr/process-trace', |
| | | method: 'get', |
| | | params: {processInstanceId: row.processInstanceId} |
| | | }).then( |
| | | res => { |
| | | this.tableData = res.data.data; |
| | | }); |
| | | this.dialogVisible = true; |
| | | }, |
| | | handleTakeBack(row){ |
| | | //组长取回 |
| | | this.$confirm('确认要取回吗?', '', { |
| | | confirmButtonText: this.$t('submitText'), |
| | | cancelButtonText: this.$t('cancelText'), |
| | | type: 'warning', |
| | | }).then(() => { |
| | | axios({ |
| | | url: '/blade-mdm/flow/mgr/takeback', |
| | | method: 'get', |
| | | params: {processInstanceId: row.processInstanceId} |
| | | }).then(res => { |
| | | if(res.data.code !== 200) { |
| | | this.$message.error(res.data.msg); |
| | | return; |
| | | } |
| | | this.$message.success('操作成功'); |
| | | |
| | | todoChangeNotify(); |
| | | |
| | | this.refreshChange(); |
| | | }).catch(err => { |
| | | console.error(err); |
| | | //done() |
| | | }); |
| | | |
| | | }).catch(() => { |
| | | console.log('>>>>>>') |
| | | // this.$message.info('已取消操作'); |
| | | //done(); |
| | | }); |
| | | }, |
| | | handleWithdraw(row) { |
| | | //console.log(row,row.processInstanceId) |
| | | this.$confirm('确认要撤回吗?', '', { |
| | | confirmButtonText: this.$t('submitText'), |
| | | cancelButtonText: this.$t('cancelText'), |
| | | type: 'warning', |
| | | }).then(() => { |
| | | axios({ |
| | | url: '/blade-mdm/flow/mgr/withdraw', |
| | | method: 'get', |
| | | params: {processInstanceId: row.processInstanceId} |
| | | }).then(res => { |
| | | if(res.data.code !== 200) { |
| | | this.$message.error(res.data.msg); |
| | | return; |
| | | } |
| | | this.$message.success('操作成功'); |
| | | |
| | | todoChangeNotify(); |
| | | |
| | | this.refreshChange(); |
| | | }).catch(err => { |
| | | console.error(err); |
| | | //done() |
| | | }); |
| | | |
| | | }).catch(() => { |
| | | console.log('>>>>>>') |
| | | // this.$message.info('已取消操作'); |
| | | //done(); |
| | | }); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | |
| | | console.log('searchChange', params); |
| | | params.createTimeBegin = params?.processCreateTime?.[0] || ''; |
| | | params.createTimeEnd = params?.processCreateTime?.[1] || ''; |
| | | console.log(params); |
| | | // data = { |
| | | // createTimeBegin: dayjs(params.createTimeBegin).isValid() ? dayjs(params.createTimeBegin).format('YYYY-MM-DD') : '', |
| | | // createTimeEnd: dayjs(params.createTimeEnd).isValid() ? dayjs(params.createTimeEnd).format('YYYY-MM-DD') : '', |
| | | // keyword: params.keyword || '' |
| | | // } |
| | | |
| | | data = { |
| | | createTimeBegin: params.createTimeBegin, |
| | | createTimeEnd: params.createTimeEnd, |
| | | keyword: params.keyword || '' |
| | | keyword: params.keyword || '', |
| | | status: params.status || 0 |
| | | } |
| | | this.query = data |
| | | this.onLoad(this.page, data); |
| | | done(); |
| | | }, |
| | | searchReset () { |
| | | this.loading = true; |
| | | this.form = {}; |
| | | this.getList(); |
| | | this.getDoneList(); |
| | | }, |
| | | sizeChange() { |
| | | this.loading = true; |
| | | this.getList(); |
| | | |
| | | this.getDoneList(); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | onLoad(page, params = {},done) { |
| | | const query = { |
| | | ...this.query, |
| | | // category: params.category ? flowCategory(params.category) : null, |
| | |
| | | console.error('日期格式化错误', error); |
| | | } |
| | | |
| | | this.loading = true; |
| | | //this.loading = true; |
| | | getDoneList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | if(done){ |
| | | done(); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | }, |
| | | computed: { |
| | | |
| | | ...mapGetters(['userInfo', 'permission']), |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss"> |
| | | .margin0 { |
| | | margin: 0 |
| | | } |
| | | .viewRowForm .el-form-item--default { |
| | | margin-bottom: 0 |
| | | } |
| | | </style> |