|
@@ -12,6 +12,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 v-hasPermi="['order:management:export']" type="success" icon="Download"
|
|
<el-button v-hasPermi="['order:management:export']" type="success" icon="Download"
|
|
|
@click="handleExport">导出Excel</el-button>
|
|
@click="handleExport">导出Excel</el-button>
|
|
@@ -203,8 +206,8 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
-<script setup>
|
|
|
|
|
-import { ref, reactive, onMounted, onUnmounted, nextTick, getCurrentInstance, toRefs } from 'vue';
|
|
|
|
|
|
|
+<script setup lang="ts">
|
|
|
|
|
+import { ref, reactive, computed, onMounted, onUnmounted, nextTick, getCurrentInstance, toRefs } from 'vue';
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
import { ElMessage, ElMessageBox } from 'element-plus';
|
|
|
import OrderDetailDrawer from './components/OrderDetailDrawer.vue';
|
|
import OrderDetailDrawer from './components/OrderDetailDrawer.vue';
|
|
|
import DispatchDialog from './components/DispatchDialog.vue';
|
|
import DispatchDialog from './components/DispatchDialog.vue';
|
|
@@ -230,7 +233,8 @@ const loading = ref(false);
|
|
|
const filters = reactive({
|
|
const filters = reactive({
|
|
|
service: '',
|
|
service: '',
|
|
|
status: '',
|
|
status: '',
|
|
|
- content: ''
|
|
|
|
|
|
|
+ content: '',
|
|
|
|
|
+ site: undefined
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const pagination = reactive({
|
|
const pagination = reactive({
|
|
@@ -243,6 +247,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({});
|
|
|
|
|
|
|
|
let timer = null;
|
|
let timer = null;
|
|
@@ -258,7 +276,8 @@ onMounted(() => {
|
|
|
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 || [];
|
|
|
pagination.total = res.total || 0;
|
|
pagination.total = res.total || 0;
|
|
@@ -323,6 +342,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 = () => {
|
|
const handleSearch = () => {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
listSubOrder({
|
|
listSubOrder({
|
|
@@ -330,7 +364,8 @@ const handleSearch = () => {
|
|
|
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 || [];
|