|
|
|
|
@ -14,7 +14,11 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" size="small" @click="resetSearch">reset</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button type="primary" size="small" @click="exportExcel">export</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- <div>
|
|
|
|
|
<el-button type="primary" size="small" @click="editNote('add')">add</el-button>
|
|
|
|
|
</div> -->
|
|
|
|
|
@ -26,17 +30,9 @@
|
|
|
|
|
</div>
|
|
|
|
|
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
|
|
|
|
|
:table-item="table_item">
|
|
|
|
|
<template v-slot:product>
|
|
|
|
|
<template v-slot:order_product>
|
|
|
|
|
<el-table-column align='left' label="Product" minWidth="360" header-align="center">
|
|
|
|
|
<!-- <template slot-scope="scope">
|
|
|
|
|
<el-table :data="scope.row.order_products" style="width: 100%; margin-top: 10px;">
|
|
|
|
|
<el-table-column prop="name" label="订单名称"></el-table-column>
|
|
|
|
|
<el-table-column prop="number" label="订单日期"></el-table-column>
|
|
|
|
|
<el-table-column prop="total" label="金额"></el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</template> -->
|
|
|
|
|
|
|
|
|
|
<el-table-column align='left' label="name" width="360" header-align="center">
|
|
|
|
|
<el-table-column align='left' label="Product Name" width="360" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<template v-if="scope.row.order_products && scope.row.order_products.length>0">
|
|
|
|
|
<template v-for="item in scope.row.order_products">
|
|
|
|
|
@ -45,7 +41,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align='left' label="number" width="360" header-align="center">
|
|
|
|
|
<el-table-column align='left' label="Part Number" width="360" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<template v-if="scope.row.order_products && scope.row.order_products.length>0">
|
|
|
|
|
<template v-for="item in scope.row.order_products">
|
|
|
|
|
@ -54,7 +50,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align='left' label="total" width="120" header-align="center">
|
|
|
|
|
<el-table-column align='left' label="Total" width="120" header-align="center">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<template v-if="scope.row.order_products && scope.row.order_products.length>0">
|
|
|
|
|
<template v-for="item in scope.row.order_products">
|
|
|
|
|
@ -86,7 +82,10 @@
|
|
|
|
|
import {
|
|
|
|
|
index,
|
|
|
|
|
destroy
|
|
|
|
|
} from "@/api/order/index.js"
|
|
|
|
|
} from "@/api/order/index.js"
|
|
|
|
|
import {
|
|
|
|
|
download
|
|
|
|
|
} from "@/utils/downloadRequest";
|
|
|
|
|
export default {
|
|
|
|
|
components: {},
|
|
|
|
|
data() {
|
|
|
|
|
@ -98,7 +97,8 @@
|
|
|
|
|
},
|
|
|
|
|
total: 0,
|
|
|
|
|
list: [],
|
|
|
|
|
table_item: [{
|
|
|
|
|
table_item: [{
|
|
|
|
|
prop:'index',
|
|
|
|
|
type: 'index',
|
|
|
|
|
width: 50,
|
|
|
|
|
fixed: 'left'
|
|
|
|
|
@ -108,7 +108,7 @@
|
|
|
|
|
align: 'left',
|
|
|
|
|
width: 240
|
|
|
|
|
}, {
|
|
|
|
|
prop: 'product',
|
|
|
|
|
prop: 'order_product',
|
|
|
|
|
label: 'Product',
|
|
|
|
|
align: 'left',
|
|
|
|
|
minWidth: 360,
|
|
|
|
|
@ -136,6 +136,11 @@
|
|
|
|
|
label: 'Address',
|
|
|
|
|
align: 'left',
|
|
|
|
|
width: 360
|
|
|
|
|
}, {
|
|
|
|
|
prop: 'created_at',
|
|
|
|
|
label: 'Created At',
|
|
|
|
|
align: 'left',
|
|
|
|
|
width: 240
|
|
|
|
|
}]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
@ -156,6 +161,31 @@
|
|
|
|
|
this.select.page = 1
|
|
|
|
|
this.select.number = ''
|
|
|
|
|
this.getList()
|
|
|
|
|
},
|
|
|
|
|
exportExcel() {
|
|
|
|
|
let _export = {}
|
|
|
|
|
this.table_item.map(item => {
|
|
|
|
|
if (item.prop === 'index') {
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
_export[item.prop] = item.label
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
download(
|
|
|
|
|
'/api/admin/order/index',
|
|
|
|
|
'get', {
|
|
|
|
|
export_fields: _export,
|
|
|
|
|
show_relation: ['orderProducts.product', 'user'],
|
|
|
|
|
filter: [{
|
|
|
|
|
key: 'number',
|
|
|
|
|
op: 'like',
|
|
|
|
|
value: this.select.number
|
|
|
|
|
}],
|
|
|
|
|
is_export: 1,
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 99999
|
|
|
|
|
},
|
|
|
|
|
`Orders.xlsx`)
|
|
|
|
|
},
|
|
|
|
|
async getList() {
|
|
|
|
|
const res = await index({
|
|
|
|
|
|