[update] 修改企标更改流程

This commit is contained in:
lideqin
2023-11-24 14:26:04 +08:00
parent 0c12db10d9
commit 0f071b75bb
4 changed files with 73 additions and 39 deletions
@@ -1,5 +1,5 @@
<template> <template>
<internal-detail-page :title="pageTitle" :content-padding="0"> <internal-detail-page :title="pageTitle" :content-padding="0" :loading="loading">
<!-- 标题右侧tab --> <!-- 标题右侧tab -->
<template v-slot:titleRightCustom> <template v-slot:titleRightCustom>
<div class="table-operator-tab"> <div class="table-operator-tab">
@@ -79,7 +79,7 @@
<!-- 人员信息 --> <!-- 人员信息 -->
<div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0"> <div v-show="switchValue === 'user'" class="detail-page-scroll-content p-0">
<process-detail-list> <process-detail-list>
<personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNode + ''"></personnel-info> <personnel-info slot="personnelInfo" ref="personnelInfo" :data="personnelInfoData" :currentNode="currentNodeName"></personnel-info>
</process-detail-list> </process-detail-list>
</div> </div>
<!-- 操作按钮 --> <!-- 操作按钮 -->
@@ -257,6 +257,7 @@ export default {
func = enStandardChangeGetDataDraft func = enStandardChangeGetDataDraft
params = param params = param
} }
this.loading = true
func(params).then(res => { func(params).then(res => {
if (res.success) { if (res.success) {
this.model = res.result this.model = res.result
@@ -267,11 +268,14 @@ export default {
if (type === 'draft') { if (type === 'draft') {
this.approvalInfoForm.setFieldsValue(pick(this.model.common, 'commitText', 'commitFile')) this.approvalInfoForm.setFieldsValue(pick(this.model.common, 'commitText', 'commitFile'))
} }
// 初始化业务基本信息中组件内容
this.$refs.baseInfoRef.initData(this.model.data)
}) })
// 初始化业务基本信息中组件内容
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => {
this.loading = false
}) })
}, },
// 头部tab改变 // 头部tab改变
@@ -305,7 +309,7 @@ export default {
const baseInfo = this.$refs.baseInfoRef.getData() const baseInfo = this.$refs.baseInfoRef.getData()
const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...baseInfo.formInline } const param = { ...processInfoForm, ...approvalInfoForm, ...personnelObj, ...baseInfo.formInline }
const flag = Object.values(param).some(v => !!v || v === 0) const flag = Object.values(param).some(v => !!v || v === 0)
if (!flag || (baseInfo.dataSource && baseInfo.dataSource.length <= 0)) { if (!flag && (baseInfo.dataSource && baseInfo.dataSource.length <= 0)) {
// 提示至少填写一项 // 提示至少填写一项
this.$message.warning(this.$t('pleaseFillInAtLeastOneItem')) this.$message.warning(this.$t('pleaseFillInAtLeastOneItem'))
return return
@@ -127,19 +127,18 @@ export default {
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
this.data = data
// 给表格赋值,在线编辑不知道要怎么赋值? // 给表格赋值,在线编辑不知道要怎么赋值?
// this.dataSource = this.dataSource = data.list
// 给表单赋值 // 给表单赋值
// this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.baseInfoForm.formInline = this.$refs.baseInfoForm.initData(data)
// }) })
}, },
// 外层要获取数据 // 外层要获取数据
getData () { getData () {
// 把数据抛出,在线编辑不知道要不要抛 // 把数据抛出,在线编辑不知道要不要抛
const data = {} const data = {}
data.formInline = this.$refs.baseInfoForm.formInline data.formInline = this.$refs.baseInfoForm.getData()
data.dataSource = this.dataSource data.dataSource = this.dataSource
return data return data
}, },
@@ -54,7 +54,6 @@
<!-- 标准等级分类 --> <!-- 标准等级分类 -->
<div class="box-title-text form-flex-item"> <div class="box-title-text form-flex-item">
<div class="title-text"> <div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.standardGradeClassification')"> <span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.standardGradeClassification')">
{{ $t('workCenter.enterpriseInitChangePlan.standardGradeClassification') }} {{ $t('workCenter.enterpriseInitChangePlan.standardGradeClassification') }}
</span> </span>
@@ -78,16 +77,14 @@
</span> </span>
</div> </div>
<a-form-model-item class="item-model" prop="standardSystem"> <a-form-model-item class="item-model" prop="standardSystem">
<a-tree-select <s-tree-select
v-model="formInline.standardSystem" v-model="formInline.standardSystem"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
style="width: 100%"
:disabled="disabled" :disabled="disabled"
:tree-data="standardSystemOptions" :tree-data="standardSystemOptions"
tree-checkable tree-checkable
treeCheckStrictly treeCheckStrictly
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.standardSystem')" /> :placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.standardSystem')" />
</a-form-model-item> </a-form-model-item>
</div> </div>
<!-- 标准英文名称 --> <!-- 标准英文名称 -->
<div class="box-title-text form-flex-item"> <div class="box-title-text form-flex-item">
@@ -186,7 +183,7 @@
v-model="formInline.partName" v-model="formInline.partName"
@nameChange="treeSelectNameChange" @nameChange="treeSelectNameChange"
filedName="partName" filedName="partName"
type="radio" type="checkbox"
:nameStr="formInline.partName_dictText" :nameStr="formInline.partName_dictText"
dict-id="1696007957666533377" dict-id="1696007957666533377"
:disabled="disabled" /> :disabled="disabled" />
@@ -248,6 +245,7 @@
<standard-selection :source="StandardSource.ENTERPRISE.value" <standard-selection :source="StandardSource.ENTERPRISE.value"
:disabled="disabled" :disabled="disabled"
:disabledSourceSearch="true" :disabledSourceSearch="true"
:exclude-standard-numbers="formInline.standardNumber"
type="radio" type="radio"
v-model="formInline.substituteStandardNumber" /> v-model="formInline.substituteStandardNumber" />
</a-form-model-item> </a-form-model-item>
@@ -264,6 +262,7 @@
<standard-selection :source="StandardSource.ENTERPRISE.value" <standard-selection :source="StandardSource.ENTERPRISE.value"
:disabled="disabled" :disabled="disabled"
:disabledSourceSearch="true" :disabledSourceSearch="true"
:exclude-standard-numbers="formInline.standardNumber"
type="radio" type="radio"
v-model="formInline.quotedStandard" /> v-model="formInline.quotedStandard" />
</a-form-model-item> </a-form-model-item>
@@ -335,6 +334,7 @@ import StandardSelection from '@/components/selection/StandardSelection'
import UserSelection from '@/components/selection/UserSelection' import UserSelection from '@/components/selection/UserSelection'
import UploadFile from '@/components/UploadFile' import UploadFile from '@/components/UploadFile'
import TreeSelection from '@/components/selection/TreeSelection' import TreeSelection from '@/components/selection/TreeSelection'
import STreeSelect from '@/components/STreeSelect'
export default { export default {
name: 'BaseInfoForm', name: 'BaseInfoForm',
@@ -342,7 +342,8 @@ export default {
StandardSelection, StandardSelection,
UserSelection, UserSelection,
UploadFile, UploadFile,
TreeSelection TreeSelection,
STreeSelect
}, },
props: { props: {
disabled: { disabled: {
@@ -379,7 +380,7 @@ export default {
// 标准等级分类 // 标准等级分类
gradeClassification: [ gradeClassification: [
{ {
required: true, required: false,
message: this.$t('workCenter.enterpriseInitChangePlan.standardGradeClassification') + this.$t('cannotEmpty'), message: this.$t('workCenter.enterpriseInitChangePlan.standardGradeClassification') + this.$t('cannotEmpty'),
trigger: 'change' trigger: 'change'
} }
@@ -424,6 +425,40 @@ export default {
this.initStandardSystemOptions() this.initStandardSystemOptions()
}, },
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) {
this.formInline = Object.assign({}, data)
this.formInline.standardSystem = this.formInline.standardSystem ? this.formInline.standardSystem.split(',').map(item => {
return { value: item }
}) : []
},
// 外层要获取数据
getData () {
const formInline = Object.assign({}, this.formInline)
if (formInline.standardSystem && formInline.standardSystem.length > 0) {
formInline.standardSystem = formInline.standardSystem.map(item => item.value).join(',')
} else {
formInline.standardSystem = ''
}
return formInline
},
// 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () {
let formInline = {}
await this.$refs.ruleForm.validate(valid => {
if (valid) {
formInline = Object.assign({}, this.formInline)
if (formInline.standardSystem && formInline.standardSystem.length > 0) {
formInline.standardSystem = formInline.standardSystem.map(item => item.value).join(',')
} else {
formInline.standardSystem = ''
}
} else {
formInline = false
}
})
return formInline
},
// 获取标准体系下拉框数据 // 获取标准体系下拉框数据
initStandardSystemOptions () { initStandardSystemOptions () {
getTreeList({ option: 1 }).then(res => { getTreeList({ option: 1 }).then(res => {
@@ -30,7 +30,7 @@
:can-drag="true" :can-drag="true"
:scroll="{x: '100%'}" :scroll="{x: '100%'}"
ref="table" ref="table"
rowKey="enterpriseStandardPlanId" :rowKey="(record, index) => { return index }"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="false" :pagination="false"
@@ -138,37 +138,33 @@ export default {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
// 给表格赋值,在线编辑不知道要怎么赋值? // 给表格赋值,在线编辑不知道要怎么赋值?
this.dataSource = data.dataSource this.dataSource = data.list
// 给表单赋值 // 给表单赋值
// this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.baseInfoForm.formInline = this.$refs.baseInfoForm.initData(data)
// }) })
}, },
// 外层要获取数据 // 外层要获取数据
getData () { getData () {
// 把数据抛出,在线编辑不知道要不要抛 // 把数据抛出,在线编辑不知道要不要抛
const data = {} const data = {}
data.formInline = this.$refs.baseInfoForm.formInline data.formInline = this.$refs.baseInfoForm.getData()
if (data.formInline.standardSystem && data.formInline.standardSystem.length > 0) {
data.formInline.standardSystem = data.formInline.standardSystem.map(item => item.value).join(',')
}
data.dataSource = this.dataSource data.dataSource = this.dataSource
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
async getDataValidate () { async getDataValidate () {
let data = {} let data = {}
await this.$refs.baseInfoForm.$refs.ruleForm.validate(valid => { const formInline = await this.$refs.baseInfoForm.getDataValidate()
if (valid) { if (formInline && this.dataSource.length > 0) {
data.formInline = this.$refs.baseInfoForm.formInline data.formInline = formInline
if (data.formInline.standardSystem && data.formInline.standardSystem.length > 0) { data.dataSource = this.dataSource
data.formInline.standardSystem = data.formInline.standardSystem.map(item => item.value).join(',') } else if (this.dataSource.length <= 0) {
} this.$message.warning(this.$t('addAtLeastOneRowOfData'))
data.dataSource = this.dataSource data = false
} else { } else {
data = false data = false
} }
})
return data return data
}, },
// 企标编号和名称修改触发流程名称的修改 // 企标编号和名称修改触发流程名称的修改
@@ -204,7 +200,7 @@ export default {
this.dataSource.push(value) this.dataSource.push(value)
} }
}, },
// 修改前按钮点击 // 修改前按钮点击,后端还没有给文件id??
beforeUpdateClick (record) { beforeUpdateClick (record) {
} }