e047444d by lihua

企业认证,连接器代码迁移

1 parent e622f04e
......@@ -100,7 +100,7 @@ VITE_APP_DATA_DELIVERY = https://daop-jgjf-test.zgsjzc.com/
#数据服务接口地址
VITE_APP_SERVICE_BASEURL = ms-daop-trust-api-service
#数字合约接口
#数字合约接口,身份认证有关的服务
VITE_APP_DIGITAL_CONTRACT_URL = ms-daop-trust-data-space-service
# 本地访问地址
......
......@@ -37,6 +37,7 @@
"html2canvas": "^1.4.1",
"html2pdf.js": "^0.12.1",
"insert-css": "^2.0.0",
"ip-regex": "^5.0.0",
"jquery": "^3.7.1",
"jsencrypt": "^3.3.2",
"lodash-es": "^4.17.21",
......
......@@ -71,6 +71,9 @@ dependencies:
insert-css:
specifier: ^2.0.0
version: 2.0.0
ip-regex:
specifier: ^5.0.0
version: 5.0.0
jquery:
specifier: ^3.7.1
version: 3.7.1
......@@ -6056,6 +6059,11 @@ packages:
resolution: {integrity: sha512-pZ2xT+LOHckCatGQ3DcG/a+QuEqvoxqkiL7tvE8nn3uuu+f6i1TtpB5/FtWFbxUuVr5PZCx8KskuGatbJDXOWA==}
dev: true
/ip-regex@5.0.0:
resolution: {integrity: sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: false
/is-absolute@1.0.0:
resolution: {integrity: sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==}
engines: {node: '>=0.10.0'}
......
......@@ -588,3 +588,29 @@ export const getDictionaryTree = (params) => request({
method: 'post',
params
})
/** -------------------- 数据产品目录分类----------- */
export const addDictClass = (params) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dict/save-class`,
method: 'post',
data: params
})
export const getDictClass = (params) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dict/get-type-page-list`,
method: 'post',
data: params
})
export const removeDict = (guids) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dict/del`,
method: 'delete',
data: guids
});
export const getDictData = (params) => request({
url: `${import.meta.env.VITE_API_NEW_PORTAL}/dict/get-tree`,
method: 'post',
data: params
})
\ No newline at end of file
......
import request from "@/utils/request";
// 最后一级节点审批通过
export const contractApprove = (params, serviceTenantGuid:any = null) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/data-contract/submit-flow${serviceTenantGuid?`?serviceTenantGuid=${serviceTenantGuid}`:''}`,
method: 'post',
data: params
})
/** 企业认证 **/
// 企业认证分页
export const getEnterpriseList = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/enterprise/page-list`,
method: 'post',
data: params
})
// 企业认证详情
export const getEnterpriseDetail = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/enterprise/detail`,
method: 'get',
params
})
// 企业认证新增
export const enterpriseSave = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/enterprise/save`,
method: 'post',
data: params
})
// 企业认证修改
export const enterpriseUpdate = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/enterprise/update`,
method: 'put',
data: params
})
// 企业认证删除
export const enterpriseDelete = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/enterprise/delete`,
method: 'delete',
data: params
})
// 企业认证变更删除
export const enterpriseChangeDelete = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/enterprise/change/delete`,
method: 'delete',
data: params
})
// 企业认证最后一级审批
export const enterpriseApprove = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/enterprise/last-approve`,
method: 'post',
data: params
})
// 企业认证进度列表
export const getTaskGressList = (params) => request({
url: `${import.meta.env.VITE_APP_PERSONAL_URL}/pending-task/page-list`,
method: 'post',
data: params
})
// 企业认证重新发起
export const getTaskRestart = (params) => request({
url: `${import.meta.env.VITE_APP_PERSONAL_URL}/pending-task/restart`,
method: 'get',
params
})
// 企业认证执行日志
export const getTaskExecutionLog = (params) => request({
url: `${import.meta.env.VITE_APP_PERSONAL_URL}/pending-task/task-info`,
method: 'get',
params
})
// 获取企业认证流程列表
export const getFlowEnterpriseList = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/enterprise/flow/page-list`,
method: 'post',
data: params
})
// 获取企业信息
export const getUserTenant = () => request({
// url: `http://localhost:9000/master/ms-daop-personel-service/tenant/get-current-user-tenant-from-cache`,
url: `http://192.168.6.20:18052/master/ms-daop-personel-service/tenant/get-current-user-tenant-from-cache`,
method: 'get'
})
// 获取企业信息
export const getEnterpriseData = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/enterprise/detail-by-logonUser`,
method: 'get',
params
})
/** -------------------- 连接器管理 -------------------------- */
// 连接器分页
export const getConnectorList = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/tds-connector-identity/page-list`,
method: 'post',
data: params
})
/** 保存 */
export const saveConnector = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/tds-connector-identity/save`,
method: 'post',
data: params
})
/** 更新 */
export const updateConnector = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/tds-connector-identity/update`,
method: 'put',
data: params
})
/** 变更的重新提交 */
export const changeSaveConnector = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/tds-connector-identity/change-save`,
method: 'post',
data: params
})
/** 删除 */
export const deleteConnector = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/tds-connector-identity/delete`,
method: 'delete',
data: params
})
export const getConnectorDetail = (guid) => request({
url: `${import.meta.env.VITE_APP_CIRCULATION_PORTAL_URL}/tds-connector-identity/detail?guid=${guid}`,
method: 'get'
})
/** 判断当前用户企业是否已申请连接器 */
export const checkConnector = () => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/tds-connector-identity/check-connector `,
method: 'get'
})
/** 接入方式下拉列表 */
export const assessMethodList = [
{
label: "专线",
value: 1,
},
{
label: "互联网(固定公网IP)",
value: 2,
},
{
label: "互联网(无固定公网IP)",
value: 3,
},
{
label: "高速数据网",
value: 4,
},
{
label: "其他",
value: 5,
},
]
\ No newline at end of file
......@@ -345,3 +345,9 @@ export const checkSql = (params) => request({
method: 'post',
data:params
})
export const getUserSomeInfo = (params) => request({
url: `/ms-daop-user-service/user/data/get-some-info`,
method: 'post',
data: params
})
......
......@@ -83,3 +83,21 @@ export const isNeedApprove = (params) => request({
url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/func-flow-config/is-need-approve?funcCode=${params.funcCode}`,
method: 'get',
})
export const changeApproveSave = (params)=>request({
url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/changeApprove/save`,
method: 'post',
data: params
})
export const myLastNode = (params) => request({
url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/is-my-last-node`,
method: 'post',
data: params
})
// 获取最新变更信息
export const getLastChange = (params) => request({
url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/changeApprove/get-by-guid/${params}`,
method: 'get'
})
\ No newline at end of file
......
/** form表单检验规则钩子函数 */
import { FormItemRule } from 'element-plus'
import { cnIdCode, StringUtils } from '@/utils/validation'
import ipRegex from 'ip-regex';
export const useValidator = () => {
const required = (message?: string): FormItemRule => {
......@@ -187,6 +189,33 @@ export const useValidator = () => {
trigger: "blur",
};
}
const isUSCCCode = (message?: string): FormItemRule => {
return {
validator: (_, val, callback) => {
if (val && !StringUtils.checkUnifiedCreditCode(val).success) {
callback(new Error(message || StringUtils.checkUnifiedCreditCode(val).errorMessage || '统一社会信用代码格式不正确!'))
} else {
callback()
}
},
trigger: 'blur'
}
}
const idCode = (message?: string): FormItemRule => {
return {
validator: (_, val, callback) => {
if (val && !cnIdCode(val)) {
callback(new Error(message || '身份证格式不正确!'))
} else {
callback()
}
},
trigger: 'blur',
}
}
/** 验证输入的多个IP地址 */
const validateIPList = (): FormItemRule => {
return {
......@@ -303,6 +332,8 @@ export const useValidator = () => {
scrollToError,
checkExistName,
requiredFiles,
isUSCCCode,
idCode,
validateIPList,
validateDomainList
}
......
import type { RouteRecordRaw } from 'vue-router'
function Layout() {
return import('@/layouts/index.vue')
}
const routes: RouteRecordRaw[] = [
{
path: '/data-facilitator/authentication-management',
component: Layout,
meta: {
title: '认证管理',
icon: 'sidebar-videos',
},
children: [{
path: '',
name: 'authenticationManagement',
component: () => import('@/views/data_facilitator/authenticationManagement.vue'),
meta: {
title: '认证管理',
sidebar: false,
breadcrumb: false,
cache: true,
editPage: true
},
}]
},
{
path: '/data-facilitator/certification-audit',
component: Layout,
meta: {
title: '认证审核管理',
icon: 'sidebar-videos',
},
children: [
{
path: '',
name: 'certificationAudit',
component: () => import('@/views/data_facilitator/certificationAudit.vue'),
meta: {
title: '认证审核管理',
sidebar: false,
breadcrumb: false,
cache: true
},
},
{
path: 'certification-audit-detail',
name: 'certificationAuditDetail',
component: () => import('@/views/data_facilitator/certificationAuditDetail.vue'),
meta: {
title: '详情-',
sidebar: false,
breadcrumb: false,
cache: true,
},
beforeEnter: (to, from) => {
to.meta.title = `详情-${to.query.name}`;
}
}
]
},
{
path: '/data-connector/settle-management',
component: Layout,
meta: {
title: '连接器管理',
icon: 'sidebar-videos',
},
children: [{
path: '',
name: 'settleManagement',
component: () => import('@/views/data_facilitator/settleManagement.vue'),
meta: {
title: '',
sidebar: false,
breadcrumb: false,
cache: true,
editPage: true
},
}, {
path: 'settle-start',
name: 'settleStart',
component: () => import('@/views/data_facilitator/settleStart.vue'),
meta: {
title: '连接器入驻',
sidebar: false,
breadcrumb: false,
cache: true,
editPage: true,
reuse: true
},
beforeEnter: (to, from) => {
to.meta.title = !to.query.guid ? '连接器入驻' : (to.query.isChange == 'Y' ? `变更-${to.query.name}` : `编辑-${to.query.name}`);
to.meta.editPage = true;
}
}, {
path: 'settle-detail',
name: 'settleDetail',
component: () => import('@/views/data_facilitator/settleDetail.vue'),
meta: {
title: '详情-',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
to.meta.title = `详情-${to.query.name}`;
}
},]
},
]
export default routes
......@@ -4,6 +4,7 @@ import type { RouteRecordRaw } from 'vue-router'
import DataAssess from './modules/dataAsset';
import DataService from './modules/dataService';
import DataSmartContract from './modules/dataSmartContract';
import DataFacilitator from './modules/dataFacilitator';
import useSettingsStore from '@/store/modules/settings'
......@@ -93,6 +94,7 @@ const asyncRoutes: RouteRecordRaw[] = [
...DataAssess,
...DataService,
...DataSmartContract,
...DataFacilitator,
// ...DataAssetRegistry,
]
......
const useDataConnectorStore = defineStore(
'isRefresh',
() => {
const isRefresh = ref<boolean>(false)
function set(v: boolean) {
isRefresh.value = v;
}
return {
isRefresh,
set,
}
},
)
export default useDataConnectorStore
\ No newline at end of file
import moment from "moment";
const normalize = (id) => {
let re;
re = /\[-\/\s]/g;
id = id.toUpperCase().replace(re, "");
re = /\([A-Z0-9]\)$/;
if (re.test(id)) {
id = id.replace(/\[\(\)]/g, "");
}
return id;
};
const isDateValid = (idDate, minDate, maxDate) => {
let isFormatValid, parseDate;
if (minDate == null) {
minDate = "default";
}
if (maxDate == null) {
maxDate = "today";
}
if (minDate === "default" || minDate === "") {
minDate = "18991129";
}
isFormatValid = function (date) {
return typeof date === "string" && /^[0-9]{8}$/.test(date);
};
if (!isFormatValid(idDate)) {
return false;
}
if (!isFormatValid(minDate)) {
return false;
}
parseDate = function (input) {
let date,
day,
isDayValid,
isFutureDate,
isLeapYear,
isMonthValid,
maxDay,
month,
startIndex,
year;
startIndex = 0;
year = +input.substring(startIndex, (startIndex += 4));
month = input.substring(startIndex, (startIndex += 2));
day = +input.substring(startIndex, (startIndex += 2));
date = new Date(year, +month - 1, day);
maxDay =
"01,03,05,07,08,10,12".indexOf(month) >= 0
? 31
: "04,06,09,11".indexOf(month) >= 0
? 30
: ((isLeapYear =
(year % 4 === 0 && year % 100 !== 0) || year % 400 === 0),
isLeapYear ? 29 : 28);
isDayValid = day > 0 && day <= maxDay;
if (!isDayValid) {
return false;
}
isMonthValid = +month > 0 && +month <= 12;
if (!isMonthValid) {
return false;
}
isFutureDate = new Date() < date;
if (isFutureDate) {
return false;
}
return date;
};
idDate = parseDate(idDate);
if (idDate === false) {
return false;
}
minDate = parseDate(minDate);
if (minDate === false) {
return false;
}
maxDate =
maxDate === "today"
? new Date()
: typeof maxDate === "string"
? parseDate(maxDate)
: maxDate;
if (maxDate === false) {
return false;
}
return idDate >= minDate && idDate <= maxDate;
};
const getMaxDate = (yearsOld) => {
let now, year;
now = new Date();
year = now.getFullYear() - yearsOld;
return new Date(year, now.getMonth(), now.getDate());
};
/**
* 身份证校验函数
* @param id
* @returns
*/
export const cnIdCode = (id) => {
let isChecksumValid, isDateValidFn, isFormatValid, isLengthValid
isLengthValid = function (id) {
return id.length === 18
}
isFormatValid = function (id) {
return /^[0-9]{17}[0-9X]$/.test(id)
}
isDateValidFn = function () {
return isDateValid(id.substring(6, 14), '18860625',null)
}
isChecksumValid = function (id) {
let char, checkDigit, getWeight, i, identifier, index, len, remainder, weightedSum
identifier = id.slice(0, -1)
checkDigit = id.slice(-1) === 'X' ? 10 : +id.slice(-1)
getWeight = function (n) {
return Math.pow(2, n - 1) % 11
}
weightedSum = 0
index = id.length
for (i = 0, len = identifier.length; i < len; i++) {
char = identifier[i]
weightedSum += +char * getWeight(index)
index--
}
remainder = (12 - weightedSum % 11) % 11 - checkDigit
return remainder === 0
}
id = normalize(id)
return isLengthValid(id) && isFormatValid(id) && isDateValidFn() && isChecksumValid(id)
};
/**
* 校验工具类
*/
export class StringUtils {
constructor() {
}
/**
* 判断是空字符串?
* @param str
*/
static isBlank(str: string) {
return str === undefined || str === null || '' === str.trim();
}
/**
* 去空格
* @param str 处理字符串
* @return 结果字符串
*/
static trim(str: string) {
return str.replace('\n', '').replace(' ', '').trim();
}
/**
* 判断不是空字符串?
* @param str
*/
static isNotBlank(str: string) {
return !this.isBlank(str);
}
/**
* 判断是空?
* @param o
*/
static isEmpty(o) {
return o === null || o === 'null' || o === undefined || o === 'undefined' || o === '';
}
/**
* 判断不是空?
* @param o
*/
static isNotEmpty(o) {
return !this.isEmpty(o);
}
/**
* 校验身份证的
* @param code
*/
public static identityCodeValid(code): ProcessResult {
// 判断是否为空 长度是否合法
if (this.isBlank(code) || code.length !== 18) {
return new ProcessResult(false, '身份证长度不够');
}
code = this.trim(code);
// 身份证号格式错误
if (!code || !/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(code)) {
return new ProcessResult(false, '身份证不合法');
}
// 省份对应的省编码
const city = {
11: '北京', 12: '天津', 13: '河北', 14: '山西', 15: '内蒙古', 21: '辽宁', 22: '吉林', 23: '黑龙江', 31: '上海',
32: '江苏', 33: '浙江', 34: '安徽', 35: '福建', 36: '江西', 37: '山东', 41: '河南', 42: '湖北', 43: '湖南',
44: '广东', 45: '广西', 46: '海南', 50: '重庆', 51: '四川', 52: '贵州', 53: '云南', 54: '西藏', 61: '陕西',
62: '甘肃', 63: '青海', 64: '宁夏', 65: '新疆', 71: '台湾', 81: '香港', 82: '澳门', 91: '国外'
};
if (!city[code.substr(0, 2)]) {
// 地址编码错误
return new ProcessResult(false, '身份证前2为输入有误');
} else {
// 18位身份证需要验证最后一位校验位
code = code.split('');
// 身份证最后一位
const lastOneCode = code[17];
// 加权因子 ∑(ai×Wi)(mod 11)
const factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
// 校验位
const parity = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
let sum = 0;
let ai = 0;
let wi = 0;
// 取前17位,(每一位数字 * 每一位数字在加权因子数组的对应的数字) 之和
for (let i = 0; i < 17; i++) {
ai = code[i];
wi = factor[i];
sum += ai * wi;
}
// 算出来的和 mod 11 得到 最后一位,再把传进来的身份证的最后一位和算出来的最后一位对比
return new ProcessResult(parity[sum % 11] === lastOneCode, '身份证不合法');
}
}
/**
* 身份证自定义校验器
*/
public static idCardNoValidator() {
return (control): { [key: string]: any } | null => {
const processResult = this.identityCodeValid(control.value);
return processResult.isSuccess() ? null : {idCardError: {value: control.value, message: processResult.errorMessage}};
};
}
/**
* 统一社会信用代码自定义校验器
*/
public static isValidUSCC() {
return (control): { [key: string]: any } | null => {
const processResult = this.checkUnifiedCreditCode(control.value);
return processResult.isSuccess() ? null : {unifiedCreditCodeError: {value: control.value, message: processResult.errorMessage}};
};
}
/**
* 统一社会信用代码校验
* @param uniCode
*/
public static checkUnifiedCreditCode(uniCode: string): ProcessResult {
// 假如不是18位,错误
if (!uniCode || uniCode.length !== 18) {
return new ProcessResult(false, '统一社会信用代码长度不合法');
}
uniCode = this.trim(uniCode);
// 统一社会信用代码由18位阿拉伯数字或英文大写字母表示(不包括I,O,Z,S,V以防止和阿拉伯字母混淆)-->V:???关我毛事?
const upUniCode = uniCode.toUpperCase();
if (upUniCode.indexOf('I') !== -1 || upUniCode.indexOf('O') !== -1 || upUniCode.indexOf('Z') !== -1 || upUniCode.indexOf('S') !== -1 || upUniCode.indexOf('V') !== -1) {
return new ProcessResult(false, '统一社会信用代码不能含有(I,O,Z,S,V)');
}
// (组织机构代码)校验
const orgCheckCode = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z'
];
// 组织机构代码加权因子
const orgWeight = [3, 7, 9, 10, 5, 8, 4, 2];
const orgCode = uniCode.substring(8, 17);
let sumOrg = 0;
// 去前8位数 每一位数对应在orgWeight数组的下标 * 对应的加权因子 之和
for (let i = 0; i < 8; i++) {
const tmpAttr = orgCode[i] as any;
const tmpCode = orgCheckCode.indexOf(tmpAttr);
const tmpWeight = orgWeight[i];
sumOrg += (tmpCode * tmpWeight);
}
// 再用11 - 算出的合数 mod 11
const modOrg = 11 - sumOrg % 11;
// 再用算出来的数字转换成最后一位的数字 拿到最后一个字符
const modOrgLast = (modOrg === 10) ? 'X' : ((modOrg === 11) ? '0' : ('' + modOrg));
// 对比算出来的最后一位是否等于给我的组织机构代码的最后一位
if (modOrgLast !== orgCode[8]) {
return new ProcessResult(false, '统一社会信用代码中的组织机构代码不合法');
}
// 最后一位的校验 (A=10, B=11,以此类推)
const uniCheckCode = [
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q',
'R', 'T', 'U', 'W', 'X', 'Y'
];
// 统一社会信用代码加权因子
const uniCodeWeight = [1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28];
let sumUniCode = 0;
// 去前17位数 每一位数对应在uniCheckCode数组的下标 * 对应的加权因子 之和
for (let i = 0; i < 17; i++) {
const tmpAttr = uniCode[i] as any;
const tmpCode = uniCheckCode.indexOf(tmpAttr);
const tmpWeight = uniCodeWeight[i];
sumUniCode += (tmpCode * tmpWeight);
}
// 再用31 - 算出的合数 mod 31
const modOrgUni = 31 - sumUniCode % 31;
// 在uniCheckCode数组找出对应的字符就是最后一位
const modOrgUniLast = uniCheckCode[modOrgUni % 31];
// 对比算出来的最后一位是否等于给我的信用代码的最后一位
return new ProcessResult(modOrgUniLast + '' === uniCode[17] + '', '统一社会信用代码不合法');
}
/**
* 根据身份证号码获取生日年龄性别
*/
public static getIdCardInformation(idCardNo): IdCardInformation {
const processResult = this.identityCodeValid(idCardNo);
if (processResult.isFailure()) {
return new IdCardInformation(undefined, undefined, undefined);
}
// 区分二代身份证
const mark = idCardNo.length > 15;
// 获取身份证上的出生日期
const birthday = moment(idCardNo.substring(6, mark ? 14 : 11), 'YYYYMMDD').toDate();
// 算出年龄
const age = new Date().getFullYear() - birthday.getFullYear();
// 得出年龄
const gender = !(Number(idCardNo.charAt(mark ? 16 : 14)) % 2 === 0);
// 返回身份证信息
return new IdCardInformation(birthday, age, gender);
}
public static isValidBankCard(cardNumber):ProcessResult {
// 银行卡号长度检查,一般16-19位
if (!/^\d{16,19}$/.test(cardNumber)) {
return new ProcessResult(false, '银行卡号格式/长度不正确');
}
// Luhn算法校验
let sum = 0;
let shouldDouble = false;
for (let i = cardNumber.length - 1; i >= 0; i--) {
let digit = parseInt(cardNumber.charAt(i), 10);
if (shouldDouble) {
digit *= 2;
if (digit > 9) {
digit -= 9;
}
}
sum += digit;
shouldDouble = !shouldDouble;
}
return new ProcessResult(sum % 10 === 0, '银行卡号格式不正确');
}
}
/**
* 身份证信息
*/
class IdCardInformation {
/**
* 出生日期
*/
birthday: Date;
/**
* 年龄
*/
age: number;
/**
* 性别
*/
gender: boolean;
constructor(birthday: Date, age: number, gender: boolean) {
this.birthday = birthday;
this.age = age;
this.gender = gender;
}
}
/**
* 处理结果
*/
class ProcessResult {
/**
* 成功?
*/
success: boolean;
/**
* 错误信息
*/
errorMessage: string;
constructor(success: boolean, errorMessage: string) {
this.success = success;
this.errorMessage = errorMessage;
}
/**
* 是成功的?
*/
isSuccess() {
return this.success;
}
/**
* 是失败的?
*/
isFailure() {
return !this.success;
}
}
......@@ -6,8 +6,8 @@
<el-input class="tree_search_input" v-model="asidePage.searchKey" @change="asideSearch()"
:placeholder="asidePage.queryPlaceholder" :prefix-icon="SearchIcon" clearable />
<el-button class="tree_add" :icon="Plus" @click="loadAsideDialog">{{ asidePage.addButtonText }}</el-button>
<el-table ref="asideTable" style="height: calc(100% - 90px);" :data="asideTableData" highlight-current-row
:show-header="false" @row-click="searchDict">
<el-table v-loading="leftTableLoading" ref="asideTable" style="height: calc(100% - 90px);" :data="asideTableData"
highlight-current-row :show-header="false" @row-click="searchDict">
<el-table-column prop="dictTypeName">
<template #default="scope">
......@@ -42,9 +42,9 @@
<!-- 列表区域 start -->
<div class="main_wrap">
<div class="table_tool_wrap">
<TableTools :searchItems="searchItemList" :searchId="'user-manage-search'" @search="toSearch" />
<TableTools :searchItems="searchItemList" :searchId="'user-manage-search'" :init="false" @search="toSearch" />
<div class="tools_btns">
<el-button type="primary" @click="loadDialog" v-preReClick>添加规则</el-button>
<el-button type="primary" @click="loadDialog" v-preReClick>添加目录</el-button>
<el-button @click="batchDelete">批量删除</el-button>
</div>
</div>
......@@ -73,47 +73,39 @@ import { Plus, Edit, Delete, Search as SearchIcon } from "@element-plus/icons-vu
import TableTools from '@/components/Tools/table_tools.vue';
import { commonPageConfig } from "@/components/PageNav";
import { useValidator } from '@/hooks/useValidator';
import {
addDictClass,
getDictClass,
removeDict,
getDictData,
} from "@/api/modules/dataAsset";
const { required } = useValidator();
const { proxy } = getCurrentInstance() as any;
const leftTableLoading = ref(false)
const submitForm = async () => {
let res1 = await formItem1.value.submitForm()
console.log("submitForm111", res1);
if (res1) {
let resultForm1 = await formItem1.value.getData()
resultForm1.remarks = resultForm1.remarks || '';
let message = resultForm1.guid ? '修改成功' : '新增成功'
// dictApi.addDictionary(resultForm1).then(res => {
// if (res.data.code === proxy.$passCode) {
// proxy.$ElMessage({
// type: 'success',
// message: message
// })
// drawerInfo.value.visible = false;
// toSearch(params.value)
// }
// });
}
}
const asideSubmitForm = async () => {
let resultForm1 = asideDrawerRef.value?.getDrawerConRef('drawerFormRef')?.formInline
let message = resultForm1.guid ? '修改成功' : '新增成功'
// dictApi.addDictClass(resultForm1).then(res => {
// if (res.data.code === proxy.$passCode) {
// proxy.$ElMessage({
// type: 'success',
// message: message
// })
// asideDrawerInfo.value.visible = false;
// asidePage.value.curr = 1;
//asidePage.value.searchKey = '';
// asideSearch()
// }
// })
let message = asideDrawerInfo.value.type != 'add' ? '编辑成功' : '新增成功';
resultForm1.guid = asideDrawerInfo.value.type != 'add' ? currAsideRow.value.guid : '';
asideDrawerInfo.value.footer.btns[1].loading = true;
addDictClass(resultForm1).then((res: any) => {
asideDrawerInfo.value.footer.btns[1].loading = false;
if (res?.code === proxy.$passCode) {
proxy.$ElMessage({
type: 'success',
message: message
})
asideDrawerInfo.value.visible = false;
asidePage.value.curr = 1;
asidePage.value.searchKey = '';
asideSearch();
getAllAsideData();
} else {
proxy.$ElMessage.error(res?.msg);
}
})
}
const params = ref({})
......@@ -201,6 +193,7 @@ const loadAsideDialog = () => {
// 抽屉逻辑
asideDrawerInfo.value.header.title = '新增分类'
asideDrawerInfo.value.visible = true;
asideDrawerInfo.value.type = 'add';
classEditFormItems.value.forEach(item => {
item.default = '';
if (item.field == 'bizState') {
......@@ -223,35 +216,37 @@ const asideSearch = () => {
getAsideTableData(params)
};
const asideTable = ref();
// 获取左边表格
const getAsideTableData = (params: any) => {
// leftTableLoading.value = true;
// dictApi.getDictClass(params).then((res: any) => {
// leftTableLoading.value = false;
// if (res.code == proxy.$passCode) {
// let data = res.data || {};
// asideTableData.value = res.data.records ?? [];
// asidePage.value.limit = data.pageSize;
// asidePage.value.curr = data.pageIndex;
// // asidePage.value.totalPage = data.totalPages;
// asidePage.value.total = data.totalRows;
// if (asideTableData.value.length > 0) {
// let row = asideTableData.value[0]
// proxy.$refs['asideTable'].setCurrentRow(row);
// // 点击分类
// dictType.value = row.dicName
// classGuid.value = row.guid
// page.value.curr = 1;
// toSearch({})
// }
// } else {
// ElMessage({
// type: "info",
// message: res.data.msg,
// });
// }
// })
leftTableLoading.value = true;
getDictClass(params).then((res: any) => {
leftTableLoading.value = false;
if (res.code == proxy.$passCode) {
let data = res.data || {};
asideTableData.value = res.data.records ?? [];
asidePage.value.limit = data.pageSize;
asidePage.value.curr = data.pageIndex;
// asidePage.value.totalPage = data.totalPages;
asidePage.value.total = data.totalRows;
if (asideTableData.value.length > 0) {
let row = asideTableData.value[0]
asideTable.value?.setCurrentRow(row);
// 点击分类
dictType.value = row.dicName
classGuid.value = row.guid
page.value.curr = 1;
toSearch({})
}
} else {
ElMessage({
type: "error",
message: res.msg,
});
}
})
}
//左边列表点击
......@@ -263,28 +258,37 @@ const searchDict = (row?) => {
}
/** 当前正在编辑的分类 */
const currAsideRow: any = ref({});
const toAsideEdit = (data) => {
let row = data
currAsideRow.value = row;
asideDrawerInfo.value.header.title = '编辑分类'
asideDrawerInfo.value.visible = true;
asideDrawerInfo.value.type = 'edit';
row.dictTypeName = row.dicName;
classEditFormItems.value.forEach(item => {
item.default = row[item.field];
})
asideDrawerInfo.value.container.contents[0] = classEditFormInfo.value;
}
const toAsideDelete = (data) => { // 删除
let row = data
proxy.$openMessageBox("数据删除后不可恢复,确定是否删除?", () => {
// dictApi.removeDict([row.guid]).then(async (res) => {
// if (res.data.code === proxy.$passCode) {
// proxy.$ElMessage({
// type: 'success',
// message: '删除成功'
// })
// asidePage.value.curr = 1;
// asideSearch()
// }
// })
removeDict([row.guid]).then(async (res: any) => {
if (res?.code === proxy.$passCode) {
proxy.$ElMessage({
type: 'success',
message: '删除成功'
})
asidePage.value.curr = 1;
asideSearch();
getAllAsideData();
} else {
proxy.$ElMessage.error(res?.msg);
}
})
}, () => {
proxy.$ElMessage.info("已取消删除");
})
......@@ -314,7 +318,7 @@ const asideDrawerInfo: any = ref({
header: {
title: '添加分类',
},
type: '',
type: 'add',
container: {
contents: [classEditFormInfo.value],
},
......@@ -346,7 +350,7 @@ const searchItemList = ref([
field: 'dicName',
default: '',
maxlength: 50,
placeholder: '名称',
placeholder: '目录名称',
clearable: true,
visible: true
}, {
......@@ -355,7 +359,7 @@ const searchItemList = ref([
field: 'dicValue',
default: '',
maxlength: 50,
placeholder: '值',
placeholder: '目录值',
clearable: true,
visible: true
},
......@@ -438,7 +442,7 @@ const dictFormItems: any = ref([
{
field: "dicName",
label: "名称",
label: "目录名称",
type: 'input',
maxlength: 50,
placeholder: '请输入',
......@@ -449,7 +453,7 @@ const dictFormItems: any = ref([
},
{
field: "dicValue",
label: "值",
label: "目录值",
type: 'input',
maxlength: 50,
placeholder: '请输入',
......@@ -495,8 +499,8 @@ const dictFormItems: any = ref([
const dictFormRules = ref({
classGuid: [required('请选择分类')],
dicName: [required('请输入名称')],
dicValue: [required('请输入值')],
dicName: [required('请输入目录名称')],
dicValue: [required('请输入目录值')],
});
/** 新增分类的form */
......@@ -517,7 +521,7 @@ const drawerInfo: any = ref({
visible: false,
size: 600,
header: {
title: "新增/编辑规则",
title: "新增/编辑目录",
},
type: "",
container: {
......@@ -534,17 +538,18 @@ const drawerInfo: any = ref({
// 添加字典打开抽屉
const loadDialog = () => {
drawerInfo.value.header.title = '新增规则'
// dictApi.getDictTable({
// classGuid: row.classGuid
// }).then((res: any) => {
// if (res.code == proxy.$passCode) {
// classList.value = res?.data || [];
// dictFormItems.value[1].options = classList.value
// } else {
// proxy.$ElMessage.error(res.msg);
// }
// })
drawerInfo.value.header.title = '新增目录'
drawerInfo.value.type = 'add'
getDictData({
classGuid: classGuid.value
}).then((res: any) => {
if (res.code == proxy.$passCode) {
classList.value = res?.data || [];
dictFormItems.value[1].options = classList.value
} else {
proxy.$ElMessage.error(res.msg);
}
})
drawerInfo.value.visible = true;
let value = {
guid: '',
......@@ -559,7 +564,6 @@ const loadDialog = () => {
};
dictFormItems.value.forEach(item => {
item.default = value[item.field];
})
dictFormItemInfo.value.formInfo.items = dictFormItems.value;
drawerInfo.value.container.contents[0] = dictFormItemInfo.value;
......@@ -580,16 +584,18 @@ function batchDelete(param) {
return;
}
proxy.$openMessageBox("数据删除后不可恢复,确定是否删除?", () => {
// dictApi.removeDict(selectRowData.value).then(async (res) => {
// if (res.data.code === proxy.$passCode) {
// proxy.$ElMessage({
// type: 'success',
// message: '删除成功'
// })
// page.value.curr = 1;
// toSearch(params.value)
// }
// })
removeDict(selectRowData.value).then(async (res: any) => {
if (res?.code === proxy.$passCode) {
proxy.$ElMessage({
type: 'success',
message: '删除成功'
})
page.value.curr = 1;
toSearch(params.value)
} else {
proxy.$ElMessage.error(res.msg);
}
})
});
}
};
......@@ -623,41 +629,41 @@ const toSearch = (val: any, clear: boolean = false) => {
};
const getTableData = () => {
// tableInfo.value.loading = true;
// getPlanList({
tableInfo.value.loading = true;
getDictData({
// pageIndex: page.value.curr, pageSize: page.value.limit,
// dicName: page.value.dicName,
// dicValue: page.value.dicValue,
// classGuid: classGuid.value
// }).then((res: any) => {
// tableInfo.value.loading = false;
// if (res === undefined) {
// return;
// }
// if (res.code == proxy.$passCode) {
// const data = res.data || {}
// tableInfo.value.data = data.records || []
// tableInfo.value.page.limit = data.pageSize
// tableInfo.value.page.curr = data.pageIndex
// tableInfo.value.page.rows = data.totalRows
// } else {
// ElMessage.error(res.msg);
// }
// })
dicName: page.value.dicName,
dicValue: page.value.dicValue,
classGuid: classGuid.value
}).then((res: any) => {
tableInfo.value.loading = false;
if (res === undefined) {
return;
}
if (res.code == proxy.$passCode) {
const data = res.data || [];
tableInfo.value.data = data;
} else {
ElMessage.error(res.msg);
}
})
};
const tableInfo = ref({
id: 'rule-table',
loading: false,
rowKey: 'guid',
multiple: true,
treeProps: { children: 'childList', hasChildren: 'hasChildren' },
fields: [
{
label: "名称",
label: "目录名称",
field: "dicName",
fixed: 'left',
width: 140,
width: 180,
},
{
label: "值",
label: "目录值",
field: "dicValue",
width: 140,
},
......@@ -694,7 +700,7 @@ const tableInfo = ref({
},
],
data: [],
showPage: true,
showPage: false,
page: {
type: "normal",
rows: 0,
......@@ -708,12 +714,12 @@ const tableInfo = ref({
return [
{
label: "编辑", value: "edit", click: (scope) => {
toEdit(scope.row)
toEdit(scope)
}
},
{
label: "删除", value: "delete", click: (scope) => {
toDelete(scope.row)
toDelete(scope)
}
},
]
......@@ -721,9 +727,14 @@ const tableInfo = ref({
}
});
const currEditTableRow: any = ref({});
const toEdit = async (data) => {
let { row } = data
if (!row.classGuid) return
currEditTableRow.value = row;
classList.value = tableInfo.value.data || [];
dictFormItems.value[1].options = classList.value
// dictApi.getDictTable({
// classGuid: row.classGuid
// }).then((res: any) => {
......@@ -734,9 +745,12 @@ const toEdit = async (data) => {
// proxy.$ElMessage.error(res.msg);
// }
// })
drawerInfo.value.header.title = '编辑'
if (row.classGuid == row.parentGuid) {
row.parentGuid = '';
}
drawerInfo.value.header.title = '编辑目录'
drawerInfo.value.visible = true;
drawerInfo.value.type = 'edit';
dictFormItems.value.forEach(item => {
item.default = row[item.field];
})
......@@ -744,16 +758,18 @@ const toEdit = async (data) => {
const toDelete = (data) => { // 删除
let { row } = data
proxy.$openMessageBox("数据删除后不可恢复,确定是否删除?", () => {
// dictApi.removeDict([row.guid]).then(async (res) => {
// if (res.data.code === proxy.$passCode) {
// proxy.$ElMessage({
// type: 'success',
// message: '删除成功'
// })
// }
// page.value.curr = 1;
// toSearch(params.value)
// })
removeDict([row.guid]).then(async (res: any) => {
if (res?.code === proxy.$passCode) {
proxy.$ElMessage({
type: 'success',
message: '删除成功'
})
page.value.curr = 1;
toSearch(params.value)
} else {
proxy.$ElMessage.error(res.msg);
}
})
}, () => {
proxy.$ElMessage.info("已取消删除");
})
......@@ -769,18 +785,22 @@ const handleDrawSelectChange = (val, row, info) => {
classGuid: val,
};
// 获取上级字典下拉选项
// dictApi.getDictTable(params).then((res: any) => {
// if (res.data.code == proxy.$passCode) {
// const data = res.data.data;
// classList.value = data ?? [];
// dictFormItems.value[1].options = classList.value;
// } else {
// ElMessage({
// type: "info",
// message: res.msg,
// });
// }
// })
getDictData(params).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || [];
classList.value = data;
dictFormItems.value[1].options = classList.value;
info.parentGuid = '';
dictFormItems.value.forEach(d => {
d.default = info[d.field] || '';
})
} else {
ElMessage({
type: "error",
message: res.msg,
});
}
})
}
......@@ -790,7 +810,23 @@ const drawerBtnClick = (btn, info) => {
drawerInfo.value.visible = false;
} else {
if (btn.value == "save") {
submitForm()
let message = drawerInfo.value.type != 'add' ? '编辑成功' : '新增成功'
if (drawerInfo.value.type != 'add') {
info.guid = currEditTableRow.value.guid;
}
//TODO
// dictApi.addDictionary(resultForm1).then(res => {
// if (res.data.code === proxy.$passCode) {
// proxy.$ElMessage({
// type: 'success',
// message: message
// })
// drawerInfo.value.visible = false;
// toSearch(params.value)
// }
// });
} else {
drawerInfo.value.container.id = "add-dictionary-form";
drawerInfo.value.visible = false;
......@@ -798,6 +834,20 @@ const drawerBtnClick = (btn, info) => {
}
};
const getAllAsideData = () => {
getDictClass({ pageSize: -1 }).then((res: any) => {
if (res.code == proxy.$passCode) {
allClassData.value = res.data.records || [];
dictFormItems.value[0].options = allClassData.value;
} else {
ElMessage({
type: "error",
message: res.msg,
});
}
})
}
onMounted(() => {
});
......@@ -805,7 +855,7 @@ onMounted(() => {
onBeforeMount(() => {
asideSearch()
//TODO.需要查一个没有分页的作为下拉选择框。
getAllAsideData();
});
</script>
......@@ -894,6 +944,7 @@ onBeforeMount(() => {
.table_panel_wrap {
width: 100%;
height: calc(100% - 108px);
}
}
......
......@@ -430,8 +430,7 @@ const handleUploadClose = (itemGuid) => {
<div class="mid-content">
<div class="left">产品来源</div>
<!-- TODO,要改成连接器名称 -->
<div class="right">{{ item.foundMode ? (item.foundMode === 1 ? '自建' : (item.foundMode == 2 ? '加工交付' : (item.foundMode == 4 ? '江苏专区' : (item.foundMode == 5 ? '数据港' : '专区')))) : '--'
}}</div>
<div class="right">{{ item.foundModeName ? item.foundModeName : '自建' }}</div>
</div>
<div class="mid-content">
<div class="left">登记机构</div>
......
<route lang="yaml">
name: authenticationManagement //企业认证
</route>
<script lang="ts" setup name="authenticationManagement">
import { ref, onMounted } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { enterpriseSave, enterpriseUpdate, getEnterpriseData } from "@/api/modules/dataRequire";
import { getAreaData, getParamsList, getTenantDetailInfo, getUserSomeInfo } from "@/api/modules/queryService";
import { changeApproveSave, getCamundaDeploymentId } from "@/api/modules/workFlowService";
import { useValidator } from '@/hooks/useValidator';
import Moment from "moment";
import { CirclePlus } from "@element-plus/icons-vue";
import { scrollLastRowToView } from '@/utils/common';
import { onUploadFilePreview } from "@/api/modules/common";
const { proxy } = getCurrentInstance() as any;
const userData = JSON.parse(localStorage.userData);
const tenantData = JSON.parse(localStorage.tenantInfo);
const { staffName, staffNo } = userData;
const { required, isUSCCCode, idCode } = useValidator()
const loading = ref(false);
const flowDetail: any = ref({});
const getAreaDataPromise: any = ref({});
const getAreaDatas: any = ref({});
const setTenant = ref(false);
const typeMap: any = ref({});
const industryList: any = ref([]);
/**
* bizApproveState
* bizApproveStateNotList,排除状态数组,传值格式如:["N","C","D"]。
* N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃;B 变更中;
**/
const getArea = (node, resolve) => {
const { level } = node
let params = {
parentGuid: node.value
}
if (getAreaDatas.value[node.value]?.length) {
resolve(getAreaDatas.value[node.value]);
return;
}
if (!getAreaDataPromise.value[node.value]) {
getAreaDataPromise.value[node.value] = getAreaData(params).then((res: any) => {
getAreaDataPromise.value[node.value] = null;
node.loaded = true;
if (res?.code == proxy.$passCode) {
const data = res.data ?? []
data.map(item => {
item.leaf = level >= 2
})
resolve(data)
getAreaDatas.value[node.value] = data;
return res.data ?? [];
}
})
} else {
getAreaDataPromise.value[node.value].then((data) => {
getAreaDataPromise.value[node.value] = null;
node.loaded = true;
data.map(item => {
item.leaf = level >= 1
})
resolve(data)
})
}
}
const isEdit = ref(true);
const detailGuid = ref('');
const bizApproveState = ref('');
const crossPlatformApproveState = ref('');
const expand1 = ref(true)
const expand2 = ref(true)
const expand3 = ref(true)
const expand4 = ref(true)
const expand5 = ref(true)
const expand6 = ref(true)
const uploadInfoExpand = ref(true);
const expandResult = ref(true);
// 企业信息
const contentFormItems: any = ref([
{
label: '企业名称',
type: 'input',
placeholder: '请输入',
field: 'tenantName',
default: staffName,
maxlength: 50,
clearable: true,
required: true
},
{
label: '统一社会信用代码',
type: 'input',
placeholder: '请输入',
field: 'socialCreditCode',
default: '',
maxlength: 50,
clearable: true,
required: true
},
{
label: '机构类型',
type: 'select',
placeholder: '请选择',
field: 'tenantTypeVal',
default: '',
options: [],
clearable: true,
required: true,
},
{
label: '组织机构性质',
type: 'select',
placeholder: '请选择',
field: 'institutionType',
default: '',
options: [],
clearable: true,
filterable: true,
required: true,
},
{
label: '公司注册日期',
type: 'date',
placeholder: '请选择日期',
field: 'registrationDate',
default: "",
unlink: true,
clearable: true,
required: true,
},
{
label: '注册资本(万元)',
type: 'input',
inputType: 'moneyNumber',
field: 'registeredCapital',
placeholder: '请输入',
default: '',
maxlength: 18,
clearable: true,
required: true
},
{
label: '税号',
type: 'input',
placeholder: '请输入',
field: 'bankTaxNo',
default: '',
maxlength: 20,
clearable: true,
required: true,
},
{
label: '注册地',
type: 'cascader',
placeholder: '请选择',
field: 'area',
default: [],
props: {
label: 'name',
value: 'guid',
lazy: true,
lazyLoad: getArea,
},
clearable: true,
required: true,
},
{
label: '详细地址',
type: 'input',
placeholder: '请输入',
field: 'detailedAddress',
default: "",
maxlength: 250, // 后端是250
clearable: true,
required: true
},
{
label: '行业分类',
type: 'select',
placeholder: '请选择',
field: 'industry',
default: '',
options: industryList.value,
clearable: true,
filterable: true,
required: true,
},
{
label: '行业小类',
type: 'tree-select',
placeholder: '请选择',
field: 'industrySmallcode',
nodeKey: 'value',
options: industryList.value,
checkStrictly: false,//只能选择叶子节点。
lazy: false,
multiple: false,
props: {
label: "label",
value: "value",
children: 'childDictList'
},
filterable: true,
clearable: true,
default: '',
required: true,
},
{
label: '营业开始日期',
type: 'date',
placeholder: '请选择',
field: 'businessLicenseStartDate',
default: "",
unlink: true,
clearable: true,
required: true,
},
{
label: "营业结束日期",
type: "select",
placeholder: "请选择",
field: "businessLicenseTerm",
default: "2",
options: [
{
label: "长期有效",
value: "1",
},
{
label: "自定义",
value: "2",
},
],
required: true,
clearable: true,
style: {
width: '110px'
}
},
{
label: "营业结束日期",
type: 'date',
placeholder: '请选择',
field: "businessLicenseEndDate",
default: '',
labelClass: 'hide',
clearable: true,
required: true,
visible: false,
style: {
width: 'calc(33.33% - 124px)'
}
},
{
label: '营业执照',
type: 'upload-file',
field: 'businessLicenseFile',
default: [],
tip: '请上传最新营业执照原件的彩色照片或扫描件,如使用复印件请加盖公章,支持扩展名:.jpg .png, 最大5M',
accept: '.jpg, .png',
required: true,
block: true,
},
{
label: '公司简介及经营范围',
type: 'textarea',
focusValue: false,
placeholder: '请输入公司简介及经营描述',
field: 'businessLicenseScope',
default: '',
clearable: true,
required: true,
block: true,
maxlength: 1000
},
])
const contentFormRules = ref({
tenantName: [
{ required: true, trigger: 'blur', message: "请填写企业名称" }
],
socialCreditCode: [
required(),
isUSCCCode()
],
tenantTypeVal: [
{ required: true, trigger: 'change', message: "请选择机构类型" }
],
institutionType: [
{ required: true, trigger: 'change', message: "请选择组织机构性质" }
],
registrationDate: [
{ required: true, trigger: 'change', message: "请选择公司注册日期" }
],
registeredCapital: [
{ required: true, trigger: 'blur', message: "请填写注册资本(万元)" }
],
detailedAddress: [
{ required: true, trigger: 'blur', message: "请填写详细地址" }
],
bankTaxNo: [
{ required: true, trigger: 'blur', message: "请填写税号" }
],
area: [
{ required: true, trigger: 'change', message: "请选择注册地" }
],
industry: [
{ required: true, trigger: 'change', message: "请选择行业分类" }
],
industrySmallcode: [
{ required: true, trigger: 'change', message: "请选择行业小类" }
],
businessLicenseStartDate: [
{ required: true, trigger: 'change', message: "请选择营业开始日期" },
{
validator: (rule: any, value: any, callback: any) => {
if (!value) {
callback(new Error('请选择营业开始日期'))
return;
}
let businessLicenseEndDate = companyFormRef.value.formInline?.businessLicenseEndDate || '';
if (!businessLicenseEndDate) {
callback();
return;
}
let value1 = new Date(value);
// 将 today 设置为 00:00:00,只比较日期部分(本地时间)
const todayStart = new Date(
value1.getFullYear(),
value1.getMonth(),
value1.getDate()
);
// 将 date 也转换为本地日期的开始时间(避免 UTC 问题)
businessLicenseEndDate = new Date(businessLicenseEndDate);
const dateEnd = new Date(
businessLicenseEndDate.getFullYear(),
businessLicenseEndDate.getMonth(),
businessLicenseEndDate.getDate()
);
// 禁用 dateStart < todayStart 的日期(即今天之前)
if (dateEnd.getTime() < todayStart.getTime()) {
callback(new Error('营业开始日期不能晚于结束日期'))
} else {
callback();
}
}, trigger: 'change'
}
],
businessLicenseTerm: [
{ required: true, trigger: 'change', message: "请选择营业结束日期" }
],
businessLicenseEndDate: [
{ required: true, trigger: 'change', message: "请选择营业结束日期" },
{
validator: (rule: any, value: any, callback: any) => {
if (!value) {
callback(new Error('请选择营业结束日期'))
return;
}
let businessLicenseStartDate = companyFormRef.value.formInline?.businessLicenseStartDate || '';
if (!businessLicenseStartDate) {
callback();
return;
}
let value1 = new Date(value);
// 将 today 设置为 00:00:00,只比较日期部分(本地时间)
const todayStart = new Date(
value1.getFullYear(),
value1.getMonth(),
value1.getDate()
);
// 将 date 也转换为本地日期的开始时间(避免 UTC 问题)
businessLicenseStartDate = new Date(businessLicenseStartDate);
const dateStart = new Date(
businessLicenseStartDate.getFullYear(),
businessLicenseStartDate.getMonth(),
businessLicenseStartDate.getDate()
);
// 禁用 dateStart < todayStart 的日期(即今天之前)
if (dateStart.getTime() > todayStart.getTime()) {
callback(new Error('营业结束日期不能早于开始日期'))
} else {
callback();
}
}, trigger: 'change'
}
],
businessLicenseFile: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传营业执照'))
} else {
callback();
}
}, trigger: 'change'
}],
businessLicenseScope: [
{ required: true, trigger: 'blur', message: "请填写公司简介及经营范围" }
],
});
const companyFormRef = ref();
const companyForm = ref({
items: contentFormItems.value,
rules: contentFormRules.value,
})
// 法人信息
const corporateFormItems: any = ref([
{
label: '法定代表人姓名',
type: 'input',
placeholder: '请输入',
field: 'juridicalPerson',
default: '',
maxlength: 50,
clearable: true,
required: true,
},
{
label: '法定代表人证件类型',
type: 'select',
placeholder: '请选择',
field: 'juridicalPersonIdType',
default: '1',
options: [],
clearable: true,
required: true,
},
{
label: '法定代表人证件号',
type: 'input',
placeholder: '请输入',
field: 'juridicalPersonId',
default: '',
maxlength: 50,
clearable: true,
required: true,
},
{
label: '法定代表人证件正反面',
type: 'upload-file',
field: 'juridicalPersonIdPhoto',
default: [],
tip: '请上传最新法定代表人证件的彩色照片或扫描件,如使用复印件请加盖公章,支持扩展名:.jpg .png, 最大5M',
accept: '.jpg, .png',
required: true,
block: true,
},
])
const corporateFormRules = ref({
juridicalPerson: [
{ required: true, trigger: 'blur', message: "请填写法定代表人姓名" }
],
juridicalPersonIdType: [
{ required: true, trigger: 'change', message: "请选择法人证件类型" }
],
juridicalPersonId: [
{ required: true, trigger: 'blur', message: "请填写法定代表人证件号" }
],
juridicalPersonIdPhoto: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传法定代表人证件正反面'))
} else {
callback();
}
}, trigger: 'change'
}],
});
const corporateFormRef = ref();
const corporateForm = ref({
items: corporateFormItems.value,
rules: corporateFormRules.value,
})
// 账号信息
const accountFormItem = ref([
{
label: '账号',
type: 'input',
placeholder: '请输入',
field: 'logonUser',
default: userData.logonUser,
clearable: true,
required: true,
maxlength: 50,
disabled: true
},
{
label: '账号管理人姓名',
type: 'input',
placeholder: '请输入',
field: 'contacts',
default: '',
maxlength: 50,
clearable: true,
required: true,
},
{
label: '账号管理人手机号',
type: 'input',
placeholder: '请输入',
field: 'contactTel',
default: userData.mobileNo || '',
clearable: true,
maxlength: 50,
required: true,
},
{
label: '账号管理人证件类型',
type: 'select',
placeholder: '请选择',
field: 'handlePersonIdType',
default: '1',
options: [],
clearable: true,
required: true,
},
{
label: '账号管理人证件号',
type: 'input',
placeholder: '请输入',
field: 'managerPersonId',
default: '',
clearable: true,
maxlength: 50,
required: true,
},
{
label: '账号管理员证件正反面',
type: 'upload-file',
field: 'managerPersonIdPhoto',
default: [],
tip: '请上传最新管理员证件的彩色照片或扫描件,如使用复印件请加盖公章,支持扩展名:.jpg .png, 最大5M',
accept: '.jpg, .png',
required: true,
block: true,
},
]);
const accountFormRules = ref({
logonUser: [
{ required: true, trigger: 'blur', message: "请填写用户名" }
],
contacts: [
{ required: true, trigger: 'blur', message: "请填写账号管理人姓名" }
],
handlePersonIdType: [
{ required: true, trigger: 'blur', message: "请选择账号管理人证件类型" }
],
contactTel: [
{
validator: (rule: any, value: any, callback: any) => {
if (value === '') {
callback(new Error('请填写手机号'))
} else {
const regs = /^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(19[0-9]{1})|(18[0-9]{1}))+\d{8})$/
if (regs.test(value)) {
callback();
} else {
callback(new Error('请填写正确的手机号'))
}
}
},
trigger: 'blur'
},
{
min: 1,
max: 11,
message: '请填写账号管理人手机号',
trigger: 'change',
},
],
managerPersonId: [
{ required: true, trigger: 'blur', message: "账号管理人证件号" },
// required(),
// idCode()
// {
// validator: (rule: any, value: any, callback: any) => {
// if (value === '') {
// callback(new Error('请填写账号管理人证件号'))
// } else {
// const regs = /^(\d{15}$|^\d{18}(\d|X|x))$/
// if (regs.test(value)) {
// callback();
// } else {
// callback(new Error('请输入正确的15位或18位身份证号码'))
// }
// }
// },
// trigger: 'blur'
// },
{
min: 1,
max: 18,
message: '请填写账号管理人证件号',
trigger: 'change',
},
],
managerPersonIdPhoto: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传账号管理员证件正反面'))
} else {
if (value.length < 1) {
callback(new Error('请上传账号管理员证件正反面'))
} else {
callback();
}
}
}, trigger: 'change'
}],
});
const accountFormRef = ref();
const accountForm: any = ref({
items: accountFormItem.value,
rules: accountFormRules.value,
})
// 协议签署
const contractFormItem: any = ref([
{
label: '授权委托书',
type: 'upload-file',
field: 'authorizationLetterFile',
default: [],
tip: '支持扩展名:.pdf, 最大50M',
accept: '.pdf',
required: true,
block: true,
},
]);
const contractFormRules = ref({
authorizationLetterFile: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传授权委托书'))
} else {
callback();
}
}, trigger: 'change'
}],
});
const contractFormRef = ref();
const contractForm = ref({
items: contractFormItem.value,
rules: contractFormRules.value,
})
// 历史变更
const mergeRowCount: any = ref({});
// 历史信息
const rowCount = {
name: { index: 0, rowspan: [] }
};
const tableField: any = ref([
{ label: "变更字段", field: "name", width: 200 },
{
label: "变更时间", field: "date", width: 120, getName: (scope) => {
return scope.row.date ? Moment(scope.row.date).format('YYYY-MM-DD') : '--';
}
},
]);
const tableData = ref([])
const selectChange = (val, item, scope = null) => {
// console.log(val, item, scope);
if (item.field == 'businessLicenseTerm' || item.field == 'industry') {
setFormItems(scope, false)
// contentFormItems.value.at(7).default = val || '';
// contentFormItems.value.at(8).default = [];
// contentFormItems.value.at(8).visible = val == '2';
}
}
/**
* 传入多个promise对象,当全部结束时取消Loading
* @param promises 传入多个promise对象,当全部结束时取消Loading
*/
const promiseList = async (...promises: Promise<void>[]) => {
try {
await Promise.all(promises).then((res) => {
loading.value = false;
setTableField();
if (detailGuid.value) {
setFormItems();
// const approveVO = flowDetail.value.approveVO || {};
// deploymentId.value = approveVO.camundaDeploymentId || ''
// processInstanceId.value = approveVO.camundaInstanceId || '';
}
});
} catch (e) {
loading.value = false;
}
};
// 获取需求类型
const getDataType = (dictType, fieldName) => {
return getParamsList({ dictType }).then((res: any) => {
if (res?.code == proxy.$passCode) {
const data = res.data || [];
if (fieldName == 'tenantTypeVal') {
typeMap.value.tenantType = JSON.parse(JSON.stringify(data));
let item = contentFormItems.value.find(item => item.field == fieldName);
item && (item.options = data);
} else if (fieldName == 'institutionType') {
typeMap.value[fieldName] = JSON.parse(JSON.stringify(data));
let item = contentFormItems.value.find(item => item.field == fieldName);
item && (item.options = data);
} else {
typeMap.value[fieldName] = JSON.parse(JSON.stringify(data));
let item = corporateFormItems.value.find(item => item.field == fieldName);
item && (item.options = data);
if (fieldName == 'juridicalPersonIdType') {
typeMap.value[fieldName] = data;
let item = accountFormItem.value.find(item => item.field == 'handlePersonIdType');
item && (item.options = data);
}
}
} else {
proxy.$ElMessage.error(res.msg);
}
})
}
const setFormItems = (info = null, setOther = true) => {
const datas = info ? JSON.parse(JSON.stringify(info)) : JSON.parse(JSON.stringify(flowDetail.value));
contentFormItems.value.map((a, index) => {
a.disabled = !isEdit.value;
if (a.field == 'tenantName') {
a.default = datas[a.field] || staffName;
} else if (a.field == 'registeredCapital') {
a.default = Number.isNaN(datas[a.field]) ? '' : datas[a.field];
} else if (a.field == 'tenantTypeVal') {
a.default = setTenant.value ? (datas[a.field] || '') : (datas.tenantType || datas[a.field] || '');
} else if (a.field == 'socialCreditCode') {
a.default = setTenant.value ? (datas[a.field] || '') : (datas[a.field] || staffNo);
} else if (a.field == 'area') {
a.default = setTenant.value ? (datas.companyAddress ? datas.companyAddress.split('/') : datas[a.field] || []) : datas.province ? [datas.province, datas.city, datas.district] : (datas[a.field] || []);
} else if (a.field == 'businessLicenseEndDate') {
a.default = datas[a.field] || '';
a.visible = datas.businessLicenseTerm == '2';
} else if (a.field == 'businessLicenseFile') {
if (setTenant.value) {
const tenantLicList = (datas.tenantLicList || []);
const pictList = tenantLicList.filter(t => t.licenseType == '1') || [];
let picts: any = [];
pictList.map(m => {
const fl = JSON.parse(m.pictContentJson || '[]')
fl.map(f => {
picts.push({ name: f.name, url: f.path, file: { uid: f.uid, url: f.path } })
})
});
a.default = tenantLicList.length == 0 ? datas[a.field] || [] : picts;
} else {
a.default = datas.businessLicenseJson ? JSON.parse(datas.businessLicenseJson) : (datas[a.field] || []);
}
} else if (a.field == 'industry') {
a.default = datas[a.field] || '';
contentFormItems.value[index + 1].options = !a.default ? [] : industryList.value.find(i => i.value == a.default)?.childDictList || [];
} else {
a.default = datas[a.field] || '';
}
})
if (!setOther) return;
corporateFormItems.value.map(b => {
b.disabled = !isEdit.value;
if (b.field == 'juridicalPersonIdPhoto') {
b.default = datas.juridicalPersonIdPhotoJson ? JSON.parse(datas.juridicalPersonIdPhotoJson) : (datas[b.field] || []);
} else if (b.field == 'juridicalPerson') {
b.default = setTenant.value ? (datas.personIncharge || datas[b.field] || '') : (datas[b.field] || '');
} else if (b.field == 'juridicalPersonIdType') {
b.default = datas[b.field] || '1';
} else {
b.default = datas[b.field] || '';
}
})
accountFormItem.value.map(c => {
c.disabled = !isEdit.value;
if (c.field == 'logonUser') {
c.default = datas[c.field] || userData.logonUser;
c.disabled = true;
} else if (c.field == 'managerPersonIdPhoto') {
c.default = datas.managerPersonIdPhotoJson ? JSON.parse(datas.managerPersonIdPhotoJson) : (datas[c.field] || []);
} else if (c.field == 'handlePersonIdType') {
c.default = datas[c.field] || '1';
} else {
c.default = datas[c.field] || '';
}
})
contractFormItem.value.map(d => {
d.disabled = !isEdit.value;
d.default = datas.authorizationLetter ? JSON.parse(datas.authorizationLetter) : (datas.authorizationLetterFile || []);
})
setTimeout(() => {
if (setTenant.value && setOther) {
const companyFormObj = companyFormRef.value;
const companyFormEl = companyFormObj.ruleFormRef;
const corporateFormObj = corporateFormRef.value
const corporateFormEl = corporateFormObj.ruleFormRef;
const accountFormObj = accountFormRef.value
const accountFormEl = accountFormObj.ruleFormRef;
const contractFormObj = contractFormRef.value
const contractFormEl = contractFormObj.ruleFormRef;
companyFormEl.clearValidate();
corporateFormEl.clearValidate();
accountFormEl.clearValidate();
contractFormEl.clearValidate();
}
}, 100)
}
// 获取用户信息
const getUserTenantInfo = () => {
let ps1 = getParamsList({ dictType: '开发主体附件类型' })
let ps2 = getUserSomeInfo({ guid: userData.userGuid })
Promise.all([ps1, ps2]).then((resInfos: any) => {
// 处理附件信息
let res1 = resInfos?.[0];
if (res1?.code == proxy.$passCode) {
let data = uploadFileList.value = res1.data || [];
uploadFormRules.value = {};
uploadFormItems.value = data.map(d => {
// uploadFormRules.value[`files-${d.value}`] = [{
// validator: (rule: any, value: any, callback: any) => {
// if (!value?.length) {
// callback(new Error('请上传文件'))
// } else {
// callback();
// }
// }, trigger: 'change'
// }];
return {
label: d.label,
tip: '支持扩展名:pdf、png、jpg、rar、zip,单个文件不得大于10M',
type: 'upload-file',
accept: '.pdf, .png, .jpg, .rar, .zip',
required: false,
limitSize: 10,
default: [],
field: `files-${d.value}`,
}
})
} else {
ElMessage.error(res1.msg);
}
// 处理公司信息
let res = resInfos?.[1];
if (res?.code == proxy.$passCode) {
const data = res.data.records || [];
userData.logonUser = data[0].logonUser;
userData.mobileNo = data[0].mobileNo;
accountFormItem.value[0].default = userData.logonUser;
accountFormItem.value[2].default = userData.mobileNo;
getTenant()
} else {
ElMessage.error(res.msg);
}
})
}
// 获取公司信息
const getTenant = () => {
loading.value = true;
getEnterpriseData({
logonUser: userData.tenantName == '非认证会员' ? userData.logonUser : tenantData.logonUser,
}).then((res: any) => {
// debugger
if (res?.code == proxy.$passCode) {
const data = res.data || {};
const totalRows = Object.keys(data).length;
flowDetail.value = data;
detailGuid.value = data.guid || '';
bizApproveState.value = data.bizApproveState || '';
crossPlatformApproveState.value = data.crossPlatformApproveState || '';
isEdit.value = (bizApproveState.value == 'Y' || crossPlatformApproveState.value == 'Y' || bizApproveState.value == 'A' || crossPlatformApproveState.value == 'A' || bizApproveState.value == 'B') ? false : true;
contentFormItems.value[1].disabled = bizApproveState.value == 'Y' || crossPlatformApproveState.value == 'Y' ? true : false;
tableData.value = data.changeList || [];
orgData.value = data.domainRSVOS?.map(d => {
return Object.assign(d, {
domainRange: [d.domainStartTime, d.domainEndTime]
});
}) || [];
orgTableInfo.value.data = orgData.value;
// orgTableInfo.value.STATUS = isEdit.value ? 'edit' : '';
let keys = Object.keys(orgTableInfo.value.editInfo);
keys.forEach(k => {
orgTableInfo.value.editInfo[k].disabled = !isEdit.value;
})
orgTableInfo.value.actionInfo.show = isEdit.value
let attachmentRQVOS = data.attachmentRSVOS || [];
uploadFormItems.value.forEach(item => {
let field = item.field;
let key = field.slice(6);
item.default = attachmentRQVOS.filter(a => a.fileType == key).map(f => {
return {
name: f.fileName,
url: f.fileUrl
}
})
// if (!isEdit.value && !item.default?.length) {
// item.visible = false;
// } else {
// item.visible = true;
// }
item.disabled = !isEdit.value;
})
if (totalRows == 0) {
promiseList(
getDataType('机构类型', 'tenantTypeVal'),
getDataType('证件类型', 'juridicalPersonIdType'),
getDataType('组织机构性质', 'institutionType'),
getDeploymentId('10013')
)
if (userData.tenantName != '非认证会员') {
getTenantData()
} else {
contentFormItems.value[0].disabled = false;
}
} else {
getMergeRow();
promiseList(
getDataType('机构类型', 'tenantTypeVal'),
getDataType('证件类型', 'juridicalPersonIdType'),
getDataType('组织机构性质', 'institutionType'),
)
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
})
}
// 获取会员详情
const getTenantData = () => {
getTenantDetailInfo(userData.tenantGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data ?? {};
flowDetail.value = { ...flowDetail.value, ...data };
setTenant.value = true;
setFormItems()
contentFormItems.value[0].disabled = true;
} else {
ElMessage.error(res.msg);
}
})
}
// 获取流程信息
const getDeploymentId = (flowType: any) => {
return getCamundaDeploymentId(flowType, userData.tenantGuid, userData.staffGuid).then((res: any) => {
if (res.code == proxy.$passCode) {
} else {
ElMessage.error(res.msg);
}
})
}
const setTableField = () => {
tableField.value.splice(2);
tableField.value.splice(2, 0, {
label: "变更前", field: "before", width: 400, getName: (scope) => {
const nameEn = scope.row.nameEn;
if (nameEn == 'tenantType' || nameEn == 'juridicalPersonIdType' || nameEn == 'institutionType') {
return typeMap.value[nameEn].find((c: any) => c.value == scope.row.before)?.label || '--';
} else if (nameEn == 'industry') {
return industryList.value.find((c: any) => c.value == scope.row.before)?.label || '--';
} else if (nameEn == 'industrySmallcode') {
let getChildLabel = (children) => {
for (const child of children) {
if (child.value == scope.row.before) {
return child.label;
}
let label = getChildLabel(child.childDictList || []);
if (label) {
return label;
}
}
}
return scope.row.before && getChildLabel(industryList.value) || [];
} else {
return scope.row.before || '--';
}
}
}, {
label: "变更后", field: "after", width: 400, getName: (scope) => {
const nameEn = scope.row.nameEn;
if (nameEn == 'tenantType' || nameEn == 'juridicalPersonIdType' || nameEn == 'institutionType') {
return typeMap.value[nameEn].find((c: any) => c.value == scope.row.after)?.label || '--';
} else if (nameEn == 'industry') {
return industryList.value.find((c: any) => c.value == scope.row.after)?.label || '--';
} else if (nameEn == 'industrySmallcode') {
let getChildLabel = (children) => {
for (const child of children) {
if (child.value == scope.row.after) {
return child.label;
}
let label = getChildLabel(child.childDictList || []);
if (label) {
return label;
}
}
}
return scope.row.after && getChildLabel(industryList.value) || [];
} else {
return scope.row.after || '--';
}
}
});
}
// 设置表格合并下标
const getMergeRow = () => {
mergeRowCount.value = JSON.parse(JSON.stringify(rowCount));
let list = tableData.value;
for (var i = 0; i < list.length; i++) {
if (i === 0) {
//第一个数据 默认合并1行,开始位置下标默认为0
for (var m in mergeRowCount.value) {
mergeRowCount.value[m].rowspan.push(1);
mergeRowCount.value[m].index = 0;
}
} else {
// 根据拥有子级数量进行合并
for (var m in mergeRowCount.value) {
let mergeRow = mergeRowCount.value[m];
if (list[i][m] && list[i][m] === list[i - 1][m]) {
mergeRow.rowspan[mergeRow.index] += 1;
mergeRow.rowspan.push(0);
} else {
mergeRow.rowspan.push(1);
mergeRow.index = i;
}
}
}
}
}
// 表格行合并
const tableSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
if (columnIndex === 0) {
const mergeInfo = mergeRowCount.value.name;
const rowspan = mergeInfo?.rowspan?.[rowIndex];
if (rowspan == null) {
return {
rowspan: 1,
colspan: 1
}
}
if (rowspan > 0) {
return {
rowspan,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
}
const setFormDisable = () => {
isEdit.value = false;
contentFormItems.value.map(a => a.disabled = true);
corporateFormItems.value.map(b => b.disabled = true);
accountFormItem.value.map(c => c.disabled = true);
contractFormItem.value.map(d => d.disabled = true);
// orgTableInfo.value.STATUS = isEdit.value ? 'edit' : '';
orgTableInfo.value.actionInfo.show = isEdit.value;
let keys = Object.keys(orgTableInfo.value.editInfo);
keys.forEach(k => {
orgTableInfo.value.editInfo[k].disabled = !isEdit.value;
})
uploadFormItems.value.forEach(item => {
// if (!isEdit.value && !item.default?.length) {
// item.visible = false;
// } else {
// item.visible = true;
// }
item.disabled = !isEdit.value;
})
}
/** 保存草稿,不用校验。 */
const saveDraft = (params) => {
loading.value = true;
if (detailGuid.value) {
enterpriseUpdate(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
ElMessage.success('编辑认证信息成功');
bizApproveState.value = 'N';
// setFormDisable();
// setTimeout(() => {
// getTenant();
// }, 2000);
} else {
ElMessage.error(res.msg);
}
}).catch((xhr) => {
loading.value = false;
ElMessage.error(xhr.response.data.msg);
});
} else {
enterpriseSave(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
ElMessage.success('新建认证信息成功');
bizApproveState.value = 'N';
// setFormDisable();
// setTimeout(() => {
// getTenant();
// }, 2000);
} else {
ElMessage.error(res.msg);
}
}).catch((xhr) => {
loading.value = false;
ElMessage.error(xhr.response.data.msg);
});
}
}
const subSave = (params) => {
loading.value = true;
if (detailGuid.value) {
enterpriseUpdate(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
ElMessage.success('编辑认证信息提交申请成功');
bizApproveState.value = 'A';
setFormDisable();
} else {
ElMessage.error(res.msg);
}
}).catch((xhr) => {
loading.value = false;
ElMessage.error(xhr.response.data.msg);
});
} else {
enterpriseSave(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
ElMessage.success('新建认证信息提交申请成功');
bizApproveState.value = 'A';
setFormDisable();
} else {
ElMessage.error(res.msg);
}
}).catch((xhr) => {
loading.value = false;
ElMessage.error(xhr.response.data.msg);
});
}
}
const changeApprove = (params) => {
loading.value = true;
changeApproveSave(params).then((res: any) => {
loading.value = false;
if (res.code == proxy.$passCode) {
ElMessage.success('认证信息变更申请成功');
bizApproveState.value = 'B';
setFormDisable();
} else {
ElMessage.error(res.msg);
}
}).catch((xhr) => {
loading.value = false;
ElMessage.error(xhr.response.data.msg);
});
}
const btnClick = async (btn, bType = null) => {
const type = btn.value;
if (type == 'save' || type == 'submit') {
const companyFormObj = companyFormRef.value;
const companyFormEl = companyFormObj.ruleFormRef;
const companyFormInfo = companyFormObj.formInline;
const corporateFormObj = corporateFormRef.value
const corporateFormEl = corporateFormObj.ruleFormRef;
const corporateFormInfo: any = corporateFormObj.formInline;
const accountFormObj = accountFormRef.value
const accountFormEl = accountFormObj.ruleFormRef;
const accountFormInfo: any = accountFormObj.formInline;
const contractFormObj = contractFormRef.value
const contractFormEl = contractFormObj.ruleFormRef;
const contractFormInfo: any = contractFormObj.formInline;
const saveParam = () => {
let params = {
...companyFormInfo,
...corporateFormInfo,
...accountFormInfo,
...contractFormInfo,
};
params.province = params.area[0];
params.city = params.area[1];
params.district = params.area[2];
params.tenantType = params.tenantTypeVal;
params.businessLicenseJson = JSON.stringify(params.businessLicenseFile);
params.juridicalPersonIdPhotoJson = JSON.stringify(params.juridicalPersonIdPhoto);
params.managerPersonIdPhotoJson = JSON.stringify(params.managerPersonIdPhoto);
params.authorizationLetter = JSON.stringify(params.authorizationLetterFile);
// params.businessLicenseStartDate = params.businessLicenseTerm == '2' ? params.businessLicenseDate[0] : null;
params.businessLicenseEndDate = params.businessLicenseTerm == '2' ? params.businessLicenseEndDate : null;
delete params.area;
delete params.businessLicenseFile;
delete params.juridicalPersonIdPhoto;
delete params.managerPersonIdPhoto;
delete params.authorizationLetterFile;
delete params.businessLicenseDate;
delete params.tenantTypeVal;
params.tenantGuid = userData.tenantGuid;
detailGuid.value && (params.guid = detailGuid.value);
//TODO,只有江苏专区时才需要必填
// if (!orgData.value.length) {
// proxy.$ElMessage.error('开发主体领域信息不能为空');
// return;
// }
for (const d of orgData.value) {
if (!d.domainId) {
proxy.$ElMessage.error('领域名称不能为空');
return;
}
if (!d.authId) {
proxy.$ElMessage.error('授权协议号不能为空');
return;
}
if (!d.domainRange) {
proxy.$ElMessage.error('协议日期不能为空');
return;
}
// if (!d.domainEndTime) {
// proxy.$ElMessage.error('协议结束日期不能为空');
// return;
// }
if (!d.domainSignTime) {
proxy.$ElMessage.error('协议签订时间不能为空');
return;
}
if (!d.signee) {
proxy.$ElMessage.error('协议签订人不能为空');
return;
}
}
params.domainRQVOS = orgData.value?.map(d => {
return Object.assign(d, {
domainEndTime: d.domainRange?.[1],
domainStartTime: d.domainRange?.[0],
})
});
let uploadValue = uploadFormRef.value.formInline;
let attachmentRQVOS: any[] = [];
for (const key in uploadValue) {
if (!uploadValue[key]?.length) {
continue;
}
let n = key.slice(6);
uploadValue[key].forEach(uf => {
attachmentRQVOS.push({
fileName: uf.name,
fileType: n,
fileUrl: uf.url,
});
})
}
params.attachmentRQVOS = attachmentRQVOS;
if (bizApproveState.value == 'Y' && crossPlatformApproveState.value == 'Y') {
let flowParams: any = {};
flowParams.flowType = '10014';
flowParams.bizGuid = detailGuid.value;
flowParams.sourceApproveGuid = flowDetail.value.approveVO.approveGuid;
flowParams.bizDataJson = JSON.stringify(params);
flowParams.oldBizDataJson = JSON.stringify(flowDetail.value);
flowParams.isDraft = type == 'submit' ? 'N' : 'Y';
changeApprove(flowParams);
} else {
if (type == 'submit') {
params.immediateApprove = true;
params.bizApproveState = 'A';
params.isRestart = (bizApproveState.value == 'C' || bizApproveState.value == 'R') ? true : false;
subSave(params)
} else {
params.immediateApprove = false;
params.bizApproveState = 'N';
saveDraft(params)
}
}
}
companyFormEl.validate((valid, errorItem) => {
if (valid) {
corporateFormEl.validate((valid, errorItem) => {
if (valid) {
accountFormEl.validate((valid, errorItem) => {
if (valid) {
contractFormEl.validate((valid, errorItem) => {
if (valid) {
saveParam();
} else {
expand4.value = true;
var obj = Object.keys(errorItem);
contractFormEl.scrollToField(obj[0]);
}
});
} else {
expand3.value = true;
var obj = Object.keys(errorItem);
accountFormEl.scrollToField(obj[0]);
}
});
} else {
expand2.value = true;
var obj = Object.keys(errorItem);
corporateFormEl.scrollToField(obj[0]);
}
});
} else {
expand1.value = true;
var obj = Object.keys(errorItem);
companyFormEl.scrollToField(obj[0]);
}
});
} else if (type == 'cancel') {
setFormItems();
if (bizApproveState.value == 'Y' && crossPlatformApproveState.value == 'Y') {
setFormDisable();
}
} else if (type == 'change') {
isEdit.value = true;
contentFormItems.value.map(a => {
if (a.field == 'socialCreditCode') {
a.disabled = bizApproveState.value == 'Y' || crossPlatformApproveState.value == 'Y' ? true : false;
} else {
a.disabled = false
}
});
corporateFormItems.value.map(b => b.disabled = false);
accountFormItem.value.map(c => c.disabled = c.field == 'logonUser' ? true : false);
contractFormItem.value.map(d => d.disabled = false);
// orgTableInfo.value.STATUS = isEdit.value ? 'edit' : '';
let keys = Object.keys(orgTableInfo.value.editInfo);
keys.forEach(k => {
orgTableInfo.value.editInfo[k].disabled = !isEdit.value;
})
orgTableInfo.value.actionInfo.show = isEdit.value
uploadFormItems.value.forEach(item => {
// if (!isEdit.value && !item.default?.length) {
// item.visible = false;
// } else {
// item.visible = true;
// }
item.disabled = !isEdit.value;
})
}
}
onBeforeMount(() => {
// userData的值为空,则获取用户信息
getUserTenantInfo();
getParamsList({ dictType: '领域' }).then((res: any) => {
if (res?.code == proxy.$passCode) {
const data = res.data || [];
orgTableInfo.value.editInfo.domainId.options = data;
} else {
res?.msg && proxy.$ElMessage.error(res?.msg);
}
})
getParamsList({ dictType: '行业分类' }).then((res: any) => {
if (res?.code == proxy.$passCode) {
industryList.value = res.data || [];
let index = contentFormItems.value.findIndex(item => item.field == 'industry');
let item = contentFormItems.value[index];
item.options = industryList.value;
contentFormItems.value[index + 1].options = !item.default ? [] : industryList.value.find(i => i.value == item.default)?.childDictList || [];
} else {
res?.msg && proxy.$ElMessage.error(res?.msg);
}
})
})
const orgTableRef = ref();
const orgData: any = ref([]);
/** 领域的字典列表 */
const domainList: any = ref([]);
/** 被授权资源信息的表格配置 */
const orgTableInfo = ref({
id: "org-table",
height: '214px',
fields: [
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "领域名称", field: "domainId", width: 160, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "授权协议号", field: "authId", width: 180, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "协议日期", field: "domainRange", width: 260, required: true, columClass: 'edit-colum', type: 'edit' },
// { label: "协议结束日期", field: "domainEndTime", width: 140, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "协议签订时间", field: "domainSignTime", width: 200, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "协议签订人", field: "signee", width: 150, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "协议状态", field: "domainStatus", width: 140, required: true, columClass: 'edit-colum', type: 'edit' },
],
editInfo: {
authId: {
label: '',
type: 'input',
field: 'authId',
default: '',
maxlength: 50,
placeholder: '请输入',
clearable: true,
},
signee: {
label: '',
type: 'input',
field: 'signee',
default: '',
maxlength: 20,
placeholder: '请输入',
clearable: true,
},
domainId: {
label: '',
type: 'select',
field: 'domainId',
default: '',
options: domainList.value,
props: {
label: 'label',
value: 'value'
},
placeholder: '请选择',
clearable: true,
filterable: true
},
domainRange: {
label: '',
type: 'date-picker',
field: 'domainRange',
default: [],
placeholder: '请选择',
clearable: true,
},
// domainStartTime: {
// label: '',
// type: 'date',
// field: 'domainStartTime',
// default: '',
// placeholder: '请选择',
// clearable: true,
// },
// domainEndTime: {
// label: '',
// type: 'date',
// field: 'domainEndTime',
// default: '',
// placeholder: '请选择',
// clearable: true,
// },
domainSignTime: {
label: '',
type: 'datetime',
field: 'domainSignTime',
default: '',
placeholder: '请选择',
clearable: true,
},
domainStatus: {
label: '',
type: 'select',
field: 'domainStatus',
default: '',
options: [{
value: '10',
label: '生效中'
}, {
value: '20',
label: '已终止'
}],
props: {
label: 'label',
value: 'value'
},
placeholder: '请选择',
clearable: true,
filterable: true
},
},
STATUS: 'edit',
data: orgData.value,
showPage: false,
actionInfo: {
show: true,
label: "操作",
type: "btn",
width: 60,
fixed: 'right',
btns: [
{
label: "删除", value: "remove", click: (scope) => {
let index = scope.$index;
proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => {
orgData.value.splice(index, 1);
orgTableInfo.value.data = orgData.value;
proxy.$ElMessage.success('开发主体领域信息删除成功');
}, () => {
proxy.$ElMessage.info("已取消");
});
}
},
]
},
loading: false
});
/** 给表格添加一行入参定义。 */
const addOrgs = () => {
orgData.value.push({ domainId: '', authId: '', domainRange: [], domainSignTime: '', signee: '', domainStatus: '10', guid: '' });
orgTableInfo.value.data = orgData.value;
nextTick(() => {
scrollLastRowToView(orgTableRef.value?.tableRef, orgData.value.length);
})
}
const uploadFormRef = ref();
/** 开发主体附件信息 */
const uploadFormItems: any = ref([]);
const uploadFormRules = ref({});
/** 开发主体附件类型的字典 */
const uploadFileList: any = ref([]);
// 查看凭证证书
const viewVoucherFile = () => {
const url = flowDetail.value.trustedIdentityCredential;
if (!url) {
return;
}
onUploadFilePreview(url);
}
</script>
<template>
<div class="container_wrap full" v-loading="loading">
<div class="content_main panel"
:class="{ full: bizApproveState == 'A' || bizApproveState == 'B' || crossPlatformApproveState == 'A' }">
<ContentWrap title="企业信息" expandSwicth style="margin-top: 15px" :isExpand="expand1" @expand="(v) => expand1 = v"
description="备注:与平台运营签订相关的合同后才能进行认证,避免认证不成功,请知晓!">
<div class="form_panel">
<Form ref="companyFormRef" formId="company-form" :itemList="companyForm.items" :rules="companyForm.rules"
col="col3" @selectChange="selectChange" />
</div>
</ContentWrap>
<ContentWrap title="法人信息" expandSwicth style="margin-top: 15px" :isExpand="expand2" @expand="(v) => expand2 = v">
<Form ref="corporateFormRef" formId="corporate-form" :itemList="corporateForm.items"
:rules="corporateForm.rules" col="col3" @selectChange="selectChange" />
</ContentWrap>
<ContentWrap title="管理员(经办人)信息" expandSwicth style="margin-top: 15px" :isExpand="expand3"
@expand="(v) => expand3 = v">
<div class="form_panel">
<Form ref="accountFormRef" formId="account-form" :itemList="accountForm.items" :rules="accountForm.rules"
col="col3" />
</div>
</ContentWrap>
<ContentWrap title="协议签署" expandSwicth style="margin-top: 15px" :isExpand="expand4" @expand="(v) => expand4 = v">
<div class="form_panel">
<Form ref="contractFormRef" formId="contract-form" :itemList="contractForm.items" :rules="contractForm.rules"
col="col3" />
</div>
</ContentWrap>
<ContentWrap title="开发主体领域信息" expandSwicth style="margin-top: 15px" :isExpand="expand6"
@expand="(v) => expand6 = v">
<Table ref="orgsTableRef" :tableInfo="orgTableInfo" class="fiveRow-table" />
<div v-show="isEdit" class="row-add-btn">
<el-button link @click="addOrgs" :icon="CirclePlus" v-preReClick>添加</el-button>
</div>
</ContentWrap>
<ContentWrap id="id-files" title="开发主体附件信息" description="" expandSwicth style="margin-top: 15px"
:isExpand="uploadInfoExpand" @expand="(v) => uploadInfoExpand = v" v-show="uploadFormItems.length">
<Form class='uploadForm' ref="uploadFormRef" :itemList="uploadFormItems" formId="upload-form"
:rules="uploadFormRules" col="col2" />
</ContentWrap>
<ContentWrap title="历史变更信息" expandSwicth style="margin-top: 15px" :isExpand="expand5"
@expand="(v) => expand4 = v">
<div class="table_panel" :class="{ full: tableData.length > 0 }">
<el-table border :data="tableData" :span-method="tableSpanMethod" tooltip-effect="light" style="height: 100%;"
v-if="tableData.length > 0">
<el-table-column v-for="(item, i) in tableField" :key="'r_' + i" :label="item.label" :width="item.width"
:min-width="item.minWidth" :fixed="item.fixed" :align="item.align" :sortable="item.sortable ?? false"
:prop="item.field" :class-name="item.columClass" show-overflow-tooltip>
<template #default="scope">
<span>
{{ item.getName ? item.getName(scope) : scope.row[item.field] !== 0 && !scope.row[item.field] ?
"--" : scope.row[item.field] }}
</span>
</template>
</el-table-column>
</el-table>
<div class="empty_tips" v-else>暂无变更信息</div>
</div>
</ContentWrap>
<ContentWrap title="认证结果信息" v-if="bizApproveState == 'Y' && crossPlatformApproveState == 'Y' && !isEdit" expandSwicth style="margin-top: 15px" :isExpand="expandResult"
@expand="(v) => expandResult = v">
<div class="list_panel">
<div class="list_item">
<span class="item_label">认证时间:</span>
<span class="item_value">{{ flowDetail.credentialTime || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">身份认证凭证:</span>
<span v-if="flowDetail.trustedIdentityCredential" class="item_value link" @click="viewVoucherFile">查看</span>
<span v-else class="item_value">--</span>
</div>
</div>
</ContentWrap>
<!-- <ContentWrap id="id-approveInfo" title="审核信息" expandSwicth style="margin-top: 15px" :isExpand="expand6"
@expand="(v) => expand6 = v" v-show="deploymentId">
<ApprovalProcess v-if="deploymentId" :deploymentId="deploymentId" :processInstanceId="processInstanceId"
:definitionId="''">
</ApprovalProcess>
</ContentWrap> -->
</div>
<div class="tool_btns">
<div class="btns" v-if="isEdit">
<el-button @click="btnClick({ value: 'cancel' })">取消</el-button>
<!-- <el-button type="primary" v-if="bizApproveState != 'R' && bizApproveState != 'C'"
@click="btnClick({ value: 'save' })">保存</el-button> -->
<el-button type="primary" @click="btnClick({ value: 'submit' })">提交</el-button>
</div>
<div class="btns" v-else-if="bizApproveState == 'Y' && crossPlatformApproveState == 'Y' && !isEdit">
<el-button type="primary" @click="btnClick({ value: 'change' })">变更认证</el-button>
</div>
</div>
</div>
</template>
<style scoped lang="scss">
.container_wrap {
overflow: hidden;
.content_main {
height: calc(100% - 45px);
overflow: hidden auto;
&.panel {
padding: 0 16px 16px;
}
&.full {
height: 100%;
}
.template_panel {
display: flex;
flex-wrap: wrap;
padding: 16px 16px 8px;
.title_item {
display: flex;
margin-bottom: 8px;
+.title_item {
margin-left: 40px;
}
.title_label {
display: block;
width: 80px;
line-height: 1.5;
}
.title_text {
line-height: 1.5;
}
&.is_block {
width: 100%;
margin-left: 0;
.title_text {
display: block;
width: calc(100% - 80px);
text-align: justify;
}
}
}
}
.panel_content {
height: 100%;
display: flex;
flex: 1;
border-top: 1px solid #d9d9d9;
.box_left {
width: 200px;
height: 100%;
border-right: 1px solid #d9d9d9;
.aside_title {
padding: 0 8px;
height: 40px;
line-height: 40px;
font-size: 14px;
color: #212121;
font-weight: 600;
}
.tree_panel {
height: 100%;
}
}
.box_right {
width: calc(100% - 200px);
padding-top: 8px;
.el-breadcrumb {
padding: 0 12px;
line-height: 40px;
}
}
}
.table_panel_wrap {
width: 100%;
height: 100%;
padding: 0 12px;
&.full {
padding: 0;
}
}
:deep(.el-card) {
.table_panel {
height: auto;
&.full {
height: 212px;
}
}
}
}
.tool_btns {
height: 44px;
margin: 0 -8px;
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid #d9d9d9;
}
}
.row-add-btn {
.el-button--default {
padding: 4px 0px;
margin-top: 4px;
}
:deep(.el-icon) {
width: 16px;
height: 16px;
svg {
width: 16px;
height: 16px;
}
}
}
.title {
color: #212121;
font-size: 14px;
line-height: 32px;
font-weight: 600;
}
.list_panel {
display: flex;
flex-wrap: wrap;
display: flex;
align-items: center;
.list_item {
width: 33.33%;
line-height: 32px;
font-size: 14px;
color: var(--el-text-color-regular);
display: flex;
justify-content: space-between;
min-width: 120px;
.item_label {
text-align: left;
}
.item_value {
color: var(--el-color-regular);
padding: 0 4px;
flex: 1;
text-align: justify;
min-width: 0;
}
&.is_block {
width: 100%;
.item_value {
white-space: pre-wrap;
}
}
}
}
</style>
<route lang="yaml">
name: certificationAudit
</route>
<script lang="ts" setup name="certificationAudit">
import { ref } from 'vue';
import TableTools from "@/components/Tools/table_tools.vue";
import { ElMessage, ElMessageBox } from 'element-plus';
import { getParamsList } from "@/api/modules/queryService";
import { getTaskGressList, getTaskRestart, getTaskExecutionLog, getFlowEnterpriseList, enterpriseDelete, enterpriseChangeDelete } from "@/api/modules/dataRequire";
import { passFlowData, rejectFlowData, myLastNode } from "@/api/modules/workFlowService";
import useDataAssetStore from "@/store/modules/dataAsset";
import Moment from "moment";
import { TableColumnWidth } from '@/utils/enum';
import DialogApproval from '@/components/ApprovalProcess/dialog_approval.vue';
const assetStore = useDataAssetStore();
const router = useRouter();
const { proxy } = getCurrentInstance() as any;
const userData = JSON.parse(localStorage.userData);
const loading = ref(false);
const typeMap: any = ref({});
const isLastNode = ref(false);
const searchItemList = ref([
{
type: "input",
label: "",
field: "tenantName",
default: "",
placeholder: "企业名称",
clearable: true,
},
{
type: 'select',
label: '',
field: 'tenantType',
default: '',
placeholder: '机构类型',
options: [],
filterable: true,
clearable: true
},
// {
// type: 'select',
// label: '',
// field: 'canContinueCollaborate',
// default: '',
// placeholder: '能否合作',
// options: [
// { label: '能', value: 'Y' },
// { label: '不能', value: 'N' }
// ],
// clearable: true
// },
]);
const systemApproveCurrentRowInfo: any = ref({})
const approvalDialogVisible = ref(false);
const handleApprovalDialogCancel = () => {
approvalDialogVisible.value = false;
}
const tableFields: any = ref([
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "企业名称", field: "param1", width: 200, },
{ label: "统一社会信用代码", field: "param3", width: 160 },
{
label: "法人姓名", field: "juridicalPerson", width: TableColumnWidth.USERNAME, getName: (scope) => {
const param4 = scope.row.param4 || '';
return param4 ? param4.split('_')[0] : '--'
}
},
{
label: "管理员姓名", field: "contacts", width: TableColumnWidth.USERNAME, getName: (scope) => {
const param4 = scope.row.param4 || '';
return param4 ? param4.split('_')[1] : '--'
}
},
{
label: "管理员手机号", field: "contactTel", width: 120, getName: (scope) => {
const param4 = scope.row.param4 || '';
return param4 ? param4.split('_')[2] : '--'
}
},
{
label: "审批状态", field: "bizApproveState", type: "tag", width: TableColumnWidth.STATE, align: 'center', getName: (scope) => {
const approveState = scope.row.bizApproveState
switch (approveState) {
case 'N':
return '草稿中';
case 'A':
return '审批中';
case 'Y':
return '已通过';
case 'R':
return '已驳回';
case 'C':
return '已撤销';
case 'D':
return '已废弃';
default:
return '--';
}
}, tagType: (scope) => {
const approveState = scope.row.bizApproveState
switch (approveState) {
case 'A':
return 'warning';
case 'Y':
return 'success';
case 'R':
return 'danger';
default:
return 'info';
}
}
},
{
label: "主平台审批状态", field: "crossPlatformApproveState", type: "approveTagBtn", width: 150, align: 'center', btn: {
label: '查看', visible: (scope) => {
return scope.row.crossPlatformApproveState != null;
}, click: (scope) => {
systemApproveCurrentRowInfo.value = scope.row;
approvalDialogVisible.value = true;
}
}
},
{
label: "提交时间", field: "createTime", width: TableColumnWidth.DATETIME, getName: (scope) => {
return scope.row.createTime ? Moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') : '--';
}
},
]);
const page = ref({
limit: 50,
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
],
tenantName: '',
tenantType: '',
canContinueCollaborate: ''
});
const currTableData: any = ref({});
const tableInfo = ref({
id: 'value-asset-table',
rowKey: 'guid',
loading: false,
fields: tableFields.value,
data: [],
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
label: "操作",
type: "btn",
width: 180,
btns: (scope) => {
let row = scope.row;
return getTableBtns(row);
}
}
});
const getTableBtns = (row, includeDetail = true) => {
let btnsArr: any[] = [];
const currentStaffGuid = userData.staffGuid;
const approveState = row.bizApproveState || 'N';
const approveStaffGuids = row.approveStaffGuids || [];
const staffGuid = row.staffGuid || '';
let flowState;
if (approveState == 'N' && staffGuid == currentStaffGuid) {
flowState = 1;
}
if (approveState == 'A' && approveStaffGuids.indexOf(currentStaffGuid) > -1) {
flowState = 2;
}
if ((approveState == 'C' || approveState == 'R') && staffGuid == currentStaffGuid) {
flowState = 3;
}
if (row.flowType == '10013' && approveState == 'Y') {
flowState = 4;
}
btnsArr.push({ label: "详情", value: "detail" })
if (flowState === 1) {
btnsArr.push({ label: "删除", value: "delete" })
} else if (flowState === 2) {
btnsArr.push(...[{ label: "通过", value: "pass" }, { label: "驳回", value: "reject" }])
} else if (flowState === 3) {
btnsArr.push({ label: "删除", value: "delete" })
} else if (flowState === 4) {
btnsArr.push({ label: "查看进度", value: "progress" })
}
return btnsArr
}
/**
* 传入多个promise对象,当全部结束时取消Loading
* @param promises 传入多个promise对象,当全部结束时取消Loading
*/
const promiseList = async (...promises: Promise<void>[]) => {
try {
await Promise.all(promises).then((res) => {
setTableField();
});
} catch (e) {
loading.value = false;
}
};
// 获取需求类型
const getDataType = (dictType, fieldName) => {
return getParamsList({ dictType }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || [];
typeMap.value[fieldName] = JSON.parse(JSON.stringify(data));
let item = searchItemList.value.find(item => item.field == fieldName);
item && (item.options = data);
} else {
proxy.$ElMessage.error(res.msg);
}
})
}
const setTableField = () => {
tableFields.value.splice(2, 0, {
label: "机构类型", field: "tenantType", width: 120, getName: (scope) => {
const datas = typeMap.value.tenantType;
return datas.find((item) => item.value == scope.row.param2)?.label || '--';
}
});
}
const toSearch = (val: any, clear: boolean = false) => {
page.value.curr = 1;
if (clear) {
searchItemList.value.map((item) => (item.default = ""));
page.value.tenantName = '';
page.value.tenantType = "";
page.value.canContinueCollaborate = "";
} else {
page.value.tenantName = val.tenantName || '';
page.value.tenantType = val.tenantType || '';
page.value.canContinueCollaborate = val.canContinueCollaborate || '';
}
getTableData();
};
const getTableData = () => {
tableInfo.value.loading = true;
getFlowEnterpriseList({
pageSize: page.value.limit,
pageIndex: page.value.curr,
param1Like: page.value.tenantName,
param2: page.value.tenantType,
flowTypeList: ["10013", "10014"],
tenantGuid: userData.tenantGuid,
staffGuid: userData.staffGuid,
}).then((res: any) => {
tableInfo.value.loading = false;
if (res.code == proxy.$passCode) {
const data = res.data || {};
tableInfo.value.data = data.records || [];
tableInfo.value.page.curr = res.data.pageIndex;
tableInfo.value.page.limit = res.data.pageSize;
tableInfo.value.page.rows = res.data.totalRows || 0;
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
tableInfo.value.loading = false;
})
}
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
currTableData.value = row;
if (type === 'detail') { // 详情
router.push({
name: 'certificationAuditDetail',
query: { guid: row.flowType == '10014' ? row.objectGuid : row.bizGuid, name: row.param1, tName: row.tenantName, fType: row.flowType, bizGuid: row.bizGuid, type }
});
} else if (type == "delete") {
delTableOpen("此操作将永久删除该认证信息,是否继续?", "warning");
} else if (type === 'pass') {
if (row.tenantName == '非认证会员') {
myLastNode({ deploymentId: row.camundaDeploymentId, processInstanceId: row.camundaInstanceId, staffGuid: userData.staffGuid }).then((res: any) => {
if (res?.code == proxy.$passCode) {
isLastNode.value = res.data;
passDialogInfo.value.visible = true;
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
ElMessage.error('流程信息获取失败!');
});
} else {
passDialogInfo.value.visible = true;
}
} else if (type == 'reject') {
rejectDialogInfo.value.visible = true;
} else if (type == 'progress') {
loading.value = true;
getTaskGressList({ bizGuid: row.bizGuid }).then((res: any) => {
loading.value = false;
if (res?.code == proxy.$passCode) {
const data = res.data.records || [];
gressTableData.value = data;
gressDialogInfo.value.tableInfo.data = gressTableData.value;
gressDialogInfo.value.visible = true;
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
loading.value = false;
ElMessage.error('进度信息获取失败!');
});
} else if (type == 'log') {
getTaskExecutionLog({ guid: row.guid }).then((res: any) => {
if (res?.code == proxy.$passCode) {
drawerInfo.value.container.contents[0].listInfo.data = res.data || '';
gressDialogInfo.value.visible = false;
drawerInfo.value.visible = true
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
ElMessage.error('日志信息获取失败!');
});
} else if (type == 'restart') {
ElMessageBox.confirm('确定要重建该流程吗?', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
getTaskRestart({ guid: row.guid }).then((res: any) => {
if (res?.code == proxy.$passCode) {
ElMessage.success('流程已重建!');
gressDialogInfo.value.visible = false;
getTableData();
} else {
ElMessage.error(res.msg);
}
});
}).catch(() => {
ElMessage({
type: 'info',
message: '已取消重建'
});
});
}
};
const delTableOpen = (msg, type, isBatch: boolean = false) => {
ElMessageBox.confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: type,
}).then(() => {
let guids: any = [], method: any = null;
guids = [currTableData.value.bizGuid]
if(currTableData.value.flowType == '10013'){
method = enterpriseDelete(guids)
} else {
method = enterpriseChangeDelete(guids)
}
method.then((res: any) => {
if (res.code == proxy.$passCode) {
page.value.curr = 1;
getTableData();
ElMessage({
type: "success",
message: "删除该认证信息成功",
});
} else {
ElMessage({
type: "error",
message: res.msg,
});
}
})
}).catch(() => {
ElMessage({
type: 'info',
message: '已取消删除'
});
});
};
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
page.value.limit = Number(info.limit);
getTableData();
};
const passDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "通过",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-pass-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请确认该企业是否签署合同,如果是才能进行通过,请知晓!(非必填)",
field: "approveSuggest",
clearable: true,
block: true,
col: 'margin_b_0',
}
]
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const passDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
passDialogInfo.value.footer.btns[1].loading = true;
let params = {
guid: currTableData.value.guid,
flowType: currTableData.value.flowType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid,
}
passFlowData(params).then((res: any) => {
passDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success(isLastNode.value ? '正在生成数据,需要15分钟左右,请耐心等待!' : '审批成功');
passDialogInfo.value.visible = false;
getTableData();
} else {
ElMessage.error('审批失败');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
passDialogInfo.value.footer.btns[1].loading = false;
});
// if (isLastNode.value) {
// enterpriseApprove(params).then((res: any) => {
// passDialogInfo.value.footer.btns[1].loading = false;
// if (res?.code == proxy.$passCode) {
// if (res.data) {
// ElMessage.success('正在生成数据,需要3分钟左右,请耐心等待!');
// passDialogInfo.value.visible = false;
// getTableData();
// } else {
// ElMessage.error('审批失败');
// }
// } else {
// ElMessage.error(res.msg);
// }
// }).catch(() => {
// passDialogInfo.value.footer.btns[1].loading = false;
// });
// } else {
// passFlowData(params).then((res: any) => {
// passDialogInfo.value.footer.btns[1].loading = false;
// if (res?.code == proxy.$passCode) {
// if (res.data) {
// ElMessage.success('审批成功');
// passDialogInfo.value.visible = false;
// getTableData();
// } else {
// ElMessage.error('审批失败');
// }
// } else {
// ElMessage.error(res.msg);
// }
// }).catch(() => {
// passDialogInfo.value.footer.btns[1].loading = false;
// });
// }
} else if (btn.value == 'cancel') {
passDialogInfo.value.visible = false;
}
};
const rejectDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "驳回",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-reject-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请填写驳回理由(必填)",
field: "approveSuggest",
clearable: true,
block: true,
col: 'margin_b_0',
}
]
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const rejectDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
if (info.approveSuggest == '') {
ElMessage.error('请填写驳回理由');
return
}
rejectDialogInfo.value.footer.btns[1].loading = true;
let params = {
guid: currTableData.value.guid,
flowType: currTableData.value.flowType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid,
}
rejectFlowData(params).then((res: any) => {
rejectDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('驳回成功');
rejectDialogInfo.value.visible = false;
getTableData();
} else {
ElMessage.error('驳回失败');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
rejectDialogInfo.value.footer.btns[1].loading = false;
});
} else if (btn.value == 'cancel') {
rejectDialogInfo.value.visible = false;
}
};
const gressTableData: any = ref([]);
const gressDialogInfo: any = ref({
visible: false,
size: 780,
direction: "column",
tableInfo: {
id: 'gress-dialog-table',
fileds: [
{
label: '执行状态', field: 'executeState', width: 100, align: 'center', type: 'tag', getName: (scope) => {
const executeState = scope.row.executeState || '--';
switch (executeState) {
case '0':
return '未执行';
case '1':
return '执行中';
case '2':
return '执行成功';
case '3':
return '执行失败';
}
}, tagType: (scope) => {
const executeState = scope.row.executeState || 'info';
switch (executeState) {
case '0':
return 'info';
case '1':
return 'warning';
case '2':
return 'success';
case '3':
return 'danger';
}
}
},
{ label: '失败原因', field: 'failReason', width: 200 },
{
label: '执行时间', field: 'taskTime', minWidth: 340, getName: (scope) => {
// return proxy.$moment(scope.row.startTime).format('YYYY-MM-DD HH:mm:ss') : '';
return `${scope.row.startTime || '--'}${scope.row.endTime || '--'}`;
}
}
],
data: [],
btns: (scope) => {
let btnArr = [{ label: '日志', value: 'log' }];
const exIndex = gressTableData.value.findIndex(item => item.executeState == '3');
exIndex != -1 && exIndex == scope.$index && btnArr.push({ label: '重建', value: 'restart' });
return btnArr;
}
},
footer: {
visible: false,
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit" },
],
},
})
const gressDialogBtnClick = (btn) => {
if (btn.value == 'submit') {
} else if (btn.value == 'cancel') {
gressDialogInfo.value.visible = false;
}
}
const drawerInfo = ref({
visible: false,
direction: "rtl",
size: '100%',
modal: true,
modalClose: true,
header: {
title: "日志详情",
},
container: {
contents: [
{
type: 'content',
listInfo: {
data: '',
type: 'html'
}
}
],
},
footer: {
visible: false,
},
});
const drawerBtnClick = (btn) => {
drawerInfo.value.visible = false;
gressDialogInfo.value.visible = true;
};
onBeforeMount(() => {
promiseList(
getDataType('机构类型', 'tenantType'),
)
});
onActivated(() => {
if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
page.value.curr = 1;
getTableData();
assetStore.set(false);
}
})
</script>
<template>
<div class="container_wrap">
<div class="table_tool_wrap">
<TableTools :searchItems="searchItemList" :searchId="'value-asset-search'" @search="toSearch" :init="true" />
</div>
<div class="table_panel_wrap full">
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
</div>
<Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
<Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
<el-dialog v-model="gressDialogInfo.visible" title="查看进度" :width="gressDialogInfo.size">
<div class="table_panel">
<el-table border :data="gressDialogInfo.tableInfo.data" style="height: 100%;" tooltip-effect="light">
<el-table-column type="index" width="56" label="序号" align="center" />
<el-table-column label="任务内容" width="200">
<template #default="scope">
<span>创建会员、库及绑定流程</span>
</template>
</el-table-column>
<el-table-column v-for="item in gressDialogInfo.tableInfo.fileds" :key="item.field" :label="item.label"
:width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align"
:sortable="item.sortable ?? false" :prop="item.field" :class-name="item.columClass" show-overflow-tooltip>
<template #default="scope" v-if="item.type == 'tag'">
<el-tag :type="item.tagType ? item.tagType(scope) : ''">{{ item.getName ? item.getName(scope) :
scope.row[item.field] !== 0 && !scope.row[item.field] ?
"--" : scope.row[item.field] }}</el-tag>
</template>
<template #default="scope" v-else>
<span>
{{ item.getName ? item.getName(scope) : scope.row[item.field] !== 0 && !scope.row[item.field] ?
"--" : scope.row[item.field] }}
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100" fixed="right">
<template #default="scope">
<span v-for="(btn, b) in gressDialogInfo.tableInfo.btns(scope)" :key="'btn_' + b" class="text_btn"
@click="tableBtnClick(scope, btn)">{{ btn.label }}</span>
</template>
</el-table-column>
</el-table>
</div>
<template #footer v-if="gressDialogInfo.footer.visible ?? true">
<div class="dialog-footer">
<template v-for="btn in gressDialogInfo.footer.btns" :key="btn.value">
<el-button v-if="btn.visible ?? true" :type="btn.type" :disabled="btn.disabled ?? false"
:loading="btn.loading ?? false" @click="gressDialogBtnClick(btn)" v-preReClick>{{ btn.label }}</el-button>
</template>
</div>
</template>
</el-dialog>
<Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" />
<DialogApproval :visible="approvalDialogVisible" :currentRowInfo="systemApproveCurrentRowInfo"
@dialog-cancel="handleApprovalDialogCancel"></DialogApproval>
</div>
</template>
<style scoped lang="scss">
.container_wrap {
padding: 0 16px;
}
:deep(.el-dialog) {
.table_panel {
padding: 8px 0;
height: 228px;
.text_btn+.text_btn {
margin-left: 8px;
}
.el-popper {
>span {
&:first-child {
display: inline-block;
max-height: 200px;
margin: 0 -11px;
padding: 0 11px;
overflow: hidden auto;
}
}
}
}
}
</style>
<route lang="yaml">
name: certificationAuditDetail //企业认证详情
</route>
<script lang="ts" setup name="certificationAuditDetail">
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import { CircleCloseFilled } from '@element-plus/icons-vue'
import useUserStore from "@/store/modules/user";
import useDataAssetStore from "@/store/modules/dataAsset";
import { getEnterpriseDetail, enterpriseApprove } from "@/api/modules/dataRequire";
import { getAreaData, getParamsList } from "@/api/modules/queryService";
import { getLastChange, passFlowData, rejectFlowData, myLastNode, crossPlatformApprove } from "@/api/modules/workFlowService";
import Moment from "moment";
import { onUploadFilePreview } from "@/api/modules/common";
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const route = useRoute();
const userStore = useUserStore();
const userData = JSON.parse(localStorage.userData)
const fullPath = route.fullPath;
const assetStore = useDataAssetStore();
const guid = route.query.guid;
const detailType = route.query.type;
const tName = route.query.tName;
const fType = route.query.fType;
const bizGuid = route.query.bizGuid;
const loading = ref(false);
const flowDetail: any = ref({});
const approveState = ref('');
const typeMap: any = ref({});
const getAreaDataPromise: any = ref({});
const getAreaDatas: any = ref({});
const flowState = ref(0);
const isLastNode = ref(false);
const latestDate = ref('');
const approvalProcessRef = ref();
const beforeChangeList = ref([]);
const industryList: any = ref([]);
const getArea = (node, resolve) => {
const { level } = node
let params = {
parentGuid: node.value
}
if (getAreaDatas.value[node.value]?.length) {
resolve(getAreaDatas.value[node.value]);
return;
}
if (!getAreaDataPromise.value[node.value]) {
getAreaDataPromise.value[node.value] = getAreaData(params).then((res: any) => {
getAreaDataPromise.value[node.value] = null;
node.loaded = true;
if (res?.code == proxy.$passCode) {
const data = res.data ?? []
data.map(item => {
item.leaf = level >= 2
})
resolve(data)
getAreaDatas.value[node.value] = data;
return res.data ?? [];
}
})
} else {
getAreaDataPromise.value[node.value].then((data) => {
getAreaDataPromise.value[node.value] = null;
node.loaded = true;
data.map(item => {
item.leaf = level >= 1
})
resolve(data)
})
}
}
const detailGuid = ref('');
const expand1 = ref(true)
const expand2 = ref(true)
const expand3 = ref(true)
const expand4 = ref(true)
const expand5 = ref(true)
const expand6 = ref(true)
const deploymentId = ref('');
const processInstanceId = ref('')
const expand7 = ref(true);
const uploadInfoExpand = ref(true);
const expandResult = ref(true);
// 企业信息
const contentFormItems: any = ref([
{
label: '企业名称',
type: 'input',
placeholder: '请输入',
field: 'tenantName',
default: '',
maxlength: 50,
clearable: true,
required: true,
disabled: true
},
{
label: '统一社会信用代码',
type: 'input',
placeholder: '请输入',
field: 'socialCreditCode',
default: '',
maxlength: 50,
clearable: true,
required: true,
disabled: true
},
{
label: '机构类型',
type: 'select',
placeholder: '请选择',
field: 'tenantType',
default: '',
options: [],
clearable: true,
required: true,
disabled: true
},
{
label: '组织机构性质',
type: 'select',
placeholder: '请选择',
field: 'institutionType',
default: '',
options: [],
clearable: true,
filterable: true,
disabled: true,
required: true,
},
{
label: '公司注册日期',
type: 'date',
placeholder: '请选择日期',
field: 'registrationDate',
default: "",
unlink: true,
clearable: true,
required: true,
disabled: true
},
{
label: '注册资本(万元)',
type: 'input',
inputType: 'moneyNumber',
field: 'registeredCapital',
placeholder: '请输入',
default: '',
clearable: true,
required: true,
disabled: true
},
{
label: '税号',
type: 'input',
placeholder: '请输入',
field: 'bankTaxNo',
default: '',
clearable: true,
required: true,
disabled: true
},
{
label: '注册地',
type: 'cascader',
placeholder: '请选择',
field: 'area',
default: [],
props: {
label: 'name',
value: 'guid',
lazy: true,
lazyLoad: getArea,
},
clearable: true,
required: true,
disabled: true
},
{
label: '详细地址',
type: 'input',
placeholder: '请输入',
field: 'detailedAddress',
default: "",
maxlength: 250, // 后端是250
clearable: true,
disabled: true,
required: true
},
{
label: '行业分类',
type: 'select',
placeholder: '请选择',
field: 'industry',
default: '',
options: industryList.value,
clearable: true,
filterable: true,
required: true,
disabled: true
},
{
label: '行业小类',
type: 'tree-select',
placeholder: '请选择',
field: 'industrySmallcode',
nodeKey: 'value',
options: industryList.value,
checkStrictly: false,//只能选择叶子节点。
lazy: false,
multiple: false,
props: {
label: "label",
value: "value",
children: 'childDictList'
},
filterable: true,
clearable: true,
default: '',
disabled: true,
required: true,
},
{
label: '营业开始日期',
type: 'date',
placeholder: '请选择',
field: 'businessLicenseStartDate',
default: "",
unlink: true,
clearable: true,
disabled: true,
required: true,
},
{
label: "营业结束日期",
type: "select",
placeholder: "请选择",
field: "businessLicenseTerm",
default: "",
options: [
{
label: "长期有效",
value: "1",
},
{
label: "自定义",
value: "2",
},
],
required: true,
clearable: true,
disabled: true,
col: 'error_auto',
style: {
width: '110px'
}
},
{
label: "营业结束日期",
type: 'date',
placeholder: '请选择',
field: "businessLicenseEndDate",
default: '',
labelClass: 'hide',
clearable: true,
required: true,
visible: false,
disabled: true,
style: {
width: 'calc(33.33% - 124px)'
}
},
{
label: '营业执照',
type: 'upload-file',
field: 'businessLicenseFile',
default: [],
tip: '请上传最新营业执照原件的彩色照片或扫描件,如使用复印件请加盖公章,支持扩展名:.jpg .png, 最大5M',
accept: '.jpg, .png',
required: true,
block: true,
disabled: true
},
{
label: '公司简介及经营范围',
type: 'textarea',
focusValue: false,
placeholder: '请输入公司简介及经营描述',
field: 'businessLicenseScope',
default: '',
clearable: true,
required: true,
block: true,
maxlength: 1000,
disabled: true,
col: 'error_textarea',
},
])
const contentFormRules = ref({
tenantName: [
{ required: true, trigger: 'blur', message: "请填写企业名称" }
],
socialCreditCode: [
{ required: true, trigger: 'blur', message: "请填写统一社会信用代码" }
],
tenantType: [
{ required: true, trigger: 'change', message: "请选择机构类型" }
],
institutionType: [
{ required: true, trigger: 'change', message: "请选择组织机构性质" }
],
registrationDate: [
{ required: true, trigger: 'change', message: "请选择公司注册日期" }
],
registeredCapital: [
{ required: true, trigger: 'blur', message: "请填写注册资本(万元)" }
],
bankTaxNo: [
{ required: true, trigger: 'blur', message: "请填写税号" }
],
area: [
{ required: true, trigger: 'change', message: "请选择注册地" }
],
detailedAddress: [
{ required: true, trigger: 'blur', message: "请填写详细地址" }
],
businessLicenseTerm: [
{ required: true, trigger: 'change', message: "请选择营业结束日期" }
],
businessLicenseStartDate: [
{ required: true, trigger: 'change', message: "请选择营业开始日期" }
],
businessLicenseDate: [
{ required: true, trigger: 'change', message: "请选择营业日期" }
],
businessLicenseFile: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传营业执照'))
} else {
callback();
}
}, trigger: 'change'
}],
businessLicenseScope: [
{ required: true, trigger: 'blur', message: "请填写公司简介及经营范围" }
],
});
const companyFormRef = ref();
const companyForm = ref({
items: contentFormItems.value,
rules: contentFormRules.value,
})
// 法人信息
const corporateFormItems: any = ref([
{
label: '法定代表人姓名',
type: 'input',
placeholder: '请输入',
field: 'juridicalPerson',
default: '',
clearable: true,
required: true,
disabled: true
},
{
label: '法定代表人证件类型',
type: 'select',
placeholder: '请选择',
field: 'juridicalPersonIdType',
default: '',
options: [],
clearable: true,
required: true,
disabled: true
},
{
label: '法定代表人证件号',
type: 'input',
placeholder: '请输入',
field: 'juridicalPersonId',
default: '',
clearable: true,
required: true,
disabled: true
},
{
label: '法定代表人证件正反面',
type: 'upload-file',
field: 'juridicalPersonIdPhoto',
default: [],
tip: '请上传最新法定代表人证件的彩色照片或扫描件,如使用复印件请加盖公章,支持扩展名:.jpg .png, 最大5M',
accept: '.jpg, .png',
required: true,
block: true,
disabled: true
},
])
const corporateFormRules = ref({
juridicalPerson: [
{ required: true, trigger: 'blur', message: "请填写法定代表人姓名" }
],
juridicalPersonIdType: [
{ required: true, trigger: 'change', message: "请选择法人证件类型" }
],
juridicalPersonId: [
{ required: true, trigger: 'blur', message: "请填写法定代表人证件号" }
],
juridicalPersonIdPhoto: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传法定代表人证件正反面'))
} else {
callback();
}
}, trigger: 'change'
}],
});
const corporateFormRef = ref();
const corporateForm = ref({
items: corporateFormItems.value,
rules: corporateFormRules.value,
})
// 账号信息
const accountFormItem = ref([
{
label: '用户名',
type: 'input',
placeholder: '请输入',
field: 'logonUser',
default: userData.mobileNo,
clearable: true,
required: true,
disabled: true
},
{
label: '账号管理人姓名',
type: 'input',
placeholder: '请输入',
field: 'contacts',
default: '',
clearable: true,
required: true,
disabled: true
},
{
label: '账号管理人手机号',
type: 'input',
placeholder: '请输入',
field: 'contactTel',
default: '',
clearable: true,
required: true,
disabled: true
},
{
label: '账号管理人证件类型',
type: 'select',
placeholder: '请选择',
field: 'handlePersonIdType',
default: '1',
options: [],
disabled: true,
clearable: true,
required: true,
},
{
label: '账号管理人证件号',
type: 'input',
placeholder: '请输入',
field: 'managerPersonId',
default: '',
clearable: true,
required: true,
disabled: true
},
{
label: '账号管理员证件正反面',
type: 'upload-file',
field: 'managerPersonIdPhoto',
default: [],
tip: '请上传最新管理员证件的彩色照片或扫描件,如使用复印件请加盖公章,支持扩展名:.jpg .png, 最大5M',
accept: '.jpg, .png',
required: true,
block: true,
disabled: true
},
]);
const accountFormRules = ref({
logonUser: [
{ required: true, trigger: 'blur', message: "请填写用户名" }
],
contacts: [
{ required: true, trigger: 'blur', message: "请填写账号管理人姓名" }
],
contactTel: [
{
validator: (rule: any, value: any, callback: any) => {
if (value === '') {
callback(new Error('请填写手机号'))
} else {
const regs = /^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[0-9]{1})|(19[0-9]{1})|(18[0-9]{1}))+\d{8})$/
if (regs.test(value)) {
callback();
} else {
callback(new Error('请填写正确的手机号'))
}
}
},
trigger: 'blur'
},
{
min: 1,
max: 11,
message: '请填写账号管理人手机号',
trigger: 'change',
},
],
managerPersonId: [
{ required: true, trigger: 'blur', message: "账号管理人证件号" }
],
managerPersonIdPhoto: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传账号管理员证件正反面'))
} else {
callback();
}
}, trigger: 'change'
}],
});
const accountFormRef = ref();
const accountForm: any = ref({
items: accountFormItem.value,
rules: accountFormRules.value,
})
// 协议签署
const contractFormItem = ref([
{
label: '授权委托书',
type: 'upload-file',
field: 'authorizationLetterFile',
default: [],
tip: '支持扩展名:.pdf, 最大50M',
accept: '.pdf',
required: true,
block: true,
disabled: true
},
]);
const contractFormRules = ref({
authorizationLetterFile: [{
validator: (rule: any, value: any, callback: any) => {
if (!value?.length) {
callback(new Error('请上传授权委托书'))
} else {
callback();
}
}, trigger: 'change'
}],
});
const contractFormRef = ref();
const contractForm = ref({
items: contractFormItem.value,
rules: contractFormRules.value,
})
// 历史变更
const mergeRowCount: any = ref({});
const rowCount = {
name: { index: 0, rowspan: [] }
};
const tableField: any = ref([
{ label: "变更字段", field: "name", width: 200 },
{
label: "变更时间", field: "date", width: 120, getName: (scope) => {
return scope.row.date ? Moment(scope.row.date).format('YYYY-MM-DD') : '--';
}
}
]);
const tableData = ref([]);
/**
* 传入多个promise对象,当全部结束时取消Loading
* @param promises 传入多个promise对象,当全部结束时取消Loading
*/
const promiseList = async (...promises: (() => Promise<void>)[]) => {
loading.value = true;
try {
for (const promise of promises) {
await promise(); // 按顺序执行每个 Promise
}
loading.value = false;
// 所有步骤完成后执行的逻辑
// if (tableData.value.length) {
// const dateRow = tableData.value.reduce((prev: any, current: any) => {
// const date1 = new Date(prev.date);
// const date2 = new Date(current.date);
// return date1 < date2 ? current : prev; // 使用小于号来找到最新的日期
// }, tableData.value[0]);
// latestDate.value = dateRow.date;
// }
setTableField();
setFormItems();
const approveVO = flowDetail.value.approveVO || {};
deploymentId.value = approveVO.camundaDeploymentId || '';
processInstanceId.value = approveVO.camundaInstanceId || '';
approveState.value = approveVO.approveState || '';
const approveStaffGuids = approveVO.approveStaffGuids || [];
if (approveStaffGuids.indexOf(userData.staffGuid) > -1) {
flowState.value = 2;
}
} catch (e) {
loading.value = false;
}
};
// 获取需求类型
const getDataType = async (dictType, fieldName) => {
try {
const res: any = await getParamsList({ dictType });
if (res.code === proxy.$passCode) {
const data = res.data || [];
typeMap.value[fieldName] = JSON.parse(JSON.stringify(data));
if (fieldName == 'tenantType' || fieldName == 'institutionType') {
let item = contentFormItems.value.find(item => item.field == fieldName);
item && (item.options = data);
} else {
let item = corporateFormItems.value.find(item => item.field == fieldName);
item && (item.options = data);
if (fieldName == 'juridicalPersonIdType') {
typeMap.value[fieldName] = data;
let item = accountFormItem.value.find(item => item.field == 'handlePersonIdType');
item && (item.options = data);
}
}
} else {
proxy.$ElMessage.error(res.msg);
}
} catch (error) {
throw error; // 将错误向上抛出
}
}
const setErrorMsg = (item: any) => {
setTimeout(() => {
const field = item.field;
if (field == 'area') {
const row: any = beforeChangeList.value.find((t: any) => t.nameEn == 'venue');
row && (item.validateStatus = 'error', item.error = `变更前为:${row.before}`)
} else if (item.field == 'businessLicenseTerm') {
const row: any = beforeChangeList.value.find((t: any) => t.nameEn == 'businessLicenseStartEnd');
row && (item.validateStatus = 'error', item.error = `变更前为:${row.before}`)
} else if (field == 'tenantType' || field == 'juridicalPersonIdType' || field == 'institutionType') {
const row: any = beforeChangeList.value.find((t: any) => t.nameEn == field);
if (row) {
const cont = typeMap.value[field].find((c: any) => c.value == row.before)?.label || '--';
item.validateStatus = 'error';
item.error = `变更前为:${cont}`;
}
} else if (item.field == 'industry') {
const row: any = beforeChangeList.value.find((t: any) => t.nameEn == field);
if (row) {
const cont = industryList.value.find((c: any) => c.value == row.before)?.label || '--';
item.validateStatus = 'error';
item.error = `变更前为:${cont}`;
}
} else if (item.field == 'industrySmallcode') {
const row: any = beforeChangeList.value.find((t: any) => t.nameEn == field);
if (row) {
let getChildLabel = (children) => {
for (const child of children) {
if (child.value == row.before) {
return child.label;
}
let label = getChildLabel(child.childDictList || []);
if (label) {
return label;
}
}
}
let cont = row.before && getChildLabel(industryList.value) || [];
item.validateStatus = 'error';
item.error = `变更前为:${cont}`;
}
} else {
const row: any = beforeChangeList.value.find((t: any) => t.nameEn == field);
row && (item.validateStatus = 'error', item.error = `变更前为:${row.before}`)
if (field == 'businessLicenseScope' && row) {
setTimeout(() => {
const errorDom: any = document.querySelector('.error_textarea .el-form-item__error');
errorDom && (errorDom.title = row.before);
}, 3000)
}
}
}, 1000)
}
const setFormItems = () => {
const datas = JSON.parse(JSON.stringify(flowDetail.value));
contentFormItems.value.map((a, index) => {
if (a.field == 'tenantName') {
a.default = datas[a.field] || userData.staffName;
} else if (a.field == 'registeredCapital') {
a.default = Number.isNaN(datas[a.field]) ? '' : datas[a.field];
} else if (a.field == 'socialCreditCode') {
a.default = datas[a.field] || userData.staffNo;
} else if (a.field == 'area') {
a.default = datas.province ? [datas.province, datas.city, datas.district] : [];
} else if (a.field == 'businessLicenseEndDate') {
a.visible = datas.businessLicenseTerm == '2';
a.default = datas[a.field] || '';
} else if (a.field == 'businessLicenseFile') {
a.default = JSON.parse(datas.businessLicenseJson || '[]');
} else if (a.field == 'industry') {
a.default = datas[a.field] || '';
contentFormItems.value[index + 1].options = !a.default ? [] : industryList.value.find(i => i.value == a.default)?.childDictList || [];
} else {
a.default = datas[a.field] || '';
}
let f = a;
(() => {
setErrorMsg(f);
})()
})
corporateFormItems.value.map(b => {
if (b.field == 'juridicalPersonIdPhoto') {
b.default = JSON.parse(datas.juridicalPersonIdPhotoJson || '[]');
} else {
b.default = datas[b.field] || '';
}
let f = b;
(() => {
setErrorMsg(f);
})()
})
accountFormItem.value.map(c => {
if (c.field == 'logonUser') {
c.default = datas[c.field] || userData.mobileNo;
} else if (c.field == 'managerPersonIdPhoto') {
c.default = JSON.parse(datas.managerPersonIdPhotoJson || '[]');
} else {
c.default = datas[c.field] || '';
}
let f = c;
(() => {
setErrorMsg(f);
})()
})
contractFormItem.value.map(d => {
d.default = JSON.parse(datas.authorizationLetter || '[]');
let f = d;
(() => {
setErrorMsg(f);
})()
})
}
// 获取详情
const getDetail = async () => {
try {
const res1: any = await getParamsList({ dictType: '开发主体附件类型' });
if (res1?.code === proxy.$passCode) {
uploadFileList.value = res1.data || [];
uploadFormItems.value = uploadFileList.value.map(d => {
return {
label: d.label,
tip: '支持扩展名:pdf、png、jpg、rar、zip,单个文件不得大于10M',
type: 'upload-file',
accept: '.pdf, .png, .jpg, .rar, .zip',
required: false,
disabled: true,
limitSize: 10,
default: [],
field: `files-${d.value}`,
}
})
} else {
proxy.$ElMessage.error(res1.msg);
}
const res: any = await getEnterpriseDetail({ guid: bizGuid });
if (res.code === proxy.$passCode) {
const data = res.data || {};
deploymentId.value = '';
processInstanceId.value = '';
flowState.value = 0;
flowDetail.value = data;
tableData.value = data.changeList || [];
beforeChangeList.value = data.beforeChangeList || [];
getMergeRow();
orgData.value = data.domainRSVOS || [];;
orgTableInfo.value.data = orgData.value;
let attachmentRQVOS = data.attachmentRSVOS || [];
uploadFormItems.value.forEach(item => {
let field = item.field;
let key = field.slice(6);
item.default = attachmentRQVOS.filter(a => a.fileType == key).map(f => {
return {
name: f.fileName,
url: f.fileUrl
}
})
// if (!item.default?.length) {
// item.visible = false;
// } else {
// item.visible = true;
// }
item.disabled = true;
})
} else {
proxy.$ElMessage.error(res.msg);
}
} catch (error) {
throw error; // 将错误向上抛出
}
}
// 获取变更详情
const getChangeDetail = async () => {
try {
const res: any = await getLastChange(bizGuid);
if (res.code === proxy.$passCode) {
const data = res.data || {};
const bizData = JSON.parse(data.bizDataJson || '{}');
const approveVO = data.approveVO || {};
flowDetail.value = { ...flowDetail.value, approveVO: { ...flowDetail.value.approveVO, ...approveVO }, ...bizData };
} else {
proxy.$ElMessage.error(res.msg);
}
} catch (error) {
throw error; // 将错误向上抛出
}
}
const setTableField = () => {
tableField.value.splice(2);
tableField.value.splice(2, 0, {
label: "变更前", field: "before", width: 400, getName: (scope) => {
const nameEn = scope.row.nameEn;
if (nameEn == 'tenantType' || nameEn == 'juridicalPersonIdType' || nameEn == 'institutionType') {
return typeMap.value[nameEn].find((c: any) => c.value == scope.row.before)?.label || '--';
} else if (nameEn == 'industry') {
return industryList.value.find((c: any) => c.value == scope.row.before)?.label || '--';
} else if (nameEn == 'industrySmallcode') {
let getChildLabel = (children) => {
for (const child of children) {
if (child.value == scope.row.before) {
return child.label;
}
let label = getChildLabel(child.childDictList || []);
if (label) {
return label;
}
}
}
return scope.row.before && getChildLabel(industryList.value) || [];
} else {
return scope.row.before || '--';
}
}
}, {
label: "变更后", field: "after", width: 400, getName: (scope) => {
const nameEn = scope.row.nameEn;
if (nameEn == 'tenantType' || nameEn == 'juridicalPersonIdType' || nameEn == 'institutionType') {
return typeMap.value[nameEn].find((c: any) => c.value == scope.row.after)?.label || '--';
} else if (nameEn == 'industry') {
return industryList.value.find((c: any) => c.value == scope.row.after)?.label || '--';
} else if (nameEn == 'industrySmallcode') {
let getChildLabel = (children) => {
for (const child of children) {
if (child.value == scope.row.after) {
return child.label;
}
let label = getChildLabel(child.childDictList || []);
if (label) {
return label;
}
}
}
return scope.row.after && getChildLabel(industryList.value) || [];
} else {
return scope.row.after || '--';
}
}
});
}
// 设置表格合并下标
const getMergeRow = () => {
mergeRowCount.value = JSON.parse(JSON.stringify(rowCount));
let list = tableData.value;
for (var i = 0; i < list.length; i++) {
if (i === 0) {
//第一个数据 默认合并1行,开始位置下标默认为0
for (var m in mergeRowCount.value) {
mergeRowCount.value[m].rowspan.push(1);
mergeRowCount.value[m].index = 0;
}
} else {
// 根据拥有子级数量进行合并
for (var m in mergeRowCount.value) {
let mergeRow = mergeRowCount.value[m];
if (list[i][m] && list[i][m] === list[i - 1][m]) {
mergeRow.rowspan[mergeRow.index] += 1;
mergeRow.rowspan.push(0);
} else {
mergeRow.rowspan.push(1);
mergeRow.index = i;
}
}
}
}
}
// 表格行合并
const tableSpanMethod = ({ row, column, rowIndex, columnIndex }) => {
if (columnIndex === 0) {
const mergeInfo = mergeRowCount.value.name;
const rowspan = mergeInfo.rowspan[rowIndex];
if (rowspan > 0) {
return {
rowspan,
colspan: 1,
};
} else {
return {
rowspan: 0,
colspan: 0,
};
}
}
}
const toPath = () => {
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
assetStore.set(true);
router.push({ name: 'certificationAudit' })
}
const btnClick = async (btn, bType = null) => {
const type = btn.value;
if (type === 'pass') {
if (tName == '非认证会员') {
myLastNode({ deploymentId: deploymentId.value, processInstanceId: processInstanceId.value, staffGuid: userData.staffGuid }).then((res: any) => {
if (res?.code == proxy.$passCode) {
isLastNode.value = res.data;
passDialogInfo.value.visible = true;
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
ElMessage.error('流程信息获取失败!');
});
} else {
passDialogInfo.value.visible = true;
}
} else if (type == 'reject') {
rejectDialogInfo.value.visible = true;
} else if (type == 'cancel') {
toPath();
}
}
const passDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "通过",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-pass-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请确认该企业是否签署合同,如果是才能进行通过,请知晓!(非必填)",
field: "approveSuggest",
clearable: true,
block: true,
col: 'margin_b_0',
}
]
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const passDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
passDialogInfo.value.footer.btns[1].loading = true;
let params = {
guid: flowDetail.value.approveVO.approveGuid,
flowType: fType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid,
}
passFlowData(params).then((res: any) => {
passDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success(isLastNode.value ? '正在生成数据,需要3分钟左右,请耐心等待!' : '审批成功');
passDialogInfo.value.visible = false;
if (fType == '10014') {
promiseList(() => getDetail(), () => getChangeDetail());
} else {
promiseList(() => getDetail());
}
approvalProcessRef.value?.renderProcessNodes();
} else {
ElMessage.error('审批失败');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
passDialogInfo.value.footer.btns[1].loading = false;
});
} else if (btn.value == 'cancel') {
passDialogInfo.value.visible = false;
}
};
const rejectDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "驳回",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-reject-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请填写驳回理由(必填)",
field: "approveSuggest",
clearable: true,
block: true,
col: 'margin_b_0',
}
],
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const rejectDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
if (info.approveSuggest == '') {
ElMessage.error('请填写驳回理由');
return
}
rejectDialogInfo.value.footer.btns[1].loading = true;
let params = {
guid: flowDetail.value.approveVO.approveGuid,
flowType: fType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid,
}
rejectFlowData(params).then((res: any) => {
rejectDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('驳回成功');
rejectDialogInfo.value.visible = false;
if (fType == '10014') {
promiseList(() => getDetail(), () => getChangeDetail());
} else {
promiseList(() => getDetail());
}
approvalProcessRef.value?.renderProcessNodes();
} else {
ElMessage.error('驳回失败');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
rejectDialogInfo.value.footer.btns[1].loading = false;
});
} else if (btn.value == 'cancel') {
rejectDialogInfo.value.visible = false;
}
};
onActivated(() => {
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === router.currentRoute.value.fullPath);
if (tab) {
tab.meta.title = `详情-${route.query.name || ''}`;
}
})
onBeforeMount(() => {
if (fType == '10014') {
promiseList(
() => getDataType('机构类型', 'tenantType'),
() => getDataType('证件类型', 'juridicalPersonIdType'),
() => getDataType('组织机构性质', 'institutionType'),
() => getDetail(),
() => getChangeDetail()
)
} else {
promiseList(
() => getDataType('机构类型', 'tenantType'),
() => getDataType('证件类型', 'juridicalPersonIdType'),
() => getDataType('组织机构性质', 'institutionType'),
() => getDetail(),
)
}
getParamsList({ dictType: '行业分类' }).then((res: any) => {
if (res?.code == proxy.$passCode) {
industryList.value = res.data || [];
let index = contentFormItems.value.findIndex(item => item.field == 'industry');
let item = contentFormItems.value[index];
item.options = industryList.value;
contentFormItems.value[index + 1].options = !item.default ? [] : industryList.value.find(i => i.value == item.default)?.childDictList || [];
} else {
res?.msg && proxy.$ElMessage.error(res?.msg);
}
})
})
const orgTableRef = ref();
const orgData: any = ref([]);
/** 领域的字典列表 */
const domainList: any = ref([]);
/** 被授权资源信息的表格配置 */
const orgTableInfo = ref({
id: "org-table",
height: '214px',
fields: [
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "领域名称", field: "domainIdName", width: 160, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "授权协议号", field: "authId", width: 180, required: true, columClass: 'edit-colum', type: 'edit' },
{
label: "协议日期", field: "domainTimeRange", width: 200, getName: (scope) => {
return (scope.row.domainStartTime ? Moment(scope.row.domainStartTime).format('YYYY-MM-DD') : '--') + '至' + (scope.row.domainStartTime ? Moment(scope.row.domainEndTime).format('YYYY-MM-DD') : '--');
}
},
{ label: "协议签订时间", field: "domainSignTime", width: 180, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "协议签订人", field: "signee", width: 150, required: true, columClass: 'edit-colum', type: 'edit' },
{ label: "协议状态", field: "domainStatusName", width: 140, required: true, columClass: 'edit-colum', type: 'edit' },
],
STATUS: '',
data: orgData.value,
showPage: false,
actionInfo: {
show: false,
},
loading: false
});
const uploadFormRef = ref();
/** 开发主体附件信息 */
const uploadFormItems: any = ref([]);
const uploadFormRules = ref({});
/** 开发主体附件类型的字典 */
const uploadFileList: any = ref([]);
// 查看凭证证书
const viewVoucherFile = () => {
const url = flowDetail.value.trustedIdentityCredential;
if (!url) {
return;
}
onUploadFilePreview(url);
}
</script>
<template>
<div class="container_wrap full" v-loading="loading">
<div class="content_main panel">
<div
v-if="detailType == 'detail' && (flowDetail.crossPlatformApproveState == 'R' || flowDetail.crossPlatformApproveState == 'E')"
:class="['panel_wrap', 'results_panel', 'reject']">
<div class="panel_header">
<div class="header_title" v-if="flowDetail.crossPlatformApproveState == 'R'">
<el-icon class="title-icon">
<CircleCloseFilled />
</el-icon>
<span class="title_text">主平台审批已驳回,请在列表页面查看具体驳回原因</span>
</div>
<div class="header_title" v-else-if="flowDetail.crossPlatformApproveState == 'E'">
<el-icon class="title-icon">
<CircleCloseFilled />
</el-icon>
<span class="title_text">主平台审批发起失败,请在列表页面查看具体发起失败原因</span>
</div>
</div>
</div>
<ContentWrap title="企业信息" expandSwicth style="margin-top: 15px" :isExpand="expand1" @expand="(v) => expand1 = v"
description="备注:与平台运营签订相关的合同后才能进行认证,避免认证不成功,请知晓!">
<div class="form_panel">
<Form ref="companyFormRef" formId="company-form" :itemList="companyForm.items" :rules="companyForm.rules"
col="col3" />
</div>
</ContentWrap>
<ContentWrap title="法人信息" expandSwicth style="margin-top: 15px" :isExpand="expand2" @expand="(v) => expand2 = v">
<Form ref="corporateFormRef" formId="corporate-form" :itemList="corporateForm.items"
:rules="corporateForm.rules" col="col3" />
</ContentWrap>
<ContentWrap title="管理员(经办人)信息" expandSwicth style="margin-top: 15px" :isExpand="expand3"
@expand="(v) => expand3 = v">
<div class="form_panel">
<Form ref="accountFormRef" formId="account-form" :itemList="accountForm.items" :rules="accountForm.rules"
col="col3" />
</div>
</ContentWrap>
<ContentWrap title="协议签署" expandSwicth style="margin-top: 15px" :isExpand="expand4" @expand="(v) => expand4 = v">
<div class="form_panel">
<Form ref="contractFormRef" formId="contract-form" :itemList="contractForm.items" :rules="contractForm.rules"
col="col3" />
</div>
</ContentWrap>
<ContentWrap title="开发主体领域信息" expandSwicth style="margin-top: 15px" :isExpand="expand7"
@expand="(v) => expand7 = v">
<Table ref="orgsTableRef" :tableInfo="orgTableInfo" class="fiveRow-table" />
</ContentWrap>
<ContentWrap id="id-files" title="开发主体附件信息" description="" expandSwicth style="margin-top: 15px"
:isExpand="uploadInfoExpand" @expand="(v) => uploadInfoExpand = v">
<Form class='uploadForm' ref="uploadFormRef" :itemList="uploadFormItems" formId="upload-form"
:rules="uploadFormRules" col="col2" />
</ContentWrap>
<ContentWrap title="历史变更信息" expandSwicth style="margin-top: 15px" :isExpand="expand5"
@expand="(v) => expand4 = v">
<div class="table_panel" :class="{ full: tableData.length > 0 }">
<el-table border :data="tableData" :span-method="tableSpanMethod" tooltip-effect="light" style="height: 100%;"
v-if="tableData.length > 0">
<el-table-column v-for="(item, i) in tableField" :key="'r_' + i" :label="item.label" :width="item.width"
:min-width="item.minWidth" :fixed="item.fixed" :align="item.align" :sortable="item.sortable ?? false"
:prop="item.field" :class-name="item.columClass" show-overflow-tooltip>
<template #default="scope">
<span>
{{ item.getName ? item.getName(scope) : scope.row[item.field] !== 0 && !scope.row[item.field] ?
"--" : scope.row[item.field] }}
</span>
</template>
</el-table-column>
</el-table>
<div class="empty_tips" v-else>暂无变更信息</div>
</div>
</ContentWrap>
<ContentWrap title="认证结果信息" v-if="approveState == 'Y'" expandSwicth style="margin-top: 15px" :isExpand="expandResult"
@expand="(v) => expandResult = v">
<div class="list_panel">
<div class="list_item">
<span class="item_label">认证时间:</span>
<span class="item_value">{{ flowDetail.credentialTime || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">身份认证凭证:</span>
<span v-if="flowDetail.trustedIdentityCredential" class="item_value link" @click="viewVoucherFile">查看</span>
<span v-else class="item_value">--</span>
</div>
</div>
</ContentWrap>
<ContentWrap id="id-approveInfo" title="审核信息" expandSwicth style="margin-top: 15px" :isExpand="expand6"
@expand="(v) => expand6 = v">
<ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId"
:processInstanceId="processInstanceId">
</ApprovalProcess>
</ContentWrap>
</div>
<div class="tool_btns">
<div class="btns">
<el-button @click="btnClick({ value: 'cancel' })" v-if="detailType == 'detail'">关闭</el-button>
<el-button @click="btnClick({ value: 'cancel' })" v-else>取消</el-button>
<el-button type="primary" @click="btnClick({ value: 'pass' })"
v-if="approveState == 'A' && flowState == 2">通过</el-button>
<el-button type="danger" plain @click="btnClick({ value: 'reject' })"
v-if="approveState == 'A' && flowState == 2">驳回</el-button>
</div>
</div>
<Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
<Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
</div>
</template>
<style scoped lang="scss">
.container_wrap {
overflow: hidden;
.content_main {
height: calc(100% - 45px);
overflow: hidden auto;
&.panel {
padding: 0 16px 16px;
}
&.full {
height: 100%;
}
.template_panel {
display: flex;
flex-wrap: wrap;
padding: 16px 16px 8px;
.title_item {
display: flex;
margin-bottom: 8px;
+.title_item {
margin-left: 40px;
}
.title_label {
display: block;
width: 80px;
line-height: 1.5;
}
.title_text {
line-height: 1.5;
}
&.is_block {
width: 100%;
margin-left: 0;
.title_text {
display: block;
width: calc(100% - 80px);
text-align: justify;
}
}
}
}
.panel_content {
height: 100%;
display: flex;
flex: 1;
border-top: 1px solid #d9d9d9;
.box_left {
width: 200px;
height: 100%;
border-right: 1px solid #d9d9d9;
.aside_title {
padding: 0 8px;
height: 40px;
line-height: 40px;
font-size: 14px;
color: #212121;
font-weight: 600;
}
.tree_panel {
height: 100%;
}
}
.box_right {
width: calc(100% - 200px);
padding-top: 8px;
.el-breadcrumb {
padding: 0 12px;
line-height: 40px;
}
}
}
.table_panel_wrap {
width: 100%;
height: 100%;
padding: 0 12px;
&.full {
padding: 0;
}
}
:deep(.el-card) {
.el-form {
.el-form-item {
.el-form-item__error {
height: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&.error_auto {
.el-form-item__error {
width: 220px;
}
}
}
}
.table_panel {
height: auto;
&.full {
height: 212px;
}
}
}
.panel_wrap.results_panel {
box-shadow: 0 0 0 1px #d9d9d9;
margin-bottom: 16px;
margin-top: 16px;
.panel_header {
.header_title {
height: 40px;
padding: 0 16px;
display: flex;
align-items: center;
background-color: transparent;
box-shadow: none;
.el-icon {
margin-right: 8px;
width: 20px;
height: 20px;
svg {
width: 100%;
height: 100%;
}
}
}
.title_text {
line-height: 22px;
font-size: 14px;
color: var(--el-color-regular);
font-weight: 600;
display: flex;
align-items: center;
.title_icon {
width: 26px;
height: 21px;
margin-right: 4px;
cursor: pointer;
&.active {
transform: rotate(90deg);
}
}
}
}
&.reject {
background-color: #FDF2F4;
box-shadow: 0 0 0 1px #E63E33;
.panel_header {
.header_title {
.el-icon {
color: #E63E33;
}
}
}
}
}
}
.tool_btns {
height: 44px;
margin: 0 -8px;
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid #d9d9d9;
}
}
.title {
color: #212121;
font-size: 14px;
line-height: 32px;
font-weight: 600;
}
.list_panel {
display: flex;
flex-wrap: wrap;
display: flex;
align-items: center;
.list_item {
width: 33.33%;
line-height: 32px;
font-size: 14px;
color: var(--el-text-color-regular);
display: flex;
justify-content: space-between;
min-width: 120px;
.item_label {
text-align: left;
}
.item_value {
color: var(--el-color-regular);
padding: 0 4px;
flex: 1;
text-align: justify;
min-width: 0;
}
&.is_block {
width: 100%;
.item_value {
white-space: pre-wrap;
}
}
}
}
</style>
<route lang="yaml">
name: settleDetail
</route>
<script lang="ts" setup name="settleDetail">
import useUserStore from "@/store/modules/user";
import { passFlowData, rejectFlowData, revokeFlowData } from "@/api/modules/workFlowService";
import {
getConnectorDetail,
assessMethodList
} from "@/api/modules/dataRequire";
import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common';
import { ElMessage, ElMessageBox } from "element-plus";
import useDataConnectorStore from '@/store/modules/dataConnector';
import { CircleCloseFilled } from '@element-plus/icons-vue'
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const route = useRoute();
const userStore = useUserStore();
const userData = JSON.parse(localStorage.userData);
const fullscreenloading = ref(false);
const flowDetail: any = ref({});
const expand1 = ref(true);
const expand2 = ref(true);
const expand3 = ref(true);
const expandApprove = ref(true);
const expandCert = ref(true);
const approvalProcessRef = ref();
const deploymentId = ref('');
const processInstanceId = ref('');
const fullPath = route.fullPath;
const guid = route.query.guid;
const dataConnectorStore = useDataConnectorStore();
const toolBtns: any = computed(() => {
let btnsArr: any = [{
label: "关闭", value: "cancel", plain: true
}];
let approveVO = flowDetail.value.approveVO;
let staffGuid = userData.staffGuid;
if (approveVO && approveVO.approveState == 'A' && approveVO.approveStaffGuids && approveVO.approveStaffGuids.indexOf(staffGuid) > -1) {
btnsArr.push(...[{ label: "通过", value: "pass", type: 'primary' }, { label: "驳回", value: "reject", type: 'danger', plain: true }]);
}
if (approveVO && approveVO.approveState == 'A' && approveVO.staffGuid == staffGuid) {
btnsArr.push({ label: "撤销", value: "revoke" });
}
return btnsArr;
});
const btnClick = async (btn, bType = null) => {
const type = btn.value;
if (type === 'pass') {
passDialogInfo.value.visible = true;
} else if (type == 'reject') {
rejectDialogInfo.value.visible = true;
} else if (type == 'cancel') {
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
router.push({ name: 'settleManagement' });
updateDetailStatus.value && dataConnectorStore.set(true);
} else if (type == 'revoke') {
ElMessageBox.confirm('确定撤销该连接器审批流程吗?', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: 'warning',
}).then(() => {
let params = {
guid: flowDetail.value.approveVO.approveGuid,
flowType: flowDetail.value.approveVO.flowType,
approveStaffGuid: userData.staffGuid,
}
revokeFlowData(params, flowDetail.value.tenantGuid).then((res: any) => {
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('该审批流程撤销成功!');
getDetail();
updateDetailStatus.value = true;
approvalProcessRef.value?.renderProcessNodes();
} else {
ElMessage.error('该审批流程撤销失败!');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
});
}).catch(() => {
ElMessage.info('已取消撤销');
});
}
}
const passDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "通过",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-pass-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请填写通过理由(非必填)",
field: "approveSuggest",
clearable: true,
block: true,
col: 'margin_b_0',
}
]
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const passDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
passDialogInfo.value.footer.btns[1].loading = true;
let params = {
guid: flowDetail.value.approveVO.approveGuid,
flowType: flowDetail.value.approveVO.flowType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid,
}
passFlowData(params).then((res: any) => {
passDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
passDialogInfo.value.visible = false;
getDetail();
updateDetailStatus.value = true;
approvalProcessRef.value?.renderProcessNodes();
} else {
proxy.$ElMessage.error('审批失败');
}
} else {
proxy.$ElMessage.error(res.msg);
}
}).catch(() => {
passDialogInfo.value.footer.btns[1].loading = false;
});
} else if (btn.value == 'cancel') {
passDialogInfo.value.visible = false;
}
};
const rejectDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "驳回",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-reject-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请填写驳回理由(必填)",
field: "approveSuggest",
clearable: true,
block: true,
col: 'margin_b_0',
}
],
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const rejectDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
if (info.approveSuggest == '') {
proxy.$ElMessage.error('请填写驳回理由');
return
}
rejectDialogInfo.value.footer.btns[1].loading = true;
let params = {
guid: flowDetail.value.approveVO.approveGuid,
flowType: flowDetail.value.approveVO.flowType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid,
}
rejectFlowData(params).then((res: any) => {
rejectDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
proxy.$ElMessage.success('驳回成功');
rejectDialogInfo.value.visible = false;
getDetail();
updateDetailStatus.value = true;
approvalProcessRef.value?.renderProcessNodes();
} else {
proxy.$ElMessage.error('驳回失败');
}
} else {
proxy.$ElMessage.error(res.msg);
}
}).catch(() => {
rejectDialogInfo.value.footer.btns[1].loading = false;
});
} else if (btn.value == 'cancel') {
rejectDialogInfo.value.visible = false;
}
};
const viewVoucherFile = () => {
const url = flowDetail.value.trustedIdentityCredential;
if (!url) {
return;
}
onUploadFilePreview(url);
}
/** 查看连接器身份凭证证书 */
const viewResultVoucherFile = () => {
const url = flowDetail.value.trustedIdentityCredential;
if (!url) {
proxy.$ElMessage.error('暂无可查看的身份凭证证书');
return;
}
onUploadFilePreview(url);
}
/** 调用更新详情状态,关闭之后,需要重新刷新列表 */
const updateDetailStatus = ref(false);
const getDetail = () => {
fullscreenloading.value = true;
getConnectorDetail(guid).then((res: any) => {
fullscreenloading.value = false;
if (res?.code == proxy.$passCode) {
flowDetail.value = res.data || {};
flowDetail.value.accessMethodName = assessMethodList.find(a => a.value == flowDetail.value.accessMethod)?.label;
deploymentId.value = res.data.approveVO.camundaDeploymentId
processInstanceId.value = res.data.approveVO.camundaInstanceId
flowDetail.value.tdsConnectorVerifiable.thirdPartyCertification = [];
} else {
proxy.$ElMessage.error(res.msg);
}
}).catch(() => {
fullscreenloading.value = false;
})
}
onBeforeMount(() => {
getDetail();
})
const fileKeyNames = ref({
networkAccessQualification: '网络接入资质认证',
levelProtectionEvaluationResults: '等级保护(等保 2.0)测评结果',
levelProtectionEvaluationExpirationTime: '等级保护(等保 2.0)测评有效期至',
networkSecurityFilingCertificate: '网络安全产品备案证明',
encryptionModuleAuthentication: '加密模块认证',
softwareScmStatemen: '软件供应链合规声明',
securityLoopholeRepairStatement: '安全漏洞修复声明',
communicationProtocolCompatibilityCertification: '通信协议兼容性认证',
teeCertification: '硬件可信执行环境(TEE)认证',
accessAuditReport: '接入行为审计合规报告',
thirdPartyCertification: '第三方认证声明'
});
</script>
<template>
<div class="container_wrap full" v-loading="fullscreenloading">
<div class="content_main panel">
<div v-if="flowDetail.crossPlatformApproveState == 'R' || flowDetail.crossPlatformApproveState == 'E'"
:class="['panel_wrap', 'results_panel', 'reject']">
<div class="panel_header">
<div class="header_title" v-if="flowDetail.crossPlatformApproveState == 'R'">
<el-icon class="title-icon">
<CircleCloseFilled />
</el-icon>
<span class="title_text">主平台审批已驳回,请在列表页面查看具体驳回原因</span>
</div>
<div class="header_title" v-else-if="flowDetail.crossPlatformApproveState == 'E'">
<el-icon class="title-icon">
<CircleCloseFilled />
</el-icon>
<span class="title_text">主平台审批发起失败,请在列表页面查看具体发起失败原因</span>
</div>
</div>
</div>
<ContentWrap title="连接器身份信息" expandSwicth style="margin-top: 15px" :isExpand="expand1"
@expand="(v) => expand1 = v">
<div class="list_panel">
<div class="list_item">
<span class="item_label">接入连接器名称:</span>
<span class="item_value"><ellipsis-tooltip :content="flowDetail.connectorName || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'connectorName'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">接入方式:</span>
<span class="item_value"><ellipsis-tooltip :content="flowDetail.accessMethodName || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'accessMethod'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">法人或其他组织名称:</span>
<span class="item_value"><ellipsis-tooltip :content="flowDetail.legalEntity || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'legalEntity'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">法人或其他组织统一社会信用代码:</span>
<span class="item_value"><ellipsis-tooltip :content="flowDetail.legalSocialCreditCode || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'legalSocialCreditCode'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">可信凭证颁发日期:</span>
<span class="item_value">{{ flowDetail.credentialTime || '--' }}</span>
</div>
<div class="list_item">
<span class="item_label">可信凭证证书:</span>
<span class="item_value link" @click="viewVoucherFile">查看</span>
</div>
<div class="list_item is_block">
<span class="item_label">IP地址列表:</span>
<span class="item_value">{{ flowDetail.ipAddressList?.join(',') || '--' }}</span>
</div>
<div class="list_item is_block">
<span class="item_label">域名信息:</span>
<span class="item_value">{{ flowDetail.domainList?.join(',') || '--' }}</span>
</div>
</div>
</ContentWrap>
<ContentWrap title="连接器附属信息" expandSwicth style="margin-top: 15px" :isExpand="expand2"
@expand="(v) => expand2 = v">
<div class="list_panel">
<div class="list_item">
<span class="item_label">供应商名称:</span>
<span class="item_value"><ellipsis-tooltip
:content="flowDetail.tdsConnectorAdditional?.supplierName || '--'" class-name="w100f mr8-i"
:refName="'tooltipOver' + 'supplierName'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">供应商统一社会信用代码:</span>
<span class="item_value"><ellipsis-tooltip
:content="flowDetail.tdsConnectorAdditional?.supplierCode || '--'" class-name="w100f mr8-i"
:refName="'tooltipOver' + 'supplierCode'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">连接器类型:</span>
<span class="item_value"><ellipsis-tooltip
:content="flowDetail.tdsConnectorAdditional?.connectorType == '0' ? '标准型' : '全功能型'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'connectorType'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">可信身份凭证签发单位:</span>
<span class="item_value"><ellipsis-tooltip
:content="flowDetail.tdsConnectorAdditional?.trustedIdentityCredentialUnit || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'identityIssuingUnit'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">产品SN号:</span>
<span class="item_value"><ellipsis-tooltip :content="flowDetail.tdsConnectorAdditional?.productSn || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'productSn'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">产品版本号:</span>
<span class="item_value"><ellipsis-tooltip
:content="flowDetail.tdsConnectorAdditional?.productVersion || '--'" class-name="w100f mr8-i"
:refName="'tooltipOver' + 'productVersion'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">设备MAC地址:</span>
<span class="item_value"><ellipsis-tooltip
:content="flowDetail.tdsConnectorAdditional?.deviceMacAddress || '--'" class-name="w100f mr8-i"
:refName="'tooltipOver' + 'deviceMacAddress'"></ellipsis-tooltip></span>
</div>
</div>
</ContentWrap>
<ContentWrap title="连接器可验信息" expandSwicth style="margin-top: 15px" :isExpand="expand3"
@expand="(v) => expand3 = v">
<div class="list_panel">
<template v-for="(field, index) in Object.keys(fileKeyNames || {})">
<div
v-if="field != 'levelProtectionEvaluationExpirationTime' && flowDetail.tdsConnectorVerifiable?.[field]?.length"
class="list_item isFile">
<span class="item_label" :style="{ width: 'auto', 'text-align': 'left' }">{{ fileKeyNames[field] }}</span>
<!-- <span v-if="!flowDetail.tdsConnectorVerifiable?.[field]?.length" class="item_value">{{ '--' }}</span> -->
<span v-for="(item) in (flowDetail.tdsConnectorVerifiable?.[field] || [])" class="item_value"
:style="{ 'padding-left': '0px' }">
<div class="file-operate">
<template
v-if="item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'xls' || item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'xlsx' || item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'csv'">
<img class="file-img" src="../../assets/images/excel.png" />
</template>
<template
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'doc' || item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'docx'">
<img class="file-img" src="../../assets/images/word.png" />
</template>
<template v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'zip'">
<img class="file-img" src="../../assets/images/zip.png" />
</template>
<template v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'rar'">
<img class="file-img" src="../../assets/images/RAR.png" />
</template>
<template v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'pdf'">
<img class="file-img" src="../../assets/images/PDF.png" />
</template>
<template v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'png'">
<img class="file-img" src="../../assets/images/png.png" />
</template>
<template
v-else-if="item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'jpeg'">
<img class="file-img" src="../../assets/images/jpg.png" />
</template>
<div class="file-name"><ellipsis-tooltip :content="item.name ?? ''" class-name="w100f"
refName="tooltipOver"></ellipsis-tooltip></div>
<div :style="{ right: '36px' }"
v-if="item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'pdf' || item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'png' || item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'jpg' || item.name.substring(item.name.lastIndexOf('.') + 1).toLowerCase() == 'jpeg'"
class="file-preview" @click="onUploadFilePreview(item)">查看</div>
<div :style="{ right: '0px' }" class="file-preview" @click="onUploadFileDownload(item)">下载</div>
</div>
</span>
</div>
<div v-if="field == 'levelProtectionEvaluationExpirationTime'" class="list_item isFile">
<span class="item_label" :style="{ width: 'auto', 'text-align': 'left' }">可信凭证颁发日期</span>
<span class="item_value">{{ flowDetail.tdsConnectorVerifiable?.[field] || '--' }}</span>
</div>
</template>
</div>
</ContentWrap>
<ContentWrap id="id-approveInfo" title="审核信息" expandSwicth style="margin-top: 15px" :isExpand="expandApprove"
@expand="(v) => expandApprove = v">
<ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId"
:processInstanceId="processInstanceId">
</ApprovalProcess>
</ContentWrap>
<ContentWrap v-if="flowDetail.connectorIdentity" title="连接器凭证信息" expandSwicth style="margin-top: 15px" :isExpand="expandCert"
@expand="(v) => expandCert = v">
<div class="list_panel">
<div class="list_item">
<span class="item_label">连接器唯一标识:</span>
<span class="item_value"><ellipsis-tooltip :content="flowDetail.connectorIdentity || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'connectorIdentity'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">可信凭证证书:</span>
<span class="item_value link" @click="viewResultVoucherFile">查看</span>
</div>
<div class="list_item">
<span class="item_label">可信凭证颁发日期:</span>
<span class="item_value ">{{ flowDetail.credentialTime || '--' }}</span>
</div>
</div>
</ContentWrap>
<ContentWrap id="id-approveInfo" title="审核信息" expandSwicth style="margin-top: 15px" :isExpand="expandApprove"
@expand="(v) => expandApprove = v">
<ApprovalProcess ref="approvalProcessRef" v-if="deploymentId" :deploymentId="deploymentId"
:processInstanceId="processInstanceId">
</ApprovalProcess>
</ContentWrap>
</div>
<div class="tool_btns">
<div class="btns">
<el-button v-for="btn in toolBtns" :type="btn.type" :plain="btn.plain" @click="btnClick(btn)">{{ btn.label
}}</el-button>
</div>
</div>
<Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
<Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
</div>
</template>
<style lang="scss" scoped>
.container_wrap {
overflow: hidden;
.content_main {
height: calc(100% - 45px);
overflow: hidden auto;
&.panel {
padding: 0 16px 16px;
}
&.full {
height: 100%;
}
}
.tool_btns {
height: 44px;
margin: 0 -8px;
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid #d9d9d9;
}
}
.list_panel {
display: flex;
flex-wrap: wrap;
display: flex;
align-items: center;
.list_item {
width: 33.33%;
line-height: 32px;
font-size: 14px;
color: var(--el-text-color-regular);
display: flex;
justify-content: space-between;
min-width: 120px;
.item_label {
text-align: left;
}
.item_value {
color: var(--el-color-regular);
padding: 0 4px;
flex: 1;
text-align: justify;
min-width: 0;
&.link {
color: var(--el-color-primary);
cursor: pointer;
}
}
&.is_block {
width: 100%;
.item_value {
white-space: pre-wrap;
word-wrap: break-word;
}
}
&.isFile {
width: 33%;
display: flex;
flex-direction: column;
justify-content: space-between;
.item_label {
width: 100px;
text-align: right;
flex-shrink: 0;
}
.item_value {
flex: 1 1 0%;
min-width: 100px;
white-space: pre-wrap;
}
}
.file-operate {
display: flex;
align-items: center;
position: relative;
.file-img {
width: 24px;
height: 24px;
}
&:hover {
background-color: #f5f5f5;
}
.file-name {
width: calc(100% - 120px);
color: var(--el-color-regular);
margin-left: 4px;
}
.file-preview {
position: absolute;
cursor: pointer;
color: var(--el-color-primary);
margin-right: 8px;
}
}
}
}
.panel_wrap {
.panel_header {
.header_title {
height: 40px;
padding: 0 16px;
background-color: #fafafa;
box-shadow: 0 0 0 1px #e5e5e5;
display: flex;
align-items: center;
}
.title_text {
line-height: 22px;
font-size: 14px;
color: var(--el-color-regular);
font-weight: 600;
display: flex;
align-items: center;
.title_icon {
width: 26px;
height: 21px;
margin-right: 4px;
cursor: pointer;
&.active {
transform: rotate(90deg);
}
}
}
}
&.results_panel {
margin-top: 15px;
box-shadow: 0 0 0 1px #d9d9d9;
.panel_header {
.header_title {
background-color: transparent;
box-shadow: none;
.el-icon {
margin-right: 8px;
width: 20px;
height: 20px;
svg {
width: 100%;
height: 100%;
}
}
}
}
.panel_body {
padding-top: 0;
margin-top: 0;
box-shadow: none;
.results_list {
display: flex;
.list_item {
display: flex;
margin-bottom: 8px;
margin-right: 60px;
color: #666;
.item_value {
padding: 0 8px;
color: var(--el-color-regular);
}
}
}
}
&.reject {
background-color: #FDF2F4;
box-shadow: 0 0 0 1px #E63E33;
.panel_header {
.header_title {
.el-icon {
color: #E63E33;
}
}
}
}
}
}
</style>
\ No newline at end of file
<route lang="yaml">
name: settleManagement
</route>
<script lang="ts" setup name="settleManagement">
import { ref } from 'vue';
import TableTools from "@/components/Tools/table_tools.vue";
import {
getConnectorList,
assessMethodList,
deleteConnector,
checkConnector,
} from "@/api/modules/dataRequire";
import { ElMessage, ElMessageBox } from 'element-plus';
import { passFlowData, rejectFlowData, revokeFlowData } from "@/api/modules/workFlowService";
import DialogApproval from '@/components/ApprovalProcess/dialog_approval.vue';
import useDataConnectorStore from '@/store/modules/dataConnector';
const router = useRouter();
const route = useRoute();
const dataConnectorStore = useDataConnectorStore();
const userData = JSON.parse(localStorage.userData)
const tenantData = JSON.parse(localStorage.tenantInfo);
const { proxy } = getCurrentInstance() as any;
const searchItemList = ref([
{
type: "input",
label: "",
field: "connectorName",
default: "",
placeholder: "连接器名称",
maxlength: 50,
clearable: true,
},
{
type: 'select',
label: '',
field: 'approveState',
default: '',
placeholder: '审核状态',
options: [
{ label: '草稿中', value: 'N' },
{ label: '审批中', value: 'A' },
{ label: '已通过', value: 'Y' },
{ label: '已驳回', value: 'R' },
{ label: '已撤销', value: 'C' },
],
filterable: true,
clearable: true
}
]);
const systemApproveCurrentRowInfo: any = ref({})
const approvalDialogVisible = ref(false);
const handleApprovalDialogCancel = () => {
approvalDialogVisible.value = false;
}
const tableFields = ref([
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "连接器唯一标识", field: "connectorIdentity", width: 252, },
{ label: "连接器名称", field: "connectorName", width: 150 },
{
label: "接入方式", field: "accessMethod", width: 130, getName: (scope) => {
return scope.row.accessMethod && assessMethodList.find(a => a.value == scope.row.accessMethod)?.label || '--';
}
},
{
label: "审批状态", field: "approveVO", type: "tag", width: 96, align: 'center', getName: (scope) => {
const approveVO = scope.row.approveVO || {}
switch (approveVO.approveState) {
case 'N':
return '草稿中';
case 'A':
return '审批中';
case 'Y':
return '已通过';
case 'R':
return '已驳回';
case 'C':
return '已撤销';
case 'I':
return '--';
default:
return '草稿中';
}
}, tagType: (scope) => {
const approveVO = scope.row.approveVO || {}
switch (approveVO.approveState) {
case 'A':
return 'warning';
case 'Y':
return 'success';
case 'R':
return 'danger';
default:
return 'info';
}
}
},
// { label: "同步状态", field: "approveVO", type: "tag", },
// 专区才需要显示的
{
label: "主平台审批状态", field: "crossPlatformApproveState", type: "approveTagBtn", width: 170, align: 'center', btn: {
label: '查看', visible: (scope) => {
return scope.row.crossPlatformApproveState != null;
}, click: (scope) => {
systemApproveCurrentRowInfo.value = scope.row;
approvalDialogVisible.value = true;
}
}
},
{ label: "法人或其他组织", field: "legalEntity", width: 200 },
{ label: "修改人", field: "updateUserName", width: 130 },
{ label: "修改时间", field: "updateTime", width: 170 },
]);
const page = ref({
limit: 50,
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
],
connectorName: '',
approveState: ''
});
const currTableData: any = ref({});
const tableInfo = ref({
id: 'value-asset-table',
rowKey: 'guid',
loading: false,
fields: tableFields.value,
data: [],
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
label: "操作",
type: "btn",
width: 180,
btns: (scope) => {
let row = scope.row;
return getTableBtns(row);
}
}
});
const getTableBtns = (row, includeDetail = true) => {
let btnsArr: any[] = [];
const approveVO = row.approveVO;
const currentStaffGuid = userData.staffGuid
const bizApproveState = row.bizApproveState;
const approveState = approveVO?.approveState || 'N';
const approveStaffGuids = approveVO?.approveStaffGuids || [];
const staffGuid = approveVO?.staffGuid || '';
let isShowCancel = false;
let flowState;
if (approveState == 'N') {
flowState = 1;
}
if (approveState == 'A' && approveStaffGuids.indexOf(currentStaffGuid) > -1) {
flowState = 2;
}
if ((approveState == 'C' || approveState == 'R') && staffGuid == currentStaffGuid) {
flowState = 3;
}
if (approveVO && approveVO.approveState == 'A' && staffGuid == currentStaffGuid) {
isShowCancel = true;
}
if (flowState === 1) {
btnsArr = [{ label: "编辑", value: "edit" }, { label: "删除", value: "delete" }]
} else {
btnsArr.push({ label: "详情", value: "detail" })
if (flowState === 2) {
btnsArr.push(...[{ label: "通过", value: "pass" }, { label: "驳回", value: "reject" }])
} else if (flowState === 3) {
if (bizApproveState != 'D') {
btnsArr.push({ label: "重新提交", value: "edit" })
}
}
isShowCancel && btnsArr.push({ label: "撤销", value: "revoke" })
flowState === 3 && btnsArr.push({ label: "删除", value: "delete" })
}
return btnsArr
}
const toSearch = (val: any, clear: boolean = false) => {
if (clear) {
searchItemList.value.map((item) => (item.default = ""));
page.value.connectorName = '';
page.value.approveState = "";
} else {
page.value.connectorName = val.connectorName;
page.value.approveState = val.approveState;
}
getTableData();
updateCheckConnector();
};
const getTableData = () => {
tableInfo.value.loading = true
getConnectorList({
pageIndex: page.value.curr,
pageSize: page.value.limit,
connectorName: page.value.connectorName,
approveState: page.value.approveState,
currentStaffGuid: userData.staffGuid
}).then((res: any) => {
if (res?.code == proxy.$passCode) {
const data = res.data || {}
tableInfo.value.data = data.records || []
tableInfo.value.page.limit = data.pageSize
tableInfo.value.page.curr = data.pageIndex
tableInfo.value.page.rows = data.totalRows
} else {
proxy.$ElMessage({
type: 'error',
message: res.msg,
})
}
tableInfo.value.loading = false
}).catch(() => {
tableInfo.value.loading = false
})
};
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
currTableData.value = row;
if (type === "edit") { //草稿中\已驳回\已撤销\已通过 状态,才可以编辑。
router.push({
name: 'settleStart',
query: {
guid: row.guid,
name: row.connectorName
}
});
} else if (type == "delete") {
proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => {
let guids = [scope.row.guid];
deleteConnector(guids).then((res: any) => {
if (res?.code == proxy.$passCode) {
page.value.curr = 1;
getTableData();
proxy.$ElMessage.success('删除成功');
updateCheckConnector();
} else {
proxy.$ElMessage.error(res.msg);
}
});
})
} else if (type === 'revoke') { // 撤销,状态为审批中时可以撤销。
ElMessageBox.confirm('确定撤销该连接器审批流程吗?', "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: 'warning',
}).then(() => {
let params = {
guid: row.approveVO.approveGuid,
flowType: row.approveVO.flowType,
approveStaffGuid: userData.staffGuid,
}
revokeFlowData(params, currTableData.value.tenantGuid).then((res: any) => {
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('该审批流程撤销成功!');
getTableData();
updateCheckConnector();
} else {
ElMessage.error('该审批流程撤销失败!');
}
} else {
ElMessage.error(res.msg);
}
});
}).catch(() => {
ElMessage.info('已取消撤销');
});
} else if (type === 'detail') { // 详情, 若是草稿中,详情就是编辑,
router.push({
name: 'settleDetail',
query: {
guid: row.guid,
name: row.connectorName
}
});
} else if (type === 'pass') {
passDialogInfo.value.visible = true;
} else if (type == 'reject') {
rejectDialogInfo.value.visible = true;
}
};
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
page.value.limit = Number(info.limit);
tableInfo.value.page.curr = page.value.curr;
tableInfo.value.page.limit = page.value.limit;
getTableData();
updateCheckConnector();
};
const newCreate = () => {
if (tenantData.isCertification != 'Y') {
proxy.$ElMessage.error('请先进行企业认证,再新增连接器');
return;
}
router.push({
name: 'settleStart'
});
}
const resubmit = () => {
router.push({
name: 'settleStart',
query: {
guid: hasConnectorInfo.value?.guid,
name: hasConnectorInfo.value?.connectorName,
isChange: 'Y'
}
});
}
onActivated(() => {
if (dataConnectorStore.isRefresh) {//如果是首次加载,则不需要调用
page.value.curr = 1;
getTableData();
dataConnectorStore.set(false);
updateCheckConnector();
}
})
const fullscreenloading = ref(false);
/** 该用户企业是否已经包含连接器 */
const hasConnectorInfo: any = ref({});
const updateCheckConnector = () => {
fullscreenloading.value = true;
checkConnector().then((res: any) => {
fullscreenloading.value = false;
if (res?.code == proxy.$passCode) {
hasConnectorInfo.value = res.data || {};
} else {
proxy.$ElMessage({
type: 'error',
message: res.msg,
})
}
}).catch(() => {
fullscreenloading.value = false;
})
}
onBeforeMount(() => {
toSearch({});
updateCheckConnector();
})
const passDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "通过",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-pass-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请填写通过理由(非必填)",
field: "approveSuggest",
clearable: true,
block: true,
col: 'margin_b_0',
}
]
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const passDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
passDialogInfo.value.footer.btns[1].loading = true;
let params = {
guid: currTableData.value.approveVO.approveGuid,
flowType: currTableData.value.approveVO.flowType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid,
}
passFlowData(params, currTableData.value.tenantGuid).then((res: any) => {
passDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('审批成功');
passDialogInfo.value.visible = false;
getTableData();
updateCheckConnector();
} else {
ElMessage.error('审批失败');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
passDialogInfo.value.footer.btns[1].loading = false;
});
} else if (btn.value == 'cancel') {
passDialogInfo.value.visible = false;
}
};
const rejectDialogInfo = ref({
visible: false,
size: 460,
direction: "column",
header: {
title: "驳回",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'batch-reject-form',
items: [
{
label: '',
type: "textarea",
placeholder: "请填写驳回理由(必填)",
field: "approveSuggest",
clearable: true,
block: true,
col: 'margin_b_0',
}
],
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const rejectDialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
if (info.approveSuggest == '') {
ElMessage.error('请填写驳回理由');
return
}
rejectDialogInfo.value.footer.btns[1].loading = true;
let params = {
guid: currTableData.value.approveVO.approveGuid,
flowType: currTableData.value.approveVO.flowType,
approveSuggest: info.approveSuggest,
approveStaffGuid: userData.staffGuid,
}
rejectFlowData(params, currTableData.value.tenantGuid).then((res: any) => {
rejectDialogInfo.value.footer.btns[1].loading = false;
if (res?.code == proxy.$passCode) {
if (res.data) {
ElMessage.success('驳回成功');
rejectDialogInfo.value.visible = false;
getTableData();
updateCheckConnector();
} else {
ElMessage.error('驳回失败');
}
} else {
ElMessage.error(res.msg);
}
}).catch(() => {
rejectDialogInfo.value.footer.btns[1].loading = false;
});
} else if (btn.value == 'cancel') {
rejectDialogInfo.value.visible = false;
}
};
</script>
<template>
<div class="container_wrap" v-loading="fullscreenloading">
<div class="table_tool_wrap">
<TableTools :searchItems="searchItemList" :searchId="'settle-asset-search'" @search="toSearch" :init="false" />
<div class="tools_btns">
<!-- v-if="userData.superTubeFlag != 'Y'" TODO, 没有人认证过的不可以申请连接器,此处的条件还需要修改 -->
<el-button type="primary" :disabled="hasConnectorInfo?.bizApproveState == 'A' || hasConnectorInfo?.bizApproveState == 'Y' || hasConnectorInfo?.bizApproveState == 'B'" @click="newCreate">新增</el-button>
<!-- hasConnectorInfo?.crossPlatformApproveState == 'Y' 主平台不需要有这个判断条件但专区要有 -->
<el-button type="primary" v-show="hasConnectorInfo?.bizApproveState == 'Y'" @click="resubmit">变更</el-button>
</div>
</div>
<div class="table_panel_wrap"
:style="{ height: 'calc(100% - 88px)' /* userData.superTubeFlag != 'Y' ? 'calc(100% - 88px)' : 'calc(100% - 44px)'*/ }">
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
</div>
<Dialog :dialogInfo="passDialogInfo" @btnClick="passDialogBtnClick" />
<Dialog :dialogInfo="rejectDialogInfo" @btnClick="rejectDialogBtnClick" />
<DialogApproval :visible="approvalDialogVisible" :currentRowInfo="systemApproveCurrentRowInfo"
@dialog-cancel="handleApprovalDialogCancel"></DialogApproval>
</div>
</template>
<style lang="scss" scoped>
.container_wrap {
padding: 0px 16px;
}
</style>
\ No newline at end of file
<route lang="yaml">
name: settleStart
</route>
<script lang="ts" setup name="settleStart">
import useUserStore from "@/store/modules/user";
import { useValidator } from "@/hooks/useValidator";
import useDataConnectorStore from "@/store/modules/dataConnector";
import { getCamundaDeploymentId } from "@/api/modules/workFlowService";
import {
saveConnector,
updateConnector,
changeSaveConnector,
getConnectorDetail,
assessMethodList
} from "@/api/modules/dataRequire";
import { getEnterpriseData } from "@/api/modules/dataRequire";
import { onUploadFilePreview } from "@/api/modules/common";
const {
required,
isUSCCCode,
requiredFiles,
validateIPList,
validateDomainList,
} = useValidator();
const userStore = useUserStore();
const dataConnectorStore = useDataConnectorStore();
const userData = JSON.parse(userStore.userData);
const tenantData = JSON.parse(localStorage.tenantInfo);
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const route = useRoute();
const fullPath = route.fullPath;
const guid = route.query.guid;
const fullscreenLoading = ref(false);
const restart = ref(false);
/** 展开收起 */
const expandBase = ref(false);
const expandImpact = ref(false);
const expandValid = ref(false);
const approveInfoExpand = ref(false);
const deploymentId = ref("");
const processInstanceId = ref("");
/** 连接器身份信息表单配置 */
const baseInfoFormRef = ref();
const baseInfoFormItems = ref([
{
type: "input",
label: "连接器名称",
field: "connectorName",
default: "",
placeholder: "请输入",
maxlength: 50,
clearable: true,
required: true,
},
{
label: "接入方式",
type: "radio-group",
placeholder: "",
field: "accessMethod",
default: 1,
options: assessMethodList,
col: "col2 radio-left",
required: true,
},
{
type: "input",
label: "法人或其他组织名称",
field: "legalEntity",
default: "",
col: "mr8",
placeholder: "-",
clearable: true,
disabled: true,
required: false,
},
{
type: "input",
label: "法人或其他组织统一社会信用代码",
field: "legalSocialCreditCode",
default: "",
placeholder: "-",
clearable: true,
disabled: true,
required: false,
},
{
type: "input",
label: "可信凭证颁发日期",
field: "credentialTime",
default: "",
placeholder: "-",
clearable: true,
disabled: true,
required: false,
col: "width-left no-margin-r",
viewBtn: {
label: "查看可信身份凭证",
click: () => {
const url = logonUserDetailInfo.value.trustedIdentityCredential;
if (!url) {
return;
}
onUploadFilePreview(url);
},
},
},
{
type: "input",
label: "可信身份凭证url地址",
field: "trustedIdentityCredential",
default: "",
placeholder: "-",
clearable: true,
disabled: true,
visible: false,
required: false,
},
{
type: "input",
label: "IP地址列表",
field: "ipAddressList",
default: "",
placeholder: "支持以逗号,分隔的多地址配置,格式IPv4/IPv6",
clearable: true,
required: true,
block: true,
},
{
type: "input",
label: "域名信息",
field: "domainList",
default: "",
placeholder: "支持以逗号,分隔的多个域名配置",
clearable: true,
required: true,
block: true,
},
]);
const baseInfoFormRules = ref({
connectorName: [required("请填写连接器名称")],
accessMethod: [required("请选择接入方式")],
ipAddressList: [required("请填写IP地址列表"), validateIPList()], //TODO,校验IP地址和域名
domainList: [required("请填写域名信息"), validateDomainList()],
});
/** 连接器附属信息表单配置 */
const addInfoFormRef = ref();
const addInfoFormItems = ref([
{
type: "input",
label: "供应商名称",
field: "supplierName",
default: "",
placeholder: "请输入",
maxlength: 50,
clearable: true,
required: true,
},
{
type: "input",
label: "供应商统一社会信用代码",
field: "supplierCode",
default: "",
placeholder: "请输入",
maxlength: 50,
clearable: true,
required: true,
},
{
label: "连接器类型",
type: "radio-group",
placeholder: "",
field: "connectorType",
default: 0,
options: [
{
label: "标准型",
value: 0,
},
{
label: "全能型",
value: 1,
},
],
required: true,
},
{
type: "input",
label: "可信身份凭证签发单位",
field: "trustedIdentityCredentialUnit",
default: "",
placeholder: "-",
clearable: true,
disabled: true,
required: false,
},
{
type: "input",
label: "产品SN号",
field: "productSn",
default: "",
placeholder: "请输入出厂唯一SN号",
maxlength: 20,
clearable: true,
required: true,
},
{
type: "input",
label: "产品版本号",
field: "productVersion",
default: "",
placeholder: "请输入产品版本号,用于补丁管理和漏洞响应",
maxlength: 20,
clearable: true,
required: true,
},
{
type: "input",
label: "设备MAC地址",
field: "deviceMacAddress",
default: "",
placeholder: "物理设备唯一标识符(若有多台,只登记管理服务器mac地址)",
maxlength: 50,
clearable: true,
required: true,
},
]);
const addInfoFormRules = ref({
supplierName: [required("请填写供应商名称")],
supplierCode: [required('请填写供应商统一社会信用代码'), isUSCCCode()],
productSn: [required("请填写出厂唯一SN号")],
productVersion: [required("请填写产品版本号")],
deviceMacAddress: [required("请填写设备MAC地址")], //校验
});
/** 连接器身份可验证信息 */
const validInfoFormRef = ref();
const validInfoFormItems = ref([
{
label: "网络接入资质认证",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
required: false,
limitSize: 10,
default: [],
field: "networkAccessQualification",
tooltip: true,
tooltipContent: "如工信部核发的互联网接入服务许可、VPN 接入资质等",
},
{
label: "等级保护测评结果",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
required: true,
limitSize: 10,
default: [],
tooltip: true,
tooltipContent:
"具备国家网络安全等级保护测评资质,含系统/设备测评等级与有效期",
field: "levelProtectionEvaluationResults",
},
{
label: "等级保护测评有效期至",
type: "date",
field: "levelProtectionEvaluationExpirationTime",
default: null,
placeholder: "请选择",
clearable: true,
disabledDate: (date) => {
const today = new Date();
// 将 today 设置为 00:00:00,只比较日期部分(本地时间)
const todayStart = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate()
);
// 将 date 也转换为本地日期的开始时间(避免 UTC 问题)
const dateStart = new Date(
date.getFullYear(),
date.getMonth(),
date.getDate()
);
// 禁用 dateStart < todayStart 的日期(即今天之前)
return dateStart.getTime() < todayStart.getTime();
},
required: true,
},
{
label: "网络安全产品备案证明",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
required: false,
limitSize: 10,
default: [],
tooltip: true,
tooltipContent: "如国家网信办或公安机关备案的防火墙/网关产品登记信息",
field: "networkSecurityFilingCertificate",
},
{
label: "加密模块认证",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
limitSize: 10,
default: [],
tooltip: true,
tooltipContent: "如密码管理局颁发的SM系列算法模块认证书",
field: "encryptionModuleAuthentication",
},
{
label: "软件供应链合规声明",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
limitSize: 10,
default: [],
tooltip: true,
tooltipContent: "包含安全SBOM清单、安全更新机制合规性声明",
field: "softwareScmStatemen",
},
{
label: "安全漏洞修复声明",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
limitSize: 10,
default: [],
tooltip: true,
tooltipContent: "由供应商出具的修复已知漏洞的声明,附漏洞编号与修复记录",
field: "securityLoopholeRepairStatement",
},
{
label: "通信协议兼容性认证",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
limitSize: 10,
default: [],
tooltip: true,
tooltipContent: "如支持OIDC/SAML等跨平台协议的互操作性报告",
field: "communicationProtocolCompatibilityCertification",
},
{
label: "硬件可信执行环境(TEE)认证",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
limitSize: 10,
default: [],
tooltip: true,
tooltipContent: "具备可信启动、安全执行、物理隔离能力的设备认证",
field: "teeCertification",
},
{
label: "接入行为审计合规报告",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
limitSize: 10,
default: [],
tooltip: true,
tooltipContent: "具备行为记录留存、数据访问控制和审计能力的外部审计报告",
field: "accessAuditReport",
},
{
label: "第三方认证声明",
tip: "支持扩展名:pdf、png、jpg,单个文件不得大于10M",
type: "upload-file",
accept: ".pdf, .png, .jpg",
limitSize: 10,
default: [],
tooltip: true,
tooltipContent:
"如由行业联盟、CA 机构等出具的合规性、互操作性、性能认证等声明材料",
field: "thirdPartyCertification",
},
]);
const validInfoFormRules = ref({
//networkAccessQualification: [requiredFiles()],
levelProtectionEvaluationResults: [requiredFiles()],
levelProtectionEvaluationExpirationTime: [required("请选择有效期")],
//networkSecurityFilingCertificate: [requiredFiles()],
// encryptionModuleAuthentication: [requiredFiles()],
// softwareScmStatemen: [requiredFiles()],
// securityLoopholeRepairStatement: [requiredFiles()],
// communicationProtocolCompatibilityCertification: [requiredFiles()],
// accessAuditReport: [requiredFiles()],
// thirdPartyCertification: [requiredFiles()],
});
const cancel = () => {
proxy.$openMessageBox(
"当前页面尚未保存,确定放弃修改吗?",
() => {
userStore.setTabbar(
userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)
);
router.push({
name: "settleManagement",
});
},
() => {
proxy.$ElMessage.info("已取消");
}
);
};
const transferValueInfo = () => {
let params: any = {};
let baseInfo = baseInfoFormRef.value.formInline;
params = { ...baseInfo };
params.trustedIdentityCredential = logonUserDetailInfo.value.trustedIdentityCredential;
if (params.ipAddressList) {
params.ipAddressList = params.ipAddressList.split(",");
} else {
params.ipAddressList = [];
}
if (params.domainList) {
params.domainList = params.domainList.split(",");
} else {
params.domainList = [];
}
let addInfo = addInfoFormRef.value.formInline;
params.tdsConnectorAdditional = addInfo;
params.tdsConnectorAdditional.guid = connectorDetailInfo.value?.tdsConnectorAdditional?.guid;
let validInfo = validInfoFormRef.value.formInline;
let tdsConnectorVerifiable = {};
for (const key in validInfo) {
if (key == "levelProtectionEvaluationExpirationTime") {
tdsConnectorVerifiable[key] = validInfo[key];
} else {
tdsConnectorVerifiable[key] =
validInfo[key]?.map((v) => {
return {
name: v.name,
url: v.url,
};
}) || [];
}
}
params.tdsConnectorVerifiable = tdsConnectorVerifiable;
params.tdsConnectorVerifiable.guid = connectorDetailInfo.value?.tdsConnectorVerifiable?.guid;
return params;
}
const saveDraft = () => {
let params: any = transferValueInfo();
params.immediateApprove = false;
params.bizApproveState = "N";
fullscreenLoading.value = true;
if (!guid) {
saveConnector(params).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('保存成功');
userStore.setTabbar(
userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)
);
router.push({
name: "settleManagement",
});
dataConnectorStore.set(true);
} else {
proxy.$ElMessage.error(res.msg);
}
});
} else {
params.guid = guid;
updateConnector(params).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('保存成功');
userStore.setTabbar(
userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)
);
router.push({
name: "settleManagement",
});
dataConnectorStore.set(true);
} else {
proxy.$ElMessage.error(res.msg);
}
});
}
};
const submit = () => {
baseInfoFormRef.value.ruleFormRef.validate((valid1, errorItem1) => {
if (valid1) {
addInfoFormRef.value.ruleFormRef.validate((valid2, errorItem2) => {
if (valid2) {
validInfoFormRef.value.ruleFormRef.validate((valid3, errorItem3) => {
if (valid3) {
let params: any = transferValueInfo();
params.immediateApprove = true;
params.bizApproveState = 'A';
fullscreenLoading.value = true;
if (route.query.isChange == 'Y') {
params.sourceBizGuid = guid;
changeSaveConnector(params).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('提交成功');
userStore.setTabbar(
userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)
);
router.push({
name: "settleManagement",
});
dataConnectorStore.set(true);
} else {
proxy.$ElMessage.error(res.msg);
}
});
} else {
if (!guid) {
saveConnector(params).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('提交成功');
userStore.setTabbar(
userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)
);
router.push({
name: "settleManagement",
});
dataConnectorStore.set(true);
} else {
proxy.$ElMessage.error(res.msg);
}
});
} else {
params.guid = guid;
updateConnector(params).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
proxy.$ElMessage.success('提交成功');
userStore.setTabbar(
userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)
);
router.push({
name: "settleManagement",
});
dataConnectorStore.set(true);
} else {
proxy.$ElMessage.error(res.msg);
}
});
}
}
} else {
expandValid.value = true;
var obj = Object.keys(errorItem3);
validInfoFormRef.value.ruleFormRef.scrollToField(obj[0]);
}
});
} else {
expandImpact.value = true;
var obj = Object.keys(errorItem2);
addInfoFormRef.value.ruleFormRef.scrollToField(obj[0]);
validInfoFormRef.value.ruleFormRef.validate(() => { });
}
});
} else {
expandBase.value = true;
var obj = Object.keys(errorItem1);
baseInfoFormRef.value.ruleFormRef.scrollToField(obj[0]);
addInfoFormRef.value.ruleFormRef.validate(() => { });
validInfoFormRef.value.ruleFormRef.validate(() => { });
}
});
};
const logonUserDetailInfo: any = ref({});
const connectorDetailInfo: any = ref({});
onBeforeMount(() => {
if (!guid) {
getCamundaDeploymentId("10031", userData.tenantGuid, userData.staffGuid).then(
(res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
} else {
proxy.$ElMessage.error(res.msg);
}
}
);
fullscreenLoading.value = true;
getEnterpriseData({
logonUser: userData.tenantName == "非认证会员" ? userData.logonUser : tenantData.logonUser
}).then((res: any) => {
fullscreenLoading.value = false;
if (res?.code == proxy.$passCode) {
const data = res.data || {};
logonUserDetailInfo.value = data;
baseInfoFormItems.value.forEach((item) => {
if (item.field == "legalEntity") {
item.default = res.data["tenantName"] || "";
} else if (item.field == "legalSocialCreditCode") {
item.default = res.data["socialCreditCode"] || "";
} else if (item.field == 'credentialTime') {
item.default = data.credentialTime || '';
} else if (item.field == 'trustedIdentityCredential') {
item.default = data.trustedIdentityCredential || '';
}
});
let tenantItem = addInfoFormItems.value.find(item => item.field == "trustedIdentityCredentialUnit");
tenantItem && (tenantItem.default = data['trustedIdentityCredentialUnit']);
} else {
proxy.$ElMessage.error(res.msg);
}
});
} else {
fullscreenLoading.value = true;
let ps1 = getConnectorDetail(guid);
let ps2 = getEnterpriseData({
logonUser: userData.tenantName == "非认证会员" ? userData.logonUser : tenantData.logonUser
});
Promise.all([ps1, ps2]).then((res: any) => {
fullscreenLoading.value = false;
let res1 = res?.[0];
let res2 = res?.[1];
let logonUserDetail = logonUserDetailInfo.value = res2?.data || {};
if (res2?.code == proxy.$passCode) {
} else {
proxy.$ElMessage.error(res1.msg);
}
if (res1?.code == proxy.$passCode) {
let connectorDetail = connectorDetailInfo.value = res1?.data || {};
deploymentId.value = connectorDetail.approveVO?.camundaDeploymentId || '';
processInstanceId.value = connectorDetail.approveVO?.camundaInstanceId || '';
if (!deploymentId.value) {
getCamundaDeploymentId("10031", userData.tenantGuid, userData.staffGuid).then(
(res: any) => {
if (res.code == proxy.$passCode) {
deploymentId.value = res.data;
} else {
proxy.$ElMessage.error(res.msg);
}
}
);
}
let approveVO = connectorDetail.approveVO || {};
if ((approveVO.approveState == 'C' || approveVO.approveState == 'R') && approveVO.staffGuid == userData.staffGuid && connectorDetail.bizApproveState != 'D') {
restart.value = true;
}
baseInfoFormItems.value.forEach(item => {
if (item.field == "legalEntity") {
item.default = connectorDetail[item.field] || logonUserDetail["tenantName"] || "";
} else if (item.field == "legalSocialCreditCode") {
item.default = connectorDetail[item.field] || logonUserDetail["socialCreditCode"] || "";
} else if (item.field == 'credentialTime' || item.field == 'trustedIdentityCredential') {
item.default = connectorDetail[item.field] || logonUserDetail[item.field] || "";
} else if (item.field == 'ipAddressList' || item.field == 'domainList') {
item.default = connectorDetail[item.field]?.join(',') || '';
} else {
item.default = connectorDetail[item.field] || '';
}
});
addInfoFormItems.value.forEach(item => {
if (item.field == "trustedIdentityCredentialUnit") {
item.default = connectorDetail[item.field] || logonUserDetail['trustedIdentityCredentialUnit'] || '';
} else {
item.default = connectorDetail.tdsConnectorAdditional?.[item.field];
}
})
validInfoFormItems.value.forEach(item => {
if (item.field == 'levelProtectionEvaluationExpirationTime') {
item.default = connectorDetail.tdsConnectorVerifiable?.[item.field] || '';
} else {
item.default = connectorDetail.tdsConnectorVerifiable?.[item.field] || [];
}
});
} else {
proxy.$ElMessage.error(res1.msg);
}
}).catch(() => {
fullscreenLoading.value = false;
});
}
});
</script>
<template>
<div class="container_wrap full" v-loading="fullscreenLoading">
<div class="content_main panel">
<ContentWrap title="连接器身份信息" expandSwicth style="margin-top: 15px" :isExpand="expandBase"
@expand="(v) => (expandBase = v)" description="">
<Form ref="baseInfoFormRef" formId="base-info-form" :itemList="baseInfoFormItems" :rules="baseInfoFormRules"
col="col3" />
</ContentWrap>
<ContentWrap title="连接器附属信息" expandSwicth style="margin-top: 15px" :isExpand="expandImpact"
@expand="(v) => (expandImpact = v)" description="">
<Form ref="addInfoFormRef" formId="add-info-form" :itemList="addInfoFormItems" :rules="addInfoFormRules"
col="col3" />
</ContentWrap>
<ContentWrap title="连接器可验信息" expandSwicth style="margin-top: 15px" :isExpand="expandValid"
@expand="(v) => (expandValid = v)" description="">
<Form ref="validInfoFormRef" formId="valid-info-form" :itemList="validInfoFormItems" :rules="validInfoFormRules"
col="col3" />
</ContentWrap>
<ContentWrap id="id-approveInfo" title="审批信息" :isExpand="approveInfoExpand" expandSwicth style="margin-top: 15px"
@expand="(v) => (approveInfoExpand = v)">
<ApprovalProcess v-if="deploymentId" :deploymentId="deploymentId" :definitionId="''">
</ApprovalProcess>
</ContentWrap>
</div>
<div class="tool_btns">
<div class="btns">
<el-button @click="cancel">取消</el-button>
<el-button type="primary" v-if="!restart && route.query.isChange != 'Y'" @click="saveDraft">保存</el-button>
<el-button type="primary" @click="submit">提交</el-button>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.container_wrap {
overflow: hidden;
.content_main {
height: calc(100% - 45px);
overflow: hidden auto;
&.panel {
padding: 0 16px 16px;
}
}
}
.tool_btns {
height: 44px;
margin: 0 -8px;
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid #d9d9d9;
}
:deep(.el-form) {
.width-left {
width: calc(100% - 125px);
}
.el-form-item.col2.radio-left {
width: calc(66.6% - 12px);
}
}
:deep(.dialog-form-inline.col3) {
align-items: flex-start;
}
</style>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!