浏览代码

Merge pull request #21 from tron/lock/Microservices/inovice

Lock/microservices/inovice
John-Hong 2 年之前
父节点
当前提交
e9d1715576

+ 3 - 3
src/api/parking/index.js

@@ -110,14 +110,14 @@ export function invoicesEdittitles(params, id) {
 
 
 // 删除发票抬头
 // 删除发票抬头
 
 
-export function invoicesDelecttitles(params) {
-  return window.requestms.get(`/invoices/completed`, params, { loading: true });
+export function invoicesDeletetitles(id) {
+  return window.requestms.delete(`/invoice-titles/${id}`, { loading: true });
 }
 }
 
 
 // 发票抬头列表
 // 发票抬头列表
 
 
 export function invoicesDetail(params) {
 export function invoicesDetail(params) {
-  return window.requestms.get(`/invoice-titles`, params, { loading: true });
+  return window.requestms.get(`/invoice-titles`, { params, loading: true });
 }
 }
 
 
 // 再次发送发票附件
 // 再次发送发票附件

+ 4 - 2
src/main.js

@@ -17,7 +17,7 @@ import {
   CountDown,
   CountDown,
   Switch,
   Switch,
   Skeleton,
   Skeleton,
-  Dialog,
+  Dialog
 } from 'vant';
 } from 'vant';
 import router from './routes/index.js'; // 注册页面路由
 import router from './routes/index.js'; // 注册页面路由
 import wx from '@/utils/js_sdk/weixin'; // 接入微信JSDK
 import wx from '@/utils/js_sdk/weixin'; // 接入微信JSDK
@@ -51,7 +51,9 @@ Vue.use(Icon)
   .use(CountDown)
   .use(CountDown)
   .use(Skeleton)
   .use(Skeleton)
   .use(Switch)
   .use(Switch)
-  .use(Dialog);
+  .use(Dialog)
+
+  
 
 
 Vue.config.ignoredElements = ['wx-open-launch-weapp'];
 Vue.config.ignoredElements = ['wx-open-launch-weapp'];
 
 

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

@@ -186,5 +186,7 @@ export default {
   .lines {
   .lines {
     border-bottom: 2px solid #ececec;
     border-bottom: 2px solid #ececec;
   }
   }
+  
+  
 }
 }
 </style>
 </style>

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

@@ -21,7 +21,7 @@
         <div class="part-item">
         <div class="part-item">
           <span class="part-item-key">开票日期</span>
           <span class="part-item-key">开票日期</span>
           <span class="part-item-value">{{
           <span class="part-item-value">{{
-              order.invoiceTime ? order.invoiceTime : '-'
+              order.invoiceDate ? order.invoiceDate : '-'
             }}</span>
             }}</span>
         </div>
         </div>
         <div class="part-item">
         <div class="part-item">
@@ -45,14 +45,14 @@
         <div class="part-item">
         <div class="part-item">
           <span class="part-item-key">总金额</span>
           <span class="part-item-key">总金额</span>
           <span class="part-item-value"
           <span class="part-item-value"
-          ><span class="purple">{{ order.invoiceAmount }}</span
+          ><span class="purple">{{ order.invoiceTotalAmount }}</span
           >元</span
           >元</span
           >
           >
         </div>
         </div>
         <div class="part-item">
         <div class="part-item">
-        <!-- <span class="part-item-key"
-        >共<span class="purple">{{ order.invoiceItem.length }}笔</span>缴费记录</span
-        > -->
+        <span class="part-item-key"
+        >共<span class="purple">{{ order.totalOrderCount }}笔</span>缴费记录</span
+        >
           <div class="part-item-value" @click="gotoRecordDetail">
           <div class="part-item-value" @click="gotoRecordDetail">
             <span>查看详情</span>
             <span>查看详情</span>
             <img class="invoice-header-arrow" :src="arrowIcon" mode="widthFix" />
             <img class="invoice-header-arrow" :src="arrowIcon" mode="widthFix" />

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

@@ -36,7 +36,7 @@
     <!-- 开票列表 -->
     <!-- 开票列表 -->
     <scroll-view class="choice_card" :style="{ height: height }" @scrolltolower="scrollLower">
     <scroll-view class="choice_card" :style="{ height: height }" @scrolltolower="scrollLower">
       <div class="suggestion-list">
       <div class="suggestion-list">
-        <van-checkbox-group v-model="ids" v-if="isJingAn" @change="radioChange" style="background-color: #f2f2f2">
+        <van-checkbox-group  v-model="ids" v-if="isJingAn" @change="radioChange" style="background-color: #f2f2f2">
           <label
           <label
             class="uni-list-cell uni-list-cell-pd"
             class="uni-list-cell uni-list-cell-pd"
             @click="goToDeatil(item)"
             @click="goToDeatil(item)"
