[update] 市场法规清单

This commit is contained in:
lideqin
2024-07-05 18:22:16 +08:00
parent 3c2b4f9010
commit 60e39606a3
6 changed files with 380 additions and 715 deletions
@@ -165,6 +165,7 @@ import {
} from '@/api/workCenter'
import pick from 'lodash.pick'
import { WorkCenterMixin } from '@/mixins/WorkCenterMixin'
import { marketRegulationDetailPublish } from '../../../api/standardRegulationLibraryApi'
export default {
name: 'MarketListReleaseProcess',
@@ -230,6 +231,13 @@ export default {
} else {
this.currentNodeName = '法规工程师发起'
}
// 从市场法规清单跳转过来的
if (this.$route.query.marketRegulationId) {
this.$nextTick(() => {
// 说明是从企标复审计划页面发起跳转过来的
this.$refs.baseInfoRef.setFormById(this.$route.query.marketRegulationId)
})
}
},
data () {
return {
@@ -413,50 +421,57 @@ export default {
},
// 节点一时候的提交
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 = marketListReleaseAgree
paramObj.common.taskId = this.$route.query.taskId
} else {
func = marketListReleaseApproval
}
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'
}
})
marketRegulationDetailPublish({id: this.$route.query.marketRegulationId}).then(res => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
// 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 = marketListReleaseAgree
// paramObj.common.taskId = this.$route.query.taskId
// } else {
// func = marketListReleaseApproval
// }
// 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 () {
@@ -10,11 +10,12 @@
{{ $t('listNumber') }}
</span>
</div>
<a-form-model-item class="item-model" prop="listNumber">
<a-form-model-item class="item-model" prop="listId">
<market-regulations-list-selection type="radio"
selectOnly
:name-str="formInline.manifestNo"
:placeholder="$t('pleaseSelect') + $t('listNumber')"
v-model="formInline.listNumber" />
v-model="formInline.listId" />
</a-form-model-item>
</div>
<!-- 清单名称 -->
@@ -24,10 +25,10 @@
{{ $t('listName') }}
</span>
</div>
<a-form-model-item class="item-model" prop="listName">
<a-form-model-item class="item-model" prop="manifestName">
<a-input class="box-input"
disabled
v-model="formInline.listName"
v-model="formInline.manifestName"
:maxLength="50"
:placeholder="isGetDataAfter ? '' : $t('pleaseEnter')+$t('listName')" />
</a-form-model-item>
@@ -39,12 +40,15 @@
{{ $t('countryRegion') }}
</span>
</div>
<a-form-model-item class="item-model" prop="countryRegion">
<j-dict-select-tag
:placeholder="isGetDataAfter ? '' : $t('pleaseSelect') + $t('countryRegion')"
v-model="formInline.countryRegion"
disabled
dict-code="market_state"></j-dict-select-tag>
<a-form-model-item class="item-model" prop="country">
<s-tree-select v-model="formInline.country"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:tree-data="countryOptions"
tree-checkable
treeCheckStrictly
disabled
:placeholder="isGetDataAfter ? '' : $t('pleaseSelect')+$t('countryRegion')" />
</a-form-model-item>
</div>
</div>
@@ -102,14 +106,17 @@
import MarketRegulationsListSelection from '@/components/selection/MarketRegulationsListSelection'
import UserSelection from '@/components/selection/UserSelection'
import JTable from '@/components/jero/JTable'
import {
getMarketRegulationListByIdNoPerm
} from '@/api/standardRegulationLibraryApi'
import { StandardSource } from '../../../../enums/commonEnums'
import {
getMarketRegulationListById,
marketRegulationDetailListById
} from '@/api/standardRegulationLibraryApi'
import { getFormDictTreeList } from '../../../../api/api'
import STreeSelect from '@/components/STreeSelect'
export default {
name: 'BaseInfoForm',
components: { MarketRegulationsListSelection, UserSelection, JTable },
components: { MarketRegulationsListSelection, UserSelection, JTable, STreeSelect },
props: {
disabled: {
type: Boolean,
@@ -129,7 +136,7 @@ export default {
userFormInline: {},
rules: {
// 清单编号
listNumber: [
listId: [
{
required: true,
message: this.$t('listNumber') + this.$t('cannotEmpty'),
@@ -176,98 +183,98 @@ export default {
title: this.$t('workCenter.marketListReleaseProcess.englishName'),
align: 'center',
width: 180,
dataIndex: 'englishName',
dataIndex: 'standardEnglishName',
scopedSlots: { customRender: 'text' }
},
{ // 新生产车实施日期
title: this.$t('workCenter.marketListReleaseProcess.newProductionVehicleImplementationDate'),
align: 'center',
width: 180,
dataIndex: 'newProductionVehicleImplementationDate',
dataIndex: 'newProductImplDate',
scopedSlots: { customRender: 'text' }
},
{ // 新认证车实施日期
title: this.$t('workCenter.marketListReleaseProcess.newCertifiedVehicleImplementationDate'),
align: 'center',
width: 180,
dataIndex: 'newCertifiedVehicleImplementationDate',
dataIndex: 'newAuthImplDate',
scopedSlots: { customRender: 'text' }
},
{ // 适用国家/地区
title: this.$t('workCenter.marketListReleaseProcess.applicableCountryRegion'),
align: 'center',
width: 180,
dataIndex: 'applicableCountryRegion',
dataIndex: 'applicableCountryRegion_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 适用车型
title: this.$t('workCenter.marketListReleaseProcess.applicableVehicleType'),
align: 'center',
width: 180,
dataIndex: 'applicableVehicleType',
dataIndex: 'applicableVehicle_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 认证对象
title: this.$t('workCenter.marketListReleaseProcess.authenticationObject'),
align: 'center',
width: 180,
dataIndex: 'authenticationObject',
dataIndex: 'authenticationObject_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 认证交付物
title: this.$t('workCenter.marketListReleaseProcess.certifiedDeliverables'),
align: 'center',
width: 180,
dataIndex: 'certifiedDeliverables',
dataIndex: 'certifyTheDeliverables',
scopedSlots: { customRender: 'text' }
},
{ // 类型
title: this.$t('workCenter.marketListReleaseProcess.type'),
align: 'center',
width: 180,
dataIndex: 'type',
dataIndex: 'stanardClass_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 动力类型
title: this.$t('workCenter.marketListReleaseProcess.dynamicType'),
align: 'center',
width: 180,
dataIndex: 'dynamicType',
dataIndex: 'dynamicType_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 主控部门
title: this.$t('workCenter.marketListReleaseProcess.mainControlDepartment'),
align: 'center',
width: 180,
dataIndex: 'mainControlDepartment',
dataIndex: 'mainDept_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 主控部门专业模块
title: this.$t('workCenter.marketListReleaseProcess.masterControlDepartmentProfessionalModule'),
align: 'center',
width: 180,
dataIndex: 'masterControlDepartmentProfessionalModule',
dataIndex: 'mainDeptProfMode_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 关联部门
title: this.$t('workCenter.marketListReleaseProcess.relatedDepartment'),
align: 'center',
width: 180,
dataIndex: 'relatedDepartment',
dataIndex: 'associateDept_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 关联部门专业模块
title: this.$t('workCenter.marketListReleaseProcess.associateDepartmentSpecializedModules'),
align: 'center',
width: 180,
dataIndex: 'associateDepartmentSpecializedModules',
dataIndex: 'associateDeptProfMode_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 要求类型
title: this.$t('workCenter.marketListReleaseProcess.requirementType'),
align: 'center',
width: 180,
dataIndex: 'requirementType',
dataIndex: 'requireType_dictText',
scopedSlots: { customRender: 'text' }
},
{ // 备注
@@ -290,10 +297,58 @@ export default {
showSizeChanger: true,
total: 0
},
countryOptions: [], // 国家/地区下拉框
isGetDataAfter: false // 是否获取完数据了,获取完数据有的字段不显示placeholder
}
},
mounted () {
this.getCountryOption()
},
methods: {
// 获取国家/地区下拉框数据
getCountryOption () {
getFormDictTreeList({ dictId: '1801130851452059649' }).then(res => {
if (res.success) {
this.countryOptions = res.result
}
})
},
// 从市场法规清单
setFormById (marketRegulationId) {
this.loading = true
const param = {}
param.manifestId = marketRegulationId
// 获取基础信息
getMarketRegulationListById(param).then(res => {
if (res.success) {
const result = Object.assign({}, res.result.manifest)
const formInline = {}
// 清单编号id
formInline.listId = result.id
// 清单编号
formInline.manifestNo = result.manifestNo
// 清单名称
formInline.manifestName = result.manifestName
// 版本号
formInline.manifestVersion = result.manifestVersion
// 国家/地区
if (result.country) {
formInline.country = result.country.split(',').map(item => {
return { value: item }
})
}
this.formInline = Object.assign({}, formInline)
marketRegulationDetailListById(param).then(res => {
if (res.success) {
this.dataSource = res.result
}
}).finally(() => {
this.loading = false
this.$emit('processNameChange', (this.formInline.manifestName || '') + '-' + (this.formInline.manifestVersion || '') + '-' + '发布')
})
}
})
},
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
// 给表单赋值
@@ -340,37 +395,45 @@ export default {
this.formInline = {}
} else {
this.loading = true
// 清单名称
this.formInline.listName = value[0].listName
// 国家/地区
this.formInline.countryRegion = value[0].countryRegion
// 版本
this.formInline.listVersion = value[0].listVersion
// 根据返回的id查询清单列表
getMarketRegulationListByIdNoPerm({ id: value[0].id }).then(async res => {
const param = {}
param.manifestId = value[0].id
// 获取基础信息
getMarketRegulationListById(param).then(res => {
if (res.success) {
const result = res.result
this.dataSource = result.data
this.formInline = Object.assign({}, this.formInline)
this.isGetDataAfter = true
const result = Object.assign({}, res.result.manifest)
const formInline = {}
// 清单编号id
formInline.listId = result.id
// 清单编号
formInline.manifestNo = result.manifestNo
// 清单名称
formInline.manifestName = result.manifestName
// 版本号
formInline.manifestVersion = result.manifestVersion
// 国家/地区
if (formInline.country) {
formInline.country = formInline.country.split(',').map(item => {
return { value: item }
})
}
this.formInline = Object.assign({}, formInline)
marketRegulationDetailListById(param).then(res => {
if (res.success) {
this.dataSource = res.result
}
}).finally(() => {
this.loading = false
this.$emit('processNameChange', (this.formInline.manifestName || '') + '-' + (this.formInline.manifestVersion || '') + '-' + '发布')
})
}
}).finally(() => {
this.loading = false
})
}
this.$emit('processNameChange', (this.formInline.listName || '') + '-' + (this.formInline.listVersion || '') + '-' + '发布')
},
handleTableChange (pagination, filters, sorter) {
this.ipagination = pagination
},
toDetail (record) {
let path = ''
// 需要先判断是哪种标准
if (record.source === StandardSource.FOREIGN.value) {
path = '/standardRegulationLibrary/foreignStandardDetailPage'
} else if (record.source === StandardSource.ENTERPRISE.value) {
path = '/enterpriseStandardLibrary/enterpriseStandardDetail'
}
const path = '/standardRegulationLibrary/foreignStandardDetailPage'
this.$openPageNewSheet({
path: path,
query: {