134 lines
3.8 KiB
Vue
134 lines
3.8 KiB
Vue
<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" @click="onlineEditView">{{ $t('look') }}</van-button>
|
|
</div>
|
|
<van-form
|
|
ref="baseInfoFormRef"
|
|
input-align="right"
|
|
error-message-align="right"
|
|
:readonly="readonly"
|
|
>
|
|
<!-- 是否开启征求意见 -->
|
|
<picker-field
|
|
:rules="baseInfoRule.adviceFlag"
|
|
:label="$t('enStandardRevision.isOpenComment')"
|
|
:placeholder="$t('pleaseSelect') + $t('enStandardRevision.isOpenComment')"
|
|
:columnData="isColumnData"
|
|
v-model="formInline.adviceFlag" />
|
|
<!-- 部门联络人 -->
|
|
<select-user-field
|
|
v-if="formInline.adviceFlag === '1'"
|
|
:rules="baseInfoRule.contactUser"
|
|
:label="$t('enStandardRevision.departmentalLiaison')"
|
|
v-model="formInline.contactUser"
|
|
fieldName="contactUser"
|
|
@selectNameChange="userNameChange"
|
|
:checkedNames="formInline.contactUser_dictText"
|
|
type="checkbox"
|
|
/>
|
|
</van-form>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import BaseInfoForm from './BaseInfoForm'
|
|
import PickerField from '@/components/PickerField'
|
|
import SelectUserField from '@/components/SelectUserField'
|
|
|
|
export default {
|
|
name: 'ConfirmWhetherCommentBaseInfo',
|
|
components: { BaseInfoForm, PickerField, SelectUserField },
|
|
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: {
|
|
// 部门联络人
|
|
contactUser: [
|
|
{
|
|
required: true,
|
|
message: this.$t('pleaseSelect') + this.$t('enStandardRevision.departmentalLiaison')
|
|
}
|
|
]
|
|
},
|
|
formInline: {},
|
|
onEditFile: '' // 在线编辑的文件
|
|
}
|
|
},
|
|
watch: {
|
|
// 是否开启征求意见
|
|
'formInline.adviceFlag': {
|
|
handler (val) {
|
|
if (val && val === '1') {
|
|
// 开启征求意见,部门联络人必填
|
|
this.baseInfoRule.contactUser[0].required = true
|
|
} else {
|
|
this.baseInfoRule.contactUser[0].required = false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
initData (data) {
|
|
this.formInline = Object.assign({}, data)
|
|
if (!this.formInline.adviceFlag) {
|
|
this.formInline.adviceFlag = '1'
|
|
}
|
|
this.onEditFile = data.onEditFile
|
|
// 给表单赋值
|
|
this.$nextTick(() => {
|
|
this.$refs.baseInfoForm.initData(data)
|
|
})
|
|
},
|
|
// 外层要获取数据
|
|
getData () {
|
|
console.log(this.formInline)
|
|
// 把数据抛出,在线编辑不知道要不要抛
|
|
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
|
|
},
|
|
// 在线编辑的查看
|
|
onlineEditView () {
|
|
this.$emit('onlineEditView', this.onEditFile)
|
|
}
|
|
}
|
|
}
|
|
</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;
|
|
}
|
|
}
|
|
</style>
|