zhiquz@163.com пре 3 година
родитељ
комит
fbc2f2ef9a

+ 2 - 2
.env.production

@@ -2,6 +2,6 @@
 ENV = 'production'
 
 # base api
-#VUE_APP_BASE_API = '//api.admin.app.jiuweiyun.cn/api'
+VUE_APP_BASE_API = '//api.admin.app.jiuweiyun.cn/api'
 
-VUE_APP_BASE_API = '//api.appadmin.woaidakele.cn/api'
+#VUE_APP_BASE_API = '//api.appadmin.woaidakele.cn/api'

+ 17 - 0
src/api/order/store.js

@@ -18,3 +18,20 @@ export function downOrder(params) {
   })
 }
 
+// 拆单
+export function BreakUpOrder(params) {
+  return request({
+    url: '/data/orderStoreBreakUpCourier',
+    method: 'get',
+    params
+  })
+}
+
+// 订单金额
+export function list_down(params) {
+  return request({
+    url: '/data/order_store_list_down',
+    method: 'get',
+    params
+  })
+}

+ 20 - 0
src/pages/dataScreen/hint.vue

@@ -0,0 +1,20 @@
+<template>
+  <div class="content">
+    <div class="title">
+      <h3>微信版本过低,无法打开。请升级微信版本后重试。</h3>
+    </div>
+  </div>
+</template>
+<script>
+document.title = '升级提醒'
+</script>
+<style lang="scss" scoped>
+    .content {
+        padding:200px 50px;
+        .title {
+            margin: 0 auto;
+            line-height: 30px;
+            text-align:center
+        }
+    }
+</style>

+ 122 - 86
src/pages/order/list.vue

@@ -49,7 +49,7 @@
         <el-button v-permit="2" :roles-permit="roles" type="primary" class="bg3" @click="machExamine(2)">发货审核</el-button>
         <el-button v-permit="3" :roles-permit="roles" type="primary" @click="showMergeOrder">合并订单</el-button>
         <!-- <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" icon="el-icon-download" @click="dialog.export_order = true">导出</el-button> -->
-        <el-button v-permit="2" :roles-permit="roles" type="primary" icon="el-icon-upload2" @click="dialog.lead_order = true">导入</el-button>
+        <!-- <el-button v-permit="2" :roles-permit="roles" type="primary" icon="el-icon-upload2" @click="dialog.lead_order = true">导入</el-button> -->
         <!-- <el-button v-permit="2" :roles-permit="roles" type="primary" icon="el-icon-refresh" @click="dialog.import_wuliunew = true">物流更新</el-button> -->
         <!-- <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item" @click="exportOrder">导出订单信息</el-button>
         <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item" @click="exporOrdertOrder">导出拆单信息</el-button> -->
@@ -57,7 +57,28 @@
         <el-button v-permit="2" :roles-permit="roles" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item">导入物流</el-button> -->
         <!-- <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" @click="exportOrder">导出订单数据</el-button>
         <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" @click="exporOrdertOrder">导出拆单数据</el-button> -->
-        <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" icon="el-icon-download" @click="dialog.export_order = true">导出</el-button>
+        <!-- <el-button v-permit="[0,1,2]" :roles-permit="roles" type="primary" icon="el-icon-download" @click="dialog.export_order = true">导出</el-button> -->
+        <el-popover
+          placement="bottom"
+          width="230"
+          trigger="hover"
+        >
+          <el-button type="primary" @click="dialog.import_wuliu = true">导入单号</el-button>
+          <el-button type="primary" @click="dialog.import_wuliunew = true">修改单号</el-button>
+          <!-- <el-button slot="reference" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item">导出</el-button> -->
+          <el-button slot="reference" v-permit="2" :roles-permit="roles" type="primary" icon="el-icon-upload2" @click="dialog.lead_order = true">导入</el-button>
+        </el-popover>
+        <el-popover
+          placement="bottom"
+          width="330"
+          trigger="hover"
+        >
+          <el-button type="primary" @click="exportOrder">订单明细</el-button>
+          <el-button type="primary" @click="exporOrdertOrder">拆单明细</el-button>
+          <el-button type="primary" @click="exportMoney">订单金额</el-button>
+          <!-- <el-button slot="reference" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item">导出</el-button> -->
+          <el-button slot="reference" v-permit="[0,1,2]" :roles-permit="roles" type="primary" icon="el-icon-download" @click="dialog.export_order = true">导出</el-button>
+        </el-popover>
       </div>
     </div>
     <!-- 合并订单 -->
@@ -448,26 +469,24 @@
           <el-input v-model="exportForm.good" type="text" placeholder="输入商品名称" style="width: 400px" />
         </el-form-item>
         <el-form-item label="订单状态">
-          <el-tree
-            ref="status_tree"
-            :data="statusTree"
-            show-checkbox
-            default-expand-all
-            node-key="id"
-            highlight-current
-            :expand-on-click-node="false"
-          />
+          <div style="display:flex;">
+            <div style="margin-right:20px">
+              <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">全选</el-checkbox>
+            </div>
+            <el-checkbox-group v-model="exportForm.order_status" @change="handleCheckedCitiesChange">
+              <el-checkbox v-for="(item,index) in statusTree" :key="index" :value="item.id" :label="item.id">{{ item.label }}</el-checkbox>
+            </el-checkbox-group>
+          </div>
         </el-form-item>
         <el-form-item label="支付状态">
