|
@@ -14,6 +14,9 @@
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
<el-input v-model="filters.content" placeholder="订单号/品牌/宠主/手机号" class="search-input" prefix-icon="Search"
|
|
<el-input v-model="filters.content" placeholder="订单号/品牌/宠主/手机号" class="search-input" prefix-icon="Search"
|
|
|
clearable @clear="handleSearch" @keyup.enter="handleSearch" />
|
|
clearable @clear="handleSearch" @keyup.enter="handleSearch" />
|
|
|
|
|
+ <el-cascader v-model="filterCascaderValue" :options="areaTreeOptions"
|
|
|
|
|
+ :props="{ checkStrictly: true, value: 'id', label: 'name' }" placeholder="所属站点" clearable
|
|
|
|
|
+ style="width: 350px; margin-left: 10px;" @change="handleFilterCascaderChange" />
|
|
|
<el-button type="primary" icon="Search" @click="handleSearch">查询</el-button>
|
|
<el-button type="primary" icon="Search" @click="handleSearch">查询</el-button>
|
|
|
<el-button type="success" icon="Download" @click="handleExport"
|
|
<el-button type="success" icon="Download" @click="handleExport"
|
|
|
v-hasPermi="['order:orderList:export']">导出Excel</el-button>
|
|
v-hasPermi="['order:orderList:export']">导出Excel</el-button>
|
|
@@ -224,7 +227,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { ref, reactive, onMounted, onUnmounted, nextTick, getCurrentInstance } from 'vue';
|
|
|
|
|
|
|
+import { ref, reactive, computed, onMounted, onUnmounted, nextTick, getCurrentInstance } from 'vue';
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import fulfillerEnums from '@/json/fulfiller.json';
|
|
import fulfillerEnums from '@/json/fulfiller.json';
|
|
@@ -259,7 +262,8 @@ const loading = ref(false);
|
|
|
const filters = reactive({
|
|
const filters = reactive({
|
|
|
service: '',
|
|
service: '',
|
|
|
status: '',
|
|
status: '',
|
|
|
- content: ''
|
|
|
|
|
|
|
+ content: '',
|
|
|
|
|
+ site: undefined as number | undefined
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const pagination = reactive({
|
|
const pagination = reactive({
|
|
@@ -272,6 +276,20 @@ const tableData = ref([]);
|
|
|
const serviceOptions = ref([]);
|
|
const serviceOptions = ref([]);
|
|
|
const areaStationList = ref([]);
|
|
const areaStationList = ref([]);
|
|
|
const areaStationMap = ref({});
|
|
const areaStationMap = ref({});
|
|
|
|
|
+const areaTreeOptions = computed(() => {
|
|
|
|
|
+ const buildTree = (data: any[], parentId: any): any[] => {
|
|
|
|
|
+ return data
|
|
|
|
|
+ .filter(item => String(item.parentId) === String(parentId))
|
|
|
|
|
+ .map(item => {
|
|
|
|
|
+ const children = buildTree(data, item.id);
|
|
|
|
|
+ const res: any = { id: item.id, name: item.name };
|
|
|
|
|
+ if (children && children.length > 0) res.children = children;
|
|
|
|
|
+ return res;
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ return buildTree(areaStationList.value, 0);
|
|
|
|
|
+});
|
|
|
|
|
+const filterCascaderValue = ref<any[]>([]);
|
|
|
const storeMap = ref({});
|
|
const storeMap = ref({});
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -343,6 +361,21 @@ const handleStatusTabChange = async () => {
|
|
|
handleSearch();
|
|
handleSearch();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const handleFilterCascaderChange = (val: any[]) => {
|
|
|
|
|
+ if (val && val.length > 0) {
|
|
|
|
|
+ const lastId = val[val.length - 1];
|
|
|
|
|
+ const node = areaStationList.value.find((item: any) => item.id === lastId);
|
|
|
|
|
+ if (node && node.type === 2) {
|
|
|
|
|
+ filters.site = lastId;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ filters.site = undefined;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ filters.site = undefined;
|
|
|
|
|
+ }
|
|
|
|
|
+ handleSearch();
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const handleSearch = (isPolling: any = false) => {
|
|
const handleSearch = (isPolling: any = false) => {
|
|
|
const isAutoPoll = isPolling === true;
|
|
const isAutoPoll = isPolling === true;
|
|
|
if (!isAutoPoll) {
|
|
if (!isAutoPoll) {
|
|
@@ -353,7 +386,8 @@ const handleSearch = (isPolling: any = false) => {
|
|
|
pageSize: pagination.size,
|
|
pageSize: pagination.size,
|
|
|
service: filters.service !== '' ? filters.service : undefined,
|
|
service: filters.service !== '' ? filters.service : undefined,
|
|
|
status: filters.status !== '' ? Number(filters.status) : undefined,
|
|
status: filters.status !== '' ? Number(filters.status) : undefined,
|
|
|
- content: filters.content || undefined
|
|
|
|
|
|
|
+ content: filters.content || undefined,
|
|
|
|
|
+ site: filters.site || undefined
|
|
|
})
|
|
})
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
tableData.value = res.rows || [];
|
|
tableData.value = res.rows || [];
|