lock.qiu@kerryprops.com 2 жил өмнө
parent
commit
98cc844af4

+ 56 - 0
src/api/parking/index.js

@@ -76,3 +76,59 @@ export function unlicensedCarCheckIn(params) {
   return window.requestms.post(`/parking/unlicensed-car-check-in`, params, { loading: true });
 }
 
+/* 开票相关接口api */
+
+// 未开票列表
+export function invoicesNotapplied(params) {
+  return window.requestms.get(`/invoices/not-applied`, params, { loading: true });
+}
+
+// 已开票列表
+export function invoicesCompleted(params) {
+  return window.requestms.get(`/invoices/completed`, params, { loading: true });
+}
+
+// 开票详情
+export function invoicesDeatil(id) {
+  return window.requestms.get(`/invoices${id}`, { loading: true });
+}
+
+// 发票关联的订单支付详情
+export function invoicesOrders(invoiceId) {
+  return window.requestms.get(`/invoices/${invoiceId}/orders`, { loading: true });
+}
+
+// 新增发票抬头
+export function invoicesNewtitles(params) {
+  return window.requestms.post(`/invoice-titles`, params, { loading: true });
+}
+// 编辑发票抬头
+
+export function invoicesEdittitles(params, id) {
+  return window.requestms.put(`/invoice-titles/${id}`, params, { loading: true });
+}
+
+// 删除发票抬头
+
+export function invoicesDelecttitles(params) {
+  return window.requestms.get(`/invoices/completed`, params, { loading: true });
+}
+
+// 发票抬头列表
+
+export function invoicesDetail(params) {
+  return window.requestms.get(`/invoice-titles`, params, { loading: true });
+}
+
+// 再次发送发票附件
+
+export function invoicesAgainSandEmail(invoiceId) {
+  return window.requestms.get(`/invoices/send-email?invoiceId=${invoiceId}`, { loading: true });
+}
+
+// 提交发票申请
+
+export function submitInvoice(params) {
+  return window.requestms.post(`/invoices`,params, { loading: true });
+}
+

+ 16 - 16
src/pages/parkingFee/components/base/parkingReceipt/parkingApplication.vue

@@ -4,14 +4,14 @@
 
     <scroll-view class="push-box">
       <div class="choose-invoice-header lines" @click="changeHeader">
-        <div class="invoice-header-info" v-if="headerInfo.invoiceTitleName">
+        <div class="invoice-header-info" v-if="headerInfo.titleName">
           <div
             class="invoice-header-name"
-            :class="headerInfo.invoiceTitleType == 1 ? 'header-name' : ''"
+            :class="headerInfo.invoiceTitleType == 'COMPANY' ? 'header-name' : ''"
           >
             <div>
-              {{ headerInfo.invoiceTitleName }}
-              <span class="isDefault" v-if="headerInfo.setDefault == 1"
+              {{ headerInfo.titleName }}
+              <span class="isDefault" v-if="headerInfo.defaultOrNot"
                 >默认</span
               >
             </div>
@@ -21,7 +21,7 @@
               mode="widthFix"
             />
           </div>
-          <div v-if="headerInfo.invoiceTitleType == 0" class="duty-paragraph">
+          <div v-if="headerInfo.invoiceTitleType == 'COMPANY'" class="duty-paragraph">
             税号:{{ headerInfo.corporationTax }}
           </div>
         </div>
@@ -37,8 +37,8 @@
           <div class="duty-paragraph">未选择发票抬头</div>
         </div>
       </div>
-      <div class="tab-header" v-if="headerInfo.invoiceTitleName">发票详情</div>
-      <div class="part" v-if="headerInfo.invoiceTitleName">
+      <div class="tab-header" v-if="headerInfo.titleName">发票详情</div>
+      <div class="part" v-if="headerInfo.titleName">
         <div class="invoice-header">
           <!-- <div class="part-item">
           			<span class="part-item-key">开票订单号</span>
@@ -51,24 +51,24 @@
           <div class="part-item">
             <span class="part-item-key">抬头类型</span>
             <span class="part-item-value">{{
-              headerInfo.invoiceTitleType === 0 ? '单位' : '个人/非企业单位'
+             headerInfo.invoiceTitleType === 'COMPANY' ? '单位' : '个人/非企业单位'
             }}</span>
           </div>
           <div
             class="part-item"
-            :class="headerInfo.invoiceTitleType == 1 ? 'header-name' : ''"
+            :class="headerInfo.invoiceTitleType == 'INDIVIDUAL' ? 'header-name' : ''"
           >
             <span class="part-item-key">抬头名称</span>
             <span class="part-item-value">{{
-              headerInfo.invoiceTitleName
+              headerInfo.titleName
             }}</span>
           </div>
-          <div class="part-item lines" v-if="headerInfo.invoiceTitleType === 0">
+          <div class="part-item lines" v-if="headerInfo.invoiceTitleType === 'COMPANY'">
             <span class="part-item-key">公司税号</span>
-            <span class="part-item-value">{{ headerInfo.corporationTax }}</span>
+            <span class="part-item-value">{{ headerInfo.taxNo }}</span>
           </div>
         </div>
-        <div class="invoice-more" v-if="headerInfo.invoiceTitleType === 0">
+        <div class="invoice-more" v-if="headerInfo.invoiceTitleType === 'COMPANY'">
           <div class="tab-title show-more" @click="changeShowMore">
             <span class="c">更多信息</span>
             <!--  :class="!isShowMore ? 'toBottom' : 'toRight'" -->
@@ -94,7 +94,7 @@
             <div class="part-item top">
               <span class="part-item-key">开户账户</span>
               <span class="part-item-value">{{
-                headerInfo.accountNumber
+                headerInfo.depositAccount
               }}</span>
             </div>
           </div>
