From 939ee5a461a64b40b23d2b5f51c69dead13ee7e3 Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期二, 30 十二月 2025 23:21:03 +0800
Subject: [PATCH] 提交

---
 ui/car_wx_app/pages/examine/index.vue |  123 ++++++++++++++++++++++++++++++----------
 1 files changed, 92 insertions(+), 31 deletions(-)

diff --git a/ui/car_wx_app/pages/examine/index.vue b/ui/car_wx_app/pages/examine/index.vue
index a885ba6..8b26b47 100644
--- a/ui/car_wx_app/pages/examine/index.vue
+++ b/ui/car_wx_app/pages/examine/index.vue
@@ -124,7 +124,7 @@
         </u-form-item> -->
 
 
-        <u-form-item ref="item1" borderBottom label=" " labelWidth="0" prop="" :borderBottom="false">
+        <u-form-item ref="item1" borderBottom label=" " labelWidth="0" prop="" :borderBottom="false" v-if="uploadAreas.length > 0">
           <view style="display: flex;align-items: center;"><u--image :showLoading="true" src="/static/bt.png"
               width="20px" height="20px"></u--image>鍑瘉<span
               style="color: #c6c0ba;margin-left: 10px;display: inline-block;"></span></view>
@@ -303,6 +303,25 @@
             </u-number-box>
 
 
+
+          </view>
+
+          <view v-if="form.tripType == '5'"  style="display: flex; align-items: center; width: 100%; margin-top: 15px">
+            <view style="display: flex; align-items: center; flex-shrink: 0; margin-right: 10px;">
+              <u--image :showLoading="true" src="/static/bt.png" width="20px" height="20px"></u--image>
+              <text>鏄惁鏌ヨ溅:</text>
+
+            </view>
+
+              <u-radio-group
+                  v-model="form.iscc"  iconPlacement="right"
+                  placement="row">
+                <u-radio  label="鏄�" name="0" style="margin-right: 20px"></u-radio>
+                <u-radio  label="鍚�" name="1"></u-radio>
+              </u-radio-group>
+
+
+
           </view>
 
 
@@ -352,6 +371,8 @@
 </template>
 
 <script>
+import {uploadImage} from "@/common/upload";
+
 function groupBy(array, key){
   return array.reduce((acc, item) => {
     const groupKey = String(item[key]);
@@ -430,7 +451,7 @@
       },
       mapList: {},
       activeActive: {},
-
+      isHk:false,
 
     };
   },
@@ -445,6 +466,7 @@
     this.amapPlugin = new amap.AMapWX({
       key: this.mapApiKey
     });
+
     // 鑾峰彇 URL 鍙傛暟
     if (options.id) {
       //this.getList();
@@ -453,6 +475,8 @@
       this.form.tripTime = this.getCurrentDateTime();
 
     }
