[add] 法规符合性排查流程

This commit is contained in:
lideqin
2024-06-26 18:05:04 +08:00
parent 1786001075
commit e40a403d16
13 changed files with 1897 additions and 25 deletions
+30
View File
@@ -32,6 +32,26 @@ const newRegulationImportGetDataById = (taskId, params) => getAction(`/process/e
// 草稿的办理回显数据
const newRegulationImportGetDataDraft = (params) => getAction('/process/es/archive/draftHandle', params)
// 法规符合性排查流程
// 保存
const regulatoryComplianceCheckSave = (params) => postAction('/process/es/archive/save', params)
// 发起
const regulatoryComplianceCheckApproval = (params) => postAction('/process/es/archive/start', params)
// 转办
const regulatoryComplianceCheckTurnTo = (params) => postAction('/process/es/archive/transfer', params)
// 同意
const regulatoryComplianceCheckAgree = (params) => postAction('/process/es/archive/agree', params)
// 驳回
const regulatoryComplianceCheckReject = (params) => postAction('/process/es/archive/reject', params)
// 根据id查询流程数据--办理
const regulatoryComplianceCheckGetDataById = (taskId, params) => getAction(`/process/es/archive/handle/${taskId}`, params)
// 草稿的办理回显数据
const regulatoryComplianceCheckGetDataDraft = (params) => getAction('/process/es/archive/draftHandle', params)
// 从拆分库选择标准
const selectStandardFromSplit = (params) => getAction('', params)
// 法规工程师节点,获取条款表信息
const getClauseListInfo = (params) => getAction('', params)
// 市场清单发布流程
// 保存
const marketListReleaseSave = (params) => postAction('/process/es/archive/save', params)
@@ -82,6 +102,16 @@ export {
newRegulationImportGetDataById,
newRegulationImportGetDataDraft,
regulatoryComplianceCheckSave,
regulatoryComplianceCheckApproval,
regulatoryComplianceCheckTurnTo,
regulatoryComplianceCheckAgree,
regulatoryComplianceCheckReject,
regulatoryComplianceCheckGetDataById,
regulatoryComplianceCheckGetDataDraft,
selectStandardFromSplit,
getClauseListInfo,
marketListReleaseSave,
marketListReleaseApproval,
marketListReleaseTurnTo,
+6 -1
View File
@@ -560,7 +560,7 @@
&-btn {
width: 24px;
height: 24px;
background: rgba(213, 44, 38, 0.08);
background: rgba(0, 100, 250, 0.08);
border-radius: 2px 2px 2px 2px;
border: none;
margin-left: 4px;
@@ -957,4 +957,9 @@
// 表格表头的必填标识
.table-header-required {
color: #FF0000;
}
// 解决表头错位问题
/deep/ .ant-table-hide-scrollbar {
margin-right: -9px;
}
+7
View File
@@ -192,6 +192,13 @@ module.exports = {
curBefore: 'Before this day',
curAfter: 'After this day',
pleaseSelectADate: 'Please select a date first',
applicableMarket: 'Applicable market',
responsibleDepartment: 'Responsible department',
standardState: 'Standard state',
newProductionVehicleImplementationDate: 'New production vehicle implementation date',
newCertifiedVehicleImplementationDate: 'New certified vehicle implementation date',
generate: '生成',
vehicleType: '车型',
// 树右键
treeRight: {
addFolder: 'Create New Folder',
+13
View File
@@ -21,6 +21,19 @@ module.exports = {
ccPerson: '抄送人员',
briefDescription: '法规要求简要描述'
},
// 法规符合性排查流程
regulatoryComplianceCheckProcess: {
addStandard: '添加标准',
manualAddition: '手动新增',
vehicleTypeItem: '车型项目',
applicableMarket: '适用市场',
isAlike: '是否与上一版相同',
resolutionAttachment: '分解单附件',
decompositionSingleSource: '分解单来源',
pleaseAddStandard: '请先新增一条标准',
modelStatus: '车型状态',
primaryInvestigator: '主排查人'
},
// 市场清单发布流程
marketListReleaseProcess: {
englishName: '英文名称',
+13
View File
@@ -21,6 +21,19 @@ module.exports = {
ccPerson: '抄送人员',
briefDescription: '法规要求简要描述'
},
// 法规符合性排查流程
regulatoryComplianceCheckProcess: {
addStandard: '添加标准',
manualAddition: '手动新增',
vehicleTypeItem: '车型项目',
applicableMarket: '适用市场',
isAlike: '是否与上一版相同',
resolutionAttachment: '分解单附件',
decompositionSingleSource: '分解单来源',
pleaseAddStandard: '请先新增一条标准',
modelStatus: '车型状态',
primaryInvestigator: '主排查人'
},
// 市场清单发布流程
marketListReleaseProcess: {
englishName: '英文名称',
+9
View File
@@ -144,6 +144,7 @@ module.exports = {
processInformation: '流程信息',
basicServiceInformation: '业务基本信息',
processApprovalInformation: '流程审批信息',
dispatchInformation: '业务分派信息',
processName: '流程名称',
expirationDate: '截止日期',
processExplain: '流程说明',
@@ -195,6 +196,7 @@ module.exports = {
transfer: '调取',
batchClose: '批量关闭',
clauseNo: '条款号',
clauseTitle: '条款标题',
clauseName: '条款名称',
clauseContent: '条款内容',
maximumSelectFive: '最多选择五条记录!',
@@ -207,6 +209,13 @@ module.exports = {
curBefore: '这天之前',
curAfter: '这天之后',
pleaseSelectADate: '请先选中一个日期',
applicableMarket: '适用市场',
responsibleDepartment: '责任部门',
standardState: '标准状态',
newProductionVehicleImplementationDate: '新生产车实施日期',
newCertifiedVehicleImplementationDate: '新认证车实施日期',
generate: '生成',
vehicleType: '车型',
// 标准字段
standardField: {
standardEnglishName: '标准英文名称',
+35 -20
View File
@@ -119,26 +119,6 @@ export const EnterpriseStandardStatus = {
ARCHIVE: { text: '封存', value: '10' }
}
// 流程key,获取人员信息前需要获取流程定义id,传这里的名字到WorkCenterMixin的getFlowDefinition方法中
export const ProcessKey = {
// 新法规导入流程
NEW_REGULATIONS_IMPORT: { text: '', value: '' },
// 标准解读流程
// 法规符合性排查流程
// 市场清单发布流程
MARKET_LIST_RELEASE: { text: '', value: '' }
}
// 流程类型
export const ProcessType = {
// 新法规导入流程
NEW_REGULATIONS_IMPORT: { text: '新法规导入流程', value: '1' },
// 标准解读流程
// 法规符合性排查流程
// 市场清单发布流程
MARKET_LIST_RELEASE: { text: '市场清单发布流程', value: '4' }
}
// 标准化活动类型
export const StandardizedActivityType = new EsEnums({
rootNode: { text: '总标委', value: 'ROOT' },
@@ -160,6 +140,28 @@ export const IsReadOnlyEnums = {
subConfigurable: { text: '字段固定,内部可配', value: 2 }
}
// 流程key,获取人员信息前需要获取流程定义id,传这里的名字到WorkCenterMixin的getFlowDefinition方法中
export const ProcessKey = {
// 新法规导入流程
NEW_REGULATIONS_IMPORT: { text: '', value: '' },
// 标准解读流程
// 法规符合性排查流程
REGULATORY_COMPLIANCE_CHECK: { text: '', value: '' },
// 市场清单发布流程
MARKET_LIST_RELEASE: { text: '', value: '' }
}
// 流程类型
export const ProcessType = {
// 新法规导入流程
NEW_REGULATIONS_IMPORT: { text: '新法规导入流程', value: '1' },
// 标准解读流程
// 法规符合性排查流程
REGULATORY_COMPLIANCE_CHECK: { text: '', value: '' },
// 市场清单发布流程
MARKET_LIST_RELEASE: { text: '市场清单发布流程', value: '4' }
}
// 新法规导入流程节点
export const NewRegulationsImportNodes = new EsEnums({
initiated: { text: '法规工程师发起', value: '' },
@@ -169,6 +171,19 @@ export const NewRegulationsImportNodes = new EsEnums({
responsibleLeaderApprovalTwo: { text: '公司标准法规责任领导批准', value: '' }
})
// 法规符合性排查流程
export const RegulatoryComplianceCheckNodes = new EsEnums({
initiated: { text: '法规工程师发起', value: '' },
interfacesDistributed: { text: '各部门接口人分发', value: '' },
mainFinderDistributes: { text: '主排查人分发', value: '' },
designEngineerEvaluation: { text: '设计工程师评估', value: '' },
mainFinderSingleLineAudit: { text: '主排查人单线审核', value: '' },
mainFinderCollect: { text: '主排查人汇总', value: '' },
countersign: { text: '会签', value: '' },
designEngineerManagerReview: { text: '设计工程师科室经理审核', value: '' },
seniorManagerApproved: { text: '高级经理/技术官批准', value: '' }
})
// 市场清单发布流程节点
export const MarketListReleaseNodes = new EsEnums({
initiated: { text: '法规工程师发起', value: '' },
@@ -231,7 +231,7 @@ export default {
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
// 把数据抛出
const data = {}
data.formInline = this.formInline
return data
@@ -259,13 +259,13 @@ export default {
this.formInline = {}
} else {
this.loading = true
// 标名称
// 标名称
this.formInline.standardName = value[0].standardName
// 根据返回的id查询标数据
// 根据返回的id查询标数据
getForeignStandardDetail({ id: value[0].id, type: '2' }).then(async res => {
if (res.success) {
const result = res.result
// 代替标编号
// 代替标编号
this.formInline.substituteStandardNumber = result.substitute_standard_number
// 实施日期
this.formInline.implementationDate = result.implementation_date
@@ -0,0 +1,569 @@
<template>
<internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧tab -->
<template v-slot:titleRightCustom>
<div class="table-operator-tab">
<a class="switch-item" :class="switchValue === 'base' ? 'table-operator-tab-active' : ''"
@click="switchChange('base')">{{ $t('basicInformation') }}
</a>
<a class="switch-item" :class="switchValue === 'user' ? 'table-operator-tab-active' : ''"
@click="switchChange('user')">{{ $t('personalInformation') }}
</a>
</div>
</template>
<!-- 基础信息 -->
<div v-show="switchValue === 'base'" class="detail-page-scroll-content">
<!-- 流程信息 -->
<div class="process-part-title">{{ $t('processInformation') }}</div>
<a-form :form="processInfoForm">
<a-row>
<a-col :span="12">
<!-- 流程名称 自动生成规则标准编号-标准名称-法规符合性排查 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('processName')" :colon="formItemColon">
<a-input :placeholder="$t('pleaseEnter') + $t('processName')"
disabled
:maxLength="50"
v-decorator="['prcName', validatorRules.prcName]" />
</a-form-item>
</a-col>
<a-col :span="12">
<!-- 截止日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('expirationDate')" :colon="formItemColon">
<a-date-picker :placeholder="$t('pleaseSelect') + $t('expirationDate')"
style="width: 100%"
:disabled="disabled"
value-format="YYYY-MM-DD"
v-decorator="['dueTime']" />
</a-form-item>
</a-col>
<a-col :span="24">
<!-- 流程说明 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('processExplain')" :colon="formItemColon">
<a-textarea :placeholder="$t('pleaseEnter') + $t('processExplain')"
:maxLength="500"
:rows="4"
:disabled="disabled"
v-decorator="['prcMes']" />
</a-form-item>
</a-col>
<a-col v-if="[2].includes(currentNode)" :span="24">
<!-- 标准编号/标准名称 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('standardNumber') + '/' + $t('standardName')" :colon="formItemColon">
<a-input :placeholder="$t('pleaseEnter') + $t('standardNumber') + '/' + $t('standardName')"
disabled
v-decorator="['standardNumberName']" />
</a-form-item>
</a-col>
<a-col v-if="[2].includes(currentNode)" :span="24">
<!-- 适用市场 -->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('applicableMarket')" :colon="formItemColon">
<a-input :placeholder="$t('pleaseEnter') + $t('applicableMarket')"
disabled
v-decorator="['applicableMarket']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- 业务基本信息和业务分派信息部分 -->
<!-- 节点1法规工程师发起 -->
<engineer-init-base-info v-if="currentNode === 1" ref="baseInfoRef" @processNameChange="processNameChange"></engineer-init-base-info>
<!-- 节点2各部门接口人分发 -->
<interface-person-delivery-base-info v-if="currentNode === 2" ref="baseInfoRef"></interface-person-delivery-base-info>
<!-- 节点3主排查人分发 -->
<!-- 节点4设计工程师评估 -->
<!-- 节点5主排查人单线审核 -->
<!-- 节点6只排查人汇总 -->
<!-- 节点7会签 -->
<!-- 节点8设计工程师科室经理审核 -->
<!-- 节点9高级经理/技术官批准 -->
<!-- 流程审批信息 -->
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
<a-form :form="approvalInfoForm">
<!--备注-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('remarks')" :colon="formItemColon">
<a-textarea :placeholder="$t('pleaseEnter') + $t('remarks')"
:maxLength="500"
:rows="4"
v-decorator="['commitText', validatorRules.commitText]" />
</a-form-item>
<!--附件-->
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('attach')" :colon="formItemColon">
<j-upload v-decorator="['commitFile']" return-id multiple />
</a-form-item>
</a-form>
</div>
<!-- 人员信息 -->
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list :processKey="ProcessKey.REGULATORY_COMPLIANCE_CHECK.value">
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNodeId" :notPermissField="['relatedUserList']"></personnel-info>
</process-detail-list>
</div>
<!-- 操作按钮 -->
<div class="detail-page-bottom-operate-box">
<!-- 发起节点 -->
<template v-if="currentNode === 1">
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleStart" icon="upload">{{ $t('submit') }}</a-button>
</template>
<!-- 各部门接口人分发, 主排查人汇总 -->
<template v-else-if="[2, 6].includes(currentNode)">
<!-- 转办 -->
<a-button type="primary" ghost :loading="loading" @click="handleTurnTo" icon="arrow-up">{{ $t('turnTo') }}</a-button>
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleSubmit" icon="upload">{{ $t('submit') }}</a-button>
</template>
<!-- 主排查人分发设计工程师评估 -->
<template v-else-if="[3, 4].includes(currentNode)">
<!-- 驳回 -->
<a-button type="primary" :loading="loading" @click="handleReject" icon="close-circle">{{ $t('reject') }}</a-button>
<!-- 转办 -->
<a-button type="primary" ghost :loading="loading" @click="handleTurnTo" icon="arrow-up">{{ $t('turnTo') }}</a-button>
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 提交 -->
<a-button type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('submit') }}</a-button>
</template>
<template v-else>
<!-- 转办 -->
<a-button type="primary" ghost :loading="loading" @click="handleTurnTo" icon="arrow-up">{{ $t('turnTo') }}</a-button>
<!-- 保存 -->
<a-button type="primary" ghost :loading="loading" @click="handleSave"><i class="iconfont icon-save"></i> {{ $t('preservation') }}</a-button>
<!-- 同意 -->
<a-button type="primary" :loading="loading" @click="handleAgree" icon="check-circle">{{ $t('agree') }}</a-button>
<!-- 驳回 -->
<a-button type="primary" :loading="loading" @click="handleReject" icon="close-circle">{{ $t('reject') }}</a-button>
</template>
</div>
<!-- 选人弹框 -->
<user-select-modal ref="userSelectModal" type="radio" @change="userSelectModalChange"></user-select-modal>
</internal-detail-page>
</template>
<script>
import InternalDetailPage from '@/components/InternalDetailPage'
import ProcessDetailList from '@/components/ProcessDetailList'
import PersonnelInfo from '@/components/PersonnelInfo'
import UserSelectModal from '@/components/selection/UserSelectModal'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { RegulatoryComplianceCheckNodes, ProcessKey } from '../../../enums/commonEnums'
import {
regulatoryComplianceCheckAgree, regulatoryComplianceCheckApproval,
regulatoryComplianceCheckGetDataById,
regulatoryComplianceCheckGetDataDraft, regulatoryComplianceCheckReject,
regulatoryComplianceCheckSave, regulatoryComplianceCheckTurnTo
} from '../../../api/workCenter'
import pick from 'lodash.pick'
import EngineerInitBaseInfo from './modules/EngineerInitBaseInfo'
import InterfacePersonDeliveryBaseInfo from './modules/InterfacePersonDeliveryBaseInfo'
export default {
name: 'RegulatoryComplianceCheckProcess',
components: {
InterfacePersonDeliveryBaseInfo,
EngineerInitBaseInfo,
InternalDetailPage,
ProcessDetailList,
PersonnelInfo,
UserSelectModal
},
mixins: [WorkCenterMixin],
computed: {
pageTitle () {
return this.$t('flowCenter') + this.$route.meta.title + '' + this.currentNodeName + ''
}
},
mounted () {
// 初始化节点
const nodeId = this.$route.query.nodeId
if (nodeId) {
this.currentNodeId = nodeId
if (nodeId === RegulatoryComplianceCheckNodes.initiated.value) {
// 法规工程师发起
this.currentNode = 1
} else if (nodeId === RegulatoryComplianceCheckNodes.interfacesDistributed.value) {
// 各部门接口人分发
this.currentNode = 2
} else if (nodeId === RegulatoryComplianceCheckNodes.mainFinderDistributes.value) {
// 主排查人分发
this.currentNode = 3
} else if (nodeId === RegulatoryComplianceCheckNodes.designEngineerEvaluation.value) {
// 设计工程师评估
this.currentNode = 4
} else if (nodeId === RegulatoryComplianceCheckNodes.mainFinderSingleLineAudit.value) {
// 主排查人单线审核
this.currentNode = 5
} else if (nodeId === RegulatoryComplianceCheckNodes.mainFinderCollect.value) {
// 主排查人汇总
this.currentNode = 6
} else if (nodeId === RegulatoryComplianceCheckNodes.countersign.value) {
// 会签
this.currentNode = 7
} else if (nodeId === RegulatoryComplianceCheckNodes.designEngineerManagerReview.value) {
// 设计工程师科室经理审核
this.currentNode = 8
} else if (nodeId === RegulatoryComplianceCheckNodes.seniorManagerApproved.value) {
// 高级经理/技术官批准
this.currentNode = 9
} else {
// 预留加签节点
this.currentNode = 999
}
}
// 获取人员信息结构
this.getPersonInfoStructure(ProcessKey.REGULATORY_COMPLIANCE_CHECK.value, () => {
if (this.$route.query.processInstanceId) {
if (this.currentNode === 1) {
this.disabled = false
this.initPersonInfoData(true)
} else {
this.disabled = true
// 如果不是第一个节点,人员信息全部不可选
this.initPersonInfoData(false)
}
}
})
if (this.$route.query.taskId && !this.$route.query.draftId) {
// 有流程id说明是从流程中心来的,需要初始化数据
this.getProcessData('todo', { taskId: this.$route.query.taskId })
}
if (this.$route.query.draftId) {
// 有草稿id,说明是从流程中心-草稿来的,需要初始化数据
this.getProcessData('draft', { draftId: this.$route.query.draftId, projectId: this.$route.query.projectId })
}
if (this.$route.query.taskName) {
// 说明是已发起流程
this.currentNodeName = this.$route.query.taskName
} else {
this.currentNodeName = '法规工程师发起'
}
},
data () {
return {
ProcessKey,
loading: false,
switchValue: 'base', // 头部tab选中值
disabled: false,
currentNode: 2, // 当前节点
currentNodeName: '',
currentNodeId: RegulatoryComplianceCheckNodes.initiated.value, // 当前节点id
model: {},
processInfoForm: this.$form.createForm(this),
labelCol: {
xs: { span: 24 },
sm: { span: 4 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 20 }
},
longLabelCol: {
xs: { span: 24 },
sm: { span: 2 }
},
longWrapperCol: {
xs: { span: 24 },
sm: { span: 22 }
},
validatorRules: {
// 流程名称
prcName: {
rules: [
{ required: true, message: this.$t('pleaseEnter') + this.$t('processName') }
],
validateTrigger: 'blur'
},
commitText: {
rules: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }
],
validateTrigger: 'blur'
}
},
formInline: {},
approvalInfoForm: this.$form.createForm(this), // 审批信息表单
personnelInfoData: []
}
},
methods: {
// 根据流程id获取数据并回显
getProcessData (type, param) {
this.loading = true
let func
let params = {}
if (type === 'todo') {
func = regulatoryComplianceCheckGetDataById
params = param.taskId
} else {
func = regulatoryComplianceCheckGetDataDraft
params = param
}
func(params).then(res => {
if (res.success) {
this.model = res.result
this.$nextTick(() => {
if (type === 'todo') {
// 初始化流程信息
this.processInfoForm.setFieldsValue(pick(this.model.common, 'prcName', 'dueTime', 'prcMes'))
}
// 有草稿json按草稿进来的回显
if (this.model.infoJsonStr) {
// 初始化流程信息
const prcObj = Object.assign({}, this.model)
prcObj.dueTime = this.model.processDueDate
prcObj.prcMes = this.model.processDescription
this.processInfoForm.setFieldsValue(pick(prcObj, 'prcName', 'dueTime', 'prcMes'))
// 初始化流程审批信息
prcObj.commitText = this.model.handleText
prcObj.commitFile = this.model.handleFile
this.approvalInfoForm.setFieldsValue(pick(prcObj, 'commitText', 'commitFile'))
this.model.data = JSON.parse(this.model.infoJsonStr).data
// 如果是节点1的保存回显人员信息
if (this.currentNode === 1) {
this.draftInitPersonInfo(JSON.parse(this.model.infoJsonStr).personnelObj)
}
}
if (this.$refs.baseInfoRef) {
this.$refs.baseInfoRef.initData(this.model.data)
}
})
// 初始化业务基本信息中组件内容
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 头部tab改变
switchChange (value) {
this.switchValue = value
},
// 业务基本信息组件中获取到流程名称改变后的值
processNameChange (value) {
const param = { prcName: value }
this.$nextTick(() => {
this.processInfoForm.setFieldsValue(pick(param, 'prcName'))
})
},
// 保存
handleSave () {
if (this.loading) {
return
}
// 有任意一项填了即可
// 流程信息表单
const processInfoForm = this.processInfoForm.getFieldsValue()
// 流程审批信息
const approvalInfoForm = this.approvalInfoForm.getFieldsValue()
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObj()
// 业务基本信息
const baseInfo = this.$refs.baseInfoRef.getData()
const param = { ...processInfoForm, ...baseInfo.formInline, ...approvalInfoForm, ...personnelObj }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
// 需要传给后端的数据
const paramObj = {}
// 流程信息
paramObj.basicProcessInfoDTO = Object.assign({}, processInfoForm)
paramObj.basicProcessInfoDTO.processName = paramObj.basicProcessInfoDTO.prcName
paramObj.basicProcessInfoDTO.processDueDate = paramObj.basicProcessInfoDTO.dueTime
paramObj.basicProcessInfoDTO.processDescription = paramObj.basicProcessInfoDTO.prcMes
paramObj.basicProcessInfoDTO.processInstanceId = this.$route.query.processInstanceId
// 流程审批信息
paramObj.basicTaskInfoDTO = Object.assign({}, approvalInfoForm)
paramObj.basicTaskInfoDTO.handleText = paramObj.basicTaskInfoDTO.commitText
paramObj.basicTaskInfoDTO.handleFile = paramObj.basicTaskInfoDTO.commitFile
paramObj.basicTaskInfoDTO.taskId = this.$route.query.taskId
// 草稿id
if (this.model.infoJsonStr) {
paramObj.draftId = this.model.id
}
// 业务基本信息和人员信息
paramObj.infoJsonStr = JSON.stringify({
data: baseInfo.formInline,
personnelObj: personnelObj
})
this.loading = true
// 保存到草稿
regulatoryComplianceCheckSave(paramObj).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
})
},
// 节点一时候的提交
handleStart () {
if (this.loading) return
// 流程信息的校验
this.processInfoForm.validateFields((err, values) => {
// 流程审批信息的校验
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!err && !approvalErr && data) {
// 人员信息的数据, 处理成对象
const personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.switchValue = 'user'
return
}
this.loading = true
const paramObj = {} // 需要传给后端的数据
paramObj.common = { ...values, ...approvalValues }
// 草稿id
if (this.model.infoJsonStr) {
paramObj.common.draftId = this.model.id
}
paramObj.flowUser = personnelObj
paramObj.data = data.formInline
let func
if (this.$route.query.taskId) {
// 有taskId说明是驳回的提交
func = regulatoryComplianceCheckAgree
paramObj.common.taskId = this.$route.query.taskId
} else {
func = regulatoryComplianceCheckApproval
}
func(paramObj).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
})
} else {
this.switchValue = 'base'
}
})
})
},
// 转办
handleTurnTo () {
if (this.loading) return
// 点击显示选人组件
this.$refs.userSelectModal.open()
},
// 转办选完人的回调
userSelectModalChange (userIds) {
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = Object.assign({}, values)
param.userId = userIds
param.taskId = this.$route.query.taskId
regulatoryComplianceCheckTurnTo(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
})
}
})
},
// 提交
handleSubmit () {
if (this.loading) return
this.approvalInfoForm.validateFields(async (approvalErr, approvalValues) => {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (!approvalErr && data) {
const param = {} // 需要传给后端的数据
param.common = Object.assign({}, approvalValues)
param.common.taskId = this.$route.query.taskId
param.data = data
this.loading = true
regulatoryComplianceCheckAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
})
} else {
this.switchValue = 'base'
}
})
},
// 同意
handleAgree () {
if (this.loading) return
this.validatorRules.commitText.rules[0].required = false
if (!this.approvalInfoForm.getFieldValue('commitText')) {
this.approvalInfoForm.setFieldsValue({ commitText: '同意' })
}
this.approvalInfoForm.validateFields((err, values) => {
if (!err) {
this.loading = true
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
regulatoryComplianceCheckAgree(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
})
}
})
},
// 驳回
handleReject () {
if (this.loading) return
this.validatorRules.commitText.rules[0].required = true
if (!this.approvalInfoForm.getFieldValue('commitText')) {
this.$message.warning(this.$t('pleaseEnterRemarks'))
this.switchValue = 'base'
}
this.$nextTick(() => {
this.approvalInfoForm.validateFields({ force: true }, (err, values) => {
if (!err) {
this.loading = true
const param = {}
param.common = Object.assign({}, values)
param.common.taskId = this.$route.query.taskId
regulatoryComplianceCheckReject(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.goBack()
} else {
this.$message.warning(res.message)
this.loading = false
}
}).finally(() => {
this.validatorRules.commitText.rules[0].required = false
})
}
})
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,565 @@
<template>
<div>
<!-- 业务基本信息部分 -->
<!-- 业务基本信息 -->
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<div>
<!-- 操作区域 -->
<div v-if="!disabled" class="table-operator">
<!-- 添加标准 -->
<a-button icon="plus" type="primary" @click="handleAddStandard" :disabled="disabled">
{{ $t('workCenter.regulatoryComplianceCheckProcess.addStandard') }}
</a-button>
<!-- 手动新增 -->
<a-button icon="plus" type="primary" @click="handleAdd" :disabled="disabled">
{{ $t('workCenter.regulatoryComplianceCheckProcess.manualAddition') }}
</a-button>
<!-- 删除 -->
<a-button icon="delete" type="danger" ghost @click="handleDelete" :disabled="disabled">
{{ $t('delete') }}
</a-button>
</div>
<div>
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="standardNumber"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
:loading="loading">
<!-- 操作栏 -->
<div slot="action" slot-scope="{record}" class="action-span-cell">
<a @click="handleEdit(record)" class="table-ope-btn" :disabled="disabled">{{ $t('edit') }}</a>
</div>
</j-table>
</div>
<a-form-model :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
<div class="form-flex-box">
<!-- 车型项目 -->
<div class="box-title-text form-flex-item file-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.regulatoryComplianceCheckProcess.vehicleTypeItem')">
{{ $t('workCenter.regulatoryComplianceCheckProcess.vehicleTypeItem') }}
</span>
</div>
<a-form-model-item class="item-model" prop="vehicleTypeItem">
<j-upload
return-id
v-model="formInline.vehicleTypeItem">
</j-upload>
</a-form-model-item>
</div>
<!-- 适用市场 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('applicableMarket')">
{{ $t('applicableMarket') }}
</span>
</div>
<a-form-model-item class="item-model" prop="applicableMarket">
<j-dict-select-tag
:placeholder="$t('pleaseSelect') + this.$t('applicableMarket')"
dict-code=""
v-model="formInline.applicableMarket">
</j-dict-select-tag>
</a-form-model-item>
</div>
<!-- 是否与上一版相同 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.regulatoryComplianceCheckProcess.isAlike')">
{{ $t('workCenter.regulatoryComplianceCheckProcess.isAlike') }}
</span>
</div>
<a-form-model-item class="item-model" prop="isAlike">
<j-dict-select-tag
:placeholder="$t('pleaseSelect') + this.$t('workCenter.regulatoryComplianceCheckProcess.isAlike')"
dict-code="yn"
v-model="formInline.isAlike">
</j-dict-select-tag>
</a-form-model-item>
</div>
</div>
</a-form-model>
<div class="center-operate-box">
<!-- 生成 -->
<a-button type="primary" ghost :loading="loading" @click="handleGenerate">{{ $t('generate') }}</a-button>
</div>
</div>
<template v-if="isGenerateAfter">
<!-- 业务分派信息部分 -->
<div class="process-part-title">{{ $t('dispatchInformation') }}</div>
<div>
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<!-- 责任部门 -->
<a-col :md="6" :sm="8">
<a-form-item :label="$t('responsibleDepartment')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-tree-select
tree-node-filter-prop="title"
v-model="queryParam.authDept"
:maxTagCount="1"
allowClear
:getPopupContainer="triggerNode=> triggerNode.parentNode"
class="box-input"
style="width: 100%"
:tree-data="categoryTreeList"
show-search
:filterTreeNode="filterTreeOption"
:placeholder="$t('pleaseSelect') + $t('responsibleDepartment')"
/>
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">{{ $t('query') }}</a-button>
<a-button type="primary" ghost @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<!-- 操作区域 -->
<div v-if="!disabled" class="table-operator">
<!-- 批量删除 -->
<a-button icon="delete" type="danger" ghost @click="batchDel" :disabled="disabled">
{{ $t('batchDelete') }}
</a-button>
</div>
<div>
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
:columns="clauseColumns"
:dataSource="clauseDataSource"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:pagination="false"
:loading="loading">
<!-- 标准编号标准名称 -->
<template v-slot:toDetail="{text, record}">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a class="link-a" @click="toDetail(record)">{{ text }}</a>
</a-tooltip>
</template>
<!-- 操作栏 -->
<div slot="action" slot-scope="{record}" class="action-span-cell">
<a @click="handleDelete(record.uid)" class="table-ope-btn" :disabled="disabled">{{ $t('delete') }}</a>
</div>
</j-table>
</div>
</div>
</template>
<!-- 添加标准弹框 -->
<standard-selection-modal ref="selectStandardRef" type="radio" @listChange="listChange"/>
<!-- 手动新增弹框 -->
<manual-add-modal ref="manualAddRef" @ok="manualAddOk"/>
</div>
</template>
<script>
import JTable from '@/components/jero/JTable'
import StandardSelectionModal from '@/components/selection/StandardSelectionModal'
import { getForeignStandardDetail } from '@/api/standardRegulationLibraryApi'
import ManualAddModal from './ManualAddModal'
import { StandardSource } from '@/enums/commonEnums'
import { getClauseListInfo } from '@/api/workCenter'
import { queryDepartTreeList } from '../../../../api/api'
export default {
name: 'EngineerInitBaseInfo',
components: {
JTable,
ManualAddModal,
StandardSelectionModal
},
props: {
disabled: {
type: Boolean,
required: false,
default: false
}
},
data () {
return {
loading: false,
formInline: {},
rules: {
// 车型项目
vehicleTypeItem: [
{
required: true,
message: this.$t('workCenter.regulatoryComplianceCheckProcess.vehicleTypeItem') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 适用市场
applicableMarket: [
{
required: true,
message: this.$t('workCenter.regulatoryComplianceCheckProcess.applicableMarket') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 是否与上一版相同
isAlike: [
{
required: true,
message: this.$t('workCenter.regulatoryComplianceCheckProcess.isAlike') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
columns: [
{ // 标准编号
title: this.$t('standardNumber'),
align: 'center',
width: 180,
dataIndex: 'standardNumber',
scopedSlots: { customRender: 'toDetail' }
},
{ // 标准名称
title: this.$t('standardName'),
align: 'center',
width: 180,
dataIndex: 'standardName',
scopedSlots: { customRender: 'toDetail' }
},
{ // 标准状态
title: this.$t('standardState'),
align: 'center',
width: 180,
dataIndex: 'standardState',
scopedSlots: { customRender: 'text' }
},
{ // 分解单来源
title: this.$t('workCenter.regulatoryComplianceCheckProcess.decompositionSingleSource'),
align: 'center',
width: 180,
dataIndex: 'decompositionSingleSource',
customRender: (value, row, index) => {
return <j-dict-select-tag
v-model={row.decompositionSingleSource}
dictCode={'decomposition_single_source'}
disabled={this.disabled}
placeholder={this.$t('pleaseSelect')} />
}
},
{ // 新生产车实施日期
title: this.$t('newProductionVehicleImplementationDate'),
align: 'center',
width: 180,
dataIndex: 'newProductionVehicleImplementationDate',
scopedSlots: { customRender: 'text' }
},
{ // 新认证车实施日期
title: this.$t('newCertifiedVehicleImplementationDate'),
align: 'center',
width: 180,
dataIndex: 'newCertifiedVehicleImplementationDate',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
fixed: 'right',
width: 170
}
],
dataSource: [],
isGetDataAfter: false, // 是否获取完数据了,获取完数据有的字段不显示placeholder
isGenerateAfter: false, // 是否点击了生成按钮
queryParam: {},
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 }
},
categoryTreeList: [], // 组织机构下拉框数据
clauseColumns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
width: 80,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 标准编号/条款号
title: this.$t('standardNumber') + '/' + this.$t('clauseNo'),
align: 'center',
width: 180,
dataIndex: 'clauseNo',
scopedSlots: { customRender: 'text' }
},
{ // 标准名称/条款标题
title: this.$t('standardName') + '/' + this.$t('clauseTitle'),
align: 'center',
width: 180,
dataIndex: 'clauseTitle',
scopedSlots: { customRender: 'text' }
},
{ // 条款内容
title: this.$t('clauseContent'),
align: 'center',
width: 180,
dataIndex: 'clauseContent',
scopedSlots: { customRender: 'text' }
},
{ // 车型
title: this.$t('vehicleType'),
align: 'center',
width: 180,
dataIndex: 'vehicleType',
scopedSlots: { customRender: 'text' }
},
{ // 车型状态
title: this.$t('workCenter.regulatoryComplianceCheckProcess.modelStatus'),
align: 'center',
width: 180,
dataIndex: 'modelStatus',
scopedSlots: { customRender: 'text' }
},
{ // 责任部门
title: this.$t('responsibleDepartment'),
align: 'center',
width: 180,
dataIndex: 'authDept',
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('operation'),
scopedSlots: { customRender: 'action' },
align: 'center',
fixed: 'right',
width: 170
}
],
clauseDataSource: [],
clauseDataList: [], // 防止查询数据丢失
selectedRowKeys: [],
selectionRows: []
}
},
mounted () {
this.getSysCategoryTree()
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
// 给表单赋值
this.formInline = Object.assign({}, data)
this.isGetDataAfter = true
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
data.formInline = this.formInline
} else {
data = false
}
})
return data
},
// 获取组织机构树
getSysCategoryTree () {
queryDepartTreeList().then((res) => {
if (res.success) {
this.categoryTreeList = res.result
} else {
this.categoryTreeList = []
}
})
},
// 添加标准
handleAddStandard () {
this.$refs.selectStandardRef.open()
},
// 添加标准了,需要回显内容,返回流程名称
listChange (value) {
console.log(value)
let obj
if (!value || value.length <= 0) {
obj = {}
} else {
this.loading = true
// 标准名称
obj.standardName = value[0].standardName
// 根据返回的id查询标准数据
getForeignStandardDetail({ id: value[0].id, type: '2' }).then(async res => {
if (res.success) {
const result = res.result
// 标准状态
obj.standardState = result.standard_state
// 分解单来源初始化成发布稿
obj.decompositionSingleSource = '1'
// 新生产车实施日期
obj.newProductImplDate = result.new_product_impl_date
// 新认证车实施日期
obj.newAuthImplDate = result.new_auth_impl_date
this.dataSource[0] = obj
this.isGetDataAfter = true
}
}).finally(() => {
this.loading = false
})
}
this.$emit('processNameChange', (obj.standardNumber || '') + '-' + (obj.standardName || '') + '-' + '法规符合性排查')
},
// 手动新增
handleAdd () {
this.$refs.manualAddRef.title = this.$t('newlyAdded')
this.$refs.manualAddRef.add()
},
// 标准的编辑
handleEdit (record) {
this.$refs.manualAddRef.title = this.$t('edit')
this.$refs.manualAddRef.edit(record)
},
// 手动新增或者编辑完的回调
manualAddOk (result, isEdit) {
this.dataSource[0] = result
},
// 删除
handleDelete () {
this.$confirm({
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
this.dataSource = []
}
})
},
// 跳转标准详情
toDetail (record) {
let path = ''
// 需要先判断是哪种标准
if (record.source === StandardSource.FOREIGN.value) {
path = '/standardRegulationLibrary/foreignStandardDetailPage'
} else if (record.source === StandardSource.ENTERPRISE.value) {
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
}
this.$openPageNewSheet({
path: path,
query: {
id: record.standardId
}
})
},
// 生成
handleGenerate () {
// 显示下方列表信息,生成列表信息
this.isGenerateAfter = true
if (this.dataSource.length < 1) {
// 有标准才可以获取
this.clauseDataSource = []
return
}
// 获取下方列表信息
const param = {}
param.standardNumber = this.dataSource[0].standardNumber
// 分解单来源
param.decompositionSingleSource = this.dataSource[0].decompositionSingleSource
getClauseListInfo(param).then(res => {
if (res.success) {
this.clauseDataSource = res.result
}
})
},
// 查询
searchQuery () {
if (this.queryParam.authDept) {
this.clauseDataSource = this.clauseDataList.filter(item => {
return item.authDept + '' === this.queryParam.authDept + ''
})
} else {
this.dataSource = JSON.parse(JSON.stringify(this.clauseDataList))
}
this.selectedRowKeys = []
this.selectionRows = []
},
// 重置
searchReset () {
this.dataSource = JSON.parse(JSON.stringify(this.clauseDataList))
this.selectedRowKeys = []
this.selectionRows = []
},
batchDel () {
if (this.selectedRowKeys.length <= 0) {
this.$message.warning(this.$t('selectARecord'))
} else {
this.$confirm({
title: this.$t('confirmBatchDeletion'),
content: this.$t('deleteAData'),
onOk: () => {
this.clauseDataSource = this.clauseDataSource.filter(item => !this.selectedRowKeys.includes(item.id))
this.clauseDataList = this.clauseDataList.filter(item => !this.selectedRowKeys.includes(item.id))
}
})
}
},
onSelectChange (selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys
this.selectionRows = selectionRows
},
filterTreeOption (input, option) {
const text = option.componentOptions.propsData.title || option.componentOptions.propsData.label
return text.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
}
}
</script>
<style scoped lang="less">
.form-add {
margin-top: 20px;
}
.file-flex-item {
width: 280px !important;
}
.form-flex-item {
width: calc((100% - 280px) / 2);
padding: 0 20px;
}
.center-operate-box {
float: right;
}
</style>
@@ -0,0 +1,160 @@
<template>
<div>
<!-- 业务分派信息部分 -->
<div class="process-part-title">{{ $t('dispatchInformation') }}</div>
<div>
<a-form-model :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
<div class="form-flex-box">
<!-- 主排查人 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.regulatoryComplianceCheckProcess.primaryInvestigator')">
{{ $t('workCenter.regulatoryComplianceCheckProcess.primaryInvestigator') }}
</span>
</div>
<a-form-model-item class="item-model" prop="primaryInvestigator">
<user-selection v-model="formInline.primaryInvestigator"
:placeholder="$t('pleaseSelect')+$t('workCenter.regulatoryComplianceCheckProcess.primaryInvestigator')"
:disabled="disabled"
filedName="primaryInvestigator"
@nameChange="userSelectNameChange"
:nameStr="formInline.primaryInvestigator_dictText"
type="checkbox"/>
</a-form-model-item>
</div>
</div>
</a-form-model>
<div>
<j-table
:can-drag="true"
:scroll="{x: '100%'}"
ref="table"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
:loading="loading">
</j-table>
</div>
</div>
</div>
</template>
<script>
import JTable from '@/components/jero/JTable'
import UserSelection from '@/components/selection/UserSelection'
export default {
name: 'InterfacePersonDeliveryBaseInfo',
components: { JTable, UserSelection },
props: {
disabled: {
type: Boolean,
required: false,
default: false
}
},
data () {
return {
loading: false,
formInline: {},
rules: {
// 主排查人
primaryInvestigator: [
{
required: true,
message: this.$t('workCenter.regulatoryComplianceCheckProcess.primaryInvestigator') + this.$t('cannotEmpty'),
trigger: 'change'
}
]
},
columns: [
{
title: this.$t('serialNumber'),
dataIndex: '',
key: 'rowIndex',
width: 80,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{ // 标准编号/条款号
title: this.$t('standardNumber') + '/' + this.$t('clauseNo'),
align: 'center',
width: 180,
dataIndex: 'clauseNo',
scopedSlots: { customRender: 'text' }
},
{ // 标准名称/条款标题
title: this.$t('standardName') + '/' + this.$t('clauseTitle'),
align: 'center',
width: 180,
dataIndex: 'clauseTitle',
scopedSlots: { customRender: 'text' }
},
{ // 条款内容
title: this.$t('clauseContent'),
align: 'center',
width: 180,
dataIndex: 'clauseContent',
scopedSlots: { customRender: 'text' }
},
{ // 车型
title: this.$t('vehicleType'),
align: 'center',
width: 180,
dataIndex: 'vehicleType',
scopedSlots: { customRender: 'text' }
},
{ // 车型状态
title: this.$t('workCenter.regulatoryComplianceCheckProcess.modelStatus'),
align: 'center',
width: 180,
dataIndex: 'modelStatus',
scopedSlots: { customRender: 'text' }
}
],
dataSource: [],
isGetDataAfter: false, // 是否获取完数据了,获取完数据有的字段不显示placeholder
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
// 给表单赋值
this.formInline = Object.assign({}, data)
this.isGetDataAfter = true
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = {}
data.formInline = this.formInline
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () {
let data = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
data.formInline = this.formInline
} else {
data = false
}
})
return data
},
// 选择用户得到用户名
userSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,133 @@
<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('standardNumber')">
<a-input :placeholder="$t('pleaseEnter') + $t('standardNumber')"
:maxLength="50"
v-decorator="['standardNumber', validatorRules.standardNumber]" />
</a-form-item>
<!-- 标准名称 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardNumber')">
<a-input :placeholder="$t('pleaseEnter') + $t('standardName')"
:maxLength="50"
v-decorator="['standardName', validatorRules.standardName]" />
</a-form-item>
<!-- 标准状态 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('standardState')">
<j-dict-select-tag :placeholder="$t('pleaseEnter') + $t('standardState')"
dict-code="standard_state"
v-decorator="['standardState', validatorRules.standardState]" />
</a-form-item>
<!-- 新生产车实施日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('newProductionVehicleImplementationDate')">
<j-multiple-date-picker :placeholder="$t('pleaseSelect') + $t('newProductionVehicleImplementationDate')"
v-decorator="['newProductImplDate', validatorRules.newProductImplDate]" />
</a-form-item>
<!-- 新认证车实施日期 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('newCertifiedVehicleImplementationDate')">
<j-multiple-date-picker :placeholder="$t('pleaseSelect') + $t('newCertifiedVehicleImplementationDate')"
v-decorator="['newAuthImplDate', validatorRules.newAuthImplDate]" />
</a-form-item>
<!-- 分解单附件 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.regulatoryComplianceCheckProcess.resolutionAttachment')">
<j-upload return-id
v-decorator="['resolutionAttachment', validatorRules.resolutionAttachment]" />
</a-form-item>
</a-form>
</j-modal>
</template>
<script>
import JMultipleDatePicker from '../../../../components/JMultipleDatePicker'
import { addForeignSystemTree, editForeignSystemTree } from '../../../../api/standardRegulationLibraryApi'
export default {
name: 'ManualAddModal',
components: { JMultipleDatePicker },
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: {
// 标准编号
standardNumber: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardNumber') }],
validateTrigger: 'blur'
},
// 标准名称
standardName: {
rules: [{ required: true, message: this.$t('pleaseEnter') + this.$t('standardName') }],
validateTrigger: 'blur'
},
// 新生产车实施日期
newProductImplDate: {
rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('newProductionVehicleImplementationDate') }],
validateTrigger: 'change'
},
// 新认证车实施日期
newAuthImplDate: {
rules: [{ required: true, message: this.$t('pleaseSelect') + this.$t('newCertifiedVehicleImplementationDate') }],
validateTrigger: 'change'
}
}
}
},
methods: {
add () {
this.edit({})
},
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 isEdit = this.model.standardNumber
const formData = Object.assign(this.model, values, isEdit)
this.$emit('ok', formData)
this.confirmLoading = false
this.close()
}
})
},
handleCancel () {
this.close()
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,353 @@
<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.source')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag style="width: 100%" v-model="queryParam.source"
:disabled="disabledSourceSearch"
:placeholder="$t('pleaseSelect')+$t('standardSelect.source')"
:triggerChange="false"
:options="sourceOptions"
@change="handleTypeChange" />
</a-form-item>
</a-col>
<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 style="margin-left: 8px" type="primary" icon="search" @click="searchQuery">{{ $t('query') }}</a-button>
<a-button style="margin-left: 8px" type="primary" ghost icon="reload" @click="searchReset">{{ $t('reset') }}</a-button>
</div>
</a-row>
</a-form>
</div>
<a-table
:columns="columns"
rowKey="standardNumber"
:scroll="{x: 900}"
:data-source="dataList"
:pagination="ipagination"
:row-selection="{ type: type, selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:loading="loading"
@change="handleTableChange">
<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>
<!-- 标准编号/标准名称 -->
<template v-slot:toDetail="text, record">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<a v-if="text" class="link-a" @click="handleGoDetail(record)">{{ text }}</a>
<div v-else class="table-text">{{ global.emptyLine }}</div>
</a-tooltip>
</template>
<!-- 标准状态 -->
<template slot="standardState" slot-scope="text, record">
<a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ record.source === '3' ? (record.esStandardState_dictText || global.emptyLine) : (record.standardState_dictText || global.emptyLine) }}</template>
<div class="table-text">{{ record.source === '3' ? (record.esStandardState_dictText || global.emptyLine) : (record.standardState_dictText || 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 JDictSelectTag from '@/components/dict/JDictSelectTag'
import { StandardSource } from '../../../../enums/commonEnums'
import { ajaxGetDictItems } from '../../../../api/api'
import { selectStandardFromSplit } from '../../../../api/workCenter'
export default {
name: 'SelectStandardFromSplitModal',
components: { JDictSelectTag },
props: {
source: {
type: [String, Number],
default: '1'
},
// 查询条件可以选择的类型
canSelectedSource: {
type: [String, Array],
required: false,
default: () => {
return [StandardSource.FOREIGN.value, StandardSource.ENTERPRISE.value]
}
},
value: {
type: String,
default: ''
},
// 搜索条件中的来源是否不可更改
disabledSourceSearch: {
type: Boolean,
default: false
},
type: {
type: String,
required: false,
default: 'checkbox'
},
// 列表数据不包含的标准
excludeStandardNumbers: {
type: String,
required: false,
default: null
},
// 过滤条件
filters: {
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('standardNumber'),
dataIndex: 'standardNumber',
ellipsis: true,
align: 'center',
width: 150,
scopedSlots: { customRender: 'toDetail' }
},
{
title: this.$t('standardName'),
dataIndex: 'standardName',
ellipsis: true,
align: 'center',
width: 150,
scopedSlots: { customRender: 'toDetail' }
},
// 实施日期
{
title: this.$t('standardSelect.materialDate'),
dataIndex: 'implementationDate',
align: 'center',
width: 120,
scopedSlots: { customRender: 'text' }
},
{
title: this.$t('standardSelect.textState'),
dataIndex: 'standardState_dictText',
align: 'center',
width: 150,
scopedSlots: { customRender: 'standardState' }
}
],
dataList: [],
sourceOptions: []
}
},
methods: {
open () {
this.visible = true
this.queryParam = {}
this.initDict()
this.$nextTick(() => {
this.source ? this.queryParam.source = this.source : this.queryParam = {}
this.replacePage()
})
},
initDict () {
ajaxGetDictItems('standard_source').then(res => {
if (res.success) {
const canSelectedArr = typeof this.canSelectedSource === 'string' ? this.canSelectedSource.split(',') : this.canSelectedSource
this.sourceOptions = res.result.filter(tt => canSelectedArr.includes(tt.value))
}
})
},
// 获取表格数据
replacePage (arg) {
if (arg === 1) {
this.ipagination.current = 1
}
const query = {
...this.queryParam,
...this.filters,
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize,
excludeStandardNumbers: this.excludeStandardNumbers
}
// 清空在可选范围内进行查询
if (!query.source && this.canSelectedSource.length < 3) {
query.source = this.canSelectedSource.join(',')
}
// this.selectedRowKeys = []
this.loading = true
selectStandardFromSplit(query).then((res) => {
if (res.success) {
this.dataList = res.result.records
this.ipagination.total = res.result.total
this.selectedRowKeys = this.value ? this.value.split(',') : (this.selectedRowKeys || [])
} else {
this.dataList = []
}
}).finally(() => {
this.loading = false
})
},
searchQuery () {
this.replacePage(1)
},
searchReset () {
// 如果禁用来源,就不重置来源
if (this.disabledSourceSearch) {
this.queryParam = { source: this.source }
} else {
this.queryParam = {}
}
this.replacePage(1)
},
// 表格选择改变
onSelectChange (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys
// this.selectedRowList = row
if (this.type === 'checkbox') {
if (selectedRowKeys.length > this.selectedRowList.length) {
// 说明是增加了数据
for (const rowIndex in selectedRows) {
if (!this.selectedRowList.find(item => item.standardNumber === selectedRows[rowIndex].standardNumber)) {
// 不存在,追加
this.selectedRowList.push(selectedRows[rowIndex])
}
}
} else {
// 说明是删除了数据
if (selectedRowKeys && selectedRowKeys.length > 0) {
// 没有选中数据,说明这一页没有选中数据了
for (let i = 0; i < this.selectedRowList.length; i++) {
if (!selectedRowKeys.find(item => item === this.selectedRowList[i].standardNumber)) {
// 表格选中中没有找到这一条数据,说明已经被删了
this.selectedRowList.splice(i, 1)
i--
}
}
} else {
this.selectedRowList = []
}
}
console.log(this.selectedRowList)
} else {
this.selectedRowList = selectedRows
}
},
handleTableChange (pagination) {
// 分页、排序、筛选变化时触发
this.ipagination = pagination
this.replacePage()
},
handleCancel () {
this.close()
},
handleSubmit () {
const serialNumber = []
const serialNameArr = []
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
this.selectedRowList.forEach(res => {
serialNumber.push(res.standardNumber)
serialNameArr.push(res.standardName)
})
this.$emit('change', this.selectedRowKeys.join(','))
this.$emit('nameChange', serialNameArr.join(','))
this.$emit('listChange', this.selectedRowList)
this.close()
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
close () {
this.visible = false
this.selectedRowKeys = []
this.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
}
},
handleTypeChange () {
this.$forceUpdate()
},
// 点击跳转标准详情
handleGoDetail (record) {
let path = ''
// 需要先判断是哪种标准
if (record.source === '1') {
path = '/standardRegulationLibrary/foreignStandardDetailPage'
} else if (record.source === '3') {
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
}
this.$openPageNewSheet({
path: path,
query: {
id: record.id
}
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>