|
|
@ -1,23 +1,16 @@ |
|
|
|
<template> |
|
|
|
<div class="app-container"> |
|
|
|
<div class="tab-header webtop"> |
|
|
|
<div>品牌管理</div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" @click="handleCreate()">新增</el-button> |
|
|
|
<el-button type="primary" size="small" @click="handleUpdate()">修改</el-button> |
|
|
|
<el-button type="danger" size="small" @click="handleDelete()">删除</el-button> |
|
|
|
<!-- <el-button type="success" size="small" @click="handleDaoRu()">导入</el-button> --> |
|
|
|
<el-button type="success" size="small" @click="handleDaoChu()">导出</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<button-bar view-title="品牌管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
|
|
|
<div class="main-content"> |
|
|
|
<div class="searchcon"> |
|
|
|
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> |
|
|
|
<div v-show="isSearchShow" class="search"> |
|
|
|
<el-form ref="listQueryform" :inline="true" :model="listQuery" label-width="100px" class="tab-header"> |
|
|
|
<div class="searchli"> |
|
|
|
<el-form-item label="厂商名称"> |
|
|
|
<el-autocomplete v-model="listQuery.manufacturerName" :fetch-suggestions="querySearchAsync1" style="width: 300px" placeholder="请输入厂商名称" @select="handleSelect1"> |
|
|
|
<i slot="suffix" class="el-icon-edit el-input__icon" @click="inputclear1" /> |
|
|
|
<el-autocomplete v-model="listQuery.manufacturerName" :fetch-suggestions="querySearchAsync1" |
|
|
|
style="width: 300px" placeholder="请输入厂商名称" @select="handleSelect1"> |
|
|
|
<i slot="suffix" class="el-icon-edit el-input__icon" @click="inputclear1"/> |
|
|
|
<template slot-scope="{ item }"> |
|
|
|
<div style="paddingg:5px;background-color:Azure;"> |
|
|
|
<span>厂商名称:</span> |
|
|
@ -28,8 +21,9 @@ |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="品牌名称"> |
|
|
|
<!-- <el-input v-model="listQuery.brandName" placeholder="请输入品牌名称" clearable class="filter-item" /> --> |
|
|
|
<el-autocomplete v-model="listQuery.brandName" :fetch-suggestions="querySearchAsync" style="width: 300px" placeholder="请输入品牌名称" @select="handleSelect"> |
|
|
|
<i slot="suffix" class="el-icon-edit el-input__icon" @click="inputclear" /> |
|
|
|
<el-autocomplete v-model="listQuery.brandName" :fetch-suggestions="querySearchAsync" |
|
|
|
style="width: 300px" placeholder="请输入品牌名称" @select="handleSelect"> |
|
|
|
<i slot="suffix" class="el-icon-edit el-input__icon" @click="inputclear"/> |
|
|
|
<template slot-scope="{ item }"> |
|
|
|
<div style="paddingg:5px;background-color:Azure;"> |
|
|
|
<span>品牌名称:</span> |
|
|
@ -39,37 +33,25 @@ |
|
|
|
</template> |
|
|
|
</el-autocomplete> |
|
|
|
</el-form-item> |
|
|
|
<el-button type="primary" @click="handleFilter">查询</el-button> |
|
|
|
</div> |
|
|
|
<!-- <div class="searchli"> |
|
|
|
<el-form-item label="首字母检索"> |
|
|
|
<el-radio-group v-model="listQuery.manage" size="mini"> |
|
|
|
<el-radio-button label="A" /> |
|
|
|
<el-radio-button label="B" /> |
|
|
|
<el-radio-button label="C" /> |
|
|
|
<el-radio-button label="D" /><el-radio-button label="E" /><el-radio-button label="F" /><el-radio-button label="G" /> |
|
|
|
<el-radio-button label="H" /><el-radio-button label="I" /><el-radio-button label="J" /><el-radio-button label="K" /> |
|
|
|
<el-radio-button label="L" /><el-radio-button label="M" /><el-radio-button label="N" /><el-radio-button label="O" /> |
|
|
|
<el-radio-button label="P" /><el-radio-button label="Q" /><el-radio-button label="R" /><el-radio-button label="S" /> |
|
|
|
<el-radio-button label="T" /><el-radio-button label="U" /><el-radio-button label="V" /><el-radio-button label="W" /> |
|
|
|
<el-radio-button label="X" /><el-radio-button label="Y" /><el-radio-button label="Z" /> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</div> --> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
<div class="btn" style="text-align: center;"> |
|
|
|
<el-button type="primary" @click="handleFilter">查询</el-button> |
|
|
|
<el-button type="primary" @click="handleReset">重置</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="listtop"> |
|
|
|
<div class="tit">品牌信息列表</div> |
|
|
|
<!-- <pageye v-show="total>0" :total="total" :page.sync="listQuery.pageNumber" :limit.sync="listQuery.pageSize" class="pagination" @pagination="getList" /> --> |
|
|
|
<pageye v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList" /> |
|
|
|
<pageye v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" |
|
|
|
class="pagination" @pagination="getList"/> |
|
|
|
</div> |
|
|
|
<div class="listcon"> |
|
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" @selection-change=" handleSelectionChange"> |
|
|
|
<el-table-column width="50px" type="selection" align="center" /> |
|
|
|
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center" /> |
|
|
|
<div class=""> |
|
|
|
<el-table :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%;" |
|
|
|
@selection-change=" handleSelectionChange"> |
|
|
|
<el-table-column width="50px" type="selection" align="center"/> |
|
|
|
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|
|
|
<el-table-column label="品牌名称" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span class="bluezi" @click="handleCheck(scope.row)">{{ scope.row.brandName }}</span> |
|
|
@ -80,12 +62,22 @@ |
|
|
|
<span>{{ scope.row.brandCode }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="厂商" align="center"> |
|
|
|
<el-table-column label="品牌类型" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.brandTypeValue }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="340px" label="厂商" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.manufacturerName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="更新时间" align="center"> |
|
|
|
<el-table-column width="120px" label="是否有效" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.isValidity }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column width="160px" label="更新时间" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.modifyTime }}</span> |
|
|
|
</template> |
|
|
@ -98,40 +90,28 @@ |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<div class="pages"> |
|
|
|
<div class="tit" /> |
|
|
|
<div class="tit"/> |
|
|
|
<!-- 翻页 --> |
|
|
|
<!-- <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNumber" :limit.sync="listQuery.pageSize" class="pagination" @pagination="getList" /> --> |
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" class="pagination" @pagination="getList" /> |
|
|
|
<pagination v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" |
|
|
|
class="pagination" @pagination="getList"/> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
// import { |
|
|
|
// getServiceTypeList, |
|
|
|
// getServiceTypePageList, |
|
|
|
// addServiceType, |
|
|
|
// getServiceType, |
|
|
|
// editServiceType, |
|
|
|
// delServiceType, |
|
|
|
// } from "@/api/yanglao/serviceType"; |
|
|
|
// import { getFileType, parseDate, parseTime, ConvertMenuState } from "@/utils"; |
|
|
|
// import { findButtonByUserId } from '@/api/sys/permission' |
|
|
|
import { getNamesDownes } from '@/api/jichuxinxi/basemanufacturer' |
|
|
|
import { |
|
|
|
pagerList, |
|
|
|
brandLike, |
|
|
|
dictType, |
|
|
|
deleteBySids, |
|
|
|
basefinbankExportExcel |
|
|
|
} from '@/api/jichuxinxi/brandManagement' |
|
|
|
import {mapGetters} from 'vuex' |
|
|
|
import {getNamesDownes} from '@/api/jichuxinxi/basemanufacturer' |
|
|
|
import {basefinbankExportExcel, brandLike, deleteBySids, dictType, pagerList} from '@/api/jichuxinxi/brandManagement' |
|
|
|
import Pagination from '@/components/pagination' |
|
|
|
import pageye from '@/components/pagination/pageye' |
|
|
|
import ButtonBar from '@/components/ButtonBar/index.vue' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'Pinpaiguanli', |
|
|
|
components: { Pagination, pageye }, |
|
|
|
components: {Pagination, pageye, ButtonBar}, |
|
|
|
// directives: { |
|
|
|
// drag: { |
|
|
|
// // 指令的定义 |
|
|
@ -172,6 +152,44 @@ export default { |
|
|
|
return { |
|
|
|
isSearchShow: false, |
|
|
|
searchxianshitit: '显示查询条件', |
|
|
|
btndisabled: false, |
|
|
|
btnList: [ |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: 'plus', |
|
|
|
btnKey: 'toAdd', |
|
|
|
btnLabel: '新增' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'primary', |
|
|
|
size: 'small', |
|
|
|
icon: 'edit', |
|
|
|
btnKey: 'toEdit', |
|
|
|
btnLabel: '编辑' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'danger', |
|
|
|
size: 'small', |
|
|
|
icon: 'del', |
|
|
|
btnKey: 'doDel', |
|
|
|
btnLabel: '删除' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'success', |
|
|
|
size: 'small', |
|
|
|
icon: 'export', |
|
|
|
btnKey: 'build', |
|
|
|
btnLabel: '导出' |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: 'info', |
|
|
|
size: 'small', |
|
|
|
icon: 'cross', |
|
|
|
btnKey: 'doClose', |
|
|
|
btnLabel: '关闭' |
|
|
|
} |
|
|
|
], |
|
|
|
// --按钮菜单------- |
|
|
|
menuState: { |
|
|
|
add: false, // 添加 |
|
|
@ -244,6 +262,9 @@ export default { |
|
|
|
'departmentCode', |
|
|
|
]), |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$refs["btnbar"].setButtonList(this.btnList) |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// 初始化变量 |
|
|
|
this.init() |
|
|
@ -260,8 +281,30 @@ export default { |
|
|
|
this.searchxianshitit = '显示查询条件' |
|
|
|
} |
|
|
|
}, |
|
|
|
btnHandle(btnKey) { |
|
|
|
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|
|
|
switch (btnKey) { |
|
|
|
case 'toAdd': |
|
|
|
this.toAdd() |
|
|
|
break |
|
|
|
case 'toEdit': |
|
|
|
this.toEdit() |
|
|
|
break |
|
|
|
case 'doDel': |
|
|
|
this.doDel() |
|
|
|
break |
|
|
|
case 'doExport': |
|
|
|
this.doExport() |
|
|
|
break |
|
|
|
case 'doClose': |
|
|
|
this.doClose() |
|
|
|
break |
|
|
|
default: |
|
|
|
break |
|
|
|
} |
|
|
|
}, |
|
|
|
init() { |
|
|
|
dictType({ psid: 0, type: 'supplierType' }).then((response) => { |
|
|
|
dictType({psid: 0, type: 'supplierType'}).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
this.supplierType = response.data |
|
|
|
} |
|
|
@ -278,14 +321,7 @@ export default { |
|
|
|
// } |
|
|
|
// }) |
|
|
|
}, |
|
|
|
searchData(data) { |
|
|
|
brandLike(data).then((response) => { |
|
|
|
console.log(response, 7777777777) |
|
|
|
if (response.code === '200') { |
|
|
|
this.YongHu = response.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 序号 |
|
|
|
indexMethod(index) { |
|
|
|
// var pagestart = (this.listQuery.pageNumber - 1) * this.listQuery.pageSize |
|
|
@ -326,6 +362,11 @@ export default { |
|
|
|
e.manufacturerName = a.dictValue |
|
|
|
} |
|
|
|
}) |
|
|
|
if (e.isValidity == '1'){ |
|
|
|
e.isValidity = '是' |
|
|
|
}else if (e.isValidity == '2'){ |
|
|
|
e.isValidity = '否' |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(this.list, 11111111111) |
|
|
|
// setuser(response.data.records.sid) |
|
|
@ -341,7 +382,15 @@ export default { |
|
|
|
this.listQuery.pageNumber = 1 |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
|
|
|
|
handleReset() { |
|
|
|
this.listQuery = { |
|
|
|
params: {}, |
|
|
|
current: 1, |
|
|
|
size: 10, |
|
|
|
total: 0 |
|
|
|
} |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
// ----------------------------------方法-------------------- |
|
|
|
// 添加前数据初始化 |
|
|
|
resetTemp() { |
|
|
@ -354,6 +403,14 @@ export default { |
|
|
|
state: '', // 状态 |
|
|
|
} |
|
|
|
}, |
|
|
|
searchData01(data) { |
|
|
|
brandLike(data).then((response) => { |
|
|
|
console.log(response, 7777777777) |
|
|
|
if (response.code === '200') { |
|
|
|
this.YongHu = response.data |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 文本模糊查询 |
|
|
|
querySearchAsync(queryString, cb) { |
|
|
|
console.log('查询条件:', queryString) |
|
|
@ -363,8 +420,8 @@ export default { |
|
|
|
queryString != undefined && |
|
|
|
queryString !== '' |
|
|
|
) { |
|
|
|
this.searchData({ name: queryString }) |
|
|
|
brandLike({ name: queryString }).then((response) => { |
|
|
|
this.searchData01({name: queryString}) |
|
|
|
brandLike({name: queryString}).then((response) => { |
|
|
|
if (response.code === '200') { |
|
|
|
response.data |
|
|
|
cb(response.data) |
|
|
@ -432,8 +489,8 @@ export default { |
|
|
|
// this.listQuery.brandCode = '' |
|
|
|
}, |
|
|
|
// 打开添加 |
|
|
|
handleCreate() { |
|
|
|
this.$router.push({ path: '/pinpai/pinpaiAdd/0' }) |
|
|
|
toAdd() { |
|
|
|
this.$router.push({path: '/pinpai/pinpaiAdd/0'}) |
|
|
|
}, |
|
|
|
// 导入 |
|
|
|
handleDaoRu() { |
|
|
@ -493,7 +550,7 @@ export default { |
|
|
|
// console.log('wpwpwpw',this.daochu_user) |
|
|
|
}, |
|
|
|
// 打开修改 |
|
|
|
handleUpdate(row) { |
|
|
|
toEdit(row) { |
|
|
|
// this.resetTemp() |
|
|
|
// const tempData = Object.assign({}, row) // copy obj |
|
|
|
// this.FormLoading = true |
|
|
@ -575,39 +632,47 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 根据本行ID删除数据 |
|
|
|
handleDelete() { |
|
|
|
if(this.sids.length>0){ |
|
|
|
deleteBySids(this.sids).then((response) => { |
|
|
|
console.log('3455', response) |
|
|
|
if (response.code === '200') { |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '删除成功', |
|
|
|
type: 'success', |
|
|
|
duration: 2000, |
|
|
|
doDel() { |
|
|
|
if (this.sids.length > 0) { |
|
|
|
const _this = this |
|
|
|
const tip = '请确认是否删除所选 ' + this.sids.length + ' 条记录?' |
|
|
|
this.$confirm(tip, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
this.getList() |
|
|
|
} else { |
|
|
|
this.$notify({ |
|
|
|
title: '删除失败', |
|
|
|
message: response.msg, |
|
|
|
type: 'error', |
|
|
|
.then(() => { |
|
|
|
const loading = this.$loading({ |
|
|
|
lock: true, |
|
|
|
text: 'Loading', |
|
|
|
spinner: 'el-icon-loading', |
|
|
|
background: 'rgba(0, 0, 0, 0.7)' |
|
|
|
}) |
|
|
|
deleteBySids(this.sids) |
|
|
|
.then(resp => { |
|
|
|
if (resp.success && resp.code == '200'){ |
|
|
|
loading.close() |
|
|
|
_this.$message({ type: 'success', message: resp.msg, showClose: true }) |
|
|
|
_this.getList() |
|
|
|
}else { |
|
|
|
loading.close() |
|
|
|
// _this.$message({ type: 'error', message: resp.msg, showClose: true }) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.$notify({ |
|
|
|
title: '提示', |
|
|
|
message: '没有选择品牌!!', |
|
|
|
type: 'error', |
|
|
|
duration: 2000, |
|
|
|
.catch(e => { |
|
|
|
loading.close() |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.$message({ type: 'error', message: '没有选择品牌!', showClose: true }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 导出 |
|
|
|
handleDaoChu() { |
|
|
|
doExport() { |
|
|
|
// this.$confirm('确定要导出数据, 是否继续?', '提示', { |
|
|
|
// confirmButtonText: '确定', |
|
|
|
// cancelButtonText: '取消', |
|
|
@ -627,6 +692,10 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
doClose() { |
|
|
|
this.$store.dispatch('tagsView/delView', this.$route); |
|
|
|
this.$router.go(-1) |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
@ -639,18 +708,31 @@ export default { |
|
|
|
margin: 0; |
|
|
|
padding: 0; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-collapse-item__wrap { |
|
|
|
border-bottom: 0px solid #ebeef5; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-collapse-item__header { |
|
|
|
border-bottom: 0px solid #e6ebf5; |
|
|
|
} |
|
|
|
|
|
|
|
.searchli { |
|
|
|
padding: 5px 100px; |
|
|
|
} |
|
|
|
.listcon { |
|
|
|
height: calc(100vh - 430px); |
|
|
|
overflow-y: auto; |
|
|
|
overflow-x: hidden; |
|
|
|
|
|
|
|
.btn { |
|
|
|
padding: 15px 0 15px 0; |
|
|
|
border: 1px solid #e0e3eb; |
|
|
|
} |
|
|
|
|
|
|
|
.tab-header { |
|
|
|
background-color: #edf1f7; |
|
|
|
padding: 8px 20px; |
|
|
|
margin-bottom: 0 !important; |
|
|
|
} |
|
|
|
|
|
|
|
.tab-header /deep/ .el-form-item { |
|
|
|
margin-bottom: 10px; |
|
|
|
} |
|
|
|
</style> |
|
|
|