|
@@ -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
|