Merge branch 'master' of https://codeup.aliyun.com/bsdtec/biz-pc-cloud
This commit is contained in:
commit
916bb2e466
9 files changed
+878
-106
No files matched your search
@@ -0,0 +1,41 @@
|
|||||||
|
import request from "/@/utils/request"
|
||||||
|
|
||||||
|
export function fetchList(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carInfo/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addObj(obj?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carInfo',
|
||||||
|
method: 'post',
|
||||||
|
data: obj
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getObj(id?: string) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carInfo/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delObjs(ids?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carInfo',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function putObj(obj?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carInfo',
|
||||||
|
method: 'put',
|
||||||
|
data: obj
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import request from "/@/utils/request"
|
||||||
|
|
||||||
|
export function fetchList(query?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carPassRecord/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addObj(obj?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carPassRecord',
|
||||||
|
method: 'post',
|
||||||
|
data: obj
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getObj(id?: string) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carPassRecord/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function delObjs(ids?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carPassRecord',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function putObj(obj?: Object) {
|
||||||
|
return request({
|
||||||
|
url: '/integrated/carPassRecord',
|
||||||
|
method: 'put',
|
||||||
|
data: obj
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,177 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
||||||
|
:close-on-click-modal="false" draggable>
|
||||||
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="车牌号" prop="carNumber">
|
||||||
|
<el-input v-model="form.carNumber" placeholder="请输入车牌号"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="车主姓名" prop="ownerName">
|
||||||
|
<el-input v-model="form.ownerName" placeholder="请输入车主姓名"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="车主手机号码" prop="ownerPhone">
|
||||||
|
<el-input v-model="form.ownerPhone" placeholder="请输入车主手机号码"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="审核状态" prop="checkStatus">
|
||||||
|
<el-input v-model="form.checkStatus" placeholder="请输入审核状态"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="部门id" prop="deptId">
|
||||||
|
<el-input v-model="form.deptId" placeholder="请输入部门id"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="是否是临时车" prop="isTemp">
|
||||||
|
<el-radio-group v-model="form.isTemp">
|
||||||
|
<el-radio :label="item.value" v-for="(item, index) in is_show" border :key="index">{{ item.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="临时失效日期" prop="tempDate">
|
||||||
|
<el-date-picker type="datetime" placeholder="请选择临时失效日期" v-model="form.tempDate" :value-format="dateTimeStr"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="流程id" prop="processInstanceId">
|
||||||
|
<el-input v-model="form.processInstanceId" placeholder="请输入流程id"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="审核原因" prop="checkReason">
|
||||||
|
<el-input v-model="form.checkReason" placeholder="请输入审核原因"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="用户id" prop="userId">
|
||||||
|
<el-input v-model="form.userId" placeholder="请输入用户id"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="车辆状态" prop="carStatus">
|
||||||
|
<el-select v-model="form.carStatus" placeholder="请选择车辆状态">
|
||||||
|
<el-option :value="item.value" :label="item.label" v-for="(item, index) in car_status" :key="index"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="CarInfoDialog">
|
||||||
|
import { useDict } from '/@/hooks/dict';
|
||||||
|
import { useMessage } from "/@/hooks/message";
|
||||||
|
import { getObj, addObj, putObj } from '/@/api/integrated/carInfo'
|
||||||
|
import { rule } from '/@/utils/validate';
|
||||||
|
const emit = defineEmits(['refresh']);
|
||||||
|
|
||||||
|
// 定义变量内容
|
||||||
|
const dataFormRef = ref();
|
||||||
|
const visible = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
// 定义字典
|
||||||
|
const { car_status,check_status,is_show } = useDict('car_status','check_status','is_show')
|
||||||
|
|
||||||
|
// 提交表单数据
|
||||||
|
const form = reactive({
|
||||||
|
id:'',
|
||||||
|
carNumber: '',
|
||||||
|
ownerName: '',
|
||||||
|
ownerPhone: '',
|
||||||
|
checkStatus: '',
|
||||||
|
deptId: '',
|
||||||
|
isTemp: '',
|
||||||
|
tempDate: '',
|
||||||
|
processInstanceId: '',
|
||||||
|
checkReason: '',
|
||||||
|
userId: '',
|
||||||
|
carStatus: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
// 定义校验规则
|
||||||
|
const dataRules = ref({
|
||||||
|
carNumber: [{required: true, message: '车牌号不能为空', trigger: 'blur'}],
|
||||||
|
ownerName: [{required: true, message: '车主姓名不能为空', trigger: 'blur'}],
|
||||||
|
ownerPhone: [{required: true, message: '车主手机号码不能为空', trigger: 'blur'}, { validator: rule.mobilePhone, trigger: 'blur' }],
|
||||||
|
})
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (id: string) => {
|
||||||
|
visible.value = true
|
||||||
|
form.id = ''
|
||||||
|
|
||||||
|
// 重置表单数据
|
||||||
|
nextTick(() => {
|
||||||
|
dataFormRef.value?.resetFields();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取carInfo信息
|
||||||
|
if (id) {
|
||||||
|
form.id = id
|
||||||
|
getcarInfoData(id)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const onSubmit = async () => {
|
||||||
|
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||||
|
if (!valid) return false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
form.id ? await putObj(form) : await addObj(form);
|
||||||
|
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||||
|
visible.value = false;
|
||||||
|
emit('refresh');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 初始化表单数据
|
||||||
|
const getcarInfoData = (id: string) => {
|
||||||
|
// 获取数据
|
||||||
|
loading.value = true
|
||||||
|
getObj(id).then((res: any) => {
|
||||||
|
Object.assign(form, res.data)
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
// 暴露变量
|
||||||
|
defineExpose({
|
||||||
|
openDialog
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
<template>
|
||||||
|
<div class="layout-padding">
|
||||||
|
<div class="layout-padding-auto layout-padding-view">
|
||||||
|
<el-row v-show="showSearch">
|
||||||
|
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||||
|
<el-form-item label="车牌号" prop="carNumber" >
|
||||||
|
<el-input placeholder="请输入车牌号" v-model="state.queryForm.carNumber" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车主姓名" prop="ownerName" >
|
||||||
|
<el-input placeholder="请输入车主姓名" v-model="state.queryForm.ownerName" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="车主手机号码" prop="ownerPhone" >
|
||||||
|
<el-input placeholder="请输入车主手机号码" v-model="state.queryForm.ownerPhone" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="search" type="primary" @click="getDataList">
|
||||||
|
查询
|
||||||
|
</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<div class="mb8" style="width: 100%">
|
||||||
|
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||||
|
v-auth="'integrated_carInfo_add'">
|
||||||
|
新 增
|
||||||
|
</el-button>
|
||||||
|
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||||
|
v-auth="'integrated_carInfo_del'" @click="handleDelete(selectObjs)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" :export="'integrated_carInfo_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"
|
||||||
|
@selection-change="selectionChangHandle"
|
||||||
|
@sort-change="sortChangeHandle">
|
||||||
|
<el-table-column type="selection" width="40" align="center" />
|
||||||
|
<el-table-column type="index" label="#" width="40" />
|
||||||
|
<el-table-column prop="carNumber" label="车牌号" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="ownerName" label="车主姓名" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="ownerPhone" label="车主手机号码" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="checkStatus" label="审核状态" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="check_status" :value="scope.row.checkStatus"></dict-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="deptId" label="部门id" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="isTemp" label="是否是临时车" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="is_show" :value="scope.row.isTemp"></dict-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="tempDate" label="临时失效日期" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="processInstanceId" label="流程id" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="checkReason" label="审核原因" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="userId" label="用户id" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="carStatus" label="车辆状态" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="car_status" :value="scope.row.carStatus"></dict-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button icon="edit-pen" text type="primary" v-auth="'integrated_carInfo_edit'"
|
||||||
|
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||||
|
<el-button icon="delete" text type="primary" v-auth="'integrated_carInfo_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 编辑、新增 -->
|
||||||
|
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="systemCarInfo">
|
||||||
|
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||||
|
import { fetchList, delObjs } from "/@/api/integrated/carInfo";
|
||||||
|
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||||
|
import { useDict } from '/@/hooks/dict';
|
||||||
|
|
||||||
|
// 引入组件
|
||||||
|
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||||
|
// 定义查询字典
|
||||||
|
|
||||||
|
const { car_status,check_status,is_show } = useDict('car_status','check_status','is_show')
|
||||||
|
// 定义变量内容
|
||||||
|
const formDialogRef = ref()
|
||||||
|
// 搜索变量
|
||||||
|
const queryRef = ref()
|
||||||
|
const showSearch = ref(true)
|
||||||
|
// 多选变量
|
||||||
|
const selectObjs = ref([]) as any
|
||||||
|
const multiple = ref(true)
|
||||||
|
|
||||||
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
|
queryForm: {},
|
||||||
|
pageList: fetchList
|
||||||
|
})
|
||||||
|
|
||||||
|
// table hook
|
||||||
|
const {
|
||||||
|
getDataList,
|
||||||
|
currentChangeHandle,
|
||||||
|
sizeChangeHandle,
|
||||||
|
sortChangeHandle,
|
||||||
|
downBlobFile,
|
||||||
|
tableStyle
|
||||||
|
} = useTable(state)
|
||||||
|
|
||||||
|
// 清空搜索条件
|
||||||
|
const resetQuery = () => {
|
||||||
|
// 清空搜索条件
|
||||||
|
queryRef.value?.resetFields()
|
||||||
|
// 清空多选
|
||||||
|
selectObjs.value = []
|
||||||
|
getDataList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出excel
|
||||||
|
const exportExcel = () => {
|
||||||
|
downBlobFile('/integrated/carInfo/export', Object.assign(state.queryForm, { ids: selectObjs }), 'carInfo.xlsx')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多选事件
|
||||||
|
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||||
|
selectObjs.value = objs.map(({ id }) => id);
|
||||||
|
multiple.value = !objs.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 删除操作
|
||||||
|
const handleDelete = async (ids: string[]) => {
|
||||||
|
try {
|
||||||
|
await useMessageBox().confirm('此操作将永久删除');
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await delObjs(ids);
|
||||||
|
getDataList();
|
||||||
|
useMessage().success('删除成功');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
|
||||||
|
:close-on-click-modal="false" draggable>
|
||||||
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="车牌号" prop="carNumber">
|
||||||
|
<el-input v-model="form.carNumber" placeholder="请输入车牌号"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="通行时间" prop="passTime">
|
||||||
|
<el-input v-model="form.passTime" placeholder="请输入通行时间"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="通行地点" prop="location">
|
||||||
|
<el-input v-model="form.location" placeholder="请输入通行地点"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="到访单位" prop="deptId">
|
||||||
|
<el-input v-model="form.deptId" placeholder="请输入到访单位"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="进出方向" prop="direction">
|
||||||
|
<el-input v-model="form.direction" placeholder="请输入进出方向"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="现场图片" prop="picUrl">
|
||||||
|
<el-input v-model="form.picUrl" placeholder="请输入现场图片"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12" class="mb20">
|
||||||
|
<el-form-item label="道闸id" prop="gateId">
|
||||||
|
<el-input v-model="form.gateId" placeholder="请输入道闸id"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="visible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="CarPassRecordDialog">
|
||||||
|
import { useDict } from '/@/hooks/dict';
|
||||||
|
import { useMessage } from "/@/hooks/message";
|
||||||
|
import { getObj, addObj, putObj } from '/@/api/integrated/carPassRecord'
|
||||||
|
import { rule } from '/@/utils/validate';
|
||||||
|
const emit = defineEmits(['refresh']);
|
||||||
|
|
||||||
|
// 定义变量内容
|
||||||
|
const dataFormRef = ref();
|
||||||
|
const visible = ref(false)
|
||||||
|
const loading = ref(false)
|
||||||
|
// 定义字典
|
||||||
|
const { direction } = useDict('direction')
|
||||||
|
|
||||||
|
// 提交表单数据
|
||||||
|
const form = reactive({
|
||||||
|
id:'',
|
||||||
|
carNumber: '',
|
||||||
|
passTime: '',
|
||||||
|
location: '',
|
||||||
|
deptId: '',
|
||||||
|
direction: '',
|
||||||
|
picUrl: '',
|
||||||
|
gateId: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
// 定义校验规则
|
||||||
|
const dataRules = ref({
|
||||||
|
})
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
|
const openDialog = (id: string) => {
|
||||||
|
visible.value = true
|
||||||
|
form.id = ''
|
||||||
|
|
||||||
|
// 重置表单数据
|
||||||
|
nextTick(() => {
|
||||||
|
dataFormRef.value?.resetFields();
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取carPassRecord信息
|
||||||
|
if (id) {
|
||||||
|
form.id = id
|
||||||
|
getcarPassRecordData(id)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const onSubmit = async () => {
|
||||||
|
const valid = await dataFormRef.value.validate().catch(() => {});
|
||||||
|
if (!valid) return false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
loading.value = true;
|
||||||
|
form.id ? await putObj(form) : await addObj(form);
|
||||||
|
useMessage().success(form.id ? '修改成功' : '添加成功');
|
||||||
|
visible.value = false;
|
||||||
|
emit('refresh');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// 初始化表单数据
|
||||||
|
const getcarPassRecordData = (id: string) => {
|
||||||
|
// 获取数据
|
||||||
|
loading.value = true
|
||||||
|
getObj(id).then((res: any) => {
|
||||||
|
Object.assign(form, res.data)
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
// 暴露变量
|
||||||
|
defineExpose({
|
||||||
|
openDialog
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
<template>
|
||||||
|
<div class="layout-padding">
|
||||||
|
<div class="layout-padding-auto layout-padding-view">
|
||||||
|
<el-row v-show="showSearch">
|
||||||
|
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
|
||||||
|
<el-form-item label="车牌号" prop="carNumber" >
|
||||||
|
<el-input placeholder="请输入车牌号" v-model="state.queryForm.carNumber" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="search" type="primary" @click="getDataList">
|
||||||
|
查询
|
||||||
|
</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<div class="mb8" style="width: 100%">
|
||||||
|
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
|
||||||
|
v-auth="'integrated_carPassRecord_add'">
|
||||||
|
新 增
|
||||||
|
</el-button>
|
||||||
|
<el-button plain :disabled="multiple" icon="Delete" type="primary"
|
||||||
|
v-auth="'integrated_carPassRecord_del'" @click="handleDelete(selectObjs)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" :export="'integrated_carPassRecord_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"
|
||||||
|
@selection-change="selectionChangHandle"
|
||||||
|
@sort-change="sortChangeHandle">
|
||||||
|
<el-table-column type="selection" width="40" align="center" />
|
||||||
|
<el-table-column type="index" label="#" width="40" />
|
||||||
|
<el-table-column prop="carNumber" label="车牌号" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="passTime" label="通行时间" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="location" label="通行地点" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="deptId" label="到访单位" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="direction" label="进出方向" show-overflow-tooltip>
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="direction" :value="scope.row.direction"></dict-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="picUrl" label="现场图片" show-overflow-tooltip/>
|
||||||
|
<el-table-column prop="gateId" label="道闸id" show-overflow-tooltip/>
|
||||||
|
<el-table-column label="操作" width="150">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button icon="edit-pen" text type="primary" v-auth="'integrated_carPassRecord_edit'"
|
||||||
|
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
|
||||||
|
<el-button icon="delete" text type="primary" v-auth="'integrated_carPassRecord_del'" @click="handleDelete([scope.row.id])">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 编辑、新增 -->
|
||||||
|
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="systemCarPassRecord">
|
||||||
|
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||||
|
import { fetchList, delObjs } from "/@/api/integrated/carPassRecord";
|
||||||
|
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||||
|
import { useDict } from '/@/hooks/dict';
|
||||||
|
|
||||||
|
// 引入组件
|
||||||
|
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||||
|
// 定义查询字典
|
||||||
|
|
||||||
|
const { direction } = useDict('direction')
|
||||||
|
// 定义变量内容
|
||||||
|
const formDialogRef = ref()
|
||||||
|
// 搜索变量
|
||||||
|
const queryRef = ref()
|
||||||
|
const showSearch = ref(true)
|
||||||
|
// 多选变量
|
||||||
|
const selectObjs = ref([]) as any
|
||||||
|
const multiple = ref(true)
|
||||||
|
|
||||||
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
|
queryForm: {},
|
||||||
|
pageList: fetchList
|
||||||
|
})
|
||||||
|
|
||||||
|
// table hook
|
||||||
|
const {
|
||||||
|
getDataList,
|
||||||
|
currentChangeHandle,
|
||||||
|
sizeChangeHandle,
|
||||||
|
sortChangeHandle,
|
||||||
|
downBlobFile,
|
||||||
|
tableStyle
|
||||||
|
} = useTable(state)
|
||||||
|
|
||||||
|
// 清空搜索条件
|
||||||
|
const resetQuery = () => {
|
||||||
|
// 清空搜索条件
|
||||||
|
queryRef.value?.resetFields()
|
||||||
|
// 清空多选
|
||||||
|
selectObjs.value = []
|
||||||
|
getDataList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出excel
|
||||||
|
const exportExcel = () => {
|
||||||
|
downBlobFile('/integrated/carPassRecord/export', Object.assign(state.queryForm, { ids: selectObjs }), 'carPassRecord.xlsx')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多选事件
|
||||||
|
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||||
|
selectObjs.value = objs.map(({ id }) => id);
|
||||||
|
multiple.value = !objs.length;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 删除操作
|
||||||
|
const handleDelete = async (ids: string[]) => {
|
||||||
|
try {
|
||||||
|
await useMessageBox().confirm('此操作将永久删除');
|
||||||
|
} catch {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await delObjs(ids);
|
||||||
|
getDataList();
|
||||||
|
useMessage().success('删除成功');
|
||||||
|
} catch (err: any) {
|
||||||
|
useMessage().error(err.msg);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,5 +1,12 @@
|
|||||||
<template>
|
<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-form-item class="login-animation1" prop="username">
|
||||||
<el-input
|
<el-input
|
||||||
text
|
text
|
||||||
@@ -56,22 +63,22 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="mt-4 login-animation4">
|
<el-form-item class="mt-4 login-animation4">
|
||||||
<el-button type="primary" class="rounded-lg login-content-submit" v-waves @click="handleVerify" :loading="loading">
|
<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-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<div class="relative flex items-center justify-between">
|
<div class="relative flex items-center justify-between">
|
||||||
<div class="ml-auto text-sm">
|
<div class="ml-auto text-sm">
|
||||||
<a href="#" class="text-blue-500" @click="emit('change', LoginTypeEnum.MOBILE)">
|
<!-- <a href="#" class="text-blue-500" @click="emit('change', LoginTypeEnum.MOBILE)">
|
||||||
{{ $t('password.mobileLogin') }}
|
{{ $t("password.mobileLogin") }}
|
||||||
</a>
|
</a> -->
|
||||||
<a href="#" v-if="autoRegisterEnable" class="ml-2 text-blue-500" @click="emit('change', LoginTypeEnum.REGISTER)">
|
<a href="#" v-if="autoRegisterEnable" class="ml-2 text-blue-500" @click="emit('change', LoginTypeEnum.REGISTER)">
|
||||||
{{ $t('password.createAccount') }}
|
{{ $t("password.createAccount") }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</el-form>
|
||||||
<Verify
|
<Verify
|
||||||
@success="verifySuccess"
|
@success="verifySuccess"
|
||||||
@@ -84,92 +91,92 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="password">
|
<script setup lang="ts" name="password">
|
||||||
import { defineAsyncComponent, reactive, ref } from 'vue';
|
import { defineAsyncComponent, reactive, ref } from "vue"
|
||||||
import { useUserInfo } from '/@/stores/userInfo';
|
import { useUserInfo } from "/@/stores/userInfo"
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from "vue-i18n"
|
||||||
import { generateUUID } from '/@/utils/other';
|
import { generateUUID } from "/@/utils/other"
|
||||||
import { LoginErrorEnum, LoginTypeEnum } from '/@/api/login';
|
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 autoRegisterEnable = ref(import.meta.env.VITE_REGISTER_ENABLE === "true")
|
||||||
const emit = defineEmits(['signInSuccess', 'change']); // 声明事件名称
|
const emit = defineEmits(["signInSuccess", "change"]) // 声明事件名称
|
||||||
const loginFormRef = ref(); // 定义LoginForm表单引用
|
const loginFormRef = ref() // 定义LoginForm表单引用
|
||||||
const loading = ref(false); // 定义是否正在登录中
|
const loading = ref(false) // 定义是否正在登录中
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
isShowPassword: false, // 是否显示密码
|
isShowPassword: false, // 是否显示密码
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
// 表单数据
|
// 表单数据
|
||||||
username: '', // 用户名
|
username: "", // 用户名
|
||||||
password: '', // 密码
|
password: "", // 密码
|
||||||
code: '', // 验证码
|
code: "", // 验证码
|
||||||
randomStr: 'blockPuzzle', // 验证码随机数
|
randomStr: "blockPuzzle", // 验证码随机数
|
||||||
},
|
},
|
||||||
});
|
})
|
||||||
|
|
||||||
const loginRules = reactive({
|
const loginRules = reactive({
|
||||||
username: [{ required: true, trigger: 'blur', message: t('password.accountPlaceholder1') }], // 用户名校验规则
|
username: [{ required: true, trigger: "blur", message: t("password.accountPlaceholder1") }], // 用户名校验规则
|
||||||
password: [{ required: true, trigger: 'blur', message: t('password.accountPlaceholder2') }], // 密码校验规则
|
password: [{ required: true, trigger: "blur", message: t("password.accountPlaceholder2") }], // 密码校验规则
|
||||||
code: [{ required: true, trigger: 'blur', message: t('verify.imageCode') }],
|
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 verifyEnable = ref(import.meta.env.VITE_VERIFY_ENABLE === "true")
|
||||||
const verifyImageEnable = ref(import.meta.env.VITE_VERIFY_IMAGE_ENABLE === 'true');
|
const verifyImageEnable = ref(import.meta.env.VITE_VERIFY_IMAGE_ENABLE === "true")
|
||||||
const imgSrc = ref('');
|
const imgSrc = ref("")
|
||||||
|
|
||||||
// 调用图形证码进行校验
|
// 调用图形证码进行校验
|
||||||
const getVerifyImageCode = () => {
|
const getVerifyImageCode = () => {
|
||||||
state.ruleForm.randomStr = generateUUID();
|
state.ruleForm.randomStr = generateUUID()
|
||||||
imgSrc.value = `${import.meta.env.VITE_API_URL}${import.meta.env.VITE_IS_MICRO == 'false' ? '/admin' : '/auth'}/code/image?randomStr=${
|
imgSrc.value = `${import.meta.env.VITE_API_URL}${import.meta.env.VITE_IS_MICRO == "false" ? "/admin" : "/auth"}/code/image?randomStr=${
|
||||||
state.ruleForm.randomStr
|
state.ruleForm.randomStr
|
||||||
}`;
|
}`
|
||||||
};
|
}
|
||||||
|
|
||||||
// 调用滑块验证码进行校验
|
// 调用滑块验证码进行校验
|
||||||
const handleVerify = async () => {
|
const handleVerify = async () => {
|
||||||
const valid = await loginFormRef.value.validate().catch(() => {}); // 表单校验
|
const valid = await loginFormRef.value.validate().catch(() => {}) // 表单校验
|
||||||
|
|
||||||
if (valid && verifyEnable.value) {
|
if (valid && verifyEnable.value) {
|
||||||
verifyref.value.show(); // 显示验证组件
|
verifyref.value.show() // 显示验证组件
|
||||||
} else if (valid) {
|
} else if (valid) {
|
||||||
onSignIn(); // 调用登录方法
|
onSignIn() // 调用登录方法
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
// 滑块验证码校验成功调用后台登录接口
|
// 滑块验证码校验成功调用后台登录接口
|
||||||
const verifySuccess = (params: any) => {
|
const verifySuccess = (params: any) => {
|
||||||
state.ruleForm.code = params.captchaVerification; // 获取验证码
|
state.ruleForm.code = params.captchaVerification // 获取验证码
|
||||||
onSignIn(); // 调用登录方法
|
onSignIn() // 调用登录方法
|
||||||
};
|
}
|
||||||
|
|
||||||
// 账号密码登录
|
// 账号密码登录
|
||||||
const onSignIn = async () => {
|
const onSignIn = async () => {
|
||||||
loading.value = true; // 正在登录中
|
loading.value = true // 正在登录中
|
||||||
try {
|
try {
|
||||||
await useUserInfo().login(state.ruleForm); // 调用登录方法
|
await useUserInfo().login(state.ruleForm) // 调用登录方法
|
||||||
emit('signInSuccess'); // 触发事件
|
emit("signInSuccess") // 触发事件
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (err?.data === LoginErrorEnum.CREDENTIALS_EXPIRED) {
|
if (err?.data === LoginErrorEnum.CREDENTIALS_EXPIRED) {
|
||||||
emit('change', LoginTypeEnum.EXPIRE, state.ruleForm.username); // 触发修改密码
|
emit("change", LoginTypeEnum.EXPIRE, state.ruleForm.username) // 触发修改密码
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false; // 登录结束
|
loading.value = false // 登录结束
|
||||||
if (verifyImageEnable.value) {
|
if (verifyImageEnable.value) {
|
||||||
getVerifyImageCode();
|
getVerifyImageCode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (verifyImageEnable.value) {
|
if (verifyImageEnable.value) {
|
||||||
getVerifyImageCode();
|
getVerifyImageCode()
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -1,21 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" width="30%" :close-on-click-modal="false" draggable>
|
<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"
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||||
v-loading="loading">
|
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="充值时间" prop="importTime">
|
<el-form-item label="充值时间" prop="importTime">
|
||||||
<el-date-picker v-model="form.importTime" type="month" value-format="YYYY-MM-DD"
|
<el-date-picker v-model="form.importTime" type="month" value-format="YYYY-MM-DD" placeholder="请选择充值时间" />
|
||||||
placeholder="请选择充值时间" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="充值类型" prop="bizType">
|
<el-form-item label="充值类型" prop="bizType">
|
||||||
<!-- :hide-ids="[(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) ? '' : '3', auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2', '1']" -->
|
<!-- :hide-ids="[(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) ? '' : '3', auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2', '1']" -->
|
||||||
<dict-select v-model="form.bizType" :disabled="form.invoiceId" dict-code="wallet_biz_recharge"
|
<dict-select
|
||||||
:hide-ids="[(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) ? '' : '3', auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2', form.bizType == '1' ? '' : '1']"
|
v-model="form.bizType"
|
||||||
placeholder="请选择饭卡类型" />
|
:disabled="form.invoiceId"
|
||||||
|
dict-code="wallet_biz_recharge"
|
||||||
|
:hide-ids="[
|
||||||
|
roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund']) ? '' : '3',
|
||||||
|
auths(['wallet_walletRechargeApply_select_jz']) ? '' : '2',
|
||||||
|
form.bizType == '1' || auths(['wallet_walletRechargeApply_unbind']) ? '' : '1',
|
||||||
|
]"
|
||||||
|
placeholder="请选择饭卡类型"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
@@ -23,15 +29,16 @@
|
|||||||
<el-form-item label="钱包" prop="walletTypeId">
|
<el-form-item label="钱包" prop="walletTypeId">
|
||||||
<!-- <select-wallet-type v-model="form.walletTypeId" placeholder="请选择钱包" :disabled="false" /> -->
|
<!-- <select-wallet-type v-model="form.walletTypeId" placeholder="请选择钱包" :disabled="false" /> -->
|
||||||
<el-select v-model="form.walletTypeId" :disabled="walletTypeIdDisabled">
|
<el-select v-model="form.walletTypeId" :disabled="walletTypeIdDisabled">
|
||||||
<el-option v-for="item in walletTypeOptions" :key="item.id" :label="item.name"
|
<el-option v-for="item in walletTypeOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
:value="item.id" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col
|
<el-col
|
||||||
v-if="(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) && form.bizType == 3"
|
v-if="(roleCodes.includes('RETURN_CANTEEN') || auths(['wallet_walletRechargeApply_refund'])) && form.bizType == 3"
|
||||||
:span="24" class="mb20">
|
:span="24"
|
||||||
|
class="mb20"
|
||||||
|
>
|
||||||
<el-form-item prop="isAuthorization">
|
<el-form-item prop="isAuthorization">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span>授权</span>
|
<span>授权</span>
|
||||||
@@ -47,8 +54,7 @@
|
|||||||
|
|
||||||
<el-col :span="24" class="mb20">
|
<el-col :span="24" class="mb20">
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea"
|
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" :autosize="{ minRows: 6 }" />
|
||||||
:autosize="{ minRows: 6 }" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -150,7 +156,7 @@ const openDialog = async (id: string) => {
|
|||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
const valid = await dataFormRef.value.validate().catch(() => { })
|
const valid = await dataFormRef.value.validate().catch(() => {})
|
||||||
if (!valid) return false
|
if (!valid) return false
|
||||||
if (form.bizType == 3 && form.isAuthorization != 1) {
|
if (form.bizType == 3 && form.isAuthorization != 1) {
|
||||||
useMessage().error("请同意授权协议")
|
useMessage().error("请同意授权协议")
|
||||||
@@ -185,7 +191,7 @@ const getwalletRechargeApplyData = async (id: string) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(err);
|
console.error(err)
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="layout-padding">
|
<div class="layout-padding">
|
||||||
<div class="layout-padding-auto layout-padding-view">
|
<div class="layout-padding-auto layout-padding-view">
|
||||||
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm"
|
<el-form v-show="showSearch" ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||||
@keyup.enter="getDataList">
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form-item style="width: 300px" label="用户" prop="userIds">
|
<el-form-item style="width: 300px" label="用户" prop="userIds">
|
||||||
<select-user v-model="state.queryForm.userIds" placeholder="用户" />
|
<select-user v-model="state.queryForm.userIds" placeholder="用户" />
|
||||||
@@ -11,47 +10,69 @@
|
|||||||
<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>
|
||||||
<el-form-item style="width: 200px" label="充值类型" prop="bizType">
|
<el-form-item style="width: 200px" label="充值类型" prop="bizType">
|
||||||
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz_recharge"
|
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz_recharge" placeholder="充值类型" />
|
||||||
placeholder="充值类型" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="width: 450px" label="创建时间" prop="createTimeList">
|
<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"
|
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
|
||||||
type="datetimerange" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="width: 450px" label="审核时间" prop="processTimeList">
|
<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"
|
<el-date-picker v-model="state.queryForm.processTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
|
||||||
type="datetimerange" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn")
|
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
|
||||||
}}</el-button>
|
|
||||||
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
|
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row>
|
<el-row>
|
||||||
<div class="mb8" style="width: 100%">
|
<div class="mb8" style="width: 100%">
|
||||||
<el-button icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()"
|
<el-button icon="folder-add" type="primary" class="ml10" @click="uploadExcelRef.show()" v-auth="'wallet_walletRechargeApply_add'">
|
||||||
v-auth="'wallet_walletRechargeApply_add'">
|
|
||||||
导 入
|
导 入
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="false" plain :disabled="multiple" icon="Delete" type="primary"
|
<el-button
|
||||||
v-auth="'wallet_walletRechargeApply_del'" @click="handleDelete(selectObjs)">
|
icon="folder-add"
|
||||||
|
type="primary"
|
||||||
|
class="ml10"
|
||||||
|
@click="uploadExcelUnbindRef.show()"
|
||||||
|
v-auth="'wallet_walletRechargeApply_unbind'"
|
||||||
|
>
|
||||||
|
导 入(不绑定发票)
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="false"
|
||||||
|
plain
|
||||||
|
:disabled="multiple"
|
||||||
|
icon="Delete"
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_del'"
|
||||||
|
@click="handleDelete(selectObjs)"
|
||||||
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<el-tabs class="flex-1" v-model="activeName" @tab-click="handleClickTabItem">
|
<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-tab-pane v-for="v in tabItems" :key="v.id" :label="v.label" :name="v.value" />
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<right-toolbar v-model:showSearch="showSearch" :export="'wallet_walletRechargeApply_export'"
|
<right-toolbar
|
||||||
@exportExcel="exportExcel" class="ml10 mr20" style="float: right"
|
v-model:showSearch="showSearch"
|
||||||
@queryTable="getDataList" />
|
:export="'wallet_walletRechargeApply_export'"
|
||||||
|
@exportExcel="exportExcel"
|
||||||
|
class="ml10 mr20"
|
||||||
|
style="float: right"
|
||||||
|
@queryTable="getDataList"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
|
<el-table
|
||||||
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
|
:data="state.dataList"
|
||||||
@sort-change="sortChangeHandle">
|
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="selection" width="40" align="center" />
|
||||||
<el-table-column type="index" label="#" width="80" />
|
<el-table-column type="index" label="#" width="80" />
|
||||||
<el-table-column prop="username" label="申请人" />
|
<el-table-column prop="username" label="申请人" />
|
||||||
@@ -103,48 +124,93 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" v-auths="[
|
<el-table-column
|
||||||
'wallet_walletRechargeApply_view',
|
label="操作"
|
||||||
'wallet_walletRechargeApply_apply',
|
v-auths="[
|
||||||
'wallet_walletRechargeApply_edit',
|
'wallet_walletRechargeApply_view',
|
||||||
'wallet_walletRechargeApply_del',
|
'wallet_walletRechargeApply_apply',
|
||||||
'wallet_walletRechargeApply_check',
|
'wallet_walletRechargeApply_edit',
|
||||||
]" width="300" fixed="right">
|
'wallet_walletRechargeApply_del',
|
||||||
|
'wallet_walletRechargeApply_check',
|
||||||
|
]"
|
||||||
|
width="300"
|
||||||
|
fixed="right"
|
||||||
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button v-if="row.importTime" icon="Document" text type="primary"
|
<el-button
|
||||||
v-auth="'wallet_walletRechargeApply_view'" @click="doInfo(row)">
|
v-if="row.importTime"
|
||||||
|
icon="Document"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_view'"
|
||||||
|
@click="doInfo(row)"
|
||||||
|
>
|
||||||
数据
|
数据
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="row.importTime && !row.processId" icon="Connection" text type="primary"
|
<el-button
|
||||||
v-auth="'wallet_walletRechargeApply_apply'" @click="doApply(row)">
|
v-if="row.importTime && !row.processId"
|
||||||
|
icon="Connection"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_apply'"
|
||||||
|
@click="doApply(row)"
|
||||||
|
>
|
||||||
申请
|
申请
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="!row.processId" icon="edit-pen" text type="primary"
|
<el-button
|
||||||
v-auth="'wallet_walletRechargeApply_edit'" @click="formDialogRef.openDialog(row.id)">
|
v-if="!row.processId"
|
||||||
|
icon="edit-pen"
|
||||||
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_edit'"
|
||||||
|
@click="formDialogRef.openDialog(row.id)"
|
||||||
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-if="row.isCheckUser && row.processStatus == '1'" type="primary" size="small" link
|
<el-button
|
||||||
icon="VideoPlay" @click="deal(row)" v-auth="'wallet_walletRechargeApply_check'">
|
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>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="row.userId == userInfos?.user?.userId && [null, '1'].includes(row.processStatus)"
|
v-if="row.userId == userInfos?.user?.userId && [null, '1'].includes(row.processStatus)"
|
||||||
icon="delete" text type="primary" v-auth="'wallet_walletRechargeApply_del'"
|
icon="delete"
|
||||||
@click="handleDelete([row.id])">
|
text
|
||||||
|
type="primary"
|
||||||
|
v-auth="'wallet_walletRechargeApply_del'"
|
||||||
|
@click="handleDelete([row.id])"
|
||||||
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||||
v-bind="state.pagination" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 编辑、新增 -->
|
<!-- 编辑、新增 -->
|
||||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||||
|
|
||||||
<upload-excel ref="uploadExcelRef" title="充值导入" url="/wallet/wallet-recharge-apply/read-excel"
|
<upload-excel
|
||||||
temp-url="/admin/sys-file/local/file/wallet_recharge.xlsx" @refreshDataList="getDataList(false)" />
|
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-unbind
|
||||||
|
ref="uploadExcelUnbindRef"
|
||||||
|
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" />
|
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
|
||||||
@@ -167,6 +233,7 @@ const { push } = useRouter()
|
|||||||
// 引入组件
|
// 引入组件
|
||||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||||
const UploadExcel = defineAsyncComponent(() => import("./upload-excel.vue"))
|
const UploadExcel = defineAsyncComponent(() => import("./upload-excel.vue"))
|
||||||
|
const UploadExcelUnbind = defineAsyncComponent(() => import("/@/components/Upload/Excel.vue"))
|
||||||
// 定义查询字典
|
// 定义查询字典
|
||||||
const { wallet_biz_recharge, wallet_type, check_status } = useDict("wallet_biz_recharge", "wallet_type", "check_status")
|
const { wallet_biz_recharge, wallet_type, check_status } = useDict("wallet_biz_recharge", "wallet_type", "check_status")
|
||||||
// store
|
// store
|
||||||
@@ -176,6 +243,7 @@ const { userInfos } = storeToRefs(stores)
|
|||||||
// 定义变量内容
|
// 定义变量内容
|
||||||
const formDialogRef = ref()
|
const formDialogRef = ref()
|
||||||
const uploadExcelRef = ref()
|
const uploadExcelRef = ref()
|
||||||
|
const uploadExcelUnbindRef = ref()
|
||||||
// 搜索变量
|
// 搜索变量
|
||||||
const queryRef = ref()
|
const queryRef = ref()
|
||||||
const showSearch = ref(true)
|
const showSearch = ref(true)
|
||||||
|
|||||||
Reference in new issue
Block a user