Files
laws_weilai/jero-web/src/views/projectManagement/platformItemLibraryDetails/components/addModel.vue
T

1014 lines
38 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--平台件-->
<template>
<a-drawer
:title="title"
:maskClosable="false"
:width="1000"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<!-- 项目基本信息-->
<div class="header-text">
{{$t('basicInformationOfParameters')}}
</div>
<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('power')">{{$t('power')}}</span>
</div>
<a-form-model-item class="itemModel" prop="power">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('power')"
v-model="formInline.power"></a-input>
</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('producer')">{{$t('producer')}}</span>
</div>
<a-form-model-item class="itemModel" prop="producer">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('producer')"
v-model="formInline.producer"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<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('targetMarket')">{{$t('targetMarket')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="targetMarket">
<j-multi-select-tag class="box-input" v-model="formInline.targetMarket"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('targetMarket')"
:type="'select'"
:triggerChange="false" :dictCode="'region'"/>
</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('brand')">{{$t('brand')}}</span>
</div>
<a-form-model-item class="itemModel" prop="brand">
<j-dict-select-tag class="box-input" v-model="formInline.brand"
:placeholder="$t('PleaseSelect')+$t('brand')"
:type="'select'"
@input="handleInput('brand')"
:triggerChange="false" :dictCode="'brand'"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<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('projectStatus')">{{$t('projectStatus')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="projectStatus">
<j-multi-select-tag class="box-input" v-model="formInline.projectStatus"
:disabled="disabled"
:placeholder="$t('PleaseSelect')+$t('projectStatus')"
:type="'select'"
:triggerChange="false" :dictCode="'project_status'"/>
</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('statisticalNodes')">{{$t('statisticalNodes')}}</span>
</div>
<a-form-model-item class="itemModel" prop="dutyTerritory">
<a-select :placeholder="$t('PleaseSelect')+$t('statisticalNodes')"
allowClear
show-search
mode="multiple"
optionFilterProp="label"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
v-model="formInline.dutyTerritory">
<a-select-option v-for="(item, key) in firstLevelDutyTerritoryList"
:key="key"
:label="item.key"
:value="item.key">
<span style="display: inline-block;width: 100%" :title=" item.key ">
{{ item.key }}
</span>
</a-select-option>
</a-select>
</a-form-model-item>
</div>
</a-col>
</a-row>
<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('regulatoryEngineer')">{{$t('regulatoryEngineer')}}</span>
</div>
<a-form-model-item class="itemModel" :prop="'regulationOwnerIdName'">
<PersonnelSelection :query="{db_field_name:'regulationOwnerId',db_field_txt:$t('regulatoryEngineer')}"
:isSingleChoice="true"
:personneQuery="formInline"
@change="PersonnelSelectionChange"
v-model="formInline.regulationOwnerIdName"/>
</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('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}}</span>
</div>
<a-form-model-item class="itemModel" prop="engineeringInterfacePersonName">
<PersonnelSelection :query="{db_field_name:'engineeringInterfacePerson',db_field_txt:$t('regulatoryEngineer')}"
:isSingleChoice="true"
:personneQuery="formInline"
@change="PersonnelSelectionChange"
v-model="formInline.engineeringInterfacePersonName"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Nameplatelabel')">{{$t('Nameplatelabel')}}</span>
</div>
<a-form-model-item class="itemModelimg" prop="explanation">
<div>
<!-- brandLabel-->
<a-upload
:action="uploadAction+'?state='+state+'&cut='+cut"
list-type="picture-card"
:file-list="fileList"
@preview="handlePreview"
@change="handleChange"
:headers="headers"
>
<div v-if="fileList.length < 20">
<a-icon type="plus" />
<div class="ant-upload-text">
<!-- Upload-->
</div>
</div>
</a-upload>
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancelimg">
<img alt="example" style="width: 100%" :src="previewImage" />
</a-modal>
</div>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('explain')">{{$t('explain')}}</span>
</div>
<a-form-model-item class="itemModel" prop="explanation">
<a-textarea :placeholder="$t('pleaseEnter')+$t('explain')"
v-model="formInline.explanation"
:maxLength="500"
:rows="2"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<!-- 电池备案记录-->
<div class="header-text">
{{$t('Batteryfilingrecord')}}
</div>
<!-- 型号信息-->
<div class='header-title'>
<span class='header-title-text'>{{$t('Modelinformation')}}</span>
</div>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('productModel')">{{$t('productModel')}}</span>
</div>
<a-form-model-item class="itemModel" prop="productModel">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('productModel')"
v-model="formInline.productModel"></a-input>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Electriccellproductionenterprises')">{{$t('Electriccellproductionenterprises')}}</span>
</div>
<a-form-model-item class="itemModel" prop="Electriccellproductionenterprises">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Electriccellproductionenterprises')"
v-model="formInline.cellEnterprise"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Assemblymanufacturer')">{{$t('Assemblymanufacturer')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="Assemblymanufacturer">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Assemblymanufacturer')"
v-model="formInline.assemblyEnterprise"></a-input>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('PartNumberCN')">{{$t('PartNumberCN')}}</span>
</div>
<a-form-model-item class="itemModel" prop="PartNumberCN">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('PartNumberCN')"
v-model="formInline.partNumberCn"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('PartNumberEU')">{{$t('PartNumberEU')}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="PartNumberEU">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('PartNumberEU')"
v-model="formInline.part_numberEn"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<!-- 电池国标码-->
<div class='header-title'>
<span class='header-title-text'>{{$t('Batterynationalcode')}}</span>
</div>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('bitfilecode')">{{$t('bitfilecode')}}</span>
</div>
<a-form-model-item class="itemModel" prop="bitfilecode">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('bitfilecode')"
v-model="formInline.filingCode"></a-input>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Vendorcode') + '(13)'">{{$t('Vendorcode') + '(13)'}}</span>
</div>
<a-form-model-item class="itemModel" prop="endorcode">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Vendorcode') + '(13)'"
v-model="formInline.supplierCode"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Productclasscode') + '(4)'">{{$t('Productclasscode') + '(4)'}}</span>
</div>
<a-form-model-item class="itemModel" prop="Productclasscode">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Productclasscode') + '(4)'"
v-model="formInline.productTypeCode"></a-input>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Batterytypecode') + '(5)'">{{$t('Batterytypecode') + '(5)'}}</span>
</div>
<a-form-model-item class="itemModel" prop="Batterytypecode">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Batterytypecode') + '(5)'"
v-model="formInline.batteryTypeCode"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Specificationcode') + '(67)'">{{$t('Specificationcode') + '(67)'}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="Specificationcode">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Specificationcode') + '(67)'"
v-model="formInline.specificationCode"></a-input>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Traceinformationcode') + '(814)'">{{$t('Traceinformationcode') + '(814)'}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="Traceinformationcode">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Traceinformationcode') + '(814)'"
v-model="formInline.traceabilityCode"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Productionyearmonthdateserialnumber') + '(1520)'">{{$t('Productionyearmonthdateserialnumber') + '(1520)'}}</span>
</div>
<a-form-model-item class="itemModel-multi" prop="Productionyearmonthdateserialnumber">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Productionyearmonthdateserialnumber') + '(1520)'"
v-model="formInline.ymdNumber"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<!-- 备案信息-->
<div class='header-title'>
<span class='header-title-text'>{{$t('Recordnformation')}}</span>
</div>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('dimension')">{{$t('dimension')}}</span>
</div>
<a-form-model-item class="itemModel" prop="dimension">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('dimension')"
v-model="formInline.size"></a-input>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Ratedcapacity')">{{$t('Ratedcapacity')}}</span>
</div>
<a-form-model-item class="itemModel" prop="Ratedcapacity">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Ratedcapacity')"
v-model="formInline.ratedCapacity"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Nominalvoltage')">{{$t('Nominalvoltage')}}</span>
</div>
<a-form-model-item class="itemModel" prop="Nominalvoltage">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Nominalvoltage')"
v-model="formInline.nominalVoltage"></a-input>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Ratedmass')">{{$t('Ratedmass')}}</span>
</div>
<a-form-model-item class="itemModel" prop="Ratedmass">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Ratedmass')"
v-model="formInline.ratedMass"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Numbercontainedmodules')">{{$t('Numbercontainedmodules')}}</span>
</div>
<a-form-model-item class="itemModel" prop="Numbercontainedmodules">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Numbercontainedmodules')"
v-model="formInline.moduleNumber"></a-input>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Moduleseriesparallelmode')">{{$t('Moduleseriesparallelmode')}}</span>
</div>
<a-form-model-item class="itemModel" prop="Moduleseriesparallelmode">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Moduleseriesparallelmode')"
v-model="formInline.connectionType"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('modulspecificationcodeused')">{{$t('modulspecificationcodeused')}}</span>
</div>
<a-form-model-item class="itemModel" prop="modulspecificationcodeused">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('modulspecificationcodeused')"
v-model="formInline.moduleSpecificationCode"></a-input>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Coolingmode')">{{$t('Coolingmode')}}</span>
</div>
<a-form-model-item class="itemModel" prop="dimension">
<a-input class="box-input" :maxLength="200" :placeholder="$t('PleaseEnter')+$t('Coolingmode')"
v-model="formInline.coolingMethod"></a-input>
</a-form-model-item>
</div>
</a-col>
</a-row>
<!-- 备注-->
<div class='header-title'>
<span class='header-title-text'>{{$t('remarks')}}</span>
</div>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('Filingcompletiontime')">{{$t('Filingcompletiontime')}}</span>
</div>
<a-form-model-item class="itemModel" prop="designDueDate">
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('Filingcompletiontime')"
@change="dateChange({db_field_name:'filingCompletionTime'})"
format="YYYY-MM-DD"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.filingCompletionTime"
style="width: 100%"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('remarks')">{{$t('remarks')}}</span>
</div>
<a-form-model-item class="itemModel" prop="remarks">
<a-textarea
:placeholder="$t('remarks')"
:maxLength="500"
v-model="formInline.remark" :rows="2"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: 8px" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import { mapGetters } from 'vuex'
import moment from 'moment'
import Vue from 'vue'
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = () => resolve(reader.result)
reader.onerror = (error) => reject(error)
})
}
export default {
name: 'addModel',
components: {
PersonnelSelection
},
props: ['url'],
data() {
return {
formInline: {},
confirmLoading: false,
visible: false,
yearNameDataList: [],
rules: {
ipdInfo: [
{
pattern: /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%$#_]*)?/,
message: this.$t('pleaseEnterTheCorrectWebAddress')
},
{
max: 200,
message: this.$t('configurationInformation') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
vehicleDevelopmentPlan: [
{
pattern: /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%$#_]*)?/,
message: this.$t('pleaseEnterTheCorrectWebAddress')
},
{
max: 200,
message: this.$t('dehicleDevelopmentPlan') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
explanation: [
{
max: 500,
message: this.$t('explain') + this.$t('cannotExceed') + 500 + this.$t('Characters'),
trigger: 'blur'
}
],
attestationPlan: [
{
pattern: /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%$#_]*)?/,
message: this.$t('pleaseEnterTheCorrectWebAddress')
},
{
max: 200,
message: this.$t('certificationProgram') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
vehiclePlatform: [
{
max: 200,
message: this.$t('ModelPlatform') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
projectNameId:[
{
required: true,
message: this.$t('entryName') + this.$t('cannotEmpty'),
trigger: 'blur'
},
{
max: 200,
message: this.$t('DigitalPlatform') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
power:[
{
required: true,
message: this.$t('power') + this.$t('cannotEmpty'),
trigger: 'blur'
},
{
max: 200,
message: this.$t('DigitalPlatform') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
producer:[
{
required: true,
message: this.$t('producer') + this.$t('cannotEmpty'),
trigger: 'blur'
},
{
max: 200,
message: this.$t('DigitalPlatform') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
digitalPlatform: [
{
max: 200,
message: this.$t('DigitalPlatform') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
softwareVersion: [
{
max: 200,
message: this.$t('softwareVersion') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
yearNameId: [
{
required: true,
message: this.$t('modelYear') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
targetMarket: [
{
required: true,
message: this.$t('targetMarket') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
brand: [
{
required: true,
message: this.$t('brand') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
projectStatus: [
{
required: true,
message: this.$t('projectStatus') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
studioEngineerName: [
{
required: true,
message: this.$t('StudioEngineer') + this.$t('cannotEmpty'),
trigger: 'change'
},
{
max: 100,
message: this.$t('StudioEngineer') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'change'
}
],
dutyTerritory: [
{
required: true,
message: this.$t('statisticalNodes') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
regulationOwnerIdName: [
{
required: true,
message: this.$t('regulatoryEngineer') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
engineeringInterfacePersonName: [
{
required: true,
message: this.$t('engineeringInterfacePerson') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
},
disabled: false,
previewVisible: false,
previewImage: '',
cut: '',
fileList: [],
projectNameList: [],
firstLevelDutyTerritoryList:[],
title: '',
headers: {},
uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload',
state: undefined,
myuploadAction: window._CONFIG['domianURL'] + this.thisFileUploadUrl,
upDataList: [],
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
downLoadImgUrl: window._CONFIG['domianWebImgURL'] + '/sys/common/download',
}
},
created() {
this.containerId = 'container-ty-' + new Date().getTime()
},
mounted() {
this.getNameList()
let long = localStorage.getItem('language')
this.cut = ''
if (long && long == 'zh-cn') {
this.cut = 'cn'
} else if (long && long == 'en-us') {
this.cut = 'en'
}
},
methods: {
...mapGetters(['userInfo']),
handleCancelimg() {
this.previewVisible = false;
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
handleChange({ fileList }) {
this.fileList = fileList;
console.log(this.fileList)
let filelist = []
let filelistId = []
this.fileList.forEach((item => {
filelist.push(item.response)
}))
console.log(filelist,'111')
filelist.forEach((item => {
filelistId.push(item.result.id)
}))
this.formInline.brandLabel = filelistId.join(',')
this.formInline = { ...this.formInline }
},
getFirstLevelDutyTerritory() {
getAction('/sys/dictItem/getFirstLevelDutyTerritory', {}).then((res) => {
if (res.success) {
this.firstLevelDutyTerritoryList = res.result
} else {
this.firstLevelDutyTerritoryList = []
}
})
},
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') : ''
},
getNameList(value) {
getAction('project/projectNameInfoEO/list', {}).then((res) => {
if (res.success) {
this.projectNameList = res.result || []
if (this.title == this.$t('edit')) {
let content = this.projectNameList.filter(res => {
return res.id == value.projectNameId
})
this.formInline = value
console.log(this.formInline)
this.formInline = { ...this.formInline }
}
} else {
this.projectNameList = []
}
})
},
addModel() {
this.visible = true
this.title = this.$t('add')
this.formInline = {}
this.getNameList()
this.getFirstLevelDutyTerritory()
const token = Vue.ls.get(ACCESS_TOKEN)
this.headers = { 'X-Access-Token': token }
console.log(this.headers)
this.formInline.regulationOwnerIdName = this.userInfo().username
this.formInline.regulationOwnerId = this.userInfo().id
this.formInline.projectVersion = '00'
this.formInline = { ...this.formInline }
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
},
editModel(value) {
this.visible = true
this.title = this.$t('edit')
this.getNameList(value)
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
},
handleCancel() {
this.visible = false
},
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let url = ''
let Action
if (this.formInline.id) {
url = this.url.edit
Action = putAction
} else {
url = this.url.add
Action = postAction
}
let query = JSON.parse(JSON.stringify(this.formInline))
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',')
}
})
this.confirmLoading = true
Action(url, query).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.$emit('addModelList')
// this.vdrClick()
} else {
this.$message.warning(res.message)
this.confirmLoading = false
}
})
}
})
},
// 跳转vdr
// vdrClick(){
// let _this = this
// this.$confirm({
// content: _this.$t('Rematchornot') + 'VDR',
// onOk() {
// let newUrl = _this.$router.resolve({
// path:'otaAuthentication',
// })
// window.open(newUrl.href, '_blank')
// }
// })
// },
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
this.formInline = { ...this.formInline }
},
projectNameChange(value) {
this.formInline.yearNameId = undefined
let content = this.projectNameList.filter(res => {
return res.id == value
})
this.formInline.vehiclePlatform = content[0].vehiclePlatform || ''
this.formInline.digitalPlatform = content[0].digitalPlatform || ''
this.formInline = { ...this.formInline }
}
}
}
</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;
/*align-items: center;*/
}
.title-text {
width: 114px;
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: 48px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
height: 40px;
margin-bottom: 24px;
}
.itemModelimg {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
margin-bottom: 24px;
}
.header-text {
font-size: 16px;
color: #000000;
font-weight: bold;
}
.header-title-text{
font-size: 16px;
color: #000000;
line-height: 50px;
margin: 0 19px;
}
.header-title{
background: #F5F6F7;
width: 100%;
height: 50px;
margin-top: 10px;
margin-bottom: 10px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.formAdd {
margin-bottom: 40px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
z-index: 100;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
<style>
.ant-input-disabled {
color: rgba(0, 0, 0, 0.65) !important;
}
</style>