| | |
| | | @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" v-if="permission.withdraw_button" text size="default" @click.stop="handleWithdraw(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> |
| | |
| | | </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, |
| | |
| | | } |
| | | }, |
| | | { |
| | | label: '工艺版次', |
| | | label: '批次号', |
| | | prop: 'variables.craftEdition', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.craftEdition || ''); |
| | |
| | | }, |
| | | { |
| | | label: '过程卡号', |
| | | prop: 'empty', |
| | | prop: '', |
| | | render: ({ row }) => { |
| | | return h('p',{'class': 'margin0'}, row?.variables?.empty || ''); |
| | | return h('p',{'class': 'margin0'}, row?.variables?.processCard || ''); |
| | | } |
| | | }, |
| | | { |
| | |
| | | search: true, |
| | | searchType: 'input', |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: '状态', |
| | | prop: 'status', |
| | | //cleerable:true, |
| | | search: true, |
| | | type: 'select', |
| | | dicData: [ |
| | | { |
| | | label: '涉密网程序', |
| | | value: 1, |
| | | label:'进行中', |
| | | value:'1' |
| | | }, |
| | | { |
| | | label: '工控网车床程序', |
| | | value: 2, |
| | | label:'已结束', |
| | | value:'2' |
| | | }, |
| | | ], |
| | | labelKey: 'label', |
| | | |
| | | span: "8" |
| | | }, |
| | | { |
| | | label: '标题', |
| | |
| | | type: 'datetime', |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | sortable:true, |
| | | search: false, |
| | | searchRange: true, |
| | | searchSpan: 8, |
| | |
| | | }); |
| | | 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('确认要撤回吗?', '', { |
| | |
| | | return; |
| | | } |
| | | this.$message.success('操作成功'); |
| | | |
| | | todoChangeNotify(); |
| | | |
| | | this.refreshChange(); |
| | | }).catch(err => { |
| | | console.error(err); |
| | | done() |
| | | //done() |
| | | }); |
| | | |
| | | }).catch(() => { |
| | | console.log('>>>>>>') |
| | | // this.$message.info('已取消操作'); |
| | | done(); |
| | | //done(); |
| | | }); |
| | | }, |
| | | currentChange(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(); |
| | | } |
| | | }); |
| | | }, |
| | | at1(){ |
| | | console.log('computed') |
| | | } |
| | | |
| | | }, |
| | | computed: { |