[update] 修改企标制修订流程

This commit is contained in:
lideqin
2024-01-02 18:07:50 +08:00
parent 8d8e021b04
commit 4d6f65d24d
10 changed files with 1120 additions and 27 deletions
+24
View File
@@ -90,6 +90,22 @@ const standardizationInitAgree = (params) => postAction('/process/es/annualInit/
// 拒绝
const standardizationInitReject = (params) => postAction('/process/es/annualInit/reject', params)
// 企标制修订流程
// 保存
const enStandardEditSave = (params) => postAction('/process/es/revision/save', params)
// 转办
const enStandardEditTurnTo = (params) => postAction('/process/es/revision/transfer', params)
// 同意
const enStandardEditAgree = (params) => postAction('/process/es/revision/agree', params)
// 拒绝
const enStandardEditReject = (params) => postAction('/process/es/revision/reject', params)
// 根据id查流程数据
const enStandardEditGetDataById = (taskId, params) => getAction(`/process/es/revision/handle/${taskId}`, params)
// 获取表单数据
const getEnterpriseStandardAddForm = (params) => getAction('/laws/standard/enterprise/getFormModel', params)
// 根据id获取详情
const getEnterpriseStandardInfoById = (params) => getAction('/laws/standard/enterprise/getByIdAndModule', params)
// 企标复审流程
// 保存
const enStandardRecheckSave = (params) => postAction('/process/es/recheck/save', params)
@@ -262,6 +278,14 @@ export {
standardizationInitAgree,
standardizationInitReject,
enStandardEditSave,
enStandardEditTurnTo,
enStandardEditAgree,
enStandardEditReject,
enStandardEditGetDataById,
getEnterpriseStandardAddForm,
getEnterpriseStandardInfoById,
enStandardRecheckSave,
enStandardRecheckTurnTo,
enStandardRecheckAgree,
+19
View File
@@ -42,6 +42,10 @@ module.exports = {
operation: '操作',
strip: '条',
total: '共',
yes: '是',
no: '否',
standardText: '标准文本',
look: '查看',
// 标准法规入库/变更流程
standardEntryOrChange: {
source: '来源',
@@ -125,6 +129,21 @@ module.exports = {
planSubmissionDate: '计划报批日期',
changeState: '变更状态'
},
// 企标制修订流程
enStandardRevision: {
typeOfRevision: '制修订类型',
isCanAuditMeeting: '是否可以进行评审会',
assessor: '评审人',
scorer: '评分人',
reviewDate: '评审日期',
judgingVenue: '评审地点',
descText: '描述文本',
common: '一般',
good: '优良',
excellent: '优秀',
grade: '评分',
groundsForDemerit: '扣分理由'
},
// 企标复审流程
esRecheck: {
recheckDate: '复审日期',
+27 -25
View File
@@ -39,7 +39,7 @@
</template>
<script>
import {ajaxGetDictItems, getDictItemsFromCache} from '../../api/api'
import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api'
export default {
name: 'PickerDictCheckboxField',
@@ -71,7 +71,7 @@ export default {
default: false
}
},
data() {
data () {
return {
showPicker: false,
showValue: '',
@@ -86,37 +86,37 @@ export default {
this.initVal()
}
},
dictCode:{
immediate:true,
handler() {
dictCode: {
immediate: true,
handler () {
this.initDictData()
},
},
}
}
},
computed: {
//透传给下级组件的事件,需要排除本组件使用的change事件
childListeners() {
// 透传给下级组件的事件,需要排除本组件使用的change事件
childListeners () {
// const vm = this
let result = Object.assign({},
this.$listeners,
const result = Object.assign({},
this.$listeners
)
delete result.change
return result
}
},
methods: {
showPickerFunc() {
if(this.readonly) return
showPickerFunc () {
if (this.readonly) return
this.initVal()
this.showPicker = true
},
initVal() {
initVal () {
if (this.value) {
this.checkedArr = this.value.split(',')
let showArr = []
const showArr = []
this.checkedArr.map(item => {
let column = this.columnData.find(tt => (tt[this.valueKey] + '') === (item + ''))
if(column) {
const column = this.columnData.find(tt => (tt[this.valueKey] + '') === (item + ''))
if (column) {
showArr.push((column || {})[this.showKey])
}
this.showValue = showArr.join('')
@@ -126,28 +126,28 @@ export default {
this.checkedArr = []
}
},
initDictData() {
//优先从缓存中读取字典配置
if(getDictItemsFromCache(this.dictCode)){
initDictData () {
// 优先从缓存中读取字典配置
if (getDictItemsFromCache(this.dictCode)) {
this.columnData = getDictItemsFromCache(this.dictCode)
return
}
//根据字典Code, 初始化字典数组
// 根据字典Code, 初始化字典数组
ajaxGetDictItems(this.dictCode, null).then((res) => {
if (res.success) {
this.columnData = res.result
}
})
},
onConfirm() {
if(this.checkedArr.length === 0) {
onConfirm () {
if (this.checkedArr.length === 0) {
this.$toast('请至少选择一条数据')
return
}
this.showPicker = false
this.$emit('change', this.checkedArr.join())
},
onCancel() {
onCancel () {
// this.checkedArr = []
this.showPicker = false
}
@@ -163,6 +163,8 @@ export default {
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
/deep/.dict-checkbox-field-popup{
height: 308px;
font-size: 16px;
@@ -183,4 +185,4 @@ export default {
}
}
</style>
</style>
+23 -1
View File
@@ -47,7 +47,7 @@ export const ProcessKey = {
// 年度制修订-标准化部门主动发起
ES_ANNUAL_INIT: { text: 'es-annual-init', value: 'es-annual-init' },
// 企标制修订流程
ES_EDIT: { text: '', value: '' },
ES_EDIT: { text: 'es-revision', value: 'es-revision' },
// 企标更改流程
ES_CHANGE: { text: 'es-change', value: 'es-change' },
// 企标复审流程
@@ -139,6 +139,28 @@ export const EsRevisionPlanStandardizationInitNodes = new EsEnums({
standardizationSumUp: { text: '标准化归档', value: 'sid-86610E08-1DDB-467A-A32E-C661FE889A57' }
})
// 企标制修订流程
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 Recheck = {
STAND_GOOD: { text: '继续有效', value: '1' },
+10
View File
@@ -29,6 +29,16 @@ export default [
hasBack: true // 这个属性控制页面上面的导航栏 是否有返回按钮
}
},
{
path: '/workCenter/enterpriseStandardRevision',
name: 'EnterpriseStandardRevision',
component: (resolve) => require(['@/views/workCenter/enterpriseStandardRevision/EnterpriseStandardRevision.vue'], resolve),
meta: {
// title: '企标制修订流程',
hasNavBar: true, // 这个属性控制页面是否显示上面的导航栏
hasBack: true // 这个属性控制页面上面的导航栏 是否有返回按钮
}
},
{
path: '/workCenter/enterpriseStandardRecheck',
name: 'EnterpriseStandardRecheck',
+1 -1
View File
@@ -80,7 +80,7 @@ export default {
break
// 企标制修订流程
case '10':
path = '/workCenter/enterpriseStandardRevision/enterpriseStandardRevisionFlow'
path = '/workCenter/enterpriseStandardRevision'
break
// 企标更改流程
case '11':
@@ -0,0 +1,477 @@
<template>
<process-common-layout ref="processCommonLayout" class="page-box" :processKey="ProcessKey.ES_EDIT.value" :loading="loading">
<template v-slot:process>
<!-- 流程信息 -->
<div class="process-part">
<div class="process-part-title">{{ $t('processInformation') }}</div>
<van-form
ref="form"
input-align="right"
error-message-align="right"
:readonly="readonly"
>
<!-- 流程名称 -->
<van-field
:label="$t('processName')"
:placeholder="$t('pleaseEnter') + $t('processName')"
readonly
type="textarea"
rows="1"
autosize
v-model="processInfoForm.prcName" />
<!-- 截止日期 -->
<calendar-field
:label="$t('expirationDate')"
v-model="processInfoForm.dueTime"
type="date"
readonly
/>
<!-- 流程说明 -->
<van-field
v-model="processInfoForm.prcMes"
:label="$t('processExplain')"
type="textarea"
autosize
disabled
rows="2"
:placeholder="$t('pleaseEnter')+$t('processExplain')"
:border="false"
input-align="left"
class="vertical-form-item"/>
</van-form>
</div>
<!-- 4标准化审核节点 -->
<standardization-check-base-info
v-if="currentNode === 4"
ref="baseInfoRef"
@standardizationAuditIsMeeting="standardizationAuditIsMeeting"
></standardization-check-base-info>
<!-- 5评分人打分 -->
<scorer-mark-base-info
v-if="currentNode === 5"
ref="baseInfoRef"
></scorer-mark-base-info>
<!-- 6标准化确认是否开启征求意见 -->
<!-- 7部所联络人下发 -->
<!-- 13其他起草人校对 -->
<!-- 14主管级领导审批 -->
<!-- 15标准化审批 -->
<!-- 16相关部门领导会签 -->
<!-- 17总工程师审批 -->
<!-- 流程审批信息 -->
<div class="process-part">
<div class="process-part-title">{{ $t('processApprovalInformation') }}</div>
<van-form
ref="processForm"
input-align="right"
error-message-align="right"
:readonly="readonly">
<!-- 备注 -->
<van-field
v-model="processInfoForm.commitText"
:rules="processInfoRules.commitText"
:label="$t('remark')"
name="commitText"
type="textarea"
autosize
rows="2"
:placeholder="$t('pleaseEnter')+$t('remark')"
:border="false"
input-align="left"
class="vertical-form-item"/>
</van-form>
</div>
</template>
<template v-slot:operation>
<!-- 转办 -->
<van-button class="operation-common-btn" @click="handleTurnTo">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="xunhuan" />
</template>
{{ $t('turnTo') }}
</van-button>
<!-- 节点5,6,7 转办保存提交 -->
<template v-if="[5,6,7].includes(currentNode)">
<!-- 保存 -->
<van-button class="operation-common-btn light-color-button" @click="handleSave">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="baocun" />
</template>
{{ $t('save') }}
</van-button>
<!-- 提交 -->
<van-button class="operation-common-btn" type="primary" @click="handleSubmit">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="check" />
</template>
{{ $t('submit') }}
</van-button>
</template>
<template v-else>
<!-- 同意 -->
<van-button class="operation-common-btn" type="primary" @click="handleAgree" :disabled="agreeBtnDisabled">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="check" />
</template>
{{ $t('agree') }}
</van-button>
<!-- 驳回 -->
<van-button class="operation-common-btn light-color-button" @click="handleReject" :disabled="rejectBtnDisabled">
<template #icon>
<van-icon class="iconfont" class-prefix="icon" name="close" />
</template>
{{ $t('reject') }}
</van-button>
</template>
</template>
<select-user ref="selectUserRef" @selected-change="selectUserChange"></select-user>
</process-common-layout>
</template>
<script>
import ProcessCommonLayout from '@/components/ProcessCommonLayout'
import SelectUser from '@/components/SelectUser'
import CalendarField from '@/components/CalendarField'
import StandardizationCheckBaseInfo
from '@/views/workCenter/enterpriseStandardRevision/module/StandardizationCheckBaseInfo'
import { EsRevisionNodes, ProcessKey } from '@/enums/commonEnums'
import {
enStandardEditSave,
enStandardEditTurnTo,
enStandardEditAgree,
enStandardEditReject,
enStandardEditGetDataById
} from '@/api/api'
import ScorerMarkBaseInfo from "@/views/workCenter/enterpriseStandardRevision/module/ScorerMarkBaseInfo";
export default {
name: 'EnterpriseStandardRevision',
components: {
ScorerMarkBaseInfo,
StandardizationCheckBaseInfo,
ProcessCommonLayout,
SelectUser,
CalendarField
},
mounted () {
// 初始化节点
const nodeId = this.$route.query.nodeId
if (nodeId) {
if (nodeId === EsRevisionNodes.mainDrafterSend.value) {
// 主起草人起草分发
this.currentNode = 1
} else if (nodeId === EsRevisionNodes.otherDrafterUploadStandard.value) {
// 其他起草人上传企标
this.currentNode = 2
} else if (nodeId === EsRevisionNodes.mainDrafterAllUploadMinute.value) {
// 主起草人汇总上传会议纪要
this.currentNode = 3
} else if (nodeId === EsRevisionNodes.standardizationAudit.value) {
// 标准化审核
this.currentNode = 4
} else if (nodeId === EsRevisionNodes.scorerMark.value) {
// 评分人打分
this.currentNode = 5
} else if (nodeId === EsRevisionNodes.standardizationConfirmIsStartAdvice.value) {
// 标准化确认是否开启征求意见
this.currentNode = 6
} else if (nodeId === EsRevisionNodes.contactSend.value) {
// 部所联络人下发
this.currentNode = 7
} else if (nodeId === EsRevisionNodes.takeAdviceObjectEnterAdvice.value) {
// 征求意见对象填写意见
this.currentNode = 8
} else if (nodeId === EsRevisionNodes.contactAll.value) {
// 部所联络人汇总数据
this.currentNode = 9
} else if (nodeId === EsRevisionNodes.contactLeaderApproval.value) {
// 部门联络人主管级领导审批
this.currentNode = 10
} else if (nodeId === EsRevisionNodes.mainDrafterAll.value) {
// 主起草人汇总
this.currentNode = 11
} else if (nodeId === EsRevisionNodes.mainDrafterUploadMinute.value) {
// 主起草人上传会议纪要
this.currentNode = 12
} else if (nodeId === EsRevisionNodes.otherDrafterProofread.value) {
// 其他起草人校对
this.currentNode = 13
} else if (nodeId === EsRevisionNodes.leaderApproval.value) {
// 主管级领导审批
this.currentNode = 14
} else if (nodeId === EsRevisionNodes.standardizationApproval.value) {
// 标准化审批
this.currentNode = 15
} else if (nodeId === EsRevisionNodes.relatedDeptLeaderCountersign.value) {
// 相关部门领导会签
this.currentNode = 16
} else if (nodeId === EsRevisionNodes.allEngineerApproval.value) {
// 总工程师审批
this.currentNode = 17
} else if (nodeId === EsRevisionNodes.mainDrafterPublish.value) {
// 主起草人发布
this.currentNode = 18
} else {
// 预留加签节点
this.currentNode = 999
}
}
},
data () {
return {
ProcessKey,
currentNode: 1,
readonly: false,
loading: false,
rejectBtnDisabled: false, // 驳回按钮不可点击
agreeBtnDisabled: false, // 同意按钮不可点击
processInfoForm: {}, // 流程信息表单
// 流程信息校验
processInfoRules: {
commitText: [
{ required: false, message: this.$t('pleaseEnter') + this.$t('remark') }
]
},
baseInfoForm: {}
}
},
created () {
this.initData()
},
methods: {
// 初始化数据
initData () {
this.loading = true
enStandardEditGetDataById(this.$route.query.taskId).then(res => {
if (res.success) {
const result = res.result
this.processInfoForm = result.common
this.baseInfoForm = result.data
this.$nextTick(() => {
this.$refs.baseInfoRef.initData(this.baseInfoForm)
})
} else {
this.$message(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 标准化审核节点是否可进行评审会修改,需要修改备注的是否必填和同意、驳回按钮是否可用
standardizationAuditIsMeeting (value) {
// 选是的话,驳回按钮置灰,不可点击;选否,备注变成必填,内容自动带入“驳回”,下方同意按钮置灰,不可点击
if (value === '1') {
// 选了是
this.processInfoRules.commitText[0].required = false
this.rejectBtnDisabled = true
this.agreeBtnDisabled = false
} else {
// 选了否
this.processInfoRules.commitText[0].required = true
this.rejectBtnDisabled = false
this.agreeBtnDisabled = true
this.processInfoForm.commitText = '驳回'
}
},
// 转交
handleTurnTo () {
if (this.loading) return
// 点击显示选人组件
this.$refs.selectUserRef.open()
},
// 转交选完人的回调
selectUserChange (userIds) {
this.loading = true
const param = {}
param.userId = userIds
param.taskId = this.$route.query.taskId
enStandardEditTurnTo(param).then(res => {
if (res.success) {
this.$message(res.message)
this.goBack()
} else {
this.$message(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 保存
handleSave () {
if (this.loading) return
// 需要传给后端的
const paramObj = {}
// 流程信息
paramObj.basicProcessInfoDTO = Object.assign({}, this.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 = {}
paramObj.basicTaskInfoDTO.handleText = paramObj.basicProcessInfoDTO.commitText
paramObj.basicTaskInfoDTO.handleFile = paramObj.basicProcessInfoDTO.commitFile
paramObj.basicTaskInfoDTO.taskId = this.$route.query.taskId
// 业务基本信息
if (this.$refs.baseInfoRef) {
// 业务基本信息
const baseInfo = this.$refs.baseInfoRef.getData()
const param = { ...this.processInfoForm, ...baseInfo }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
} else {
// 业务基本信息和人员信息
paramObj.infoJsonStr = JSON.stringify({
data: Object.assign({}, baseInfo),
// personnelObj: personnelObj
})
}
} else {
// 需要外层信息至少填了一项
const param = { ...this.processInfoForm }
const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag) {
// 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return
}
}
this.loading = true
// 保存到草稿
enStandardEditSave(paramObj).then(res => {
if (res.success) {
this.$message(res.message)
this.goBack()
} else {
this.$message(res.message)
}
}).finally(() => {
this.loading = false
})
},
// 同意
handleAgree () {
if (this.loading) return
this.processInfoRules.commitText[0].required = false
if (!this.processInfoForm.commitText) {
this.processInfoForm.commitText = '同意'
}
this.$refs.processForm.validate().then(async () => {
if (this.currentNode === 4 || this.currentNode === 10) {
const data = await this.$refs.baseInfoRef.getDataValidate()
if (data) {
this.loading = true
const param = {}
param.common = Object.assign({}, this.processInfoForm)
param.common.taskId = this.$route.query.taskId
param.data = data
enStandardEditAgree(param).then(res => {
if (res.success) {
this.$message(res.message)
this.goBack()
} else {
this.$message(res.message)
}
}).finally(() => {
this.loading = false
})
}
} else {
this.loading = true
const param = {}
param.common = Object.assign({}, this.processInfoForm)
param.common.taskId = this.$route.query.taskId
enStandardEditAgree(param).then(res => {
if (res.success) {
this.$message(res.message)
this.goBack()
} else {
this.$message(res.message)
}
}).finally(() => {
this.loading = false
})
}
}).catch((errorInfo) => {
console.log(errorInfo)
})
},
// 驳回
handleReject () {
if (this.loading) return
this.processInfoRules.commitText[0].required = true
this.$refs.processForm.validate().then(() => {
this.loading = true
const param = {}
param.common = Object.assign({}, this.processInfoForm)
param.common.taskId = this.$route.query.taskId
enStandardEditReject(param).then(res => {
if (res.success) {
this.$message(res.message)
this.goBack()
} else {
this.$message(res.message)
}
}).finally(() => {
this.loading = false
this.processInfoRules.commitText[0].required = false
})
}).catch((errorInfo) => {
console.log(errorInfo)
if (errorInfo.find(item => item.name === 'commitText')) {
// 没通过校验的有备注,弹窗提示输入备注
this.$message(this.$t('pleaseEnterRemarks'))
}
})
},
// 提交
handleSubmit () {
if (this.loading) return
let personnelObj = {}
if (this.currentNode === 7) {
// 说明是部所联络人下发节点,需要传人员信息
personnelObj = this.$refs.personnelInfo.getDataObjVerify()
if (!personnelObj) {
this.activeTab = 'person'
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
if (this.currentNode === 7) {
param.flowUser = personnelObj
}
this.loading = true
enStandardEditAgree(param).then(res => {
if (res.success) {
this.$message(res.message)
this.goBack()
} else {
this.$message(res.message)
}
}).finally(() => {
this.loading = false
})
} else {
this.activeTab = 'basic'
}
})
},
goBack () {
this.$router.go(-1)
}
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,193 @@
<template>
<van-form
ref="baseInfoFormRef"
input-align="right"
error-message-align="right"
:readonly="readonly"
>
<!-- 业务基本信息 -->
<div class="process-part">
<div class="process-part-title">{{ $t('basicServiceInformation') }}</div>
<van-field v-model="formInline.typeOfRevision_dictText"
:label="$t('enStandardRevision.typeOfRevision')"
type="textarea"
autosize
readonly
rows="1"
:border="false"/>
<div v-for="formItem in dataList" :key="formItem.id">
<!-- 字典单选 -->
<picker-dict-field v-if="formItem.fieldShowType === FieldType.OPTION_SINGLE.value"
v-model="formInline[formItem.dbFieldName]"
:label="formItem.dbFieldTxt"
:dictCode="formItem.dictField"
readonly/>
<!-- 字典多选 -->
<picker-dict-checkbox-field v-else-if="formItem.fieldShowType === FieldType.OPTION_MORE.value"
v-model="formInline[formItem.dbFieldName]"
:label="formItem.dbFieldTxt"
:dictCode="formItem.dictField"
readonly/>
<!-- 多选组织机构 -->
<select-department-field v-else-if="formItem.fieldShowType === FieldType.ORGAN_MORE.value"
:label="formItem.dbFieldTxt"
:list="departmentList"
readonly
v-model="formInline[formItem.dbFieldName]"/>
<!-- 单选组织机构 -->
<select-department-field v-else-if="formItem.fieldShowType === FieldType.ORGAN_SINGLE.value"
:label="formItem.dbFieldTxt"
:list="departmentList"
readonly
v-model="formInline[formItem.dbFieldName]"/>
<van-field v-else
v-model="formInline[dictField.includes(formItem.dbFieldName) ? formItem.dbFieldName + '_dictText' : formItem.dbFieldName]"
:label="formItem.dbFieldTxt"
type="textarea"
autosize
readonly
rows="1"
:border="false">
<template v-slot:input v-if="fileField.includes(formItem.dbFieldName)">
<file-display :file-ids="formInline[formItem.dbFieldName]" />
</template>
</van-field>
</div>
</div>
</van-form>
</template>
<script>
import { StandardSource, FieldType } from '@/enums/commonEnums'
import {
getDepartmentList,
getEnterpriseStandardAddForm
} from '@/api/api'
import PickerDictField from '@/components/PickerDictField'
import PickerDictCheckboxField from '@/components/PickerDictCheckboxField'
import FileDisplay from '@/components/FileDisplay'
import SelectDepartmentField from '@/components/SelectDepartmentField'
export default {
name: 'BaseInfoForm',
components: { SelectDepartmentField, PickerDictCheckboxField, PickerDictField, FileDisplay },
data () {
return {
FieldType,
formInline: {},
dataList: [],
ruleList: [],
rules: {},
fileField: [], // 是上传文件类型的字段
dictField: [], // 是字典类型的字段
confirmLoading: false,
readonly: true,
departmentList: [] // 组织机构数据
}
},
created () {
this.initDepartmentList()
this.getForm()
},
methods: {
initData (data) {
this.formInline = JSON.parse(data.businessJson)
},
// 获取部门列表数据
initDepartmentList () {
getDepartmentList().then(res => {
if (res.success) {
this.departmentList = res.result
}
})
},
// 获取表单列表
getForm (callBack) {
this.confirmLoading = true
const params = {
module: StandardSource.ENTERPRISE.value,
type: 2
}
getEnterpriseStandardAddForm(params).then((res) => {
if (res.success) {
let dataList = res.result.基础信息
// 1、去掉三个代号一个年代号
dataList = dataList.filter(item => !['standard_code', 'name_code', 'category_code', 'year_number', 'standard_state'].includes(item.dbFieldName))
// 2、加零部件名称和代替标准号
const partName = res.result.适用范围.find(item => item.dbFieldName === 'part_name')
const substituteStandardNumber = res.result.关联信息.find(item => item.dbFieldName === 'substitute_standard_number')
if (partName) {
dataList.push(partName)
}
if (substituteStandardNumber) {
dataList.push(substituteStandardNumber)
}
console.log(dataList)
this.dataList = dataList
this.ruleList = dataList
this.integrateData()
this.dealFileAndDict()
callBack && callBack()
}
})
},
// 处理是否是文件或字典
dealFileAndDict () {
this.fileField = []
this.dictField = []
this.dataList.forEach(item => {
if (item.fieldShowType === FieldType.FILE_UP.value) {
this.fileField.push(item.dbFieldName)
}
const dictType = [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]
if (dictType.includes(item.fieldShowType)) {
this.dictField.push(item.dbFieldName)
}
})
},
// 设置表单校验
integrateData () {
this.isFormInline = false
const ruleList = this.ruleList
const rules = {}
ruleList.forEach((res, index) => {
const rule = []
if (res.fieldMustInput === '1') {
if ([FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value].includes(res.fieldShowType)) {
rule.push({
required: true,
message: res.dbFieldTxt + this.$t('cannotEmpty')
})
} else {
rule.push({
required: true,
message: res.dbFieldTxt + this.$t('cannotEmpty')
})
}
} else {
if ([FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value].includes(res.fieldShowType)) {
rule.push({
required: false,
message: res.dbFieldTxt + this.$t('cannotEmpty')
})
} else {
rule.push({
required: false,
message: res.dbFieldTxt + this.$t('cannotEmpty')
})
}
}
if (rule.length > 0) {
rules[res.dbFieldName] = rule
}
})
this.rules = { ...this.rules, ...rules }
this.confirmLoading = false
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
</style>
@@ -0,0 +1,186 @@
<template>
<div>
<!-- 业务基本信息 -->
<base-info-form ref="baseInfoForm"></base-info-form>
<!-- 标准文本 -->
<div class="process-part process-right-box">
<div class="process-part-title">{{ $t('standardText') }}</div>
<van-button plain color="#E63636">{{ $t('look') }}</van-button>
</div>
<!-- 评分表 -->
<div class="process-part" v-for="item in dataSource" :key="item.id">
<!-- 评分项 -->
<div class="process-part-title">{{ item.project }}</div>
<!-- 描述文本 -->
<div class="desc-text-title">{{ $t('enStandardRevision.descText') }}</div>
<div class="desc-text-cont">{{ item.desc }}</div>
<!-- 分值范围 -->
<a-table :columns="columns" :dataSource="item.scoreRange" :pagination="false"></a-table>
<!-- 评分 -->
<van-field :label="$t('enStandardRevision.grade')"
type="textarea"
autosize
readonly
rows="1"
input-align="right"
:border="false">
<template v-slot:input>
<van-stepper
:rules="[{required: true}]"
v-model="item.evaluateScore"
/>
</template>
</van-field>
<!-- 扣分理由 -->
<van-field
v-model="item.deductionScoreReason"
:rules="[{required: true, message: $t('pleaseEnter')+$t('enStandardRevision.groundsForDemerit')}]"
:label="$t('enStandardRevision.groundsForDemerit')"
type="textarea"
autosize
rows="2"
:placeholder="$t('pleaseEnter')"
:border="false"
input-align="left"
class="vertical-form-item"/>
</div>
</div>
</template>
<script>
import BaseInfoForm from './BaseInfoForm'
const fixDataSourse = [
{
id: 1,
project: '文本格式(15分)',
desc: '评估标准文件的格式是否符合GB/T 1.1的要求,包括文件名、编号、版本号、' +
'发布日期、生效日期、引用文件章节、图表等内容是否齐全、准确、清晰。',
scoreRange: [
{ common: '0~5', good: '6~10', excellent: '11~15' }
]
},
{
id: 4,
project: '标准内容(45分)',
desc: '评估标准文件的内容是否详细准确、内容详实、逻辑清晰、科学合理。包括术语定义、' +
'引用标准、技术要求、试验检测方法等各个方面是否符合/严于法律法规、国家标准、行业标准等要求。',
scoreRange: [
{ common: '0~20', good: '21~35', excellent: '36~45' }
]
},
{
id: 7,
project: '适用性 (10分)',
desc: '评估标准文件的应用范围是否明确、适用,是否与研发工艺、质量、生产、采购等环节相符合。',
scoreRange: [
{ common: '0~3', good: '4~6', excellent: '7~10' }
]
},
{
id: 10,
project: '完整性 (15分)',
desc: '评估标准文件所涉及的专业领域是否全面、系统,是否涵盖了所有相关模版' +
'(比如设计规范模版、释放规范模版、产品技术条件模版)所规定的要素和环节。',
scoreRange: [
{ common: '0~5', good: '6~10', excellent: '11~15' }
]
},
{
id: 13,
project: '可读性 (5分)',
desc: '评估标准文件的可读性是否良好,是否有错别字,是否易于阅读和理解。',
scoreRange: [
{ common: '0~2', good: '3~4', excellent: '5' }
]
},
{
id: 16,
project: '权威性及可执行性(10分)',
desc: '评估标准文件的权威性是否足够,是否得到了相关方的认可和信任,是否得到了有效的贯彻和执行。',
scoreRange: [
{ common: '0~3', good: '4~6', excellent: '7~10' }
]
}
]
export default {
name: 'ScorerMarkBaseInfo',
components: { BaseInfoForm },
data () {
return {
columns: [
{ // 一般
title: this.$t('enStandardRevision.common'),
align: 'center',
dataIndex: 'common'
},
{ // 优良
title: this.$t('enStandardRevision.good'),
align: 'center',
dataIndex: 'good'
},
{ // 优秀
title: this.$t('enStandardRevision.excellent'),
align: 'center',
dataIndex: 'excellent'
}
],
dataSource: []
}
},
methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
console.log(data)
// 给表格赋值,在线编辑不知道要怎么赋值?
if (data.reviewMeetingDetails && data.reviewMeetingDetails.length > 0) {
this.dataSource = JSON.parse(JSON.stringify(fixDataSourse))
for (const i in fixDataSourse) {
this.dataSource[i].evaluateScore = data.reviewMeetingDetails[i].evaluateScore || ''
this.dataSource[i].deductionScoreReason = data.reviewMeetingDetails[i].deductionScoreReason || ''
}
} else {
this.dataSource = JSON.parse(JSON.stringify(fixDataSourse))
}
console.log(this.dataSource)
// 给表单赋值
this.$nextTick(() => {
this.$refs.baseInfoForm.initData(data)
})
},
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
.process-right-box {
display: flex;
justify-content: space-between;
align-items: center;
/deep/ .van-button {
width: 1.22rem;
height: 0.57rem;
margin: 0 0.32rem 0.24rem 0;
font-size: 0.28rem;
}
}
// 描述文本标题
.desc-text-title {
font-size: 0.3rem;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: rgba(29,33,41,0.9);
margin: 0 0 0.24rem 0.32rem;
}
// 描述文本内容
.desc-text-cont {
font-size: 0.24rem;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #888888;
margin: 0 0.32rem;
}
</style>
@@ -0,0 +1,160 @@
<template>
<div>
<base-info-form ref="baseInfoForm"></base-info-form>
<van-form
ref="baseInfoFormRef"
input-align="right"
error-message-align="right"
:readonly="readonly"
>
<!-- 是否可进行评审会 -->
<picker-field
:rules="baseInfoRule.reviewMeetingFlag"
:label="$t('enStandardRevision.isCanAuditMeeting')"
:placeholder="$t('pleaseSelect') + $t('enStandardRevision.isCanAuditMeeting')"
:columnData="isColumnData"
@change="reviewMeetingFlagChange"
v-model="formInline.reviewMeetingFlag" />
<template v-if="formInline.reviewMeetingFlag === '1'">
<!-- 评审人 -->
<select-user-field
:rules="baseInfoRule.reviewUser"
:label="$t('enStandardRevision.assessor')"
v-model="formInline.reviewUser"
fieldName="reviewUser"
@selectNameChange="userNameChange"
:checkedNames="formInline.reviewUser_dictText"
type="radio"
/>
<!-- 评分人 -->
<select-user-field
:rules="baseInfoRule.raters"
:label="$t('enStandardRevision.scorer')"
v-model="formInline.raters"
fieldName="raters"
@selectNameChange="userNameChange"
:checkedNames="formInline.raters_dictText"
type="checkbox"
/>
<!-- 评审日期 -->
<calendar-field
:rules="baseInfoRule.reviewDate"
:label="$t('enStandardRevision.reviewDate')"
v-model="formInline.reviewDate"
:placeholder="$t('pleaseSelect') + $t('enStandardRevision.reviewDate')"
type="date"
/>
<!-- 评审地点 -->
<van-field
:rules="baseInfoRule.reviewPlace"
v-model="formInline.reviewPlace"
:label="$t('enStandardRevision.judgingVenue')"
:placeholder="$t('pleaseEnter') + $t('enStandardRevision.judgingVenue')"
type="textarea"
autosize
rows="1"
:border="false"
/>
</template>
</van-form>
</div>
</template>
<script>
import BaseInfoForm from '@/views/workCenter/enterpriseStandardRevision/module/BaseInfoForm'
import PickerField from '@/components/PickerField'
import SelectUserField from '@/components/SelectUserField'
import CalendarField from '@/components/CalendarField'
export default {
name: 'StandardizationCheckBaseInfo',
components: {
BaseInfoForm,
PickerField,
SelectUserField,
CalendarField
},
data () {
return {
readonly: false,
// 是否可进行评审会下拉数据
isColumnData: [
{ name: this.$t('yes'), value: '1', text: this.$t('yes') },
{ name: this.$t('no'), value: '0', text: this.$t('no') }
],
baseInfoRule: {
// 评审人
reviewUser: [
{
required: true,
message: this.$t('pleaseSelect') + this.$t('enStandardRevision.assessor')
}
],
// 评分人
raters: [
{
required: true,
message: this.$t('pleaseSelect') + this.$t('enStandardRevision.scorer')
}
],
// 评审日期
reviewDate: [
{
required: true,
message: this.$t('pleaseSelect') + this.$t('enStandardRevision.reviewDate')
}
],
// 评审地点
reviewPlace: [
{
required: true,
message: this.$t('pleaseEnter') + this.$t('enStandardRevision.judgingVenue')
}
]
},
formInline: {}
}
},
methods: {
initData (data) {
this.formInline = Object.assign({}, data)
if (!this.formInline.reviewMeetingFlag) {
this.formInline.reviewMeetingFlag = '1'
}
this.reviewMeetingFlagChange()
// 给表单赋值
this.$nextTick(() => {
this.$refs.baseInfoForm.initData(data)
})
},
// 外层要获取数据
getData () {
// 把数据抛出,在线编辑不知道要不要抛
const data = Object.assign({}, this.formInline)
return data
},
// 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () {
let data = {} // 要返回的数据
await this.$refs.baseInfoFormRef.validate().then(() => {
data = Object.assign({}, this.formInline)
}).catch((errorInfo) => {
data = false
console.log(errorInfo)
})
return data
},
userNameChange (value, fieldName) {
this.formInline[fieldName + 'dictText'] = value
},
// 是否可进行评审会
reviewMeetingFlagChange () {
// 选是的话,驳回按钮置灰,不可点击;选否,备注变成必填,内容自动带入“驳回”,下方同意按钮置灰,不可点击
this.$emit('standardizationAuditIsMeeting', this.formInline.reviewMeetingFlag)
}
}
}
</script>
<style scoped>
</style>