|
@@ -113,6 +113,35 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
+ <!-- 导出日期区间弹窗 -->
|
|
|
|
|
+ <el-dialog
|
|
|
|
|
+ v-model="exportDateDialogVisible"
|
|
|
|
|
+ title="退款导出"
|
|
|
|
|
+ width="420px"
|
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
|
+ :align-center="true"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-form label-width="90px" style="padding: 8px 16px 0">
|
|
|
|
|
+ <el-form-item label="区间选择:">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="exportDateRange"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ range-separator="至"
|
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <el-button @click="exportDateDialogVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" :loading="exportBtnLoading" @click="handleExportConfirm">
|
|
|
|
|
+ 确 定
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
<!-- 退款日志抽屉 -->
|
|
<!-- 退款日志抽屉 -->
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
v-model="refundLogDrawerVisible"
|
|
v-model="refundLogDrawerVisible"
|
|
@@ -136,6 +165,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
|
|
+import UserOrderInfoAPI from "@/api/orderManage/user-order-info-api";
|
|
|
|
|
+
|
|
|
defineOptions({ name: "UserInfo" });
|
|
defineOptions({ name: "UserInfo" });
|
|
|
|
|
|
|
|
import UserInfoAPI, {
|
|
import UserInfoAPI, {
|
|
@@ -158,7 +189,6 @@ const {
|
|
|
handleAddClick,
|
|
handleAddClick,
|
|
|
handleEditClick,
|
|
handleEditClick,
|
|
|
handleSubmitClick,
|
|
handleSubmitClick,
|
|
|
- handleExportClick,
|
|
|
|
|
handleSearchClick,
|
|
handleSearchClick,
|
|
|
handleFilterChange,
|
|
handleFilterChange,
|
|
|
} = usePage();
|
|
} = usePage();
|
|
@@ -226,6 +256,8 @@ const contentConfig: IContentConfig<UserInfoPageQuery> = reactive({
|
|
|
pk: "id",
|
|
pk: "id",
|
|
|
// 列表查询接口
|
|
// 列表查询接口
|
|
|
indexAction: UserInfoAPI.getPage,
|
|
indexAction: UserInfoAPI.getPage,
|
|
|
|
|
+ //退款导出
|
|
|
|
|
+ exportAction: UserInfoAPI.exportExcel,
|
|
|
// 数据解析函数
|
|
// 数据解析函数
|
|
|
parseData(res: any) {
|
|
parseData(res: any) {
|
|
|
return {
|
|
return {
|
|
@@ -241,6 +273,7 @@ const contentConfig: IContentConfig<UserInfoPageQuery> = reactive({
|
|
|
pageSizes: [10, 20, 30, 50],
|
|
pageSizes: [10, 20, 30, 50],
|
|
|
},
|
|
},
|
|
|
// 工具栏配置
|
|
// 工具栏配置
|
|
|
|
|
+ toolbar: ["export"],
|
|
|
defaultToolbar: ["refresh", "filter"],
|
|
defaultToolbar: ["refresh", "filter"],
|
|
|
// 表格列配置
|
|
// 表格列配置
|
|
|
cols: [
|
|
cols: [
|
|
@@ -386,6 +419,40 @@ const handleOperateClick = (data: IObject) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// ==================== 导出日期区间弹窗相关 ====================
|
|
|
|
|
+const exportDateDialogVisible = ref(false);
|
|
|
|
|
+const exportDateRange = ref<[string, string] | null>(null);
|
|
|
|
|
+const exportBtnLoading = ref(false);
|
|
|
|
|
+
|
|
|
|
|
+// 覆盖 usePage 默认的 handleExportClick,先弹窗选择日期
|
|
|
|
|
+const handleExportClick = () => {
|
|
|
|
|
+ exportDateRange.value = null;
|
|
|
|
|
+ exportDateDialogVisible.value = true;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 确认导出
|
|
|
|
|
+const handleExportConfirm = () => {
|
|
|
|
|
+ const queryParams = searchRef.value?.getQueryParams() ?? {};
|
|
|
|
|
+ const filteredQuery: Record<string, any> = {};
|
|
|
|
|
+ for (const key in queryParams) {
|
|
|
|
|
+ const value = queryParams[key];
|
|
|
|
|
+ if (value !== "" && value !== null && value !== undefined) {
|
|
|
|
|
+ filteredQuery[key] = value;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (exportDateRange.value && exportDateRange.value.length === 2) {
|
|
|
|
|
+ filteredQuery.startTime = `${exportDateRange.value[0]} 00:00:00`;
|
|
|
|
|
+ filteredQuery.endTime = `${exportDateRange.value[1]} 23:59:59`;
|
|
|
|
|
+ }
|
|
|
|
|
+ exportBtnLoading.value = true;
|
|
|
|
|
+ contentRef.value?.exportPageData(filteredQuery);
|
|
|
|
|
+ // exportPageData 内部异步处理,此处延迟关闭弹窗
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ exportBtnLoading.value = false;
|
|
|
|
|
+ exportDateDialogVisible.value = false;
|
|
|
|
|
+ }, 1500);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 处理工具栏按钮点击
|
|
// 处理工具栏按钮点击
|
|
|
const handleToolbarClick = (name: string) => {
|
|
const handleToolbarClick = (name: string) => {
|
|
|
console.log(name);
|
|
console.log(name);
|