zaijin 1 year ago
parent
commit
f1d1eee9bc

+ 9 - 27
pages/invoiceModule/addInvoice/addInvoice.vue

@@ -169,9 +169,7 @@ export default {
       this.companyPop.show = true;
     },
     customBack() {
-      this.$u.route({
-        url: '/pages/invoiceModule/availableOrder/availableOrder'
-      });
+      uni.navigateBack();
     },
     moreContent() {
       this.moreContentPop.show = true;
@@ -184,30 +182,14 @@ export default {
       const { code, data } = await this.$u.api.invoiceModuleApi.getInvoiceHeadSelectApi({ ...this.queryParams });
       if (code === 200) {
         this.companyPop.list = data;
-        if (data.length) {
-          if (data[0].invoStatus === 1) {
-            this.form.invoName = data[0].invoName;
-            this.form.invoCode = data[0].invoCode;
-            this.form.invoHeadId = data[0].id;
-            this.form.invoMail = data[0].invoMail;
-            this.form.invoPhone = data[0].invoPhone;
-            this.companyPop.form.name = data[0].id;
-          } else {
-            this.form.invoName = '';
-            this.form.invoCode = '';
-            this.form.invoHeadId = '';
-            this.form.invoMail = '';
-            this.form.invoPhone = '';
-            this.companyPop.form.name = '';
-          }
-        } else {
-          this.form.invoName = '';
-          this.form.invoCode = '';
-          this.form.invoHeadId = '';
-          this.form.invoMail = '';
-          this.form.invoPhone = '';
-          this.companyPop.form.name = '';
-        }
+        const { invoName, invoCode, id, invoMail, invoPhone, invoStatus } = data[0] || {};
+        const isEmpty = invoStatus !== 1;
+        this.form.invoName = isEmpty ? '' : invoName;
+        this.form.invoCode = isEmpty ? '' : invoCode;
+        this.form.invoHeadId = isEmpty ? '' : id;
+        this.form.invoMail = isEmpty ? '' : invoMail;
+        this.form.invoPhone = isEmpty ? '' : invoPhone;
+        this.companyPop.form.name = isEmpty ? '' : id;
       }
     },
     /**

+ 1 - 1
pages/invoiceModule/availableOrder/availableOrder.vue

@@ -21,7 +21,7 @@
             <view class="left-content">
               <view class="left-content-item money">¥{{ item.amount }}</view>
               <view class="left-content-item">{{ item.name }}</view>
-              <view class="left-content-item time">{{ item.payTime }}</view>
+              <view class="left-content-item time">{{ $u.timeFormat(new Date(item.payTime), 'yyyy-mm-dd hh:MM:ss') }}</view>
             </view>
           </view>
           <view class="right">{{ item.vehicleNo }}</view>

+ 1 - 1
pages/invoiceModule/invoiceDetails/invoiceDetails.vue

@@ -23,7 +23,7 @@
         </view>
         <view class="details-invoice-list-item u-skeleton-fillet">
           <view class="details-invoice-list-item-label">申请时间:</view>
-          <view class="details-invoice-list-item-content">{{ invoiceInfo.askTime }}</view>
+          <view class="details-invoice-list-item-content">{{ $u.timeFormat(new Date(invoiceInfo.askTime), 'yyyy-mm-dd hh:MM:ss') }}</view>
         </view>
         <view class="details-invoice-list-item u-skeleton-fillet">
           <view class="details-invoice-list-item-label">更多内容:</view>

+ 1 - 1
pages/invoiceModule/myInvoice/myInvoice.vue

@@ -34,7 +34,7 @@
             <view class="invoice-list-item-left-item">
               <view class="left">申请时间:</view>
               <view class="right">
-                <text class="time">{{ item.askTime }}</text>
+                <text class="time">{{ $u.timeFormat(new Date(item.askTime), 'yyyy-mm-dd hh:MM:ss') }}</text>
               </view>
             </view>
           </view>