|
@@ -49,7 +49,7 @@
|
|
</a-input-group>
|
|
</a-input-group>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
<a-form-model-item label="产品品牌" prop="productBrandSn">
|
|
<a-form-model-item label="产品品牌" prop="productBrandSn">
|
|
- <a-select
|
|
|
|
|
|
+ <!-- <a-select
|
|
id="productInfoEdit-productBrand"
|
|
id="productInfoEdit-productBrand"
|
|
placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增"
|
|
placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增"
|
|
:disabled="!!$route.params.id"
|
|
:disabled="!!$route.params.id"
|
|
@@ -60,6 +60,21 @@
|
|
:filter-option="filterOption"
|
|
:filter-option="filterOption"
|
|
style="width: 90%;">
|
|
style="width: 90%;">
|
|
<a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
|
|
<a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
|
|
|
|
+ </a-select> -->
|
|
|
|
+ <a-select
|
|
|
|
+ show-search
|
|
|
|
+ id="productInfoEdit-productBrand"
|
|
|
|
+ v-model="form.productBrandSn"
|
|
|
|
+ placeholder="请输入名称或拼音查询,如果没有请点击 '+' 新增"
|
|
|
|
+ :disabled="!!$route.params.id"
|
|
|
|
+ :filter-option="false"
|
|
|
|
+ :not-found-content="fetching ? undefined : null"
|
|
|
|
+ @search="fetchUser"
|
|
|
|
+ @change="handleChange"
|
|
|
|
+ style="width: 90%;"
|
|
|
|
+ >
|
|
|
|
+ <a-spin v-if="fetching" slot="notFoundContent" size="small" />
|
|
|
|
+ <a-select-option v-for="item in productBrandList" :key="item.brandSn" :value="item.brandSn" :disabled="item.enabledFlag==0">{{ item.brandName }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
<a-button
|
|
<a-button
|
|
@click="openModal=true"
|
|
@click="openModal=true"
|
|
@@ -73,7 +88,7 @@
|
|
<a-cascader
|
|
<a-cascader
|
|
:disabled="!!$route.params.id"
|
|
:disabled="!!$route.params.id"
|
|
@change="changeProductType"
|
|
@change="changeProductType"
|
|
- expand-trigger="hover"
|
|
|
|
|
|
+ expand-trigger="hover"
|
|
:options="productTypeList"
|
|
:options="productTypeList"
|
|
:fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
:fieldNames="{ label: 'productTypeName', value: 'productTypeSn', children: 'children' }"
|
|
id="productInfoEdit-productType"
|
|
id="productInfoEdit-productType"
|
|
@@ -165,12 +180,32 @@ export default {
|
|
{ required: true, message: '请选择产品分类', trigger: 'change' }
|
|
{ required: true, message: '请选择产品分类', trigger: 'change' }
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ fetching: false,
|
|
productBrandList: [], // 品牌下拉数据
|
|
productBrandList: [], // 品牌下拉数据
|
|
productTypeList: [], // 分类下拉数据
|
|
productTypeList: [], // 分类下拉数据
|
|
openModal: false // 新增编辑 弹框
|
|
openModal: false // 新增编辑 弹框
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 搜索经销商
|
|
|
|
+ fetchUser (value) {
|
|
|
|
+ console.log('fetching user', value)
|
|
|
|
+ this.fetching = true
|
|
|
|
+ dealerProductBrandQuery({ 'sysFlag': '0', 'queryWord': value }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.productBrandList = res.data
|
|
|
|
+ this.fetching = false
|
|
|
|
+ } else {
|
|
|
|
+ this.dealerData = []
|
|
|
|
+ this.fetching = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 调往对象名称 change
|
|
|
|
+ handleChange (value) {
|
|
|
|
+ const ind = this.dealerData.findIndex(item => item.dealerSn == value)
|
|
|
|
+ this.form.targetName = this.dealerData[ind].dealerName
|
|
|
|
+ },
|
|
filterEmpty () {
|
|
filterEmpty () {
|
|
let str = this.form.name
|
|
let str = this.form.name
|
|
str = str.replace(/\ +/g, '')
|
|
str = str.replace(/\ +/g, '')
|
|
@@ -265,7 +300,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () { // 不使用beforeRouteEnter:由于页面路由动态id导致页面表现方式不同但路由相同,则会出现数据不重新请求问题
|
|
mounted () { // 不使用beforeRouteEnter:由于页面路由动态id导致页面表现方式不同但路由相同,则会出现数据不重新请求问题
|
|
- this.getProductBrand()
|
|
|
|
|
|
+ // this.getProductBrand()
|
|
this.getProductType()
|
|
this.getProductType()
|
|
this.$refs.ruleForm.resetFields()
|
|
this.$refs.ruleForm.resetFields()
|
|
if (this.$route.params.id) { // 编辑页
|
|
if (this.$route.params.id) { // 编辑页
|