新增金久信学堂
This commit is contained in:
@@ -17,12 +17,12 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item label="规格型号">
|
||||
<el-select v-model="form1.data.model" placeholder="请选择">
|
||||
<template v-if=" attributes.find(attr => attr.label === '规格型号')">
|
||||
<template v-if=" goodsAttributes.find(attr => attr.label === '规格型号')">
|
||||
<el-option
|
||||
v-for="(item, index) in attributes.find(attr => attr.label === '规格型号').options"
|
||||
v-for="(item, index) in goodsAttributes.find(attr => attr.label === '规格型号').values"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</template>
|
||||
</el-select>
|
||||
@@ -31,12 +31,12 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item label="其他数据">
|
||||
<el-select v-model="form1.data.otherData" placeholder="请选择">
|
||||
<template v-if=" attributes.find(attr => attr.label === '其他数据')">
|
||||
<template v-if=" goodsAttributes.find(attr => attr.label === '其他数据')">
|
||||
<el-option
|
||||
v-for="(item, index) in attributes.find(attr => attr.label === '其他数据').options"
|
||||
v-for="(item, index) in goodsAttributes.find(attr => attr.label === '其他数据').values"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</template>
|
||||
</el-select>
|
||||
@@ -47,7 +47,7 @@
|
||||
<el-select v-model="form1.data.standard" placeholder="请选择">
|
||||
<template v-if="form1.data.goodsId">
|
||||
<el-option
|
||||
v-for="(item, index) in goodsList.find(goods => goods._id === form1.data.goodsId).attributes.filter(attr => attr.label === '执行标准')[0].values"
|
||||
v-for="(item, index) in goodsAttributes.find(attr => attr.label === '执行标准').values"
|
||||
:key="index"
|
||||
:label="item"
|
||||
:value="item">
|
||||
@@ -106,7 +106,7 @@
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="采购数量">
|
||||
<el-input v-model="form1.data.procureNumber">
|
||||
<el-input v-model="form1.data.procureNumber" class="input-with-select">
|
||||
<el-select v-model="form1.data.procureUnit" slot="append" placeholder="请选择">
|
||||
<template v-if=" attributes.find(attr => attr.label === '单位')">
|
||||
<el-option
|
||||
@@ -152,26 +152,27 @@
|
||||
<el-select v-model="provinceIndex" placeholder="省" @change="selectProvince">
|
||||
<el-option v-for="(item, index) in provinceData" :key="index" :value="index"
|
||||
:label="item.name"/>
|
||||
<!-- <span slot="prefix">省</span>-->
|
||||
<!-- <span slot="prefix">省</span>-->
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="cityIndex" placeholder="市">
|
||||
<el-select v-model="cityIndex" placeholder="市" @change="selectCity">
|
||||
<template v-if="provinceIndex !== null">
|
||||
<el-option v-for="(item, index) in cityData[provinceIndex]" :key="index"
|
||||
:value="index"
|
||||
:label="item.name"/>
|
||||
</template>
|
||||
<!-- <span slot="prefix">市</span>-->
|
||||
<!-- <span slot="prefix">市</span>-->
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-select v-model="areaIndex" placeholder="区/县">
|
||||
<el-select v-model="areaIndex" placeholder="区/县" @change="selectArea">
|
||||
<template v-if="provinceIndex !== null && cityIndex !== null">
|
||||
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]" :key="index" :value="index"
|
||||
<el-option v-for="(item, index) in areaData[provinceIndex][cityIndex]"
|
||||
:key="index" :value="index"
|
||||
:label="item.name"/>
|
||||
</template>
|
||||
<!-- <span slot="prefix">区/县</span>-->
|
||||
<!-- <span slot="prefix">区/县</span>-->
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -222,6 +223,8 @@ export default {
|
||||
attributesLoaded: false,
|
||||
goodsList: [],
|
||||
attributes: [],
|
||||
goodsAttributes: [],
|
||||
address: ['', '', ''],
|
||||
form: {
|
||||
addressDetail: ''
|
||||
},
|
||||
@@ -242,7 +245,8 @@ export default {
|
||||
len: null,
|
||||
extraAttributes: {},
|
||||
attributes: {},
|
||||
addressRegion: undefined
|
||||
addressRegion: [],
|
||||
addressDetail: null
|
||||
},
|
||||
// 表单属性
|
||||
props: {
|
||||
@@ -532,14 +536,24 @@ export default {
|
||||
})
|
||||
},
|
||||
selectGoods(val) {
|
||||
this.goodsList.forEach(({_id, name}) => {
|
||||
if (_id === val) this.form1.data.goodsName = name
|
||||
this.goodsList.forEach(({_id, name, extraAttributes}) => {
|
||||
if (_id === val) {
|
||||
this.form1.data.goodsName = name
|
||||
console.log(extraAttributes)
|
||||
this.goodsAttributes = extraAttributes
|
||||
}
|
||||
})
|
||||
},
|
||||
selectProvince(index){
|
||||
console.log(index, this.provinceIndex)
|
||||
console.log(this.cityData, this.cityData[index])
|
||||
}
|
||||
selectProvince(index) {
|
||||
this.form1.data.addressRegion[0] = this.provinceData[index].code
|
||||
},
|
||||
selectCity(index) {
|
||||
this.form1.data.addressRegion[1] = this.cityData[this.provinceIndex][index].code
|
||||
},
|
||||
selectArea(index) {
|
||||
this.form1.data.addressRegion[2] = this.areaData[this.provinceIndex][this.cityIndex][index].code
|
||||
},
|
||||
|
||||
},
|
||||
watch: {
|
||||
"form1.data"(val) {
|
||||
@@ -564,7 +578,7 @@ export default {
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.input-with-select .el-input-group__append {
|
||||
/deep/ .input-with-select .el-input-group__append {
|
||||
background-color: #fff !important;
|
||||
width: 130px !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user