123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508 |
- import routerService from '@/common/services/router-service'
- import asyncComponent from '@/common/services/async-component'
- import flowService from '@/webflow/flow-service'
- import formService from '@/webform/form-service'
- import SdTable from '@/common/components/sd-table.vue'
- import routerReady from '@/common/router-ready'
- import axios from '@/common/services/axios-instance'
- import todoListService from '@/todo/todo-list-service'
- import { message } from '@/common/one-ui'
- // 隐藏系统内关联文件页签
- routerReady((router) => {
- router.beforeEach((to, from, next) => {
- // 如果是从自查离开,则去掉隐藏按钮样式样式
- if (from.fullPath.includes('cpm-check-self') || from.fullPath.includes('cpm-check-plan')) {
- const div = document.querySelector('.button_author_div')
- const parentDiv = div?.parentElement
- parentDiv?.removeChild(div)
- }
- import('@/application-manage/sd-task-list.vue').then(({ default: sdTaskList }) => {
- // @ts-ignore
- sdTaskList.methods.openTask = (record) => {
- if (record.instId === null) {
- message.warning('请先分配联系人', 3)
- return
- }
- if (!record.openLink) {
- record.openLink = '/api/framework/v1/task-form-process/done-pages'
- }
- todoListService.openTaskItem(record)
- }
- })
- // 首页或登录页不重定向,防止重复跳转
- if (to.path === '/' || to.path === '/sd-login') {
- next()
- return false
- }
- // 隐藏系统内关联文件页签
- import('@/webflow/sd-webflow.vue').then((sdWebflow) => {
- // @ts-ignore
- sdWebflow.default.props.removedTabs = {
- type: Array,
- default: () => ['sdRelatedDoc'],
- }
- })
- next()
- })
- })
- // @ts-ignore
- const oldColumnsComputed = SdTable.computed.columnsComputed
- // @ts-ignore
- SdTable.computed.columnsComputed = function () {
- const obj = oldColumnsComputed
- .bind(this)()
- .find((i) => i.title === '序号')
- if (
- obj ||
- this.$route?.path === '/risk-criteria-form' ||
- (this.$route?.path.indexOf('/sd-task-list') === -1 &&
- this.$route?.path.indexOf('/sd-business-list') === -1 &&
- this.$route?.path.indexOf('/cpm-project') === -1 &&
- this.$route?.path.indexOf('/law-dispute-search') === -1)
- ) {
- return [...oldColumnsComputed.bind(this)()]
- } else {
- const returnColumns = [...oldColumnsComputed.bind(this)()]
- if (returnColumns[0].scopedSlots?.customRender === 'id') {
- returnColumns.splice(1, 0, {
- dataIndex: 'xmindex',
- title: '序号',
- // @ts-ignore
- customRender: (text, record, index) => `${index + 1}`,
- width: '65px',
- show: true,
- })
- return returnColumns
- }
- return [
- {
- dataIndex: 'xmindex',
- title: '序号',
- // @ts-ignore
- customRender: (text, record, index) => `${index + 1}`,
- width: '65px',
- show: true,
- },
- ...oldColumnsComputed.bind(this)(),
- ]
- }
- }
- // 整改检查方案
- flowService.addFlowForm(
- 'onl:5d82a6c0eb3949fb9994156e4eeac6e1',
- './project/check-plan/cpm-check-plan-form.vue'
- )
- // 整改检查通知
- flowService.addFlowForm(
- 'onl:395bd21f5bd74dae9d9451cfa24d9a05',
- './project/check-notice/cpm-check-notice-form.vue'
- )
- // 问题整改反馈
- flowService.addFlowForm(
- 'onl:a5222825c6594c24b9a0b5c302edbfa2',
- './improve/feedback/cpm-improve-feedback-form.vue'
- )
- // 合规举报
- flowService.addFlowForm(
- 'onl:19a222eb058041af8a4a866d34078496',
- './accusation/cpm-accusation-form.vue'
- )
- // 问题确认单明细
- routerService.routeInFrame('cpm-confirm-detail', {
- component: './project/confirm/cpm-confirm-detail-form.vue',
- })
- // 问题整改清单录入
- routerService.routeInFrame('cpm-improve-rect', {
- component: './improve/rectProblem/cpm-improve-rect-problem-form.vue',
- })
- // 问题确认单
- flowService.addFlowForm(
- 'onl:fd31f3fb56224b7aa368d33ab4ea6519',
- './project/confirm/cpm-confirm-form.vue'
- )
- // 问题整改要求
- flowService.addFlowForm(
- 'onl:7db756cfc7544a2bb5b12b2f310bac08',
- './improve/require/audit-cpm-improve-require-form.vue'
- )
- // 合规项目
- routerService.routeInFrame('cpm-project-list', {
- component: './project/cpm-project-list.vue',
- })
- // 合规检查立项
- flowService.addFlowForm('onl:8d8b353ab83b461a9f2b3a8e04894f71', './project/cpm-project-check.vue')
- // 整改提醒
- routerService.routeInFrame('cpm-remind-config', {
- component: './improve/remind/cpm-improve-remind-config.vue',
- })
- // 工作底稿
- flowService.addFlowForm(
- 'onl:4d40a24f7eae43bba231b025ebf44f95',
- './project/work-paper/cpm-work-paper-form.vue'
- )
- // 内控-测试
- routerService.route('/cpm-project/', {
- component: './project/cpm-project.vue',
- children: [
- {
- path: 'cpm-check-plan',
- components: {
- rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
- },
- props: (route) => ({
- customValues: route.query.customValues,
- formListId: route.query.formListId,
- moduleId: route.query.moduleId,
- projectId: route.query.projectId,
- groupId: route.query.groupId,
- }),
- // @ts-ignore
- beforeEnter: (to, from, next) => {
- const mainIni = setInterval(() => {
- const mainDiv = document.querySelector('.header_cpm-project_product')
- if (mainDiv) {
- const div = document.createElement('div')
- div.className = 'button_author_div'
- div.style.display = 'none'
- const style = document.createElement('style')
- style.innerHTML = `.header_sd-data-table_common {
- display:none
- }`
- div.appendChild(style)
- mainDiv.appendChild(div)
- let projectId = to.query.groupId
- if (projectId.toString() === '1') {
- projectId = to.query.projectId
- }
- axios({
- method: 'get',
- url: `api/xcoa-mobile/v1/cpm-project-member/isProjectLeader?projectId=${projectId}`,
- }).then((res) => {
- // 如果不是组长,则隐藏新建按钮
- if (!res.data) {
- const btnIni = setInterval(() => {
- if (document.querySelectorAll('.header_sd-data-table_common button').length > 0) {
- style.innerHTML = `.header_sd-data-table_common .ant-btn-primary{
- display:none
- }`
- clearInterval(btnIni)
- }
- })
- } else {
- style.innerHTML = ''
- }
- })
- clearInterval(mainIni)
- }
- }, 100)
- next()
- },
- },
- {
- path: 'cpm-check-notice',
- components: {
- rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
- },
- props: (route) => ({
- customValues: route.query.customValues,
- formListId: route.query.formListId,
- moduleId: route.query.moduleId,
- projectId: route.query.projectId,
- groupId: route.query.groupId,
- }),
- // @ts-ignore
- beforeEnter: (to, from, next) => {
- const mainIni = setInterval(() => {
- const mainDiv = document.querySelector('.header_cpm-project_product')
- if (mainDiv) {
- const div = document.createElement('div')
- div.className = 'button_author_div'
- div.style.display = 'none'
- const style = document.createElement('style')
- style.innerHTML = `.header_sd-data-table_common {
- display:none
- }`
- div.appendChild(style)
- mainDiv.appendChild(div)
- let projectId = to.query.groupId
- if (projectId.toString() === '1') {
- projectId = to.query.projectId
- }
- axios({
- method: 'get',
- url: `api/xcoa-mobile/v1/cpm-project-member/isProjectLeader?projectId=${projectId}`,
- }).then((res) => {
- // 如果不是组长,则隐藏新建按钮
- if (!res.data) {
- const btnIni = setInterval(() => {
- if (document.querySelectorAll('.header_sd-data-table_common button').length > 0) {
- style.innerHTML = `.header_sd-data-table_common .ant-btn-primary{
- display:none
- }`
- clearInterval(btnIni)
- }
- })
- } else {
- style.innerHTML = ''
- }
- })
- clearInterval(mainIni)
- }
- }, 100)
- next()
- },
- },
- {
- path: 'cpm-check-self',
- components: {
- rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
- },
- props: (route) => ({
- customValues: route.query.customValues,
- formListId: route.query.formListId,
- moduleId: route.query.moduleId,
- projectId: route.query.projectId,
- groupId: route.query.groupId,
- }),
- // @ts-ignore
- beforeEnter: (to, from, next) => {
- const mainIni = setInterval(() => {
- const mainDiv = document.querySelector('.header_cpm-project_product')
- if (mainDiv) {
- const div = document.createElement('div')
- div.className = 'button_author_div'
- div.style.display = 'none'
- const style = document.createElement('style')
- style.innerHTML = `.header_sd-data-table_common {
- display:none
- }`
- div.appendChild(style)
- mainDiv.appendChild(div)
- let projectId = to.query.groupId
- if (projectId.toString() === '1') {
- projectId = to.query.projectId
- }
- axios({
- method: 'get',
- url: `api/xcoa-mobile/v1/cpm-project-member/isProjectLeader?projectId=${projectId}`,
- }).then((res) => {
- // 如果是组长,则去掉隐藏按钮的样式
- if (res.data) {
- const btnIni = setInterval(() => {
- if (document.querySelectorAll('.header_sd-data-table_common button').length > 0) {
- style.innerHTML = `.header_sd-data-table_common .ant-btn-primary{
- display:none
- }
- .header_sd-data-table_common button[disabled='disabled']{
- display:none
- }`
- document
- .querySelectorAll('.header_sd-data-table_common button')
- .forEach((item) => {
- if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
- item.setAttribute('style', 'display:none')
- }
- })
- clearInterval(btnIni)
- }
- })
- } else {
- const btnIni = setInterval(() => {
- if (document.querySelectorAll('.header_sd-data-table_common button').length > 0) {
- style.innerHTML = `.header_sd-data-table_common button{
- display:none
- }
- .header_sd-data-table_common button[disabled='disabled']{
- display:none
- }`
- document
- .querySelectorAll('.header_sd-data-table_common button')
- .forEach((item) => {
- if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
- item.setAttribute('style', 'display:none')
- }
- })
- clearInterval(btnIni)
- }
- })
- }
- })
- clearInterval(mainIni)
- }
- }, 100)
- next()
- },
- },
- {
- path: 'cpm-work-papre',
- components: {
- rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
- },
- props: (route) => ({
- customValues: route.query.customValues,
- formListId: route.query.formListId,
- moduleId: route.query.moduleId,
- projectId: route.query.projectId,
- groupId: route.query.groupId,
- }),
- beforeEnter: (to, from, next) => {
- const mainIni = setInterval(() => {
- const mainDiv = document.querySelector('.header_cpm-project_product')
- if (mainDiv) {
- const div = mainDiv.getElementsByClassName('button_author_div')
- if (div && div.length > 0) {
- for (var s = 0; s < div.length; s++) {
- document
- .querySelector('.header_cpm-project_product')
- .getElementsByClassName('button_author_div')
- [s]?.remove()
- }
- }
- document.querySelectorAll('.header_sd-data-table_common button').forEach((item) => {
- if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
- item.setAttribute('style', '')
- }
- })
- clearInterval(mainIni)
- }
- }, 100)
- next()
- },
- },
- {
- path: 'cpm-work-report',
- components: {
- rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
- },
- props: (route) => ({
- customValues: route.query.customValues,
- formListId: route.query.formListId,
- moduleId: route.query.moduleId,
- projectId: route.query.projectId,
- groupId: route.query.groupId,
- }),
- beforeEnter: (to, from, next) => {
- const mainIni = setInterval(() => {
- const mainDiv = document.querySelector('.header_cpm-project_product')
- if (mainDiv) {
- const div = mainDiv.getElementsByClassName('button_author_div')
- if (div && div.length > 0) {
- for (var s = 0; s < div.length; s++) {
- document
- .querySelector('.header_cpm-project_product')
- .getElementsByClassName('button_author_div')
- [s]?.remove()
- }
- }
- document.querySelectorAll('.header_sd-data-table_common button').forEach((item) => {
- if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
- item.setAttribute('style', '')
- }
- })
- clearInterval(mainIni)
- }
- }, 100)
- next()
- },
- },
- {
- path: 'cpm-confirm-list',
- components: {
- rightfrm: asyncComponent(() => import('./project/confirm/cpm-confirm-list.vue')),
- },
- props: (route) => ({
- customValues: route.query.customValues,
- formListId: route.query.formListId,
- moduleId: route.query.moduleId,
- projectId: route.query.projectId,
- groupId: route.query.groupId,
- }),
- beforeEnter: (to, from, next) => {
- const mainIni = setInterval(() => {
- const mainDiv = document.querySelector('.header_cpm-project_product')
- if (mainDiv) {
- const div = mainDiv.getElementsByClassName('button_author_div')
- if (div && div.length > 0) {
- for (var s = 0; s < div.length; s++) {
- document
- .querySelector('.header_cpm-project_product')
- .getElementsByClassName('button_author_div')
- [s]?.remove()
- }
- }
- document.querySelectorAll('.header_sd-data-table_common button').forEach((item) => {
- if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
- item.setAttribute('style', '')
- }
- })
- clearInterval(mainIni)
- }
- }, 100)
- next()
- },
- },
- {
- path: 'cpm-check-user',
- component: asyncComponent(() => import('./project/user/audit-cpm-project-user.vue')),
- props: (route) => ({
- pageId: route.query.pageId,
- projectId: route.query.projectId,
- }),
- },
- {
- path: 'cpm-check-group',
- component: asyncComponent(() => import('./project/group/audit-cpm-project-group.vue')),
- props: (route) => ({
- pageId: route.query.pageId,
- projectId: route.query.projectId,
- }),
- },
- ],
- })
- // 制度审查
- flowService.addFlowForm('onl:a68deaea1d024a439ff0ffecd1068830', './check/cpm-rule-check.vue')
- // 合同审查
- flowService.addFlowForm('onl:cfa055669fbe4afbafaefebdc4fdad70', './check/cpm-contract-check.vue')
- // 重大决策审查
- flowService.addFlowForm(
- 'onl:930ec02130ab4d8798e23ffa32216e05',
- './policycheck/cpm-policy-check.vue'
- )
- // 合规检查报告
- flowService.addFlowForm(
- 'onl:e1e85d865d984f0383f238a5e0d11ab6',
- './project/report/cpm-project-report-form.vue'
- )
- // 领导专题学习
- routerService.routeInFrame('cpm-leader-study', {
- component: './cultural/cpm-leader-study-form.vue',
- })
- // 委员会专题纪要
- routerService.routeInFrame('cpm-committee', {
- component: './cultural/cpm-committee-form.vue',
- })
- // 合规培训
- flowService.addFlowForm('onl:fdb6b6b593ba432b8e5932da76c0910d', './cultural/cpm-train-form.vue')
- // 宣传管理
- flowService.addFlowForm('onl:d531f98f303444a58e892e46b86c4ed9', './cultural/cpm-billboard-form.vue')
|