From 372b7fa2b732665db81b3487c63127ab3a20f29d Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Tue, 03 Feb 2026 17:17:55 +0800
Subject: [PATCH] feat:更新小程序

---
 uniapps/work-wx/src/subPackages/deviceRegistration/add.vue     |    6 +++---
 uniapps/work-wx/src/subPackages/flightApplication/add.vue      |   22 ++++++++++++----------
 uniapps/work-wx/src/subPackages/deviceRegistration/details.vue |   31 ++++++++++++++++++++++---------
 3 files changed, 37 insertions(+), 22 deletions(-)

diff --git a/uniapps/work-wx/src/subPackages/deviceRegistration/add.vue b/uniapps/work-wx/src/subPackages/deviceRegistration/add.vue
index 6541906..08034e4 100644
--- a/uniapps/work-wx/src/subPackages/deviceRegistration/add.vue
+++ b/uniapps/work-wx/src/subPackages/deviceRegistration/add.vue
@@ -258,7 +258,7 @@
             </view>
                 <u-radio-group
                 v-if="!loadingManufacturer"
-                    v-model="formParams.spacecraftId"
+                    v-model="formParams.manufacturer"
                     placement="column"
                     @change="radioChange"
                 >
@@ -426,7 +426,7 @@
     formParams.value.region = e[2] || '' // 用逗号分隔的区域码
     // 通过arrRegion的数组值为[36,3608,360824] 从areaData里面反查出名称
     const regionNames = findRegionNamesByCodes(e, areaData.value)
-    formParams.value.regionText = regionNames.join('-') || '' // 用连字符连接的区域名称
+    formParams.value.regionText = regionNames.join(',') || '' // 用连字符连接的区域名称
     isShowRegion.value = false
 }
 // 是否有保险
@@ -671,7 +671,7 @@
     // 检查响应
     if (response.statusCode === 200) {
         areaData.value = response.data
-        console.log('请求成功:', data)
+        // console.log('请求成功:', data)
         // 处理数据
     } else {
         console.error('请求失败:', response)
diff --git a/uniapps/work-wx/src/subPackages/deviceRegistration/details.vue b/uniapps/work-wx/src/subPackages/deviceRegistration/details.vue
index e10db1d..8bc3a92 100644
--- a/uniapps/work-wx/src/subPackages/deviceRegistration/details.vue
+++ b/uniapps/work-wx/src/subPackages/deviceRegistration/details.vue
@@ -313,12 +313,6 @@
         current: 1,
         size: 1000,
     }).then(res => {
-        // manufacturerList.value = res.data.data.records.map(item => ({
-        //     ...item,
-        //     label: item.unitName,
-        //     value: item.id,
-        // }))
-        console.log(formParams.value.manufacturer, res.data.data.records.find(item => item.id === formParams.value.manufacturer))
         formParams.value.manufacturerText = res.data.data.records.find(item => item.id === formParams.value.manufacturer)?.unitName || ''
     })
 }
@@ -329,7 +323,9 @@
         formParams.value.hasInsurance = res.data.data.hasInsurance === '1' ? '有' : '无'
         // formParams.value.manufacturer = manufacturerList.value.find(item => item.value === res.data.data.manufacturer)?.label || ''
         formParams.value.type = typeList.value.find(item => item.value === res.data.data.type)?.label || ''
-        formParams.value.region = res.data.data.region
+        // formParams.value.region = res.data.data.region
+        // 360824 截取留前两位 3608 截取留前四位
+        formParams.value.region = findRegionNamesByCodes([res.data.data.region.slice(0,2),res.data.data.region.slice(0,4),res.data.data.region], areaData.value)
         getManufacturerInfoApi()
     })
     
@@ -339,8 +335,25 @@
     // getManufacturerInfoApi()
     getProTypeApi()
     // 动态导入xzqhData,确保在使用前已初始化
-    const { xzqhData } = await import('@/static/xzqh/index')
-    areaData.value = xzqhData
+    // const { xzqhData } = await import('@/static/xzqh/index')
+    // areaData.value = xzqhData
+    const response = await uni.request({
+        url: 'https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ja-app-wx/xzqh/index.json',
+        method: 'GET',
+        timeout: 10000, // 10秒超时
+        dataType: 'json'
+    })
+
+    // 检查响应
+    if (response.statusCode === 200) {
+        
+        areaData.value = response.data
+        // console.log('请求成功:', data)
+        // 处理数据
+    } else {
+        console.error('请求失败:', response)
+        throw new Error(`请求失败: ${response.statusCode}`)
+    }
 })
 </script>
 <style scoped lang="scss">
diff --git a/uniapps/work-wx/src/subPackages/flightApplication/add.vue b/uniapps/work-wx/src/subPackages/flightApplication/add.vue
index 3c522c5..ec51e8f 100644
--- a/uniapps/work-wx/src/subPackages/flightApplication/add.vue
+++ b/uniapps/work-wx/src/subPackages/flightApplication/add.vue
@@ -370,20 +370,20 @@
         <view class="confirm-btn" @click="onPickerAircraftInfo">确定</view>
     </view>
     <view class="select-content">
-          <up-checkbox-group
+          <u-checkbox-group
             v-model="formParams.spacecraftId"
             placement="column"
             @change="checkboxChange"
         >
-            <up-checkbox
+            <u-checkbox
                 :customStyle="{marginBottom: '8px'}"
                 v-for="(item, index) in aircraftInfoList"
                 :key="item.id"
                 :label="item.label"
                 :name="item.value"
             >
-            </up-checkbox>
-        </up-checkbox-group>
+            </u-checkbox>
+        </u-checkbox-group>
     </view>
     </scroll-view>
   </u-popup>
@@ -408,20 +408,20 @@
         <view class="confirm-btn" @click="onPickerPilotInfo">确定</view>
     </view>
     <view class="select-content">
-          <up-checkbox-group
+          <u-checkbox-group
             v-model="formParams.pilotId"
             placement="column"
             @change="checkboxPilotChange"
         >
-            <up-checkbox
+            <u-checkbox
                 :customStyle="{marginBottom: '8px'}"
                 v-for="(item, index) in pilotInfoList"
                 :key="item.id"
                 :label="item.label"
                 :name="item.value"
             >
-            </up-checkbox>
-        </up-checkbox-group>
+            </u-checkbox>
+        </u-checkbox-group>
     </view>
     </scroll-view>
   </u-popup>
@@ -641,7 +641,7 @@
 //   isShowAircraftInfo.value = false
 // }
 function checkboxChange(val) {
-    formParams.value.spacecraftId = val.join(',')
+    formParams.value.spacecraftId = val
     formParams.value.spacecraftText = aircraftInfoList.value.filter(item => val.includes(item.value)).map(item => item.label).join(',')
 }
 const onPickerAircraftInfo = () => {
@@ -662,7 +662,7 @@
     })
 }
 function checkboxPilotChange(val) {
-    formParams.value.pilotId = val.join(',')
+    formParams.value.pilotId = val
     formParams.value.pilotText = pilotInfoList.value.filter(item => val.includes(item.value)).map(item => item.label).join(',')
 }
 const onPickerPilotInfo = (e) => {
@@ -771,6 +771,8 @@
 const submitForm = async () => {
   await formRef.value.validate()
   isSubmitDisabled.value = true
+  formParams.value.pilotId = formParams.value.pilotId.join(',')
+  formParams.value.spacecraftId = formParams.value.spacecraftId.join(',')
   flightPlanSaveApi(formParams.value).then(res => {
     if (res.data.code === 200) {
         isSubmitDisabled.value = true

--
Gitblit v1.9.3