项目库新增添加年款字段

This commit is contained in:
qq787203167
2022-05-23 11:49:05 +08:00
parent 2679d9effe
commit f747dc9a8b
2 changed files with 25 additions and 22 deletions
@@ -190,6 +190,7 @@
} }
}, },
edit() { edit() {
console.log(this.queryForm)
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(this.queryForm))) this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(this.queryForm)))
}, },
addModelList() { addModelList() {
@@ -38,14 +38,14 @@
<span class="Required">*</span> <span class="Required">*</span>
<span class="title-text-text" :title="$t('modelYear')">{{$t('modelYear')}}</span> <span class="title-text-text" :title="$t('modelYear')">{{$t('modelYear')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="yearName"> <a-form-model-item class="itemModel" prop="yearNameId">
<a-select :placeholder="$t('PleaseSelect')+$t('modelYear')" <a-select :placeholder="$t('PleaseSelect')+$t('modelYear')"
v-model="formInline.yearName"> v-model="formInline.yearNameId">
<a-select-option v-for="(item, key) in projectNameList" <a-select-option v-for="(item, key) in yearNameDataList"
:key="key" :key="key"
:value="item.id"> :value="item.id">
<span style="display: inline-block;width: 100%" :title=" item.projectName "> <span style="display: inline-block;width: 100%" :title=" item.yearName ">
{{ item.projectName}} {{ item.yearName}}
</span> </span>
</a-select-option> </a-select-option>
</a-select> </a-select>
@@ -218,6 +218,7 @@
formInline: {}, formInline: {},
confirmLoading: false, confirmLoading: false,
visible: false, visible: false,
yearNameDataList: [],
rules: { rules: {
ipdInfo: [ ipdInfo: [
{ {
@@ -252,14 +253,14 @@
trigger: 'blur' trigger: 'blur'
} }
], ],
vehiclePlatform:[ vehiclePlatform: [
{ {
max: 100, max: 100,
message: this.$t('ModelPlatform') + this.$t('cannotExceed') + 100 + this.$t('Characters'), message: this.$t('ModelPlatform') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
trigger: 'blur' trigger: 'blur'
} }
], ],
digitalPlatform:[ digitalPlatform: [
{ {
max: 100, max: 100,
message: this.$t('DigitalPlatform') + this.$t('cannotExceed') + 100 + this.$t('Characters'), message: this.$t('DigitalPlatform') + this.$t('cannotExceed') + 100 + this.$t('Characters'),
@@ -273,7 +274,7 @@
trigger: 'change' trigger: 'change'
} }
], ],
yearName: [ yearNameId: [
{ {
required: true, required: true,
message: this.$t('modelYear') + this.$t('cannotEmpty'), message: this.$t('modelYear') + this.$t('cannotEmpty'),
@@ -309,23 +310,20 @@
}, },
mounted() { mounted() {
this.getNameList() this.getNameList()
this.getSpaceInfo()
}, },
methods: { methods: {
...mapGetters(['userInfo']), ...mapGetters(['userInfo']),
getNameList() { getNameList(value) {
getAction('project/projectNameInfoEO/list', {}).then((res) => { getAction('project/projectNameInfoEO/list', {}).then((res) => {
if (res.success) { if (res.success) {
this.projectNameList = res.result || [] this.projectNameList = res.result || []
} else { if (this.title == this.$t('edit')) {
this.projectNameList = [] let content = this.projectNameList.filter(res => {
} return res.id == value.projectNameId
}) })
}, this.yearNameDataList = content[0].yearNameDataList || []
getSpaceInfo() { this.formInline = value
postAction('/project/projectNameInfoEO/getSpaceInfo', {}).then((res) => { }
if (res.success) {
// this.projectNameList = res.result || []
} else { } else {
this.projectNameList = [] this.projectNameList = []
} }
@@ -336,7 +334,6 @@
this.title = this.$t('add') this.title = this.$t('add')
this.formInline = {} this.formInline = {}
this.getNameList() this.getNameList()
this.getSpaceInfo()
this.formInline.studioEngineerName = this.userInfo().username this.formInline.studioEngineerName = this.userInfo().username
this.formInline.studioEngineer = this.userInfo().id this.formInline.studioEngineer = this.userInfo().id
this.$nextTick(() => { this.$nextTick(() => {
@@ -346,8 +343,8 @@
editModel(value) { editModel(value) {
this.visible = true this.visible = true
this.title = this.$t('edit') this.title = this.$t('edit')
this.getNameList(value)
this.$nextTick(() => { this.$nextTick(() => {
this.formInline = value
this.$refs.ruleForm.clearValidate() this.$refs.ruleForm.clearValidate()
}) })
}, },
@@ -398,7 +395,12 @@
this.formInline = { ...this.formInline } this.formInline = { ...this.formInline }
}, },
projectNameChange(value) { projectNameChange(value) {
console.log(value) let content = this.projectNameList.filter(res => {
return res.id == value
})
this.formInline.vehiclePlatform = content[0].vehiclePlatform || ''
this.yearNameDataList = content[0].yearNameDataList || []
this.formInline.digitalPlatform = content[0].digitalPlatform || ''
} }
} }
} }