From d6863f0b1490a527e5b02b99e859035b86ea088d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 08 八月 2025 11:45:08 +0800
Subject: [PATCH] 1.协同审批-提交审核是添加电子签名 2.添加薪资管理页面

---
 src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue |   62 +++++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
index 847f4c4..584a6c2 100644
--- a/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
+++ b/src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -116,17 +116,34 @@
       </el-form>
       <template #footer v-if="operationType === 'approval'">
         <div class="dialog-footer">
-          <el-button type="primary" @click="submitForm(2)">涓嶉�氳繃</el-button>
-          <el-button type="primary" @click="submitForm(1)">閫氳繃</el-button>
+          <el-button type="primary" @click="openSignatureDialog(2)">涓嶉�氳繃</el-button>
+          <el-button type="primary" @click="openSignatureDialog(1)">閫氳繃</el-button>
           <el-button @click="closeDia">鍙栨秷</el-button>
         </div>
       </template>
+    </el-dialog>
+    <!-- 鐢靛瓙绛惧悕寮圭獥锛坴ue3-signature-pad锛� -->
+    <el-dialog v-model="signatureDialogVisible" title="鐢靛瓙绛惧悕" width="600px" append-to-body>
+			<vueEsign
+				ref="esign"
+				class="mySign"
+				:width="800"
+				:height="300"
+				:isCrop="isCrop"
+				:lineWidth="lineWidth"
+				:lineColor="lineColor"
+			/>
+      <div style="margin-top:10px;">
+        <el-button @click="clearSignature">娓呴櫎</el-button>
+        <el-button type="primary" @click="confirmSignature">纭畾</el-button>
+      </div>
     </el-dialog>
   </div>
 </template>
 
 <script setup>
-import {getCurrentInstance, reactive, ref, toRefs} from "vue";
+import { getCurrentInstance, reactive, ref, toRefs } from "vue";
+import vueEsign from "vue-esign";
 import {
 	approveProcessDetails,
 	getDept,
@@ -156,6 +173,14 @@
 	},
 });
 const { form } = toRefs(data);
+const signatureDialogVisible = ref(false);
+const signatureImg = ref('');
+let submitStatus = null; // 涓存椂瀛樺偍閫氳繃/涓嶉�氳繃鐘舵��
+const isCrop = ref("");
+const esign = ref(null);
+const lineWidth = ref(0);
+const lineColor = ref("#000000");
+
 // 鑺傜偣鏍囬
 const getNodeTitle = (index, len) => {
   if (index === len - 1) return '缁撴潫';
@@ -205,17 +230,40 @@
 		productOptions.value = res.data;
 	});
 };
+// 鎵撳紑绛惧悕寮圭獥
+const openSignatureDialog = (status) => {
+  submitStatus = status;
+  signatureDialogVisible.value = true;
+};
+// 娓呴櫎绛惧悕
+const clearSignature = () => {
+	esign.value.reset();
+};
+// 纭绛惧悕
+const confirmSignature = () => {
+	esign.value.generate().then((res) => {
+		console.log(res);
+		signatureImg.value = res;
+		signatureDialogVisible.value = false;
+		clearSignature()
+		submitForm(submitStatus);
+	}).catch((err) => {
+		console.log(err);
+		proxy.$modal.msgWarning("璇峰厛绛惧悕锛�");
+	})
+};
 // 鎻愪氦瀹℃壒
 const submitForm = (status) => {
   const filteredActivities = activities.value.filter(activity => activity.isShen);
-  filteredActivities[0].approveNodeStatus = status
+  filteredActivities[0].approveNodeStatus = status;
+  filteredActivities[0].signatureImg = signatureImg.value; // 鏂板绛惧悕鍥剧墖瀛楁
   // 鍒ゆ柇鏄惁涓烘渶鍚庝竴姝�
   const isLast = activities.value.findIndex(a => a.isShen) === activities.value.length-1;
-  updateApproveNode({ ...filteredActivities[0], isLast }).then(() => {
+  updateApproveNode({ ...filteredActivities[0], isLast, signatureImg: signatureImg.value }).then(() => {
     proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
     closeDia();
-  })
-}
+  });
+};
 // 鍏抽棴寮规
 const closeDia = () => {
   proxy.resetForm("formRef");

--
Gitblit v1.9.3