From 5e440a7dc434c43eb828fa62cf9c12b0078b8565 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期一, 20 一月 2025 11:36:18 +0800
Subject: [PATCH] !173 发布 5.3.0-BETA 公测版本 Merge pull request !173 from 疯狂的狮子Li/dev

---
 src/views/workflow/leave/leaveEdit.vue |   70 +++++++++++++++++++++++++++++++---
 1 files changed, 63 insertions(+), 7 deletions(-)

diff --git a/src/views/workflow/leave/leaveEdit.vue b/src/views/workflow/leave/leaveEdit.vue
index 55556fd..8ef66a5 100644
--- a/src/views/workflow/leave/leaveEdit.vue
+++ b/src/views/workflow/leave/leaveEdit.vue
@@ -44,6 +44,17 @@
     <submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
     <!-- 瀹℃壒璁板綍 -->
     <approvalRecord ref="approvalRecordRef" />
+    <el-dialog v-model="dialogVisible.visible" :title="dialogVisible.title" :before-close="handleClose" width="500">
+      <el-select v-model="flowCode" placeholder="Select" style="width: 240px">
+        <el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
+      </el-select>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="handleClose">鍙栨秷</el-button>
+          <el-button type="primary" @click="submitFlow()"> 纭 </el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -80,6 +91,35 @@
     label: '濠氬亣'
   }
 ];
+const flowCodeOptions = [
+  {
+    value: 'leave1',
+    label: '璇峰亣鐢宠-鏅��'
+  },
+  {
+    value: 'leave2',
+    label: '璇峰亣鐢宠-鎺掍粬缃戝叧'
+  },
+  {
+    value: 'leave3',
+    label: '璇峰亣鐢宠-骞惰缃戝叧'
+  },
+  {
+    value: 'leave4',
+    label: '璇峰亣鐢宠-浼氱'
+  },
+  {
+    value: 'leave5',
+    label: '璇峰亣鐢宠-骞惰浼氱缃戝叧'
+  }
+];
+
+const flowCode = ref<string>('');
+
+const dialogVisible = reactive<DialogOption>({
+  visible: false,
+  title: '娴佺▼瀹氫箟'
+});
 //鎻愪氦缁勪欢
 const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
 //瀹℃壒璁板綍缁勪欢
@@ -88,8 +128,8 @@
 const leaveFormRef = ref<ElFormInstance>();
 
 const submitFormData = ref<StartProcessBo>({
-  businessKey: '',
-  tableName: '',
+  businessId: '',
+  flowCode: '',
   variables: {}
 });
 const taskVariables = ref<Record<string, any>>({});
@@ -119,6 +159,11 @@
   }
 });
 
+const handleClose = () => {
+  dialogVisible.visible = false;
+  flowCode.value = '';
+  buttonLoading.value = false;
+};
 const { form, rules } = toRefs(data);
 
 /** 琛ㄥ崟閲嶇疆 */
@@ -174,6 +219,15 @@
           proxy.$tab.closePage(proxy.$route);
           proxy.$router.go(-1);
         } else {
+          if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
+            flowCode.value = flowCodeOptions[0].value;
+            dialogVisible.visible = true;
+            return;
+          }
+          //璇存槑鍚姩杩囧厛闅忔剰绌夸釜鍙傛暟
+          if (flowCode.value === '' || flowCode.value === null) {
+            flowCode.value = 'xx';
+          }
           await handleStartWorkFlow(res.data);
         }
       }
@@ -183,17 +237,19 @@
   }
 };
 
+const submitFlow = async () => {
+  handleStartWorkFlow(form.value);
+  dialogVisible.visible = false;
+};
 //鎻愪氦鐢宠
 const handleStartWorkFlow = async (data: LeaveVO) => {
   try {
-    submitFormData.value.tableName = 'test_leave';
-    submitFormData.value.businessKey = data.id;
+    submitFormData.value.flowCode = flowCode.value;
+    submitFormData.value.businessId = data.id;
     //娴佺▼鍙橀噺
     taskVariables.value = {
-      entity: data,
       leaveDays: data.leaveDays,
-      userList: ["1", "3"],
-      userList2: ["1", "3"]
+      userList: ['1', '3', '4']
     };
     submitFormData.value.variables = taskVariables.value;
     const resp = await startWorkFlow(submitFormData.value);

--
Gitblit v1.9.3