From ba8323742a8a398b0ed0b28ecbffc3bed961e959 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Tue, 27 Jan 2026 18:02:05 +0800
Subject: [PATCH] feat:更新工单

---
 applications/task-work-order/src/views/orderView/flyingHand/FlyingHandDialog.vue |   36 +++++++++++++++++++++++++++---------
 1 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/applications/task-work-order/src/views/orderView/flyingHand/FlyingHandDialog.vue b/applications/task-work-order/src/views/orderView/flyingHand/FlyingHandDialog.vue
index 4566740..d0cc686 100644
--- a/applications/task-work-order/src/views/orderView/flyingHand/FlyingHandDialog.vue
+++ b/applications/task-work-order/src/views/orderView/flyingHand/FlyingHandDialog.vue
@@ -199,7 +199,8 @@
 })
 
 const formRef = ref(null)
-const formData = reactive({
+
+const initForm = () => ({
 	flyerName: '',
 	flyerId: '',
 	flyerPhone: '',
@@ -208,7 +209,22 @@
 	technicalStrength: '',
 	skilledUavType: '',
 	certification: [], // 证书
+	regionCode: '', // 区域编码
 })
+
+const formData = ref(initForm()) // 表单数据
+
+
+// const rules = {
+// 	flyerId: fieldRules(true),
+// 	flyerPhone: fieldRules(true, 50),
+// 	flightHours: fieldRules(true, 50),
+// 	technicalSkills: fieldRules(true, 50),
+// 	skilledTaskType: fieldRules(true),
+// 	projectExperience: fieldRules(true),
+// 	technicalStrength: fieldRules(true),
+// 	skilledUavType: fieldRules(true, 50),
+// }
 
 const rules = {
 	flyerId: [
@@ -243,10 +259,11 @@
 watch(
 	() => props.flyingHandData,
 	(newData) => {
+		formData.value = initForm()
 		if (newData) {
-			Object.assign(formData, newData)
-			formData.flightHours = Number(newData.flightHours)
-		}
+			Object.assign(formData.value, newData)
+			formData.value.flightHours = Number(newData.flightHours)
+		} 
 	},
 	{ deep: true, immediate: true }
 )
@@ -260,8 +277,9 @@
 // 处理选择飞手姓名
 function handleChange(val) {
 	const result = flyingHandList.value.find(item => item.id === val) || []
-	formData.flyerName = result.name
-	formData.certification = formData.certification.concat(result.licenseFrontFileUrl || [], result.licenseBackFileUrl || [])
+	formData.value.flyerName = result.name
+	formData.value.regionCode = result.regionCode
+	formData.value.certification = formData.value.certification.concat(result.licenseFrontFileUrl || [], result.licenseBackFileUrl || [])
 }
 
 
@@ -270,7 +288,7 @@
 function resetForm() {
 	formRef.value?.resetFields()
 	// 重置为默认值
-	Object.assign(formData, {
+	Object.assign(formData.value, {
 		flyerName: '',
 		flyerPhone: '',
 		flightHours: 0,
@@ -290,10 +308,10 @@
 
 	try {
 		if (props.dialogType === 'add') {
-			await submitFlyingHand(formData)
+			await submitFlyingHand(formData.value)
 			ElMessage.success('添加成功')
 		} else if (props.dialogType === 'edit') {
-			await submitFlyingHand(formData)
+			await submitFlyingHand(formData.value)
 			ElMessage.success('编辑成功')
 		}
 		emit('confirm')

--
Gitblit v1.9.3