From 2470a24d86d9f0242046e4fff77fbb908bf170b2 Mon Sep 17 00:00:00 2001
From: zhangback <zhangback@163.com>
Date: 星期五, 30 一月 2026 11:17:09 +0800
Subject: [PATCH] 修改为下单类型

---
 ui/car_wx_app/pages/examine/index.vue |  161 ++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 122 insertions(+), 39 deletions(-)

diff --git a/ui/car_wx_app/pages/examine/index.vue b/ui/car_wx_app/pages/examine/index.vue
index 26af185..d282e89 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>
@@ -162,7 +162,7 @@
         <u-button class="btn-list" @click="goThistory" text="琛岀▼鍘嗗彶"></u-button>
         <u-button class="btn-list" @click="goToAdvanceList" text="鍨粯鍒楄〃"></u-button>
         <!-- <u-button class="btn-budget" @click="goToAdvanceBudget" type="success" text="鍨粯棰勭畻"></u-button> -->
-        <u-button class="btn-submit" @click="submitForm" type="primary" text="鎻愪氦"></u-button>
+        <u-button :loading="loading" class="btn-submit" @click="submitForm" type="primary" text="鎻愪氦"></u-button>
       </view>
 
     </view>
@@ -255,7 +255,7 @@
         <u-button class="btn-list" @click="goThistory" text="琛岀▼鍘嗗彶"></u-button>
         <u-button class="btn-list" @click="goToAdvanceList" text="鍨粯鍒楄〃"></u-button>
         <!-- <u-button class="btn-budget" @click="goToAdvanceBudget" type="success" text="鍨粯棰勭畻"></u-button> -->
-        <u-button class="btn-submit" @click="submitForm" type="primary" text="鎻愪氦"></u-button>
+        <u-button :loading="loading" class="btn-submit" @click="submitForm" type="primary" text="鎻愪氦"></u-button>
       </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>
 
 
@@ -315,7 +334,7 @@
         <u-button class="cancel-btn" @click="showPopup = false" type="info" plain>
           鍙栨秷
         </u-button>
-        <u-button class="submit-btn" @click="handleSubmit" type="primary">
+        <u-button  class="submit-btn" @click="handleSubmit" type="primary">
           鎻愪氦
         </u-button>
       </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,8 +451,8 @@
       },
       mapList: {},
       activeActive: {},
-
-
+      isHk:false,
+		loading: false
     };
   },
   onLoad(options) {
@@ -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);
         }
       });
     },
@@ -932,7 +984,9 @@
 
     // 琛ㄥ崟鎻愪氦鏃堕獙璇佸浘鐗囨槸鍚﹀畬鏁达紙鏍规嵁闇�姹傝皟鏁村繀濉」锛�
     submitForm() {
-
+		if(this.loading){
+			return;
+		}
 
       // 鏍规嵁褰撳墠婵�娲荤殑鏍囩椤垫墽琛屼笉鍚岀殑鎻愪氦閫昏緫
       if (this.activeTab == 'upload') {
@@ -956,8 +1010,8 @@
         } else {
           // 楠岃瘉鏄惁鑷冲皯涓婁紶浜嗕竴寮犲浘鐗�
           // 鏀堕泦鎵�鏈変笂浼犵殑鍥剧墖鍦板潃锛堢敤閫楀彿鍒嗛殧锛�
-
-          const voucherUrls = this.uploadAreas.map(item => item.imageUrl && item.imageUrl !== '').join(',');
+			this.loading = true;
+          const voucherUrls = this.uploadAreas.filter(item => item.imageUrl!=='').map(item => item.imageUrl).join(',');
           this.form.voucherUrl = voucherUrls;
 
           this.$refs.uForm.validate().then(res => {
@@ -968,7 +1022,9 @@
               if (this.form.tripType == 1) {
                 /*璁剧疆 */
                 // console.log(this.form);
-
+			setTimeout(()=>{
+							this.loading = false
+						},2000)
                 uni.setStorageSync("signContractForm", this.form);
                 setTimeout(() => {
                   uni.$u.route('/pages/signContract/index');
@@ -977,6 +1033,9 @@
                 /* 涓婁紶琛岀▼鍙戣溅 */
                 carUploadTrip(this.form).then((res) => {
                   if (res == 1) {
+					  setTimeout(()=>{
+					  	this.loading = false
+					  },2000)
                     uni.$u.toast('鎿嶄綔鎴愬姛')
                     // 閲嶇疆琛ㄥ崟
                     this.form = {
@@ -995,12 +1054,18 @@
                   }
                 }).catch(err => {
                   uni.$u.toast('鎻愪氦澶辫触')
+				  setTimeout(()=>{
+				  	this.loading = false
+				  },2000)
                 })
               }
 
             }
           }).catch(errors => {
             uni.$u.toast('鏍¢獙澶辫触')
+			setTimeout(()=>{
+				this.loading = false
+			},2000)
           })
 
 
@@ -1020,7 +1085,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
@@ -1032,6 +1097,9 @@
             this.cleanedForm = this.cleanFormData({ ...this.form })
             carUploadFinance(this.cleanedForm).then((res) => {
               if (res == 1) {
+				  setTimeout(()=>{
+				  	this.loading = false
+				  },2000)
                 uni.$u.toast('鎿嶄綔鎴愬姛')
                 // 閲嶇疆琛ㄥ崟
                 this.form = {
@@ -1046,10 +1114,16 @@
               }
             }).catch(err => {
               uni.$u.toast('鎻愪氦澶辫触')
+			  setTimeout(()=>{
+			  	this.loading = false
+			  },2000)
             })
           }
         }).catch(errors => {
           uni.$u.toast('鏍¢獙澶辫触')
+		  setTimeout(()=>{
+		  	this.loading = false
+		  },2000)
         })
       }
 
@@ -1530,4 +1604,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