diff --git a/src/api/company.ts b/src/api/company.ts index 74fbeaa..a3c7786 100644 --- a/src/api/company.ts +++ b/src/api/company.ts @@ -1,39 +1,42 @@ -import request from "@/utils/request"; +import request from '@/utils/request' // 公司列表 export function apiCompanyLists(params: any) { - return request.get({ url: "/company/lists", params }); + return request.get({ url: '/company/lists', params }) } // 添加公司 export function apiCompanyAdd(params: any) { - return request.post({ url: "/company/add", params }); + return request.post({ url: '/company/add', params }) } // 编辑公司 export function apiCompanyEdit(params: any) { - return request.post({ url: "/company/edit", params }); + return request.post({ url: '/company/edit', params }) } // 删除公司 export function apiCompanyDelete(params: any) { - return request.post({ url: "/company/delete", params }); + return request.post({ url: '/company/delete', params }) } // 公司详情 export function apiCompanyDetail(params: any) { - return request.get({ url: "/company/detail", params }); + return request.get({ url: '/company/detail', params }) } // 下属公司详情 export function apiSubordinateList(params: any) { - return request.get({ url: "/company/subordinate", params }); + return request.get({ url: '/company/subordinate', params }) +} +export function sendMsgApi(params: any) { + return request.get({ url: '/company/postsms', params }) } // 生成合同 export function generateGontract(params: any) { - return request.get({ url: "/company/Draftingcontracts", params }); + return request.get({ url: '/company/Draftingcontracts', params }) } // 发送短信 -export function sendMsgApi(params: any) { - return request.get({ url: "/company/postsms", params }); +export function authentication(params: any) { + return request.get({ url: '/company/authentication', params }) } diff --git a/src/api/examined.ts b/src/api/examined.ts new file mode 100644 index 0000000..3a63493 --- /dev/null +++ b/src/api/examined.ts @@ -0,0 +1,30 @@ +import request from "@/utils/request"; +//审批类型列表 +export function apiCateLists(params: any) { + return request.get({ url: "/cate/index", params }); +} +//审批流程列表 +export function apiFlowLists(params: any) { + return request.get({ url: "/flow/index", params }); +} +//创建审批类型 +export function apiCateCreat(params: any) { + return request.post({ url: "/cate/create", params }); +} +// 创建流程 +export function apiFlowCreat(params: any) { + return request.post({ url: "/flow/create", params }); +} + +// 启用审批类型 +export function apiCateStatus(params: any) { + return request.get({ url: "/cate/status", params }); +} +// 启用审批流程 +export function apiFlowStatus(params: any) { + return request.get({ url: "/flow/status", params }); +} +// 审批流程详情 +export function apiFlowDetil(params: any) { + return request.get({ url: "/flow/view", params }); +} diff --git a/src/hooks/usePaging.ts b/src/hooks/usePaging.ts index 4d83312..a42ed87 100644 --- a/src/hooks/usePaging.ts +++ b/src/hooks/usePaging.ts @@ -1,64 +1,71 @@ -import { reactive, toRaw } from 'vue' +import { reactive, toRaw } from "vue"; // 分页钩子函数 interface Options { - page?: number - size?: number - fetchFun: (_arg: any) => Promise - params?: Record - firstLoading?: boolean + page?: number; + size?: number; + fetchFun: (_arg: any) => Promise; + params?: Record; + firstLoading?: boolean; } export function usePaging(options: Options) { - const { page = 1, size = 15, fetchFun, params = {}, firstLoading = false } = options - // 记录分页初始参数 - const paramsInit: Record = Object.assign({}, toRaw(params)) - // 分页数据 - const pager = reactive({ - page, - size, - loading: firstLoading, - count: 0, - lists: [] as any[], - extend: {} as Record + const { + page = 1, + size = 15, + fetchFun, + params = {}, + firstLoading = false, + } = options; + // 记录分页初始参数 + const paramsInit: Record = Object.assign({}, toRaw(params)); + // 分页数据 + const pager = reactive({ + page, + size, + loading: firstLoading, + count: 0, + lists: [] as any[], + extend: {} as Record, + }); + // 请求分页接口 + const getLists = () => { + pager.loading = true; + return fetchFun({ + page_no: pager.page, + page_size: pager.size, + ...params, }) - // 请求分页接口 - const getLists = () => { - pager.loading = true - return fetchFun({ - page_no: pager.page, - page_size: pager.size, - ...params - }) - .then((res: any) => { - pager.count = res?.count - pager.lists = res?.lists - pager.extend = res?.extend - return Promise.resolve(res) - }) - .catch((err: any) => { - return Promise.reject(err) - }) - .finally(() => { - pager.loading = false - }) - } - // 重置为第一页 - const resetPage = () => { - pager.page = 1 - getLists() - } - // 重置参数 - const resetParams = () => { - Object.keys(paramsInit).forEach((item) => { - params[item] = paramsInit[item] - }) - getLists() - } - return { - pager, - getLists, - resetParams, - resetPage - } + .then((res: any) => { + pager.count = res?.count; + res.lists ? (pager.lists = res.lists) : (pager.lists = res.data); + // pager.lists = res?.lists + pager.extend = res?.extend; + return Promise.resolve(res); + }) + .catch((err: any) => { + return Promise.reject(err); + }) + .finally(() => { + pager.loading = false; + }); + }; + // 重置为第一页 + const resetPage = () => { + pager.page = 1; + getLists(); + }; + // 重置参数 + const resetParams = () => { + Object.keys(paramsInit).forEach((item) => { + params[item] = paramsInit[item]; + }); + getLists(); + }; + return { + pager, + getLists, + resetParams, + resetPage, + }; } diff --git a/src/router/routes.ts b/src/router/routes.ts index ed48fa0..86bafe6 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -13,73 +13,81 @@ } */ -import type { RouteRecordRaw } from 'vue-router' -import { PageEnum } from '@/enums/pageEnum' -import Layout from '@/layout/default/index.vue' +import type { RouteRecordRaw } from "vue-router"; +import { PageEnum } from "@/enums/pageEnum"; +import Layout from "@/layout/default/index.vue"; -export const LAYOUT = () => Promise.resolve(Layout) +export const LAYOUT = () => Promise.resolve(Layout); -export const INDEX_ROUTE_NAME = Symbol() +export const INDEX_ROUTE_NAME = Symbol(); export const constantRoutes: Array = [ - { - path: '/:pathMatch(.*)*', - component: () => import('@/views/error/404.vue') - }, - { - path: PageEnum.ERROR_403, - component: () => import('@/views/error/403.vue') - }, - { - path: PageEnum.LOGIN, - component: () => import('@/views/account/login.vue') - }, - { - path: '/user', - component: LAYOUT, - children: [ - { - path: 'setting', - component: () => import('@/views/user/setting.vue'), - name: Symbol(), - meta: { - title: '个人设置' - } - } - ] - } - // { - // path: '/dev_tools', - // component: LAYOUT, - // children: [ - // { - // path: 'code/edit', - // component: () => import('@/views/dev_tools/code/edit.vue'), - // meta: { - // title: '编辑数据表', - // activeMenu: '/dev_tools/code' - // } - // } - // ] - // }, - // { - // path: '/setting', - // component: LAYOUT, - // children: [ - // { - // path: 'dict/data', - // component: () => import('@/views/setting/dict/data/index.vue'), - // meta: { - // title: '数据管理', - // activeMenu: '/setting/dict' - // } - // } - // ] - // } -] + { + path: "/:pathMatch(.*)*", + component: () => import("@/views/error/404.vue"), + }, + { + path: PageEnum.ERROR_403, + component: () => import("@/views/error/403.vue"), + }, + { + path: PageEnum.LOGIN, + component: () => import("@/views/account/login.vue"), + }, + { + path: "/user", + component: LAYOUT, + children: [ + { + path: "setting", + component: () => import("@/views/user/setting.vue"), + name: Symbol(), + meta: { + title: "个人设置", + }, + }, + { + path: "examined", + component: () => import("@/views/examined/examinedFlow.vue"), + name: Symbol(), + meta: { + title: "个人设置", + }, + }, + ], + }, + // { + // path: '/dev_tools', + // component: LAYOUT, + // children: [ + // { + // path: 'code/edit', + // component: () => import('@/views/dev_tools/code/edit.vue'), + // meta: { + // title: '编辑数据表', + // activeMenu: '/dev_tools/code' + // } + // } + // ] + // }, + // { + // path: '/setting', + // component: LAYOUT, + // children: [ + // { + // path: 'dict/data', + // component: () => import('@/views/setting/dict/data/index.vue'), + // meta: { + // title: '数据管理', + // activeMenu: '/setting/dict' + // } + // } + // ] + // } +]; export const INDEX_ROUTE: RouteRecordRaw = { - path: PageEnum.INDEX, - component: LAYOUT, - name: INDEX_ROUTE_NAME -} + path: PageEnum.INDEX, + component: LAYOUT, + name: INDEX_ROUTE_NAME, +}; diff --git a/src/views/company/dialog_index.vue b/src/views/company/dialog_index.vue index ed316d7..9af4cf7 100644 --- a/src/views/company/dialog_index.vue +++ b/src/views/company/dialog_index.vue @@ -27,14 +27,12 @@
- + - -
diff --git a/src/views/company/edit.vue b/src/views/company/edit.vue index ccf118f..eed27f4 100644 --- a/src/views/company/edit.vue +++ b/src/views/company/edit.vue @@ -1,884 +1,817 @@ diff --git a/src/views/company/index.vue b/src/views/company/index.vue index 224108f..eedd2d9 100644 --- a/src/views/company/index.vue +++ b/src/views/company/index.vue @@ -83,15 +83,20 @@
- + - - + + + @@ -194,13 +209,20 @@ diff --git a/src/views/company/subordinate.vue b/src/views/company/subordinate.vue index 77a03f2..756e3f9 100644 --- a/src/views/company/subordinate.vue +++ b/src/views/company/subordinate.vue @@ -4,14 +4,23 @@
- + - - + + - - + + + + diff --git a/src/views/examined/editCate.vue b/src/views/examined/editCate.vue new file mode 100644 index 0000000..1d7e990 --- /dev/null +++ b/src/views/examined/editCate.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/views/examined/editFlow.vue b/src/views/examined/editFlow.vue new file mode 100644 index 0000000..500357a --- /dev/null +++ b/src/views/examined/editFlow.vue @@ -0,0 +1,373 @@ + + + diff --git a/src/views/examined/examinedCate.vue b/src/views/examined/examinedCate.vue new file mode 100644 index 0000000..8412b59 --- /dev/null +++ b/src/views/examined/examinedCate.vue @@ -0,0 +1,149 @@ + + + diff --git a/src/views/examined/examinedFlow.vue b/src/views/examined/examinedFlow.vue new file mode 100644 index 0000000..38e51dd --- /dev/null +++ b/src/views/examined/examinedFlow.vue @@ -0,0 +1,228 @@ + + + diff --git a/src/views/permission/admin/edit.vue b/src/views/permission/admin/edit.vue index 7f142e1..96e8207 100644 --- a/src/views/permission/admin/edit.vue +++ b/src/views/permission/admin/edit.vue @@ -166,14 +166,14 @@ - - + - - - - - - - - - - + @@ -354,8 +331,7 @@
- -