Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4383a7efda
9 files changed
+243
-202
No files matched your search
+2
-2
@@ -12,7 +12,7 @@ ENV = 'development'
|
||||
# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
|
||||
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
|
||||
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/
|
||||
VITE_ADMIN_PROXY_PATH = http://192.168.101.150:9999/ # 邓-本地
|
||||
VITE_ADMIN_PROXY_PATH = http://192.168.101.159:9999/ # 邓-本地
|
||||
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
|
||||
|
||||
# 图片访问基础地址
|
||||
@@ -20,7 +20,7 @@ VITE_ADMIN_PROXY_PATH = http://192.168.101.150:9999/ # 邓-本地
|
||||
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
|
||||
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
|
||||
# VITE_IMAGE_BASE_PATH = http://localhost:9999
|
||||
VITE_IMAGE_BASE_PATH = http://192.168.101.150:9999 # 邓-本地
|
||||
VITE_IMAGE_BASE_PATH = http://192.168.101.159:9999 # 邓-本地
|
||||
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
|
||||
|
||||
# 代码生成服务地址
|
||||
|
||||
@@ -34,6 +34,14 @@ export function fetchList(query?: Object) {
|
||||
})
|
||||
}
|
||||
|
||||
export function qbTotal(data: any) {
|
||||
return request({
|
||||
url: "/wallet/wallet-manage/qb-total",
|
||||
method: "post",
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchListJoinQb(query: any) {
|
||||
return request({
|
||||
url: "/wallet/wallet-manage/page-join-qb",
|
||||
|
||||
@@ -24,6 +24,14 @@ export function comparePageJoin(obj?: Object) {
|
||||
})
|
||||
}
|
||||
|
||||
export function compareInvoicePageJoin(obj?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-recharge-apply/compare-invoice-page-join",
|
||||
method: "get",
|
||||
params: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function pageJoin(query?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-recharge-apply/page-join",
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<DraggableDepTree
|
||||
ref="draggableDepTreeRef"
|
||||
placeholder="请输入部门名称"
|
||||
:show-expand="true"
|
||||
@getSelectNode="handleGetSelectNode"
|
||||
switch-inactive-text="包含"
|
||||
switch-active-text="不包含"
|
||||
:defaultTreeWidth="20"
|
||||
:nodeClickable="false"
|
||||
>
|
||||
<DraggableDepTree ref="draggableDepTreeRef" placeholder="请输入部门名称" :show-expand="true"
|
||||
@getSelectNode="handleGetSelectNode" switch-inactive-text="包含" switch-active-text="不包含"
|
||||
:defaultTreeWidth="20" :nodeClickable="false">
|
||||
<template #default>
|
||||
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||
<el-row>
|
||||
@@ -18,41 +11,30 @@
|
||||
<dict-select v-model="state.queryForm.hourType" dict-code="daily_menu" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 250px" label="食堂" prop="merchantId">
|
||||
<select-mch v-model="state.queryForm.merchantId" :apiParams="{ parentIsNull: false, types: '1' }" />
|
||||
<select-mch v-model="state.queryForm.merchantId"
|
||||
:apiParams="{ parentIsNull: false, types: '1' }" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 450px" label="创建时间" prop="createTimeList">
|
||||
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
|
||||
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD"
|
||||
type="daterange" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="Search" type="primary" @click="doSearch">{{ $t("common.queryBtn") }}</el-button>
|
||||
<el-button icon="Search" type="primary" @click="doSearch">{{ $t("common.queryBtn")
|
||||
}}</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<right-toolbar
|
||||
:search="false"
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'wallet_walletTransaction_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
<right-toolbar :search="false" v-model:showSearch="showSearch"
|
||||
:export="'wallet_walletTransaction_export'" @exportExcel="exportExcel" class="ml10 mr20"
|
||||
style="float: right" @queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
:summary-method="getSummaries"
|
||||
:show-summary="true"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle" :summary-method="getSummaries"
|
||||
:show-summary="true" @selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="80" align="center" />
|
||||
<el-table-column type="index" label="#" width="50" />
|
||||
<el-table-column label="用餐时间" align="center" prop="createTime">
|
||||
@@ -65,6 +47,11 @@
|
||||
<dict-tag :options="daily_menu" :value="row.hourType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="购买次数" align="center" prop="payCount">
|
||||
<template #default="{ row }">
|
||||
<span class="color-primary"> {{ row.timeCount || 0 }}次 </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售出商品数量" align="center" prop="payCount">
|
||||
<template #default="{ row }">
|
||||
<span class="color-success"> {{ row.payCount || 0 }}份 </span>
|
||||
@@ -78,18 +65,15 @@
|
||||
|
||||
<el-table-column fixed="right" label="操作" width="200">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
icon="Tickets"
|
||||
text
|
||||
type="primary"
|
||||
@click="productTotalTableRef.openDialog(parseTime(row.createTime, '{y}-{m}-{d}'), row.hourType)"
|
||||
>
|
||||
<el-button icon="Tickets" text type="primary"
|
||||
@click="productTotalTableRef.openDialog(parseTime(row.createTime, '{y}-{m}-{d}'), row.hourType)">
|
||||
菜品详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
|
||||
v-bind="state.pagination" />
|
||||
</template>
|
||||
</DraggableDepTree>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<el-form size="large" class="login-content-form" ref="loginFormRef" :rules="loginRules" :model="state.ruleForm" @keyup.enter="handleVerify">
|
||||
<el-form
|
||||
size="large"
|
||||
class="login-content-form"
|
||||
ref="loginFormRef"
|
||||
:rules="loginRules"
|
||||
:model="state.ruleForm"
|
||||
@keyup.enter="handleVerify"
|
||||
>
|
||||
<el-form-item class="login-animation1" prop="username">
|
||||
<el-input
|
||||
text
|
||||
@@ -56,22 +63,22 @@
|
||||
</el-form-item>
|
||||
<el-form-item class="mt-4 login-animation4">
|
||||
<el-button type="primary" class="rounded-lg login-content-submit" v-waves @click="handleVerify" :loading="loading">
|
||||
<span class="font-semibold tracking-wide">{{ $t('password.accountBtnText') }}</span>
|
||||
<span class="font-semibold tracking-wide">{{ $t("password.accountBtnText") }}</span>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
|
||||
<div class="relative flex items-center justify-between">
|
||||
<div class="ml-auto text-sm">
|
||||
<a href="#" class="text-blue-500" @click="emit('change', LoginTypeEnum.MOBILE)">
|
||||
{{ $t('password.mobileLogin') }}
|
||||
</a>
|
||||
<!-- <a href="#" class="text-blue-500" @click="emit('change', LoginTypeEnum.MOBILE)">
|
||||
{{ $t("password.mobileLogin") }}
|
||||
</a> -->
|
||||
<a href="#" v-if="autoRegisterEnable" class="ml-2 text-blue-500" @click="emit('change', LoginTypeEnum.REGISTER)">
|
||||
{{ $t('password.createAccount') }}
|
||||
{{ $t("password.createAccount") }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="font12 mt30 login-animation4 login-msg text-slate-400">{{ $t('browserMsgText') }}</div>
|
||||
<div class="font12 mt30 login-animation4 login-msg text-slate-400">{{ $t("browserMsgText") }}</div>
|
||||
</el-form>
|
||||
<Verify
|
||||
@success="verifySuccess"
|
||||
@@ -84,92 +91,92 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="password">
|
||||
import { defineAsyncComponent, reactive, ref } from 'vue';
|
||||
import { useUserInfo } from '/@/stores/userInfo';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { generateUUID } from '/@/utils/other';
|
||||
import { LoginErrorEnum, LoginTypeEnum } from '/@/api/login';
|
||||
import { defineAsyncComponent, reactive, ref } from "vue"
|
||||
import { useUserInfo } from "/@/stores/userInfo"
|
||||
import { useI18n } from "vue-i18n"
|
||||
import { generateUUID } from "/@/utils/other"
|
||||
import { LoginErrorEnum, LoginTypeEnum } from "/@/api/login"
|
||||
|
||||
// 使用国际化插件
|
||||
const { t } = useI18n();
|
||||
const { t } = useI18n()
|
||||
|
||||
// 动态加载滑块验证码组件
|
||||
const Verify = defineAsyncComponent(() => import('/@/components/Verifition/Verify.vue'));
|
||||
const Verify = defineAsyncComponent(() => import("/@/components/Verifition/Verify.vue"))
|
||||
|
||||
// 定义变量内容
|
||||
const autoRegisterEnable = ref(import.meta.env.VITE_REGISTER_ENABLE === 'true');
|
||||
const emit = defineEmits(['signInSuccess', 'change']); // 声明事件名称
|
||||
const loginFormRef = ref(); // 定义LoginForm表单引用
|
||||
const loading = ref(false); // 定义是否正在登录中
|
||||
const autoRegisterEnable = ref(import.meta.env.VITE_REGISTER_ENABLE === "true")
|
||||
const emit = defineEmits(["signInSuccess", "change"]) // 声明事件名称
|
||||
const loginFormRef = ref() // 定义LoginForm表单引用
|
||||
const loading = ref(false) // 定义是否正在登录中
|
||||
const state = reactive({
|
||||
isShowPassword: false, // 是否显示密码
|
||||
ruleForm: {
|
||||
// 表单数据
|
||||
username: '', // 用户名
|
||||
password: '', // 密码
|
||||
code: '', // 验证码
|
||||
randomStr: 'blockPuzzle', // 验证码随机数
|
||||
username: "", // 用户名
|
||||
password: "", // 密码
|
||||
code: "", // 验证码
|
||||
randomStr: "blockPuzzle", // 验证码随机数
|
||||
},
|
||||
});
|
||||
})
|
||||
|
||||
const loginRules = reactive({
|
||||
username: [{ required: true, trigger: 'blur', message: t('password.accountPlaceholder1') }], // 用户名校验规则
|
||||
password: [{ required: true, trigger: 'blur', message: t('password.accountPlaceholder2') }], // 密码校验规则
|
||||
code: [{ required: true, trigger: 'blur', message: t('verify.imageCode') }],
|
||||
});
|
||||
username: [{ required: true, trigger: "blur", message: t("password.accountPlaceholder1") }], // 用户名校验规则
|
||||
password: [{ required: true, trigger: "blur", message: t("password.accountPlaceholder2") }], // 密码校验规则
|
||||
code: [{ required: true, trigger: "blur", message: t("verify.imageCode") }],
|
||||
})
|
||||
|
||||
const verifyref = ref<InstanceType<typeof Verify>>(null); // 定义verify组件引用
|
||||
const verifyref = ref<InstanceType<typeof Verify>>(null) // 定义verify组件引用
|
||||
// 是否开启验证码
|
||||
const verifyEnable = ref(import.meta.env.VITE_VERIFY_ENABLE === 'true');
|
||||
const verifyImageEnable = ref(import.meta.env.VITE_VERIFY_IMAGE_ENABLE === 'true');
|
||||
const imgSrc = ref('');
|
||||
const verifyEnable = ref(import.meta.env.VITE_VERIFY_ENABLE === "true")
|
||||
const verifyImageEnable = ref(import.meta.env.VITE_VERIFY_IMAGE_ENABLE === "true")
|
||||
const imgSrc = ref("")
|
||||
|
||||
// 调用图形证码进行校验
|
||||
const getVerifyImageCode = () => {
|
||||
state.ruleForm.randomStr = generateUUID();
|
||||
imgSrc.value = `${import.meta.env.VITE_API_URL}${import.meta.env.VITE_IS_MICRO == 'false' ? '/admin' : '/auth'}/code/image?randomStr=${
|
||||
state.ruleForm.randomStr = generateUUID()
|
||||
imgSrc.value = `${import.meta.env.VITE_API_URL}${import.meta.env.VITE_IS_MICRO == "false" ? "/admin" : "/auth"}/code/image?randomStr=${
|
||||
state.ruleForm.randomStr
|
||||
}`;
|
||||
};
|
||||
}`
|
||||
}
|
||||
|
||||
// 调用滑块验证码进行校验
|
||||
const handleVerify = async () => {
|
||||
const valid = await loginFormRef.value.validate().catch(() => {}); // 表单校验
|
||||
const valid = await loginFormRef.value.validate().catch(() => {}) // 表单校验
|
||||
|
||||
if (valid && verifyEnable.value) {
|
||||
verifyref.value.show(); // 显示验证组件
|
||||
verifyref.value.show() // 显示验证组件
|
||||
} else if (valid) {
|
||||
onSignIn(); // 调用登录方法
|
||||
onSignIn() // 调用登录方法
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 滑块验证码校验成功调用后台登录接口
|
||||
const verifySuccess = (params: any) => {
|
||||
state.ruleForm.code = params.captchaVerification; // 获取验证码
|
||||
onSignIn(); // 调用登录方法
|
||||
};
|
||||
state.ruleForm.code = params.captchaVerification // 获取验证码
|
||||
onSignIn() // 调用登录方法
|
||||
}
|
||||
|
||||
// 账号密码登录
|
||||
const onSignIn = async () => {
|
||||
loading.value = true; // 正在登录中
|
||||
loading.value = true // 正在登录中
|
||||
try {
|
||||
await useUserInfo().login(state.ruleForm); // 调用登录方法
|
||||
emit('signInSuccess'); // 触发事件
|
||||
await useUserInfo().login(state.ruleForm) // 调用登录方法
|
||||
emit("signInSuccess") // 触发事件
|
||||
} catch (err: any) {
|
||||
if (err?.data === LoginErrorEnum.CREDENTIALS_EXPIRED) {
|
||||
emit('change', LoginTypeEnum.EXPIRE, state.ruleForm.username); // 触发修改密码
|
||||
emit("change", LoginTypeEnum.EXPIRE, state.ruleForm.username) // 触发修改密码
|
||||
}
|
||||
} finally {
|
||||
loading.value = false; // 登录结束
|
||||
loading.value = false // 登录结束
|
||||
if (verifyImageEnable.value) {
|
||||
getVerifyImageCode();
|
||||
getVerifyImageCode()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (verifyImageEnable.value) {
|
||||
getVerifyImageCode();
|
||||
getVerifyImageCode()
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@@ -1,16 +1,9 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<DraggableDepTree
|
||||
ref="draggableDepTreeRef"
|
||||
placeholder="请输入部门名称"
|
||||
:show-expand="true"
|
||||
@getSelectNode="handleGetSelectNode"
|
||||
switch-inactive-text="包含"
|
||||
switch-active-text="不包含"
|
||||
:defaultTreeWidth="20"
|
||||
:nodeClickable="false"
|
||||
>
|
||||
<DraggableDepTree ref="draggableDepTreeRef" placeholder="请输入部门名称" :show-expand="true"
|
||||
@getSelectNode="handleGetSelectNode" switch-inactive-text="包含" switch-active-text="不包含"
|
||||
:defaultTreeWidth="20" :nodeClickable="false">
|
||||
<template #default>
|
||||
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||
<el-row>
|
||||
@@ -18,57 +11,43 @@
|
||||
<select-user v-model="state.queryForm.userId" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 200px" label="饭卡类型" prop="walletTypeId">
|
||||
<select-wallet-type v-model="state.queryForm.walletTypeId" placeholder="饭卡类型" clearable />
|
||||
<select-wallet-type v-model="state.queryForm.walletTypeId" placeholder="饭卡类型"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 200px" label="月份" prop="walletRecordMonth">
|
||||
<el-date-picker
|
||||
v-model="state.queryForm.walletRecordMonth"
|
||||
value-format="YYYY-MM"
|
||||
type="month"
|
||||
:clearable="false"
|
||||
placeholder="选择月份"
|
||||
/>
|
||||
<el-date-picker v-model="state.queryForm.walletRecordMonth" value-format="YYYY-MM"
|
||||
type="month" :clearable="false" placeholder="选择月份" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
|
||||
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn")
|
||||
}}</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'wallet_walletManage_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
<div class="mb8 flex justify-between" style="width: 100%">
|
||||
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'wallet_walletManage_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'wallet_walletRecord_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
></right-toolbar>
|
||||
<div class="flex gap-5">
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'wallet_walletRecord_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right"
|
||||
@queryTable="getDataList">
|
||||
<el-tooltip class="item" effect="dark" content="统计" placement="top">
|
||||
<el-button icon="DataLine" circle @click="viewBalanceStatistics" />
|
||||
</el-tooltip>
|
||||
|
||||
</right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:summary-method="getSummaries"
|
||||
show-summary
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
>
|
||||
<el-table-column v-auth="'wallet_walletManage_del'" type="selection" width="40" align="center" />
|
||||
<el-table :data="state.dataList" v-loading="state.loading" border :summary-method="getSummaries"
|
||||
show-summary :cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
|
||||
@selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
|
||||
<el-table-column v-auth="'wallet_walletManage_del'" type="selection" width="40"
|
||||
align="center" />
|
||||
<el-table-column type="index" label="#" width="80" />
|
||||
<el-table-column prop="username" width="100" label="用户" />
|
||||
<el-table-column prop="userAvatar" width="80" label="头像">
|
||||
@@ -107,16 +86,39 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
|
||||
v-bind="state.pagination" />
|
||||
</template>
|
||||
</DraggableDepTree>
|
||||
</div>
|
||||
|
||||
<el-drawer v-model="showDrawer" @closed="drawerClose">
|
||||
<el-table :data="[balanceStatistics]" style="width: 100%">
|
||||
<el-table-column align="center" label="余额统计">
|
||||
<el-table-column align="center" prop="total" label="总余额">
|
||||
<template #default="{ row }">
|
||||
{{ displayPrice(row.total) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="eatTotal" label="饭卡钱包">
|
||||
<template #default="{ row }">
|
||||
{{ displayPrice(row.eatTotal) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="payTotal" label="消费钱包">
|
||||
<template #default="{ row }">
|
||||
{{ displayPrice(row.payTotal) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemWalletManage">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchListJoinQb, delObjs } from "/@/api/wallet/wallet-manage"
|
||||
import { fetchListJoinQb, delObjs, qbTotal } from "/@/api/wallet/wallet-manage"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
@@ -131,6 +133,11 @@ const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const showDrawer = ref(false) // 余额统计抽屉开关
|
||||
const balanceStatisticsLoading = ref(false)
|
||||
const balanceStatistics = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
@@ -154,6 +161,31 @@ const resetQuery = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 余额统计
|
||||
const viewBalanceStatistics = async () => {
|
||||
showDrawer.value = true
|
||||
balanceStatisticsLoading.value = true
|
||||
try {
|
||||
const { code, data } = await qbTotal({ ...state.queryForm })
|
||||
if (code == 0) {
|
||||
Object.assign(balanceStatistics, data)
|
||||
return
|
||||
}
|
||||
return useMessage().error(data.msg || "获取数据失败")
|
||||
} catch (error: any) {
|
||||
useMessage().error(error.msg)
|
||||
} finally {
|
||||
balanceStatisticsLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭抽屉
|
||||
const drawerClose = () => {
|
||||
for (const key in balanceStatistics) {
|
||||
balanceStatistics[key] = 0
|
||||
}
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
postDownBlobFile(
|
||||
|
||||
@@ -52,7 +52,9 @@ const { query } = useRoute()
|
||||
|
||||
onMounted(async () => {
|
||||
const id = query.id as unknown as any
|
||||
const invoiceId = query.invoiceId as unknown as any
|
||||
state.queryForm.id = id
|
||||
state.queryForm.invoiceId = invoiceId
|
||||
getList()
|
||||
getDetail()
|
||||
})
|
||||
@@ -66,7 +68,7 @@ const state = reactive<any>({
|
||||
total: 0,
|
||||
pageSizes: [10, 20, 50, 100, 200, 500],
|
||||
},
|
||||
pageList: walletRechargeApplyApi.comparePageJoin,
|
||||
pageList: walletRechargeApplyApi.compareInvoicePageJoin,
|
||||
})
|
||||
|
||||
const { downBlobFile, tableStyle } = useTable(state)
|
||||
@@ -107,13 +109,27 @@ const getList = async () => {
|
||||
...state.pagination,
|
||||
...state.queryForm,
|
||||
}
|
||||
const { data: pageData } = await walletRechargeApplyApi.comparePageJoin(_pa)
|
||||
data.list = pageData.page.records
|
||||
data.total = pageData.page.total
|
||||
const { data: pageData } = await walletRechargeApplyApi.compareInvoicePageJoin(_pa)
|
||||
console.log(pageData, "pageData");
|
||||
|
||||
if (pageData.records && pageData.records.length) {
|
||||
pageData.records = pageData.records.map((v: any) => {
|
||||
return {
|
||||
...v,
|
||||
currentImport_price: v.price
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
console.log(pageData.records, "pageData.records");
|
||||
|
||||
|
||||
data.list = pageData.records
|
||||
data.total = pageData.total
|
||||
data.tableList = pageData.tableList
|
||||
console.log(pageData.tableList)
|
||||
data.tableListStr = pageData.tableListStr
|
||||
state.pagination.total = pageData.page.total
|
||||
|
||||
state.pagination.total = pageData.total
|
||||
} finally {
|
||||
state.loading = false
|
||||
}
|
||||
@@ -151,47 +167,8 @@ const getSummaries = (param: SummaryMethodProps) => {
|
||||
} else {
|
||||
sums[index] = "NaN"
|
||||
}
|
||||
} else if (column.property === "afterBalance") {
|
||||
const values = data1.map((item) => Number(item[column.property]))
|
||||
if (!values.every((value) => Number.isNaN(value))) {
|
||||
sums[index] = h("span", { style: {} }, [
|
||||
displayPrice(
|
||||
values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
} else {
|
||||
return prev
|
||||
}
|
||||
}, 0),
|
||||
),
|
||||
])
|
||||
} else {
|
||||
sums[index] = "NaN"
|
||||
}
|
||||
} else if (column.property === data.tableList[0]) {
|
||||
sums[index] = displayPrice(
|
||||
data.list.reduce((prev: any, curr: any) => {
|
||||
return prev + curr[data.tableList[0] + "_price"]
|
||||
}, 0),
|
||||
)
|
||||
} else if (column.property === data.tableList[1]) {
|
||||
sums[index] = displayPrice(
|
||||
data.list.reduce((prev: any, curr: any) => {
|
||||
return prev + curr[data.tableList[1] + "_price"]
|
||||
}, 0),
|
||||
)
|
||||
} else if (column.property === data.tableList[2]) {
|
||||
sums[index] = displayPrice(
|
||||
data.list.reduce((prev: any, curr: any) => {
|
||||
return prev + curr[data.tableList[2] + "_price"]
|
||||
}, 0),
|
||||
)
|
||||
} else {
|
||||
sums[index] = ""
|
||||
}
|
||||
})
|
||||
|
||||
return sums
|
||||
}
|
||||
</script>
|
||||
@@ -71,7 +71,7 @@
|
||||
<dict-tag :options="check_status" :value="row.processStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="发票状态" width="100">
|
||||
<el-table-column prop="status" label="发票状态" width="120">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="recharge_invoice_status" :value="row.status" />
|
||||
</template>
|
||||
@@ -99,9 +99,13 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="260" fixed="right">
|
||||
<el-table-column label="操作" min-width="320" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<div class="flex">
|
||||
<el-button v-if="!['6'].includes(row.status)" icon="Document" text type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_view'" @click="doInfo(row)">
|
||||
数据
|
||||
</el-button>
|
||||
<el-button v-auth="'wallet_walletRechargeApply_print'" icon="printer" text type="primary"
|
||||
:disabled="loading" @click="previewInvoice(row)">
|
||||
查看发票
|
||||
@@ -153,6 +157,8 @@ const PrintDialog = defineAsyncComponent(() => import("./print-dialog.vue"))
|
||||
|
||||
const { recharge_invoice_status, check_status } = useDict("recharge_invoice_status", "check_status")
|
||||
|
||||
const { push } = useRouter()
|
||||
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const uploadExcelRef = ref()
|
||||
@@ -186,6 +192,15 @@ const resetQuery = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
const doInfo = (row: any) => {
|
||||
push({
|
||||
path: "/wallet/wallet-recharge-apply/preview-excel", query: {
|
||||
id: null,
|
||||
invoiceId: row.id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
downBlobFile("/wallet/walletRechargeInvoice/export", Object.assign(state.queryForm, { ids: selectObjs }), "walletRechargeInvoice.xlsx")
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" title="预览" width="800px" :close-on-click-modal="false" draggable destroy-on-close>
|
||||
<dict-tag class="mb-2" :options="check_status" :value="receiptData.processStatus" />
|
||||
|
||||
<div v-loading="loading" id="receiptRef" ref="receiptRef"
|
||||
class="w-[17.5cm] h-[9.5cm] border border-gray-400 p-6 bg-[#EBE1C622]">
|
||||
<div class="text-center mx-auto w-[10cm] text-3xl font-bold">浦江县行政事业单位食堂统一收款收据</div>
|
||||
@@ -91,17 +89,18 @@
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="handleClose" :disabled="loading">关闭</el-button>
|
||||
<el-button v-if="receiptData.processStatus == '2' || receiptData.processStatus == '3'"
|
||||
<el-button v-if="['2', '3'].includes(receiptData.processStatus!) && !['6'].includes(receiptData.status!)"
|
||||
v-auth="'wallet_walletRechargeApply_back'" type="primary" plain @click="backInvoice"
|
||||
:disabled="loading">
|
||||
作废
|
||||
</el-button>
|
||||
<el-button v-if="!receiptData.processStatus" type="primary" :disabled="loading"
|
||||
@click="applyStamp">申请审批</el-button>
|
||||
<el-button v-if="receiptData.processStatus == undefined" v-auth="'wallet_walletRechargeApply_receiptSave'"
|
||||
type="primary" @click="saveReceipt" :disabled="loading">保存</el-button>
|
||||
<el-button v-if="receiptData.stampPicUrl" type="warning" @click="handlePrint"
|
||||
:disabled="loading">打印</el-button>
|
||||
<el-button v-if="!receiptData.processStatus && !['6'].includes(receiptData.status!)" type="primary"
|
||||
:disabled="loading" @click="applyStamp">申请审批</el-button>
|
||||
<el-button v-if="receiptData.processStatus == undefined && !['6'].includes(receiptData.status!)"
|
||||
v-auth="'wallet_walletRechargeApply_receiptSave'" type="primary" @click="saveReceipt"
|
||||
:disabled="loading">保存</el-button>
|
||||
<el-button v-if="receiptData.stampPicUrl && !['6'].includes(receiptData.status!)" type="warning"
|
||||
@click="handlePrint" :disabled="loading">打印</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -131,6 +130,7 @@ interface ReceiptData {
|
||||
picUrl: string
|
||||
stampPicUrl: string
|
||||
processStatus: string | null
|
||||
status?: string
|
||||
}
|
||||
|
||||
const emit = defineEmits(["refresh"])
|
||||
@@ -259,13 +259,23 @@ const saveReceipt = async (): Promise<void> => {
|
||||
const applyStamp = async () => {
|
||||
await useMessage().delConfirm("是否提交审批")
|
||||
if (receiptData.value.processStatus == "1") return useMessage().warning("你已提交过申请,请勿重复提交")
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
// 先保存
|
||||
const res = await bindInvoice({
|
||||
...receiptData.value,
|
||||
deptOrUser: receiptData.value.deptOrUser,
|
||||
applyId: receiptData.value.id,
|
||||
})
|
||||
if (res.code != 0) {
|
||||
useMessage().error("保存失败")
|
||||
return
|
||||
}
|
||||
// 申请审批
|
||||
const blob = await genImage()
|
||||
if (!blob) return useMessage().success("图片生成失败")
|
||||
if (!blob) return useMessage().error("图片生成失败")
|
||||
const picUrl = await uploadImage(blob)
|
||||
if (!picUrl) return useMessage().success("图片上传失败")
|
||||
if (!picUrl) return useMessage().error("图片上传失败")
|
||||
|
||||
const { code, msg } = await apply({ id: receiptData.value.id, picUrl })
|
||||
if (code == 0) {
|
||||
|
||||
Reference in new issue
Block a user