添加:酒道馆关联品牌

This commit is contained in:
wuhui_zzw 2024-02-04 16:45:49 +08:00
parent 5cb9c36241
commit 34c7704704
3 changed files with 58 additions and 41 deletions

View File

@ -90,6 +90,13 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12">
<el-form-item label="品牌类型:">
<el-select v-model="merData.brand_id" filterable remote class="selWidth" placeholder="请输入品牌名称进行搜索" :remote-method="selectBrandList">
<el-option v-for="item in brand_list" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="排序:" prop="sort"> <el-form-item label="排序:" prop="sort">
<el-input-number <el-input-number
@ -99,6 +106,8 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item :label="mar_type_name + '状态:'" prop="status"> <el-form-item :label="mar_type_name + '状态:'" prop="status">
<el-switch <el-switch
@ -111,8 +120,6 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="备注:" prop="mark"> <el-form-item label="备注:" prop="mark">
<el-input <el-input
@ -370,7 +377,7 @@
<script> <script>
import { merCategoryListApi } from '@/api/product' import { merCategoryListApi } from '@/api/product'
import {getstoreTypeApi, merchantUpdate, merchantCreate, merchantListApi} from "@/api/merchant"; import {getstoreTypeApi, merchantUpdate, merchantCreate, merchantListApi, brandListApi} from "@/api/merchant";
export default { export default {
props: { props: {
merData: { merData: {
@ -397,6 +404,7 @@ export default {
} }
} }
return { return {
brand_list: {},
mer_list: {}, mer_list: {},
mar_type_name: '商户', mar_type_name: '商户',
loading: false, loading: false,
@ -430,6 +438,7 @@ export default {
this.mar_type_name = this.defaultMerchantType == 1 ? '酒道馆' : (this.defaultMerchantType == 2 ? '供应商' :'商户'); this.mar_type_name = this.defaultMerchantType == 1 ? '酒道馆' : (this.defaultMerchantType == 2 ? '供应商' :'商户');
this.selectMerList(); this.selectMerList();
this.selectBrandList('');
}, },
deep: true deep: true
} }
@ -517,7 +526,22 @@ export default {
}).catch(res => { }).catch(res => {
this.$message.error(res.message); this.$message.error(res.message);
}); });
},
//
selectBrandList(query){
let _this = this;
let params = {
page: 1,
limit: 100,
title: query,
};
brandListApi(params).then(res => {
_this.brand_list = res.data.list || {};
}).catch(res => {
this.$message.error(res.message);
});
} }
}, },
}; };
</script> </script>

View File

@ -106,19 +106,11 @@
</div> </div>
<el-button size="small" type="primary" @click="onAdd">添加商户</el-button> <el-button size="small" type="primary" @click="onAdd">添加商户</el-button>
</div> </div>
<el-table <el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="small" highlight-current-row class="switchTable">
v-loading="listLoading" <el-table-column prop="mer_id" label="ID" min-width="60" align="center"/>
:data="tableData.data" <el-table-column prop="mer_name" label="商户名称" min-width="150" align="center"/>
style="width: 100%" <el-table-column prop="real_name" label="商户姓名" min-width="150" align="center"/>
size="small" <el-table-column prop="status" label="推荐" min-width="100" align="center">
highlight-current-row
class="switchTable"
>
<el-table-column prop="mer_id" label="ID" min-width="60" />
<el-table-column prop="mer_name" label="商户名称" min-width="150" />
<el-table-column prop="real_name" label="商户姓名" min-width="150" />
<el-table-column prop="status" label="推荐" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.is_best" v-model="scope.row.is_best"
@ -131,7 +123,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="开启/关闭" min-width="100"> <el-table-column prop="status" label="开启/关闭" min-width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.status" v-model="scope.row.status"
@ -144,16 +136,15 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="150" /> <el-table-column prop="create_time" label="创建时间" min-width="150" align="center"/>
<el-table-column prop="margin" label="保证金" min-width="150"> <el-table-column prop="margin" label="保证金" min-width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span> <span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="sort" label="排序" min-width="100" /> <el-table-column prop="sort" label="排序" min-width="100" align="center"/>
<el-table-column prop="mark" label="备注" min-width="200" /> <el-table-column prop="mark" label="备注" min-width="200" align="center"/>
<el-table-column label="操作" min-width="150" fixed="right" align="center"> <el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <router-link <!-- <router-link

View File

@ -106,18 +106,16 @@
</div> </div>
<el-button size="small" type="primary" @click="onAdd">添加酒道馆</el-button> <el-button size="small" type="primary" @click="onAdd">添加酒道馆</el-button>
</div> </div>
<el-table <el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="small" highlight-current-row class="switchTable">
v-loading="listLoading" <el-table-column prop="mer_id" label="ID" min-width="60" align="center"/>
:data="tableData.data" <el-table-column prop="mer_name" label="酒道馆名称" min-width="150" align="center"/>
style="width: 100%" <el-table-column prop="real_name" label="联系人" min-width="100" align="center">
size="small" <template slot-scope="scope">
highlight-current-row {{ scope.row.real_name }}<br />
class="switchTable" {{ scope.row.mer_phone }}
> </template>
<el-table-column prop="mer_id" label="ID" min-width="60" /> </el-table-column>
<el-table-column prop="mer_name" label="酒道馆名称" min-width="150" /> <el-table-column prop="status" label="是否推荐" min-width="90" align="center">
<el-table-column prop="real_name" label="酒道馆姓名" min-width="150" />
<el-table-column prop="status" label="推荐" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.is_best" v-model="scope.row.is_best"
@ -130,7 +128,7 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="开启/关闭" min-width="100"> <el-table-column prop="status" label="状态" min-width="90" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.status" v-model="scope.row.status"
@ -143,20 +141,24 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="create_time" label="创建时间" min-width="150" /> <el-table-column prop="create_time" label="创建时间" min-width="140" align="center"/>
<el-table-column prop="margin" label="保证金" min-width="150"> <el-table-column prop="margin" label="保证金" min-width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span> <span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="sort" label="排序" min-width="100" /> <el-table-column prop="sort" label="排序" min-width="60" align="center"/>
<el-table-column prop="status" label="关联商户" min-width="100"> <el-table-column prop="status" label="关联商户" min-width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.merShop ? (scope.row.merShop.mer_name || '') : ''}} {{ scope.row.merShop ? (scope.row.merShop.mer_name || '') : ''}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="mark" label="备注" min-width="200" /> <el-table-column prop="status" label="品牌" min-width="150" align="center">
<template slot-scope="scope">
{{ scope.row.brand ? (scope.row.brand.title || '') : ''}}
</template>
</el-table-column>
<!--<el-table-column prop="mark" label="备注" min-width="150" align="center"/>-->
<el-table-column label="操作" min-width="150" fixed="right" align="center"> <el-table-column label="操作" min-width="150" fixed="right" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <router-link <!-- <router-link