+
+    this.getLocation();
   },
   created() {
     // this.getList();
@@ -656,6 +680,8 @@
         success: (res) => {
           const latitude = res.latitude;
           const longitude = res.longitude;
+          this.form.longitude =longitude;
+          this.form.latitude =latitude;
           this.getAddress(latitude, longitude);
         },
         fail: (err) => {
@@ -669,7 +695,14 @@
       this.amapPlugin.getRegeo({
         location:`${longitude},${latitude}`,
         success: (data) => {
-          this.form.address  = data[0].name;
+          let datum = data[0];
+          if (datum.regeocodeData){
+            if (datum.regeocodeData.addressComponent){
+              let province = datum.regeocodeData.addressComponent.province;
+              this.isHk = province.indexOf("棣欐腐") != -1;
+            }
+          }
+          this.form.address  = datum.name;
         },
         fail: (err) => {
           console.error("SDK璋冪敤澶辫触:", err);
@@ -735,8 +768,8 @@
       else if (type == '2'||type == '6'){ // 鍒拌揪瑁呰揣鐐� 鍒拌揪鍗歌揣鐐�
         this.uploadAreas = [
           { name: '杞﹀ご', imageUrl: '',required: true },
-          { name: '杞﹀熬(闈炲繀濉�)', imageUrl: '',required: false },
-          { name: '浠〃鐩�(闈炲繀濉�)', imageUrl: '',required: false },
+          // { name: '杞﹀熬(闈炲繀濉�)', imageUrl: '',required: false },
+          // { name: '浠〃鐩�(闈炲繀濉�)', imageUrl: '',required: false },
 
 
         ]
@@ -745,13 +778,21 @@
         this.uploadAreas = [
           { name: '杞﹀ご', imageUrl: '',required: true },
           { name: '杞﹀熬', imageUrl: '',required: true },
-          { name: '浠〃鐩�(闈炲繀濉�)', imageUrl: '',required: false },
+          // { name: '浠〃鐩�(闈炲繀濉�)', imageUrl: '',required: false },
         ]
       }else if (type == '4'||type == '5'){// 鍒拌揪娓呭叧鍦哄湴 绂诲紑娓呭叧鍦哄湴
         this.uploadAreas = [
-          { name: '浠〃鐩�(闈炲繀濉�)', imageUrl: '',required: false },
-          { name: '杞﹀ご(闈炲繀濉�)', imageUrl: '',required: false },
-          { name: '杞﹀熬(闈炲繀濉�)', imageUrl: '',required: false },
+          // { name: '浠〃鐩�(闈炲繀濉�)', imageUrl: '',required: false },
+          // { name: '杞﹀ご(闈炲繀濉�)', imageUrl: '',required: false },
+          // { name: '杞﹀熬(闈炲繀濉�)', imageUrl: '',required: false },
+        ]
+      }else if (type == '8'){
+        this.uploadAreas = [
+          { name: '杞﹀ご', imageUrl: '',required: true },
+          { name: '浠〃鐩�', imageUrl: '',required: true },
+
+          { name: '杞﹀熬', imageUrl: '',required: true },
+          { name: '鎵胯繍鍗�', imageUrl: '',required: false },
         ]
       }else{
         this.uploadAreas = [
@@ -768,6 +809,7 @@
         if (['3','5','7'].includes(type)){
           let item = this.tmsTripTables[0] || {};
           this.form.odometer = item.odometer;
+          this.form.iscc = "1";
         }else{
           this.form.odometer = 0
         }
@@ -788,26 +830,31 @@
     // 鏂板鍥剧墖
     async afterRead(event) {
       // 褰撹缃� multiple 涓� true 鏃�, file 涓烘暟缁勬牸寮忥紝鍚﹀垯涓哄璞℃牸寮�
-      let lists = [].concat(event.file)
-      let fileListLen = this.fileList.length
-      lists.map((item) => {
-        this.fileList.push({
-          ...item,
-          status: 'success',
-          message: '涓婁紶涓�'
-        })
+      uploadImage(event.file[0].url,this.isHk).then(res=>{
+        console.log(res)
+        this.fileList.push(res);
       })
-      for (let i = 0; i < lists.length; i++) {
 
-        const result = await this.uploadFilePromise(lists[i].url)
-        let item = this.fileList[fileListLen]
-        this.fileList.splice(fileListLen, 1, Object.assign(item, {
-          status: result.status,
-          message: result.status == 'success' ? '涓婁紶鎴愬姛' : '涓婁紶澶辫触',
-          urls: result.url
-        }))
-        fileListLen++
-      }
+      // let lists = [].concat(event.file)
+      // let fileListLen = this.fileList.length
+      // lists.map((item) => {
+      //   this.fileList.push({
+      //     ...item,
+      //     status: 'success',
+      //     message: '涓婁紶涓�'
+      //   })
+      // })
+      // for (let i = 0; i < lists.length; i++) {
+      //
+      //   const result = await this.uploadFilePromise(lists[i].url)
+      //   let item = this.fileList[fileListLen]
+      //   this.fileList.splice(fileListLen, 1, Object.assign(item, {
+      //     status: result.status,
+      //     message: result.status == 'success' ? '涓婁紶鎴愬姛' : '涓婁紶澶辫触',
+      //     urls: result.url
+      //   }))
+      //   fileListLen++
+      // }
     },
 
     uploadFilePromise(url) {
@@ -893,10 +940,15 @@
         sizeType: ['original', 'compressed'],
         sourceType: ['album', 'camera'],
         success: (res) => {
+          const tempFilePaths = res.tempFilePaths;
+          const imgUrl = tempFilePaths[0];
+          uploadImage(imgUrl,this.isHk).then(res2=>{
+            this.uploadAreas[index].imageUrl = res2.url;
+            // const tempFilePath = res.tempFilePaths[0];
+            // // 涓婁紶鍥剧墖鍒版湇鍔″櫒
+            // this.uploadAreaPic(tempFilePath, index);
+          })
 
-          const tempFilePath = res.tempFilePaths[0];
-          // 涓婁紶鍥剧墖鍒版湇鍔″櫒
-          this.uploadAreaPic(tempFilePath, index);
         }
       });
     },
@@ -1020,7 +1072,7 @@
 
         this.$refs.uForm.validate().then(res => {
           if (res) {
-            var urls = this.fileList.map(item => item.urls).join(',');
+            var urls = this.fileList.map(item => item.url).join(',');
             this.form.feeVoucherUrl = urls
             this.form.dispatchOrderId = this.newForm.dispatchId
             this.form.driverId = this.newForm.driverId
@@ -1530,4 +1582,13 @@
   padding: 2px;
   z-index: 999;
 }
+
+</style>
+<style lang="scss" scoped>
+::v-deep .u-radio{
+  margin-right: 20px;
+}
+::v-deep .u-radio__icon-wrap{
+  margin-left: 10px;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.8.0