[update] 删除国标,外标,AddForm组件的特殊判断,外部标准库lang中多余部分

This commit is contained in:
lideqin
2024-06-21 15:36:40 +08:00
parent 54291d8f79
commit 10b7b40b55
14 changed files with 45 additions and 3628 deletions
@@ -2,6 +2,7 @@ module.exports = {
configStandard: 'Configuration standard', // 配置标准
removeStandard: 'Removal criteria', // 移出标准
nodeName: 'Node name', // 节点名称
nodeOrder: 'Node ordering', // 节点排序
configStandardNoTreeNode: 'Please select Level 2 and below system first', // 请先选择二级及以下体系
selectLeastOneTableData: 'Select at least one list data', // 选中至少一条列表数据
standardResolutionSheet: 'Standard resolution sheet', // 标准分解单
@@ -31,12 +32,6 @@ module.exports = {
exportZipName: 'Domestic standards (with documents)', // 国内标准法规(带文件)
templateName: 'Import templates for domestic standards' // 国内标准法规导入模板
},
standardDetail: {
standardNumber: 'Standard Number',
problemOccurrenceTime: 'Problem occurrence time',
respondent: 'Respondent',
problemDescription: 'Problem description'
},
// 动态消息
dynamicMessage: {
dynamicHeading: 'Dynamic heading',
@@ -51,9 +46,9 @@ module.exports = {
profileCenter: {
typeOfOwnership: 'Type of ownership',
uploadData: 'Upload data',
addAPeer: '新增同级',
newChild: '新增子级',
pleaseSelectTheDirectoryOnTheLeft: '请选择左侧目录'
addAPeer: 'Add a peer',
newChild: 'New child',
pleaseSelectTheDirectoryOnTheLeft: 'Please select the directory on the left'
},
// 市场法规清单
marketRegulationsList: {
@@ -69,7 +64,8 @@ module.exports = {
customName: '自定义名称',
securityClass: '密级',
listDeclaration: '清单说明',
templateName: '市场法规清单导入模版'
templateName: '市场法规清单导入模版',
historicalVersion: '历史版本'
},
// 市场清单详情列表字段
marketListField: {
@@ -91,4 +87,29 @@ module.exports = {
automaticDrivingLevel: '自动驾驶等级',
requirementType: '要求类型'
},
// 标准主计划
standardMasterPlan: {
standardNumber: '标准编号',
standardName: '标准名称',
standardStatus: '标准状态',
applicableMarket: '适用市场',
informationInput: '信息输入',
textStorage: '文本入库',
importNotification: '导入通知',
interpretationOfRegulations: '法规解读',
regulatoryPromotion: '法规宣贯',
marketRegulationListUpdate: '市场法规清单更新',
regulatoryComplianceInvestigation: '法规符合性排查',
generalDocumentRectificationPlan: '通用文件整改计划',
vehicleModelRectification: '车型整改',
isItRelatedTo: '是否涉及',
responsiblePerson: '责任人',
plannedCompletionDate: '计划完成日期',
actualFinishingDate: '实际完成日期',
deliverables: '交付物',
pcrNumber: 'PCR编号',
rectifyFinishingDate: '整改完成日期',
viewMarketList: '查看市场清单',
viewTroubleshootingResults: '查看排查结果'
}
}
@@ -2,6 +2,7 @@ module.exports = {
configStandard: '配置标准',
removeStandard: '移出标准',
nodeName: '节点名称',
nodeOrder: '节点排序',
configStandardNoTreeNode: '请先选择二级及以下体系',
selectLeastOneTableData: '选中至少一条列表数据',
standardResolutionSheet: '标准分解单',
@@ -31,12 +32,6 @@ module.exports = {
exportZipName: '国内标准(带文件)',
templateName: '国内标准导入模板'
},
standardDetail: {
standardNumber: '标准编号',
problemOccurrenceTime: '问题发生时间',
respondent: '回答人',
problemDescription: '问题描述'
},
// 动态消息
dynamicMessage: {
dynamicHeading: '动态标题',
@@ -55,11 +50,6 @@ module.exports = {
newChild: '新增子级',
pleaseSelectTheDirectoryOnTheLeft: '请选择左侧目录'
},
// 文档动态
documentDynamics: {
messageContent: '消息内容',
notificationTime: '通知时间'
},
// 市场法规清单
marketRegulationsList: {
listNumber: '清单编号',
+5 -298
View File
@@ -159,19 +159,14 @@ import UploadFile from '../UploadFile'
import StandardSelection from '../selection/StandardSelection'
import {
FieldType,
StandardGradeClassify,
StandardProperty,
IsTrial,
EnterpriseStandardStatus,
StandardSource,
StandardStatus, EnterpriseStandardCode, EnterpriseNameCode
StandardSource
} from '../../enums/commonEnums'
import JMultipleDatePicker from '../JMultipleDatePicker'
import UserSelection from '../selection/UserSelection'
import { getAction } from '../../api/manage.js'
import { ajaxGetDictItems, getDictByCode, getFormDictTreeList } from '../../api/api.js'
import { ajaxGetDictItems, getFormDictTreeList } from '../../api/api.js'
import TreeSelection from '../selection/TreeSelection'
import { getStandardGradeClassification } from '../../api/enterpriseStandardLibraryApi'
import STreeSelect from '../STreeSelect'
export default {
@@ -211,7 +206,7 @@ export default {
}
}
},
// 标准模块的区分:1国内; 2,国外;3,企标
// 标准模块的区分:1,外来标准3,企标
flag: {
type: String,
default: null
@@ -303,16 +298,6 @@ export default {
}
}
},
mounted () {
// 如果是企标就获取企标级别映射数据
if (this.flag === StandardSource.ENTERPRISE.value) {
getStandardGradeClassification().then(res => {
if (res.success) {
this.standardGradeClassification = res.result
}
})
}
},
data () {
return {
FieldType,
@@ -337,134 +322,18 @@ export default {
}
},
watch: {
// 国内的零部件分类、适用认证、适用车型和标准性质关联,准入标准必填,非准入标准不必填
'formInline.standard_property' () {
this.handleDomesticSpecialCheck()
this.handleStatePropertyCheck()
},
// 标准等级分类改变后授权部门需要自动带出
'formInline.grade_classification' (val) {
if (val && this.flag === StandardSource.ENTERPRISE.value && !this.isEditSetData) {
if (val === StandardGradeClassify.ZERO_LEVEL.value) {
// 选的是0级,授权部门带出不可编辑
this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '0').deptIds
if (!this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField.push('auth_dept')
}
} else if (val === StandardGradeClassify.ONE_LEVEL.value) {
// 选的是1级
// // 带出3级的部门:起草部门
// this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '3').deptIds
// 带出主起草单位
this.formInline.auth_dept = this.formInline.main_drafting_unit
// 设置可选择项
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '1').deptIds.split(',')
this.formInline = JSON.parse(JSON.stringify(this.formInline))
// 设置授权部门可编辑
if (this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept')
}
} else if (val === StandardGradeClassify.TWO_LEVEL.value) {
// 选的是2级
// // 带出3级的部门:起草部门
// this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '3').deptIds
// 带出主起草单位
this.formInline.auth_dept = this.formInline.main_drafting_unit
// 设置可选择项
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '2').deptIds.split(',')
this.formInline = JSON.parse(JSON.stringify(this.formInline))
// 设置授权部门可编辑
if (this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept')
}
} else if (val === StandardGradeClassify.THREE_LEVEL.value) {
// // 选的是3级,授权部门带出不可编辑
// this.formInline.auth_dept = this.standardGradeClassification.find(item => item.level + '' === '3').deptIds
// 选的是3级,带出主起草单位
this.formInline.auth_dept = this.formInline.main_drafting_unit
if (!this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField.push('auth_dept')
}
}
} else if (val && this.flag === StandardSource.ENTERPRISE.value && this.isEditSetData) {
if (val === StandardGradeClassify.ZERO_LEVEL.value) {
// 选的是0级,授权部门带出不可编辑
if (!this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField.push('auth_dept')
}
} else if (val === StandardGradeClassify.ONE_LEVEL.value) {
// 选的是1级
// 设置可选择项
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '1').deptIds.split(',')
// 设置授权部门可编辑
if (this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept')
}
} else if (val === StandardGradeClassify.TWO_LEVEL.value) {
// 选的是2级
// 设置可选择项
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '2').deptIds.split(',')
// 设置授权部门可编辑
if (this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept')
}
} else if (val === StandardGradeClassify.THREE_LEVEL.value) {
// 选的是3级,授权部门带出不可编辑
if (!this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField.push('auth_dept')
}
}
} else if (!val && this.flag === StandardSource.ENTERPRISE.value && !this.isEditSetData) {
// 清空授权部门的可选项
this.departSelectRange = []
// 设置授权部门可编辑
if (this.innerDisabledField.includes('auth_dept')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'auth_dept')
}
// 清空授权部门
this.formInline.auth_dept = ''
}
},
// 主起草单位改变后,需要将选中的主起草单位增加到授权部门
'formInline.main_drafting_unit' (val) {
if (val) {
if (this.formInline.grade_classification === StandardGradeClassify.ONE_LEVEL.value ||
this.formInline.grade_classification === StandardGradeClassify.TWO_LEVEL.value) {
// 标准等级分类是1级或者2级需要,把主起草单位追加到授权部门
let authDeptArr = (this.formInline.auth_dept || '').split(',')
// 把旧的主起草部门刨出去,否则每换一次主起草单位都会累计到授权部门
authDeptArr = authDeptArr.filter(item => item !== this.oldMainDraftingUnit)
authDeptArr.push(val)
this.formInline.auth_dept = authDeptArr.join(',')
} else if (this.formInline.grade_classification === StandardGradeClassify.THREE_LEVEL.value) {
// 标准等级分类是3级,把授权部门替换成主起草单位
this.formInline.auth_dept = val
}
this.oldMainDraftingUnit = val
}
},
// 企标是否试行改变,标准状态需要跟着变,试行周期必填校验也跟着变
// 企标是否试行改变,试行周期必填校验跟着变
'formInline.try_flag' (val) {
if (val && this.flag === StandardSource.ENTERPRISE.value && !this.isEditSetData) {
if (val === IsTrial.YES.value) {
// 试行,标准状态改为试运行,
this.formInline.standard_state = EnterpriseStandardStatus.TRIAL_OPERATION.value
// 试行周期给默认值24
this.formInline.trial_period = '24'
this.formInline.trial_period = '12'
this.formInline = JSON.parse(JSON.stringify(this.formInline))
// 试行,标准状态不可修改
if (!this.innerDisabledField.includes('standard_state')) {
this.innerDisabledField.push('standard_state')
}
// 试行,试行周期必填
this.rules.trial_period[0].required = true
} else {
// 试行周期置空
this.formInline.trial_period = undefined
// 不试行,标准状态可修改
if (this.innerDisabledField.includes('standard_state')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'standard_state')
}
// 不试行,试行周期非必填
this.rules.trial_period[0].required = false
}
@@ -478,59 +347,6 @@ export default {
this.rules.trial_period[0].required = false
}
}
},
// 编辑回显标准状态是废止,标准状态不可更改
'formInline.standard_state' (val) {
if (val && this.isEditSetData && (
(this.flag === StandardSource.ENTERPRISE.value && val === EnterpriseStandardStatus.ABOLISH.value) ||
(this.flag === StandardSource.DOMESTIC.value && val === StandardStatus.ABOLISH.value) ||
(this.flag === StandardSource.OVERSEAS.value && val === StandardStatus.ABOLISH.value))) {
// 状态是废止
if (!this.innerDisabledField.includes('standard_state')) {
this.innerDisabledField.push('standard_state')
}
} else if (this.formInline.try_flag === IsTrial.YES.value && this.flag === StandardSource.ENTERPRISE.value && this.isEditSetData) {
// 企标,是否试行选的是,需要标准状态不可编辑
if (!this.innerDisabledField.includes('standard_state')) {
this.innerDisabledField.push('standard_state')
}
} else {
// 状态不是废止
if (this.innerDisabledField.includes('standard_state')) {
this.innerDisabledField = this.innerDisabledField.filter(item => item !== 'standard_state')
}
}
// 起草、征求依据、报批、废止状态时发布日期、实施日期不必填
this.handleRequiredByState(val)
this.handleStatePropertyCheck()
},
// 企标:企业标准代号选Q,企业名称代号只能选ZZ\ZR;标准代号选TS,企业名称代号只能选ZZ
'formInline.standard_code' (val) {
if (this.flag === StandardSource.ENTERPRISE.value && !this.isEditSetData) {
if (val === EnterpriseStandardCode.Q.value) {
// 选的Q,企业名称代号只能选ZZ\ZR
this.optionsData.name_code.map(item => {
if (![EnterpriseNameCode.ZZ.value, EnterpriseNameCode.ZR.value].includes(item.value)) {
item.disabled = true
} else {
item.disabled = false
}
})
} else if (val === EnterpriseStandardCode.TS.value) {
// 选的TS,企业名称代号只能选ZZ
this.optionsData.name_code.map(item => {
if (![EnterpriseNameCode.ZZ.value].includes(item.value)) {
item.disabled = true
} else {
item.disabled = false
}
})
}
if (this.formInline.name_code !== EnterpriseNameCode.ZZ.value) {
this.formInline.name_code = undefined
this.formInline = Object.assign({}, this.formInline)
}
}
}
},
methods: {
@@ -578,7 +394,6 @@ export default {
// 处理标准选择不能选自己
this.excludeStandardNumbers = this.formInline[this.excludeStandardValFormFields]
this.handleDomesticSpecialCheck()
this.loading = false
} else {
this.loading = false
@@ -681,16 +496,6 @@ export default {
ajaxGetDictItems(item.dictField).then(res => {
if (res.success) {
const result = JSON.parse(JSON.stringify(res.result))
if (item.dbFieldName === 'name_code') {
for (const dictItem of result) {
if ([EnterpriseNameCode.WQ.value, EnterpriseNameCode.JC.value, EnterpriseNameCode.JHK.value].includes(dictItem.value)) {
dictItem.disabled = true
} else {
dictItem.disabled = false
}
}
}
console.log('获取企业名称代号下拉框数据成功了', result)
this.$set(this.optionsData, item.dbFieldName, result)
}
})
@@ -760,110 +565,12 @@ export default {
clearValidate (fieldNameList) {
this.$refs.ruleForm.clearValidate(fieldNameList)
},
/**
* 标准性质是准入,状态为发布、即将实施和现行有效的时候 新车型实施日期和在产车的实施日期 都改成必填
*/
handleStatePropertyCheck () {
const mustFillFields = ['new_model_implementation_date', 'on_the_production_date']
const rules = JSON.parse(JSON.stringify(this.rules))
if (this.formInline.standard_property === StandardProperty.admittance.value && (
this.formInline.standard_state === StandardStatus.RELEASE.value ||
this.formInline.standard_state === StandardStatus.BE_IMPLEMENTED_SOON.value ||
this.formInline.standard_state === StandardStatus.CURRENTLY_EFFECTIVE.value)) {
mustFillFields.forEach(key => {
if (rules[key] && rules[key].length > 0) {
rules[key][0].required = true
const dataPart = Object.keys(this.dataList).find(tt => this.dataList[tt].some(item => item.dbFieldName === key))
const index = this.dataList[dataPart].findIndex(tt => tt.dbFieldName === key)
this.dataList[dataPart][index].fieldMustInput = '1'
}
})
} else {
mustFillFields.forEach(key => {
if (rules[key] && rules[key].length > 0) {
rules[key][0].required = false
const dataPart = Object.keys(this.dataList).find(tt => this.dataList[tt].some(item => item.dbFieldName === key))
const index = this.dataList[dataPart].findIndex(tt => tt.dbFieldName === key)
this.dataList[dataPart][index].fieldMustInput = '0'
}
})
}
this.rules = Object.assign({}, rules)
this.clearValidate(mustFillFields)
},
/**
* 国内海外的特殊处理
*/
handleDomesticSpecialCheck () {
if (this.domesticSpecialCheck) {
const fieldNameList = ['part_name', 'applicable_certification', 'applicable_vehicle', 'responsible_department']
const rules = JSON.parse(JSON.stringify(this.rules))
if (this.formInline.standard_property === StandardProperty.admittance.value) {
fieldNameList.forEach(key => {
if (rules[key] && rules[key].length > 0) {
rules[key][0].required = true
const dataPart = Object.keys(this.dataList).find(tt => this.dataList[tt].some(item => item.dbFieldName === key))
const index = this.dataList[dataPart].findIndex(tt => tt.dbFieldName === key)
this.dataList[dataPart][index].fieldMustInput = '1'
}
})
} else {
fieldNameList.forEach(key => {
if (rules[key] && rules[key].length > 0) {
rules[key][0].required = false
const dataPart = Object.keys(this.dataList).find(tt => this.dataList[tt].some(item => item.dbFieldName === key))
const index = this.dataList[dataPart].findIndex(tt => tt.dbFieldName === key)
this.dataList[dataPart][index].fieldMustInput = '0'
}
})
}
this.rules = Object.assign({}, rules)
this.clearValidate(fieldNameList)
}
},
getFlag (fieldName) {
return this.flagByField[fieldName] || this.flag
},
filterTreeOption (input, option) {
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
/**
* 标准状态为起草、征求意见、报批等状态时发布日期、实施日期不应是必填项
* @param val
*/
handleRequiredByState (val) {
let notRequiredStatus = [], fields = []
// 国内和海外的标准状态是同一个数据字典
if (this.flag === StandardSource.DOMESTIC.value || this.flag === StandardSource.OVERSEAS.value) {
notRequiredStatus = [StandardStatus.DRAFT.value, StandardStatus.SEEK_FOR_OPTIONS.value, StandardStatus.EXAMINE.value, StandardStatus.APPROVAL.value, StandardStatus.ABOLISH.value]
fields = ['release_date', 'implementation_date']
} else { // 处理企标
notRequiredStatus = [EnterpriseStandardStatus.DRAFT.value, EnterpriseStandardStatus.SEEK_FOR_OPTIONS.value, EnterpriseStandardStatus.EXAMINE.value, EnterpriseStandardStatus.APPROVAL.value]
fields = ['release_date', 'implementation_date']
}
const rules = JSON.parse(JSON.stringify(this.rules))
if (notRequiredStatus.includes(val)) {
fields.forEach(key => {
if (rules[key] && rules[key].length > 0) {
rules[key][0].required = false
const dataPart = Object.keys(this.dataList).find(tt => this.dataList[tt].some(item => item.dbFieldName === key))
const index = this.dataList[dataPart].findIndex(tt => tt.dbFieldName === key)
this.dataList[dataPart][index].fieldMustInput = '0'
}
})
} else {
fields.forEach(key => {
if (rules[key] && rules[key].length > 0) {
rules[key][0].required = true
const dataPart = Object.keys(this.dataList).find(tt => this.dataList[tt].some(item => item.dbFieldName === key))
const index = this.dataList[dataPart].findIndex(tt => tt.dbFieldName === key)
this.dataList[dataPart][index].fieldMustInput = '1'
}
})
}
this.rules = Object.assign({}, rules)
this.clearValidate(fields)
}
}
}
+8 -407
View File
@@ -87,21 +87,13 @@ export const TypeOfClauseItem = {
IMG: { text: '图片', value: 'IMG' }
}
// 标准等级分类
export const StandardGradeClassify = {
ZERO_LEVEL: { text: '0级', value: '1' },
ONE_LEVEL: { text: '1级', value: '2' },
TWO_LEVEL: { text: '2级', value: '3' },
THREE_LEVEL: { text: '3级', value: '4' }
}
// 是否试行
export const IsTrial = {
YES: { text: '是', value: '1' },
NO: { text: '否', value: '0' }
}
// 国内标准状态
// 外来标准状态
export const StandardStatus = {
DRAFT: { text: '起草', value: '1' },
SEEK_FOR_OPTIONS: { text: '征求意见', value: '2' },
@@ -130,105 +122,13 @@ export const EnterpriseStandardStatus = {
// 流程key,获取人员信息前需要获取流程定义id,传这里的名字到WorkCenterMixin的getFlowDefinition方法中
export const ProcessKey = {
// 新法规导入流程
NEW_REGULATIONS_IMPORT: { text: '', value: '' },
// 企标立项/变更计划
ES_INIT_CHANGE: { text: 'es-init-change', value: 'es-init-change' },
// 年度制修订-各部门主动上报
ES_ANNUAL_REPORT: { text: 'es-annual-report', value: 'es-annual-report' },
// 年度制修订-标准化部门主动发起
ES_ANNUAL_INIT: { text: 'es-annual-init', value: 'es-annual-init' },
// 企标制修订流程
ES_EDIT: { text: 'es-revision', value: 'es-revision' },
// 企标更改流程
ES_CHANGE: { text: 'es-change', value: 'es-change' },
// 企标复审流程
ES_RECHECK: { text: 'es-recheck', value: 'es-recheck' },
// 企标废止流程
ES_ABOLISH: { text: 'es-abolish', value: 'es-abolish' },
// 企标封存流程
ES_ARCHIVE: { text: 'es-archive', value: 'es-archive' },
// 已封存企标启用流程
ES_ENABLE: { text: 'es-enable', value: 'es-enable' },
// 标准法规入库/变更流程
FB_ENTRY_CHANGE: { text: 'fb-entry-change', value: 'fb-entry-change' },
// 征求意见流程
CONSULTATION: { text: 'fb-standard-consultation', value: 'fb-standard-consultation' },
// 项目合规评估流程
PROJECT_COMPLIANCE_EVALUATION: { text: 'project-assessment', value: 'project-assessment' },
// 未符合项跟踪流程
NO_MATCH_TRACKING: { text: 'project-not-met', value: 'project-not-met' },
// 法规合规评估流程
REGULATORY_COMPLIANCE_ASSESSMENT: { text: 'standard-assessment', value: 'standard-assessment' },
// 法规采购流程
LEGAL_PROCUREMENT: { text: 'fb-standard-purchase', value: 'fb-standard-purchase' },
// 企标稽查计划
ES_INSPECTION_PLAN: { text: 'inspect_plan', value: 'inspect_plan' },
// 企标稽查流程
ES_INSPECTION_PROCESS: { text: 'inspect_process', value: 'inspect_process' },
// 稽查延期申请流程
INSPECTION_EXTENSION_REQUEST_PROCESS: { text: 'inspect_delay_apply_process', value: 'inspect_delay_apply_process' },
// 企标稽查整改
ES_INSPECTION_RECTIFICATION: { text: 'inspect_rectify', value: 'inspect_rectify' },
// 权限申请流程
PERMISSION_APPLY: { text: 'permission_apply_process', value: 'permission_apply_process' },
// 标准宣贯流程
STANDARD_PROMOTION: { text: 'standard_declare', value: 'standard_declare' },
// 会后管理流程
POST_MEETING_MANAGE: { text: 'meeting_manage', value: 'meeting_manage' }
NEW_REGULATIONS_IMPORT: { text: '', value: '' }
}
// 流程类型
export const ProcessType = {
// 标准法规入库/变更流程
FB_ENTRY_CHANGE: { text: '标准法规入库/变更流程', value: '1' },
// 征求意见流程
CONSULTATION: { text: '征求意见流程', value: '2' },
// 项目合规评估流程
PROJECT_COMPLIANCE_EVALUATION: { text: '项目合规评估流程', value: '3' },
// 未符合项跟踪流程
NO_MATCH_TRACKING: { text: '未符合项跟踪流程', value: '4' },
// 法规合规评估流程
REGULATORY_COMPLIANCE_ASSESSMENT: { text: '法规合规评估流程', value: '5' },
// 法规采购流程
LEGAL_PROCUREMENT: { text: '法规采购流程', value: '6' },
// 企标立项/变更计划
ES_INIT_CHANGE: { text: '企标立项/变更计划', value: '7' },
// 年度制修订-各部门主动上报
ES_ANNUAL_REPORT: { text: '年度制修订-各部门主动上报', value: '8' },
// 年度制修订-标准化部门主动发起
ES_ANNUAL_INIT: { text: '年度制修订-标准化部门主动发起', value: '9' },
// 企标制修订流程
ES_EDIT: { text: '企标制修订流程', value: '10' },
// 企标更改流程
ES_CHANGE: { text: '企标更改流程', value: '11' },
// 企标复审流程
ES_RECHECK: { text: '企标复审流程', value: '12' },
// 企标废止流程
ES_ABOLISH: { text: '企标废止流程', value: '13' },
// 企标封存流程
ES_ARCHIVE: { text: '企标封存流程', value: '14' },
// 已封存企标启用流程
ES_ENABLE: { text: '已封存企标启用流程', value: '15' },
// 企标稽查计划
ES_INSPECTION_PLAN: { text: '企标稽查计划', value: '16' },
// 企标稽查流程
ES_INSPECTION_PROCESS: { text: '企标稽查流程', value: '17' },
// 稽查延期申请流程
INSPECTION_EXTENSION_REQUEST_PROCESS: { text: '稽查延期申请流程', value: '18' },
// 企标稽查整改
ES_INSPECTION_RECTIFICATION: { text: '企标稽查整改', value: '19' },
// 权限申请流程
PERMISSION_APPLY: { text: '权限申请流程', value: '20' },
// 标准宣贯流程
STANDARD_PROMOTION: { text: '标准宣贯流程', value: '21' },
// 会后管理流程
POST_MEETING_MANAGE: { text: '会后管理流程', value: '22' }
}
// 标准性质
export const StandardProperty = {
admittance: { text: '准入性', value: 'SN001' },
recommendation: { text: '推荐性', value: 'SN002' }
// 新法规导入流程
NEW_REGULATIONS_IMPORT: { text: '新法规导入流程', value: '1' }
}
// 标准化活动类型
@@ -252,257 +152,6 @@ export const IsReadOnlyEnums = {
subConfigurable: { text: '字段固定,内部可配', value: 2 }
}
// 标准法规入库/变更流程
export const FGEntryChangeProcessNode = new EsEnums({
initiate: { text: '法规工程师发起', value: 'Activity_16zkjpn', btn: ['save', 'submit'], disabled: false },
approve: {
text: '法规工程师主管级领导审批',
value: 'Activity_084um6e',
btn: ['return', 'save', 'agree', 'reject'],
disabled: true
}
})
// 标准征求意见流程
export const ConsultationProcess = new EsEnums({
initiate: { text: '法规工程师发起', value: 'engineer_start', btn: ['save', 'submit'] },
distribute: { text: '各部所主管级领导分发', value: 'depart_leader_start', btn: ['return', 'save', 'submit'] },
moduleOwnerDistribution: { text: '模块负责人分发', value: 'module_owner_start', btn: ['return', 'save', 'submit'] },
designEngineerFillIn: { text: '设计工程师填写', value: 'design_engineer', btn: ['return', 'save', 'submit'] },
moduleOwnerSummary: { text: '模块负责人汇总', value: 'module_owner_end', btn: ['return', 'save', 'submit'] },
leaderApproval: { text: '各部所主管级领导审批', value: 'depart_leader_end', btn: ['return', 'save', 'agree', 'reject'] },
leaderSummary: { text: '各部所主管级领导汇总', value: 'depart_leader_collect', btn: ['return', 'save', 'submit'] },
regulatoryEngineerApproval: { text: '法规工程师审批', value: 'engineer_end', btn: ['return', 'save', 'agree', 'reject'] }
})
// 下发人员类型
export const SenderType = {
moduleOwner: { text: '模块负责人', value: '1' },
designEngineer: { text: '设计工程师', value: '2' }
}
// 企标稽查计划
export const EsInspectionPlan = new EsEnums({
initiate: { text: '稽查联络人发起计划', value: 'liaisons_start', btn: ['save', 'submit'] },
fillInComments: { text: '稽查征求意见对象填写意见', value: 'opinion_fill', btn: ['save', 'submit'] },
liaisonCollect: { text: '稽查联络人汇总', value: 'liaisons_collect', btn: ['save', 'submit'] },
relevantPersonnelCountersign: { text: '相关人员会签', value: 'involve_countersign', btn: ['transfer', 'save', 'agree', 'reject'] },
liaisonLeaderApproval: { text: '联络人主管级领导批准', value: 'leader_approval', btn: ['transfer', 'save', 'agree', 'reject'] }
})
// 企标稽查流程
export const EsInspectionProcess = new EsEnums({
initiate: { text: '稽查负责人发起', value: 'responsible_start', btn: ['save', 'submit'] },
directorLeaderApprovalOne: { text: '负责人主管级领导审批', value: 'leader_approval', btn: ['transfer', 'save', 'agree', 'reject'] },
inputInspectionReport: { text: '稽查负责人上传稽查报告和整改计划', value: 'responsible_upload', btn: ['transfer', 'save', 'submit'] },
directorLeaderApprovalTwo: { text: '负责人主管级领导审批', value: 'leader_approval_again', btn: ['transfer', 'save', 'agree', 'reject'] },
relevantPersonnelCountersign: { text: '相关人员会签', value: 'involve_countersign', btn: ['transfer', 'save', 'agree', 'reject'] }
})
// 稽查延期申请流程
export const InspectionExtensionRequestProcess = new EsEnums({
initiate: { text: '稽查负责人申请延期', value: 'responsible_start', btn: ['save', 'submit'] },
directorLeaderApproval: { text: '负责人主管级领导审批', value: 'leader_approval', btn: ['transfer', 'save', 'agree', 'reject'] },
contactEvaluation: { text: '稽查联络人评估', value: 'liaisons_assess', btn: ['transfer', 'save', 'agree', 'reject'] },
directorSuperiorLeaderApproval: {
text: '负责人主管级上一级领导审批',
value: 'leader_up_level',
btn: ['transfer', 'save', 'agree', 'reject']
}
})
// 企标稽查整改
export const EsInspectionRectification = new EsEnums({
uploadRectificationResult: { text: '整改负责人上传整改结果', value: 'responsible_start', btn: ['transfer', 'save', 'submit'] },
directorLeaderApproval: { text: '负责人主管级领导审批', value: 'leader_approval', btn: ['transfer', 'save', 'agree', 'reject'] },
directorToExamine: { text: '稽查负责人审核', value: 'responsible_approval', btn: ['transfer', 'save', 'agree', 'reject'] }
})
// 权限申请流程
export const PermissionApply = new EsEnums({
initiate: { text: '发起人申请', value: 'initiator_start', btn: ['save', 'submit'] },
leaderApproval: { text: '发起人领导审批', value: 'leader_approval', btn: ['transfer', 'save', 'agree', 'reject'] },
standardApproval: { text: '标准化审批', value: 'standard_approval', btn: ['transfer', 'save', 'agree', 'reject'] }
})
// 标准宣贯流程
export const StandardPromotion = new EsEnums({
initiate: { text: '发起并归档', value: 'initiator_start', btn: ['cancel', 'save', 'submit'] }
})
// 会后管理流程
export const PostMeetingManage = new EsEnums({
initiate: { text: '法规工程师发起', value: 'engineer_start', btn: ['save', 'submit'] },
attendeesUploadMaterials: { text: '参会人员上传材料', value: 'meeting_upload', btn: ['uncommitted', 'transfer', 'save', 'submit'] }
})
// 项目评估结果类型
export const EvaluationResultType = new EsEnums({
accordWith: { text: '符合', value: '1' },
inconformity: { text: '不符合', value: '2' },
toBeVerified: { text: '待验证', value: '3' },
uninvolved: { text: '不涉及', value: '4' }
})
// 征求意见流程-意见
export const SolicitOpinions = {
accept: { text: '采纳', value: '1' },
partialAdoption: { text: '部分采纳', value: '2' },
reject: { text: '不采纳', value: '3' }
}
// 法规采购流程节点
export const ProcurementProcessNodes = new EsEnums({
initiate: { text: '发起人申请', value: 'Activity_0fmr3id', btn: ['save', 'submit'] },
sponsorLeaderApproval: { text: '发起人主管级领导审批', value: 'Activity_1fr1x5i', btn: ['return', 'save', 'agree', 'reject'] },
standardLeaderApproval: { text: '标准化主管级领导审批', value: 'Activity_06jy4oo', btn: ['return', 'save', 'agree', 'reject'] },
standardSuperiorLeaderApproval: { text: '标准化主管级上一级领导审批', value: 'Activity_1u5337a', btn: ['return', 'save', 'agree', 'reject'] },
regulatoryEngineerConfirmation: { text: '法规工程师确认', value: 'Activity_1q01zfq', btn: ['carbonCopy', 'submit'] }
})
// 项目合规评估流程节点
export const ProjectComplianceEvaluationProcessNode = new EsEnums({
initiate: { text: '法规工程师发起', value: 'fggcsfq', btn: ['save', 'pre', 'next', 'submit'] },
departLeaderIssued: { text: '各部门主管级领导下发', value: 'gbmzgjldxf', btn: ['return', 'save', 'submit'] },
moduleOwnerIssued: { text: '模块负责人分发', value: 'mkfzrff', btn: ['return', 'save', 'submit'] },
designEngineerEvaluation: { text: '设计工程师评估', value: 'sjgcspg', btn: ['return', 'save', 'submit'] },
moduleOwnerApproval: { text: '模块负责人审批', value: 'mkfzrsp', btn: ['return', 'save', 'agree', 'reject'] },
departLeaderApproval: { text: '各部门主管级领导审批', value: 'gbmzgjldsp', btn: ['return', 'save', 'agree', 'reject'] },
moduleOwnerModification: { text: '模块负责人修改', value: 'mkfzrxg', btn: ['return', 'save', 'submit'] },
regulatoryEngineerFiling: { text: '法规工程师归档', value: 'fggcsgd', btn: ['return', 'save', 'submit'] }
})
// 企标立项、变更流程
export const EsInitChangeNodes = new EsEnums({
mainDrafterStart: { text: '主起草人发起', value: 'sid-7120EF36-78C3-4DB0-8B49-91178F79C24B' },
contactCheck: { text: '部所联络人校对', value: 'sid-BB1FF9A5-89DF-4356-AB16-9D68B8FABC04' },
expertApproval: { text: '专家审批', value: 'sid-ABE29414-15C7-4798-B690-E53055F6CA75' },
leaderApproval: {
initiationText: '发起人主管级领导审批',
changeText: '主起草人主管级领导审批',
value: 'sid-A58C400F-BA13-4125-9B00-45EB45F1A559'
},
leaderLeaderApproval: {
initiationText: '发起人主管级上一级领导审批',
changeText: '主起草人主管级上一级领导审批',
value: 'sid-298A57B6-6658-47C0-94EB-76E3A5790258'
},
standardizationApproval: { text: '标准化审批', value: 'sid-06CB29CE-E39F-4CD2-A534-18546DC8C6FB' },
newDraftUnitLeaderLeaderSend: { text: '新起草部门主管级上一级领导下发', value: 'sid-AB70F1CA-8311-4639-B3DA-204EF3332B29' },
newDraftUnitLeaderConfirm: { text: '新起草部门主管级领导确认', value: 'sid-A26EC37C-7C93-4987-9833-363C4E25EC50' },
relevantPersonnelWillSign: { text: '相关人员会签', value: 'sid-7BFD2753-B6CD-4637-8D4B-819903511925' },
mainDrafterCopy: { text: '主起草人抄送', value: 'sid-08D0381A-5C20-4708-9D73-C7EB5C51DB02' }
})
// 年度制修订计划-各部门主动上报
export const EsRevisionPlanActivityReportNodes = new EsEnums({
standardizationStart: { text: '标准化工程师发起', value: 'sid-A6DD8A92-30D8-4733-9EE3-D8C6636D73C6' },
contactEnterSendTask: { text: '各部所联络人 填写/下发任务', value: 'sid-ECCB8ADE-F528-482C-8714-0D33471EF662' },
contactEnterEs: { text: '工作组/所联络人填写企标', value: 'sid-B6F66797-8F09-4B84-AA8E-28B841067217' },
contactLeaderApproval: { text: '收集联络人主管级领导审批', value: 'sid-2A8155BC-4634-4353-BD0E-89CE07F0D335' },
contactsApproval: { text: '各部所联络人汇总', value: 'sid-69F04E36-5EDB-4693-8284-FFF3FCBE2B3D' },
contactLeaderLeaderApproval: { text: '联络人主管级上一级领导审批', value: 'sid-60783E25-8671-404F-9E7D-B9181CA07B69' },
standardizationSumUp: { text: '标准化工程师归档', value: 'sid-482034AD-DB3C-4A93-9E0D-B8834F4767F0' }
})
// 年度制修订计划-标准化发起
export const EsRevisionPlanStandardizationInitNodes = new EsEnums({
standardizationStart: { text: '标准化工程师发起', value: 'sid-880237E7-1735-49AE-B9EC-D7DA5D28E17D' },
contactSelectApprover: { text: '部所联络人选取审批人', value: 'sid-C3F65D96-76B0-4901-8C8A-D6B390099381' },
standardizationUpdate: { text: '标准化工程师修改调整', value: 'sid-3CB0E6B1-9918-4A21-9C62-9344FF1B7269' },
mainDrafterLeaderSend: { text: '主起草单位主管级领导审批下发', value: 'sid-050827D6-AA12-4561-8B37-4D2023AF6D7F' },
contactUpdate: { text: '部所联络人修改调整', value: 'sid-3AF454B3-1D93-4BF6-B925-98F1A7E125B8' },
mainDrafterEnterInfo: { text: '主起草人填写信息', value: 'sid-E2015AB3-9C52-4E49-A261-DA11CB4BAA7E' },
contactsApproval: { text: '部所联络人汇总', value: 'sid-158523C5-7D8F-4433-B2DB-8A6C09DFDB1B' },
mainDrafterLeaderApproval: { text: '主起草单位主管级领导批准', value: 'sid-57656F2E-0AE1-45D8-85D0-CE3E37D9E926' },
standardizationSumUp: { text: '标准化归档', value: 'sid-86610E08-1DDB-467A-A32E-C661FE889A57' },
standardizationTwoUpdate: { text: '标准化工程师二次修改调整', value: 'sid-BEAAC29F-17D8-4162-8C0B-01A4A8ED7729' }
})
// 企标制修订流程
export const EsRevisionNodes = new EsEnums({
mainDrafterSend: { text: '主起草人起草分发', value: 'Activity_0v98tow' },
otherDrafterUploadStandard: { text: '其他起草人上传企标', value: 'Activity_1d2la4l' },
mainDrafterAllUploadMinute: { text: '主起草人汇总上传会议纪要', value: 'Activity_1dz3u0m' },
standardizationAudit: { text: '标准化审核', value: 'Activity_0m576ex' },
scorerMark: { text: '评分人打分', value: 'Activity_1qhpnpa' },
standardizationConfirmIsStartAdvice: { text: '标准化确认是否开启征求意见', value: 'Activity_1siuksf' },
contactSend: { text: '部所联络人下发', value: 'Activity_1ns6olf' },
takeAdviceObjectEnterAdvice: { text: '征求意见对象填写意见', value: 'Activity_04m430n' },
contactAll: { text: '部所联络人汇总数据', value: 'Activity_1riqzkp' },
contactLeaderApproval: { text: '部门联络人主管级领导审批', value: 'Activity_1ralk8e' },
mainDrafterAll: { text: '主起草人汇总', value: 'Activity_1hb9aun' },
mainDrafterUploadMinute: { text: '主起草人上传会议纪要', value: 'Activity_11uuyg0' },
otherDrafterProofread: { text: '其他起草人校对', value: 'Activity_1seways' },
leaderApproval: { text: '主管级领导审批', value: 'Activity_1l028rz' },
standardizationApproval: { text: '标准化审批', value: 'Activity_0uxua0b' },
relatedDeptLeaderCountersign: { text: '相关部门领导会签', value: 'Activity_05pybsc' },
allEngineerApproval: { text: '总工程师审批', value: 'Activity_1yr56ac' },
mainDrafterPublish: { text: '主起草人发布', value: 'Activity_0n0h60s' }
})
// 企标更改流程
export const EsChangeNodes = new EsEnums({
mainDrafterStart: { text: '主起草人发起', value: 'sid-030A34BF-65B2-460C-BCAB-4BFEE0F77987' },
relevantPersonnelCheck: { text: '相关人员校对', value: 'sid-109C6F14-FB23-4A90-A462-F10F344BECD1' },
mainDrafterLeaderApproval: { text: '主起草人主管级领导审批', value: 'sid-8A8307F2-20BB-423C-80AA-F426F5F612C3' },
standardizationApproval: { text: '标准化审批', value: 'sid-F0B237E0-1D97-455B-BE15-C3796429B412' },
mainDrafterLeaderLeaderApproval: { text: '起草人主管级上一级领导审批', value: 'sid-05CC5BD1-2451-45AF-9453-74AE93D026EF' }
})
// 企标复审流程
export const EsRecheckNodes = new EsEnums({
standardizationSelectContact: { text: '标准化工程师选择联络人', value: 'sid-4462498E-D15B-4288-855C-FB1D52F1877D' },
initiatorStart: { text: '发起人发起', value: 'sid-2E53F267-8541-40FB-974D-D8DDD03191CB' },
drafterEnterOption: { text: '起草人填写意见', value: 'sid-72303DAD-0B49-471B-828E-66602468BE44' },
drafterMinisterApproval: { text: '起草人部长审批', value: 'sid-18EE1480-C281-4569-93F6-F94F204B71ED' },
standardizationApproval: { text: '标准化审批', value: 'sid-6BF8F285-0A2A-449C-A108-24024A922723' }
})
// 企标废止流程
export const EsAnnulNodes = new EsEnums({
initiatorStart: { text: '发起人发起', value: 'sid-5F5FC475-64DE-4F98-A52D-5F6837C39B63' },
relevantPersonnelWillSign: { text: '相关人员会签', value: 'sid-B4157F9F-73E5-48F5-855D-AF87C0DB91C6' },
leaderApproval: { text: '起草人和会签人主管级领导审批', value: 'sid-0BC5B3BC-ED99-4061-84B4-7320E25DE326' },
standardizationApproval: { text: '标准化审批', value: 'sid-9C90582D-F71F-4516-B54F-1E9F896C30D8' }
})
// 未符合项跟踪流程
export const NoMatchTrackingNodes = new EsEnums({
initial: { text: '法规工程师发起整改', value: 'fggcsfqzg', btn: ['save', 'submit'] },
designEngineer: { text: '设计工程师上传整改材料', value: 'sjgcssczgcl', btn: ['return', 'save', 'submit'] },
directorLevelLeader: { text: '主管级领导审批', value: 'zgjldsp', btn: ['return', 'save', 'agree', 'reject'] },
regulatoryEngineer: { text: '法规工程师审批', value: 'fggcssp', btn: ['return', 'save', 'agree', 'reject'] }
})
// 企标封存流程
export const EsSealSaveNodes = new EsEnums({
initiatorStart: { text: '发起人发起', value: 'sid-5F5FC475-64DE-4F98-A52D-5F6837C39B63' },
relevantPersonnelWillSign: { text: '相关人员会签', value: 'sid-B4157F9F-73E5-48F5-855D-AF87C0DB91C6' },
leaderApproval: { text: '起草人和会签人主管级领导审批', value: 'sid-0BC5B3BC-ED99-4061-84B4-7320E25DE326' },
standardizationApproval: { text: '标准化审批', value: 'sid-9C90582D-F71F-4516-B54F-1E9F896C30D8' }
})
// 已封存企标启用流程
export const EsStartUseNodes = new EsEnums({
initiatorStart: { text: '发起人发起', value: 'sid-5F5FC475-64DE-4F98-A52D-5F6837C39B63' },
relevantPersonnelWillSign: { text: '相关人员会签', value: 'sid-B4157F9F-73E5-48F5-855D-AF87C0DB91C6' },
leaderApproval: { text: '起草人和会签人主管级领导审批', value: 'sid-0BC5B3BC-ED99-4061-84B4-7320E25DE326' },
standardizationApproval: { text: '标准化审批', value: 'sid-9C90582D-F71F-4516-B54F-1E9F896C30D8' }
})
// 法规合规流程节点
export const StandardComplianceNodes = new EsEnums({
initial: { text: '法规工程师发起', value: 'fggcsfq', btn: ['save', 'submit'] },
departLeaderIssue: { text: '部所主管级领导下发', value: 'bszgjldxf', btn: ['return', 'save', 'submit'] },
moduleOwnerIssue: { text: '模块责任人分发', value: 'mkzrrff', btn: ['return', 'save', 'submit'] },
designEngineerAssess: { text: '设计工程师评估', value: 'sjgcspg', btn: ['return', 'save', 'submit'] },
moduleOwnerReview: { text: '模块责任人审批', value: 'mkzrrsp', btn: ['return', 'save', 'agree', 'reject'] },
departLeaderApprove: { text: '部所主管级领导审批', value: 'bszgjldsp', btn: ['return', 'save', 'agree', 'reject'] },
regulatoryEngineerApprove: { text: '法规工程师审批', value: 'fggcssp', btn: ['return', 'save', 'agree', 'reject'] },
designEngineerWriteProject: { text: '设计工程师补充立项项目号', value: 'sjgcsbcgzlbh', btn: ['submit'] }
})
// 新法规导入流程节点
export const NewRegulationsImportNodes = new EsEnums({
initiated: { text: '法规工程师发起', value: '' },
@@ -512,42 +161,9 @@ export const NewRegulationsImportNodes = new EsEnums({
responsibleLeaderApprovalTwo: { text: '公司标准法规责任领导批准', value: '' }
})
// 项目合规评估流程状态
export const EvaluateProcessStatus = {
notEvaluated: { text: '未评估', value: '1' },
beEvaluating: { text: '评估中', value: '2' },
evaluated: { text: '已评估', value: '3' }
}
// 稽查状态
export const InspectStatus = {
inProgress: { text: '进行中', value: '1' },
underInspection: { text: '稽查中', value: '2' },
completed: { text: '已完成', value: '3' },
delay: { text: '拖期', value: '4' }
}
// 未符合项整改状态
export const InconformityItemState = {
toBeRectified: { text: '待整改', value: '1' },
rectifying: { text: '整改中', value: '2' },
approving: { text: '审批中', value: '3' },
done: { text: '已完成', value: '4' },
closed: { text: '已关闭', value: '5' },
caution: { text: '警示', value: '6' },
exceedTheTimeLimit: { text: '超期', value: '7' }
}
// 法规合规评估结果
export const StandardEvaluationResultType = {
accordWith: { text: '符合', value: '1' },
inconformity: { text: '不符合', value: '2' },
notInvolve: { text: '不涉及', value: '4' }
}
// 条款使用范围
export const ClauseUsableRange = new EsEnums({
DOMESTIC: { text: '国标', value: '1' },
DOMESTIC: { text: '外来标准', value: '1' },
ENTERPRISE: { text: '企标', value: '3' }
})
@@ -557,29 +173,14 @@ export const ReadFlag = {
READ: { text: '已读', value: '1' }
}
// 企业标准代号
export const EnterpriseStandardCode = {
Q: { text: 'Q', value: 'Q' },
TS: { text: 'TS', value: 'TS' }
}
// 企业名称代号
export const EnterpriseNameCode = {
ZZ: { text: 'ZZ', value: 'ZZ' },
ZR: { text: 'ZR', value: 'ZR' },
WQ: { text: 'WQ', value: 'WQ' },
JC: { text: 'JC', value: 'JC' },
JHK: { text: 'JHK', value: 'JHK' }
}
// 清单状态
// 市场法规清单-清单状态
export const ListState = {
RELEASED: { text: '已发布', value: '1' },
UNPUBLISH: { text: '未发布', value: '2' },
UNDER_REVISION: { text: '修改中', value: '3' },
UNDER_REVISION: { text: '修改中', value: '3' }
}
// 整改状态
// 不符合项库-整改状态
export const RectificationState = {
TO_BE_RECTIFIED: { text: '待整改', value: '1' },
TARGET_IS_CLOSED: { text: '已关闭', value: '2' }
@@ -1,438 +0,0 @@
<template>
<div class="detail-page">
<a-spin :spinning="loading">
<div class="detail-page-title">{{ pageTitle }}{{ $t('details') }}</div>
<div class="detail-page-part" v-for="(part, index) in partList" :key="part + index">
<div class="detail-page-part-title">
<span>{{ part }}</span>
</div>
<div class="detail-page-part-form" v-if="part !== '过程稿件' && part !== 'Process Manuscript'">
<div class="detail-page-part-form-item" v-for="formItem in form[part]" :key="formItem.id">
<label>{{ formItem.dbFieldTxt }}</label>
<!--标准需要跳转是标准字段且有内容的情况下在这处理-->
<template v-if="standardFields.includes(formItem.dbFieldName) && !!detailData[formItem.dbFieldName]">
<div class="div-form-content">
<template v-for="(standard, standardIndex) in detailData[formItem.dbFieldName].split(',')">
<div class="can-click" :key="'standardKey' + standardIndex" @click="toStandardDetailPage(standard)">{{ standard }}</div>
<div v-if="standardIndex!==detailData[formItem.dbFieldName].split(',').length - 1">,</div>
</template>
</div>
</template>
<!--文件需要显示预览-->
<div class="file-box" v-else-if="fileField.includes(formItem.dbFieldName)">
<template v-if="detailData[formItem.dbFieldName + 'List'] && detailData[formItem.dbFieldName + 'List'].length > 0">
<div class="detail-page-process-manuscript-file"
v-for="file in detailData[formItem.dbFieldName + 'List']"
:key="file.id">
<div class="detail-page-process-manuscript-file-info">
<a-icon type="link" />
<div class="detail-page-process-manuscript-file-name" @click="handlePreview(file)">{{ file.fileName }}</div>
</div>
<!-- 下载-->
<a-button type="link"
icon="download"
v-has="btnPermission.download"
class="file-btn"
@click="handleDownload(file)">
{{
$t('download')
}}
</a-button>
<!-- 无水印下载-->
<!--<a-button type="link" v-has="btnPermission.unwatermarkedDownload" class="file-btn">-->
<!-- <i class="iconfont icon-water-drop-slash"></i>-->
<!-- {{ $t('unwatermarkedDownload') }}-->
<!--</a-button>-->
</div>
</template>
<span v-else>{{ global.emptyLine }}</span>
</div>
<!-- 需要显示查看全部按钮 -->
<a-button v-else-if="showViewAllField.includes(formItem.dbFieldName) &&
(detailData[formItem.dbFieldName + '_dictText'] || detailData[formItem.dbFieldName])"
type="primary" ghost @click="viewAll(formItem.dbFieldName)">
{{ $t('enterpriseStandardLibrary.standard.viewAll')}}
</a-button>
<span v-else>
{{
detailData[needDictFieldList.includes(formItem.fieldShowType) ? formItem.dbFieldName + '_dictText' : formItem.dbFieldName] || global.emptyLine
}}
</span>
</div>
</div>
<!-- 过程稿件特殊处理-->
<div class="detail-page-process-manuscript" v-if="part === '过程稿件' || part === 'Process Manuscript'">
<div class="detail-page-process-manuscript-item" v-for="formItem in form[part]" :key="formItem.id">
<div class="detail-page-process-manuscript-title">
<span>{{ formItem.dbFieldTxt }}</span>
<!-- 标准分解单-->
<a-button type="primary"
ghost
icon="file-text"
@click="previewStandardResolutionSheet(detailData[formItem.dbFieldName + '_standardSplit'])"
v-has="btnPermission.standardResolutionSheet"
:disabled="!detailData[formItem.dbFieldName + '_standardSplit']">
{{ $t('standardRegulationLibrary.standardResolutionSheet') }}
</a-button>
</div>
<div class="detail-page-process-manuscript-file"
v-for="file in detailData[formItem.dbFieldName + 'List']"
:key="file.id">
<div class="detail-page-process-manuscript-file-info">
<a-icon type="link" />
<div class="detail-page-process-manuscript-file-name" @click="handlePreview(file)">{{ file.fileName }}</div>
</div>
<div class="detail-page-process-manuscript-file-operate">
<!-- 下载-->
<a-button type="link" icon="download" v-has="btnPermission.download" @click="handleWatermarkedDownload(file)">
{{ $t('download') }}
</a-button>
<!-- 无水印下载-->
<a-button type="link" v-has="btnPermission.unwatermarkedDownload" @click="handleDownload(file)">
<i class="iconfont icon-water-drop-slash"></i>
{{ $t('unwatermarkedDownload') }}
</a-button>
</div>
</div>
</div>
</div>
</div>
</a-spin>
<div id="images">
<div class="image" v-viewer="{movable: false}">
<img v-show="image" :src="imageUrl" alt="">
</div>
</div>
<!-- 标准分解单-->
<standard-resolution-sheet-modal ref="standardResolutionSheetModal" />
<!-- 查看全部弹框 -->
<text-content-modal ref="textContentModal"></text-content-modal>
</div>
</template>
<script>
import '@assets/less/common.less'
import { FieldType, StandardSource } from '../../../enums/commonEnums'
import {
getDomesticStandardFormModal,
getDomesticStandardDetail,
getOverseasStandardForm,
getOverseasStandardDocumentInfo
} from '../../../api/standardRegulationLibraryApi'
import StandardResolutionSheetModal from './modules/StandardResolutionSheetModal.vue'
import { getFileInfo } from '../../../api/api.js'
import Vue from 'vue'
import { ACCESS_TOKEN } from '../../../store/mutation-types.js'
import { downloadFile, getFileAccessHttpUrl } from '../../../api/manage.js'
import { previewPdf } from '../../../utils/previewPdf.js'
import { kkFilePreview } from '../../../utils/kkFilePreview'
import { queryStandardInfoByStandardNumber } from '../../../utils/util'
import TextContentModal from '../../enterpriseStandardLibrary/standard/detail/module/TextContentModal'
// 国内标准权限
const DomesticStandardPermission = {
standardResolutionSheet: 'domesticStandard:standardResolutionSheet', // 标准分解单
download: 'domesticStandard:download', // 下载
unwatermarkedDownload: 'domesticStandard:unwatermarkedDownload' // 无水印下载
}
// 海外标准权限
const OverseasStandardPermission = {
standardResolutionSheet: 'overseasStandard:standardResolutionSheet', // 标准分解单
download: 'overseasStandard:download', // 下载
unwatermarkedDownload: 'overseasStandard:unwatermarkedDownload' // 无水印下载
}
// 国内标准接口
const DomesticApi = {
getFormFunc: getDomesticStandardFormModal, // 获取字段
getDetailData: getDomesticStandardDetail // 获取详情数据
}
// 海外标准接口
const OverseasApi = {
getFormFunc: getOverseasStandardForm, // 获取字段
getDetailData: getOverseasStandardDocumentInfo // 获取详情数据
}
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
const FILE_TYPE_PDF = 'pdf'
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
export default {
name: 'StandardDetailPage',
components: { StandardResolutionSheetModal, TextContentModal },
data () {
return {
loading: false,
partList: [], // 页面模块列表
form: {}, // 页面字段
// 页面数据
detailData: {},
// 文件的字段
fileField: [],
// 需要数据字段翻译的属性类型
needDictFieldList: [FieldType.USER_SINGLE.value, FieldType.ORGAN_SINGLE.value, FieldType.ORGAN_MORE.value, FieldType.OPTION_SINGLE.value, FieldType.OPTION_MORE.value, FieldType.TREE.value, FieldType.TREE_SINGLE.value],
image: false,
imageUrl: null,
// 标准字段,需要跳转标准详情
standardFields: ['substitute_standard_number', 'replaced_by_standard_number', 'reference_standard', 'referenced_standard', 'adopt_the_international_standard_number', 'associated_foreign_standards'],
showViewAllField: ['auth_dept'] // 需要显示展示查看全部按钮的字段
}
},
computed: {
type () {
if (this.$route.path.indexOf('Domestic') !== -1) {
return StandardSource.DOMESTIC.value
}
if (this.$route.path.indexOf('Overseas') !== -1) {
return StandardSource.OVERSEAS.value
}
return ''
},
pageTitle () {
if (this.type === StandardSource.DOMESTIC.value) {
return this.$t('system.tag.domesticLaws')
}
if (this.type === StandardSource.OVERSEAS.value) {
return this.$t('system.tag.foreignStandards')
}
return ''
},
// 按钮权限
btnPermission () {
let permission = {}
switch (this.type) {
// 国内标准法规
case StandardSource.DOMESTIC.value:
permission = DomesticStandardPermission
break
// 海外
case StandardSource.OVERSEAS.value:
permission = OverseasStandardPermission
break
default:
break
}
return permission
},
// 操作接口
operateApiFunc () {
let func = {}
switch (this.type) {
case StandardSource.DOMESTIC.value:
func = DomesticApi
break
case StandardSource.OVERSEAS.value:
func = OverseasApi
break
default:
break
}
return func
}
},
async created () {
await this.initForm()
this.initDetailData()
},
methods: {
/**
* 获取页面字段
*/
initForm () {
return new Promise(resolve => {
this.operateApiFunc.getFormFunc({ type: 1 }).then(res => {
if (res.success) {
const data = res.result || {}
this.partList = Object.keys(data)
const formList = Object.values(data).reduce((acc, cur) => acc.concat(cur), [])
this.fileField = []
formList.forEach(item => {
if (item.fieldShowType === FieldType.FILE_UP.value) {
this.fileField.push(item.dbFieldName)
}
})
this.form = data
} else {
this.$message.warn(res.message)
}
}).finally(() => {
resolve()
})
})
},
// 获取数据
initDetailData () {
this.loading = true
this.operateApiFunc.getDetailData({ id: this.$route.query.id, type: 1 }).then(res => {
if (res.success) {
this.detailData = Object.assign({}, res.result || {})
this.fileField.forEach(item => {
if (this.detailData[item]) {
const fileList = this.detailData[item].split(',')
const fileInfoList = []
fileList.forEach(async id => {
const fileInfo = await this.getFileInfo(id)
if (fileInfo) {
fileInfoList.push(fileInfo)
}
})
this.$set(this.detailData, item + 'List', fileInfoList)
}
})
console.log(this.detailData)
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
getFileInfo (fileId) {
return new Promise(resolve => {
let fileInfo
getFileInfo({ id: fileId }).then(res => {
if (res.success) {
fileInfo = res.result
}
}).finally(() => {
resolve(fileInfo)
})
})
},
/**
* 查看标准分解单
*/
previewStandardResolutionSheet (id) {
this.$refs.standardResolutionSheetModal.open(id)
},
// 查看全部
viewAll (fieldName) {
const data = this.detailData[fieldName + '_dictText'] || this.detailData[fieldName]
this.$refs.textContentModal.open(data)
},
handlePreview (file) {
if (!file || !file.url) {
return
}
// 截取文件后缀名
const fileSuffix = file.fileName ? file.fileName.split('.')[file.fileName.split('.').length - 1] : ''
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)
// 判断是否为可预览格式的文件
if (!canPreview) {
this.$message.loading('该文件类型不支持预览,正在为您准备下载...').then(() => {
this.handleDownload(file)
})
return
}
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
console.log(fileFullUrl)
// 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
this.imageUrl = getFileAccessHttpUrl(file.id)
// 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer
// 调用show方法进行显示预览图
viewer.show()
// this.$refs.imagePreviewModal.open(file)
return
}
// pdf预览
if (canPreview && FILE_TYPE_PDF.includes(fileSuffix.toLowerCase())) {
const url = previewPdf(file.id)
window.open(url)
return
}
// 其余可预览文件仍使用KKFile进行预览
kkFilePreview(fileFullUrl)
},
/**
* 无水印下载
* @param file
*/
handleDownload (file) {
// 下载文件
downloadFile(`/sys/common/noEncryptDownloadWithoutWaterMark/${file.id}`, file.fileName)
},
/**
* 有水印下载
* @param file
*/
handleWatermarkedDownload (file) {
downloadFile(`/sys/common/noEncryptDownload/${file.id}`, file.fileName)
},
async toStandardDetailPage (standardNumber) {
const standardInfo = await queryStandardInfoByStandardNumber(standardNumber)
if (!standardInfo) {
return
}
let path
// 根据来源跳转不同的详情页
switch (standardInfo.source) {
// 国内
case StandardSource.DOMESTIC.value:
path = '/standardRegulationLibrary/DomesticStandardDetail'
break
// 海外
case StandardSource.OVERSEAS.value:
path = '/standardRegulationLibrary/OverseasStandardDetail'
break
// 企标
case StandardSource.ENTERPRISE.value:
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
break
default:
break
}
if (!path) {
return
}
const query = {
id: standardInfo.id
}
this.$openPageNewSheet({
path, query
})
}
}
}
</script>
<style scoped lang="less">
.file-box {
flex: 1;
width: 0;
}
.file-btn > ::v-deep span {
display: inline;
color: @primary-color;
font-size: 14px;
}
.div-form-content {
word-break: break-all;
white-space: pre-wrap;
font-size: 16px;
font-family: PingFang SC-Regular, PingFang SC, sans-serif;
color: #1D2129;
-ms-flex: 1;
flex: 1;
width: 0;
}
.div-form-content > div {
display: inline-block;
}
.can-click {
display: inline-block;
color: @primary-color;
cursor: pointer;
}
</style>
@@ -1,84 +0,0 @@
<template>
<j-modal
:title="$t('standardRegulationLibrary.standardResolutionSheet')"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
fullscreen
switchFullscreen
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<div class="page-container">
<standard-resolution-sheet ref="resolutionSheet" />
</div>
</a-spin>
<template v-slot:footer>
<a-button @click="handleCancel">{{ $t('close') }}</a-button>
</template>
</j-modal>
</template>
<script>
import StandardResolutionSheet from '../../../../components/StandardResolutionSheet.vue'
export default {
name: 'StandardResolutionSheetModal',
components: { StandardResolutionSheet },
data () {
return {
width: '90%',
visible: false,
confirmLoading: false,
splitId: null,
isFullScreen: false
}
},
methods: {
open (id) {
this.visible = true
this.$nextTick(() => {
const ids = id.split(',')
this.$refs.resolutionSheet.queryParams = {
id: ids[0],
publishBeforeId: ids[1]
}
this.$refs.resolutionSheet.initClauseFieldList()
this.$refs.resolutionSheet.initDetailInfo()
})
},
handleCancel () {
this.visible = false
}
}
}
</script>
<style scoped lang="less">
.page-container {
min-height: 250px;
height: calc(100vh - 200px - 55px - 54px - 48px);
}
/deep/ .ant-modal-body {
background: #F0F2F4;
}
// 处理全屏状态下的样式问题
.j-modal-box.fullscreen .ant-modal-content .ant-modal-body {
.ant-spin-nested-loading {
height: 100%;
/deep/ .ant-spin-container {
height: 100%;
}
}
.page-container {
height: 100%;
}
}
</style>
@@ -1,705 +0,0 @@
<template>
<a-card :bordered="false" class="page-left-right-layout">
<!-- 树部分-->
<div class="page-left-box">
<a-input-search v-model="treeInput" class="tree-search"
:placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
@search="handleTreeSearch" />
<div class="page-tree-box page-tree-box-has-search">
<a-spin :spinning="treeLoading">
<a-tree :show-line="true"
:show-icon="true"
:tree-data="treeData"
:expanded-keys.sync="expandedKeys"
:selected-keys="selectedTreeKeys">
<template #title="record">
<div class="tree-operate-node"
@mouseenter="handleTreeMouseover(record.key)"
@mouseleave="handleTreeMouseout(record.key)"
@click="handleSelectTreeNode(record)">
<a-icon class="parent-node-icon"
type="folder"
v-if="record.dataRef.children && record.dataRef.children.length > 0" />
<a-tooltip>
<template #title>
{{ record.title }}
</template>
<span class="tree-node-custom-title">{{ record.title }}</span>
</a-tooltip>
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.key !== mouseInNodeKey}">
<!-- 新增-->
<a-button icon="plus"
class="tree-operate-node-btn"
@click.stop="handleAddTreeNode(record)"
v-if="record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
v-has="'domesticStandard:tree:add'"></a-button>
<!-- 编辑根节点不能编辑-->
<a-button class="tree-operate-node-btn"
@click.stop="handleEditTreeNode(record)"
v-has="'domesticStandard:tree:edit'"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value">
<i class="iconfont icon-bianji" />
</a-button>
<!-- 删除根节点不能删除-->
<a-button class="tree-operate-node-btn"
v-has="'domesticStandard:tree:delete'"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
@click.stop="handleDelTreeNode(record)">
<i class="iconfont icon-shanchu_" />
</a-button>
</div>
</div>
</template>
</a-tree>
</a-spin>
</div>
</div>
<!-- 表格部分-->
<div class="page-right-box">
<div class="table-page-search-wrapper">
<search ref="searchRef"
:url="url"
:get-query-condition-func="getQueryConditionFunc"
search-has="domesticStandard:search"
@search="searchQuery"
@reset="searchReset" />
</div>
<div class="table-operator">
<!-- 新增-->
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'domesticStandard:add'">{{ $t('newlyAdded') }}</a-button>
<!-- 导入-->
<a-upload name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
v-has="'domesticStandard:import'"
@change="handleImportExcel">
<a-button type="primary" icon="download" ghost>{{ $t('import') }}</a-button>
</a-upload>
<!-- 导出-->
<a-button icon="upload"
type="primary"
ghost
v-has="'domesticStandard:export'"
@click="handleExportXls($t('standardRegulationLibrary.domesticStandard.exportFileName'))">
{{ $t('export') }}
</a-button>
<!-- 带文件导出-->
<a-button icon="upload"
type="primary"
ghost
v-has="'domesticStandard:exportFile'"
@click="handleFileExport($t('standardRegulationLibrary.domesticStandard.exportFileName'))">
{{ $t('exportWithFile') }}
</a-button>
<!-- 模板下载-->
<a-button type="primary"
icon="download"
ghost
v-has="'domesticStandard:downTemplate'"
@click="downTemplate($t('standardRegulationLibrary.domesticStandard.templateName'))">
{{ $t('templateDownload') }}
</a-button>
<!-- 批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'domesticStandard:batchDel'">{{
$t('batchDelete')
}}
</a-button>
<!-- 配置标准-->
<a-button type="primary" icon="setting" ghost @click="handleConfigStandard" v-has="'domesticStandard:configStandard'">
{{ $t('standardRegulationLibrary.configStandard') }}
</a-button>
<!-- 移出标准-->
<a-button type="primary"
icon="minus-circle"
ghost
@click="handleRemoveStandard"
v-has="'domesticStandard:removeStandard'">
{{ $t('standardRegulationLibrary.removeStandard') }}
</a-button>
</div>
<div>
<j-table
v-if="columns && columns.length > 0"
ref="tableRef"
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:scroll="{x: '100%', y: yScrollHeight}"
:loading="loading"
@change="tableOnChange">
<!-- 标准编号-->
<template v-slot:standard_number="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{
text
}}
</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 标准名称-->
<template v-slot:standard_name="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{
text
}}
</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<template v-slot:operation="{text, record}">
<template v-if="operationList.length > operateMaxNum + 1">
<!-- 收藏-->
<a @click="operationClick(operationList[0],record)"
v-if="operationList[0].text === $t('standardRegulationLibrary.domesticStandard.cancelCollection')">
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
</a>
<a v-else @click="operationClick(operationList[0],record)">
<div class="operate-btn">
<!-- 查看图标-->
<i class="iconfont icon-link operate-btn-icon" v-if="operationList[0].text === $t('viewDetail')" />
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operationList[0].text === $t('edit')" />
<!-- 删除图标-->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operationList[0].text === $t('delete')" />
{{ operationList[0].text }}
</div>
</a>
<a-divider type="vertical" />
<a-dropdown placement="bottomCenter">
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
<a-menu slot="overlay">
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
<a @click="operationClick(operation,record)">
<div class="operate-btn">
<!-- 查看图标-->
<i class="iconfont icon-link operate-btn-icon" v-if="operation.text === $t('viewDetail')" />
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
<!-- 删除图标-->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
{{ operation.text }}
</div>
</a>
</a-menu-item>
</a-menu>
</a-dropdown>
</template>
<template v-else-if="operationList.length > 0">
<template v-for="(operation, index) in operationList">
<!-- 收藏-->
<a :key="index" @click="operationClick(operationList[0],record)"
v-if="operation.text === $t('standardRegulationLibrary.domesticStandard.cancelCollection')">
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
</a>
<a v-else @click="operationClick(operation,record)" style="display: inline-block">
<div class="operate-btn">
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
<!-- 删除图标-->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
{{ operation.text }}
</div>
</a>
<a-divider type="vertical" v-if="index !== operationList.length - 1" />
</template>
</template>
</template>
</j-table>
</div>
</div>
<!-- 新增编辑-->
<domestic-standard-modal ref="modalForm" @ok="modalFormOk" />
<!-- 树新增编辑-->
<domestic-system-tree-modal ref="treeModal" @ok="modalFormOk" />
<!-- 配置标准-->
<selection-domestic-standard-drawer ref="standardSelectionModal"
:node-code="selectedTreeNodeCodes[0]"
@change="continueConfigStandard" />
</a-card>
</template>
<script>
import '@assets/less/common.less'
import { ConfigurableTableMixin } from '@/mixins/ConfigurableTableMixin'
import Search from '../../../components/customField/Search.vue'
import JTable from '../../../components/jero/JTable.vue'
import DomesticStandardModal from './modules/DomesticStandardModal.vue'
import {
configDomesticStandard,
deleteDomesticSystemTree,
getDomesticStandardSearchForm,
getDomesticStandardTableHeader,
getDomesticStandardTree,
removeDomesticStandard,
collectionDomesticStandard,
cancelCollectionDomesticStandard
} from '../../../api/standardRegulationLibraryApi'
import {
OperationType,
StandardSource,
StandardStatus,
StandardSystemTreeNodeType,
YesOrNoEnum
} from '../../../enums/commonEnums'
import DomesticSystemTreeModal from './modules/DomesticSystemTreeModal.vue'
import SelectionDomesticStandardDrawer from './modules/SelectionDomesticStandardDrawer.vue'
import { postDownFile } from '@api/manage'
import { mapGetters } from 'vuex'
export default {
name: 'DomesticStandardList',
components: {
Search,
JTable,
DomesticStandardModal,
DomesticSystemTreeModal,
SelectionDomesticStandardDrawer
},
mixins: [ConfigurableTableMixin],
data () {
return {
StandardSystemTreeNodeType,
treeInput: null, // 树查询绑定值
treeData: [],
mouseInNodeKey: null, // 鼠标悬浮的节点key值
showAction: true,
operationList: [
// 收藏
{
text: this.$t('standardRegulationLibrary.domesticStandard.cancelCollection'),
clickEvent: 'handleCollection',
has: 'domesticStandard:collection'
},
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: 'domesticStandard:edit'
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: 'domesticStandard:delete'
}
],
getTableHeaderFunc: getDomesticStandardTableHeader,
getQueryConditionFunc: getDomesticStandardSearchForm,
url: {
list: '/laws/standard/domestic/getCommonPage',
delete: '/laws/standard/domestic/deleteByIdsAndModule',
deleteBatch: '/laws/standard/domestic/deleteByIdsAndModule',
downTemplateUrl: '/laws/standard/domestic/templateDownload', // 下载模板
exportXlsUrl: '/laws/standard/domestic/exportData', // 导出
exportZipUrl: '/laws/standard/domestic/exportDataWithFile', // 带文件导出
importExcelUrl: '/laws/standard/domestic/importExcelWithData' // 导入
},
yesValue: YesOrNoEnum.YES.value,
noValue: YesOrNoEnum.NO.value,
selectedTreeKeys: [], // 选中的树节点key
selectedTreeNodeCodes: [], // 选中树节点的code
tableSlotField: ['standard_name', 'standard_number'], // 表格中需要插槽的字段
treeLoading: false,
isCollection: false,
expandedKeys: [], // 展开的节点
needFilterTableBtn: true
}
},
computed: {
...mapGetters(['userInfo']),
importExcelUrl () {
return `${window._CONFIG.domianURL}/${this.url.importExcelUrl}`
},
// 当前用户是否管理员
isAdmin () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
},
created () {
this.initTreeData()
},
methods: {
/**
* 获取树数据
*/
initTreeData () {
this.treeLoading = true
const params = {
nodeName: this.treeInput
}
if (!params.nodeName) {
delete params.nodeName
}
getDomesticStandardTree(params).then(res => {
this.treeData = []
this.selectedTreeKeys = []
this.selectedTreeNodeCodes = []
this.filters.nodeCode = null
if (res.success) {
this.treeData = res.result || []
// 根节点默认展开
this.expandedKeys = [this.treeData[0].key]
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.treeLoading = false
})
},
/**
* 树节点查询
*/
handleTreeSearch () {
this.initTreeData()
},
/**
* 树节点鼠标移入
* @param key
*/
handleTreeMouseover (key) {
this.mouseInNodeKey = key
},
/**
* 树节点鼠标移出
* @param key
*/
handleTreeMouseout (key) {
if (this.mouseInNodeKey === key) {
this.mouseInNodeKey = null
}
},
/**
* 收藏/取消收藏
* @param record
*/
handleCollection ({ collectionFlag, id: standardId, standard_number: standardNumber }) {
if (this.isCollection) {
return
}
this.isCollection = true
let params
let submitFunc
// 取消收藏
if (collectionFlag) {
params = { id: standardId, standardNumber }
submitFunc = cancelCollectionDomesticStandard
} else {
params = { standardId, standardNumber }
submitFunc = collectionDomesticStandard
}
// 收藏
submitFunc(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.isCollection = false
})
},
modalFormOk () {
this.selectedTreeKeys = []
this.filters.nodeCode = null
this.initTreeData()
// 新增/修改 成功时,重载列表
this.loadData()
// 清空列表选中
this.onClearSelected()
},
/**
* 新增树节点
* @param dataRef
*/
handleAddTreeNode ({ dataRef }) {
this.$refs.treeModal.add({ parentId: dataRef.id, parentCode: dataRef.nodeCode })
},
/**
* 编辑树节点
* @param dataRef
*/
handleEditTreeNode ({ dataRef }) {
this.$refs.treeModal.edit(dataRef)
},
/**
* 删除树节点
* @param dataRef
*/
handleDelTreeNode ({ dataRef }) {
this.$confirm({
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
deleteDomesticSystemTree({ id: dataRef.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warning(res.message)
}
})
}
})
},
/**
* 选中树节点
* @param dataRef
*/
handleSelectTreeNode ({ dataRef }) {
this.selectedTreeKeys = [dataRef.key]
this.selectedTreeNodeCodes = [dataRef.nodeCode]
this.filters.nodeCode = dataRef.nodeCode
this.loadData(1)
},
/**
* 配置标准
*/
handleConfigStandard () {
if (!this.selectedTreeNodeCodes || this.selectedTreeNodeCodes.length === 0 ||
this.selectedTreeNodeCodes.includes('MyCollection') || this.selectedTreeNodeCodes.includes('A02')) {
this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode'))
return
}
this.$refs.standardSelectionModal.open()
},
/**
* 配置标准-提交
* @param dbFieldName
* @param standardIds
*/
continueConfigStandard (dbFieldName, standardIds) {
this.loading = true
const params = {
nodeCode: this.selectedTreeNodeCodes[0],
ids: standardIds
}
configDomesticStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 移出标准
*/
handleRemoveStandard () {
// 没选择左侧树节点,需要提示“请先选择二级及以下体系”
if (!this.selectedTreeNodeCodes || this.selectedTreeNodeCodes.length === 0 || this.selectedTreeNodeCodes.includes('A02')) {
this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode'))
return
}
// 左侧节点选的是我的收藏,不可移出标准
if (this.selectedTreeNodeCodes[0] === 'MyCollection') {
this.$message.warn(this.$t('enterpriseStandardLibrary.standard.myCollectNotRemove'))
return
}
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('standardRegulationLibrary.selectLeastOneTableData'))
return
}
this.loading = true
const params = {
nodeCode: this.selectedTreeNodeCodes[0],
ids: this.selectedRowKeys.join(',')
}
removeDomesticStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
if (this.ipagination.current > 1 && ((this.ipagination.current - 1) * this.ipagination.pageSize) + 1 === this.ipagination.total) {
this.ipagination.current -= 1
}
this.loadData()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 跳转详情页
* @param id
* @param standardNumber
*/
toDetailPage ({ id }) {
this.$openPageNewSheet({
path: '/standardRegulationLibrary/DomesticStandardDetail',
query: {
id
}
})
},
/**
* 重置查询
*/
searchReset (params) {
this.searchParams = Object.assign({}, params)
this.selectedRowKeys = []
this.selectedTreeKeys = []
delete this.filters.nodeCode
this.getTableHeader()
this.loadData()
},
// 导出改成用post
handleExportXls (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
postDownFile(this.url.exportXlsUrl, param).then((data) => {
if (!data || data.size === 0) {
this.$message.warning('文件下载失败')
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName + '.xls')
} else {
const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName + '.xls')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
// 带文件导出
handleFileExport (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
param.module = StandardSource.DOMESTIC.value
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
postDownFile(this.url.exportZipUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName + '.zip')
} else {
const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName + '.zip')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
// }
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
/**
* 新增-非管理员用户跳转流程发起页面,不能修改操作类型
*/
handleAdd () {
if (!this.isAdmin) {
this.$router.push({
path: '/workCenter/StandardEntryOrChangeProcess',
query: {
source: StandardSource.DOMESTIC.value, // 国内标准
operateType: OperationType.ENTRY.value // 入库
}
})
return
}
this.$refs.modalForm.add()
this.$refs.modalForm.title = this.$t('newlyAdded')
this.$refs.modalForm.disableSubmit = false
},
handleEdit (record) {
if (!this.isAdmin) {
this.$router.push({
path: '/workCenter/StandardEntryOrChangeProcess',
query: {
source: StandardSource.DOMESTIC.value, // 国内标准
operateType: OperationType.CHANGE.value, // 变更
standardId: record.id // 标准id
}
})
return
}
this.$refs.modalForm.edit(record)
this.$refs.modalForm.title = this.$t('edit')
this.$refs.modalForm.disableSubmit = false
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
color: #1D2129;
}
.parent-node-icon {
color: #1D2129;
font-size: 16px;
margin-right: 10px;
}
</style>
@@ -1,144 +0,0 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
:maskClosable="false"
destroyOnClose
class="custom-drawer-style"
>
<div class="custom-drawer-style-scroll">
<a-spin :spinning="confirmLoading" style="width: 100%;height:100%">
<add-form ref="addForm"
:flag="StandardSource.DOMESTIC.value"
:get-form-func="getFormFunc"
:get-document-info-func="getDocumentInfoFunc"
:special-placeholder="specialPlaceholder"
:default-value="defaultValue"
:disabled-field-list="disabledField"
:open-selected-all-field-list="openSelectedAllFieldList"
:exclude-standard-fields="excludeStandardFields"
domestic-special-check
:flag-by-field="{associated_foreign_standards: StandardSource.OVERSEAS.value}"
@submitFormData="submitFormData" />
</a-spin>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleCancel" style="margin-bottom: 0;" :loading="confirmLoading">{{ $t('close') }}</a-button>
<a-button @click="handleOk" type="primary" style="margin-bottom: 0;" :loading="confirmLoading">
{{ $t('preservation') }}
</a-button>
</div>
</a-drawer>
</template>
<script>
import AddForm from '../../../../components/customField/AddForm.vue'
import {
getDomesticStandardDocumentInfo,
getDomesticStandardFormModal,
addDomesticStandard,
editDomesticStandard
} from '../../../../api/standardRegulationLibraryApi'
import { StandardSource } from '../../../../enums/commonEnums.js'
export default {
name: 'DomesticStandardModal',
components: { AddForm },
data () {
return {
StandardSource,
visible: false,
title: '',
width: 800,
// 存储表单的数据
form: {},
confirmLoading: false,
getFormFunc: getDomesticStandardFormModal,
getDocumentInfoFunc: getDomesticStandardDocumentInfo,
// 特殊的placeholder
specialPlaceholder: {
standard_number_temp: `${this.$t('standardRegulationLibrary.inputExample')}7258`
},
defaultValue: {
year_number: new Date().getFullYear() + ''
},
// 数据字典多选,需要全选功能的字段
openSelectedAllFieldList: [
'applicable_vehicle', // 适用车型
'dynamic_type' // 动力类型
],
isEdit: null // 是否编辑
}
},
computed: {
// 不可编辑的字段
disabledField () {
if (this.isEdit) {
// 标准编号,被代替标准号,被引用标准号,标准类别,年代号
return ['standard_number_temp', 'replaced_by_standard_number', 'referenced_standard', 'standard_class', 'year_number']
}
return ['replaced_by_standard_number', 'referenced_standard']
},
excludeStandardFields () {
if (this.isEdit) {
return ['substitute_standard_number', 'reference_standard']
}
return []
}
},
methods: {
add () {
this.visible = true
this.isEdit = false
this.$nextTick(() => {
this.$refs.addForm.add()
})
},
edit (record) {
this.visible = true
this.isEdit = true
this.$nextTick(() => {
this.$refs.addForm.edit(record)
})
},
handleOk () {
this.$refs.addForm.submit()
},
// 表单提交的回调,获取表单数据
submitFormData (formInline) {
this.confirmLoading = true
let submitFunc
if (formInline.id) {
submitFunc = editDomesticStandard
} else {
submitFunc = addDomesticStandard
}
submitFunc(formInline).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
},
handleCancel () {
this.close()
},
close () {
this.visible = false
}
}
}
</script>
<style scoped>
</style>
@@ -1,103 +0,0 @@
<template>
<j-modal
:title="title"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardRegulationLibrary.nodeName')">
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.nodeName')"
:maxLength="50"
v-decorator="['nodeName', validatorRules.nodeName]" />
</a-form-item>
</a-form>
</j-modal>
</template>
<script>
import { addDomesticSystemTree, editDomesticSystemTree } from '../../../../api/standardRegulationLibraryApi'
export default {
name: 'DomesticSystemTreeModal',
data () {
return {
title: this.$t('operation'),
width: 800,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
validatorRules: {
// 节点名称
nodeName: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.nodeName') }],
validateTrigger: 'blur'
}
}
}
},
methods: {
add (parentInfo) {
this.edit(parentInfo)
},
edit (record) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(this.model)
})
},
close () {
this.visible = false
},
handleOk () {
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
const formData = Object.assign(this.model, values)
formData.nodeOrder = '0'
let submitFunc
if (this.model.id) {
submitFunc = editDomesticSystemTree
} else {
submitFunc = addDomesticSystemTree
}
submitFunc(formData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}
})
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped lang="less">
</style>
@@ -1,238 +0,0 @@
<template>
<a-drawer
:title="$t('standardSelect.standardSelection')"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
class="custom-drawer-style">
<div class="custom-drawer-style-scroll">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :sm="8">
<a-form-item :label="$t('standardSelect.standardNumOrName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('standardSelect.standardNumOrName')"
v-model="queryParam.standardNumberOrName"></a-input>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;margin-right: 41px;margin-bottom: 20px"
class="table-page-search-submitButtons">
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{
$t('query')
}}
</a-button>
</div>
</a-row>
</a-form>
</div>
<a-table
:columns="columns"
rowKey="serial_number"
:scroll="{x: 900}"
:data-source="dataList"
:pagination="ipagination"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:loading="loading"
@change="handleTableChange">
<!-- 标准编号标准名称跳转详情-->
<template v-slot:detail="text, record">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{ text }}</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
</a-table>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleCancel">{{ $t('cancel') }}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{ $t('submit') }}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getDomesticStandardNoSystem } from '../../../../api/standardRegulationLibraryApi.js'
import { StandardSource } from '../../../../enums/commonEnums.js'
export default {
name: 'SelectionDomesticStandardDrawer',
props: {
// 选中节点code
nodeCode: {
type: String,
required: false,
default: null
},
query: {
type: Object,
required: false,
default: () => {
return {}
}
}
},
data () {
return {
visible: false,
confirmLoading: false,
labelCol: {
sm: 8
},
wrapperCol: {
sm: 14
},
selectedRowKeys: [],
selectedRowList: [],
loading: false,
queryParam: {},
/* 分页参数 */
ipagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
columns: [
// 标准号
{
title: this.$t('standardSelect.standardNumber'),
dataIndex: 'standardNumber',
align: 'center',
width: 150,
scopedSlots: { customRender: 'detail' }
},
// 标准名称
{
title: this.$t('standardSelect.standardName'),
dataIndex: 'standardName',
align: 'center',
width: 150,
scopedSlots: { customRender: 'detail' }
},
// 发布日期
{
title: this.$t('standardSelect.releaseDate'),
dataIndex: 'releaseDate',
align: 'center',
width: 120,
scopedSlots: { customRender: 'text' }
},
// 标准状态
{
title: this.$t('projectLibrary.vehicleItemLibrary.standardState'),
dataIndex: 'standardState_dictText',
align: 'center',
width: 120,
scopedSlots: { customRender: 'text' }
}
],
dataList: [],
url: {
searchList: 'document/bussDocumentLibraryEO/queryCondition' // 搜索字段
}
}
},
methods: {
open () {
this.visible = true
this.queryParam = {}
this.replacePage()
},
// 获取表格数据
replacePage () {
const query = {
...this.queryParam,
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize,
nodeCode: this.nodeCode,
source: StandardSource.DOMESTIC.value
}
this.selectedRowKeys = []
this.loading = true
getDomesticStandardNoSystem(query).then((res) => {
if (res.success) {
this.dataList = res.result.records
this.ipagination.total = res.result.total
this.selectedRowKeys = this.standard[this.query.db_field_name] ? this.standard[this.query.db_field_name].split(',') : []
} else {
this.dataList = []
}
}).finally(() => {
this.loading = false
})
},
searchQuery () {
this.replacePage()
},
searchReset () {
this.queryParam = {}
this.replacePage()
},
// 表格选择改变
onSelectChange (value, row) {
this.selectedRowKeys = value
this.selectedRowList = row
},
handleCancel () {
this.visible = false
},
handleSubmit () {
const serialNumber = []
const replaceStandardId = []
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
// let content = JSON.parse(JSON.stringify(this.selectedRowList))
this.selectedRowList.forEach(res => {
serialNumber.push(res.serial_number)
replaceStandardId.push(res.id)
})
this.$emit('input', serialNumber.join(','))
this.$emit('change', this.query.dbFieldName, replaceStandardId.join(','))
// this.$emit('changecontent', this.content)
this.visible = false
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
/**
* 跳转详情页
* @param id
*/
toDetailPage ({ id }) {
this.$openPageNewSheet({
path: '/standardRegulationLibrary/DomesticStandardDetail',
query: {
id
}
})
},
handleTableChange (pagination) {
this.ipagination = pagination
this.replacePage()
}
}
}
</script>
<style scoped>
</style>
@@ -1,706 +0,0 @@
<template>
<a-card :bordered="false" class="page-left-right-layout">
<!-- 树部分-->
<div class="page-left-box">
<a-input-search v-model="treeInput" class="tree-search"
:placeholder="$t('standardRegulationLibrary.domesticStandard.treeSearchPlaceholder')"
@search="handleTreeSearch" />
<div class="page-tree-box page-tree-box-has-search">
<a-spin :spinning="treeLoading">
<a-tree :show-line="true"
:show-icon="true"
:tree-data="treeData"
:expanded-keys.sync="expandedKeys"
:selected-keys="selectedTreeKeys">
<template #title="record">
<div class="tree-operate-node"
@mouseenter="handleTreeMouseover(record.key)"
@mouseleave="handleTreeMouseout(record.key)"
@click="handleSelectTreeNode(record)">
<a-icon class="parent-node-icon"
type="folder"
v-if="record.dataRef.children && record.dataRef.children.length > 0" />
<a-tooltip>
<template #title>
{{ record.title }}
</template>
<span class="tree-node-custom-title">{{ record.title }}</span>
</a-tooltip>
<div class="tree-operate-node-btn-box" :class="{'tree-operate-node-btn-box-hide': record.key !== mouseInNodeKey}">
<!-- 新增-->
<a-button icon="plus"
class="tree-operate-node-btn"
@click.stop="handleAddTreeNode(record)"
v-if="record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
v-has="'overseasStandard:tree:add'"></a-button>
<!-- 编辑根节点不能编辑-->
<a-button class="tree-operate-node-btn"
@click.stop="handleEditTreeNode(record)"
v-has="'overseasStandard:tree:edit'"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value">
<i class="iconfont icon-bianji" />
</a-button>
<!-- 删除根节点不能删除-->
<a-button class="tree-operate-node-btn"
v-has="'overseasStandard:tree:delete'"
v-if="record.nodeType !== StandardSystemTreeNodeType.ROOT_NODE.value && record.nodeType !== StandardSystemTreeNodeType.NOT_OPERATE_NODE.value"
@click.stop="handleDelTreeNode(record)">
<i class="iconfont icon-shanchu_" />
</a-button>
</div>
</div>
</template>
</a-tree>
</a-spin>
</div>
</div>
<!-- 表格部分-->
<div class="page-right-box">
<div class="table-page-search-wrapper">
<search ref="searchRef"
:url="url"
:get-query-condition-func="getQueryConditionFunc"
search-has="overseasStandard:search"
@search="searchQuery"
@reset="searchReset" />
</div>
<div class="table-operator">
<!-- 新增-->
<a-button icon="plus" type="primary" @click="handleAdd" v-has="'overseasStandard:add'">{{ $t('newlyAdded') }}</a-button>
<!-- 导入-->
<a-upload name="file"
:showUploadList="false"
:multiple="false"
:headers="tokenHeader"
:action="importExcelUrl"
v-has="'overseasStandard:import'"
@change="handleImportExcel">
<a-button type="primary" icon="download" ghost>{{ $t('import') }}</a-button>
</a-upload>
<!-- 导出-->
<a-button icon="upload"
type="primary"
ghost
v-has="'overseasStandard:export'"
@click="handleExportXls($t('standardRegulationLibrary.overseasStandard.exportFileName'))">
{{ $t('export') }}
</a-button>
<!-- 带文件导出-->
<a-button icon="upload"
type="primary"
ghost
v-has="'overseasStandard:exportFile'"
@click="handleFileExport($t('standardRegulationLibrary.overseasStandard.exportFileName'))">
{{ $t('exportWithFile') }}
</a-button>
<!-- 模板下载-->
<a-button type="primary"
icon="download"
ghost
v-has="'overseasStandard:downTemplate'"
@click="downTemplate($t('standardRegulationLibrary.overseasStandard.templateName'))">
{{ $t('templateDownload') }}
</a-button>
<!-- 批量删除-->
<a-button type="primary" icon="delete" ghost @click="batchDel" v-has="'overseasStandard:batchDel'">{{
$t('batchDelete')
}}
</a-button>
<!-- 配置标准-->
<a-button type="primary" icon="setting" ghost @click="handleConfigStandard" v-has="'overseasStandard:configStandard'">
{{ $t('standardRegulationLibrary.configStandard') }}
</a-button>
<!-- 移出标准-->
<a-button type="primary"
icon="minus-circle"
ghost
@click="handleRemoveStandard"
v-has="'overseasStandard:removeStandard'">
{{ $t('standardRegulationLibrary.removeStandard') }}
</a-button>
</div>
<div>
<j-table
v-if="columns && columns.length > 0"
ref="tableRef"
:columns="columns"
:dataSource="dataSource"
:can-drag="true"
rowKey="id"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="ipagination"
:scroll="{x: '100%', y: yScrollHeight}"
:loading="loading"
@change="tableOnChange">
<!-- 标准编号-->
<template v-slot:standard_number="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{
text
}}
</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 标准名称-->
<template v-slot:standard_name="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{
text
}}
</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<template v-slot:operation="{text, record}">
<template v-if="operationList.length > operateMaxNum + 1">
<!-- 收藏-->
<a @click="operationClick(operationList[0],record)"
v-if="operationList[0].text === $t('standardRegulationLibrary.domesticStandard.cancelCollection')">
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
</a>
<a v-else @click="operationClick(operationList[0],record)">
<div class="operate-btn">
<!-- 查看图标-->
<i class="iconfont icon-link operate-btn-icon" v-if="operationList[0].text === $t('viewDetail')" />
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operationList[0].text === $t('edit')" />
<!-- 删除图标-->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operationList[0].text === $t('delete')" />
{{ operationList[0].text }}
</div>
</a>
<a-divider type="vertical" />
<a-dropdown placement="bottomCenter">
<a-icon type="more" class="operate-icon-btn operate-icon-more" />
<a-menu slot="overlay">
<a-menu-item v-for="(operation, index) in operationList.slice(operateMaxNum)" :key="index">
<a @click="operationClick(operation,record)">
<div class="operate-btn">
<!-- 查看图标-->
<i class="iconfont icon-link operate-btn-icon" v-if="operation.text === $t('viewDetail')" />
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
<!-- 删除图标-->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
{{ operation.text }}
</div>
</a>
</a-menu-item>
</a-menu>
</a-dropdown>
</template>
<template v-else-if="operationList.length > 0">
<template v-for="(operation, index) in operationList">
<!-- 收藏-->
<a :key="index" @click="operationClick(operationList[0],record)"
v-if="operation.text === $t('standardRegulationLibrary.domesticStandard.cancelCollection')">
<i class="iconfont icon-star1" v-show="record.collectionFlag" />
<i class="iconfont icon-star" v-show="!record.collectionFlag" />
</a>
<a v-else @click="operationClick(operation,record)" style="display: inline-block">
<div class="operate-btn">
<!-- 编辑图标-->
<i class="iconfont icon-bianji operate-btn-icon" v-if="operation.text === $t('edit')" />
<!-- 删除图标-->
<i class="iconfont icon-shanchu_ operate-btn-icon" v-if="operation.text === $t('delete')" />
{{ operation.text }}
</div>
</a>
<a-divider type="vertical" v-if="index !== operationList.length - 1" />
</template>
</template>
</template>
</j-table>
</div>
</div>
<!-- 新增编辑-->
<overseas-standard-modal ref="modalForm" @ok="modalFormOk" />
<!-- 树新增编辑-->
<overseas-system-tree-modal ref="treeModal" @ok="modalFormOk" />
<!-- 配置标准-->
<selection-overseas-standard-drawer ref="standardSelectionModal"
:node-code="selectedTreeNodeCodes[0]"
@change="continueConfigStandard" />
</a-card>
</template>
<script>
import '@assets/less/common.less'
import { ConfigurableTableMixin } from '../../../mixins/ConfigurableTableMixin'
import Search from '../../../components/customField/Search.vue'
import JTable from '../../../components/jero/JTable.vue'
import {
getOverseasStandardSearchForm,
getOverseasStandardTableHeader,
getOverseasStandardSystem,
collectionOverseasStandard,
cancelCollectionOverseasStandard,
deleteOverseasStandardSystem,
configOverseasStandard,
removeOverseasStandard
} from '../../../api/standardRegulationLibraryApi'
import {
OperationType,
StandardSource,
StandardStatus,
StandardSystemTreeNodeType,
YesOrNoEnum
} from '../../../enums/commonEnums'
import OverseasStandardModal from './modules/OverseasStandardModal.vue'
import OverseasSystemTreeModal from './modules/OverseasSystemTreeModal.vue'
import SelectionOverseasStandardDrawer from './modules/SelectionOverseasStandardDrawer.vue'
import { postDownFile } from '../../../api/manage.js'
import { mapGetters } from 'vuex'
export default {
name: 'OverseasStandardList',
components: {
Search,
JTable,
OverseasStandardModal,
OverseasSystemTreeModal,
SelectionOverseasStandardDrawer
},
mixins: [ConfigurableTableMixin],
data () {
return {
StandardSystemTreeNodeType,
treeInput: null, // 树查询绑定值
treeData: [],
mouseInNodeKey: null, // 鼠标悬浮的节点key值
showAction: true,
operationList: [
// 收藏
{
text: this.$t('standardRegulationLibrary.domesticStandard.cancelCollection'),
clickEvent: 'handleCollection',
has: 'overseasStandard:collection'
},
// 编辑
{
text: this.$t('edit'),
clickEvent: 'handleEdit',
has: 'overseasStandard:edit'
},
// 删除
{
text: this.$t('delete'),
clickEvent: 'handleDelete',
has: 'overseasStandard:delete'
}
],
getTableHeaderFunc: getOverseasStandardTableHeader,
getQueryConditionFunc: getOverseasStandardSearchForm,
url: {
list: '/laws/standard/overseas/getCommonPage',
delete: '/laws/standard/overseas/deleteByIdsAndModule',
deleteBatch: '/laws/standard/overseas/deleteByIdsAndModule',
downTemplateUrl: '/laws/standard/overseas/templateDownload', // 下载模板
exportXlsUrl: '/laws/standard/overseas/exportData', // 导出
exportZipUrl: '/laws/standard/overseas/exportDataWithFile', // 带文件导出
importExcelUrl: '/laws/standard/overseas/importExcelWithData' // 导入
},
yesValue: YesOrNoEnum.YES.value,
noValue: YesOrNoEnum.NO.value,
selectedTreeKeys: [], // 选中的树节点key
selectedTreeNodeCodes: [], // 选中树节点的code
tableSlotField: ['standard_name', 'standard_number'], // 表格中需要插槽的字段
treeLoading: false,
isCollection: false,
expandedKeys: []
}
},
computed: {
...mapGetters(['userInfo']),
importExcelUrl () {
return `${window._CONFIG.domianURL}/${this.url.importExcelUrl}`
},
// 当前用户是否管理员
isAdmin () {
const adminRoleList = window._CONFIG.adminRoleCode.split(',')
const userRoleList = this.userInfo.roleCode.split(',')
return userRoleList.some(tt => adminRoleList.includes(tt))
}
},
created () {
this.initTreeData()
},
methods: {
/**
* 获取树数据
*/
initTreeData () {
this.treeLoading = true
const params = {
nodeName: this.treeInput
}
if (!params.nodeName) {
delete params.nodeName
}
getOverseasStandardSystem(params).then(res => {
this.treeData = []
this.selectedTreeKeys = []
this.selectedTreeNodeCodes = []
this.filters.nodeCode = null
if (res.success) {
this.treeData = res.result || []
// 根节点默认展开
this.expandedKeys = [this.treeData[0].key]
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.treeLoading = false
})
},
/**
* 树节点查询
*/
handleTreeSearch () {
this.initTreeData()
},
/**
* 树节点鼠标移入
* @param key
*/
handleTreeMouseover (key) {
this.mouseInNodeKey = key
},
/**
* 树节点鼠标移出
* @param key
*/
handleTreeMouseout (key) {
if (this.mouseInNodeKey === key) {
this.mouseInNodeKey = null
}
},
/**
* 收藏/取消收藏
* @param record
*/
handleCollection ({ collectionFlag, id: standardId, standard_number: standardNumber }) {
if (this.isCollection) {
return
}
this.isCollection = true
let params
let submitFunc
// 取消收藏
if (collectionFlag) {
params = { id: standardId, standardNumber }
submitFunc = cancelCollectionOverseasStandard
} else {
params = { standardId, standardNumber }
submitFunc = collectionOverseasStandard
}
// 收藏
submitFunc(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.isCollection = false
})
},
modalFormOk () {
this.selectedTreeKeys = []
this.filters.nodeCode = null
this.initTreeData()
// 新增/修改 成功时,重载列表
this.loadData()
// 清空列表选中
this.onClearSelected()
},
/**
* 新增树节点
* @param dataRef
*/
handleAddTreeNode ({ dataRef }) {
this.$refs.treeModal.add({ parentId: dataRef.id, parentCode: dataRef.nodeCode })
},
/**
* 编辑树节点
* @param dataRef
*/
handleEditTreeNode ({ dataRef }) {
this.$refs.treeModal.edit(dataRef)
},
/**
* 删除树节点
* @param dataRef
*/
handleDelTreeNode ({ dataRef }) {
this.$confirm({
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
deleteOverseasStandardSystem({ id: dataRef.id }).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.modalFormOk()
} else {
this.$message.warning(res.message)
}
})
}
})
},
/**
* 选中树节点
* @param dataRef
*/
handleSelectTreeNode ({ dataRef }) {
this.selectedTreeKeys = [dataRef.key]
this.selectedTreeNodeCodes = [dataRef.nodeCode]
this.filters.nodeCode = dataRef.nodeCode
this.loadData(1)
},
/**
* 配置标准
*/
handleConfigStandard () {
// 请先选择二级及以下体系
if (!this.selectedTreeNodeCodes || this.selectedTreeNodeCodes.length === 0 ||
this.selectedTreeNodeCodes.includes('MyCollection') || this.selectedTreeNodeCodes.includes('A03')) {
this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode'))
return
}
this.$refs.standardSelectionModal.open()
},
/**
* 配置标准-提交
* @param dbFieldName
* @param standardIds
*/
continueConfigStandard (dbFieldName, standardIds) {
this.loading = true
const params = {
nodeCode: this.selectedTreeNodeCodes[0],
ids: standardIds
}
configOverseasStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
this.loadData()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 移出标准
*/
handleRemoveStandard () {
// 没选择左侧树节点,需要提示“请先选择二级及以下体系”
if (!this.selectedTreeNodeCodes || this.selectedTreeNodeCodes.length === 0 || this.selectedTreeNodeCodes.includes('A03')) {
this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode'))
return
}
// 左侧节点选的是我的收藏,不可移出标准
if (this.selectedTreeNodeCodes[0] === 'MyCollection') {
this.$message.warn(this.$t('enterpriseStandardLibrary.standard.myCollectNotRemove'))
return
}
// 没有选择列表数据,需要提示“选中至少一条列表数据”
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('standardRegulationLibrary.selectLeastOneTableData'))
return
}
this.loading = true
const params = {
nodeCode: this.selectedTreeNodeCodes[0],
ids: this.selectedRowKeys.join(',')
}
removeOverseasStandard(params).then(res => {
if (res.success) {
this.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
if (this.ipagination.current > 1 && ((this.ipagination.current - 1) * this.ipagination.pageSize) + 1 === this.ipagination.total) {
this.ipagination.current -= 1
}
this.loadData()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.loading = false
})
},
/**
* 跳转详情页
* @param id
* @param standardNumber
*/
toDetailPage ({ id }) {
this.$openPageNewSheet({
path: '/standardRegulationLibrary/OverseasStandardDetail',
query: {
id
}
})
},
/**
* 重置查询
*/
searchReset (params) {
this.searchParams = Object.assign({}, params)
this.selectedRowKeys = []
this.selectedTreeKeys = []
delete this.filters.nodeCode
this.getTableHeader()
this.loadData()
},
// 导出改成用post
handleExportXls (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
postDownFile(this.url.exportXlsUrl, param).then((data) => {
if (!data || data.size === 0) {
this.$message.warning('文件下载失败')
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName + '.xls')
} else {
const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName + '.xls')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
// 带文件导出
handleFileExport (fileName) {
if (!fileName || typeof fileName !== 'string') {
fileName = '导出文件'
}
const param = this.getQueryParams()
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
param.selections = this.selectedRowKeys.join(',')
}
param.module = StandardSource.OVERSEAS.value
console.log('导出参数', param)
// 加一个大的提示
const modalLoading = this.$info({
title: '提示',
content: <span>正在导出请稍候 <a-spin size="small" /></span>,
keyboard: false
})
// 把知道了这个按钮去掉
this.$nextTick(() => {
document.getElementsByClassName('ant-modal-confirm-btns')[0].style = 'display:none'
})
postDownFile(this.url.exportZipUrl, param).then((data) => {
if (!data) {
this.$message.warning('文件下载失败')
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data]), fileName + '.zip')
} else {
const url = window.URL.createObjectURL(new Blob([data]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName + '.zip')
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
}
// }
}).finally(() => {
// 销毁这个提示
modalLoading.destroy()
})
},
/**
* 新增-非管理员用户跳转流程发起页面,不能修改操作类型
*/
handleAdd () {
if (!this.isAdmin) {
this.$router.push({
path: '/workCenter/StandardEntryOrChangeProcess',
query: {
source: StandardSource.OVERSEAS.value, // 海外标准
operateType: OperationType.ENTRY.value // 入库
}
})
return
}
this.$refs.modalForm.add()
this.$refs.modalForm.title = this.$t('newlyAdded')
this.$refs.modalForm.disableSubmit = false
},
handleEdit (record) {
if (!this.isAdmin) {
this.$router.push({
path: '/workCenter/StandardEntryOrChangeProcess',
query: {
source: StandardSource.OVERSEAS.value, // 海外标准
operateType: OperationType.CHANGE.value, // 变更
standardId: record.id // 标准id
}
})
return
}
this.$refs.modalForm.edit(record)
this.$refs.modalForm.title = this.$t('edit')
this.$refs.modalForm.disableSubmit = false
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
/deep/ .ant-tree li span.ant-tree-switcher.ant-tree-switcher-noop {
color: #1D2129;
}
.parent-node-icon {
color: #1D2129;
font-size: 16px;
margin-right: 10px;
}
</style>
@@ -1,143 +0,0 @@
<template>
<a-drawer
:title="title"
:width="width"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
:maskClosable="false"
destroyOnClose
class="custom-drawer-style"
>
<div class="custom-drawer-style-scroll">
<a-spin :spinning="confirmLoading" style="width: 100%;height:100%">
<add-form ref="addForm"
:flag="StandardSource.OVERSEAS.value"
:get-form-func="getFormFunc"
:get-document-info-func="getDocumentInfoFunc"
:special-placeholder="specialPlaceholder"
:default-value="defaultValue"
:disabled-field-list="disabledField"
:open-selected-all-field-list="openSelectedAllFieldList"
:exclude-standard-fields="excludeStandardFields"
@submitFormData="submitFormData" />
</a-spin>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleCancel" style="margin-bottom: 0;" :loading="confirmLoading">{{ $t('close') }}</a-button>
<a-button @click="handleOk" type="primary" style="margin-bottom: 0;" :loading="confirmLoading">
{{ $t('preservation') }}
</a-button>
</div>
</a-drawer>
</template>
<script>
import AddForm from '../../../../components/customField/AddForm.vue'
import {
getOverseasStandardForm,
getOverseasStandardDocumentInfo,
addOverseasStandard,
editOverseasStandard
} from '../../../../api/standardRegulationLibraryApi'
import { StandardSource } from '../../../../enums/commonEnums.js'
export default {
name: 'OverseasStandardModal',
components: { AddForm },
data () {
return {
StandardSource,
visible: false,
title: '',
width: 800,
// 存储表单的数据
form: {},
confirmLoading: false,
getFormFunc: getOverseasStandardForm,
getDocumentInfoFunc: getOverseasStandardDocumentInfo,
// 特殊的placeholder
specialPlaceholder: {
standard_number_temp: `${this.$t('standardRegulationLibrary.inputExample')}7258`
},
defaultValue: {
year_number: new Date().getFullYear() + ''
},
// 数据字典多选,需要全选功能的字段
openSelectedAllFieldList: [
'applicable_vehicle', // 适用车型
'dynamic_type' // 动力类型
],
isEdit: null // 是否编辑
}
},
computed: {
// 不可编辑的字段
disabledField () {
console.log(this.isEdit)
if (this.isEdit) {
// 标准编号,被代替标准号,被引用标准号
return ['standard_class', 'year_number', 'standard_number_temp', 'replaced_by_standard_number', 'referenced_standard']
}
return ['replaced_by_standard_number', 'referenced_standard']
},
excludeStandardFields () {
if (this.isEdit) {
return ['substitute_standard_number', 'reference_standard']
}
return []
}
},
methods: {
add () {
this.visible = true
this.isEdit = false
this.$nextTick(() => {
this.$refs.addForm.add()
})
},
edit (record) {
this.visible = true
this.isEdit = true
this.$nextTick(() => {
this.$refs.addForm.edit(record)
})
},
handleOk () {
this.$refs.addForm.submit()
},
// 表单提交的回调,获取表单数据
submitFormData (formInline) {
this.confirmLoading = true
let submitFunc
if (formInline.id) {
submitFunc = editOverseasStandard
} else {
submitFunc = addOverseasStandard
}
submitFunc(formInline).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
},
handleCancel () {
this.close()
},
close () {
this.visible = false
}
}
}
</script>
<style scoped>
</style>
@@ -1,103 +0,0 @@
<template>
<j-modal
:title="title"
:maskClosable="false"
:width="width"
:visible="visible"
:confirm-loading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel">
<a-form :form="form">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardRegulationLibrary.nodeName')">
<a-input :placeholder="$t('pleaseEnter') + $t('standardRegulationLibrary.nodeName')"
:maxLength="50"
v-decorator="['nodeName', validatorRules.nodeName]" />
</a-form-item>
</a-form>
</j-modal>
</template>
<script>
import { addOverseasStandardSystem, editOverseasStandardSystem } from '../../../../api/standardRegulationLibraryApi.js'
export default {
name: 'OverseasSystemTreeModal',
data () {
return {
title: this.$t('operation'),
width: 800,
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
validatorRules: {
// 节点名称
nodeName: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardRegulationLibrary.nodeName') }],
validateTrigger: 'blur'
}
}
}
},
methods: {
add (parentInfo) {
this.edit(parentInfo)
},
edit (record) {
this.form.resetFields()
this.model = Object.assign({}, record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(this.model)
})
},
close () {
this.visible = false
},
handleOk () {
this.form.validateFields((err, values) => {
if (!err) {
this.confirmLoading = true
const formData = Object.assign(this.model, values)
formData.nodeOrder = '0'
let submitFunc
if (this.model.id) {
submitFunc = editOverseasStandardSystem
} else {
submitFunc = addOverseasStandardSystem
}
submitFunc(formData).then(res => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
}
})
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped lang="less">
</style>
@@ -1,238 +0,0 @@
<template>
<a-drawer
:title="$t('standardSelect.standardSelection')"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
class="custom-drawer-style">
<div class="custom-drawer-style-scroll">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :sm="8">
<a-form-item :label="$t('standardSelect.standardNumOrName')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('standardSelect.standardNumOrName')"
v-model="queryParam.standardNumberOrName"></a-input>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;margin-right: 41px;margin-bottom: 20px"
class="table-page-search-submitButtons">
<a-button class="box-button" style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button>
<a-button class="box-button" style="margin-left: 8px" type="primary" @click="searchQuery">{{
$t('query')
}}
</a-button>
</div>
</a-row>
</a-form>
</div>
<a-table
:columns="columns"
rowKey="serial_number"
:scroll="{x: 900}"
:data-source="dataList"
:pagination="ipagination"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:loading="loading"
@change="handleTableChange">
<!-- 标准编号标准名称跳转详情-->
<template v-slot:detail="text, record">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text can-click-table-text" v-if="text || text === 0" @click="toDetailPage(record)">{{ text }}</div>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<template slot="text" slot-scope="text">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="table-text">{{ text || text === 0 ? text : global.emptyLine }}</div>
</a-tooltip>
</template>
</a-table>
</div>
<div class="custom-drawer-style-bottom-btn">
<a-button @click="handleCancel">{{ $t('cancel') }}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{ $t('submit') }}</a-button>
</div>
</a-drawer>
</template>
<script>
import { getDomesticStandardNoSystem } from '../../../../api/standardRegulationLibraryApi.js'
import { StandardSource } from '../../../../enums/commonEnums.js'
export default {
name: 'SelectionOverseasStandardDrawer',
props: {
// 选中节点code
nodeCode: {
type: String,
required: false,
default: null
},
query: {
type: Object,
required: false,
default: () => {
return {}
}
}
},
data () {
return {
visible: false,
confirmLoading: false,
labelCol: {
sm: 8
},
wrapperCol: {
sm: 14
},
selectedRowKeys: [],
selectedRowList: [],
loading: false,
queryParam: {},
/* 分页参数 */
ipagination: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '30', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
columns: [
// 标准号
{
title: this.$t('standardSelect.standardNumber'),
dataIndex: 'standardNumber',
align: 'center',
width: 150,
scopedSlots: { customRender: 'detail' }
},
// 标准名称
{
title: this.$t('standardSelect.standardName'),
dataIndex: 'standardName',
align: 'center',
width: 150,
scopedSlots: { customRender: 'detail' }
},
// 发布日期
{
title: this.$t('standardSelect.releaseDate'),
dataIndex: 'releaseDate',
align: 'center',
width: 120,
scopedSlots: { customRender: 'text' }
},
// 标准状态
{
title: this.$t('projectLibrary.vehicleItemLibrary.standardState'),
dataIndex: 'standardState_dictText',
align: 'center',
width: 120,
scopedSlots: { customRender: 'text' }
}
],
dataList: [],
url: {
searchList: 'document/bussDocumentLibraryEO/queryCondition' // 搜索字段
}
}
},
methods: {
open () {
this.visible = true
this.queryParam = {}
this.replacePage()
},
// 获取表格数据
replacePage () {
const query = {
...this.queryParam,
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize,
nodeCode: this.nodeCode,
source: StandardSource.OVERSEAS.value
}
this.selectedRowKeys = []
this.loading = true
getDomesticStandardNoSystem(query).then((res) => {
if (res.success) {
this.dataList = res.result.records
this.ipagination.total = res.result.total
this.selectedRowKeys = this.standard[this.query.db_field_name] ? this.standard[this.query.db_field_name].split(',') : []
} else {
this.dataList = []
}
}).finally(() => {
this.loading = false
})
},
searchQuery () {
this.replacePage()
},
searchReset () {
this.queryParam = {}
this.replacePage()
},
// 表格选择改变
onSelectChange (value, row) {
this.selectedRowKeys = value
this.selectedRowList = row
},
handleCancel () {
this.visible = false
},
handleSubmit () {
const serialNumber = []
const replaceStandardId = []
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
// let content = JSON.parse(JSON.stringify(this.selectedRowList))
this.selectedRowList.forEach(res => {
serialNumber.push(res.serial_number)
replaceStandardId.push(res.id)
})
this.$emit('input', serialNumber.join(','))
this.$emit('change', this.query.dbFieldName, replaceStandardId.join(','))
// this.$emit('changecontent', this.content)
this.visible = false
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
/**
* 跳转详情页
* @param id
*/
toDetailPage ({ id }) {
this.$openPageNewSheet({
path: '/standardRegulationLibrary/OverseasStandardDetail',
query: {
id
}
})
},
handleTableChange (pagination) {
this.ipagination = pagination
this.replacePage()
}
}
}
</script>
<style scoped lang="less">
</style>