@@ -106,7 +106,7 @@
                 <!-- 0:已提交申请(待开票) 1:开票中  2:开票完成 3:开票失败 -->
                 <!-- 0:已提交申请(待开票) 1:开票中  2:开票完成 3:开票失败 -->
                 <div
                 <div
                   class="choice_card_status"
                   class="choice_card_status"
-                  v-if="item.status === 2"
+                  v-if="item.status === 'COMPLETE'"
                   style="color: #8cc63f"
                   style="color: #8cc63f"
                 >
                 >
                   开票完成
                   开票完成
@@ -145,7 +145,7 @@
 
 
           </label>
           </label>
         </van-checkbox-group>
         </van-checkbox-group>
-        <van-checkbox-group v-model="ids" v-else @change="checkboxChange">
+        <van-checkbox-group  v-model="ids" v-else @change="checkboxChange">
           <label
           <label
             class="uni-list-cell uni-list-cell-pd"
             class="uni-list-cell uni-list-cell-pd"
             @click="goToDeatil(item)"
             @click="goToDeatil(item)"
@@ -186,6 +186,8 @@
                     shape="square"
                     shape="square"
                     :name="item.id"
                     :name="item.id"
                     icon-size="20"
                     icon-size="20"
+                    ref="checkboxes"
+                    @click="checkboxchange2($event, index)"
                   />
                   />
                 </div>
                 </div>
               </div>
               </div>
@@ -211,10 +213,10 @@
                   {{ item.createTime ? item.createTime : '-' }}
                   {{ item.createTime ? item.createTime : '-' }}
                 </div
                 </div
                 >
                 >
-                <!-- 0:已提交申请(待开票) 1:开票中  2:开票完成 3:开票失败  COMPLETE-->
+                <!-- 0:已提交申请(待开票) 1:开票中  2:开票完成 3:开票失败  -->
                 <div
                 <div
                   class="choice_card_status"
                   class="choice_card_status"
-                  v-if="item.status === 'SUBMITTED'"
+                  v-if="item.status === 'COMPLETE'"
                   style="color: #8cc63f"
                   style="color: #8cc63f"
                 >
                 >
                   开票完成
                   开票完成