@@ -132,7 +132,7 @@
               style="white-space: nowrap"
               type="text"
               placeholder="请输入电子邮箱"
-              v-model="condition.mailbox"
+              v-model="condition.email"
             />
           </div>
         </div>
@@ -155,7 +155,7 @@
     </scroll-view>
     <div class="push-btn">
       <div
-        v-if="headerInfo.invoiceTitleName"
+        v-if="headerInfo.titleName"
         :class="{
           btn: true,
           'push-again-btn': true,

+ 5 - 5
src/pages/parkingFee/components/base/parkingReceipt/parkingChangeHeader.vue

@@ -29,7 +29,7 @@
           <div class="part-item-value">
             <van-field
               placeholder="请输入抬头名称"
-              v-model="condition.invoiceTitleName"
+              v-model="condition.titleName"
             />
           </div>
         </div>
@@ -38,7 +38,7 @@
           <div class="part-item-value">
             <van-field
               placeholder="请输入公司税号"
-              v-model="condition.corporationTax"
+              v-model="condition.taxNo"
             />
           </div>
         </div>
@@ -47,7 +47,7 @@
           <div class="part-item-value">
             <van-switch
               active-color="#8CC63F"
-              v-model="isDefault"
+              v-model="condition.defaultOrNot"
               @change="switch1Change"
             />
           </div>
@@ -86,8 +86,8 @@
           <span class="part-item-key">开户账户</span>
           <div class="part-item-value">
             <van-field
-              placeholder="请输入开户银行"
-              v-model="condition.accountNumber"
+              placeholder="请输入开户账户"
+              v-model="condition.depositAccount"
             />
           </div>
         </div>

+ 4 - 4
src/pages/parkingFee/components/base/parkingReceipt/parkingChooseHeader.vue

@@ -17,15 +17,15 @@
             <div class="invoice-header-text">
               <div class="invoice-header-name">
                 <div class="invoice-header-name-text">
-                  {{ item.invoiceTitleName
-                  }}<span class="isDefault" v-if="item.setDefault === 1"
+                  {{ item.titleName
+                  }}<span class="isDefault" v-if="item.defaultOrNot"
                 >默认</span
                 >
                 </div>
                 <div class="invoice-header-name-icon">
                   <div
                     class="edit-header"
-                    @click.stop="changeHeader('edit', item.id)"
+                    @click.stop="changeHeader('edit', item.id, item)"
                   >
                     <img
                       class="invoice-header-arrow"
@@ -43,7 +43,7 @@
                 </div>
               </div>
               <div class="duty-paragraph">
-                税号 {{ item.corporationTax }}
+                税号 {{ item.taxNo }}
               </div>
             </div>
           </div>

+ 3 - 3
src/pages/parkingFee/components/base/parkingReceipt/parkingOrderDetail.vue

@@ -12,13 +12,13 @@
         <!-- 0:停车缴费  1:活动报名 2:积分兑换 -->
         <template v-if="item.invoiceCategory === 0">
           <div class="item-header">
-            <div>{{ item.orderNo }}-{{ item.carNo }}</div>
-            <div class="red">¥{{ getOrderItemPrice(item) }}</div>
+            <div>{{ item.orderNo }}-{{ item.vehicleNo }}</div>
+            <div class="red">¥{{ item.totalPaidAmount }}</div>
           </div>
           <div class="item-bottom">
             <div>{{ item.parkName }}</div>
             <div>入场时间: {{ item.enterTime }}</div>
-            <div>停车时长: {{ item.serviceHour }}分钟</div>
+            <div>停车时长: 停车时长: {{ item.serviceMin | parkingTime }}</div>
           </div>
         </template>
         <template v-else-if="item.invoiceCategory === 1"></template>

+ 22 - 22
src/pages/parkingFee/components/base/parkingReceipt/parkingReceipt.vue

@@ -48,30 +48,30 @@
             <div class="choice_card_item">
               <div class="choice_card_index choice_card_index1">
                 <div v-if="tabIndex == 1"
-                >{{ item.orderno }}-{{ item.carno }}
+                >{{ item.orderNo }}-{{ item.vehicleNo }}
                 </div
                 >
-                <div v-else>{{ item.invoiceTitleName }}的停车发票</div>
+                <div v-else>{{ item.titleName }}的停车发票</div>
                 <div v-if="tabIndex == 1" style="color: #ed1c24"
-                >¥{{ ( item.payfee / 100 ).toFixed(2) }}
+                >¥{{item.totalPaidAmount}}
                 </div
                 >
                 <div v-else style="color: #ed1c24"
-                >¥{{ ( item.invoiceAmount / 100 ).toFixed(2) }}
+                >{{item.totalPaidAmount}}
                 </div
                 >
               </div>
               <div
                 class="choice_card_index choice_card_index2"
                 v-if="tabIndex == 1"
-              >{{ item.parkname }}
+              >{{ item.parkName }}
               </div
               >
               <div
                 class="choice_card_index choice_card_index3"
                 v-if="tabIndex == 1"
               >
-                <div>入场时间: {{ item.entertime }}</div>
+                <div>入场时间: {{ item.enterTime }}</div>
                 <div
                 >
                   <radio
@@ -90,7 +90,7 @@
               <div
                 class="choice_card_index choice_card_index2"
                 v-if="tabIndex == 2"
-              >税号: {{ item.corporationTax }}
+              >税号: {{ item.taxNo }}
               </div
               >
               <div
@@ -100,7 +100,7 @@
               >
                 <div
                 >开票时间:
