387 lines
13 KiB
Java
387 lines
13 KiB
Java
<template>
|
|
<a-modal
|
|
:title="$t('setting')"
|
|
:width="1100"
|
|
:visible="visible"
|
|
:confirm-loading="confirmLoading"
|
|
:maskClosable="false"
|
|
@ok="handleOk"
|
|
@cancel="handleCancel"
|
|
>
|
|
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
|
|
<a-row :gutter="24">
|
|
<a-col :span="12">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<span class="Required">*</span>
|
|
<span class="title-text-text" :title="$t('confirmationOfRegulationsList')">
|
|
{{$t('confirmationOfRegulationsList')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel" prop="listConfirmation">
|
|
<a-date-picker class="box-input"
|
|
:placeholder="$t('PleaseSelect')+$t('confirmationOfRegulationsList')"
|
|
@change="dateChange({db_field_name:'listConfirmation'})"
|
|
format="YYYY-MM-DD"
|
|
:getCalendarContainer="(trigger) => trigger.parentNode"
|
|
v-model="formInline.listConfirmation"
|
|
:disabled="false"
|
|
style="width: 100%"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<span class="Required">*</span>
|
|
<span class="title-text-text" :title="$t('regulatoryTaskConfirmation')">
|
|
{{$t('regulatoryTaskConfirmation')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel" prop="legalTaskConfirmation">
|
|
<a-date-picker class="box-input"
|
|
:placeholder="$t('PleaseSelect')+$t('regulatoryTaskConfirmation')"
|
|
@change="dateChange({db_field_name:'legalTaskConfirmation'})"
|
|
format="YYYY-MM-DD"
|
|
:getCalendarContainer="(trigger) => trigger.parentNode"
|
|
v-model="formInline.legalTaskConfirmation"
|
|
:disabled="false"
|
|
style="width: 100%"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<span class="Required">*</span>
|
|
<span class="title-text-text" :title="$t('confirmationOfDesignConformity')">
|
|
{{$t('confirmationOfDesignConformity')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel" prop="designDeadline">
|
|
<a-date-picker class="box-input"
|
|
:placeholder="$t('PleaseSelect')+$t('confirmationOfDesignConformity')"
|
|
@change="dateChange({db_field_name:'designDeadline'})"
|
|
format="YYYY-MM-DD"
|
|
:getCalendarContainer="(trigger) => trigger.parentNode"
|
|
v-model="formInline.designDeadline"
|
|
:disabled="false"
|
|
style="width: 100%"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<span class="Required">*</span>
|
|
<span class="title-text-text" :title="$t('preHomoCompletion')">
|
|
{{$t('preHomoCompletion')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel" prop="prehomoDeadline">
|
|
<a-date-picker class="box-input"
|
|
:placeholder="$t('PleaseSelect')+$t('preHomoCompletion')"
|
|
@change="dateChange({db_field_name:'prehomoDeadline'})"
|
|
format="YYYY-MM-DD"
|
|
:getCalendarContainer="(trigger) => trigger.parentNode"
|
|
v-model="formInline.prehomoDeadline"
|
|
:disabled="false"
|
|
style="width: 100%"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<span class="Required">*</span>
|
|
<span class="title-text-text" :title="$t('certificationStart')">
|
|
{{$t('certificationStart')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel" prop="attestationStartTime">
|
|
<a-date-picker class="box-input"
|
|
:disabledDate='this.disabledRegistrationStartDate'
|
|
:placeholder="$t('PleaseSelect')+$t('certificationStart')"
|
|
@change="dateChange({db_field_name:'attestationStartTime'})"
|
|
format="YYYY-MM-DD"
|
|
:getCalendarContainer="(trigger) => trigger.parentNode"
|
|
v-model="formInline.attestationStartTime"
|
|
:disabled="false"
|
|
style="width: 100%"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<span class="Required">*</span>
|
|
<span class="title-text-text" :title="$t('certificationEnd')">
|
|
{{$t('certificationEnd')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel" prop="attestationEndTime">
|
|
<a-date-picker class="box-input"
|
|
:disabledDate='this.disabledRegistrationEndDate'
|
|
:placeholder="$t('PleaseSelect')+$t('certificationEnd')"
|
|
@change="dateChange({db_field_name:'attestationEndTime'})"
|
|
format="YYYY-MM-DD"
|
|
:getCalendarContainer="(trigger) => trigger.parentNode"
|
|
v-model="formInline.attestationEndTime"
|
|
:disabled="false"
|
|
style="width: 100%"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<span class="Required">*</span>
|
|
<span class="title-text-text" :title="$t('verificationAndConformityconfirmation')">
|
|
{{$t('verificationAndConformityconfirmation')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel" prop="verifyDeadline">
|
|
<a-date-picker class="box-input"
|
|
:placeholder="$t('PleaseSelect')+$t('verificationAndConformityconfirmation')"
|
|
@change="dateChange({db_field_name:'verifyDeadline'})"
|
|
format="YYYY-MM-DD"
|
|
:getCalendarContainer="(trigger) => trigger.parentNode"
|
|
v-model="formInline.verifyDeadline"
|
|
:disabled="false"
|
|
style="width: 100%"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
</a-row>
|
|
</a-form-model>
|
|
</a-modal>
|
|
</template>
|
|
|
|
<script>
|
|
import { getAction, postAction, putAction } from '@/api/manage'
|
|
import moment from 'moment'
|
|
|
|
export default {
|
|
name: 'settingList',
|
|
props: ['url'],
|
|
data() {
|
|
return {
|
|
visible: false,
|
|
confirmLoading: false,
|
|
formInline: {},
|
|
rules: {
|
|
listConfirmation: [
|
|
{
|
|
required: true,
|
|
message: this.$t('confirmationOfRegulationsList') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
legalTaskConfirmation: [
|
|
{
|
|
required: true,
|
|
message: this.$t('regulatoryTaskConfirmation') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
designDeadline: [
|
|
{
|
|
required: true,
|
|
message: this.$t('confirmationOfDesignConformity') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
prehomoDeadline: [
|
|
{
|
|
required: true,
|
|
message: this.$t('preHomoCompletion') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
attestationStartTime: [
|
|
{
|
|
required: true,
|
|
message: this.$t('certificationStart') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
attestationEndTime: [
|
|
{
|
|
required: true,
|
|
message: this.$t('certificationEnd') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
verifyDeadline: [
|
|
{
|
|
required: true,
|
|
message: this.$t('verificationConfirmationDeadline') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
]
|
|
},
|
|
ids: []
|
|
}
|
|
},
|
|
mounted() {
|
|
},
|
|
methods: {
|
|
disabledRegistrationEndDate(endDate) {
|
|
const { attestationStartTime, attestationEndTime } = this.formInline
|
|
if (attestationEndTime && endDate.valueOf() > attestationEndTime.valueOf()) {
|
|
return true
|
|
}
|
|
return endDate < moment(attestationStartTime).add('days')
|
|
},
|
|
disabledRegistrationStartDate(StartDate) {
|
|
const { attestationStartTime, attestationEndTime } = this.formInline
|
|
if (attestationEndTime && StartDate.valueOf() > attestationEndTime.valueOf()) {
|
|
return true
|
|
}
|
|
return StartDate > moment(attestationEndTime).add('days')
|
|
},
|
|
edit() {
|
|
this.visible = true
|
|
this.$nextTick(() => {
|
|
this.$refs.ruleForm.clearValidate()
|
|
})
|
|
this.settingQueryForm()
|
|
},
|
|
settingQueryForm() {
|
|
getAction(this.url.settingQueryForm, { projectId: this.$route.query.id }).then((res) => {
|
|
if (res.success) {
|
|
this.$nextTick(() => {
|
|
this.formInline = res.result || {}
|
|
})
|
|
}
|
|
})
|
|
},
|
|
handleOk() {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
let query = {
|
|
...this.formInline,
|
|
projectId: this.$route.query.id
|
|
}
|
|
let url = ''
|
|
let Action
|
|
if (this.formInline.id) {
|
|
url = this.url.editSettingUrl
|
|
Action = putAction
|
|
} else {
|
|
url = this.url.addSettingUrl
|
|
Action = postAction
|
|
}
|
|
this.confirmLoading = true
|
|
Action(url, query).then((res) => {
|
|
if (res.success) {
|
|
this.$message.success(this.$t('OperationSuccessful'))
|
|
this.visible = false
|
|
this.confirmLoading = false
|
|
this.$emit('settingListForm')
|
|
} else {
|
|
this.$message.warning(this.$t('operationFailed'))
|
|
this.confirmLoading = false
|
|
}
|
|
})
|
|
}
|
|
})
|
|
},
|
|
handleCancel() {
|
|
this.formInline = {}
|
|
this.visible = false
|
|
},
|
|
dateChange(item) {
|
|
this.formInline[item.db_field_name] = this.formInline[item.db_field_name] ? moment(this.formInline[item.db_field_name]).format('YYYY-MM-DD') : ''
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.formAdd .ant-form-item-label {
|
|
width: 130px;
|
|
}
|
|
|
|
.formAdd .ant-form-item-control-wrapper {
|
|
display: inline-block;
|
|
width: 100%;
|
|
}
|
|
|
|
/*.formAdd .ant-form-item {*/
|
|
/* margin-bottom: 20px;*/
|
|
/*}*/
|
|
|
|
.itemModel .ant-form-item-control-wrapper {
|
|
width: 100%;
|
|
}
|
|
|
|
.box-input .ant-select-selection--single {
|
|
height: 38px;
|
|
}
|
|
|
|
.box-input .ant-select-selection--multiple {
|
|
height: 38px;
|
|
}
|
|
|
|
.box-input .ant-select-selection__rendered {
|
|
line-height: 38px;
|
|
height: 38px;
|
|
}
|
|
|
|
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
|
|
margin-top: 6px;
|
|
}
|
|
|
|
.box-input .ant-calendar-picker {
|
|
line-height: 38px;
|
|
height: 38px;
|
|
}
|
|
|
|
.box-input .ant-calendar-picker-input {
|
|
height: 38px;
|
|
}
|
|
|
|
.box-input .ant-input-number-input-wrap {
|
|
line-height: 38px;
|
|
height: 38px;
|
|
}
|
|
</style>
|
|
<style scoped>
|
|
.box-title-text {
|
|
line-height: 1.4;
|
|
display: flex;
|
|
}
|
|
|
|
.title-text {
|
|
width: 144px;
|
|
text-align: right;
|
|
display: inline-block;
|
|
font-weight: 500;
|
|
font-size: 14px;
|
|
margin-right: 16px;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
height: 42px;
|
|
line-height: 42px;
|
|
}
|
|
|
|
.box-input {
|
|
display: inline-block;
|
|
height: 38px;
|
|
width: 100%;
|
|
}
|
|
|
|
.itemModel {
|
|
width: calc(100% - 130px);
|
|
display: inline-block;
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.title-text-text {
|
|
margin-top: 9px;
|
|
}
|
|
|
|
.formAdd {
|
|
margin-bottom: 40px;
|
|
}
|
|
|
|
.Required {
|
|
color: red;
|
|
margin-right: 3px;
|
|
}
|
|
</style> |