hejie 3 vuotta sitten
vanhempi
sitoutus
c4b1261259
3 muutettua tiedostoa jossa 106 lisäystä ja 61 poistoa
  1. 46 11
      src/pagesB/invoice/Billingresult.vue
  2. 28 46
      src/pagesB/invoice/invoiceList.vue
  3. 32 4
      src/pagesB/my/assistant.vue

+ 46 - 11
src/pagesB/invoice/Billingresult.vue

@@ -1,7 +1,8 @@
 <template>
   <div class='Billing-result'>
     <div class="head-box">
-        <div class="state">开具中</div>
+        <div class="state">{{typeStatus(obj.status)}}</div>
+        <div class="state-time">{{obj.kprq}}</div>
     </div>
     <div class="content-i">
         <div class="info-box">
@@ -9,26 +10,26 @@
             <img src="@/static/img/invoice.png" class="invoice_ico" alt="">
             <div class="info-item flex_r flex_jb">
                 <div class="label">发票抬头</div>
-                <div class="input">增值税电子普通发票</div>
+                <div class="input">{{obj.gmf_mc}}</div>
             </div>
             <div class="info-item flex_r flex_jb">
                 <div class="label">税号</div>
-                <div class="input">增值税电子普通发票</div>
+                <div class="input">{{obj.gmf_nsrsbh}}</div>
             </div>
             <div class="info-item flex_r flex_jb">
                 <div class="label">价税合计</div>
-                <div class="input">增值税电子普通发票</div>
+                <div class="input">{{obj.money}}</div>
             </div>
             <div class="info-item flex_r flex_jb">
                 <div class="label">电子邮箱</div>
-                <div class="input">增值税电子普通发票</div>
+                <div class="input">{{obj.email}}</div>
             </div>
             <div class="info-item flex_r flex_jb">
                 <div class="label">手机号码</div>
-                <div class="input">增值税电子普通发票</div>
+                <div class="input">{{obj.mobile}}</div>
             </div>
         </div>
-        <div class="check-btn">预览发票</div>
+        <div class="check-btn" v-if="obj.status == 2">预览发票</div>
     </div>
   </div>
 </template>
@@ -37,14 +38,41 @@ import { get, post } from '@/request/api.js';
 export default {
   name: 'Billing-result',
   data () {
-    return {}
+    return {
+        id:undefined,
+        obj:undefined
+    }
+  },
+  onLoad (option) {
+    this.id = option.id;
+    this.getDetail()
   },
-  onLoad (option) {},
   onLaunch () {},
   onShow () {},
   onHide () {},
-  methods: {},
-  computed: {},
+  methods: {
+    getDetail(){
+        let data = {
+            fpqqlsh:this.id
+        }
+        post('invoice/getInfo',data).then(res => {
+            this.obj = res.data
+        })
+    },
+  },
+  computed: {
+    typeStatus(){
+      return (da) => {
+        let str;
+        if (da === 1) str = "已开票";
+        if (da === 2) str = "开票失败";
+        if (da === 4) str = "红冲发票";
+        if (da === 5) str = "开票中";
+        if (da === 6) str = "发票作废";
+        return str;
+      };
+    }
+  },
   watch: {}
 }
 </script>
@@ -65,6 +93,13 @@ page {
             color: #fff;
             font-weight: bold;
         }
+        .state-time{
+            text-align: center;
+            // color: rgba($color: #000000, $alpha: 0.5);
+            color: #fff;
+            margin-top: 10rpx;
+            // font-weight: bold;
+        }
         // &::before{
         //     content: '';
         //     width: calc(100% - 72rpx);

+ 28 - 46
src/pagesB/invoice/invoiceList.vue

@@ -1,21 +1,15 @@
 <template>
   <div class="iApp">
     <div class="log_list" :style="{ height: height }">
-      <div class="list_box" v-for="(item, index) of list" :key="index">
+      <div class="list_box" v-for="(item, index) of list" :key="index" @click="toDetail(item.fpqqlsh)">
         <div class="list_item">
             <div class="p1 flex_r flex_jb c05">
-              <span>订单号:{{ item.order_sn }}</span>
-              <span>{{ $day(item.add_time * 1000).format("YYYY-MM-DD") }}</span>
+              <span>状态:{{ typeStatus(item.status) }}</span>
+              <span>{{item.create_time}}</span>
             </div>
             <div class="p2 flex_r flex_jb">