-                  {{ item.paperDrewDate ? item.paperDrewDate : '-' }}
+                  {{ item.createTime ? item.createTime : '-' }}
                 </div
                 >
                 <!-- 0:已提交申请(待开票) 1:开票中  2:开票完成 3:开票失败 -->
@@ -115,7 +115,7 @@
                     :src="arrowIcon"
                     mode="heightFix"
                     style="height: 40px"
-                  ></img>
+                  />
                 </div>
                 <div
                   class="choice_card_status"
@@ -128,7 +128,7 @@
                     :src="arrowIcon"
                     mode="heightFix"
                     style="height: 40px"
-                  ></img>
+                  />
                 </div>
                 <div class="choice_card_status" v-else style="color: #f7931e">
                   开票中
@@ -137,7 +137,7 @@
                     :src="arrowIcon"
                     mode="heightFix"
                     style="height: 40px"
-                  ></img>
+                  />
                 </div>
 
               </div>
@@ -157,30 +157,30 @@
             <div class="choice_card_item">
               <div class="choice_card_index choice_card_index1">
                 <div v-if="tabIndex == 1"
-                >{{ item.orderno }}-{{ item.carno }}
+                >{{ item.orderNo }}-{{ item.vehicleNo }}
                 </div
                 >
                 <div v-else>{{ item.invoiceTitleName }}的停车发票</div>
                 <div v-if="tabIndex == 1" style="color: #ed1c24"
-                >¥{{ ( item.payfee / 100 ).toFixed(2) }}
+                >¥{{item.totalPaidAmount}}
                 </div
                 >
                 <div v-else style="color: #ed1c24"
-                >¥{{ ( item.invoiceAmount / 100 ).toFixed(2) }}
+                >¥{{item.totalPaidAmount}}
                 </div
                 >
               </div>
               <div
                 class="choice_card_index choice_card_index2"
                 v-if="tabIndex == 1"
-              >{{ item.parkname }}
+              >{{ item.parkName }}
               </div
               >
               <div
                 class="choice_card_index choice_card_index3"
                 v-if="tabIndex == 1"
               >
-                <div>入场时间: {{ item.entertime }}</div>
+                <div>入场时间: {{ item.enterTime }}</div>
                 <div class="my-not-invoiced-item">
                   <van-checkbox
                     shape="square"
@@ -198,7 +198,7 @@
               <div
                 class="choice_card_index choice_card_index2"
                 v-if="tabIndex == 2"
-              >税号: {{ item.corporationTax }}
+              >税号: {{ item.taxNo }}
               </div
               >
               <div
@@ -208,7 +208,7 @@
               >
                 <div
                 >开票时间:
-                  {{ item.paperDrewDate ? item.paperDrewDate : '-' }}
+                  {{ item.createTime ? item.createTime : '-' }}
                 </div
                 >
                 <!-- 0:已提交申请(待开票) 1:开票中  2:开票完成 3:开票失败 -->
@@ -222,7 +222,7 @@
                     class="arrow"
                     :src="arrowIcon"
                     style="height: 40px"
-                  ></img>
+                  />
                 </div>
                 <div
                   class="choice_card_status"
@@ -245,7 +245,7 @@
                     class="arrow"
                     :src="arrowIcon"
                     style="height: 40px"
-                  ></img>
+                  />
                 </div>
               </div>
               <div
@@ -261,7 +261,7 @@
           </label>
         </van-checkbox-group>
         <div v-show="isLoadMore" :class="{ noData: !list.length }">
-          <img :src="noData" v-if="!list.length" alt="widthFix"></img>
+          <img :src="noData" v-if="!list.length" alt="widthFix"/>
           <span v-if="!list.length">暂无数据</span>
           <uni-load-more :status="loadStatus" v-else></uni-load-more>
         </div>
@@ -280,7 +280,7 @@
       <div class="priceBtn">
         <div
         >开票金额
-          <span class="price">{{ ( totalNum / 100 ).toFixed(2) }} 元</span></div
+          <span class="price">{{ totalNum.toFixed(2) }} 元</span></div
         >
         <div
           :class="{

+ 16 - 16
src/pages/parkingFee/components/officeBlue/parkingReceipt/parkingApplication.vue

@@ -3,14 +3,14 @@
     <scroll-view class="scroll-Y" scroll-y>
       <div class="push-box">
         <div class="choose-invoice-header lines" @click="changeHeader">
-          <div class="invoice-header-info" v-if="headerInfo.invoiceTitleName">
+          <div class="invoice-header-info" v-if="headerInfo.titleName">
             <div
               class="invoice-header-name"
-              :class="headerInfo.invoiceTitleType == 1 ? 'header-name' : ''"
+              :class="headerInfo.invoiceTitleType == 'COMPANY' ? 'header-name' : ''"
             >
               <div>
-                {{ headerInfo.invoiceTitleName }}
-                <span class="isDefault" v-if="headerInfo.setDefault == 1"
+                {{ headerInfo.titleName }}
+                <span class="isDefault" v-if="headerInfo.defaultOrNot"
                 >默认</span
                 >
               </div>
@@ -20,8 +20,8 @@
                 mode="widthFix"
               />
             </div>
-            <div v-if="headerInfo.invoiceTitleType == 0" class="duty-paragraph">
-              税号:{{ headerInfo.corporationTax }}
+            <div v-if="headerInfo.invoiceTitleType == 'COMPANY'" class="duty-paragraph">
+              税号:{{ headerInfo.taxNo }}
             </div>
           </div>
           <div class="invoice-header-info" v-else>
@@ -36,10 +36,10 @@
             <div class="duty-paragraph">未选择发票抬头</div>
           </div>
         </div>
-        <div class="tab-header" v-if="headerInfo.invoiceTitleName">
+        <div class="tab-header" v-if="headerInfo.titleName">
           发票详情
         </div>