-          <el-tree
-            ref="pay_status_tree"
-            :data="paystatusTree"
-            show-checkbox
-            default-expand-all
-            node-key="id"
-            highlight-current
-            :expand-on-click-node="false"
-          />
+          <div style="display:flex;">
+            <div style="margin-right:20px">
+              <el-checkbox v-model="checkAlls" :indeterminate="isIndeterminates" @change="handleCheckAllChanges">全选</el-checkbox>
+            </div>
+            <el-checkbox-group v-model="exportForm.pay_status" @change="handleCheckedCitiesChanges">
+              <el-checkbox v-for="(item,index) in paystatusTree" :key="index" :value="item.id" :label="item.id">{{ item.label }}</el-checkbox>
+            </el-checkbox-group>
+          </div>
         </el-form-item>
         <el-form-item label="下单方式">
           <el-radio-group v-model="exportForm.type">
@@ -690,7 +709,6 @@ const moduleList = {
   '快递公司代码': '',
   '发货状态': ''
 }
-
 export default {
   name: 'OrderList',
   components: { ChangeAddress, VDistpicker, examine },
@@ -822,60 +840,55 @@ export default {
       },
       statusTree: [
         {
-          id: -1,
-          label: '全部',
-          children: [
-            {
-              id: 0,
-              label: '待订单审核'
-            },
-            {
-              id: 1,
-              label: '待财务审核'
-            },
-            {
-              id: 2,
-              label: '待发货审核'
-            },
-            {
-              id: 3,
-              label: '待收货'
-            },
-            {
-              id: 4,
-              label: '已完成'
-            },
-            {
-              id: 5,
-              label: '已作废'
-            }
-          ]
+          id: 0,
+          label: '待订单审核'
+        },
+        {
+          id: 1,
+          label: '待财务审核'
+        },
+        {
+          id: 2,
+          label: '待发货审核'
+        },
+        {
+          id: 3,
+          label: '待收货'
+        },
+        {
+          id: 4,
+          label: '已完成'
+        },
+        {
+          id: 5,
+          label: '已作废'
         }
       ],
       paystatusTree: [
         {
-          id: -1,
-          label: '全部',
-          children: [
-            {
-              id: 0,
-              label: '未付款'
-            },
-            {
-              id: 1,
-              label: '部分付款'
-            },
-            {
-              id: 2,
-              label: '已付款'
-            },
-            {
-              id: 3,
-              label: '待退款'
-            }
-          ]
+          id: 0,
+          label: '未付款'
+        },
+        {
+          id: 1,
+          label: '部分付款'
+        },
+        {
+          id: 2,
+          label: '已付款'
+        },
+        {
+          id: 3,
+          label: '待退款'
         }
       ],
+      isIndeterminate: false,
+      isIndeterminates: false,
+      checkAlls: false,
+      checkAll: false,
+      oreder_status: [],
+      checkedCities: [],
+      // allOreder_status:[],
       exportForm: {
         order_num: '',
         name: '',
@@ -883,6 +896,7 @@ export default {
         good: '',
         address: '',
         status: [],
+        order_status: [],
         pay_status: [],
         type: -1,
         page_size: 10,
@@ -980,12 +994,35 @@ export default {
     this.getStore()
   },
   mounted() {
-    // console.log('权限',this.roles,this.authList)
     this.$nextTick(() => {
       this.tableHeight = document.getElementsByClassName('table-wrapper')[0].offsetHeight
     })
   },
   methods: {
+    handleCheckAllChange(val) {
+      const all = this.statusTree.map(item => {
+        return item.id
+      })
+      this.exportForm.order_status = val ? all : []
+      this.isIndeterminate = false
+    },
+    handleCheckedCitiesChange(value) {
+      const checkedCount = value.length
+      this.checkAll = checkedCount === this.statusTree.length
+      this.isIndeterminate = checkedCount > 0 && checkedCount < this.statusTree.length
+    },
+    handleCheckAllChanges(val) {
+      const all = this.paystatusTree.map(item => {
+        return item.id
+      })
+      this.exportForm.pay_status = val ? all : []
+      this.isIndeterminates = false
+    },
+    handleCheckedCitiesChanges(value) {
+      const checkedCount = value.length
+      this.checkAlls = checkedCount === this.paystatusTree.length
+      this.isIndeterminates = checkedCount > 0 && checkedCount < this.paystatusTree.length
+    },
     // 获取订单作废原因
     getVoidList() {
       const loading = this.$loading()
@@ -1232,7 +1269,7 @@ export default {
       }
       const formdata = new FormData()
       formdata.append('file', this.import_file)
-      console.log(typeof (formdata), 'formdata')
+      // console.log(typeof (formdata), 'formdata')
       this.loadingFull = true
       try {
         this.$request(orderSpend(formdata), () => {
@@ -1260,7 +1297,7 @@ export default {
       }
       const formdata = new FormData()
       formdata.append('file', this.import_file)
-      console.log(typeof (formdata), 'formdata')
+      // console.log(typeof (formdata), 'formdata')
       this.loadingFull = true
       try {
         this.$request(UpdateExpress(formdata), () => {
@@ -1372,7 +1409,7 @@ export default {
           this.$message.error(message)
         }
       } catch (e) {
-        console.log(`获取订单列表失败:${e}`)
+        // console.log(`获取订单列表失败:${e}`)
       }
       this.loadingFull = false
     },
@@ -1416,7 +1453,7 @@ export default {
           this.$message.error(message)
         }
       } catch (e) {
-        console.log(`取消订单失败:${e}`)
+        // console.log(`取消订单失败:${e}`)
       }
     },
     // 更改收货人信息
@@ -1518,8 +1555,8 @@ export default {
         this.$request(downList({ id: this.chooseList.map(e => e.id) }), (res) => {
           const exportData = res.list
           import('@/vendor/Export2Excel').then(excel => {
-            const header = ['序号', '下单时间', '所属政委', '下单人昵称', '下单人姓名', '订单状态', '支付状态', '数量合计', '订单总额', '所属者姓名', '所属者手机号', '所属体验店', '收货人', '联系方式', '收货地址', '订单备注']
-            const exportK = ['index', 'updated_at', 'admin_name', 'nickname', 'realname', 'status', 'pay_status', 'total', 'money', 'belong_realname', 'belong_mobile', 'get_store', 'username', 'mobile', 'address', 'remark']
+            const header = ['序号', '下单时间', '所属政委', '下单人昵称', '下单人姓名', '订单状态', '支付状态', '数量合计', '订单总额', '所属者姓名', '所属者手机号', '收货人', '联系方式', '收货地址', '订单备注']
+            const exportK = ['index', 'updated_at', 'admin_name', 'nickname', 'realname', 'status', 'pay_status', 'total', 'money', 'belong_realname', 'belong_mobile', 'username', 'mobile', 'address', 'remark']
             const exportV = exportData.map((item, i) => {
               const obj = {
                 index: i + 1,
@@ -1531,7 +1568,6 @@ export default {
                 pay_status: payStatus(item.pay_status).name,
                 total: item.total || '',
                 money: item.money || '',
-                get_store: item.get_store && item.get_store.name,
                 username: item.get_address.username || '',
                 mobile: +item.get_address.mobile,
                 belong_realname: item.belong_user && item.belong_user.realname,
@@ -1594,12 +1630,10 @@ export default {
           }
         }
         this.$request(downList(query), (res) => {
-          // console.log(res.data)
           const exportData = res.list
-          // console.log(exportData)
               import('@/vendor/Export2Excel').then(excel => {
-                const header = ['序号', '下单时间', '所属政委', '下单人昵称', '下单人姓名', '订单状态', '支付状态', '数量合计', '订单总额', '所属者姓名', '所属者手机号', '所属体验店', '收货人', '联系方式', '收货地址', '订单备注']
-                const exportK = ['index', 'updated_at', 'admin_name', 'nickname', 'realname', 'status', 'pay_status', 'total', 'money', 'belong_realname', 'belong_mobile', 'get_store', 'username', 'mobile', 'address', 'remark']
+                const header = ['序号', '下单时间', '所属政委', '下单人昵称', '下单人姓名', '订单状态', '支付状态', '数量合计', '订单总额', '所属者姓名', '所属者手机号', '收货人', '联系方式', '收货地址', '订单备注']
+                const exportK = ['index', 'updated_at', 'admin_name', 'nickname', 'realname', 'status', 'pay_status', 'total', 'money', 'belong_realname', 'belong_mobile', 'username', 'mobile', 'address', 'remark']
                 // if(+this.collect == false) {
                 //     header.splice(12,1)
                 //     exportK.splice(12,1)
@@ -1616,7 +1650,6 @@ export default {
                     total: item.total || '',
                     money: item.money || '',
                     username: item.get_address.username || '',
-                    get_store: item.get_store && item.get_store.name,
                     mobile: +item.get_address.mobile,
                     belong_realname: item.belong_user && item.belong_user.realname,
                     belong_mobile: item.belong_user && item.belong_user.mobile,
@@ -2078,9 +2111,11 @@ export default {
     },
     // 高级搜索
     submitExport() {
-      let order_status = this.$refs.status_tree.getCheckedKeys()
+      // let order_status = this.$refs.status_tree.getCheckedKeys()
+      let order_status = this.exportForm.order_status
       if (order_status.indexOf(-1) !== -1) order_status = [-1]
-      let pay_status = this.$refs.pay_status_tree.getCheckedKeys()
+      // let pay_status = this.$refs.pay_status_tree.getCheckedKeys()
+      let pay_status = this.exportForm.pay_status
       if (pay_status.indexOf(-1) !== -1) pay_status = [-1]
       const { page_index, page_size, order_num, time, name, address, good, type, provice, city, area, activity_id } = this.exportForm
       this.loadingFull = true
@@ -2122,6 +2157,7 @@ export default {
         good: '',
         address: '',
         status: [],
+        order_status: [],
         pay_status: [],
         type: -1,
         page_size: 10,
@@ -2131,8 +2167,8 @@ export default {
         area: '',
         activity_id: ''
       }
-      this.$refs.status_tree.setCheckedKeys([])
-      this.$refs.pay_status_tree.setCheckedKeys([])
+      // this.$refs.status_tree.setCheckedKeys([])
+      // this.$refs.pay_status_tree.setCheckedKeys([])
       this.dialog.export = false
       this.listQuery.page_index = 1
       this.listQuery.page_size = 10

+ 497 - 4
src/pages/order/store.vue

@@ -16,7 +16,16 @@
         <el-option v-for="item in activitys" :key="item.id" :label="item.title" :value="item.id" />
       </el-select>
       <el-button type="primary" icon="el-icon-search" class="filter-item" @click="listQuery.page_index = 1;getList()">搜索</el-button>
-      <el-button type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item" @click="exportOrder">导出</el-button>
+      <el-popover
+        placement="bottom"
+        width="350"
+        trigger="hover"
+      >
+        <el-button type="primary" @click="exportOrder">订单明细</el-button>
+        <el-button type="primary" @click="exporOrdertOrder">拆单明细</el-button>
+        <el-button type="primary" @click="exportMoney">订单金额</el-button>
+        <el-button slot="reference" type="primary" :loading="downloadLoading" icon="el-icon-document" class="filter-item">导出</el-button>
+      </el-popover>
     </div>
     <el-table :data="tableList" :header-cell-style="{ background: '#f8fbfc' }" border stripe @selection-change="orderMulSelect">
       <el-table-column type="selection" width="50" align="center" :show-overflow-tooltip="true" />
@@ -56,7 +65,7 @@
         </template>
       </el-table-column>
       <el-table-column prop="total" label="数量合计" align="center" width="80" :show-overflow-tooltip="true" />
-      <el-table-column prop="money" label="订单总额" align="center" width="120" :show-overflow-tooltip="true">
+      <el-table-column prop="money" label="订单总额" align="censtoreter" width="120" :show-overflow-tooltip="true">
         <template slot-scope="{ row }">{{ `¥${row.money}` }}</template>
       </el-table-column>
       <el-table-column prop="get_address" label="收货人" align="center" width="120" :show-overflow-tooltip="true">
@@ -72,14 +81,58 @@
     </el-table>
     <!-- 分页 -->
     <pagination :total="tableTotal" :limit="listQuery.page_size" :page="listQuery.page_index" @pagination="changePagination" @update:limit="changePagination" />
+    <el-dialog title="导出数据" :visible.sync="export_order" width="520px">
+      <el-form label-width="120">
+        <el-form-item label="导出类型">
+          <el-button type="primary" @click="exportOrder">订单明细</el-button>
+          <el-button type="primary" @click="exporOrdertOrder">拆单明细</el-button>
+          <el-button type="primary" @click="exportMoney">订单金额</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
   </div>
 </template>
 <script>
-import { getList, downOrder } from '@/api/order/store'
+import { getList, BreakUpOrder, downOrder, list_down } from '@/api/order/store'
 import { getStore } from '@/api/order/list'
 import { orderStatus, payStatus } from '@/filters/common'
 import { formatter } from '@/filters/index'
 import { activityList } from '@/api/giftB'
+const moduleList = {
+  '订单编号': '',
+  '下单时间': '',
+  '所属政委': '',
+  '寄件人': '大卫博士',
+  '联系方式': '4006867733',
+  '发件人详细地址': '河南省郑州市经开区',
+  '下单人昵称': '',
+  '下单人姓名': '',
+  '下单人手机号': '',
+  '收件人': '',
+  '电话': '',
+  '收件人省': '',
+  '收件人市': '',
+  '收件人区': '',
+  '收件人街道地址': '',
+  'L': '',
+  'XL': '',
+  'XXL': '',
+  'XXXL': '',
+  '女M': '',
+  '女L': '',
+  '女XL': '',
+  '女XXL': '',
+  '女XXXL': '',
+  '5XL': '',
+  '数据求和': '',
+  '所属': '',
+  '备注': '',
+  '赠品': '',
+  '快递单号': '',
+  '快递公司': '',
+  '快递公司代码': '',
+  '发货状态': ''
+}
 export default {
   data() {
     return {
@@ -87,6 +140,7 @@ export default {
       authList: this.$route.meta.authList,
       loadingFull: false,
       downloadLoading: false,
+      export_order: false,
       listQuery: {
         order_no: '',
         page_index: 1,
@@ -96,6 +150,7 @@ export default {
         store_id: '',
         activity_id: ''
       },
+      expressData: [],
       storeList: [],
       tableList: [],
       tableTotal: 0,
@@ -156,7 +211,151 @@ export default {
       this.listQuery.page_index = page
       this.getList()
     },
-    // 导出
+    // 订单金额
+    exportMoney() {
+      if (this.chooseList.length) {
+        // this.$request(downList({ id: this.chooseList.map(e => e.id) }), (res) => {
+        //   this.expressData = res
+        //   const exportData = this.getExportModule()
+        //   import('@/vendor/Export2Excel').then(excel => {
+        //     excel.export_json_to_excel({
+        //       header: Object.keys(moduleList),
+        //       data: exportData.map(listItem => Object.keys(exportData[0]).map(j => listItem[j])),
+        //       filename: `${new Date().toLocaleDateString()}快递单导出`,
+        //       bookType: 'xlsx',
+        //       isCSV: true
+        //     })
+        //     this.dialog.export_order = false
+        //   })
+        // })
+        this.$request(list_down({ id: this.chooseList.map(e => e.id) }), (res) => {
+          const exportData = res.list
+          import('@/vendor/Export2Excel').then(excel => {
+            const header = ['序号', '下单时间', '所属政委', '下单人昵称', '下单人姓名', '订单状态', '支付状态', '数量合计', '订单总额', '所属者姓名', '所属者手机号', '所属体验店', '收货人', '联系方式', '收货地址', '订单备注']
+            const exportK = ['index', 'updated_at', 'admin_name', 'nickname', 'realname', 'status', 'pay_status', 'total', 'money', 'belong_realname', 'belong_mobile', 'get_store', 'username', 'mobile', 'address', 'remark']
+            const exportV = exportData.map((item, i) => {
+              const obj = {
+                index: i + 1,
+                updated_at: item.updated_at || '',
+                admin_name: item.get_user && item.get_user.warea && item.get_user.warea.admin_name,
+                nickname: item.get_user.nickname || '',
+                realname: item.get_user.realname || '',
+                status: orderStatus(item.status).name || '',
+                pay_status: payStatus(item.pay_status).name,
+                total: item.total || '',
+                money: item.money || '',
+                get_store: item.get_store && item.get_store.name,
+                username: item.get_address.username || '',
+                mobile: +item.get_address.mobile,
+                belong_realname: item.belong_user && item.belong_user.realname,
+                belong_mobile: item.belong_user && item.belong_user.mobile,
+                address: item.get_address.province + item.get_address.city + item.get_address.town + item.get_address.address,
+                remark: item.remark || ''
+              }
+              return obj
+            })
+            const exportD = exportV.map(item => exportK.map(k => item[k]))
+            excel.export_json_to_excel({
+              header,
+              data: exportD,
+              filename: `${formatter(new Date(), 'yyyy-MM-dd')}订单金额`,
+              autoWidth: true,
+              bookType: 'xlsx'
+            })
+            this.export_order = false
+          })
+        })
+      } else {
+        if (this.tableList.length === 0) {
+          this.$message.error('没有可导出的数据')
+          return false
+        }
+        let query = {}
+        if (!this.highSearchFlag) {
+          const { order_status, order_no, page_index, page_size, store_id, search_name, time, activity_id } = this.listQuery
+          query = {
+            order_status, order_no, page_index, page_size, search_name, store_id,
+            start_time: time.length > 0 ? time[0] : '',
+            end_time: time.length > 0 ? time[1] : '',
+            activity_id
+          }
+        } else {
+          let order_status
+          let pay_status
+          try {
+            order_status = this.$refs.status_tree.getCheckedKeys()
+            if (order_status.indexOf(-1) !== -1) order_status = [-1]
+            pay_status = this.$refs.pay_status_tree.getCheckedKeys()
+            if (pay_status.indexOf(-1) !== -1) pay_status = [-1]
+          } catch (e) {
+            order_status = []
+            pay_status = []
+          }
+          const { page_index, page_size, order_num, time, name, address, good, type, provice, city, area, activity_id } = this.exportForm
+          query = {
+            page_index,
+            page_size,
+            order_no: order_num,
+            start_time: time.length > 0 ? time[0] : '',
+            end_time: time.length > 0 ? time[1] : '',
+            user_name: name,
+            receive_info: address,
+            goods_info: good,
+            order_status,
+            pay_status,
+            order_type: type,
+            provice: provice || '',
+            city: city || '',
+            area: area || '',
+            activity_id
+          }
+        }
+        this.$request(list_down(query), (res) => {
+          // console.log(res.data)
+          const exportData = res.list
+          // console.log(exportData)
+              import('@/vendor/Export2Excel').then(excel => {
+                const header = ['序号', '下单时间', '所属政委', '下单人昵称', '下单人姓名', '订单状态', '支付状态', '数量合计', '订单总额', '所属者姓名', '所属者手机号', '所属体验店', '收货人', '联系方式', '收货地址', '订单备注']
+                const exportK = ['index', 'updated_at', 'admin_name', 'nickname', 'realname', 'status', 'pay_status', 'total', 'money', 'belong_realname', 'belong_mobile', 'get_store', 'username', 'mobile', 'address', 'remark']
+                // if(+this.collect == false) {
+                //     header.splice(12,1)
+                //     exportK.splice(12,1)
+                //   }
+                const exportV = exportData.map((item, i) => {
+                  const obj = {
+                    index: i + 1,
+                    updated_at: item.updated_at || '',
+                    admin_name: item.get_user && item.get_user.warea && item.get_user.warea.admin_name,
+                    nickname: item.get_user.nickname || '',
+                    realname: item.get_user.realname || '',
+                    status: orderStatus(item.status).name || '',
+                    pay_status: payStatus(item.pay_status).name,
+                    total: item.total || '',
+                    money: item.money || '',
+                    username: item.get_address.username || '',
+                    get_store: item.get_store && item.get_store.name,
+                    mobile: +item.get_address.mobile,
+                    belong_realname: item.belong_user && item.belong_user.realname,
+                    belong_mobile: item.belong_user && item.belong_user.mobile,
+                    address: item.get_address.province + item.get_address.city + item.get_address.town + item.get_address.address,
+                    remark: item.remark || ''
+                  }
+                  return obj
+                })
+                const exportD = exportV.map(item => exportK.map(k => item[k]))
+                excel.export_json_to_excel({
+                  header,
+                  data: exportD,
+                  filename: `${formatter(new Date(), 'yyyy-MM-dd')}订单金额`,
+                  autoWidth: true,
+                  bookType: 'xlsx'
+                })
+                this.export_order = false
+              })
+        })
+      }
+    },
+    // 订单明细
     async exportOrder() {
       if (this.chooseList.length) {
         this.$request(downOrder({ id: this.chooseList.map(e => e.id) }), ({ list }) => {
@@ -169,7 +368,12 @@ export default {
             })
           })
         })
+        this.export_order = false
       } else {
+        if (this.tableList.length === 0) {
+          this.$message.error('没有可导出的数据')
+          return false
+        }
         let query = {}
         const { order_no, page_index, page_size, search_name, time, store_id, activity_id } = this.listQuery
         query = {
@@ -188,7 +392,296 @@ export default {
             })
           })
         })
+        this.export_order = false
+      }
+    },
+    // 导出拆单
+    async exporOrdertOrder() {
+      if (this.chooseList.length) {
+        this.$request(BreakUpOrder({ id: this.chooseList.map(e => e.id) }), (res) => {
+          this.expressData = res
+          const exportData = this.getExportModule()
+          import('@/vendor/Export2Excel').then(excel => {
+            excel.export_json_to_excel({
+              header: Object.keys(moduleList),
+              data: exportData.map(listItem => Object.keys(exportData[0]).map(j => listItem[j])),
+              filename: `${new Date().toLocaleDateString()}快递单导出`,
+              bookType: 'xlsx',
+              isCSV: true
+            })
+            this.export_order = false
+          })
+        })
+      } else {
+        if (this.tableList.length === 0) {
+          this.$message.error('没有可导出的数据')
+          return false
+        }
+        let query = {}
+        if (!this.highSearchFlag) {
+          const { order_status, order_no, page_index, page_size, search_name, time, activity_id, store_id } = this.listQuery
+          query = {
+            order_status, order_no, page_index, page_size, search_name, store_id,
+            start_time: time.length > 0 ? time[0] : '',
+            end_time: time.length > 0 ? time[1] : '',
+            activity_id
+          }
+        } else {
+          let order_status
+          let pay_status
+          try {
+            order_status = this.$refs.status_tree.getCheckedKeys()
+            if (order_status.indexOf(-1) !== -1) order_status = [-1]
+            pay_status = this.$refs.pay_status_tree.getCheckedKeys()
+            if (pay_status.indexOf(-1) !== -1) pay_status = [-1]
+          } catch (e) {
+            order_status = []
+            pay_status = []
+          }
+          const { page_index, page_size, order_num, time, name, address, good, type, provice, city, area, activity_id, store_id } = this.exportForm
+          query = {
+            page_index,
+            page_size,
+            store_id,
+            order_no: order_num,
+            start_time: time.length > 0 ? time[0] : '',
+            end_time: time.length > 0 ? time[1] : '',
+            user_name: name,
+            receive_info: address,
+            goods_info: good,
+            order_status,
+            pay_status,
+            order_type: type,
+            provice: provice || '',
+            city: city || '',
+            area: area || '',
+            activity_id
+          }
+        }
+        this.$request(BreakUpOrder(query), (res) => {
+          this.expressData = res
+          const exportData = this.getExportModule()
+          import('@/vendor/Export2Excel').then(excel => {
+            excel.export_json_to_excel({
+              header: Object.keys(moduleList),
+              data: exportData.map(listItem => Object.keys(exportData[0]).map(j => listItem[j])),
+              filename: `${new Date().toLocaleDateString()}快递单导出`,
+              bookType: 'xlsx',
+              isCSV: true
+            })
+            this.export_order = false
+          })
+        })
+      }
+    },
+    getExportModule() {
+      const data = this.expressData
+      const out = []
+      for (const i in data) {
+        const item = data[i]
+        const info = item.data
+        let a = 0
+        let b = 0
+        let c = 0
+        let d = 0
+        while (a < item['精装'].length) {
+          const obj = Object.assign({}, moduleList)
+          obj['订单编号'] = i
+          obj['下单时间'] = info.created_at
+          obj['所属政委'] = info.admin_name
+          obj['下单人昵称'] = info.u_nickname
+          obj['下单人姓名'] = info.u_name
+          obj['下单人手机号'] = info.u_mobile
+          obj['收件人'] = info.username
+          obj['电话'] = info.mobile
+          obj['收件人省'] = info.province
+          obj['收件人市'] = info.city
+          obj['收件人区'] = info.town
+          obj['收件人街道地址'] = info.address
+          obj['备注'] = info.remark
+          obj['所属'] = info.belong
+          obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
+          let num_all = 0
+          if (item['精装'][a].sec_attr === '男女款') {
+            const sex = item['精装'][a].size.split('-')[0]
+            let size = item['精装'][a].size.split('-')[1]
+            size = size === '3XL' ? 'XXXL' : size
+            if (sex === '男款') {
+              obj[size] = `${item['精装'][a].num}${item['精装'][a].main_attr}`
+              num_all += item['精装'][a].num
+            } else {
+              obj['女' + size] = `${item['精装'][a].num}${item['精装'][a].main_attr}`
+              num_all += item['精装'][a].num
+            }
+          } else {
+            if (item['精装'][a].size === '3XL') {
+              item['精装'][a].size = 'XXXL'
+            }
+            if (item['精装'][a].sec_attr === '男款') {
+              obj[item['精装'][a].size] = `${item['精装'][a].num}${item['精装'][a].main_attr}`
+              num_all += item['精装'][a].num
+            }
+            if (item['精装'][a].sec_attr === '女款') {
+              obj['女' + item['精装'][a].size] = `${item['精装'][a].num}${item['精装'][a].main_attr}`
+              num_all += item['精装'][a].num
+            }
+          }
+          obj['数据求和'] = num_all
+          out.push(obj)
+          a++
+        }
+        while (b < item['普通'].length) {
+          const obj = Object.assign({}, moduleList)
+          obj['订单编号'] = i
+          obj['下单时间'] = info.created_at
+          obj['所属政委'] = info.admin_name
+          obj['下单人昵称'] = info.u_nickname
+          obj['下单人姓名'] = info.u_name
+          obj['下单人手机号'] = info.u_mobile
+          obj['收件人'] = info.username
+          obj['电话'] = info.mobile
+          obj['收件人省'] = info.province
+          obj['收件人市'] = info.city
+          obj['收件人区'] = info.town
+          obj['收件人街道地址'] = info.address
+          obj['备注'] = info.remark
+          obj['所属'] = info.belong
+          obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
+          let num_all = 0
+          if (item['普通'][b].sec_attr === '男女款') {
+            const sex = item['普通'][b].size.split('-')[0]
+            let size = item['普通'][b].size.split('-')[1]
+            size = size === '3XL' ? 'XXXL' : size
+            if (sex === '男款') {
+              obj[size] = `${item['普通'][b].num}${item['普通'][b].main_attr}`
+              num_all += item['普通'][b].num
+            } else {
+              obj['女' + size] = `${item['普通'][b].num}${item['普通'][b].main_attr}`
+              num_all += item['普通'][b].num
+            }
+          } else {
+            if (item['普通'][b].size === '3XL') {
+              item['普通'][b].size = 'XXXL'
+            }
+            if (item['普通'][b].sec_attr === '男款') {
+              obj[item['普通'][b].size] = `${item['普通'][b].num}${item['普通'][b].main_attr}`
+              num_all += item['普通'][b].num
+            }
+            if (item['普通'][b].sec_attr === '女款') {
+              obj['女' + item['普通'][b].size] = `${item['普通'][b].num}${item['普通'][b].main_attr}`
+              num_all += item['普通'][b].num
+            }
+          }
+          obj['数据求和'] = num_all
+          out.push(obj)
+          b++
+        }
+        while (c < item['精装混合'].length) {
+          const obj = Object.assign({}, moduleList)
+          obj['订单编号'] = i
+          obj['下单时间'] = info.created_at
+          obj['所属政委'] = info.admin_name
+          obj['下单人昵称'] = info.u_nickname
+          obj['下单人姓名'] = info.u_name
+          obj['下单人手机号'] = info.u_mobile
+          obj['收件人'] = info.username
+          obj['电话'] = info.mobile
+          obj['收件人省'] = info.province
+          obj['收件人市'] = info.city
+          obj['收件人区'] = info.town
+          obj['收件人街道地址'] = info.address
+          obj['备注'] = info.remark
+          obj['所属'] = info.belong
+          obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
+          let num_all = 0
+          for (let j = 0; j < item['精装混合'][c].length; j++) {
+            if (item['精装混合'][c][j].sec_attr === '男女款') {
+              const sex = item['精装混合'][c][j].size.split('-')[0]
+              let size = item['精装混合'][c][j].size.split('-')[1]
+              size = size === '3XL' ? 'XXXL' : size
+              if (sex === '男款') {
+                obj[size] += `${item['精装混合'][c][j].num}${item['精装混合'][c][j].main_attr}`
+                num_all += item['精装混合'][c][j].num
+              } else {
+                obj['女' + size] += `${item['精装混合'][c][j].num}${item['精装混合'][c][j].main_attr}`
+                num_all += item['精装混合'][c][j].num
+              }
+            } else {
+              if (item['精装混合'][c][j].size === '3XL') {
+                if (item['精装混合'][c][j].sec_attr === '男款') {
+                  obj['XXXL'] += `${item['精装混合'][c][j].num}${item['精装混合'][c][j].main_attr}`
+                  num_all += item['精装混合'][c][j].num
+                }
+              } else {
+                if (item['精装混合'][c][j].sec_attr === '男款') {
+                  obj[item['精装混合'][c][j].size] += `${item['精装混合'][c][j].num}${item['精装混合'][c][j].main_attr}`
+                  num_all += item['精装混合'][c][j].num
+                }
+                if (item['精装混合'][c][j].sec_attr === '女款') {
+                  obj['女' + item['精装混合'][c][j].size] += `${item['精装混合'][c][j].num}${item['精装混合'][c][j].main_attr}`
+                  num_all += item['精装混合'][c][j].num
+                }
+              }
+            }
+          }
+          obj['数据求和'] = num_all
+          out.push(obj)
+          c++
+        }
+        while (d < item['普通混合'].length) {
+          const obj = Object.assign({}, moduleList)
+          obj['订单编号'] = i
+          obj['下单时间'] = info.created_at
+          obj['所属政委'] = info.admin_name
+          obj['下单人昵称'] = info.u_nickname
+          obj['下单人姓名'] = info.u_name
+          obj['下单人手机号'] = info.u_mobile
+          obj['收件人'] = info.username
+          obj['电话'] = info.mobile
+          obj['收件人省'] = info.province
+          obj['收件人市'] = info.city
+          obj['收件人区'] = info.town
+          obj['收件人街道地址'] = info.address
+          obj['备注'] = info.remark
+          obj['所属'] = info.belong
+          obj['赠品'] = info.gift.map(item => `${item.name}${item.num}`).join(';')
+          let num_all = 0
+          for (let j = 0; j < item['普通混合'][d].length; j++) {
+            if (item['普通混合'][d][j].sec_attr === '男女款') {
+              const sex = item['普通混合'][d][j].size.split('-')[0]
+              let size = item['普通混合'][d][j].size.split('-')[1]
+              size = size === '3XL' ? 'XXXL' : size
+              if (sex === '男款') {
+                obj[size] += `${item['普通混合'][d][j].num}${item['普通混合'][d][j].main_attr}`
+                num_all += item['普通混合'][d][j].num
+              } else {
+                obj['女' + size] += `${item['普通混合'][d][j].num}${item['普通混合'][d][j].main_attr}`
+                num_all += item['普通混合'][d][j].num
+              }
+            } else {
+              if (item['普通混合'][d][j].size === '3XL') {
+                if (item['普通混合'][d][j].sec_attr === '男款') {
+                  obj['XXXL'] += `${item['普通混合'][d][j].num}${item['普通混合'][d][j].main_attr}`
+                  num_all += item['普通混合'][d][j].num
+                }
+              } else {
+                if (item['普通混合'][d][j].sec_attr === '男款') {
+                  obj[item['普通混合'][d][j].size] += `${item['普通混合'][d][j].num}${item['普通混合'][d][j].main_attr}`
+                  num_all += item['普通混合'][d][j].num
+                }
+                if (item['普通混合'][d][j].sec_attr === '女款') {
+                  obj['女' + item['普通混合'][d][j].size] += `${item['普通混合'][d][j].num}${item['普通混合'][d][j].main_attr}`
+                  num_all += item['普通混合'][d][j].num
+                }
+              }
+            }
+          }
+          obj['数据求和'] = num_all
+          out.push(obj)
+          d++
+        }
       }
+      return out
     },
     orderMulSelect(val) {
       this.chooseList = val

+ 25 - 0
src/pages/order/test.vue

@@ -0,0 +1,25 @@
+<template>
+  <div>
+    <button @click="dialogVisible=true">点击</button>
+    <el-dialog
+      title="提示"
+      :visible.sync="dialogVisible"
+      width="30%"
+      append-to-body
+    >
+      <span>这是一段信息</span>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      dialogVisible: false
+    }
+  }
+}
+</script>

+ 4 - 1
src/pages/studio/order_detail.vue

@@ -22,10 +22,13 @@
           </div>
         </div>
         <div v-if="roles.indexOf(2) !== -1" class="head-btns">
-          <div v-if="orderDetail && orderDetail.status === 2">
+          <div v-if="orderDetail && orderDetail.status === 2 || orderDetail.status === 3">
             <!-- <el-button icon="el-icon-edit-outline" @click="ycn_changGoodList_dialog = true">修改</el-button> -->
             <el-button icon="el-icon-refresh" @click="dialog.back = true">退回</el-button>
           </div>
+          <!-- <div v-else-if="orderDetail && orderDetail.status === 3">
+              <el-button icon="el-icon-refresh" @click="dialog.back = true">退回</el-button>
+          </div> -->
         </div>
       </div>
       <!-- 表格 -->

+ 1 - 1
src/permission.js

@@ -10,7 +10,7 @@ import { filterRouter } from '@/filterRouter'
 
 NProgress.configure({ showSpinner: false }) // 滚动条配置
 
-const whiteList = ['/login', '/auth-redirect', '/1', '/2'] // 路由重定向白名单
+const whiteList = ['/login', '/auth-redirect', '/1', '/2', '/9'] // 路由重定向白名单
 
 router.beforeEach(async(to, from, next) => {
   // 开始加载滚动条

+ 5 - 0
src/router/auth.js

@@ -27,6 +27,11 @@ export const defaultRoutes = [
     hidden: true
   },
   {
+    path: '/9',
+    component: '/dataScreen/hint',
+    hidden: true
+  },
+  {
     path: '/404',
     component: '/error-page/404',
     hidden: true

+ 5 - 0
src/router/index.js

@@ -90,6 +90,11 @@ export const constantRoutes = [
     hidden: true
   },
   {
+    path: '/9',
+    component: () => import('@/pages/dataScreen/hint'),
+    hidden: true
+  },
+  {
     path: '/',
     component: Layout,
     redirect: '/home',