update 标准法规入库/变更流程
This commit is contained in:
+9
-6
@@ -102,19 +102,22 @@ export default class EsEnum {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据value获取按钮
|
* 通过value获取其他属性
|
||||||
|
* @param key
|
||||||
|
* @param value
|
||||||
|
* @returns {*|null}
|
||||||
*/
|
*/
|
||||||
btnOfValue (value) {
|
propertyOfValue (key, value) {
|
||||||
if (!value && value!== 0) {
|
if (!value && value!== 0) {
|
||||||
return []
|
return null
|
||||||
}
|
}
|
||||||
for (const i in this) {
|
for (const i in this) {
|
||||||
const e = this[i]
|
const e = this[i]
|
||||||
if (e.value !== undefined && e.value !== null && e.value.toString() === value.toString()) {
|
if (e[key] !== undefined && e[key] !== null) {
|
||||||
return e.btn || []
|
return e[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return []
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -212,8 +212,8 @@ export const IsReadOnlyEnums = {
|
|||||||
|
|
||||||
// 标准法规入库/变更流程
|
// 标准法规入库/变更流程
|
||||||
export const FGEntryChangeProcessNode = new EsEnums({
|
export const FGEntryChangeProcessNode = new EsEnums({
|
||||||
initiate: { text: '法规工程师发起', value: '1', btn: ['save', 'submit'] },
|
initiate: { text: '填写法规信息', value: '填写法规信息', btn: ['save', 'submit'], disabled: false },
|
||||||
approve: { text: '审批', value: '审批', btn: ['return', 'save', 'agree', 'reject'] }
|
approve: { text: '审批', value: '审批', btn: ['return', 'save', 'agree', 'reject'], disabled: true }
|
||||||
})
|
})
|
||||||
|
|
||||||
// 标准征求意见流程
|
// 标准征求意见流程
|
||||||
|
|||||||
+57
-12
@@ -257,7 +257,7 @@
|
|||||||
v-model="formInline[item.dbFieldName]"
|
v-model="formInline[item.dbFieldName]"
|
||||||
@nameChange="treeSelectNameChange"
|
@nameChange="treeSelectNameChange"
|
||||||
:filedName="item.dbFieldName"
|
:filedName="item.dbFieldName"
|
||||||
type="radio"
|
type="checkbox"
|
||||||
:nameStr="formInline[item.dbFieldName + '_dictText']"
|
:nameStr="formInline[item.dbFieldName + '_dictText']"
|
||||||
:dict-id="item.dictId"
|
:dict-id="item.dictId"
|
||||||
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
|
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
@change="event => event.target.value = event.target.value.trim()"
|
@change="event => event.target.value = event.target.value.trim()"
|
||||||
:maxLength="500"
|
:maxLength="500"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
v-decorator="['handleText']" />
|
v-decorator="['handleText', validatorRules.handleText]" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!--附件-->
|
<!--附件-->
|
||||||
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
|
<a-form-item :labelCol="longLabelCol" :wrapperCol="longWrapperCol" :label="$t('businessSupport.questionAnswer.attach')">
|
||||||
@@ -426,7 +426,14 @@ export default {
|
|||||||
switchValue: 'base',
|
switchValue: 'base',
|
||||||
excludeStandardNumbers: null,
|
excludeStandardNumbers: null,
|
||||||
currentNode: null,
|
currentNode: null,
|
||||||
btnList: [] // 拥有的按钮
|
btnList: [], // 拥有的按钮
|
||||||
|
validatorRules: {
|
||||||
|
// 备注
|
||||||
|
handleText: {
|
||||||
|
rules: [{ required: false, message: this.$t('pleaseEnter') + this.$t('remarks') }],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -458,7 +465,6 @@ export default {
|
|||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
if (this.$route.query.processInstanceId || this.$route.query.draftId) {
|
if (this.$route.query.processInstanceId || this.$route.query.draftId) {
|
||||||
this.disabled = true
|
|
||||||
this.initProcessData()
|
this.initProcessData()
|
||||||
} else {
|
} else {
|
||||||
this.currentNode = FGEntryChangeProcessNode.initiate.value
|
this.currentNode = FGEntryChangeProcessNode.initiate.value
|
||||||
@@ -477,26 +483,54 @@ export default {
|
|||||||
initProcessData () {
|
initProcessData () {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const { processInstanceId, draftId } = this.$route.query
|
const { processInstanceId, draftId } = this.$route.query
|
||||||
queryStandardECProcessData({ processInstanceId, draftId }).then(res => {
|
queryStandardECProcessData({ processInstanceId, draftId }).then(async res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
const businessData = Object.assign({}, { ...res.result.businessInfoDTO.businessMap })
|
const businessData = Object.assign({}, { ...res.result.businessInfoDTO.businessMap })
|
||||||
this.formInline.source = businessData.source
|
this.formInline.source = businessData.source
|
||||||
this.loading = false
|
this.loading = false
|
||||||
// 获取对应类型的表单
|
// 获取对应类型的表单
|
||||||
this.handleSourceChange()
|
await this.handleSourceChange()
|
||||||
// 处理流程信息回显
|
// 处理流程信息回显
|
||||||
this.processInfo = Object.assign({}, res.result.basicProcessInfoDTO || {})
|
this.processInfo = Object.assign({}, res.result.basicProcessInfoDTO || {})
|
||||||
// 处理流程审批信息
|
// 处理流程审批信息
|
||||||
this.approvalInfo = Object.assign({}, res.result.basicTaskInfoDTO || {})
|
this.approvalInfo = Object.assign({}, res.result.basicTaskInfoDTO || {})
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// 处理表单数据回显
|
// 处理表单数据回显
|
||||||
this.formInline = Object.assign({ ...this.formInline }, { ...businessData })
|
|
||||||
this.formInline.standard_number_temp = this.formInline.standard_number
|
|
||||||
this.processInfoForm.setFieldsValue(this.processInfo)
|
this.processInfoForm.setFieldsValue(this.processInfo)
|
||||||
this.approvalInfoForm.setFieldsValue(this.approvalInfo)
|
this.approvalInfoForm.setFieldsValue(this.approvalInfo)
|
||||||
|
|
||||||
|
// 处理业务基本信息部分的数据
|
||||||
|
const formList = Object.values(this.formList).reduce((acc, cur) => acc.concat(cur), [])
|
||||||
|
this.formInline = Object.assign({ ...this.formInline }, { ...businessData })
|
||||||
|
this.formInline.standard_number_temp = this.formInline.standard_number
|
||||||
|
const treeMultipleField = formList.filter(tt => tt.fieldShowType === FieldType.TREE.value)
|
||||||
|
treeMultipleField.forEach(field => {
|
||||||
|
const valueArr = []
|
||||||
|
if (this.formInline[field.dbFieldName]) {
|
||||||
|
const values = this.formInline[field.dbFieldName].split(',')
|
||||||
|
for (let i = 0; i < values.length; i++) {
|
||||||
|
valueArr[i] = {
|
||||||
|
value: values[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.formInline[field.dbFieldName] = valueArr
|
||||||
|
} else {
|
||||||
|
this.formInline[field.dbFieldName] = undefined
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const dictField = formList.filter(tt => tt.fieldShowType === FieldType.OPTION_SINGLE.value)
|
||||||
|
dictField.forEach(field => {
|
||||||
|
this.formInline[field.dbFieldName] = this.formInline[field.dbFieldName] || null
|
||||||
|
})
|
||||||
})
|
})
|
||||||
// 获取按钮清单
|
// 获取按钮清单
|
||||||
this.btnList = FGEntryChangeProcessNode.btnOfValue(this.$route.query.taskName)
|
const btnList = FGEntryChangeProcessNode.propertyOfValue('btn', this.$route.query.taskName)
|
||||||
|
if (btnList && btnList.length > 0) {
|
||||||
|
this.btnList = btnList
|
||||||
|
} else {
|
||||||
|
this.btnList = FGEntryChangeProcessNode.approve.btn
|
||||||
|
}
|
||||||
|
this.disabled = FGEntryChangeProcessNode.propertyOfValue('disabled', this.$route.query.taskName) || false
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning(res.message)
|
this.$message.warning(res.message)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@@ -517,6 +551,7 @@ export default {
|
|||||||
* 获取国内标准的表单
|
* 获取国内标准的表单
|
||||||
*/
|
*/
|
||||||
initDomesticStandardForm () {
|
initDomesticStandardForm () {
|
||||||
|
return new Promise(resolve => {
|
||||||
const params = {
|
const params = {
|
||||||
module: StandardSource.DOMESTIC.value,
|
module: StandardSource.DOMESTIC.value,
|
||||||
type: 2 // 2是新增;1是详情
|
type: 2 // 2是新增;1是详情
|
||||||
@@ -539,12 +574,15 @@ export default {
|
|||||||
}
|
}
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 获取海外标准的表单
|
* 获取海外标准的表单
|
||||||
*/
|
*/
|
||||||
initOverseasStandardForm () {
|
initOverseasStandardForm () {
|
||||||
|
return new Promise(resolve => {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
const params = {
|
const params = {
|
||||||
module: StandardSource.OVERSEAS.value,
|
module: StandardSource.OVERSEAS.value,
|
||||||
@@ -564,6 +602,7 @@ export default {
|
|||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 默认所有面板都是展开状态
|
* 默认所有面板都是展开状态
|
||||||
@@ -678,18 +717,21 @@ export default {
|
|||||||
* 来源变更,重新获取表单
|
* 来源变更,重新获取表单
|
||||||
*/
|
*/
|
||||||
handleSourceChange () {
|
handleSourceChange () {
|
||||||
|
return new Promise(async resolve => {
|
||||||
switch (this.formInline.source) {
|
switch (this.formInline.source) {
|
||||||
case StandardSource.DOMESTIC.value:
|
case StandardSource.DOMESTIC.value:
|
||||||
this.initDomesticStandardForm()
|
await this.initDomesticStandardForm()
|
||||||
break
|
break
|
||||||
case StandardSource.OVERSEAS.value:
|
case StandardSource.OVERSEAS.value:
|
||||||
this.initOverseasStandardForm()
|
await this.initOverseasStandardForm()
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
this.formInline.source = StandardSource.DOMESTIC.value
|
this.formInline.source = StandardSource.DOMESTIC.value
|
||||||
this.initDomesticStandardForm()
|
await this.initDomesticStandardForm()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
resolve()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 操作类型变化
|
* 操作类型变化
|
||||||
@@ -826,6 +868,8 @@ export default {
|
|||||||
* 同意
|
* 同意
|
||||||
*/
|
*/
|
||||||
handleAgree () {
|
handleAgree () {
|
||||||
|
this.validatorRules.handleText.rules[0].required = false
|
||||||
|
this.approvalInfoForm.setFieldsValue({ handleText: '同意' })
|
||||||
const formData = this.dealFormData()
|
const formData = this.dealFormData()
|
||||||
if (!formData) {
|
if (!formData) {
|
||||||
return
|
return
|
||||||
@@ -846,6 +890,7 @@ export default {
|
|||||||
* 驳回
|
* 驳回
|
||||||
*/
|
*/
|
||||||
handleReject () {
|
handleReject () {
|
||||||
|
this.validatorRules.handleText.rules[0].required = true
|
||||||
const formData = this.dealFormData()
|
const formData = this.dealFormData()
|
||||||
if (!formData) {
|
if (!formData) {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user