-        <div class="part" v-if="headerInfo.invoiceTitleName">
+        <div class="part" v-if="headerInfo.titleName">
           <div class="invoice-header">
             <!-- <uni-view class="part-item">
           			<span class="part-item-key">开票订单号</span>
@@ -52,29 +52,29 @@
             <div class="part-item">
               <span class="part-item-key">抬头类型</span>
               <span class="part-item-value">{{
-                  headerInfo.invoiceTitleType === 0 ? '单位' : '个人/非企业单位'
+                  headerInfo.invoiceTitleType === 'COMPANY' ? '单位' : '个人/非企业单位'
                 }}</span>
             </div>
             <div
               class="part-item"
-              :class="headerInfo.invoiceTitleType == 1 ? 'header-name' : ''"
+              :class="headerInfo.invoiceTitleType == 'COMPANY' ? 'header-name' : ''"
             >
               <span class="part-item-key">抬头名称</span>
               <span class="part-item-value">{{
-                  headerInfo.invoiceTitleName
+                  headerInfo.titleName
                 }}</span>
             </div>
             <div
               class="part-item lines"
-              v-if="headerInfo.invoiceTitleType === 0"
+              v-if="headerInfo.invoiceTitleType === 'COMPANY'"
             >
               <span class="part-item-key">公司税号</span>
               <span class="part-item-value">{{
-                  headerInfo.corporationTax
+                  headerInfo.taxNo
                 }}</span>
             </div>
           </div>
-          <div class="invoice-more" v-if="headerInfo.invoiceTitleType === 0">
+          <div class="invoice-more" v-if="headerInfo.invoiceTitleType === 'COMPANY'">
             <div class="tab-title show-more" @click="changeShowMore">
               <span class="c">更多信息</span>
               <!--  :class="!isShowMore ? 'toBottom' : 'toRight'" -->
@@ -102,7 +102,7 @@
               <div class="part-item top">
                 <span class="part-item-key">开户账户</span>
                 <span class="part-item-value">{{
-                    headerInfo.accountNumber
+                    headerInfo.depositAccount
                   }}</span>
               </div>
             </div>
@@ -112,7 +112,7 @@
           <div class="part-item lines">
             <span class="part-item-key">总金额</span>
             <span class="part-item-value"
-            ><span class="purple">{{ invoiceAmount }} 元</span></span
+            ><span class="purple">{{ invoiceAmount.toFixed(2) }} 元</span></span
             >
           </div>
           <div class="part-item top" v-if="type == ''">

+ 2 - 2
src/pages/parkingFee/components/officeBlue/parkingReceipt/parkingOrderDetail.vue

@@ -11,14 +11,14 @@
           <!-- 0:停车缴费  1:活动报名 2:积分兑换 -->
           <template v-if="item.invoiceCategory === 0">
             <div class="item-header">
-              <div class="carNo">{{ item.carNo }}</div>
+              <div class="carNo">{{ item.vehicleNo }}</div>
               <div class="price">¥{{ getOrderItemPrice(item) }}</div>
             </div>
             <div class="item-bottom">
               <div>{{ item.parkName }}</div>
               <div>订单号: {{ item.orderNo }}</div>
               <div>入场时间: {{ item.enterTime }}</div>
-              <div>停车时长: {{ item.serviceHour }}分钟</div>
+              <div>停车时长: {{ item.serviceMin }}分钟</div>
             </div>
           </template>
           <template v-else-if="item.invoiceCategory === 1"></template>

+ 10 - 11
src/pages/parkingFee/components/officeBlue/parkingReceipt/parkingReceipt.vue

@@ -36,10 +36,10 @@
                   :class="['carno', ids.indexOf(item.id) > -1 && 'active']"
                   v-if="tabIndex == 1"
                 >
-                  <span>{{ item.carno }}</span>
+                  <span>{{ item.vehicleNo }}</span>
                 </div>
                 <div class="invoiceTitleName" v-else>
-                  {{ item.invoiceTitleName }}的停车发票&nbsp;<van-icon
+                  {{ item.titleName }}的停车发票&nbsp;<van-icon
                   name="arrow"
                   color="#D8DAE0"
                 />
@@ -51,9 +51,8 @@
                   ]"
                 >
                   ¥{{
-                    (
-                      item[tabIndex == 1 ? 'payfee' : 'invoiceAmount'] / 100
-                    ).toFixed(2)
+                    
+                      item.totalPaidAmount
                   }}
                 </div>
               </div>
@@ -61,15 +60,15 @@
               <!-- 未开票 -->
               <div class="my-not-invoiced-list" v-if="tabIndex == 1">
                 <div class="left">
-                  <div class="choice_card_index">{{ item.parkname }}</div>
+                  <div class="choice_card_index">{{ item.parkName }}</div>
                   <div class="choice_card_index">
-                    订单号: {{ item.orderno }}
+                    订单号: {{ item.orderNo }}
                   </div>
                   <div class="choice_card_index">
-                    入场时间: {{ item.entertime }}
+                    入场时间: {{ item.enterTime }}
                   </div>
                   <div class="choice_card_index mb0">
-                    停车时长: {{ item.serviceMin | parkingTime }}
+                    停车时长: {{ item.serviceMin  }}
                   </div>
                 </div>
                 <div class="right" @click.stop>
@@ -88,11 +87,11 @@
               >
                 <div class="left">
                   <div class="choice_card_index">
-                    税号: {{ item.corporationTax }}
+                    税号: {{ item.taxNo }}
                   </div>
                   <div class="choice_card_index">
                     开票时间:
