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