浏览代码

feat:更新发票管理

jinx 3 年之前
父节点
当前提交
385a6cf8b0
共有 2 个文件被更改,包括 38 次插入36 次删除
  1. 30 28
      src/page/invoice/index.vue
  2. 8 8
      src/page/layout/slide.vue

+ 30 - 28
src/page/invoice/index.vue

@@ -227,6 +227,7 @@ export default {
 
   data () {
     return {
+      status: 0,
       dialogVisible: false,
       fileVal: '',
       tableHeader,
@@ -426,25 +427,25 @@ export default {
         // temp[i]['expressNum_input'] = "";
         temp[i].items = []
         temp[i]['typeStr'] = TypeArr[temp[i]['type']]
-        temp[i].orderItems = 
-          temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderItems'] :
-          temp[i]['responseVirtualOrder'] ? [{
-            goodsName: temp[i]['responseVirtualOrder'].body,
-            goodsCount: temp[i]['responseVirtualOrder'].orderCount,
-            goodsPrice: temp[i]['responseVirtualOrder'].amount,
-            abroad: temp[i]['responseVirtualOrder'].abroad
-          }] : 
-          temp[i]['responseIncrementOrder'] ? [{
-            goodsName: '会员权益',
-            goodsCount: temp[i]['responseIncrementOrder'].count,
-            goodsPrice: temp[i]['responseIncrementOrder'].amount,
-            abroad: temp[i]['responseIncrementOrder'].abroad
-          }] : ''
-          
-        temp[i]['orderSn'] = 
-          temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderSn'] : 
-          temp[i]['responseIncrementOrder'] ? temp[i]['responseIncrementOrder']['orderSn'] : 
-          temp[i]['responseVirtualOrder'] ? temp[i]['responseVirtualOrder']['orderSn'] : ''
+        temp[i].orderItems =
+          temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderItems']
+            : temp[i]['responseVirtualOrder'] ? [{
+              goodsName: temp[i]['responseVirtualOrder'].body,
+              goodsCount: temp[i]['responseVirtualOrder'].orderCount,
+              goodsPrice: temp[i]['responseVirtualOrder'].amount,
+              abroad: temp[i]['responseVirtualOrder'].abroad
+            }]
+              : temp[i]['responseIncrementOrder'] ? [{
+                goodsName: '会员权益',
+                goodsCount: temp[i]['responseIncrementOrder'].count,
+                goodsPrice: temp[i]['responseIncrementOrder'].amount,
+                abroad: temp[i]['responseIncrementOrder'].abroad
+              }] : ''
+
+        temp[i]['orderSn'] =
+          temp[i]['orderDetail'] ? temp[i]['orderDetail']['orderSn']
+            : temp[i]['responseIncrementOrder'] ? temp[i]['responseIncrementOrder']['orderSn']
+              : temp[i]['responseVirtualOrder'] ? temp[i]['responseVirtualOrder']['orderSn'] : ''
       }
       this.orders = temp
       this.currentPage = page
@@ -452,14 +453,14 @@ export default {
     },
     _exportExcelForOrder () {
       let date1, date2, userName, expressNum, orderNum
-      this.date1 = this.searchDate ? this.searchDate[0] : null
-      this.date2 = this.searchDate ? this.searchDate[1] : null
-      date1 = this.date1 ? (this.date1 + ' 00:00:00') : null
-      date2 = this.date2 ? (this.date2 + ' 23:59:59') : null
+      this.date1 = this.searchDate ? this.searchDate[0] : ''
+      this.date2 = this.searchDate ? this.searchDate[1] : ''
+      date1 = this.date1 ? (this.date1 + ' 00:00:00') : ''
+      date2 = this.date2 ? (this.date2 + ' 23:59:59') : ''
 
-      this.userName = userName = this.searchPhone || null
-      this.expressNum = expressNum = this.searchExpressNum || null
-      this.orderNum = orderNum = this.searchOrderNumber || null
+      this.userName = userName = this.searchPhone || ''
+      this.expressNum = expressNum = this.searchExpressNum || ''
+      this.orderNum = orderNum = this.searchOrderNumber || ''
 
       let data = {
         'type': this.status,
@@ -478,13 +479,14 @@ export default {
       }).then(async () => {
         let exec = await this.$http({
           methods: 'get',
-          params: data,
-          url: '/manager/order/export',
+          url: `/manager/order/export?type=${this.status}&startDate=${date1}&endDate=${date2}&orderSn=${orderNum}&phoneNum=${this.userName}&expressNum=${expressNum}`,
           responseType: 'arraybuffer'
         })
+
         try {
           let blob = new Blob([exec], {type: 'application/vnd.ms-excel'})
           let url = URL.createObjectURL(blob)
+          console.log(url)
           location.href = url
         } catch (e) {
           console.error(e)

+ 8 - 8
src/page/layout/slide.vue

@@ -77,14 +77,14 @@ export default {
       },
       // { text: '版本管理', link: {name: 'edition'}, top: 182 },
       { text: '数据统计', link: {name: 'Statistics'}, top: 210 },
-      {
-        text: 'SDK 发布管理',
-        link: {name: 'sdkManage'},
-        children: [
-          { text: 'Space target', link: {name: 'spaceTarget'}, top: 182 }
-        ],
-        top: 154
-      },
+      // {
+      //   text: 'SDK 发布管理',
+      //   link: {name: 'sdkManage'},
+      //   children: [
+      //     { text: 'Space target', link: {name: 'spaceTarget'}, top: 182 }
+      //   ],
+      //   top: 154
+      // },
       { text: '用户列表', link: {name: 'userList'}, top: 126 },
       { text: '操作日志', link: {name: 'oplog'}, top: 210 }
       // { text: '会员权益', link: {name: 'Statistics'}, top: 210 },