| | |
| | | # 页面标题
|
| | | VITE_APP_TITLE = 中原金融管理系统
|
| | | VITE_APP_TITLE = 入企扫码
|
| | |
|
| | | # 开发环境配置
|
| | | VITE_APP_ENV = 'development'
|
| | |
|
| | | VITE_APP_BASE = 'http://121.43.62.184/prod-api'
|
| | | VITE_APP_BASE = 'http://172.16.61.34:8089'
|
| | | # VITE_APP_BASE = 'http://172.16.61.34:8089'
|
| | | #VITE_APP_BASE = 'http://localhost:8089'
|
| | |
|
| | |
|
| | | # VITE_APP_BASE = 'http://ss.mantanghui.com:8089'
|
| | | # 中原金融管理系统/开发环境
|
| | | # 入企扫码/开发环境
|
| | | VITE_APP_BASE_API = '/dev-api'
|
| | |
| | | # 页面标题
|
| | | VITE_APP_TITLE = 中原金融管理系统
|
| | | VITE_APP_TITLE = 入企扫码
|
| | |
|
| | | # 生产环境配置
|
| | | VITE_APP_ENV = 'production'
|
| | |
| | | #基础域名
|
| | | VITE_APP_BASE = 'http://ss.mantanghui.com:8089'
|
| | |
|
| | | # 中原金融管理系统/生产环境
|
| | | # 入企扫码/生产环境
|
| | | VITE_APP_BASE_API = '/prod-api'
|
| | |
|
| | | # 是否在打包时开启压缩,支持 gzip 和 brotli
|
| | |
| | | # 页面标题
|
| | | VITE_APP_TITLE = 中原金融管理系统
|
| | | VITE_APP_TITLE = 入企扫码
|
| | |
|
| | | # 生产环境配置
|
| | | VITE_APP_ENV = 'staging'
|
| | |
|
| | | # 中原金融管理系统/生产环境
|
| | | # 入企扫码/生产环境
|
| | | VITE_APP_BASE_API = '/stage-api'
|
| | |
|
| | | # 是否在打包时开启压缩,支持 gzip 和 brotli
|
| | |
| | | <meta name="renderer" content="webkit" />
|
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
|
| | | <!-- <link rel="icon" href="/logo.ico" /> -->
|
| | | <title>中原金融管理系统</title>
|
| | | <title>入企扫码</title>
|
| | | <!--[if lt IE 11
|
| | | ]><script>
|
| | | window.location.href = "/html/ie.html";
|
| | |
| | | {
|
| | | "name": "ruoyi",
|
| | | "version": "3.8.5",
|
| | | "description": "中原金融管理系统",
|
| | | "description": "入企扫码",
|
| | | "author": "中原金融",
|
| | | "scripts": {
|
| | | "build:prod": "vite build",
|
New file |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // 查询企业信息列表 |
| | | export function listCompany(query) { |
| | | return request({ |
| | | url: '/system/company/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // 查询企业信息详细 |
| | | export function getCompany(companyId) { |
| | | return request({ |
| | | url: '/system/company/' + companyId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 新增企业信息 |
| | | export function addCompany(data) { |
| | | return request({ |
| | | url: '/system/company/add', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 修改企业信息 |
| | | export function updateCompany(data) { |
| | | return request({ |
| | | url: '/system/company/upd', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 删除企业信息 |
| | | export function delCompany(companyId) { |
| | | return request({ |
| | | url: '/system/company/' + companyId, |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | // 导出企业模板下载 |
| | | |
| | | export function downTemplate() { |
| | | return request({ |
| | | url: '/system/company/export', |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | // 开始模板导入 |
| | | |
| | | export function importTemplate() { |
| | | return request({ |
| | | url: '/system/company/import', |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | // 导入记录 /system/company/export |
| | | |
| | | |
| | | export function importTemplateRecord() { |
| | | return request({ |
| | | url: '/system/company/export', |
| | | method: 'get', |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | | // /system/doc/list 慧企政策列表 |
| | | export function docList() { |
| | | return request({ |
| | | url: '/system/doc/list', |
| | | method: 'get', |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | |
| | | // menu hover
|
| | | .sub-menu-title-noDropdown,
|
| | | .el-sub-menu__title {
|
| | | background-color: $base-menu-background !important;
|
| | | &:hover {
|
| | | // background-color: rgba(0, 0, 0, 0.06) !important;
|
| | | background-color: $base-sub-menu-hover !important;
|
| | |
| | |
|
| | | & .theme-dark .is-active > .el-sub-menu__title {
|
| | | // color: $base-menu-color-active;
|
| | | color: var(--el-menu-active-color) !important;
|
| | | // background-color: red !important;
|
| | | color: white;
|
| | | // color: var(--el-menu-active-color) !important;
|
| | | background-color: $base-menu-background !important;
|
| | | }
|
| | |
|
| | | & .theme-dark .el-menu .is-opened {
|
| | | .el-sub-menu{
|
| | | .el-sub-menu__title{
|
| | | background-color: rgba(31, 45, 61, 1) !important;
|
| | | }
|
| | | }
|
| | | }
|
| | | & .nest-menu .el-sub-menu>.el-sub-menu__title,
|
| | | & .el-sub-menu .el-menu-item {
|
| | | // min-width: $base-sidebar-width !important;
|
| | |
| | | background-color: $base-sub-menu-background ;
|
| | |
|
| | | &:hover {
|
| | | background-color: $base-sub-menu-hover !important;
|
| | | // background-color: $base-sub-menu-hover !important;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | // color: $base-menu-color-active !important;
|
| | | background-color: $base-menu-light-background !important;
|
| | | // border-left: 3px solid $--color-primary;
|
| | | color: white;
|
| | | &:hover {
|
| | | background-color: $base-menu-light-background !important;
|
| | | color: white;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | */
|
| | | export default {
|
| | | menuColors: {
|
| | | baseMenuColor: "#333", ////菜单标题未选中文本颜色
|
| | | baseMenuColor: "white", ////菜单标题未选中文本颜色
|
| | | baseMenuLightColor: "rgba(64,158,255)", ////菜单标题选中文本颜色
|
| | | baseMenuColorActive: "rgba(64,158,255)", //菜单主文本下级被选中
|
| | | baseMenuLightBackground: "#F8F9FF", //菜单选中之后背景颜色
|
| | | baseMenuBackground: "#ffffff", //主菜单背景颜色
|
| | | baseSubMenuBackground: "#ffffff", //子菜单背景颜色
|
| | | BaseSubMenuHover: "#F8F9FF", //鼠标滑过背景颜色
|
| | | baseMenuLightBackground: "rgba(64,158,255)", //菜单选中之后背景颜色
|
| | | baseMenuBackground: "#304156", //主菜单背景颜色
|
| | | baseSubMenuBackground: "#1f2d3d", //子菜单背景颜色
|
| | | BaseSubMenuHover: "rgba(0, 21, 40, 1)", //鼠标滑过背景颜色
|
| | | BaseMenuBoxShodow: "#F8F9FF", //菜单边框阴影颜色
|
| | | },
|
| | | menuOpenWidth: "200px", //菜单展开时宽度
|
| | |
| | | <template>
|
| | | <div class="sidebar-logo-container" :class="{ collapse: collapse }">
|
| | | <transition name="sidebarLogoFade">
|
| | | <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
| | | <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/home">
|
| | | <!-- <img v-if="logo" :src="logo" class="sidebar-logo" /> -->
|
| | | LOGO
|
| | | </router-link>
|
| | | <router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
| | | <router-link v-else key="expand" class="sidebar-logo-link" to="/home">
|
| | | <!-- <img v-if="logotxt" :src="logotxt" class="sidebar-logo-txt" /> -->
|
| | | 入企扫码
|
| | | </router-link>
|
| | | </transition>
|
| | | </div>
|
| | |
| | | },
|
| | | });
|
| | |
|
| | | const title = ref("中原金融管理系统");
|
| | | const title = ref("入企扫码");
|
| | | const settingsStore = useSettingsStore();
|
| | | const sideTheme = computed(() => settingsStore.sideTheme);
|
| | | </script>
|
| | |
| | | });
|
| | | };
|
| | | </script>
|
| | |
|
| | | <style>
|
| | | .is-active .el-menu{
|
| | | background-color: rgba(31, 45, 61, 1) !important;
|
| | | }
|
| | | .el-sub-menu .el-menu{
|
| | | background-color: rgba(31, 45, 61, 1) !important;
|
| | | }
|
| | | </style>
|
| | |
| | | usePermissionStore()
|
| | | .generateRoutes()
|
| | | .then((accessRoutes) => {
|
| | | console.log(accessRoutes)
|
| | | // 根据roles权限生成可访问的路由表
|
| | | accessRoutes.forEach((route: any) => {
|
| | | if (!isHttp(route.path)) {
|
| | |
| | | component: Layout,
|
| | | redirect: "/index",
|
| | | children: [
|
| | | {
|
| | | path: "/index",
|
| | | component: () => import("@/views/index.vue"),
|
| | | name: "Index",
|
| | | meta: { title: "函件信息", icon: "dashboard", affix: true },
|
| | | },
|
| | | // {
|
| | | // path: "/index",
|
| | | // component: () => import("@/views/index.vue"),
|
| | | // name: "Index",
|
| | | // meta: { title: "函件信息", icon: "dashboard", affix: true },
|
| | | // },
|
| | | ],
|
| | | },
|
| | | {
|
New file |
| | |
| | | // 审批状态 -1拒绝,0待审批,1审批中,2通过 |
| | | |
| | | export const judgeStatus = { |
| | | '-1': '拒绝', |
| | | 0: '待审批', |
| | | 1: '审批中', |
| | | 2: '通过' |
| | | } |
| | | // 企业状态 0正常,1禁用 |
| | | |
| | | export const companyStatus = { |
| | | 0: '正常', |
| | | 1: '禁用' |
| | | } |
| | | |
| | | // 0注册,1导入 来源 |
| | | export const scopeList = { |
| | | 0: '注册', |
| | | 1: '导入' |
| | | } |
| | |
| | | downloadLoadingInstance.close();
|
| | | });
|
| | | }
|
| | |
|
| | | // 通用下载方法
|
| | | export function downloadGet(url: string, params: any, filename: string, config: any, isSaveFile = false) {
|
| | | downloadLoadingInstance = ElLoading.service({ text: "正在下载数据,请稍候", background: "rgba(0, 0, 0, 0.7)" });
|
| | | return service
|
| | | .get(url, { params }, {
|
| | | transformRequest: [
|
| | | (params) => {
|
| | | return tansParams(params);
|
| | | },
|
| | | ],
|
| | | headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
| | | responseType: "blob",
|
| | | ...config,
|
| | | })
|
| | | .then(async (data) => {
|
| | | const isBlob = blobValidate(data);
|
| | | if (isBlob && isSaveFile) {
|
| | | const blob = new Blob([data]);
|
| | | saveAs(blob, filename);
|
| | | } else {
|
| | | if(!isSaveFile) {
|
| | | } else {
|
| | | const resText = await data.text();
|
| | | const rspObj = JSON.parse(resText);
|
| | | const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode["default"];
|
| | | ElMessage.error(errMsg);
|
| | | }
|
| | | }
|
| | | downloadLoadingInstance.close();
|
| | | })
|
| | | .catch((r) => {
|
| | | console.error(r);
|
| | | ElMessage.error("下载文件出现错误,请联系管理员!");
|
| | | downloadLoadingInstance.close();
|
| | | });
|
| | | }
|
| | | const request = <T = any>(_config: AxiosRequestConfig<any>): Promise<T> => {
|
| | | return service(_config) as Promise<T>;
|
| | | };
|
| | |
| | | <h6>对不起,您没有访问权限,请不要进行非法操作!您可以返回主页面</h6>
|
| | | <ul class="list-unstyled">
|
| | | <li class="link-type">
|
| | | <router-link to="/">
|
| | | <router-link to="/home">
|
| | | 回首页
|
| | | </router-link>
|
| | | </li>
|
| | |
| | | <div class="bullshit__info">
|
| | | 对不起,您正在寻找的页面不存在。尝试检查URL的错误,然后按浏览器上的刷新按钮或尝试在我们的应用程序中找到其他内容。
|
| | | </div>
|
| | | <router-link to="/index" class="bullshit__return-home">
|
| | | <router-link to="/home" class="bullshit__return-home">
|
| | | 返回首页
|
| | | </router-link>
|
| | | </div>
|
New file |
| | |
| | | <template> |
| | | <div>首页</div> |
| | | </template> |
New file |
| | |
| | | <template> |
| | | <el-dialog title="用户导入" v-model="dialogVisible" width="600px" append-to-body @close="closeDialog" |
| | | > |
| | | <el-form label-width="80px"> |
| | | <el-form-item label="下载模板"> |
| | | <el-link type="primary" @click="downLoad">企业信息导入模板.xlsx</el-link> |
| | | </el-form-item> |
| | | <el-form-item label="选取文件"> |
| | | <FileUpload :limit="1" :fileType="['cvs', 'xlsx']" v-model="form.exportNews.file"></FileUpload> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" plain @click="startExport">开始导入</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script lang="ts" setup> |
| | | import { ref } from 'vue' |
| | | import { ElMessageBox } from 'element-plus' |
| | | import FileUpload from '@/components/FileUpload/index' |
| | | import { downloadGet as downloadHttp} from '@/utils/request' |
| | | import { downTemplate, importTemplate } from '@/api/system/company/company' |
| | | const { proxy } = getCurrentInstance(); |
| | | const dialogVisible = ref(false) |
| | | const form = reactive({ |
| | | exportNews: {} |
| | | }) |
| | | function openDialog() { |
| | | dialogVisible.value = true |
| | | } |
| | | |
| | | function cloaseDialog() { |
| | | dialogVisible.value = false |
| | | } |
| | | function downLoad() { |
| | | downTemplate().then(val => { |
| | | downloadHttp('/tool/file/download', { |
| | | fileName: val.msg, |
| | | delete: true |
| | | }, val.msg) |
| | | }) |
| | | } |
| | | function startExport() { |
| | | |
| | | } |
| | | defineExpose({ |
| | | openDialog, |
| | | cloaseDialog |
| | | }) |
| | | </script> |
| | | <style scoped> |
| | | .dialog-footer button:first-child { |
| | | margin-right: 10px; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <el-dialog title="导入记录" v-model="dialogVisible" width="1200px" append-to-body @close="closeDialog" |
| | | > |
| | | <el-table> |
| | | <el-table-column label="序号"></el-table-column> |
| | | <el-table-column label="导入文件"></el-table-column> |
| | | <el-table-column label="导入人"></el-table-column> |
| | | <el-table-column label="导入时间"></el-table-column> |
| | | <el-table-column label="进度"></el-table-column> |
| | | <el-table-column label="导入结果"></el-table-column> |
| | | <el-table-column label="导入结果文件"></el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { importTemplateRecord } from '@/api/system/company/company' |
| | | const dialogVisible = ref(false) |
| | | const closeDialog = () => { |
| | | dialogVisible.value = false |
| | | } |
| | | const openDialog = () => { |
| | | dialogVisible.value = true |
| | | } |
| | | function importTemplateRecord() { |
| | | console.log('获取导入记录') |
| | | } |
| | | defineExpose({ |
| | | openDialog, |
| | | closeDialog |
| | | }) |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="80px"> |
| | | <el-form-item label="企业名称" prop="companyName"> |
| | | <el-input v-model="queryParams.companyName" placeholder="请输入企业名称" clearable style="width: 200px" @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="企业编号" prop="companyCode"> |
| | | <el-input v-model="queryParams.companyCode" placeholder="请输入企业编号" clearable style="width: 200px" @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="企业类型" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="企业类型" clearable style="width: 200px"> |
| | | <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="联系人" prop="companyUser"> |
| | | <el-input v-model="queryParams.companyUser" placeholder="请输入联系人" clearable style="width: 200px" @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="手机号" prop="companyPhone"> |
| | | <el-input v-model="queryParams.companyPhone" type="number" placeholder="请输入手机号" clearable style="width: 200px" @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="审核" prop="checkStatus"> |
| | | <el-select v-model="queryParams.checkStatus" placeholder="审核类型" clearable style="width: 200px"> |
| | | <el-option v-for="dict in options.checkOptions" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="companyStatus"> |
| | | <el-select v-model="queryParams.companyStatus" placeholder="状态" clearable style="width: 200px"> |
| | | <el-option v-for="dict in options.companyStatus" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['system:dept:add']">新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="exportExcel" v-hasPermi="['system:dept:add']">导入</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="exportRecordComOpen" v-hasPermi="['system:dept:add']">导入记录</el-button> |
| | | </el-col> |
| | | <!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> --> |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-if="refreshTable" |
| | | v-loading="loading" |
| | | :data="deptList" |
| | | row-key="deptId" |
| | | :default-expand-all="isExpandAll" |
| | | :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" |
| | | > |
| | | <el-table-column prop="companyName" label="企业名称" minWidth="300"></el-table-column> |
| | | <el-table-column prop="companyName" label="企业类型" width="200"></el-table-column> |
| | | <el-table-column prop="companyUser" label="联系人" width="180"></el-table-column> |
| | | <el-table-column prop="companyPhone" label="手机号码" width="120"></el-table-column> |
| | | <el-table-column prop="createTime" label="创建时间" width="200"></el-table-column> |
| | | <el-table-column prop="" label="来源" width="100"> |
| | | <template #default="scope"> |
| | | {{ scopeList[scope.row.isImport] }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="checkStatus" label="审核" width="100"> |
| | | <template #default="scope"> |
| | | {{ judgeStatus[scope.row.checkStatus] }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="companyStatus" label="状态" width="100"> |
| | | <template #default="scope"> |
| | | <!-- {{ companyStatus[scope.row.companyStatus] }} --> |
| | | <el-switch v-if="scope.row.companyId" v-model="scope.row.companyStatus" @change="changeCompanyNews(scope.row, $event)" :active-value="1" :inactive-value="0"></el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width" width="240"> |
| | | <template #default="scope"> |
| | | <el-link type="primary">审核</el-link> |
| | | <el-divider direction="vertical" /> |
| | | <el-link type="primary">二维码</el-link> |
| | | <el-divider direction="vertical" /> |
| | | <el-link type="primary" @click="handleAdd(scope.row)">编辑</el-link> |
| | | <el-divider direction="vertical" /> |
| | | <el-link type="primary">删除</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination v-show="queryParams.total > 0" :total="queryParams.total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | |
| | | <!-- 添加或修改对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="600px" append-to-body> |
| | | <el-form ref="deptRef" :model="form" :rules="rules" label-width="140px"> |
| | | <el-form-item label="企业名称" prop="companyName"> |
| | | <el-input placeholder="请输入企业名称" v-model="form.companyName"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="联系人" prop="companyUser"> |
| | | <el-input placeholder="请输入联系人" v-model="form.companyUser"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="手机号码" prop="companyPhone"> |
| | | <el-input placeholder="请输入手机号码" v-model="form.companyPhone"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="统一社会信用代码" prop="companyCode"> |
| | | <el-input placeholder="请输入统一社会信用代码" v-model="form.companyCode"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="营业执照" prop="companyImg"> |
| | | <!-- <el-input placeholder="请输入营业执照" v-model="form.companyImg"></el-input> --> |
| | | <FileUpload :limit="1" :fileType="['png', 'jpg', 'jpeg']" v-model="form.companyImg"></FileUpload> |
| | | </el-form-item> |
| | | <el-form-item label="企业地址" prop="companyAddress"> |
| | | <el-input placeholder="请输入企业地址" v-model="form.companyAddress"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="状态"> |
| | | <el-switch v-model="form.companyStatus" :active-value="1" :inactive-value="0"></el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input placeholder="请输入备注" v-model="form.remark"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <exportExcelCom ref="exporttem"></exportExcelCom> |
| | | <exportRecord ref="exportRecordCom"></exportRecord> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Dept"> |
| | | import FileUpload from '@/components/FileUpload/index' |
| | | import exportRecord from './components/exportRecord' |
| | | import { listCompany,addCompany, updateCompany } from "@/api/system/company/company"; |
| | | import exportExcelCom from './components/export' |
| | | import { computed } from "vue"; |
| | | import { judgeStatus, companyStatus, scopeList } from '@/utils/mapList/index.ts' |
| | | import useSettingsStore from "@/store/modules/settings"; |
| | | const thcolor = computed(() => useSettingsStore().theme); |
| | | const { proxy } = getCurrentInstance(); |
| | | const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); |
| | | const deptList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const title = ref(""); |
| | | const deptOptions = ref([]); |
| | | const isExpandAll = ref(false); |
| | | const refreshTable = ref(true); |
| | | const exporttem = ref() |
| | | const exportRecordCom = ref() |
| | | const options = reactive({ |
| | | // -1拒绝,0待审批,1审批中,2通过 |
| | | checkOptions: [ |
| | | { |
| | | label: '拒绝', |
| | | value: -1 |
| | | }, |
| | | { |
| | | label: '待审批', |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: '审批中', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: '通过', |
| | | value: 2 |
| | | } |
| | | ], |
| | | companyStatus: [ |
| | | { |
| | | label: '正常', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: 0 |
| | | }, |
| | | ], |
| | | socreList: [ |
| | | { |
| | | label: '导入', |
| | | value: 1 |
| | | }, |
| | | { |
| | | label: '注册', |
| | | value: 0 |
| | | }, |
| | | ] |
| | | }) |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | deptName: undefined, |
| | | status: undefined, |
| | | deptType: undefined, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | total: 1 |
| | | }, |
| | | rules: { |
| | | companyName: [{ required: true, message: "企业名称不能为空", trigger: "blur" }], |
| | | companyUser: [{ required: true, message: "联系人不能为空", trigger: "blur" }], |
| | | companyPhone: [{ required: true, message: "手机号码不能为空", trigger: "blur" }, { |
| | | pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" |
| | | }], |
| | | companyCode: [{ required: true, message: "统一社会信用代码不能为空", trigger: "blur" }], |
| | | companyImg: [{ required: true, message: "营业执照不能为空", trigger: "blur" }], |
| | | companyAddress: [{ required: true, message: "企业地址不能为空", trigger: "blur" }], |
| | | |
| | | // email: [{ type: "email", message: "请输入正确的邮箱地址", trigger: ["blur", "change"] }], |
| | | // phone: [{ pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: "请输入正确的手机号码", trigger: "blur" }], |
| | | }, |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | // const dispDeptType = computed(() => (e) => { |
| | | // return dept_type.value.find((f) => f.value == e).label; |
| | | // }); |
| | | |
| | | /** 查询企业列表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listCompany(queryParams.value).then((response) => { |
| | | deptList.value = response.rows |
| | | data.queryParams.total = response.total |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | /** 取消按钮 */ |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | /** 表单重置 */ |
| | | function reset() { |
| | | form.value = { |
| | | deptId: undefined, |
| | | parentId: undefined, |
| | | deptName: undefined, |
| | | orderNum: 0, |
| | | leader: undefined, |
| | | phone: undefined, |
| | | email: undefined, |
| | | status: "0", |
| | | deptType: undefined, |
| | | }; |
| | | proxy.resetForm("deptRef"); |
| | | } |
| | | const queryRef = ref() |
| | | /** 搜索按钮操作 */ |
| | | function handleQuery() { |
| | | getList(); |
| | | } |
| | | /** 重置按钮操作 */ |
| | | function resetQuery() { |
| | | queryRef.value.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | /** 新增按钮操作 */ |
| | | function handleAdd(row) { |
| | | if(row) { |
| | | form.value = row |
| | | title.value = "编辑企业"; |
| | | } else { |
| | | form.value = {} |
| | | title.value = "添加企业"; |
| | | } |
| | | open.value = true; |
| | | } |
| | | |
| | | /** 提交按钮 */ |
| | | function submitForm() { |
| | | proxy.$refs["deptRef"].validate((valid) => { |
| | | if (valid) { |
| | | if (form.value.companyId != undefined) { |
| | | updateCompany(form.value).then((response) => { |
| | | proxy.$modal.msgSuccess("修改成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else { |
| | | addCompany(form.value).then((response) => { |
| | | proxy.$modal.msgSuccess("新增成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | /** 删除按钮操作 */ |
| | | function handleDelete(row) { |
| | | proxy.$modal |
| | | .confirm('是否确认删除名称为"' + row.deptName + '"的数据项?') |
| | | .then(function () { |
| | | return delDept(row.deptId); |
| | | }) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | // 修改企业信息 |
| | | function changeCompanyNews(row, event) { |
| | | if(loading.value){ |
| | | return |
| | | } |
| | | updateCompany(row).then(val => { |
| | | proxy.$modal.msgSuccess("修改成功"); |
| | | getList(); |
| | | }) |
| | | } |
| | | // 导入模板 |
| | | function exportExcel() { |
| | | exporttem.value.openDialog() |
| | | } |
| | | // 导入记录 |
| | | function exportRecordComOpen() { |
| | | exportRecordCom.value.openDialog() |
| | | } |
| | | getList(); |
| | | </script> |
New file |
| | |
| | | <!-- 新增政策 --> |
| | | <template> |
| | | <el-dialog title="用户导入" v-model="dialogVisible" width="600px" append-to-body @close="closeDialog"> |
| | | <el-form> |
| | | <el-form-item> |
| | | <el-select> |
| | | <el-option></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <div>内容</div> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="docStatus"> |
| | | <el-switch v-model="form.docStatus"></el-switch> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | form: { |
| | | |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | closeDialog() { |
| | | this.dialogVisible = false |
| | | }, |
| | | openDialog() { |
| | | this.dialogVisible = true |
| | | } |
| | | } |
| | | } |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :inline="true" label-width="100px" :model="form"> |
| | | <el-form-item label="政策名称"> |
| | | <el-input placeholder="请输入" ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="政策类型"> |
| | | <el-select placeholder="请选择" style="width: 200px;"> |
| | | <el-option v-for="item in policyList" :label="item.label" :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="状态"> |
| | | <el-select placeholder="请选择" style="width: 200px;"> |
| | | <el-option v-for="item in statusList" :label="item.label" :value="item.value"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleSearch">搜索</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['system:dept:add']">新增</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table :data="deptList"> |
| | | <el-table-column label="政策名称"></el-table-column> |
| | | <el-table-column label="政策类型"></el-table-column> |
| | | <el-table-column label="创建时间"></el-table-column> |
| | | <el-table-column label="创建人" width="200"></el-table-column> |
| | | <el-table-column label="状态" width="200"></el-table-column> |
| | | <el-table-column label="操作"></el-table-column> |
| | | </el-table> |
| | | <pagination v-show="queryParams.total > 0" :total="queryParams.total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" /> |
| | | <addNews ref="addnews"></addNews> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { docList } from '@/api/system/company/company' |
| | | import addNews from './components/addNews' |
| | | export default { |
| | | components: { |
| | | addNews |
| | | }, |
| | | data() { |
| | | return { |
| | | policyList: [ |
| | | { |
| | | label: '惠企政策', |
| | | value: 1 |
| | | } |
| | | ], |
| | | statusList: [ |
| | | { |
| | | label: '正常', |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: '禁用', |
| | | value: 1 |
| | | }, |
| | | ], |
| | | queryParams: { |
| | | total: 0, |
| | | pageNum: 1, |
| | | pageSize: 10 |
| | | }, |
| | | tableData: [] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getList() |
| | | }, |
| | | methods: { |
| | | // 获取列表 |
| | | getList() { |
| | | docList(this.queryParams).then(res => { |
| | | this.tableData = res.rows |
| | | this.queryParams.total = res.total |
| | | }) |
| | | }, |
| | | // 搜索 |
| | | handleSearch() { |
| | | this.queryParams.pageNum = 1 |
| | | this.getList() |
| | | }, |
| | | handleAdd() { |
| | | this.$refs.addnews.openDialog() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | userStore
|
| | | .login(loginForm.value)
|
| | | .then(() => {
|
| | | router.push({ path: redirect.value || "/" });
|
| | | router.push({ path: redirect.value || "/home" });
|
| | | })
|
| | | .catch(() => {
|
| | | loading.value = false;
|
| | |
| | | <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange">
|
| | | <el-table-column type="selection" width="55" align="center" />
|
| | | <el-table-column label="字典编号" align="center" prop="dictId" />
|
| | | <el-table-column label="是否自定义" align="center" prop="isSystem" >
|
| | | <template v-slot:default="scope">
|
| | | {{ data.dicMap[scope.row.isSystem] }}
|
| | | </template>
|
| | | </el-table-column>
|
| | | <el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/>
|
| | | <el-table-column label="字典类型" align="center" :show-overflow-tooltip="true">
|
| | | <template #default="scope">
|
| | |
| | | </el-form-item>
|
| | | <el-form-item label="字典类型" prop="dictType">
|
| | | <el-input v-model="form.dictType" placeholder="请输入字典类型" />
|
| | | </el-form-item>
|
| | | <el-form-item label="自定义" prop="dictType">
|
| | | <el-switch v-model="form.isSystem" :active-value="1" :inactive-value="0"></el-switch>
|
| | | </el-form-item>
|
| | | <el-form-item label="状态" prop="status">
|
| | | <el-radio-group v-model="form.status">
|
| | |
| | | dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }],
|
| | | dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }]
|
| | | },
|
| | | // 字典枚举
|
| | | dicMap: {
|
| | | 1: '是',
|
| | | 2:'否'
|
| | | },
|
| | | isSystem: {
|
| | | isSystem: 1
|
| | | }
|
| | | });
|
| | |
|
| | | const { queryParams, form, rules } = toRefs(data);
|
| | | const { queryParams, form, rules, isSystem } = toRefs(data);
|
| | |
|
| | | /** 查询字典类型列表 */
|
| | | function getList() {
|
| | | loading.value = true;
|
| | | listType(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
|
| | | listType({...proxy.addDateRange(queryParams.value, dateRange.value), isSystem: 1}).then(response => {
|
| | | typeList.value = response.rows;
|
| | | total.value = response.total;
|
| | | loading.value = false;
|
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch"> |
| | | <el-form-item label="字典名称" prop="dictType"> |
| | | <el-select v-model="queryParams.dictType" style="width: 200px"> |
| | | <el-option |
| | | v-for="item in typeOptions" |
| | | :key="item.dictId" |
| | | :label="item.dictName" |
| | | :value="item.dictType" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="字典标签" prop="dictLabel"> |
| | | <el-input |
| | | v-model="queryParams.dictLabel" |
| | | placeholder="请输入字典标签" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="数据状态" clearable style="width: 200px"> |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:dict:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:dict:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:dict:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:dict:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Close" |
| | | @click="handleClose" |
| | | >关闭</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="字典编码" align="center" prop="dictCode" /> |
| | | <el-table-column label="字典标签" align="center" prop="dictLabel"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.listClass == '' || scope.row.listClass == 'default'">{{ scope.row.dictLabel }}</span> |
| | | <el-tag v-else :type="scope.row.listClass == 'primary' ? '' : scope.row.listClass">{{ scope.row.dictLabel }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="字典键值" align="center" prop="dictValue" /> |
| | | <el-table-column label="字典排序" align="center" prop="dictSort" /> |
| | | <el-table-column label="状态" align="center" prop="status"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- 添加或修改参数配置对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| | | <el-form ref="dataRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="字典类型"> |
| | | <el-input v-model="form.dictType" :disabled="true" /> |
| | | </el-form-item> |
| | | <el-form-item label="数据标签" prop="dictLabel"> |
| | | <el-input v-model="form.dictLabel" placeholder="请输入数据标签" /> |
| | | </el-form-item> |
| | | <el-form-item label="数据键值" prop="dictValue"> |
| | | <el-input v-model="form.dictValue" placeholder="请输入数据键值" /> |
| | | </el-form-item> |
| | | <el-form-item label="样式属性" prop="cssClass"> |
| | | <el-input v-model="form.cssClass" placeholder="请输入样式属性" /> |
| | | </el-form-item> |
| | | <el-form-item label="显示排序" prop="dictSort"> |
| | | <el-input-number v-model="form.dictSort" controls-position="right" :min="0" /> |
| | | </el-form-item> |
| | | <el-form-item label="回显样式" prop="listClass"> |
| | | <el-select v-model="form.listClass"> |
| | | <el-option |
| | | v-for="item in listClassOptions" |
| | | :key="item.value" |
| | | :label="item.label + '(' + item.value + ')'" |
| | | :value="item.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{ dict.label }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Data"> |
| | | import useDictStore from '@/store/modules/dict' |
| | | import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type"; |
| | | import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); |
| | | |
| | | const dataList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const title = ref(""); |
| | | const defaultDictType = ref(""); |
| | | const typeOptions = ref([]); |
| | | const route = useRoute(); |
| | | // 数据标签回显样式 |
| | | const listClassOptions = ref([ |
| | | { value: "default", label: "默认" }, |
| | | { value: "primary", label: "主要" }, |
| | | { value: "success", label: "成功" }, |
| | | { value: "info", label: "信息" }, |
| | | { value: "warning", label: "警告" }, |
| | | { value: "danger", label: "危险" } |
| | | ]); |
| | | |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dictName: undefined, |
| | | dictType: undefined, |
| | | status: undefined |
| | | }, |
| | | rules: { |
| | | dictLabel: [{ required: true, message: "数据标签不能为空", trigger: "blur" }], |
| | | dictValue: [{ required: true, message: "数据键值不能为空", trigger: "blur" }], |
| | | dictSort: [{ required: true, message: "数据顺序不能为空", trigger: "blur" }] |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules } = toRefs(data); |
| | | |
| | | /** 查询字典类型详细 */ |
| | | function getTypes(dictId) { |
| | | getType(dictId).then(response => { |
| | | queryParams.value.dictType = response.data.dictType; |
| | | defaultDictType.value = response.data.dictType; |
| | | getList(); |
| | | }); |
| | | } |
| | | |
| | | /** 查询字典类型列表 */ |
| | | function getTypeList() { |
| | | getDictOptionselect().then(response => { |
| | | typeOptions.value = response.data; |
| | | }); |
| | | } |
| | | /** 查询字典数据列表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listData(queryParams.value).then(response => { |
| | | dataList.value = response.rows; |
| | | total.value = response.total; |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | /** 取消按钮 */ |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | /** 表单重置 */ |
| | | function reset() { |
| | | form.value = { |
| | | dictCode: undefined, |
| | | dictLabel: undefined, |
| | | dictValue: undefined, |
| | | cssClass: undefined, |
| | | listClass: "default", |
| | | dictSort: 0, |
| | | status: "0", |
| | | remark: undefined |
| | | }; |
| | | proxy.resetForm("dataRef"); |
| | | } |
| | | /** 搜索按钮操作 */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | /** 返回按钮操作 */ |
| | | function handleClose() { |
| | | const obj = { path: "/system/dict" }; |
| | | proxy.$tab.closeOpenPage(obj); |
| | | } |
| | | /** 重置按钮操作 */ |
| | | function resetQuery() { |
| | | proxy.resetForm("queryRef"); |
| | | queryParams.value.dictType = defaultDictType; |
| | | handleQuery(); |
| | | } |
| | | /** 新增按钮操作 */ |
| | | function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "添加字典数据"; |
| | | form.value.dictType = queryParams.value.dictType; |
| | | } |
| | | /** 多选框选中数据 */ |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map(item => item.dictCode); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | /** 修改按钮操作 */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const dictCode = row.dictCode || ids.value; |
| | | getData(dictCode).then(response => { |
| | | form.value = response.data; |
| | | open.value = true; |
| | | title.value = "修改字典数据"; |
| | | }); |
| | | } |
| | | /** 提交按钮 */ |
| | | function submitForm() { |
| | | proxy.$refs["dataRef"].validate(valid => { |
| | | if (valid) { |
| | | if (form.value.dictCode != undefined) { |
| | | updateData(form.value).then(response => { |
| | | useDictStore().removeDict(queryParams.value.dictType); |
| | | proxy.$modal.msgSuccess("修改成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else { |
| | | addData(form.value).then(response => { |
| | | useDictStore().removeDict(queryParams.value.dictType); |
| | | proxy.$modal.msgSuccess("新增成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | /** 删除按钮操作 */ |
| | | function handleDelete(row) { |
| | | const dictCodes = row.dictCode || ids.value; |
| | | proxy.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() { |
| | | return delData(dictCodes); |
| | | }).then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | useDictStore().removeDict(queryParams.value.dictType); |
| | | }).catch(() => {}); |
| | | } |
| | | /** 导出按钮操作 */ |
| | | function handleExport() { |
| | | proxy.download("system/dict/data/export", { |
| | | ...queryParams.value |
| | | }, `dict_data_${new Date().getTime()}.xlsx`); |
| | | } |
| | | |
| | | getTypes(route.params && route.params.dictId); |
| | | getTypeList(); |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="字典名称" prop="dictName"> |
| | | <el-input |
| | | v-model="queryParams.dictName" |
| | | placeholder="请输入字典名称" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="字典类型" prop="dictType"> |
| | | <el-input |
| | | v-model="queryParams.dictType" |
| | | placeholder="请输入字典类型" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select |
| | | v-model="queryParams.status" |
| | | placeholder="字典状态" |
| | | clearable |
| | | style="width: 240px" |
| | | > |
| | | <el-option |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="创建时间" style="width: 308px"> |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | value-format="YYYY-MM-DD" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:dict:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:dict:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:dict:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:dict:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Refresh" |
| | | @click="handleRefreshCache" |
| | | v-hasPermi="['system:dict:remove']" |
| | | >刷新缓存</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="typeList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="字典编号" align="center" prop="dictId" /> |
| | | <el-table-column label="字典名称" align="center" prop="dictName" :show-overflow-tooltip="true"/> |
| | | <el-table-column label="字典类型" align="center" :show-overflow-tooltip="true"> |
| | | <template #default="scope"> |
| | | <router-link :to="'/system/dict-data/index/' + scope.row.dictId" class="link-type"> |
| | | <span>{{ scope.row.dictType }}</span> |
| | | </router-link> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" align="center" prop="status"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| | | <template #default="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:dict:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:dict:remove']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | v-model:page="queryParams.pageNum" |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- 添加或修改参数配置对话框 --> |
| | | <el-dialog :title="title" v-model="open" width="500px" append-to-body> |
| | | <el-form ref="dictRef" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="字典名称" prop="dictName"> |
| | | <el-input v-model="form.dictName" placeholder="请输入字典名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="字典类型" prop="dictType"> |
| | | <el-input v-model="form.dictType" placeholder="请输入字典类型" /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio |
| | | v-for="dict in sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{ dict.label }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="cancel">取 消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup name="Dict"> |
| | | import useDictStore from '@/store/modules/dict' |
| | | import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); |
| | | |
| | | const typeList = ref([]); |
| | | const open = ref(false); |
| | | const loading = ref(true); |
| | | const showSearch = ref(true); |
| | | const ids = ref([]); |
| | | const single = ref(true); |
| | | const multiple = ref(true); |
| | | const total = ref(0); |
| | | const title = ref(""); |
| | | const dateRange = ref([]); |
| | | |
| | | const data = reactive({ |
| | | form: {}, |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | dictName: undefined, |
| | | dictType: undefined, |
| | | status: undefined |
| | | }, |
| | | rules: { |
| | | dictName: [{ required: true, message: "字典名称不能为空", trigger: "blur" }], |
| | | dictType: [{ required: true, message: "字典类型不能为空", trigger: "blur" }] |
| | | }, |
| | | isSystem: { |
| | | isSystem: 0 |
| | | } |
| | | }); |
| | | |
| | | const { queryParams, form, rules, isSystem } = toRefs(data); |
| | | |
| | | /** 查询字典类型列表 */ |
| | | function getList() { |
| | | loading.value = true; |
| | | listType({...proxy.addDateRange(queryParams.value, dateRange.value), isSystem: 0}).then(response => { |
| | | typeList.value = response.rows; |
| | | total.value = response.total; |
| | | loading.value = false; |
| | | }); |
| | | } |
| | | /** 取消按钮 */ |
| | | function cancel() { |
| | | open.value = false; |
| | | reset(); |
| | | } |
| | | /** 表单重置 */ |
| | | function reset() { |
| | | form.value = { |
| | | dictId: undefined, |
| | | dictName: undefined, |
| | | dictType: undefined, |
| | | status: "0", |
| | | remark: undefined |
| | | }; |
| | | proxy.resetForm("dictRef"); |
| | | } |
| | | /** 搜索按钮操作 */ |
| | | function handleQuery() { |
| | | queryParams.value.pageNum = 1; |
| | | getList(); |
| | | } |
| | | /** 重置按钮操作 */ |
| | | function resetQuery() { |
| | | dateRange.value = []; |
| | | proxy.resetForm("queryRef"); |
| | | handleQuery(); |
| | | } |
| | | /** 新增按钮操作 */ |
| | | function handleAdd() { |
| | | reset(); |
| | | open.value = true; |
| | | title.value = "添加字典类型"; |
| | | } |
| | | /** 多选框选中数据 */ |
| | | function handleSelectionChange(selection) { |
| | | ids.value = selection.map(item => item.dictId); |
| | | single.value = selection.length != 1; |
| | | multiple.value = !selection.length; |
| | | } |
| | | /** 修改按钮操作 */ |
| | | function handleUpdate(row) { |
| | | reset(); |
| | | const dictId = row.dictId || ids.value; |
| | | getType(dictId).then(response => { |
| | | form.value = response.data; |
| | | open.value = true; |
| | | title.value = "修改字典类型"; |
| | | }); |
| | | } |
| | | /** 提交按钮 */ |
| | | function submitForm() { |
| | | proxy.$refs["dictRef"].validate(valid => { |
| | | if (valid) { |
| | | if (form.value.dictId != undefined) { |
| | | updateType(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("修改成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } else { |
| | | addType(form.value).then(response => { |
| | | proxy.$modal.msgSuccess("新增成功"); |
| | | open.value = false; |
| | | getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | /** 删除按钮操作 */ |
| | | function handleDelete(row) { |
| | | const dictIds = row.dictId || ids.value; |
| | | proxy.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() { |
| | | return delType(dictIds); |
| | | }).then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | } |
| | | /** 导出按钮操作 */ |
| | | function handleExport() { |
| | | proxy.download("system/dict/type/export", { |
| | | ...queryParams.value |
| | | }, `dict_${new Date().getTime()}.xlsx`); |
| | | } |
| | | /** 刷新缓存按钮操作 */ |
| | | function handleRefreshCache() { |
| | | refreshCache().then(() => { |
| | | proxy.$modal.msgSuccess("刷新成功"); |
| | | useDictStore().cleanDict(); |
| | | }); |
| | | } |
| | | |
| | | getList(); |
| | | </script> |