160 lines
5.1 KiB
Vue
160 lines
5.1 KiB
Vue
<template>
|
|
<div>
|
|
<base-info-form ref="baseInfoForm" v-bind="$attrs" disabled></base-info-form>
|
|
<a-form-model :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
|
|
<div class="form-flex-box">
|
|
<!-- 标准文本 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.standardText')">
|
|
{{ $t('workCenter.enStandardRevision.standardText') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model">
|
|
<div class="online-edit-wrapper">
|
|
<p>{{ $t('enterpriseStandard') }}</p>
|
|
<a-button type="primary" @click="onlineEditView">{{ $t('view') }}</a-button>
|
|
</div>
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 是否开启征求意见 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.isOpenComment')">
|
|
{{ $t('workCenter.enStandardRevision.isOpenComment') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="adviceFlag">
|
|
<a-radio-group v-model="formInline.adviceFlag">
|
|
<a-radio value="1">
|
|
{{ $t('yes') }}
|
|
</a-radio>
|
|
<a-radio value="0">
|
|
{{ $t('not') }}
|
|
</a-radio>
|
|
</a-radio-group>
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 部门联络人 -->
|
|
<div v-if="formInline.adviceFlag === '1'" class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.departmentalLiaison')">
|
|
{{ $t('workCenter.enStandardRevision.departmentalLiaison') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="contactUser">
|
|
<user-selection v-model="formInline.contactUser"
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardRevision.departmentalLiaison')"
|
|
:disabled="disabled"
|
|
filedName="contactUser"
|
|
@nameChange="userSelectNameChange"
|
|
:nameStr="formInline.contactUser_dictText"
|
|
type="checkbox"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</div>
|
|
</a-form-model>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import BaseInfoForm from './BaseInfoForm'
|
|
import UserSelection from '@/components/selection/UserSelection'
|
|
import Vue from 'vue'
|
|
import { kkFilePreview } from '@/utils/kkFilePreview'
|
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
|
import { queryFileInfoByEditId } from '../../../../api/workCenter'
|
|
import { Base64 } from 'js-base64'
|
|
export default {
|
|
name: 'ConfirmWhetherCommentBaseInfo',
|
|
components: { BaseInfoForm, UserSelection },
|
|
props: {
|
|
disabled: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
formInline: {},
|
|
rules: {
|
|
// 部门联络人
|
|
contactUser: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.enStandardRevision.departmentalLiaison') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
]
|
|
},
|
|
onEditFile: '' // 在线编辑的文件id
|
|
}
|
|
},
|
|
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 () {
|
|
// 把数据抛出,在线编辑不知道要不要抛
|
|
const data = Object.assign({}, this.formInline)
|
|
return data
|
|
},
|
|
// 外层获取数据要过校验,返回false表示没有通过校验
|
|
async getDataValidate () {
|
|
let data = {}
|
|
await this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
data = Object.assign({}, this.formInline)
|
|
} else {
|
|
data = false
|
|
}
|
|
})
|
|
return data
|
|
},
|
|
// 选择用户得到用户名
|
|
userSelectNameChange (value, fieldName) {
|
|
this.formInline[fieldName + '_dictText'] = value
|
|
},
|
|
// 在线编辑的查看
|
|
onlineEditView () {
|
|
this.$emit('onlineEditView', this.onEditFile)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
@import '~@assets/less/common.less';
|
|
.collapsible-content-no-head {
|
|
border-top: 1px solid #E5E6EB;
|
|
border-radius: 8px 8px 8px 8px;
|
|
}
|
|
|
|
.online-edit-wrapper {
|
|
height: 100%;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
p {
|
|
margin-bottom: 0;
|
|
height: 100%;
|
|
}
|
|
.ant-btn {
|
|
margin-right: 20px;
|
|
}
|
|
}
|
|
</style>
|