293 lines
12 KiB
Vue
293 lines
12 KiB
Vue
<template>
|
|
<a-form-model :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
|
|
<div class="collapsible-panel-form">
|
|
<div class="form-flex-box collapsible-panel-form-content collapsible-content-no-head">
|
|
<!-- 紧急程度 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.standardPromotionProcess.urgency')">
|
|
{{ $t('workCenter.standardPromotionProcess.urgency') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="urgency">
|
|
<j-dict-select-tag :disabled="disabled"
|
|
v-model="formInline.urgency"
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.standardPromotionProcess.urgency')"
|
|
:triggerChange="false"
|
|
type="radio"
|
|
dictCode="yn" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 企标编号 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.standardPromotionProcess.esNumber')">
|
|
{{ $t('workCenter.standardPromotionProcess.esNumber') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="esNumber">
|
|
<standard-selection source="3"
|
|
:disabledSourceSearch="true"
|
|
:disabled="disabled"
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.standardPromotionProcess.esNumber')"
|
|
@nameChange="changeStandardName"
|
|
v-model="formInline.esNumber" />
|
|
</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.standardPromotionProcess.esName')">
|
|
{{ $t('workCenter.standardPromotionProcess.esName') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="esName">
|
|
<a-input disabled
|
|
v-model="formInline.esName"
|
|
:maxLength="50"
|
|
:placeholder="$t('pleaseEnter')+$t('workCenter.standardPromotionProcess.esName')" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 宣贯人 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.standardPromotionProcess.promoter')">
|
|
{{ $t('workCenter.standardPromotionProcess.promoter') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="promoter">
|
|
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.standardPromotionProcess.promoter')"
|
|
v-model="formInline.promoter"
|
|
:disabled="disabled"
|
|
type="radio" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 主送部门 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.standardPromotionProcess.mainDeliveryDepart')">
|
|
{{ $t('workCenter.standardPromotionProcess.mainDeliveryDepart') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="mainDeliveryDepart">
|
|
<a-input v-model="formInline.mainDeliveryDepart"
|
|
:maxLength="50"
|
|
:placeholder="$t('pleaseEnter')+$t('workCenter.standardPromotionProcess.mainDeliveryDepart')" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 主题 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.standardPromotionProcess.subject')">
|
|
{{ $t('workCenter.standardPromotionProcess.subject') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="subject">
|
|
<a-input v-model="formInline.subject"
|
|
:maxLength="50"
|
|
:placeholder="$t('pleaseEnter')+$t('workCenter.standardPromotionProcess.subject')" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 宣贯日期 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.standardPromotionProcess.promotionDate')">
|
|
{{ $t('workCenter.standardPromotionProcess.promotionDate') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="promotionDate">
|
|
<j-date date-format="YYYY-MM-DD" style="width: 100%" showType="day" :disabled="disabled"
|
|
:placeholder="$t('pleaseSelect') + $t('workCenter.standardPromotionProcess.promotionDate')"
|
|
v-model="formInline.promotionDate" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 参宣单位 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.standardPromotionProcess.participatingUnits')">
|
|
{{ $t('workCenter.standardPromotionProcess.participatingUnits') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="participatingUnits">
|
|
<j-select-depart
|
|
:disabled="disabled"
|
|
v-model="formInline.participatingUnits"
|
|
:multi="true"
|
|
:placeholder="$t('pleaseSelect') + $t('workCenter.standardPromotionProcess.participatingUnits')"
|
|
:backDepart="true"
|
|
:treeOpera="true">>
|
|
</j-select-depart>
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 联络人 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.standardPromotionProcess.contactPerson')">
|
|
{{ $t('workCenter.standardPromotionProcess.contactPerson') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="contactPerson">
|
|
<a-input disabled
|
|
v-model="formInline.contactPerson"
|
|
:maxLength="50"
|
|
:placeholder="$t('pleaseEnter')+$t('workCenter.standardPromotionProcess.contactPerson')" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 内容 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.standardPromotionProcess.content')">
|
|
{{ $t('workCenter.standardPromotionProcess.content') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="content">
|
|
<a-textarea :maxLength="500"
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.standardPromotionProcess.content')"
|
|
:rows="4"
|
|
v-model="formInline.content" />
|
|
</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.standardPromotionProcess.promotionalMaterials')">
|
|
{{ $t('workCenter.standardPromotionProcess.promotionalMaterials') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="promotionalMaterials">
|
|
<a-button type="primary" class="button-text" @click="clickButtonToUpload" :disabled="disabled">
|
|
{{
|
|
(formInline.promotionalMaterials === 'null' || formInline.promotionalMaterials === '' || formInline.promotionalMaterials === null || formInline.promotionalMaterials === undefined)
|
|
? $t('uploadFile.clickUpload')
|
|
: $t('uploadFile.viewUploadedFiles')
|
|
}}
|
|
</a-button>
|
|
</a-form-model-item>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 上传 -->
|
|
<upload-file ref="uploadFile" @change="uploadFileChange" :return-url="false"></upload-file>
|
|
</a-form-model>
|
|
</template>
|
|
|
|
<script>
|
|
import StandardSelection from '@comp/selection/StandardSelection'
|
|
import UserSelection from '@comp/selection/UserSelection'
|
|
import UploadFile from '@comp/UploadFile'
|
|
export default {
|
|
name: 'BaseInfoForm',
|
|
components: { UploadFile, UserSelection, StandardSelection },
|
|
props: {
|
|
disabled: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
formInline: {},
|
|
// 操作类型
|
|
operationType: null,
|
|
rules: {
|
|
// 操作类型
|
|
operationType: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.esInspectionRectification.operationType') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
// 整改结果
|
|
rectificationResults: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.esInspectionRectification.rectificationResults') + this.$t('cannotEmpty'),
|
|
trigger: 'blur'
|
|
}
|
|
],
|
|
// 申请延期日期
|
|
requestExtensionDate: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.esInspectionRectification.requestExtensionDate') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
// 延期说明
|
|
extensionDescription: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.esInspectionRectification.extensionDescription') + this.$t('cannotEmpty'),
|
|
trigger: 'blur'
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
|
|
initData (data) {
|
|
this.data = data
|
|
// 给表单赋值
|
|
// this.formInline =
|
|
},
|
|
// 外层要获取数据
|
|
getData () {
|
|
// 把数据抛出,在线编辑不知道要不要抛
|
|
const data = {}
|
|
data.formInline = this.formInline
|
|
return data
|
|
},
|
|
// 外层获取数据要过校验,返回false表示没有通过校验
|
|
getDataValidate (callback) {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
const data = {}
|
|
data.formInline = this.formInline
|
|
callback(data)
|
|
}
|
|
})
|
|
},
|
|
// 选择标准带出名称
|
|
changeStandardName (val) {
|
|
this.formInline.esName = val
|
|
},
|
|
// 点击点击上传按钮
|
|
clickButtonToUpload (item) {
|
|
this.$refs.uploadFile.open(item.fileId)
|
|
// this.uploadName = item.dbFieldName
|
|
},
|
|
// 文件上传改变后的回调
|
|
uploadFileChange (data) {
|
|
const attIdList = []
|
|
if (data && data.length > 0) {
|
|
data.map(item => {
|
|
attIdList.push(item.id)
|
|
})
|
|
}
|
|
/** 赋值给当前对应的表单文件 */
|
|
this.form.file = attIdList.join(',')
|
|
}
|
|
}
|
|
}
|
|
</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;
|
|
}
|
|
</style>
|