From 176e2a7c4c276fca640eb05c3df1fb28f0a710ea Mon Sep 17 00:00:00 2001
From: 李喆(开发组) <lzhe@yxqiche.com>
Date: 星期一, 11 八月 2025 14:57:20 +0800
Subject: [PATCH] Merge branch 'master' of http://www.beijingsoft.cn:9090/r/mdmweb
---
src/views/flowmgr/processQuery.vue | 561 +++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 495 insertions(+), 66 deletions(-)
diff --git a/src/views/flowmgr/processQuery.vue b/src/views/flowmgr/processQuery.vue
index db902c0..9166426 100644
--- a/src/views/flowmgr/processQuery.vue
+++ b/src/views/flowmgr/processQuery.vue
@@ -1,39 +1,71 @@
<!--
* @Date: 2025-06-18 09:17:09
* @LastEditors: gaoshp
- * @LastEditTime: 2025-07-20 20:48:15
+ * @LastEditTime: 2025-08-09 20:55:52
* @FilePath: /mdmweb/src/views/flowmgr/processQuery.vue
-->
<template>
<basic-container>
<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" @selection-change="selectionChange">
+ @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
+ @selection-change="selectionChange">
+ <template slot="view" slot-scope="{ row }">
+ <div class="custom-view-footer">
+ <p>杩欐槸鑷畾涔夌殑搴曢儴鍐呭</p>
+ <p>褰撳墠琛屾暟鎹細{{ row }}</p>
+ </div>
+ </template>
<template #menu-left>
<!-- <el-button type="primary" plain @click="exportWebSite">瀵煎嚭鍥炰紶娑夊瘑缃�</el-button> -->
<!-- <el-button type="primary" plain @click="reassign">鎸傝浇杞﹀簥绋嬪簭搴�</el-button> -->
<!-- <el-button type="primary" plain @click="exportExcel">瀵煎嚭鍒癊XCEL</el-button> -->
- </template>
- <template #menu="scope">
- <el-button type="danger" text size="default"
- @click.stop="handleAction(scope.row, scope.index, 0)">鍒犻櫎
+ <el-button type="primary" plain @click="reassign">閲嶆柊鎸囨淳
</el-button>
</template>
+ <template #menu="scope">
+ <el-button type="primary" text size="default" @click.stop="customView(scope.row, scope.index, 0)">鏌ョ湅
+ </el-button>
+ <el-button type="primary" text size="default" v-if="scope.row.processDefinitionKey === 'dispatch'"
+ @click.stop="handleAction(scope.row, scope.index, 1)">瀹℃壒琛ㄦ墦鍗�
+ </el-button>
+ <el-button type="danger" text size="default" @click.stop="handleAction(scope.row, scope.index, 0)">鍒犻櫎
+ </el-button>
+
+ </template>
</avue-crud>
+ <el-dialog title="鎸囨淳" append-to-body v-model="reassignBox" width="30%">
+ <avue-form ref="reassginform" :option="reassignOption" v-model="reassignForm"
+ @submit="toPerson"></avue-form>
+ </el-dialog>
+
+ <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 { getList, deleteRow } from '@/api/flowmgr/processQuery.js';
-import { exportBlob } from '@/api/common';
-import { getToken } from '@/utils/auth';
+import { getList, deleteRow, printRow } from '@/api/flowmgr/processQuery.js';
+import { getAssignee, reassgin } from '@/api/flow/todolist';
+import { exportBlobPost } from '@/api/common';
import NProgress from 'nprogress';
-import { downloadXls } from '@/utils/util';
+import { downloadFile } from '@/utils/util';
import 'nprogress/nprogress.css';
+
export default {
name: 'MachineReturnFileOp',
data() {
return {
+ tableData: [],
+ viewRow: {},
page: {
pageSize: 10,
currentPage: 1,
@@ -47,32 +79,32 @@
addBtn: false,
editBtn: false,
delBtn: false,
- viewBtn: true,
+ viewBtn: false,
columnBtn: false,
tip: false,
// simplePage: true,
searchShow: true,
- searchMenuSpan: 6,
- dialogWidth: '60%',
+ searchMenuSpan: 7,
+ dialogWidth: '70%',
// tree: true,
border: true,
index: true,
selection: true,
-
+
menuWidth: 200,
// menu: false,
dialogClickModal: false,
column: [
{
label: '娴佺▼绫诲瀷',
- prop: '',
+ prop: 'processDefinitionKey',
search: true,
searchType: 'select',
hide: true,
- dicUrl: `/blade-system/dict/dictionary?code=flow`,
+ dicUrl: `/blade-mdm/system/dict/dictionary?code=flow`,
props: {
label: 'dictValue',
- value: 'dictKey',
+ value: 'remark',
},
},
{
@@ -91,34 +123,150 @@
search: true,
searchType: 'input',
hide: true,
+ viewDisplay: false,
+ },
+ {
+ label: '鏍囬',
+ prop: 'variables.title',
+ width: 150,
+ render: ({ row }) => {
+ return h('p',
+ {
+ attrs: {},
+ class: {},
+ style: {},
+ }, row?.variables?.title)
+ },
+ renderForm: ({ row }) => {
+ return h('span', {
+ attrs: {},
+ class: {},
+ style: {},
+ }, row?.variables?.title || '');
+ }
+ },
+ {
+ label: '娴佺▼鍚嶇О',
+ prop: 'processDefinitionName',
+ width: 80,
},
{
- label: '娴佺▼妯$増',
- prop: '',
+ label: '宸ヨ壓鐗堟',
+ prop: 'variables.craftEdition',
+ width: 80,
+ render: ({ row }) => {
+ return h('span', {}, row?.variables?.craftEdition || '');
+ }
},
+ {
+ label: '宸ュ簭鍙�',
+ prop: 'processNo',
+ width: 80,
+ render: ({ row }) => {
+ return h('span', {}, row?.variables?.processNo || '');
+ }
+ },
+ {
+ label: '宸ュ簭鍚嶇О',
+ prop: 'processName',
+ width: 80,
+ render: ({ row }) => {
+ return h('span', {}, row?.variables?.processName || '');
+ }
+ },
+ {
+ label: '宸ュ簭鐗堟',
+ prop: 'processEdition',
+ width: 80,
+ render: ({ row }) => {
+ return h('span', {}, row?.variables?.processEdition || '');
+ }
+ },
+ {
+ label: '闆剁粍浠跺彿',
+ prop: 'drawingNo',
+ width: 80,
+ render: ({ row }) => {
+ return h('span', {}, row?.variables?.drawingNo || '');
+ }
+ },
+ {
+ label: '浠诲姟杞﹂棿',
+ prop: 'workshop',
+ width: 80,
+ render: ({ row }) => {
+ return h('p',{'class': 'margin0'}, row?.variables?.workshop || '');
+ }
+ },
+ {
+ label: '杩囩▼鍗″彿',
+ prop: 'empty',
+ width: 80,
+ },
+ {
+ label: '鍥惧彿',
+ prop: '',
+ width: 100,
+ render: ({ row }) => {
+ return h('p',
+ {
+ attrs: {},
+ class: {},
+ style: {},
+ }, row?.variables?.drawingNo)
+ },
+ renderForm: ({ row }) => {
+ return h('span', {
+ attrs: {},
+ class: {},
+ style: {},
+ }, row?.variables?.drawingNo || '');
+ }
+ },
+ {
+ label: '浜у搧鍨嬪彿',
+ prop: '',
+ width: 100,
+ render: ({ row }) => {
+ return h('p',
+ {
+ attrs: {},
+ class: {},
+ style: {},
+ }, row?.variables?.productModel)
+ },
+ renderForm: ({ row }) => {
+ return h('span', {
+ attrs: {},
+ class: {},
+ style: {},
+ }, row?.variables?.productModel || '');
+ }
+ },
+
{
label: '鏈哄簥',
prop: '',
- },
- {
- label: '鏍囬',
- prop: '',
+ render: ({ row }) => {
+ return h('p',
+ {
+ attrs: {},
+ class: {},
+ style: {},
+ }, row?.variables?.machineCode)
+ },
+ renderForm: ({ row }) => {
+ return h('span', {
+ attrs: {},
+ class: {},
+ style: {},
+ }, row?.variables?.machineCode || '');
+ }
},
{
label: '鍒涘缓浜�',
prop: 'startUserName',
- },
- {
- label: '缂栧埗',
- prop: '',
- },
- {
- label: '宸ュ簭鍚嶇О',
- prop: '',
- },
- {
- label: '鍔犲伐杞﹂棿',
- prop: '',
+ width: 80,
},
{
label: '鍒涘缓鏃堕棿',
@@ -127,26 +275,296 @@
{
label: '褰撳墠鑺傜偣',
prop: 'taskName',
+ width: 90
+ },
+ {
+ label: '璁″垝鍔犲伐鏃堕棿',
+ prop: 'planStartTime',
+ width: 180,
+ render: ({ row }) => {
+ return h('span', {}, row?.variables?.planStartTime || '');
+ }
+ },
+ {
+ label: '绋嬪簭鍖呭悕',
+ prop: 'programPackageName',
+ width: 80,
+ render: ({ row }) => {
+ return h('span', {}, row?.variables?.programPackageName || '');
+ }
},
],
- selectedList: [],
- }
+ },
+ 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: 'empty',
+ render: ({ row }) => {
+ return h('p',{'class': 'margin0'}, row?.variables?.empty || '');
+ }
+ },
+ {
+ 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 || '');
+ }
+ },
+ ],
+ },
+ selectedList: [],
+ dialogVisible: false,
+ reassignBox: false,
+ reassignForm: {},
+ reassignOption: {
+ submitBtn: true,
+ emptyBtn: false,
+ column: [
+ {
+ label: '鍙戦�佺粰',
+ prop: 'newAssigneeId',
+ type: 'select',
+ // dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`,
+ // dicFlag: true,
+ props: {
+ label: 'name',
+ value: 'id',
+ },
+ span: 24,
+ disabled: false,
+ dicData: [
+
+ ],
+ rules: [{ required: true, message: '璇疯緭鍏ラ�夋嫨', trigger: 'blur' }],
+ },
+ {
+ label: '澶囨敞',
+ span: 24,
+ prop: 'comment',
+ type: 'textarea',
+ rules: [{ required: true, message: '璇疯緭鍏ュ鎵规剰瑙�', trigger: 'blur' }],
+ },
+ ],
+ },
}
},
+ mounted() {
+ getAssignee().then(res => {
+ this.reassignOption.column[0].dicData = res.data.data;
+ })
+ },
methods: {
- handleAction (row, index, flag) {
- // 澶勭悊鎺ュ彈鎴栨嫆缁濇搷浣�
- let ids = [row.id].toString();
- this.$confirm('纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?', {
- confirmButtonText: '纭畾',
- cancelButtonText: '鍙栨秷',
- type: 'warning',
- })
- .then(() => {
- deleteRow({processInstanceId: row.processInstanceId})
- })
+ customView(row) {
+ 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;
},
- selectionChange (list) {
+ reassign() {// 閲嶆柊鎸囨淳
+ console.log(this.selectedList.length)
+ if (this.selectedList.length === 0) {
+ this.$message.warning('璇烽�夋嫨闇�瑕侀噸鏂版寚娲剧殑浠诲姟');
+ return;
+ }
+ if (this.selectedList.length > 1) {
+ this.$message.warning('璇烽�夋嫨涓�鏉�');
+ return;
+ }
+ this.reassignBox = true;
+ },
+ toPerson(form, done) {
+ this.$confirm('璇风‘璁ゆ槸鍚︽寚娲�', '', {
+ confirmButtonText: this.$t('submitText'),
+ cancelButtonText: this.$t('cancelText'),
+ type: 'warning',
+ }).then(() => {
+ console.log('toPerson', form);
+ reassgin({
+ ...form,
+ taskId: this.selectedList[0].taskId,
+ processInstanceId: this.selectedList[0].processInstanceId,
+ }).then(res => {
+ this.$message.success('鎸囨淳鎴愬姛');
+ this.reassignBox = false;
+ this.$refs?.reassginform?.resetForm();
+ this.onLoad(this.page, this.query);
+
+ }).catch(err => {
+ console.error(err);
+ })
+ });
+ done();
+ },
+ handleAction(row, index, flag) {
+ if (flag === 0) {
+ // 澶勭悊鎺ュ彈鎴栨嫆缁濇搷浣�
+ let ids = [row.id].toString();
+ this.$confirm('纭畾灏嗛�夋嫨鏁版嵁鍒犻櫎?', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ })
+ .then(() => {
+ deleteRow({ processInstanceId: row.processInstanceId,id:row.processInstanceId }).then(res => {
+ this.onLoad(this.page, this.query);
+ })
+ })
+ } else if (flag === 1) {
+ printRow({ processInstanceId: row.processInstanceId })
+ this.$confirm('鏄惁瀵煎嚭?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ console.log(this.selection)
+ NProgress.start();
+ exportBlobPost(
+ `/blade-mdm/flow/mgr/export-approve-table`,
+ { processInstanceId: row.processInstanceId },
+ { processInstanceId: row.processInstanceId },
+ ).then(res => {
+ let name = res.headers['content-disposition'].split('filename=')[1]
+ console.log(res.headers['content-disposition'].split('filename=')[1]);
+ downloadFile(res.data, `瀹℃壒鎵撳嵃-${name}`);
+ NProgress.done();
+ });
+ });
+ }
+
+ },
+ selectionChange(list) {
+ console.log('selectionChange', list);
this.selectedList = list;
},
// exportWebSite() {
@@ -204,8 +622,10 @@
// keyword: params.keyword || ''
// }
data = {
- createTimeBegin: params.createTimeBegin,
- createTimeEnd: params.createTimeEnd,
+ createTimeBegin: params.createTimeBegin || undefined,
+ createTimeEnd: params.createTimeEnd || undefined,
+ keyword: params.keyword || undefined,
+ processDefinitionKey: params.processDefinitionKey || undefined
}
this.query = data
this.onLoad(this.page, data);
@@ -213,12 +633,13 @@
},
searchReset() {
let data = {}
- this.query = params;
+ this.query = data;
this.page.currentPage = 1;
data = {
createTimeBegin: params.createTimeBegin,
createTimeEnd: params.createTimeEnd,
- keyword: params.keyword || ''
+ keyword: params.keyword || '',
+ processDefinitionKey: params.processDefinitionKey || ''
}
this.onLoad(this.page, data);
done();
@@ -237,22 +658,23 @@
*/
onLoad(page, params = {}) {
console.log('onLoad', page, params);
- const query = {
+ const data = {
...this.query,
- // category: params.category ? flowCategory(params.category) : null,
- mode: this.mode,
+ createTimeBegin: params.createTimeBegin,
+ createTimeEnd: params.createTimeEnd,
+ keyword: params.keyword || '',
+ processDefinitionKey: params.processDefinitionKey || ''
};
- try {
- delete query.confirmTime; // 鍒犻櫎涓嶅繀瑕佺殑鏌ヨ鏉′欢
- } catch (error) {
- console.error('鏃ユ湡鏍煎紡鍖栭敊璇�', error);
- }
-
this.loading = true;
- getList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => {
- const data = res.data.data;
+ getList(page.currentPage, page.pageSize, Object.assign(data, params)).then(res => {
+ const data = res.data.data
this.page.total = data.total;
- this.data = data.records;
+ this.data = data.records.map(v=> {
+ return {
+ ...v,
+ id: v.processInstanceId,
+ }
+ });
this.loading = false;
}, () => {
this.data = [];
@@ -266,4 +688,11 @@
};
</script>
-<style lang="scss" scoped></style>
\ No newline at end of file
+<style lang="scss">
+.margin0 {
+ margin: 0
+}
+.viewRowForm .el-form-item--default {
+ margin-bottom: 0
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3