-              <img :src="item.original_img" class="odr_img" alt />
-              <div class="odr_info flex_c flex_jb">
-                <div class="tit ellipsis1">{{ item.goods_name }}</div>
-                <div class="num">数量 x{{ item.goods_num }}</div>
-                <div class="money flex_r flex_jb">
-                  <span>金额{{ item.total_amount }}</span>
-                </div>
-              </div>
+                <div class="tit ellipsis1">电子发票</div>
+                <span class="money">金额{{ item.money }}</span>
             </div>
         </div>
       </div>
@@ -69,7 +63,7 @@ export default {
         page: this.page,
         rows: this.rows,
       };
-      post("invoice/orderList", data).then((res) => {
+      post("invoice/myInvoice", data).then((res) => {
         if (res.code == 0) {
           this.list = this.list.concat(res.data.data);
           this.total = res.data.total;
@@ -79,42 +73,26 @@ export default {
         }
       });
     },
-    checkboxChange(e, item) {
-      this.trueTotal = 0;
-      this.money = 0;
-      if (item.isclick == true) {
-        this.$set(item, "isclick", false);
-      } else {
-        this.$set(item, "isclick", true);
-      }
-      for (let i of this.list) {
-        if (i.isclick) {
-          this.trueTotal++;
-          this.money = this.money + i.total_amount * 1;
-        }
-      }
-    },
-    toEditinvoice() {
-      if (this.trueTotal == 0) {
-        appEv.errTips("请先选择订单");
-        return;
-      }
-      let list = []
-      ;
-      for (let i of this.list) {
-        if (i.isclick == true) {
-          list.push(i.order_sn);
-        }
-      }
-      console.log(list,"qqqq");
-      uni.navigateTo({
-        url: "/pagesB/invoice/editinvoice?icheckList="+ list.toString() + '&money=' + this.money,
-      });
-      // this.goto("/pagesB/invoice/editinvoice",{checkList : list.toString(),money:this.money});
+    toDetail(id){
+      this.goto("/pagesB/invoice/Billingresult",{id : id});
     },
   },
-  computed: {},
-  watch: {},
+  computed: {
+    typeStatus(){
+      return (da) => {
+        let str;
+        if (da === 1) str = "已开票";
+        if (da === 2) str = "开票失败";
+        if (da === 4) str = "红冲发票";
+        if (da === 5) str = "开票中";
+        if (da === 6) str = "发票作废";
+        return str;
+      };
+    }
+  },
+  watch: {
+
+  },
 };
 </script>
 <style scoped lang='scss'>
@@ -235,5 +213,9 @@ export default {
       }
     }
   }
+
+  .money{
+    color:#2db389;
+  }
 }
 </style>

+ 32 - 4
src/pagesB/my/assistant.vue

@@ -1,5 +1,10 @@
 <template>
   <div class="iApp">
+    <div class="history">
+      <div class="btn" @click="toHistory">
+        <span>开票历史</span>
+      </div>
+    </div>
     <div class="log_list" :style="{ height: height }">
       <div class="list_box" v-for="(item, index) of list" :key="index">
         <div class="list_item flex_r flex_jb">
@@ -124,20 +129,26 @@ export default {
         }
       }
     },
+    toHistory(){
+      this.goto("/pagesB/invoice/invoiceList");
+    },
     toEditinvoice() {
       if (this.trueTotal == 0) {
         appEv.errTips("请先选择订单");
         return;
       }
-      let list = []
-      ;
+      let list = [];
       for (let i of this.list) {
         if (i.isclick == true) {
           list.push(i.order_id);
         }
       }
       uni.navigateTo({
-        url: "/pagesB/invoice/editinvoice?icheckList="+ list.toString() + '&money=' + this.money,
+        url:
+          "/pagesB/invoice/editinvoice?icheckList=" +
+          list.toString() +
+          "&money=" +
+          this.money,
       });
       // this.goto("/pagesB/invoice/editinvoice",{checkList : list.toString(),money:this.money});
     },
@@ -150,8 +161,25 @@ export default {
 .iApp {
   width: 100%;
   height: 100%;
+  .history {
+    display: flex;
+    justify-content: flex-end;
+    // background-color: red;
+    align-items: center;
+    margin-right: 30rpx;
+    margin-top: 30rox;
+    height: 100rpx;
+    .btn {
+      padding: 10rpx 20rpx;
+      background-color: #2db389;
+      border-radius: 10rpx;
+      span{
+        color: #fff;
+      }
+    }
+  }
   .log_list {
-    padding: 32rpx 32rpx;
+    padding:0rpx 32rpx 32rpx;
     overflow: scroll;
     .log_title {
       line-height: 40rpx;