@@ -317,6 +319,7 @@ export default {
   height: 100vh;
   height: 100vh;
   // padding-bottom: 100px;
   // padding-bottom: 100px;
   background: #f2f2f2;
   background: #f2f2f2;
+  margin-bottom: 40px;
 
 
   .choice {
   .choice {
     width: 750px;
     width: 750px;
@@ -440,6 +443,7 @@ export default {
   flex-direction: column;
   flex-direction: column;
   //background: #fff;
   //background: #fff;
   border-radius: 15px;
   border-radius: 15px;
+  padding-bottom:120px;
 }
 }
 
 
 //:global {
 //:global {

+ 3 - 0
src/pages/parkingFee/mixins/parkingReceipt/parkingApplication.js

@@ -416,6 +416,9 @@ export default {
   try {
   try {
     const res = await submitInvoice(params)
     const res = await submitInvoice(params)
     if (res) {
     if (res) {
+      Toast({
+        message: '开票成功',
+      });
       this.$router.replace({
       this.$router.replace({
         path: 'parkingReceipt',
         path: 'parkingReceipt',
       });
       });

+ 23 - 35
src/pages/parkingFee/mixins/parkingReceipt/parkingChooseHeader.js

@@ -5,8 +5,8 @@ import delwIcon from '../../static/images/delete.png';
 import noDataIcon from '../../static/images/nodataicon.png';
 import noDataIcon from '../../static/images/nodataicon.png';
 import { mapState } from 'vuex';
 import { mapState } from 'vuex';
 import uni from '@/utils/uniHooks';
 import uni from '@/utils/uniHooks';
-import { invoicesDetail } from '@/api/parking';
-
+import { invoicesDetail, invoicesDeletetitles } from '@/api/parking';
+import { Dialog } from 'vant';
 export default {
 export default {
   data() {
   data() {
     return {
     return {
@@ -78,40 +78,28 @@ export default {
         
         
     },
     },
     // 删除抬头
     // 删除抬头
-    delHeader(id) {
+    delHeader: async function (id) {
+      console.log(1111, id)
       const self = this;
       const self = this;
-      self.$md([id]);
-      uni.showModal({
-        content: '确认要删除该发票抬头吗?',
-        success: function (res) {
-          if (res.confirm) {
-            uni.request({
-              url: self.$baseURL + 'api/1.0/invoiceTitle',
-              method: 'delete',
-              data: [id],
-              header: JSON.parse(uni.getStorageSync('handleUser')),
-              success: (res) => {
-                console.log('删除抬头', res.data);
-                if (res.data.code === 0) {
-                  self.getInvoiceTitle();
-                } else {
-                  uni.showToast({
-                    title: res.data.msg,
-                    duration: 2000,
-                    icon: 'none',
-                  });
-                }
-              },
-              fail: () => {
-                uni.showToast({
-                  title: '服务器开小差了呢,请您稍后再试',
-                  icon: 'none',
-                });
-              },
-            });
-          }
-        },
-      });
+      
+      Dialog.confirm({
+        message: '确认要删除该发票抬头吗?',
+        confirmButtonColor: '#644A79'
+      })
+        .then(() => {
+            invoicesDeletetitles(id).then(res=>{
+              console.log(11, res)
+              self.getInvoiceTitle()
+            }).catch(err=>{
+              uni.showToast({
+                title: '服务器开小差了呢,请您稍后再试',
+                icon: 'none',
+              });
+            })
+        })
+        .catch(() => {
+          // on cancel
+        });
     },
     },
     // 选择抬头
     // 选择抬头
     chooseHeader(item, index) {
     chooseHeader(item, index) {

+ 38 - 3
src/pages/parkingFee/mixins/parkingReceipt/parkingReceipt.js

@@ -13,6 +13,7 @@ import { myNotInvoicedList } from '../../list';
 import { wxToLoginCallback } from '@/utils';
 import { wxToLoginCallback } from '@/utils';
 import CacheTool from '@/utils/cache-tool'
 import CacheTool from '@/utils/cache-tool'
 import { invoicesCompleted, invoicesNotapplied } from '@/api/parking';
 import { invoicesCompleted, invoicesNotapplied } from '@/api/parking';
+import { Dialog } from 'vant';
 export default {
 export default {
   data() {
   data() {
     return {
     return {
@@ -36,7 +37,9 @@ export default {
       totalNum: 0.0,
       totalNum: 0.0,
       options: null,
       options: null,
       preUrl: '',
       preUrl: '',
-      invoiceDetailList: []
+      invoiceDetailList: [],
+      boxids: [],
+      choosekMax: 2
     };
     };
   },
   },
   components: {
   components: {
@@ -106,6 +109,13 @@ export default {
     },
     },
   },
   },
   methods: {
   methods: {
+    checkboxchange2 (e, index) {
+      if (this.boxids.length > 2) {
+        console.log(2222222222)
+        this.$refs.checkboxes[index].toggle();
+      }
+      console.log('eeeeeeee:::', e, index)
+    },
     invoice(e) {
     invoice(e) {
       this.tabIndex = e;
       this.tabIndex = e;
       this.current = -1;
       this.current = -1;
@@ -116,7 +126,7 @@ export default {
       this.getInvoiceList();
       this.getInvoiceList();
     },
     },
     goToDeatil(item) {
     goToDeatil(item) {
-      if (this.tabIndex === 2 || item.status === 'COMPLETE') {
+      if (this.tabIndex === 2 && item.status === 'COMPLETE') {
         this.$router.push({
         this.$router.push({
           path: 'parkingInvoice?id=' + item.id,
           path: 'parkingInvoice?id=' + item.id,
         });
         });
@@ -152,6 +162,18 @@ export default {
           this.current = i;
           this.current = i;
           this.ids = [this.list[i].id];
           this.ids = [this.list[i].id];
           this.totalNum = this.list[i].totalPaidAmount;
           this.totalNum = this.list[i].totalPaidAmount;
+          if (this.ids > 2) {
+            Dialog.confirm({
+              message: '确认要删除该发票抬头吗?',
+              confirmButtonColor: '#644A79'
+            })
+              .then(() => {
+                
+              })
+              .catch(() => {
+                // on cancel
+              });
+          }
           break;
           break;
         }
         }
       }
       }
@@ -248,7 +270,7 @@ export default {
             // }, 3000);
             // }, 3000);
             const listarr = res.content
             const listarr = res.content
             if (listarr.length > 0) {
             if (listarr.length > 0) {
-              this.list = res.content
+              this.list = this.list.concat(res.content)
             }
             }
             // this.list = this.list.concat(res.content);
             // this.list = this.list.concat(res.content);
             console.log(111, res.content)
             console.log(111, res.content)
@@ -328,7 +350,20 @@ export default {
       // });
       // });
     },
     },
     checkboxChange(ids) {
     checkboxChange(ids) {
+      this.boxids = ids
       console.log(423, ids);
       console.log(423, ids);
+      if (ids.length > this.choosekMax) {
+        
+        Dialog.alert({
+          title: '选择上限提示',
+          message: '合并开票订单数量上限为200条,超出的部分请多次开具',
+          confirmButtonText: '关闭',
+          confirmButtonColor: '#644A79'
+        }).then(() => {
+          // on close
+        });
+          return;
+      }
       this.calculatePrice(ids);
       this.calculatePrice(ids);
       return;
       return;
       const itemId = e.detail.value;
       const itemId = e.detail.value;