项目库新增添加年款字段

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