From d762a77d9238eef17c66c35b06955fca20160043 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期二, 02 九月 2025 19:53:25 +0800
Subject: [PATCH] 表单未清空修复

---
 src/views/flow/donelist.vue |  296 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 267 insertions(+), 29 deletions(-)

diff --git a/src/views/flow/donelist.vue b/src/views/flow/donelist.vue
index 0cb4854..7eb8aa7 100644
--- a/src/views/flow/donelist.vue
+++ b/src/views/flow/donelist.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2025-08-10 14:23:00
  * @LastEditors: gaoshp
- * @LastEditTime: 2025-08-10 14:48:40
+ * @LastEditTime: 2025-08-10 15:46:14
  * @FilePath: /mdmweb/src/views/flow/donelist.vue
 -->
 <template>
@@ -9,30 +9,194 @@
         <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.flag.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 { getList} from '@/api/flow/todolist';
+import { getDoneList,todoChangeNotify} from '@/api/flow/todolist';
 import { mapGetters } from 'vuex';
 export default {
     data() {
         return {
+            tableData: [],
+            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 || '');
+                        }
+                    },
+                ],
+            },
+            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,
-                menuWidth: 100,
+                menu: true,
+                menuWidth: 120,
                 column: [
                     {
                         label: '鍏抽敭瀛�',
@@ -55,7 +219,7 @@
 					{
                         label: '鏍囬',
                         prop: '',
-                        width: 100,
+                        width: 200,
 						render: ({ row }) => {
                             return h('p',
                                 {
@@ -67,8 +231,16 @@
                     },
                     {
                         label: '娴佺▼鍚嶇О',
-                        prop: 'processDefinitionName',
+                        prop: '',
                         width: 100,
+						render: ({ row }) => {
+                            return h('p',
+                                {
+                                    attrs: {},
+                                    class: {},
+                                    style: {},
+                                }, row?.variables?.myProcessName)
+                        }
                     },/*
                     {
                         label: '娴佺▼绫诲瀷',
@@ -91,7 +263,7 @@
                     },
                     {
                         label: '鍒涘缓鏃堕棿',
-                        width: 200,
+                        width: 100,
                         prop: 'processCreateTime',
                         type: 'datetime',
                         format: 'YYYY-MM-DD HH:mm:ss',
@@ -102,16 +274,33 @@
                         // hide: true,
                     },
                     {
-                        label: '涓婁竴姝ョ敤鎴�',
-                        width: 200,
-                        prop: '',
-                        formatter: (val, value, label) => {
-                            return `${val?.variables?.approveUserNickName || ''}`;
-                        },
+                        label: '寮�濮嬫椂闂�',
+                        width: 100,
+                        prop: 'createTime',
+                        type: 'datetime',
+                        format: 'YYYY-MM-DD HH:mm:ss',
+                        valueFormat: 'YYYY-MM-DD HH:mm:ss',
+                        search: false,
+                        searchRange: true,
+                        searchSpan: 8,
+                        // hide: true,
                     },
                     {
-                        label: '褰撳墠鑺傜偣',
-                        width: 200,
+                        label: '缁撴潫鏃堕棿',
+                        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,
+                        // hide: true,
+                    },
+                    {
+                        label: '浠诲姟鍚嶇О',
+                        width: 100,
                         prop: 'taskName',
                     },
                     {
@@ -119,17 +308,6 @@
                         width: 200,
                         prop: 'file',
                     },
-                    {
-                        label: '鍒拌揪鏃堕棿',
-                        width: 200,
-                        prop: 'createTime',
-                    },
-                    {
-                        label: '鍒拌揪鎻忚堪',
-                        width: 200,
-                        prop: 'comment',
-                    },
-
                 ],
             },
             page: {
@@ -142,6 +320,51 @@
         }
     },
     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;
+        },
+        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;
         },
@@ -152,7 +375,7 @@
             console.log('searchChange', params);
             params.createTimeBegin = params?.processCreateTime?.[0] || '';
             params.createTimeEnd = params?.processCreateTime?.[1] || '';
-            console.log(params);
+            //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') : '',
@@ -165,7 +388,7 @@
             }
             this.query = data
             this.onLoad(this.page, data);
-            done();
+            //done();
         },
         searchReset () {
             this.loading = true;
@@ -174,7 +397,7 @@
         },
         sizeChange() {
             this.loading = true;
-        this.getList(); 
+            this.getList(); 
         },
         refreshChange() {
             this.onLoad(this.page, this.query);
@@ -191,14 +414,29 @@
             }
 
             this.loading = true;
-            getList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => {
+            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;
             });
         },
+        at1(){
+            console.log('computed')
+        }
         
+    },
+    computed: {
+       
+        ...mapGetters(['userInfo', 'permission']),
     }
 }
 </script>
+<style lang="scss">
+.margin0 {
+    margin: 0
+}
+.viewRowForm .el-form-item--default {
+    margin-bottom: 0
+}
+</style>

--
Gitblit v1.9.3