|
|
@@ -2,22 +2,8 @@
|
|
|
<div class="app-container">
|
|
|
<el-card shadow="never" class="mb16 filter-card">
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" size="small" label-width="100px">
|
|
|
- <el-form-item label="租户名称" prop="companyId">
|
|
|
- <el-select
|
|
|
- v-model="queryParams.companyId"
|
|
|
- placeholder="选择租户"
|
|
|
- clearable
|
|
|
- filterable
|
|
|
- size="small"
|
|
|
- style="width: 200px"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in companyList"
|
|
|
- :key="item.companyId"
|
|
|
- :label="item.companyName"
|
|
|
- :value="item.companyId"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
+ <el-form-item label="租户名称" prop="tenantId">
|
|
|
+ <inline-tenant-selector @change="handleTenantChange" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="订单编号" prop="orderNo">
|
|
|
<el-input v-model="queryParams.orderNo" placeholder="请输入订单编号" clearable size="small" @keyup.enter.native="handleQuery" />
|
|
|
@@ -51,25 +37,26 @@
|
|
|
|
|
|
<script>
|
|
|
import { listStoreOrder, exportStoreOrder } from '@/api/admin/storeOrder'
|
|
|
-import { listAllCompanies } from '@/api/admin/sysCompany'
|
|
|
+import InlineTenantSelector from '@/components/InlineTenantSelector'
|
|
|
|
|
|
export default {
|
|
|
name: 'AdminStoreOrder',
|
|
|
+ components: { InlineTenantSelector },
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false, exportLoading: false, showSearch: true,
|
|
|
- list: [], total: 0, companyList: [],
|
|
|
- queryParams: { pageNum: 1, pageSize: 10, orderNo: null, companyId: null }
|
|
|
+ list: [], total: 0,
|
|
|
+ queryParams: { pageNum: 1, pageSize: 10, orderNo: null, tenantId: null }
|
|
|
}
|
|
|
},
|
|
|
- created() { this.getCompanyList(); this.getList() },
|
|
|
methods: {
|
|
|
- getCompanyList() {
|
|
|
- listAllCompanies({ pageSize: 9999 }).then(response => {
|
|
|
- this.companyList = response.rows || []
|
|
|
- })
|
|
|
- },
|
|
|
getList() {
|
|
|
+ if (!this.queryParams.tenantId) {
|
|
|
+ this.list = []
|
|
|
+ this.total = 0
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
this.loading = true
|
|
|
listStoreOrder(this.queryParams).then(res => {
|
|
|
this.list = res.rows || []
|
|
|
@@ -77,8 +64,9 @@ export default {
|
|
|
this.loading = false
|
|
|
}).catch(() => { this.loading = false })
|
|
|
},
|
|
|
- handleQuery() { this.queryParams.pageNum = 1; this.getList() },
|
|
|
- resetQuery() { this.resetForm('queryForm'); this.queryParams.companyId = null; this.handleQuery() },
|
|
|
+ handleTenantChange(val) { this.queryParams.tenantId = val || null; this.handleQuery() },
|
|
|
+ handleQuery() { if (!this.queryParams.tenantId) { this.$message.warning('请先选择租户'); return } this.queryParams.pageNum = 1; this.getList() },
|
|
|
+ resetQuery() { this.resetForm('queryForm'); this.queryParams.tenantId = null; this.handleQuery() },
|
|
|
handleExport() {
|
|
|
this.exportLoading = true
|
|
|
exportStoreOrder(this.queryParams).then(response => {
|