-                    {{ item.paperDrewDate ? item.paperDrewDate : '-' }}
+                    {{ item.createTime ? item.createTime : '-' }}
                   </div>
                   <!-- <div class="choice_card_index mb0">
                     停车时长: <span>{{ item.serviceMin | parkingTime }}</span>  _{{

+ 2 - 2
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -168,8 +168,8 @@ export default {
       let appId = uni.getStorageSync('appid');
       let openId = uni.getStorageSync('openid') || this.openid;
       if (platform === 'miniprogram') {
-        // appId = 'wx92c3e55fbef6b2af';
-        appId = 'wxd830fe4d1e04988e';
+        appId = 'wx92c3e55fbef6b2af';
+        // appId = 'wxd830fe4d1e04988e';
       }
       const params = {
         region: 'cn',

+ 126 - 77
src/pages/parkingFee/mixins/parkingReceipt/parkingChangeHeader.js

@@ -3,6 +3,7 @@ const app = {};
 import { mapState } from 'vuex';
 import MemberCacheTool from '@/utils/member-cache-tool.js';
 import uni from '@/utils/uniHooks';
+import { invoicesEdittitles, invoicesNewtitles } from '@/api/parking';
 
 export default {
   data() {
@@ -12,23 +13,32 @@ export default {
       id: '',
       globalData: app.globalData,
       items: [
-        { value: 0, name: '单位' },
-        { value: 1, name: '个人/非企业单位' },
+        { value: 'COMPANY', name: '单位' },
+        { value: 'INDIVIDUAL', name: '个人/非企业单位' },
       ],
       isDefault: true, // 记录
       condition: {
-        id: '', // |Long|否|抬头id
-        invoiceTitleType: 0, // |int|是|抬头类型( 0:单位,1:个人/非企业单位)
-        invoiceTitleName: '', // |String|是|抬头名称
-        corporationTax: '', // |String|是|公司税号|
-        setDefault: '', // |int|是|设为默认(0:不默认,1:默认)
-        depositBank: '', // |String|否|开户银行
-        accountNumber: '', // |String|否|开户账号
-        companyAddress: '', // |String|否|公司地址
-        companyTel: '', // |String|否|公司电话
-        createUser: '', // |String|是|创建人
-        creator: '', // |Long|是|创建者id
-        updateUser: this.member?.nickname, // |String|是|更新人
+        companyAddress: "",
+        companyTel: "",
+        defaultOrNot: true,
+        depositAccount: "",
+        depositBank: "",
+        id: '',
+        invoiceTitleType: "COMPANY",
+        taxNo: "",
+        titleName: "",
+        // id: '', // |Long|否|抬头id
+        // invoiceTitleType: 0, // |int|是|抬头类型( 0:单位,1:个人/非企业单位)
+        // invoiceTitleName: '', // |String|是|抬头名称
+        // corporationTax: '', // |String|是|公司税号|
+        // setDefault: '', // |int|是|设为默认(0:不默认,1:默认)
+        // depositBank: '', // |String|否|开户银行
+        // accountNumber: '', // |String|否|开户账号
+        // companyAddress: '', // |String|否|公司地址
+        // companyTel: '', // |String|否|公司电话
+        // createUser: '', // |String|是|创建人
+        // creator: '', // |Long|是|创建者id
+        // updateUser: this.member?.nickname, // |String|是|更新人
         // updater: this.member?.id, // |Long|是|更新人id
         // mobile: this.member?.mobile, // |String|是|手机号
         // vipcode: this.member?.vipcode, // |String|是|会员号
@@ -39,7 +49,7 @@ export default {
   },
   computed: {
     isCompany: function () {
-      return this.condition.invoiceTitleType == 0;
+      return this.condition.invoiceTitleType == 'COMPANY';
     },
     ...mapState({
       custTypeId: (state) => state.custTypeId,
@@ -49,6 +59,9 @@ export default {
   },
   created() {
     const options = this.$route.query;
+    if (options.type == 'edit') {
+      this.condition = JSON.parse(this.$route.query.item)
+    }
     console.log(this.globalData);
     if (options.type) this.type = options.type;
     if (options.id) (this.id = options.id), this.getInvoiceTitleById();
@@ -65,13 +78,14 @@ export default {
         title: '发票抬头',
       });
     }, 300);
+    
   },
   methods: {
     radioChange: function (value) {
       console.log(71, value);
       for (let i = 0; i < this.items.length; i++) {
         if (this.items[i].value === value) {
-          this.condition.invoiceTitleType = i;
+          this.condition.invoiceTitleType = value;
           break;
         }
       }
@@ -81,82 +95,117 @@ export default {
       this.isDefault = value;
     },
     // 根据抬头ID获取抬头详情信息  api/1.0/invoiceTitle/{id}
-    getInvoiceTitleById() {
+    getInvoiceTitleById: async function() {
       const self = this;
-      const params = {
-        id: this.id,
-      };
-      self.$md(params);
-      uni.request({
-        url: self.$baseURL + 'api/1.0/invoiceTitle/' + this.id,
-        method: 'GET',
-        data: params,
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          console.log('获取抬头详情信息', res.data);
-          if (res.data.code === 0) {
+      // const params = {
+      //   id: this.id,
+      // };
+        try {
+          const res = await invoicesEdittitles(this.id)
+          if (res.content.length > 0 ) {
+            console.log('res:::', res)
             self.condition = res.data.data;
             // 单独对默认选项进行赋值
             self.isDefault = res.data.data.setDefault === 1 ? true : false;
           } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none',
+            Toast({
+              message: '服务器开小差了呢,请您稍后再试',
             });
           }
-        },
-        fail: () => {
+        } catch {
           uni.showToast({
             title: '服务器开小差了呢,请您稍后再试',
             icon: 'none',
           });
-        },
-      });
+        }
+      // uni.request({
+      //   url: self.$baseURL + 'api/1.0/invoiceTitle/' + this.id,
+      //   method: 'GET',
+      //   data: params,
+      //   header: JSON.parse(uni.getStorageSync('handleUser')),
+      //   success: (res) => {
+      //     console.log('获取抬头详情信息', res.data);
+      //     if (res.data.code === 0) {
+      //       self.condition = res.data.data;
+      //       // 单独对默认选项进行赋值
+      //       self.isDefault = res.data.data.setDefault === 1 ? true : false;
+      //     } else {
+      //       uni.showToast({
+      //         title: res.data.msg,
+      //         duration: 2000,
+      //         icon: 'none',
+      //       });
+      //     }
+      //   },
+      //   fail: () => {
+      //     uni.showToast({
+      //       title: '服务器开小差了呢,请您稍后再试',
+      //       icon: 'none',
+      //     });
+      //   },
+      // });
     },
     // 添加、编辑抬头信息
-    submit() {
-      const self = this;
-      const url =
-        self.type === 'add' ? 'api/1.0/invoiceTitle' : 'api/1.0/invoiceTitle';
-      const methodType = self.type === 'add' ? 'POST' : 'PUT';
-      if (self.type === 'add') {
-        self.condition.createUser = self.$store.state.userInfo.nickname;
-        self.condition.creator = self.$store.state.userInfo.id;
-      }
-      self.condition.setDefault = self.isDefault ? 1 : 0;
-      const params = {
-        ...self.condition,
-        updater: this.member?.id, // |Long|是|更新人id
-        mobile: this.member?.mobile, // |String|是|手机号
-        vipcode: this.member?.vipcode, // |String|是|会员号
-      };
-      console.log('提交信息', params);
-      self.$md(params);
-      uni.request({
-        url: self.$baseURL + url,
-        method: methodType,
-        data: params,
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          console.log(271, res.data);
-          if (res.data.code === 0) {
+    submit: async function () {
+      let res = null
+      try {
+        if (this.type === 'add') {
+          res = await invoicesNewtitles(this.condition)
+          if (res) {
             this.$router.back();
-          } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none',
-            });
           }
-        },
-        fail: () => {
-          uni.showToast({
-            title: '服务器开小差了呢,请您稍后再试',
-            icon: 'none',
-          });
-        },
-      });
+  
+        } else if (this.type === 'edit') {
+          res = await invoicesEdittitles(this.condition, this.$route.query.id)
+        }
+      } catch {
+        uni.showToast({
+          title: '服务器开小差了呢,请您稍后再试',
+          icon: 'none',
+        });
+      }
+      
+
+      // const url =
+      //   self.type === 'add' ? 'api/1.0/invoiceTitle' : 'api/1.0/invoiceTitle';
+      // const methodType = self.type === 'add' ? 'POST' : 'PUT';
+      // if (self.type === 'add') {
+      //   self.condition.createUser = self.$store.state.userInfo.nickname;
+      //   self.condition.creator = self.$store.state.userInfo.id;
+      // }
+      // self.condition.setDefault = self.isDefault ? 1 : 0;
+      // const params = {
+      //   ...self.condition,
+      //   updater: this.member?.id, // |Long|是|更新人id
+      //   mobile: this.member?.mobile, // |String|是|手机号
+      //   vipcode: this.member?.vipcode, // |String|是|会员号
+      // };
+      // console.log('提交信息', params);
+      // self.$md(params);
+      // uni.request({
+      //   url: self.$baseURL + url,
+      //   method: methodType,
+      //   data: params,
+      //   header: JSON.parse(uni.getStorageSync('handleUser')),
+      //   success: (res) => {
+      //     console.log(271, res.data);
+      //     if (res.data.code === 0) {
+      //       this.$router.back();
+      //     } else {
+      //       uni.showToast({
+      //         title: res.data.msg,
+      //         duration: 2000,
+      //         icon: 'none',
+      //       });
+      //     }
+      //   },
+      //   fail: () => {
+      //     uni.showToast({
+      //       title: '服务器开小差了呢,请您稍后再试',
+      //       icon: 'none',
+      //     });
+      //   },
+      // });
     },
   },
 };

+ 75 - 41
src/pages/parkingFee/mixins/parkingReceipt/parkingChooseHeader.js

@@ -5,6 +5,7 @@ import delwIcon from '../../static/images/delete.png';
 import noDataIcon from '../../static/images/nodataicon.png';
 import { mapState } from 'vuex';
 import uni from '@/utils/uniHooks';
+import { invoicesDetail } from '@/api/parking';
 
 export default {
   data() {
@@ -18,6 +19,8 @@ export default {
       ids: '',
       list: [],
       preUrl: '',
+      pagesize: 10,
+      page: 1,
     };
   },
   created() {
@@ -56,15 +59,23 @@ export default {
     }),
   },
   methods: {
-    changeHeader(type, id) {
-      if (id)
+    changeHeader(type, id, item) {
+      if (type) {
         this.$router.push({
-          path: 'parkingChangeHeader?type=' + type + '&id=' + id,
+          path: 'parkingChangeHeader',
+          query: {
+            id: id,
+            type: type,
+            item: JSON.stringify(item)
+          }
         });
+      }
       else
         this.$router.push({
-          path: 'parkingChangeHeader?type=' + type,
+          path: 'parkingChangeHeader?type=' + type + '&id=' + id,
         });
+      
+        
     },
     // 删除抬头
     delHeader(id) {
@@ -116,49 +127,72 @@ export default {
       // this.$router.back();
       this.$router.replace({
         path:
-          'parkingApplication?ids=' +
-          this.ids +
-          '&header=' +
-          JSON.stringify(item),
+          'parkingApplication',
+        query: {
+          header: JSON.stringify(item),
+          ids: this.ids,
+          invoiceDetailList: this.$store.state.tempParkingOrder,
+          money: this.$store.state.tempParkingMoney
+        }
       });
     },
     // 查询全部抬头列表信息
-    getInvoiceTitle() {
-      const self = this;
+    getInvoiceTitle: async function() {
       const params = {
-        vipcode: this.member?.vipcode,
+        page: this.page,
+        size: this.pagesize
       };
-      self.$md(params);
-      uni.request({
-        url: self.$baseURL + 'api/1.0/invoiceTitle/page',
-        method: 'GET',
-        data: params,
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          console.log('查询全部抬头列表信息', res.data);
-          if (res.data.code === 0) {
-            this.list = res.data.data;
-            if (this.list.length) {
-              this.list.map((item, index) => {
-                if (item.setDefault === 1) this.current = index;
-              });
-              if (this.current == -1) this.current = 0;
-            }
-          } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none',
-            });
-          }
-        },
-        fail: () => {
-          uni.showToast({
-            title: '服务器开小差了呢,请您稍后再试',
-            icon: 'none',
+      try {
+        const res = await invoicesDetail(params)
+        if (res.content.length > 0 ) {
+          console.log('res:::', res)
+          this.list = res.content;
+          let currentIndex = 0;
+          this.list.map((item, index) => {
+            if (item.defaultOrNot) currentIndex = index;
           });
-        },
-      });
+          if (currentIndex == -1) this.current = 0;
+        } else {
+          Toast({
+            message: '服务器开小差了呢,请您稍后再试',
+          });
+        }
+      } catch {
+        uni.showToast({
+          title: '服务器开小差了呢,请您稍后再试',
+          icon: 'none',
+        });
+      }
+      // uni.request({
+      //   url: self.$baseURL + 'api/1.0/invoiceTitle/page',
+      //   method: 'GET',
+      //   data: params,
+      //   header: JSON.parse(uni.getStorageSync('handleUser')),
+      //   success: (res) => {
+      //     console.log('查询全部抬头列表信息', res.data);
+      //     if (res.data.code === 0) {
+      //       this.list = res.data.data;
+      //       if (this.list.length) {
+      //         this.list.map((item, index) => {
+      //           if (item.setDefault === 1) this.current = index;
+      //         });
+      //         if (this.current == -1) this.current = 0;
+      //       }
+      //     } else {
+      //       uni.showToast({
+      //         title: res.data.msg,
+      //         duration: 2000,
+      //         icon: 'none',
+      //       });
+      //     }
+      //   },
+      //   fail: () => {
+      //     uni.showToast({
+      //       title: '服务器开小差了呢,请您稍后再试',
+      //       icon: 'none',
+      //     });
+      //   },
+      // });
     },
   },
 };

+ 40 - 26
src/pages/parkingFee/mixins/parkingReceipt/parkingInvoice.js

@@ -4,7 +4,7 @@ import downloadBtnIcon from '../../static/images/download.png';
 import arrowIcon from '../../static/images/arrows.png';
 import { mapState } from 'vuex';
 import uni from '@/utils/uniHooks';
-
+import { invoicesDeatil } from '@/api/parking';
 export default {
   data() {
     return {
@@ -39,38 +39,52 @@ export default {
   },
   methods: {
     // 根据发票id获取发票详情信息(含发票抬头信息),
-    getInvoicedDetail(id) {
+    getInvoicedDetail: async function (id) {
       //
       // console.log('根据发票id获取发票详情信息(含发票抬头信息),', id);
       const self = this;
-      const data = {
-        id: id,
-      };
       self.$md(data);
-      uni.request({
-        url: self.$baseURL + 'api/1.0/invoice/getInvoicedDetail?id=' + id,
-        method: 'POST',
-        data: data,
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          console.log('获取发票详情信息', res.data);
-          if (res.data.code === 0) {
-            self.order = res.data.data;
-          } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none',
-            });
-          }
-        },
-        fail: () => {
+      try {
+        const res = await invoicesNotapplied(id)
+        if (res.data.code === 0) {
+          self.order = res.data.data;
+        } else {
           uni.showToast({
-            title: '服务器开小差了呢,请您稍后再试',
+            title: res.data.msg,
+            duration: 2000,
             icon: 'none',
           });
-        },
-      });
+        }
+      } catch {
+        uni.showToast({
+          title: '服务器开小差了呢,请您稍后再试',
+          icon: 'none',
+        });
+      }
+      // uni.request({
+      //   url: self.$baseURL + 'api/1.0/invoice/getInvoicedDetail?id=' + id,
+      //   method: 'POST',
+      //   data: data,
+      //   header: JSON.parse(uni.getStorageSync('handleUser')),
+      //   success: (res) => {
+      //     console.log('获取发票详情信息', res.data);
+      //     if (res.data.code === 0) {
+      //       self.order = res.data.data;
+      //     } else {
+      //       uni.showToast({
+      //         title: res.data.msg,
+      //         duration: 2000,
+      //         icon: 'none',
+      //       });
+      //     }
+      //   },
+      //   fail: () => {
+      //     uni.showToast({
+      //       title: '服务器开小差了呢,请您稍后再试',
+      //       icon: 'none',
+      //     });
+      //   },
+      // });
     },
     showHeader() {
       this.$router.push({

+ 22 - 1
src/pages/parkingFee/mixins/parkingReceipt/parkingInvoiceImage.js

@@ -3,6 +3,7 @@ const app = {};
 import downloadBtnIcon from '../../static/images/download.png';
 import { mapState } from 'vuex';
 import uni from '@/utils/uniHooks';
+import { invoicesAgainSandEmail } from '@/api/parking';
 
 export default {
   data() {
@@ -63,7 +64,7 @@ export default {
         },
       });
     },
-    pushAgain(url) {
+    pushAgain: async function (url) {
       const self = this;
       if (self.setTime >= 0 && self.timer) {
         uni.showToast({
@@ -94,6 +95,26 @@ export default {
         text: '停车发票',
       };
       self.$md(data);
+      try {
+        const res = await invoicesAgainSandEmail(id)
+        if (res) {
+          uni.showToast({
+            title: '邮件已发送邮箱,请注意查收',
+            icon: 'none',
+          });
+        } else {
+          uni.showToast({
+            title: res.data.msg,
+            duration: 2000,
+            icon: 'none',
+          });
+        }
+      } catch {
+        uni.showToast({
+          title: '服务器开小差了呢,请您稍后再试',
+          icon: 'none',
+        });
+      }
       uni.request({
         url: self.$baseURL + 'sms/email',
         method: 'POST',

+ 40 - 31
src/pages/parkingFee/mixins/parkingReceipt/parkingOrderDetail.js

@@ -1,5 +1,6 @@
 // const app = getApp()
 import uni from '@/utils/uniHooks';
+import { invoicesOrders } from '@/api/parking';
 
 export default {
   data() {
@@ -21,9 +22,11 @@ export default {
     // 如果是通过"发票申请"页面进入的,可以适用本地缓存直接获取数据
     if (useParkingOrderCache == 'true') {
       this.useParkingOrderCache = true;
-      const tempParkingOrder = this.$store.state?.tempParkingOrder;
-      this.parFee = (tempParkingOrder.invoiceAmount / 100).toFixed(2);
-      const orderList = tempParkingOrder.list;
+      const tempParkingOrder = this.optionsQuery
+      this.parFee = Number(tempParkingOrder.money).toFixed(2);
+      console.log('tempParkingOrder.invoiceDetailList:::', tempParkingOrder.invoiceDetailList)
+      const orderList = JSON.parse(tempParkingOrder.invoiceDetailList);
+      console.log(231,options)
       orderList.forEach((item) => {
         item.invoiceCategory = 0;
       });
@@ -42,45 +45,51 @@ export default {
       this.getInvoicedDetail(this.id);
     }
   },
+  filters: {
+    parkingTime(val) {
+      const days = parseInt(val / 60 / 24);
+      const hours = parseInt((val / 60) % 24);
+      const minutes = parseInt(val % 60);
+      if (days > 0) {
+        return `${days}天 ${hours}小时 ${minutes}分钟`;
+      }
+      if (hours > 0) {
+        return `${hours}小时 ${minutes}分钟`;
+      }
+      return `${minutes}分钟`;
+    },
+  },
   methods: {
     gotoDetail(item) {
       console.log(this.orderList);
+      this.$router.push({
+        path: 'parkingFeeDetailSuccess?orderNo=' + item.id,
+      });
       // this.$router.push({ path: '/pages/parkingFee/parkingFeeDetailSuccess?orderNo=' + item.orderNo });
     },
     // 根据发票id获取支付记录详情信息
-    getInvoicedDetail(id) {
+    getInvoicedDetail: async function(id) {
       const self = this;
-      const data = {
-        id: id,
-      };
       self.$md(data);
-      uni.request({
-        url:
-          self.$baseURL + 'api/1.0/invoice/myParkOrderListByInvoiceId?id=' + id,
-        method: 'POST',
-        data: data,
-        header: JSON.parse(uni.getStorageSync('handleUser')),
-        success: (res) => {
-          console.log('获取订单详情信息', res.data);
-          if (res.data.code === 0) {
-            self.order = res.data.data.list[0];
-            self.parFee = (res.data.data.invoiceAmount / 100).toFixed(2);
-            self.orderList = res.data.data.list;
-          } else {
-            uni.showToast({
-              title: res.data.msg,
-              duration: 2000,
-              icon: 'none',
-            });
-          }
-        },
-        fail: () => {
+      try {
+        const res = await invoicesOrders(id)
+        if (res.data.code === 0) {
+          self.order = res.data.data.list[0];
+          self.parFee = (res.data.data.invoiceAmount / 100).toFixed(2);
+          self.orderList = res.data.data.invoicedOrders;
+        } else {
           uni.showToast({
-            title: '服务器开小差了呢,请您稍后再试',
+            title: res.data.msg,
+            duration: 2000,
             icon: 'none',
           });
-        },
-      });
+        }
+      } catch {
+        uni.showToast({
+          title: '服务器开小差了呢,请您稍后再试',
+          icon: 'none',
+        });
+      }
     },
     getOrderItemPrice(item) {
       if (this.useParkingOrderCache) {

+ 4 - 0
src/store/index.js

@@ -45,6 +45,7 @@ const store = new Vuex.Store({
     isLogin: '1', // 1: 未登录,2:已登录,3:拒绝登录
     accessToken: '', // 用户的token
     tempParkingOrder: {},
+    tempParkingMoney: '',
     // 停车缴费
     bonusCopy: 0,
     source: '', // 访问方:微信小程序:(CRM|KIP)
@@ -115,6 +116,9 @@ const store = new Vuex.Store({
     setTempParkingOrder(state, payload) {
       state.tempParkingOrder = payload;
     },
+    setTempParkingMoney(state, payload) {
+      state.tempParkingMoney = payload;
+    },
     // setbonusCopy
     SET_BONUS_COPY(state, payload) {
       state.bonusCopy = payload;