From a7c9f5b6fba42e5e4d567c46498f633aab4d4fdc Mon Sep 17 00:00:00 2001
From: zhangxiaoxu123 <819527061@qq.com>
Date: 星期四, 29 十二月 2022 11:36:47 +0800
Subject: [PATCH] 发票

---
 src/components/page/invoice/invoiceForm.vue |  125 ++++++++++++++++++++++++++---------------
 .babelrc                                    |    9 +++
 2 files changed, 88 insertions(+), 46 deletions(-)

diff --git a/.babelrc b/.babelrc
new file mode 100644
index 0000000..7b9510a
--- /dev/null
+++ b/.babelrc
@@ -0,0 +1,9 @@
+{
+  "plugins": [
+    ["import", {
+      "libraryName": "vant",
+      "libraryDirectory": "es",
+      "style": true
+    }]
+  ]
+}
diff --git a/src/components/page/invoice/invoiceForm.vue b/src/components/page/invoice/invoiceForm.vue
index 2d6020f..f2dc820 100644
--- a/src/components/page/invoice/invoiceForm.vue
+++ b/src/components/page/invoice/invoiceForm.vue
@@ -2,45 +2,54 @@
     <div class="invoiceForm-wrap">
         <div class="title">璁㈠崟鍙戠エ</div>
         <div class="invoiceForm-main">
-            <div>
-                <el-checkbox
-                    v-model="item.isShow"
-                    :label="item.isShow"
-                    class="invoiceForm-block"
-                    v-for="(item,index) in invoiceData"
-                    :key="index"
-                    @change="handleCheckedCitiesChange(invoiceData)">
-                    <div>
-                        <div class="invoiceForm-content">
+            <div class="invoiceForm-main-inside">
+                <van-list
+                    v-model="loading"
+                    :finished="finished"
+                    finished-text="娌℃湁鏇村浜�"
+                    :offset="50"
+                    :immediate-check="false"
+                    @load="onLoad"
+                >
 
-                            <svg class="iconSvg" style="font-size: 12px" aria-hidden="true">
-                                <use xlink:href="#icon-shijian3"></use>
-                            </svg>
-                            {{item.enterTime}}
-                        </div>
-                        <div class="invoiceForm-content">
+                    <div v-for="(item,index) in invoiceData" :key="index">
+                        <el-checkbox
+                                v-model="item.isShow"
+                                :label="item.isShow"
+                                class="invoiceForm-block"
+                                @change="handleCheckedCitiesChange(invoiceData)">
+                            <div>
+                                <div class="invoiceForm-content">
 
-                            <svg class="iconSvg" style="font-size: 12px" aria-hidden="true">
-                                <use xlink:href="#icon-shijian3"></use>
-                            </svg>
-                            {{item.outTime}}
-                        </div>
-                        <div class="invoiceForm-content">
-                            <svg class="iconSvg" style="font-size: 12px" aria-hidden="true">
-                                <use xlink:href="#icon-dizhi1"></use>
-                            </svg>
-                            {{item.address}}
-                        </div>
+                                    <svg class="iconSvg" style="font-size: 12px" aria-hidden="true">
+                                        <use xlink:href="#icon-shijian3"></use>
+                                    </svg>
+                                    {{item.enterTime}}
+                                </div>
+                                <div class="invoiceForm-content">
+
+                                    <svg class="iconSvg" style="font-size: 12px" aria-hidden="true">
+                                        <use xlink:href="#icon-shijian3"></use>
+                                    </svg>
+                                    {{item.outTime}}
+                                </div>
+                                <div class="invoiceForm-content">
+                                    <svg class="iconSvg" style="font-size: 12px" aria-hidden="true">
+                                        <use xlink:href="#icon-dizhi1"></use>
+                                    </svg>
+                                    {{item.address}}
+                                </div>
+                            </div>
+                            <div>
+                                <h1 class="money-box">{{item.money}}</h1>
+                            </div>
+                        </el-checkbox>
                     </div>
-                    <div>
-                        <h1 class="money-box">{{item.money}}</h1>
-                    </div>
-                </el-checkbox>
+                </van-list>
                 <div class="fapiao-btn">
                     <el-checkbox v-model="checkAll" @change="handleCheckAllChange">鍏ㄩ��</el-checkbox>
                     <el-button size="mini" @click="seeInvoice">涓嬭浇鍙戠エ</el-button>
                 </div>
-
             </div>
         </div>
 
@@ -48,48 +57,67 @@
 </template>
 
 <script>
+    import { List } from 'vant';
     export default {
         name: "invoiceForm",
+        components: {
+            vanList: List
+        },
         data() {
             return {
                 checkedInvoices: [1,2],
                 invoiceData:[],
                 checkAll:false,
-
+                loading: false,
+                finished: false,
+                current:1,
+                size:8,
+                total:''
             }
         },
         mounted() {
-            console.log(this.$route,'$route======$route')
             this.getByCarNo()
         },
         methods: {
+            onLoad() {
+               this.loading = true
+               this.current += 1
+               this.getByCarNo()
+
+            },
             getByCarNo() {
                 let url = this.$systemconfig.basePath + '/orderrecord/getByCarNo';
-                // let params = {
-                //     carNo: this.$route.query.carNo
-                // }
-                this.$byutil.postData(this,url,{carNo: this.$route.query.carNo},
-                    res => {
-                    this.invoiceData = res.data
-                    console.log(this.invoiceData,'invoiceData====')
+                let params = {
+                    carNo: this.$route.query.carNo,
+                    current: this.current,
+                    size: this.size
+                }
+                this.$byutil.postData(this,url,params,res => {
+                    let row = res.data.records
+                    this.total = res.data.total
+                    if(row == null) {
+                        this.finished = true
+                        return
+                    }else {
+                        this.loading = false
+                        this.invoiceData = [...this.invoiceData,...row]
+                        this.invoiceData.length >= this.total ? (this.finished = true) : (this.finished = false)
+                    }
+
                 })
             },
             handleCheckAllChange(val) {
-                console.log(val,'val========')
                 let ids = []
                 this.invoiceData.forEach(item => {
                     ids.push(item.id)
                     item.isShow = val
                 })
-                console.log(this.invoiceData,'this.invoiceData======')
             },
             handleCheckedCitiesChange(value) {
-                console.log(value,'value===')
                 let checkedCount = value.length;
                 let ids = value.filter(item => {
                     return item.isShow == true
                 })
-                console.log(ids,'ids========')
                 this.checkAll = checkedCount === ids.length;
             },
             seeInvoice() {  //鏌ョ湅鍙戠エ
@@ -145,7 +173,11 @@
         width: 100%;
         padding: 0 1.33vw  /* 10/7.5 */ 1.33vw  /* 10/7.5 */ 1.33vw  /* 10/7.5 */;
         box-sizing: border-box;
-        //background: #fff;
+        height: calc(100% - 11.73vw);
+        .invoiceForm-main-inside{
+            padding-bottom: 8vw  /* 60/7.5 */;
+        }
+
     }
     .invoiceForm-content{
         font-size: 3.73vw  /* 28/7.5 */;
@@ -166,6 +198,7 @@
         display: flex;
         background: #fafafa;
         border-top: 1px solid #e5e5e5;
+        z-index: 9;
     }
     .money-box{
         font-size: 4.8vw  /* 36/7.5 */;

--
Gitblit v1.9.1