Commit b9d9c73d authored by Marcus's avatar Marcus

品牌管理多商标,部分授权客户

parent d07eab51
...@@ -34,6 +34,24 @@ export function getProductBrandEmpower(id) { ...@@ -34,6 +34,24 @@ export function getProductBrandEmpower(id) {
}) })
} }
// 获得商品品牌已授权分页
export function getProductBrandEmpowerPageAuth(query) {
return request({
url: '/ecw/product-brand-empower/page/auth',
method: 'get',
params: query
})
}
// 获得商品品牌未授权分页
export function getProductBrandEmpowerPageUnauth(query) {
return request({
url: '/ecw/product-brand-empower/page/unauth',
method: 'get',
params: query
})
}
// 获得商品品牌授权分页 // 获得商品品牌授权分页
export function getProductBrandEmpowerPage(query) { export function getProductBrandEmpowerPage(query) {
return request({ return request({
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span>卡片名称</span> <span>卡片名称</span>
<el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button> <el-button style="float: right; padding: 3px 0" type="text" @click="$emit('delete')">删除</el-button>
</div> </div>
<el-form-item :label="'商标' + (index + 1)"> <el-form-item :label="'商标' + (index + 1)">
<el-input v-model="form.brandName" placeholder="商标"></el-input> <el-input v-model="form.brandName" placeholder="商标"></el-input>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<script> <script>
export default { export default {
name: "index", name: "BrandForm",
props: { props: {
productTypeList: { productTypeList: {
type: Array, type: Array,
...@@ -69,6 +69,9 @@ export default { ...@@ -69,6 +69,9 @@ export default {
} }
} }
}, },
mounted() {
this.updateForm(this.value)
},
methods: { methods: {
getProductListByTypeId(typeId) { getProductListByTypeId(typeId) {
return typeId === 0 ? [] : this.productList.filter((p) => p.typeId === typeId) return typeId === 0 ? [] : this.productList.filter((p) => p.typeId === typeId)
...@@ -87,10 +90,8 @@ export default { ...@@ -87,10 +90,8 @@ export default {
productBrandId: this.form.productBrandId, productBrandId: this.form.productBrandId,
trademarkCategoryRelList trademarkCategoryRelList
}) })
}
}, },
watch: { updateForm(e){
value(e) {
if (!!e){ if (!!e){
this.form.brandName = e.brandName this.form.brandName = e.brandName
this.form.id = e.id this.form.id = e.id
...@@ -104,6 +105,11 @@ export default { ...@@ -104,6 +105,11 @@ export default {
} }
} }
} }
},
watch: {
value(e) {
this.updateForm(e)
}
} }
} }
</script> </script>
......
<template>
<div>
<el-dialog
:title="brandName"
:visible.sync="dialogVisible"
width="900px"
:before-close="handleClose()">
<el-tabs v-model="activeName">
<el-tab-pane label="未授权客户" name="first">
<el-form :inline="true" class="demo-form-inline">
<el-form-item label="关键字">
<el-input v-model="customerKey" placeholder="审批人"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="filterCustomer">查询</el-button>
</el-form-item>
</el-form>
<el-table
:data="list1"
style="width: 100%">
<el-table-column
prop="customerName"
label="客户名称">
</el-table-column>
<el-table-column
prop="phone"
label="客户号码">
</el-table-column>
<el-table-column
width="100px"
label="操作">
<template v-slot="{row}">
<el-button type="primary" size="mini">添加</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="已授权客户" name="second">
<el-table
:data="list2"
style="width: 100%">
<el-table-column
prop="customerName"
label="客户名称">
</el-table-column>
<el-table-column
prop="phone"
label="客户号码">
</el-table-column>
<el-table-column
width="100px"
label="操作">
<template v-slot="{row}">
<el-button type="primary" size="mini" @click="handleDelete(row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</el-dialog>
</div>
</template>
<script>
import {
deleteProductBrandEmpower,
getProductBrandEmpowerPageAuth,
getProductBrandEmpowerPageUnauth
} from "@/api/ecw/productBrandEmpower"
export default {
name: "Empower",
props: {
id: {
type: Number,
default: 0
},
brandName: String,
visible: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: false,
activeName: 'first',
customerKey: '',
list1: [],
list2: []
}
},
created() {
},
methods: {
handleClose() {},
filterCustomer() {},
handleDelete(id) {
deleteProductBrandEmpower(id).then(r => {
this.getList2()
})
},
getList1(){
getProductBrandEmpowerPageUnauth({productBrandId: this.id}).then(r => {
this.list1 = r.data.list
})
},
getList2() {
getProductBrandEmpowerPageAuth({productBrandId: this.id}).then(r => {
this.list2 = r.data.list
})
}
},
watch: {
visible(v){
if (v){
this.getList1()
this.getList2()
}
this.dialogVisible = v
},
dialogVisible(v) {
this.$emit('update:visible', v)
}
}
}
</script>
<style scoped>
</style>
...@@ -67,6 +67,8 @@ ...@@ -67,6 +67,8 @@
</template> </template>
</el-table-column> <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> </el-table-column> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleEmpower(scope.row)" v-show="scope.row.filing === '1'"
v-hasPermi="['ecw:product-brank:update']">添加授权客户</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:product-brank:update']">修改</el-button> v-hasPermi="['ecw:product-brank:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
...@@ -111,14 +113,23 @@ ...@@ -111,14 +113,23 @@
v-for="(item, index) in form.trademarkList" v-for="(item, index) in form.trademarkList"
v-model="form.trademarkList[index]" v-model="form.trademarkList[index]"
:index="index" :index="index"
:key="item.id"
:product-type-list="productTypeList" :product-type-list="productTypeList"
:product-list="productList"></brand-form> :product-list="productList"
@delete="form.trademarkList.splice(index, 1)"></brand-form>
<el-button type="primary" @click="form.trademarkList.push({
brandName: '',
trademarkCategoryRelList: []
})">添加商标</el-button>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button> <el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<empower :visible.sync="showEmpower" :brandName="empowerTitle" :id="empowerId"></empower>
</div> </div>
</template> </template>
...@@ -129,12 +140,14 @@ import {DICT_TYPE, getDictDatas} from "@/utils/dict"; ...@@ -129,12 +140,14 @@ import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import {getProductTypeList} from "@/api/ecw/productType" import {getProductTypeList} from "@/api/ecw/productType"
import {getProductList} from "@/api/ecw/product" import {getProductList} from "@/api/ecw/product"
import BrandForm from "@/views/ecw/productBrank/BrandForm" import BrandForm from "@/views/ecw/productBrank/BrandForm"
import Empower from "@/views/ecw/productBrank/Empower"
export default { export default {
name: "ProductBrank", name: "ProductBrank",
components: { components: {
BrandForm BrandForm,
Empower
}, },
data() { data() {
return { return {
...@@ -173,6 +186,10 @@ export default { ...@@ -173,6 +186,10 @@ export default {
productTypeList: [], productTypeList: [],
productList: [], productList: [],
showEmpower: false,
empowerId: null,
empowerTitle: ''
}; };
}, },
created() { created() {
...@@ -185,6 +202,11 @@ export default { ...@@ -185,6 +202,11 @@ export default {
}) })
}, },
methods: { methods: {
handleEmpower(row){
this.empowerId = row.id
this.empowerTitle = row.titleZh
this.showEmpower = true
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment