feat:退还各自食堂
This commit is contained in:
1 parent
cf26ba2a74
commit
32d07535f5
4 files changed
+114
-116
No files matched your search
+4
-4
@@ -8,19 +8,19 @@ VITE_OPEN = true
|
||||
ENV = 'development'
|
||||
|
||||
# ADMIN 服务地址
|
||||
VITE_ADMIN_PROXY_PATH = http://123.157.250.162:8089/api/ # 测试线上
|
||||
# VITE_ADMIN_PROXY_PATH = http://123.157.250.162:8089/api/ # 测试线上
|
||||
# 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.139:9999/ # 邓-本地
|
||||
VITE_ADMIN_PROXY_PATH = http://192.168.101.139:9999/ # 邓-本地
|
||||
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
|
||||
|
||||
# 图片访问基础地址
|
||||
VITE_IMAGE_BASE_PATH = http://123.157.250.162:8089/api/ # 测试线上
|
||||
# VITE_IMAGE_BASE_PATH = http://123.157.250.162:8089/api/ # 测试线上
|
||||
# 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.139:9999 # 邓-本地
|
||||
VITE_IMAGE_BASE_PATH = http://192.168.101.139:9999 # 邓-本地
|
||||
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
|
||||
|
||||
# 代码生成服务地址
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="state.selectId"
|
||||
:placeholder="props.placeholder"
|
||||
clearable
|
||||
@visible-change="(e: boolean) => e && getDictOptions()"
|
||||
>
|
||||
<el-option v-for="v in state.dictList" :key="v.code" :label="v.label" :value="v.value" />
|
||||
<el-select style="width: 100%" v-model="state.selectId" :placeholder="props.placeholder" clearable
|
||||
@visible-change="(e: boolean) => e && getDictOptions()">
|
||||
<el-option v-for="v in filterDictList" :key="v.code" :label="v.label" :value="v.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
@@ -20,6 +15,7 @@ const selectId = defineModel()
|
||||
export type Props = {
|
||||
dictCode: string
|
||||
placeholder?: string
|
||||
hideIds?: string | Array<string>
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
placeholder: "请选择",
|
||||
@@ -40,6 +36,21 @@ watch(
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
const filterDictList = computed(() => {
|
||||
const hideKeys = props.hideIds
|
||||
// 排序
|
||||
const list = state.dictList?.sort((pren: any, next: any) => {
|
||||
return pren.sortOrder - next.sortOrder
|
||||
})
|
||||
if (!hideKeys) return list
|
||||
if (typeof hideKeys == "string") {
|
||||
return list.filter((p: any) => p.value != hideKeys)
|
||||
}
|
||||
if (Array.isArray(hideKeys)) {
|
||||
return list.filter((p: any) => !hideKeys.includes(p.value))
|
||||
}
|
||||
})
|
||||
|
||||
async function getDictOptions() {
|
||||
if (!props.dictCode) return []
|
||||
const dicts = dict().getDict(props.dictCode)
|
||||
@@ -60,7 +71,7 @@ async function getDictOptions() {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-tag + .el-tag {
|
||||
.el-tag+.el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,16 +1,19 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" width="30%" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px"
|
||||
v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="充值时间" prop="importTime">
|
||||
<el-date-picker v-model="form.importTime" type="month" value-format="YYYY-MM-DD" placeholder="请选择充值时间" />
|
||||
<el-date-picker v-model="form.importTime" type="month" value-format="YYYY-MM-DD"
|
||||
placeholder="请选择充值时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="充值类型" prop="bizType">
|
||||
<dict-select v-model="form.bizType" dict-code="wallet_biz_recharge" placeholder="请选择饭卡类型" />
|
||||
<dict-select v-model="form.bizType" dict-code="wallet_biz_recharge"
|
||||
:hide-ids="[roleCodes.includes('RETURN_CANTEEN') ? '' : '3']" placeholder="请选择饭卡类型" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -18,14 +21,26 @@
|
||||
<el-form-item label="钱包" prop="walletTypeId">
|
||||
<!-- <select-wallet-type v-model="form.walletTypeId" placeholder="请选择钱包" :disabled="false" /> -->
|
||||
<el-select v-model="form.walletTypeId" :disabled="walletTypeIdDisabled">
|
||||
<el-option v-for="item in walletTypeOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||
<el-option v-for="item in walletTypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col v-if="roleCodes.includes('RETURN_CANTEEN') && form.bizType == 3" :span="24" class="mb20">
|
||||
<el-form-item label="授权" prop="isAuthorization">
|
||||
<el-radio-group v-model="form.isAuthorization">
|
||||
<el-radio v-for="v in yes_no_type" :key="v.value" :label="v.value" border>
|
||||
{{ v.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" :autosize="{ minRows: 6 }" />
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea"
|
||||
:autosize="{ minRows: 6 }" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -40,11 +55,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="WalletRechargeApplyDialog">
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/wallet/wallet-recharge-apply"
|
||||
const emit = defineEmits(["refresh"])
|
||||
import { getWalletTypeSimple } from "/@/api/wallet/wallet-type"
|
||||
import { useUserInfo } from "/@/stores/userInfo"
|
||||
import { formatDate } from "/@/utils/formatTime"
|
||||
|
||||
// 定义查询字典
|
||||
const { yes_no_type } = useDict("yes_no_type")
|
||||
|
||||
const {
|
||||
userInfos: { roleCodes },
|
||||
@@ -56,15 +76,17 @@ const loading = ref(false)
|
||||
// 定义字典
|
||||
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
const defaultForm = {
|
||||
id: "",
|
||||
userId: "",
|
||||
bizType: "",
|
||||
walletTypeId: "",
|
||||
deptId: "",
|
||||
importTime: "",
|
||||
importTime: formatDate(new Date(), "YYYY-mm"),
|
||||
remark: "",
|
||||
})
|
||||
isAuthorization: "1",
|
||||
}
|
||||
const form = reactive<any>({ ...defaultForm })
|
||||
const walletTypeOptions = ref()
|
||||
const walletTypeIdDisabled = ref(true)
|
||||
watch(
|
||||
@@ -93,6 +115,7 @@ const dataRules = ref({
|
||||
importTime: [{ required: true, message: "导入时间(手动选择)不能为空", trigger: "change" }],
|
||||
bizType: [{ required: true, message: "请选择充值类型", trigger: "change" }],
|
||||
walletTypeId: [{ required: true, message: "请选择钱包类型", trigger: "change" }],
|
||||
isAuthorization: [{ required: true, message: "请选择是否授权", trigger: "change" }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
@@ -118,9 +141,12 @@ const openDialog = async (id: string) => {
|
||||
|
||||
// 提交
|
||||
const onSubmit = async () => {
|
||||
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||
const valid = await dataFormRef.value.validate().catch(() => { })
|
||||
if (!valid) return false
|
||||
|
||||
if (form.bizType == 3 && form.isAuthorization != 1) {
|
||||
useMessage().error("请同意授权协议")
|
||||
return
|
||||
}
|
||||
try {
|
||||
loading.value = true
|
||||
form.id ? await putObj(form) : await addObj(form)
|
||||
@@ -142,8 +168,15 @@ const getwalletRechargeApplyData = async (id: string) => {
|
||||
const res = await getObj(id)
|
||||
if (res.code == 0) {
|
||||
Object.assign(form, res.data)
|
||||
if (!form.importTime) {
|
||||
form.importTime = formatDate(new Date(), "YYYY-mm-dd")
|
||||
}
|
||||
if (!form.isAuthorization) {
|
||||
form.isAuthorization = "1"
|
||||
}
|
||||
}
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm"
|
||||
@keyup.enter="getDataList">
|
||||
<el-row>
|
||||
<el-form-item style="width: 300px" label="用户" prop="userIds">
|
||||
<select-user v-model="state.queryForm.userIds" placeholder="用户" />
|
||||
@@ -10,34 +11,32 @@
|
||||
<select-wallet-type v-model="state.queryForm.walletTypeId" placeholder="饭卡类型" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 200px" label="充值类型" prop="bizType">
|
||||
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz_recharge" placeholder="充值类型" />
|
||||
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz_recharge"
|
||||
placeholder="充值类型" />
|
||||
</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 HH:mm:ss" type="datetimerange" />
|
||||
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetimerange" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 450px" label="审核时间" prop="processTimeList">
|
||||
<el-date-picker v-model="state.queryForm.processTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
|
||||
<el-date-picker v-model="state.queryForm.processTimeList" value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetimerange" />
|
||||
</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 icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()" v-auth="'wallet_walletRechargeApply_add'">
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()"
|
||||
v-auth="'wallet_walletRechargeApply_add'">
|
||||
导 入
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="false"
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
<el-button v-if="false" plain :disabled="multiple" icon="Delete" type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_del'" @click="handleDelete(selectObjs)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
@@ -45,30 +44,19 @@
|
||||
<el-tabs class="flex-1" v-model="activeName" @tab-click="handleClickTabItem">
|
||||
<el-tab-pane v-for="v in tabItems" :key="v.id" :label="v.label" :name="v.value" />
|
||||
</el-tabs>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'wallet_walletRechargeApply_export'"
|
||||
@exportExcel="exportExcel"
|
||||
class="ml10 mr20"
|
||||
style="float: right"
|
||||
@queryTable="getDataList"
|
||||
/>
|
||||
<right-toolbar v-model:showSearch="showSearch" :export="'wallet_walletRechargeApply_export'"
|
||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right"
|
||||
@queryTable="getDataList" />
|
||||
</div>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
border
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
@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" @selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle">
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="80" />
|
||||
<el-table-column prop="username" label="申请人" />
|
||||
<el-table-column prop="bizType" width="100" label="充值类型">
|
||||
<el-table-column prop="bizType" width="120" label="充值类型">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="wallet_biz_recharge" :value="row.bizType" />
|
||||
</template>
|
||||
@@ -97,96 +85,62 @@
|
||||
<el-table-column prop="remark" width="300" label="备注" />
|
||||
<el-table-column width="250" label="时间">
|
||||
<template #default="{ row }">
|
||||
<div class="status">
|
||||
<div v-if="false" class="status">
|
||||
<span>创建时间</span>
|
||||
<span>{{ row.createTime }} </span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<span>申请时间</span>
|
||||
<span>{{ row.applyTime ?? "--" }} </span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<span>审批时间</span>
|
||||
<span>{{ row.processTime ?? "--" }} </span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
v-auths="[
|
||||
'wallet_walletRechargeApply_view',
|
||||
'wallet_walletRechargeApply_apply',
|
||||
'wallet_walletRechargeApply_edit',
|
||||
'wallet_walletRechargeApply_del',
|
||||
'wallet_walletRechargeApply_check',
|
||||
]"
|
||||
width="300"
|
||||
fixed="right"
|
||||
>
|
||||
<el-table-column label="操作" v-auths="[
|
||||
'wallet_walletRechargeApply_view',
|
||||
'wallet_walletRechargeApply_apply',
|
||||
'wallet_walletRechargeApply_edit',
|
||||
'wallet_walletRechargeApply_del',
|
||||
'wallet_walletRechargeApply_check',
|
||||
]" width="300" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-if="row.importTime"
|
||||
icon="Document"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_view'"
|
||||
@click="doInfo(row)"
|
||||
>
|
||||
<el-button v-if="row.importTime" icon="Document" text type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_view'" @click="doInfo(row)">
|
||||
数据
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.importTime && !row.processId"
|
||||
icon="Connection"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_apply'"
|
||||
@click="doApply(row)"
|
||||
>
|
||||
<el-button v-if="row.importTime && !row.processId" icon="Connection" text type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_apply'" @click="doApply(row)">
|
||||
申请
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!row.processId"
|
||||
icon="edit-pen"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_edit'"
|
||||
@click="formDialogRef.openDialog(row.id)"
|
||||
>
|
||||
<el-button v-if="!row.processId" icon="edit-pen" text type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_edit'" @click="formDialogRef.openDialog(row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.isCheckUser && row.processStatus == '1'"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
icon="VideoPlay"
|
||||
@click="deal(row)"
|
||||
v-auth="'wallet_walletRechargeApply_check'"
|
||||
>
|
||||
<el-button v-if="row.isCheckUser && row.processStatus == '1'" type="primary" size="small" link
|
||||
icon="VideoPlay" @click="deal(row)" v-auth="'wallet_walletRechargeApply_check'">
|
||||
开始处理
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.userId == userInfos?.user?.userId && [null, '1'].includes(row.processStatus)"
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'wallet_walletRechargeApply_del'"
|
||||
@click="handleDelete([row.id])"
|
||||
>
|
||||
icon="delete" text type="primary" v-auth="'wallet_walletRechargeApply_del'"
|
||||
@click="handleDelete([row.id])">
|
||||
删除
|
||||
</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" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
|
||||
<upload-excel
|
||||
ref="uploadExcelRef"
|
||||
title="用户信息导入"
|
||||
url="/wallet/wallet-recharge-apply/read-excel"
|
||||
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx"
|
||||
@refreshDataList="getDataList(false)"
|
||||
/>
|
||||
<upload-excel ref="uploadExcelRef" title="用户信息导入" url="/wallet/wallet-recharge-apply/read-excel"
|
||||
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx" @refreshDataList="getDataList(false)" />
|
||||
|
||||
<!-- 审批抽屉 -->
|
||||
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
|
||||
|
||||
Reference in new issue
Block a user