parent
d5750cfb51
commit
5e610d0207
|
|
@ -477,3 +477,17 @@ export function integralOrderStatus(status) {
|
|||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
// 商户类型
|
||||
export function merchantTypeText(merchantType = 0) {
|
||||
const textArray = {
|
||||
0: '商户',
|
||||
1: '酒道馆',
|
||||
2: '供应商',
|
||||
3: '烟酒店',
|
||||
4: '超市',
|
||||
5: '省公司门店',
|
||||
6: '城市会客厅',
|
||||
7: '健康体检馆',
|
||||
}
|
||||
return textArray[Number(merchantType)] || '商户';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,21 +12,14 @@ const merchantRouter =
|
|||
alwaysShow: true,
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: 'system',
|
||||
name: 'MerchantSystem',
|
||||
meta: {
|
||||
title: '商户权限管理',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/merchant/system/index')
|
||||
},
|
||||
// 商户列表
|
||||
{
|
||||
path: 'list',
|
||||
name: 'MerchantList',
|
||||
meta: {
|
||||
title: '商户列表',
|
||||
noCache: true
|
||||
title: '联盟商家',
|
||||
noCache: true,
|
||||
merchant_type: 0,
|
||||
},
|
||||
component: () => import('@/views/merchant/list/index')
|
||||
},
|
||||
|
|
@ -35,90 +28,141 @@ const merchantRouter =
|
|||
name: 'MerchantShopList',
|
||||
meta: {
|
||||
title: '酒道馆',
|
||||
noCache: true
|
||||
noCache: true,
|
||||
merchant_type: 1,
|
||||
},
|
||||
component: () => import('@/views/merchant/list/shop')
|
||||
},
|
||||
{
|
||||
path: 'shopApply',
|
||||
name: 'MerchantShopApply',
|
||||
meta: {
|
||||
title: '酒道馆申请审核',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/merchant/application/shop_apply')
|
||||
component: () => import('@/views/merchant/list/index')
|
||||
},
|
||||
{
|
||||
path: 'supplier',
|
||||
name: 'MerchantSupplierList',
|
||||
meta: {
|
||||
title: '供应商',
|
||||
noCache: true
|
||||
noCache: true,
|
||||
merchant_type: 2,
|
||||
},
|
||||
component: () => import('@/views/merchant/list/supplier')
|
||||
component: () => import('@/views/merchant/list/index')
|
||||
},
|
||||
{
|
||||
path: 'smoke',
|
||||
name: 'SmokeShopList',
|
||||
meta: {
|
||||
title: '烟酒店',
|
||||
noCache: true
|
||||
noCache: true,
|
||||
merchant_type: 3,
|
||||
},
|
||||
component: () => import('@/views/merchant/list/smoke')
|
||||
},
|
||||
{
|
||||
path: 'smoke_apply',
|
||||
name: 'SmokeApplyList',
|
||||
meta: {
|
||||
title: '入驻申请审核',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/merchant/application/smoke_apply')
|
||||
},
|
||||
{
|
||||
path: 'hall',
|
||||
name: 'hallShopList',
|
||||
meta: {
|
||||
title: '城市会客厅',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/merchant/list/hall')
|
||||
},
|
||||
{
|
||||
path: 'hall_apply',
|
||||
name: 'hallApplyList',
|
||||
meta: {
|
||||
title: '入驻申请审核',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/merchant/application/hall_apply')
|
||||
component: () => import('@/views/merchant/list/index')
|
||||
},
|
||||
{
|
||||
path: 'supermarket',
|
||||
name: 'supermarketShopList',
|
||||
meta: {
|
||||
title: '超市',
|
||||
noCache: true
|
||||
noCache: true,
|
||||
merchant_type: 4,
|
||||
},
|
||||
component: () => import('@/views/merchant/list/supermarket')
|
||||
},
|
||||
{
|
||||
path: 'supermarket_apply',
|
||||
name: 'supermarketApplyList',
|
||||
meta: {
|
||||
title: '入驻申请审核',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/merchant/application/supermarket_apply')
|
||||
component: () => import('@/views/merchant/list/index')
|
||||
},
|
||||
{
|
||||
path: 'province',
|
||||
name: 'provinceShopList',
|
||||
meta: {
|
||||
title: '省公司门店',
|
||||
noCache: true,
|
||||
merchant_type: 5,
|
||||
},
|
||||
component: () => import('@/views/merchant/list/index')
|
||||
},
|
||||
{
|
||||
path: 'hall',
|
||||
name: 'hallShopList',
|
||||
meta: {
|
||||
title: '城市会客厅',
|
||||
noCache: true,
|
||||
merchant_type: 6,
|
||||
},
|
||||
component: () => import('@/views/merchant/list/index')
|
||||
},
|
||||
{
|
||||
path: 'health',
|
||||
name: 'healthList',
|
||||
meta: {
|
||||
title: '健康体检馆',
|
||||
noCache: true,
|
||||
merchant_type: 7,
|
||||
},
|
||||
component: () => import('@/views/merchant/list/index')
|
||||
},
|
||||
// 商户申请审核列表
|
||||
{
|
||||
path: 'application',
|
||||
name: 'MerchantApplication',
|
||||
meta: {
|
||||
title: '商户申请',
|
||||
noCache: true,
|
||||
merchant_type: 0,
|
||||
},
|
||||
component: () => import('@/views/merchant/application/index')
|
||||
},
|
||||
{
|
||||
path: 'shopApply',
|
||||
name: 'MerchantShopApply',
|
||||
meta: {
|
||||
title: '酒道馆申请审核',
|
||||
noCache: true,
|
||||
merchant_type: 1,
|
||||
},
|
||||
component: () => import('@/views/merchant/application/index')
|
||||
},
|
||||
{
|
||||
path: 'smoke_apply',
|
||||
name: 'SmokeApplyList',
|
||||
meta: {
|
||||
title: '入驻申请审核',
|
||||
noCache: true,
|
||||
merchant_type: 3,
|
||||
},
|
||||
component: () => import('@/views/merchant/application/index')
|
||||
},
|
||||
{
|
||||
path: 'supermarket_apply',
|
||||
name: 'supermarketApplyList',
|
||||
meta: {
|
||||
title: '入驻申请审核',
|
||||
noCache: true,
|
||||
merchant_type: 4,
|
||||
},
|
||||
component: () => import('@/views/merchant/application/index')
|
||||
},
|
||||
{
|
||||
path: 'hall_apply',
|
||||
name: 'hallApplyList',
|
||||
meta: {
|
||||
title: '入驻申请审核',
|
||||
noCache: true,
|
||||
merchant_type: 6,
|
||||
},
|
||||
component: () => import('@/views/merchant/application/index')
|
||||
},
|
||||
{
|
||||
path: 'health_apply',
|
||||
name: 'healthApplyList',
|
||||
meta: {
|
||||
title: '入驻申请审核',
|
||||
noCache: true,
|
||||
merchant_type: 7,
|
||||
},
|
||||
component: () => import('@/views/merchant/application/index')
|
||||
},
|
||||
// 其他
|
||||
{
|
||||
path: 'system',
|
||||
name: 'MerchantSystem',
|
||||
meta: {
|
||||
title: '商户权限管理',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/merchant/list/province')
|
||||
component: () => import('@/views/merchant/system/index')
|
||||
},
|
||||
{
|
||||
path: 'list/reconciliation/:id/:type?',
|
||||
|
|
@ -149,15 +193,6 @@ const merchantRouter =
|
|||
},
|
||||
component: () => import('@/views/merchant/brand')
|
||||
},
|
||||
{
|
||||
path: 'application',
|
||||
name: 'MerchantApplication',
|
||||
meta: {
|
||||
title: '商户申请',
|
||||
noCache: true
|
||||
},
|
||||
component: () => import('@/views/merchant/application/index')
|
||||
},
|
||||
{
|
||||
path: 'agree',
|
||||
name: 'MerchantAgreement',
|
||||
|
|
|
|||
|
|
@ -1,375 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<!--顶部搜索-->
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="width: 100%">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn, indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态:">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.status"
|
||||
size="small"
|
||||
@change="statusChange(tableFrom.status)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn, indexn) in statusList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="商户分类:">
|
||||
<el-select
|
||||
v-model="tableFrom.category_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in merCateList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺类型:">
|
||||
<el-select
|
||||
v-model="tableFrom.type_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="关键字:">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入商户名称关键字/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单-->
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" highlight-current-row class="switchTable">
|
||||
<el-table-column prop="mer_intention_id" label="ID" min-width="60" align="center"/>
|
||||
<el-table-column label="申请人" min-width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.applicant">
|
||||
<div class="user-avatar" v-if="scope.row.applicant.avatar && scope.row.applicant.avatar != 1">
|
||||
<img :src="scope.row.applicant.avatar" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="nickname">{{ scope.row.applicant.nickname }}</div>
|
||||
<div class="user-id">ID:{{ scope.row.applicant.uid }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="管理员" min-width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.manage">
|
||||
<div class="user-avatar" v-if="scope.row.manage.avatar && scope.row.manage.avatar != 1">
|
||||
<img :src="scope.row.manage.avatar" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="nickname">{{ scope.row.manage.nickname }}</div>
|
||||
<div class="user-id">ID:{{ scope.row.manage.uid }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商户名称" min-width="100" align="left">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.mer_name || ''}}
|
||||
<!--名称:{{scope.row.mer_name || ''}}<br />-->
|
||||
<!--分类 :{{scope.row.category_name || ''}}<br />-->
|
||||
<!--类型:{{scope.row.type_name || ''}}<br />-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人信息" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name || ''}}<br />
|
||||
{{scope.row.phone || ''}}<br />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="申请时间" min-width="150" align="center"/>
|
||||
<el-table-column label="资质图片" min-width="110">
|
||||
<template slot-scope="scope">
|
||||
<div class="qualification-image">
|
||||
<el-image v-for="(item, index) in scope.row.images" :key="index" :src="item" class="mr5" :preview-src-list="[item]" />
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status == 1" type="success">通过</el-tag>
|
||||
<el-tag v-if="scope.row.status == 0" type="info">未处理</el-tag>
|
||||
<el-tag v-if="scope.row.status == 2" type="warning">未通过</el-tag>
|
||||
<div v-if="scope.row.status == 2">{{ scope.row.fail_msg }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="mark" label="备注" min-width="150" />
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="onchangeIsShow(scope.row.mer_intention_id)">审核</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_intention_id)">备注</el-button>
|
||||
<el-button type="text" size="small" @click="handleDelete(scope.row.mer_intention_id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {intentionLstApi, auditApi, intentionDelte, intentionStatusApi, getstoreTypeApi, getMerCateApi} from "@/api/merchant";
|
||||
import { fromList, statusList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
export default {
|
||||
name: "MerchantApplication",
|
||||
data() {
|
||||
return {
|
||||
props: {
|
||||
emitPath: false
|
||||
},
|
||||
fromList: fromList,
|
||||
statusList: statusList, //筛选状态列表
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: this.$route.query.status ? this.$route.query.status : "",
|
||||
keyword: "",
|
||||
mer_intention_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
category_id: "",
|
||||
type_id: "",
|
||||
merchant_type: 6,
|
||||
},
|
||||
mer_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
autoUpdate: true,
|
||||
timeVal: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
mer_id(newName, oldName) {
|
||||
this.getList("");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
statusChange(tab) {
|
||||
this.tableFrom.status = tab;
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 商户分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
/**获取店铺类型 */
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
intentionLstApi(this.tableFrom)
|
||||
.then((res) => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch((res) => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(id) {
|
||||
this.$modalForm(intentionStatusApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 添加
|
||||
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.$modalForm(auditApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$deleteSure().then(() => {
|
||||
intentionDelte(id)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .cell{
|
||||
padding: 0!important;
|
||||
}
|
||||
.qualification-image{
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
/deep/ table .el-image {
|
||||
display: inline-block !important;
|
||||
}
|
||||
.user-content{
|
||||
--user-content-height-: 80px;
|
||||
|
||||
height: var(--user-content-height-);
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.user-avatar{
|
||||
height: var(--user-content-height-);
|
||||
width: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
img{
|
||||
height: 80%!important;
|
||||
width: 80%!important;
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
}
|
||||
.user-info{
|
||||
width: calc(100% - var(--user-content-height-));
|
||||
height: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
.nickname{
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
line-height: calc(var(--user-content-height- * 65%));
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user-id{
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
line-height: calc(var(--user-content-height- * 35%));
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -15,7 +15,8 @@
|
|||
v-for="(itemn, indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>{{ itemn.text }}
|
||||
</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
|
|
@ -40,42 +41,45 @@
|
|||
v-for="(itemn, indexn) in statusList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>{{ itemn.text }}
|
||||
</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户分类:">
|
||||
<template v-if="tableFrom.merchant_type == 0">
|
||||
<el-form-item label="商户分类:">
|
||||
<el-select
|
||||
v-model="tableFrom.category_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-model="tableFrom.category_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in merCateList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺类型:">
|
||||
<el-select
|
||||
v-model="tableFrom.type_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺类型:">
|
||||
<el-select
|
||||
v-model="tableFrom.type_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="关键字:">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
|
|
@ -91,7 +95,7 @@
|
|||
</div>
|
||||
<!--表单-->
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" highlight-current-row class="switchTable">
|
||||
<el-table-column prop="mer_intention_id" label="ID" min-width="60" align="center"/>
|
||||
<el-table-column prop="mer_intention_id" label="ID" min-width="60" align="center" />
|
||||
<el-table-column label="申请人" min-width="280" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.applicant">
|
||||
|
|
@ -120,18 +124,18 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="商户信息" min-width="180" align="left">
|
||||
<template slot-scope="scope">
|
||||
名称:{{scope.row.mer_name || ''}}<br />
|
||||
分类:{{scope.row.category_name || ''}}<br />
|
||||
类型:{{scope.row.type_name || ''}}<br />
|
||||
名称:{{ scope.row.mer_name || '' }}<br />
|
||||
分类:{{ scope.row.category_name || '' }}<br />
|
||||
类型:{{ scope.row.type_name || '' }}<br />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人信息" min-width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name || ''}}<br />
|
||||
{{scope.row.phone || ''}}<br />
|
||||
{{ scope.row.name || '' }}<br />
|
||||
{{ scope.row.phone || '' }}<br />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="申请时间" min-width="150" align="center"/>
|
||||
<el-table-column prop="create_time" label="申请时间" min-width="150" align="center" />
|
||||
<el-table-column label="资质图片" min-width="110">
|
||||
<template slot-scope="scope">
|
||||
<div class="qualification-image">
|
||||
|
|
@ -150,7 +154,9 @@
|
|||
<el-table-column prop="mark" label="备注" min-width="150" />
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="onchangeIsShow(scope.row.mer_intention_id)">审核</el-button>
|
||||
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="onchangeIsShow(scope.row.mer_intention_id)">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_intention_id)">备注</el-button>
|
||||
<el-button type="text" size="small" @click="handleDelete(scope.row.mer_intention_id)">删除</el-button>
|
||||
</template>
|
||||
|
|
@ -173,9 +179,18 @@
|
|||
|
||||
<script>
|
||||
|
||||
import {intentionLstApi, auditApi, intentionDelte, intentionStatusApi, getstoreTypeApi, getMerCateApi} from "@/api/merchant";
|
||||
import { fromList, statusList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
import {
|
||||
intentionLstApi,
|
||||
auditApi,
|
||||
intentionDelte,
|
||||
intentionStatusApi,
|
||||
getstoreTypeApi,
|
||||
getMerCateApi
|
||||
} from "@/api/merchant";
|
||||
import {fromList, statusList} from "@/libs/constants.js";
|
||||
import {roterPre} from "@/settings";
|
||||
import {merchantTypeText} from "@/filters";
|
||||
|
||||
export default {
|
||||
name: "MerchantApplication",
|
||||
data() {
|
||||
|
|
@ -202,22 +217,32 @@ export default {
|
|||
keyword: "",
|
||||
mer_intention_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
category_id: "",
|
||||
type_id: ""
|
||||
type_id: "",
|
||||
merchant_type: '',
|
||||
},
|
||||
mer_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
autoUpdate: true,
|
||||
timeVal: [],
|
||||
merchantTitle: '商户',
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
mer_id(newName, oldName) {
|
||||
this.getList("");
|
||||
}
|
||||
this.getList("");
|
||||
},
|
||||
'$route' () {
|
||||
this.tableFrom.merchant_type = this.$route.meta.merchant_type || 0;
|
||||
},
|
||||
'tableFrom.merchant_type' () {
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
this.merchantTitle = merchantTypeText(this.tableFrom.merchant_type);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
this.tableFrom.merchant_type = this.$route.meta.merchant_type || 0;
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 选择时间
|
||||
|
|
@ -241,19 +266,19 @@ export default {
|
|||
},
|
||||
// 商户分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
/**获取店铺类型 */
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
getStoreType() {
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
|
|
@ -292,11 +317,11 @@ export default {
|
|||
handleDelete(id) {
|
||||
this.$deleteSure().then(() => {
|
||||
intentionDelte(id)
|
||||
.then(({ message }) => {
|
||||
.then(({message}) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
.catch(({message}) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
|
|
@ -306,7 +331,7 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.qualification-image{
|
||||
.qualification-image {
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
|
|
@ -314,10 +339,12 @@ export default {
|
|||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/deep/ table .el-image {
|
||||
display: inline-block !important;
|
||||
}
|
||||
.user-content{
|
||||
|
||||
.user-content {
|
||||
--user-content-height-: 80px;
|
||||
|
||||
height: var(--user-content-height-);
|
||||
|
|
@ -327,7 +354,8 @@ export default {
|
|||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.user-avatar{
|
||||
|
||||
.user-avatar {
|
||||
height: var(--user-content-height-);
|
||||
width: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
|
|
@ -335,13 +363,15 @@ export default {
|
|||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
img{
|
||||
height: 80%!important;
|
||||
width: 80%!important;
|
||||
|
||||
img {
|
||||
height: 80% !important;
|
||||
width: 80% !important;
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
}
|
||||
.user-info{
|
||||
|
||||
.user-info {
|
||||
width: calc(100% - var(--user-content-height-));
|
||||
height: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
|
|
@ -349,7 +379,8 @@ export default {
|
|||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
.nickname{
|
||||
|
||||
.nickname {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 15px;
|
||||
|
|
@ -359,7 +390,8 @@ export default {
|
|||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user-id{
|
||||
|
||||
.user-id {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
|
|
|
|||
|
|
@ -1,375 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<!--顶部搜索-->
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="width: 100%">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn, indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态:">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.status"
|
||||
size="small"
|
||||
@change="statusChange(tableFrom.status)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn, indexn) in statusList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="商户分类:">
|
||||
<el-select
|
||||
v-model="tableFrom.category_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in merCateList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺类型:">
|
||||
<el-select
|
||||
v-model="tableFrom.type_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="关键字:">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入商户名称关键字/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单-->
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" highlight-current-row class="switchTable">
|
||||
<el-table-column prop="mer_intention_id" label="ID" min-width="60" align="center"/>
|
||||
<el-table-column label="申请人" min-width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.applicant">
|
||||
<div class="user-avatar" v-if="scope.row.applicant.avatar && scope.row.applicant.avatar != 1">
|
||||
<img :src="scope.row.applicant.avatar" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="nickname">{{ scope.row.applicant.nickname }}</div>
|
||||
<div class="user-id">ID:{{ scope.row.applicant.uid }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="管理员" min-width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.manage">
|
||||
<div class="user-avatar" v-if="scope.row.manage.avatar && scope.row.manage.avatar != 1">
|
||||
<img :src="scope.row.manage.avatar" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="nickname">{{ scope.row.manage.nickname }}</div>
|
||||
<div class="user-id">ID:{{ scope.row.manage.uid }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商户名称" min-width="100" align="left">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.mer_name || ''}}
|
||||
<!--名称:{{scope.row.mer_name || ''}}<br />-->
|
||||
<!--分类 :{{scope.row.category_name || ''}}<br />-->
|
||||
<!--类型:{{scope.row.type_name || ''}}<br />-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人信息" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name || ''}}<br />
|
||||
{{scope.row.phone || ''}}<br />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="申请时间" min-width="150" align="center"/>
|
||||
<el-table-column label="资质图片" min-width="110">
|
||||
<template slot-scope="scope">
|
||||
<div class="qualification-image">
|
||||
<el-image v-for="(item, index) in scope.row.images" :key="index" :src="item" class="mr5" :preview-src-list="[item]" />
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status == 1" type="success">通过</el-tag>
|
||||
<el-tag v-if="scope.row.status == 0" type="info">未处理</el-tag>
|
||||
<el-tag v-if="scope.row.status == 2" type="warning">未通过</el-tag>
|
||||
<div v-if="scope.row.status == 2">{{ scope.row.fail_msg }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="mark" label="备注" min-width="150" />
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="onchangeIsShow(scope.row.mer_intention_id)">审核</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_intention_id)">备注</el-button>
|
||||
<el-button type="text" size="small" @click="handleDelete(scope.row.mer_intention_id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {intentionLstApi, auditApi, intentionDelte, intentionStatusApi, getstoreTypeApi, getMerCateApi} from "@/api/merchant";
|
||||
import { fromList, statusList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
export default {
|
||||
name: "MerchantApplication",
|
||||
data() {
|
||||
return {
|
||||
props: {
|
||||
emitPath: false
|
||||
},
|
||||
fromList: fromList,
|
||||
statusList: statusList, //筛选状态列表
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: this.$route.query.status ? this.$route.query.status : "",
|
||||
keyword: "",
|
||||
mer_intention_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
category_id: "",
|
||||
type_id: "",
|
||||
merchant_type: 1,
|
||||
},
|
||||
mer_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
autoUpdate: true,
|
||||
timeVal: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
mer_id(newName, oldName) {
|
||||
this.getList("");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
statusChange(tab) {
|
||||
this.tableFrom.status = tab;
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 商户分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
/**获取店铺类型 */
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
intentionLstApi(this.tableFrom)
|
||||
.then((res) => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch((res) => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(id) {
|
||||
this.$modalForm(intentionStatusApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 添加
|
||||
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.$modalForm(auditApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$deleteSure().then(() => {
|
||||
intentionDelte(id)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .cell{
|
||||
padding: 0!important;
|
||||
}
|
||||
.qualification-image{
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
/deep/ table .el-image {
|
||||
display: inline-block !important;
|
||||
}
|
||||
.user-content{
|
||||
--user-content-height-: 80px;
|
||||
|
||||
height: var(--user-content-height-);
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.user-avatar{
|
||||
height: var(--user-content-height-);
|
||||
width: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
img{
|
||||
height: 80%!important;
|
||||
width: 80%!important;
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
}
|
||||
.user-info{
|
||||
width: calc(100% - var(--user-content-height-));
|
||||
height: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
.nickname{
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
line-height: calc(var(--user-content-height- * 65%));
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user-id{
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
line-height: calc(var(--user-content-height- * 35%));
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,375 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<!--顶部搜索-->
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="width: 100%">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn, indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态:">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.status"
|
||||
size="small"
|
||||
@change="statusChange(tableFrom.status)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn, indexn) in statusList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="商户分类:">
|
||||
<el-select
|
||||
v-model="tableFrom.category_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in merCateList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺类型:">
|
||||
<el-select
|
||||
v-model="tableFrom.type_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="关键字:">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入商户名称关键字/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单-->
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" highlight-current-row class="switchTable">
|
||||
<el-table-column prop="mer_intention_id" label="ID" min-width="60" align="center"/>
|
||||
<el-table-column label="申请人" min-width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.applicant">
|
||||
<div class="user-avatar" v-if="scope.row.applicant.avatar && scope.row.applicant.avatar != 1">
|
||||
<img :src="scope.row.applicant.avatar" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="nickname">{{ scope.row.applicant.nickname }}</div>
|
||||
<div class="user-id">ID:{{ scope.row.applicant.uid }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="管理员" min-width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.manage">
|
||||
<div class="user-avatar" v-if="scope.row.manage.avatar && scope.row.manage.avatar != 1">
|
||||
<img :src="scope.row.manage.avatar" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="nickname">{{ scope.row.manage.nickname }}</div>
|
||||
<div class="user-id">ID:{{ scope.row.manage.uid }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商户名称" min-width="100" align="left">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.mer_name || ''}}
|
||||
<!--名称:{{scope.row.mer_name || ''}}<br />-->
|
||||
<!--分类 :{{scope.row.category_name || ''}}<br />-->
|
||||
<!--类型:{{scope.row.type_name || ''}}<br />-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人信息" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name || ''}}<br />
|
||||
{{scope.row.phone || ''}}<br />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="申请时间" min-width="150" align="center"/>
|
||||
<el-table-column label="资质图片" min-width="110">
|
||||
<template slot-scope="scope">
|
||||
<div class="qualification-image">
|
||||
<el-image v-for="(item, index) in scope.row.images" :key="index" :src="item" class="mr5" :preview-src-list="[item]" />
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status == 1" type="success">通过</el-tag>
|
||||
<el-tag v-if="scope.row.status == 0" type="info">未处理</el-tag>
|
||||
<el-tag v-if="scope.row.status == 2" type="warning">未通过</el-tag>
|
||||
<div v-if="scope.row.status == 2">{{ scope.row.fail_msg }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="mark" label="备注" min-width="150" />
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="onchangeIsShow(scope.row.mer_intention_id)">审核</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_intention_id)">备注</el-button>
|
||||
<el-button type="text" size="small" @click="handleDelete(scope.row.mer_intention_id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {intentionLstApi, auditApi, intentionDelte, intentionStatusApi, getstoreTypeApi, getMerCateApi} from "@/api/merchant";
|
||||
import { fromList, statusList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
export default {
|
||||
name: "MerchantApplication",
|
||||
data() {
|
||||
return {
|
||||
props: {
|
||||
emitPath: false
|
||||
},
|
||||
fromList: fromList,
|
||||
statusList: statusList, //筛选状态列表
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: this.$route.query.status ? this.$route.query.status : "",
|
||||
keyword: "",
|
||||
mer_intention_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
category_id: "",
|
||||
type_id: "",
|
||||
merchant_type: 3,
|
||||
},
|
||||
mer_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
autoUpdate: true,
|
||||
timeVal: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
mer_id(newName, oldName) {
|
||||
this.getList("");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
statusChange(tab) {
|
||||
this.tableFrom.status = tab;
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 商户分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
/**获取店铺类型 */
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
intentionLstApi(this.tableFrom)
|
||||
.then((res) => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch((res) => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(id) {
|
||||
this.$modalForm(intentionStatusApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 添加
|
||||
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.$modalForm(auditApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$deleteSure().then(() => {
|
||||
intentionDelte(id)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .cell{
|
||||
padding: 0!important;
|
||||
}
|
||||
.qualification-image{
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
/deep/ table .el-image {
|
||||
display: inline-block !important;
|
||||
}
|
||||
.user-content{
|
||||
--user-content-height-: 80px;
|
||||
|
||||
height: var(--user-content-height-);
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.user-avatar{
|
||||
height: var(--user-content-height-);
|
||||
width: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
img{
|
||||
height: 80%!important;
|
||||
width: 80%!important;
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
}
|
||||
.user-info{
|
||||
width: calc(100% - var(--user-content-height-));
|
||||
height: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
.nickname{
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
line-height: calc(var(--user-content-height- * 65%));
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user-id{
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
line-height: calc(var(--user-content-height- * 35%));
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,375 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<!--顶部搜索-->
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="width: 100%">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn, indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态:">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.status"
|
||||
size="small"
|
||||
@change="statusChange(tableFrom.status)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn, indexn) in statusList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="商户分类:">
|
||||
<el-select
|
||||
v-model="tableFrom.category_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in merCateList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺类型:">
|
||||
<el-select
|
||||
v-model="tableFrom.type_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="关键字:">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入商户名称关键字/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单-->
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" highlight-current-row class="switchTable">
|
||||
<el-table-column prop="mer_intention_id" label="ID" min-width="60" align="center"/>
|
||||
<el-table-column label="申请人" min-width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.applicant">
|
||||
<div class="user-avatar" v-if="scope.row.applicant.avatar && scope.row.applicant.avatar != 1">
|
||||
<img :src="scope.row.applicant.avatar" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="nickname">{{ scope.row.applicant.nickname }}</div>
|
||||
<div class="user-id">ID:{{ scope.row.applicant.uid }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="管理员" min-width="230" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="user-content" v-if="scope.row.manage">
|
||||
<div class="user-avatar" v-if="scope.row.manage.avatar && scope.row.manage.avatar != 1">
|
||||
<img :src="scope.row.manage.avatar" />
|
||||
</div>
|
||||
<div class="user-info">
|
||||
<div class="nickname">{{ scope.row.manage.nickname }}</div>
|
||||
<div class="user-id">ID:{{ scope.row.manage.uid }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商户名称" min-width="100" align="left">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.mer_name || ''}}
|
||||
<!--名称:{{scope.row.mer_name || ''}}<br />-->
|
||||
<!--分类 :{{scope.row.category_name || ''}}<br />-->
|
||||
<!--类型:{{scope.row.type_name || ''}}<br />-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="联系人信息" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.name || ''}}<br />
|
||||
{{scope.row.phone || ''}}<br />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="申请时间" min-width="150" align="center"/>
|
||||
<el-table-column label="资质图片" min-width="110">
|
||||
<template slot-scope="scope">
|
||||
<div class="qualification-image">
|
||||
<el-image v-for="(item, index) in scope.row.images" :key="index" :src="item" class="mr5" :preview-src-list="[item]" />
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status == 1" type="success">通过</el-tag>
|
||||
<el-tag v-if="scope.row.status == 0" type="info">未处理</el-tag>
|
||||
<el-tag v-if="scope.row.status == 2" type="warning">未通过</el-tag>
|
||||
<div v-if="scope.row.status == 2">{{ scope.row.fail_msg }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="mark" label="备注" min-width="150" />
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="onchangeIsShow(scope.row.mer_intention_id)">审核</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_intention_id)">备注</el-button>
|
||||
<el-button type="text" size="small" @click="handleDelete(scope.row.mer_intention_id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {intentionLstApi, auditApi, intentionDelte, intentionStatusApi, getstoreTypeApi, getMerCateApi} from "@/api/merchant";
|
||||
import { fromList, statusList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
export default {
|
||||
name: "MerchantApplication",
|
||||
data() {
|
||||
return {
|
||||
props: {
|
||||
emitPath: false
|
||||
},
|
||||
fromList: fromList,
|
||||
statusList: statusList, //筛选状态列表
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: this.$route.query.status ? this.$route.query.status : "",
|
||||
keyword: "",
|
||||
mer_intention_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
category_id: "",
|
||||
type_id: "",
|
||||
merchant_type: 4,
|
||||
},
|
||||
mer_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
autoUpdate: true,
|
||||
timeVal: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
mer_id(newName, oldName) {
|
||||
this.getList("");
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
statusChange(tab) {
|
||||
this.tableFrom.status = tab;
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 商户分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
/**获取店铺类型 */
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
intentionLstApi(this.tableFrom)
|
||||
.then((res) => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch((res) => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(id) {
|
||||
this.$modalForm(intentionStatusApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 添加
|
||||
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.$modalForm(auditApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$deleteSure().then(() => {
|
||||
intentionDelte(id)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .cell{
|
||||
padding: 0!important;
|
||||
}
|
||||
.qualification-image{
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
/deep/ table .el-image {
|
||||
display: inline-block !important;
|
||||
}
|
||||
.user-content{
|
||||
--user-content-height-: 80px;
|
||||
|
||||
height: var(--user-content-height-);
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.user-avatar{
|
||||
height: var(--user-content-height-);
|
||||
width: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
img{
|
||||
height: 80%!important;
|
||||
width: 80%!important;
|
||||
border-radius: 50% !important;
|
||||
}
|
||||
}
|
||||
.user-info{
|
||||
width: calc(100% - var(--user-content-height-));
|
||||
height: var(--user-content-height-);
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
.nickname{
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
line-height: calc(var(--user-content-height- * 65%));
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.user-id{
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
line-height: calc(var(--user-content-height- * 35%));
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,378 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="display: inline-block">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn,indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字:" label-width="80px" style="display: inline-block;">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入店铺关键字/店铺名/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-tabs v-if="headeNum.length > 0" v-model="tableFrom.status" @tab-click="getList(1),getHeadNum()">
|
||||
<el-tab-pane
|
||||
v-for="(item,index) in headeNum"
|
||||
:key="index"
|
||||
:name="item.type.toString()"
|
||||
:label="item.title +'('+item.count +')' "
|
||||
/>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="onAdd">添加城市会客厅</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData.data"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
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">
|
||||
<el-switch
|
||||
v-model="scope.row.is_best"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
disabled
|
||||
@click.native="onchangeIsShow(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="开启/关闭" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
disabled
|
||||
@click.native="onchangeIsClose(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="150" />
|
||||
<el-table-column prop="margin" label="保证金" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" min-width="100" />
|
||||
<el-table-column prop="mark" label="备注" min-width="200" />
|
||||
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <router-link
|
||||
v-if="tableFrom.status === '1'"
|
||||
:to="{path: roterPre+ '/merchant/list/reconciliation/' + scope.row.mer_id + '/1' }"
|
||||
>
|
||||
<el-button type="text" size="small" class="mr10">对账</el-button>
|
||||
</router-link> -->
|
||||
<el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onLogo(scope.row.mer_id)"
|
||||
>登录</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_id)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="onDetails(scope.row.mer_id)">详情</el-button>
|
||||
<el-button
|
||||
v-if="tableFrom.status === '0'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleDelete(scope.row.mer_id, scope.$index)"
|
||||
>删除</el-button>
|
||||
<!-- <el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onDeduct(scope.row.mer_id)"
|
||||
>扣除保证金</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--城市会客厅详情-->
|
||||
<mer-detail
|
||||
ref="merDetail"
|
||||
:merId="merId"
|
||||
@closeDrawer="closeDrawer"
|
||||
@changeDrawer="changeDrawer"
|
||||
@onPassword="onPassword"
|
||||
@handleTimes="handleTimes"
|
||||
@getList="getList"
|
||||
:drawer="drawer"
|
||||
:defaultMerchantType="6"
|
||||
></mer-detail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {
|
||||
merchantListApi,
|
||||
merchantCreateApi,
|
||||
merchantUpdateApi,
|
||||
merchantDeleteForm,
|
||||
merchantStatuseApi,
|
||||
merchantPasswordApi,
|
||||
merchantLoginApi,
|
||||
changeCopyApi,
|
||||
merchantCountApi,
|
||||
merchantIsCloseApi,
|
||||
getstoreTypeApi,
|
||||
getMerCateApi, marginDeductionForm
|
||||
} from "@/api/merchant";
|
||||
import merDetail from './handle/merDetails.vue';
|
||||
import { fromList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
import SettingMer from "@/libs/settingMer";
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
name: "MerchantList",
|
||||
components: { merDetail },
|
||||
data() {
|
||||
return {
|
||||
fromList: fromList,
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
headeNum: [
|
||||
{
|
||||
count: '',
|
||||
type: "1",
|
||||
title: "正常开启的城市会客厅"
|
||||
},
|
||||
{
|
||||
count: '',
|
||||
type: "0",
|
||||
title: "已关闭城市会客厅"
|
||||
}
|
||||
],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: "1",
|
||||
keyword: "",
|
||||
is_trader: "",
|
||||
is_best: "",
|
||||
category_id: '',
|
||||
type_id: "",
|
||||
merchant_type: 6
|
||||
},
|
||||
autoUpdate: true,
|
||||
merId: "",
|
||||
drawer: false,
|
||||
timeVal: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getHeadNum();
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
onLogo(id) {
|
||||
merchantLoginApi(id)
|
||||
.then(res => {
|
||||
Cookies.set("merchantToken", res.data.token);
|
||||
window.open(SettingMer.httpUrl + res.data.url);
|
||||
})
|
||||
.catch(res => {
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 获取开启城市会客厅数
|
||||
getHeadNum() {
|
||||
merchantCountApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.headeNum[0]["count"] = res.data.valid;
|
||||
this.headeNum[1]["count"] = res.data.invalid;
|
||||
})
|
||||
.catch(res => {});
|
||||
},
|
||||
// 城市会客厅分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
merchantListApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch(res => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
const title = row.is_best === 0 ? "是否开启推荐城市会客厅" : "是否关闭推荐城市会客厅";
|
||||
this.$modalSure(title).then(() => {
|
||||
merchantStatuseApi(row.mer_id, row.is_best === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 开启关闭
|
||||
onchangeIsClose(row) {
|
||||
merchantIsCloseApi(row.mer_id, row.status === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
onAdd() {
|
||||
// this.$modalForm(merchantCreateApi()).then(() => this.getList(""));
|
||||
this.drawer = true;
|
||||
this.$refs.merDetail.initData();
|
||||
|
||||
|
||||
},
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = true;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
|
||||
},
|
||||
// 详情
|
||||
onDetails(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = false;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
},
|
||||
changeDrawer(v) {
|
||||
this.drawer = v;
|
||||
},
|
||||
closeDrawer() {
|
||||
this.drawer = false;
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$modalForm(merchantDeleteForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 扣除保证金
|
||||
onDeduct(id) {
|
||||
this.$modalForm(marginDeductionForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 设置复制次数
|
||||
handleTimes(id) {
|
||||
this.$modalForm(changeCopyApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
|
||||
// 修改密码表单
|
||||
onPassword(id) {
|
||||
this.$modalForm(merchantPasswordApi(id));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
|
@ -456,6 +456,7 @@
|
|||
import { merCategoryListApi } from '@/api/product'
|
||||
import {getstoreTypeApi, merchantUpdate, merchantCreate, merchantListApi, brandListApi} from "@/api/merchant";
|
||||
import { userLstApi } from '@/api/user'
|
||||
import {merchantTypeText} from "@/filters";
|
||||
export default {
|
||||
props: {
|
||||
merData: {
|
||||
|
|
@ -528,15 +529,7 @@ export default {
|
|||
merData: {
|
||||
handler() {
|
||||
this.merData.merchant_type = this.defaultMerchantType || 0;
|
||||
|
||||
if(this.defaultMerchantType == 1) this.mar_type_name = '酒道馆';
|
||||
else if(this.defaultMerchantType == 2) this.mar_type_name = '供应商';
|
||||
else if(this.defaultMerchantType == 3) this.mar_type_name = '烟酒店';
|
||||
else if(this.defaultMerchantType == 4) this.mar_type_name = '超市';
|
||||
else if(this.defaultMerchantType == 5) this.mar_type_name = '门店';
|
||||
else if(this.defaultMerchantType == 6) this.mar_type_name = '城市会客厅';
|
||||
else this.mar_type_name = '商户';
|
||||
|
||||
this.mar_type_name = merchantTypeText(this.merData.merchant_type);
|
||||
|
||||
this.selectMerList();
|
||||
this.selectBrandList('');
|
||||
|
|
|
|||
|
|
@ -240,6 +240,8 @@
|
|||
</template>
|
||||
<script>
|
||||
|
||||
import {merchantTypeText} from "@/filters";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
merData: {
|
||||
|
|
@ -266,14 +268,7 @@ export default {
|
|||
merData: {
|
||||
handler() {
|
||||
this.merData.merchant_type = this.defaultMerchantType || 0;
|
||||
|
||||
if(this.defaultMerchantType == 1) this.mar_type_name = '酒道馆';
|
||||
else if(this.defaultMerchantType == 2) this.mar_type_name = '供应商';
|
||||
else if(this.defaultMerchantType == 3) this.mar_type_name = '烟酒店';
|
||||
else if(this.defaultMerchantType == 4) this.mar_type_name = '超市';
|
||||
else if(this.defaultMerchantType == 5) this.mar_type_name = '门店';
|
||||
else if(this.defaultMerchantType == 6) this.mar_type_name = '城市会客厅';
|
||||
else this.mar_type_name = '商户';
|
||||
this.mar_type_name = merchantTypeText(this.merData.merchant_type);
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="display: inline-block">
|
||||
<el-form-item label="选择时间:" label-width="200px" style="display: inline-block">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字:" label-width="80px" style="display: inline-block;">
|
||||
<el-form-item label="关键字:" label-width="200px" style="display: inline-block;">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
|
|
@ -38,62 +38,64 @@
|
|||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户类别:">
|
||||
<el-select
|
||||
v-model="tableFrom.is_trader"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option label="自营" value="1" />
|
||||
<el-option label="非自营" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户分类:">
|
||||
<template v-if="tableFrom.merchant_type == 0">
|
||||
<el-form-item label-width="200px" :label="merchantTitle + '类别:'">
|
||||
<el-select
|
||||
v-model="tableFrom.category_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-model="tableFrom.is_trader"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option label="自营" value="1" />
|
||||
<el-option label="非自营" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="200px" :label="merchantTitle + '分类:'">
|
||||
<el-select
|
||||
v-model="tableFrom.category_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in merCateList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺类型:">
|
||||
<el-select
|
||||
v-model="tableFrom.type_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="200px" label="店铺类型:">
|
||||
<el-select
|
||||
v-model="tableFrom.type_id"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storeType"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否推荐:">
|
||||
<el-select
|
||||
v-model="tableFrom.is_best"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option key="1" label="是" value="1"/>
|
||||
<el-option key="0" label="否" value="0"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="200px" label="是否推荐:">
|
||||
<el-select
|
||||
v-model="tableFrom.is_best"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="selWidth"
|
||||
@change="getList(1)"
|
||||
>
|
||||
<el-option key="1" label="是" value="1"/>
|
||||
<el-option key="0" label="否" value="0"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-tabs v-if="headeNum.length > 0" v-model="tableFrom.status" @tab-click="getList(1),getHeadNum()">
|
||||
<el-tab-pane
|
||||
v-for="(item,index) in headeNum"
|
||||
|
|
@ -104,12 +106,12 @@
|
|||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="onAdd">添加商户</el-button>
|
||||
<el-button size="small" type="primary" @click="onAdd">添加{{ merchantTitle }}</el-button>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="small" highlight-current-row class="switchTable">
|
||||
<el-table-column prop="mer_id" label="ID" min-width="60" align="center"/>
|
||||
<el-table-column prop="mer_name" label="商户名称" min-width="150" align="center"/>
|
||||
<el-table-column prop="real_name" label="商户姓名" min-width="150" align="center"/>
|
||||
<el-table-column prop="mer_name" :label="merchantTitle + '名称'" min-width="150" align="center"/>
|
||||
<el-table-column prop="real_name" :label="merchantTitle + '姓名'" min-width="150" align="center"/>
|
||||
<el-table-column prop="status" label="推荐" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
|
|
@ -198,7 +200,7 @@
|
|||
@handleTimes="handleTimes"
|
||||
@getList="getList"
|
||||
:drawer="drawer"
|
||||
:defaultMerchantType="0"
|
||||
:defaultMerchantType="tableFrom.merchant_type"
|
||||
></mer-detail>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -206,8 +208,6 @@
|
|||
|
||||
import {
|
||||
merchantListApi,
|
||||
merchantCreateApi,
|
||||
merchantUpdateApi,
|
||||
merchantDeleteForm,
|
||||
merchantStatuseApi,
|
||||
merchantPasswordApi,
|
||||
|
|
@ -223,6 +223,7 @@ import { fromList } from "@/libs/constants.js";
|
|||
import { roterPre } from "@/settings";
|
||||
import SettingMer from "@/libs/settingMer";
|
||||
import Cookies from "js-cookie";
|
||||
import {merchantTypeText} from "@/filters";
|
||||
export default {
|
||||
name: "MerchantList",
|
||||
components: { merDetail },
|
||||
|
|
@ -254,24 +255,38 @@ export default {
|
|||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: "1",
|
||||
status: this.$route.query.status ? this.$route.query.status : "1",
|
||||
keyword: "",
|
||||
mer_intention_id: this.$route.query.id ? this.$route.query.id : "",
|
||||
is_trader: "",
|
||||
is_best: "",
|
||||
category_id: '',
|
||||
type_id: ""
|
||||
category_id: "",
|
||||
type_id: "",
|
||||
merchant_type: '',
|
||||
},
|
||||
autoUpdate: true,
|
||||
merId: "",
|
||||
drawer: false,
|
||||
timeVal: []
|
||||
timeVal: [],
|
||||
merchantTitle: '商户',
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$route' () {
|
||||
this.tableFrom.merchant_type = this.$route.meta.merchant_type || 0;
|
||||
},
|
||||
'tableFrom.merchant_type' () {
|
||||
this.getHeadNum();
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
this.merchantTitle = merchantTypeText(this.tableFrom.merchant_type);
|
||||
this.headeNum[0].title = '正常开启的' + this.merchantTitle;
|
||||
this.headeNum[1].title = '已关闭' + this.merchantTitle;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getHeadNum();
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
this.tableFrom.merchant_type = this.$route.meta.merchant_type || 0;
|
||||
},
|
||||
methods: {
|
||||
onLogo(id) {
|
||||
|
|
@ -300,7 +315,7 @@ export default {
|
|||
},
|
||||
// 获取开启商户数
|
||||
getHeadNum() {
|
||||
merchantCountApi()
|
||||
merchantCountApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.headeNum[0]["count"] = res.data.valid;
|
||||
this.headeNum[1]["count"] = res.data.invalid;
|
||||
|
|
@ -347,7 +362,7 @@ export default {
|
|||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
const title = row.is_best === 0 ? "是否开启推荐商户" : "是否关闭推荐商户";
|
||||
const title = row.is_best === 0 ? ("是否开启推荐" + this.merchantTitle) : ("是否关闭推荐" + this.merchantTitle);
|
||||
this.$modalSure(title).then(() => {
|
||||
merchantStatuseApi(row.mer_id, row.is_best === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
|
|
|
|||
|
|
@ -1,379 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="display: inline-block">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn,indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字:" label-width="80px" style="display: inline-block;">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入店铺关键字/店铺名/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-tabs v-if="headeNum.length > 0" v-model="tableFrom.status" @tab-click="getList(1),getHeadNum()">
|
||||
<el-tab-pane
|
||||
v-for="(item,index) in headeNum"
|
||||
:key="index"
|
||||
:name="item.type.toString()"
|
||||
:label="item.title +'('+item.count +')' "
|
||||
/>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="onAdd">添加门店</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData.data"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
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">
|
||||
<el-switch
|
||||
v-model="scope.row.is_best"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
disabled
|
||||
@click.native="onchangeIsShow(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="开启/关闭" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
disabled
|
||||
@click.native="onchangeIsClose(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="150" />
|
||||
<el-table-column prop="margin" label="保证金" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" min-width="100" />
|
||||
<el-table-column prop="mark" label="备注" min-width="200" />
|
||||
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <router-link
|
||||
v-if="tableFrom.status === '1'"
|
||||
:to="{path: roterPre+ '/merchant/list/reconciliation/' + scope.row.mer_id + '/1' }"
|
||||
>
|
||||
<el-button type="text" size="small" class="mr10">对账</el-button>
|
||||
</router-link> -->
|
||||
<el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onLogo(scope.row.mer_id)"
|
||||
>登录</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_id)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="onDetails(scope.row.mer_id)">详情</el-button>
|
||||
<el-button
|
||||
v-if="tableFrom.status === '0'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleDelete(scope.row.mer_id, scope.$index)"
|
||||
>删除</el-button>
|
||||
<!-- <el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onDeduct(scope.row.mer_id)"
|
||||
>扣除保证金</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--门店详情-->
|
||||
<mer-detail
|
||||
ref="merDetail"
|
||||
:merId="merId"
|
||||
@closeDrawer="closeDrawer"
|
||||
@changeDrawer="changeDrawer"
|
||||
@onPassword="onPassword"
|
||||
@handleTimes="handleTimes"
|
||||
@getList="getList"
|
||||
:drawer="drawer"
|
||||
:defaultMerchantType="5"
|
||||
></mer-detail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {
|
||||
merchantListApi,
|
||||
merchantCreateApi,
|
||||
merchantUpdateApi,
|
||||
merchantDeleteForm,
|
||||
merchantStatuseApi,
|
||||
merchantPasswordApi,
|
||||
merchantLoginApi,
|
||||
changeCopyApi,
|
||||
merchantCountApi,
|
||||
merchantIsCloseApi,
|
||||
getstoreTypeApi,
|
||||
getMerCateApi, marginDeductionForm
|
||||
} from "@/api/merchant";
|
||||
import merDetail from './handle/merDetails.vue';
|
||||
import { fromList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
import SettingMer from "@/libs/settingMer";
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
name: "MerchantList",
|
||||
components: { merDetail },
|
||||
data() {
|
||||
return {
|
||||
fromList: fromList,
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
headeNum: [
|
||||
{
|
||||
count: '',
|
||||
type: "1",
|
||||
title: "正常开启的门店"
|
||||
},
|
||||
{
|
||||
count: '',
|
||||
type: "0",
|
||||
title: "已关闭门店"
|
||||
}
|
||||
],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: "1",
|
||||
keyword: "",
|
||||
is_trader: "",
|
||||
is_best: "",
|
||||
category_id: '',
|
||||
type_id: "",
|
||||
merchant_type: 5
|
||||
},
|
||||
autoUpdate: true,
|
||||
merId: "",
|
||||
drawer: false,
|
||||
timeVal: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.getHeadNum();
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
onLogo(id) {
|
||||
merchantLoginApi(id)
|
||||
.then(res => {
|
||||
Cookies.set("merchantToken", res.data.token);
|
||||
window.open(SettingMer.httpUrl + res.data.url);
|
||||
})
|
||||
.catch(res => {
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 获取开启门店数
|
||||
getHeadNum() {
|
||||
merchantCountApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.headeNum[0]["count"] = res.data.valid;
|
||||
this.headeNum[1]["count"] = res.data.invalid;
|
||||
})
|
||||
.catch(res => {});
|
||||
},
|
||||
// 门店分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
merchantListApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
this.getHeadNum();
|
||||
})
|
||||
.catch(res => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
const title = row.is_best === 0 ? "是否开启推荐门店" : "是否关闭推荐门店";
|
||||
this.$modalSure(title).then(() => {
|
||||
merchantStatuseApi(row.mer_id, row.is_best === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 开启关闭
|
||||
onchangeIsClose(row) {
|
||||
merchantIsCloseApi(row.mer_id, row.status === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
onAdd() {
|
||||
// this.$modalForm(merchantCreateApi()).then(() => this.getList(""));
|
||||
this.drawer = true;
|
||||
this.$refs.merDetail.initData();
|
||||
|
||||
|
||||
},
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = true;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
|
||||
},
|
||||
// 详情
|
||||
onDetails(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = false;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
},
|
||||
changeDrawer(v) {
|
||||
this.drawer = v;
|
||||
},
|
||||
closeDrawer() {
|
||||
this.drawer = false;
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$modalForm(merchantDeleteForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 扣除保证金
|
||||
onDeduct(id) {
|
||||
this.$modalForm(marginDeductionForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 设置复制次数
|
||||
handleTimes(id) {
|
||||
this.$modalForm(changeCopyApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
|
||||
// 修改密码表单
|
||||
onPassword(id) {
|
||||
this.$modalForm(merchantPasswordApi(id));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
|
@ -1,383 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="display: inline-block">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn,indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字:" label-width="80px" style="display: inline-block;">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入店铺关键字/店铺名/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-tabs v-if="headeNum.length > 0" v-model="tableFrom.status" @tab-click="getList(1),getHeadNum()">
|
||||
<el-tab-pane
|
||||
v-for="(item,index) in headeNum"
|
||||
:key="index"
|
||||
:name="item.type.toString()"
|
||||
:label="item.title +'('+item.count +')' "
|
||||
/>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="onAdd">添加酒道馆</el-button>
|
||||
</div>
|
||||
<el-table v-loading="listLoading" :data="tableData.data" style="width: 100%" size="small" highlight-current-row class="switchTable">
|
||||
<el-table-column prop="mer_id" label="ID" min-width="60" align="center"/>
|
||||
<el-table-column prop="mer_name" label="酒道馆名称" min-width="150" align="center"/>
|
||||
<el-table-column prop="real_name" label="联系人" min-width="100" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.real_name }}<br />
|
||||
{{ scope.row.mer_phone }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="是否推荐" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.is_best"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
disabled
|
||||
@click.native="onchangeIsShow(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="状态" min-width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
disabled
|
||||
@click.native="onchangeIsClose(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="140" align="center"/>
|
||||
<el-table-column prop="margin" label="保证金" min-width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" min-width="60" align="center"/>
|
||||
<el-table-column prop="status" label="关联商户" min-width="150" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.merShop ? (scope.row.merShop.mer_name || '') : ''}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<template slot-scope="scope">
|
||||
<!-- <router-link
|
||||
v-if="tableFrom.status === '1'"
|
||||
:to="{path: roterPre+ '/merchant/list/reconciliation/' + scope.row.mer_id + '/1' }"
|
||||
>
|
||||
<el-button type="text" size="small" class="mr10">对账</el-button>
|
||||
</router-link> -->
|
||||
<el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onLogo(scope.row.mer_id)"
|
||||
>登录</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_id)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="onDetails(scope.row.mer_id)">详情</el-button>
|
||||
<el-button
|
||||
v-if="tableFrom.status === '0'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleDelete(scope.row.mer_id, scope.$index)"
|
||||
>删除</el-button>
|
||||
<!-- <el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onDeduct(scope.row.mer_id)"
|
||||
>扣除保证金</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--酒道馆详情-->
|
||||
<mer-detail
|
||||
ref="merDetail"
|
||||
:merId="merId"
|
||||
@closeDrawer="closeDrawer"
|
||||
@changeDrawer="changeDrawer"
|
||||
@onPassword="onPassword"
|
||||
@handleTimes="handleTimes"
|
||||
@getList="getList"
|
||||
:drawer="drawer"
|
||||
:defaultMerchantType="1"
|
||||
></mer-detail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {
|
||||
merchantListApi,
|
||||
merchantCreateApi,
|
||||
merchantUpdateApi,
|
||||
merchantDeleteForm,
|
||||
merchantStatuseApi,
|
||||
merchantPasswordApi,
|
||||
merchantLoginApi,
|
||||
changeCopyApi,
|
||||
merchantCountApi,
|
||||
merchantIsCloseApi,
|
||||
getstoreTypeApi,
|
||||
getMerCateApi, marginDeductionForm
|
||||
} from "@/api/merchant";
|
||||
import merDetail from './handle/merDetails.vue';
|
||||
import { fromList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
import SettingMer from "@/libs/settingMer";
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
name: "MerchantList",
|
||||
components: { merDetail },
|
||||
data() {
|
||||
return {
|
||||
fromList: fromList,
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
headeNum: [
|
||||
{
|
||||
count: '',
|
||||
type: "1",
|
||||
title: "正常开启的酒道馆"
|
||||
},
|
||||
{
|
||||
count: '',
|
||||
type: "0",
|
||||
title: "已关闭酒道馆"
|
||||
}
|
||||
],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: "1",
|
||||
keyword: "",
|
||||
is_trader: "",
|
||||
is_best: "",
|
||||
category_id: '',
|
||||
type_id: "",
|
||||
merchant_type: 1
|
||||
},
|
||||
autoUpdate: true,
|
||||
merId: "",
|
||||
drawer: false,
|
||||
timeVal: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getHeadNum();
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
onLogo(id) {
|
||||
merchantLoginApi(id)
|
||||
.then(res => {
|
||||
Cookies.set("merchantToken", res.data.token);
|
||||
window.open(SettingMer.httpUrl + res.data.url);
|
||||
})
|
||||
.catch(res => {
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 获取开启酒道馆数
|
||||
getHeadNum() {
|
||||
merchantCountApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.headeNum[0]["count"] = res.data.valid;
|
||||
this.headeNum[1]["count"] = res.data.invalid;
|
||||
})
|
||||
.catch(res => {});
|
||||
},
|
||||
// 酒道馆分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
merchantListApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch(res => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
const title = row.is_best === 0 ? "是否开启推荐酒道馆" : "是否关闭推荐酒道馆";
|
||||
this.$modalSure(title).then(() => {
|
||||
merchantStatuseApi(row.mer_id, row.is_best === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 开启关闭
|
||||
onchangeIsClose(row) {
|
||||
merchantIsCloseApi(row.mer_id, row.status === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
onAdd() {
|
||||
// this.$modalForm(merchantCreateApi()).then(() => this.getList(""));
|
||||
this.drawer = true;
|
||||
this.$refs.merDetail.initData();
|
||||
|
||||
|
||||
},
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = true;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
|
||||
},
|
||||
// 详情
|
||||
onDetails(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = false;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
},
|
||||
changeDrawer(v) {
|
||||
this.drawer = v;
|
||||
},
|
||||
closeDrawer() {
|
||||
this.drawer = false;
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$modalForm(merchantDeleteForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 扣除保证金
|
||||
onDeduct(id) {
|
||||
this.$modalForm(marginDeductionForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 设置复制次数
|
||||
handleTimes(id) {
|
||||
this.$modalForm(changeCopyApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
|
||||
// 修改密码表单
|
||||
onPassword(id) {
|
||||
this.$modalForm(merchantPasswordApi(id));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
|
@ -1,378 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="display: inline-block">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn,indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字:" label-width="80px" style="display: inline-block;">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入店铺关键字/店铺名/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-tabs v-if="headeNum.length > 0" v-model="tableFrom.status" @tab-click="getList(1),getHeadNum()">
|
||||
<el-tab-pane
|
||||
v-for="(item,index) in headeNum"
|
||||
:key="index"
|
||||
:name="item.type.toString()"
|
||||
:label="item.title +'('+item.count +')' "
|
||||
/>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="onAdd">添加烟酒店</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData.data"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
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">
|
||||
<el-switch
|
||||
v-model="scope.row.is_best"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
disabled
|
||||
@click.native="onchangeIsShow(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="开启/关闭" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
disabled
|
||||
@click.native="onchangeIsClose(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="150" />
|
||||
<el-table-column prop="margin" label="保证金" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" min-width="100" />
|
||||
<el-table-column prop="mark" label="备注" min-width="200" />
|
||||
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <router-link
|
||||
v-if="tableFrom.status === '1'"
|
||||
:to="{path: roterPre+ '/merchant/list/reconciliation/' + scope.row.mer_id + '/1' }"
|
||||
>
|
||||
<el-button type="text" size="small" class="mr10">对账</el-button>
|
||||
</router-link> -->
|
||||
<el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onLogo(scope.row.mer_id)"
|
||||
>登录</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_id)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="onDetails(scope.row.mer_id)">详情</el-button>
|
||||
<el-button
|
||||
v-if="tableFrom.status === '0'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleDelete(scope.row.mer_id, scope.$index)"
|
||||
>删除</el-button>
|
||||
<!-- <el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onDeduct(scope.row.mer_id)"
|
||||
>扣除保证金</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--烟酒店详情-->
|
||||
<mer-detail
|
||||
ref="merDetail"
|
||||
:merId="merId"
|
||||
@closeDrawer="closeDrawer"
|
||||
@changeDrawer="changeDrawer"
|
||||
@onPassword="onPassword"
|
||||
@handleTimes="handleTimes"
|
||||
@getList="getList"
|
||||
:drawer="drawer"
|
||||
:defaultMerchantType="3"
|
||||
></mer-detail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {
|
||||
merchantListApi,
|
||||
merchantCreateApi,
|
||||
merchantUpdateApi,
|
||||
merchantDeleteForm,
|
||||
merchantStatuseApi,
|
||||
merchantPasswordApi,
|
||||
merchantLoginApi,
|
||||
changeCopyApi,
|
||||
merchantCountApi,
|
||||
merchantIsCloseApi,
|
||||
getstoreTypeApi,
|
||||
getMerCateApi, marginDeductionForm
|
||||
} from "@/api/merchant";
|
||||
import merDetail from './handle/merDetails.vue';
|
||||
import { fromList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
import SettingMer from "@/libs/settingMer";
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
name: "MerchantList",
|
||||
components: { merDetail },
|
||||
data() {
|
||||
return {
|
||||
fromList: fromList,
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
headeNum: [
|
||||
{
|
||||
count: '',
|
||||
type: "1",
|
||||
title: "正常开启的烟酒店"
|
||||
},
|
||||
{
|
||||
count: '',
|
||||
type: "0",
|
||||
title: "已关闭烟酒店"
|
||||
}
|
||||
],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: "1",
|
||||
keyword: "",
|
||||
is_trader: "",
|
||||
is_best: "",
|
||||
category_id: '',
|
||||
type_id: "",
|
||||
merchant_type: 3
|
||||
},
|
||||
autoUpdate: true,
|
||||
merId: "",
|
||||
drawer: false,
|
||||
timeVal: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getHeadNum();
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
onLogo(id) {
|
||||
merchantLoginApi(id)
|
||||
.then(res => {
|
||||
Cookies.set("merchantToken", res.data.token);
|
||||
window.open(SettingMer.httpUrl + res.data.url);
|
||||
})
|
||||
.catch(res => {
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 获取开启烟酒店数
|
||||
getHeadNum() {
|
||||
merchantCountApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.headeNum[0]["count"] = res.data.valid;
|
||||
this.headeNum[1]["count"] = res.data.invalid;
|
||||
})
|
||||
.catch(res => {});
|
||||
},
|
||||
// 烟酒店分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
merchantListApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch(res => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
const title = row.is_best === 0 ? "是否开启推荐烟酒店" : "是否关闭推荐烟酒店";
|
||||
this.$modalSure(title).then(() => {
|
||||
merchantStatuseApi(row.mer_id, row.is_best === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 开启关闭
|
||||
onchangeIsClose(row) {
|
||||
merchantIsCloseApi(row.mer_id, row.status === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
onAdd() {
|
||||
// this.$modalForm(merchantCreateApi()).then(() => this.getList(""));
|
||||
this.drawer = true;
|
||||
this.$refs.merDetail.initData();
|
||||
|
||||
|
||||
},
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = true;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
|
||||
},
|
||||
// 详情
|
||||
onDetails(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = false;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
},
|
||||
changeDrawer(v) {
|
||||
this.drawer = v;
|
||||
},
|
||||
closeDrawer() {
|
||||
this.drawer = false;
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$modalForm(merchantDeleteForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 扣除保证金
|
||||
onDeduct(id) {
|
||||
this.$modalForm(marginDeductionForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 设置复制次数
|
||||
handleTimes(id) {
|
||||
this.$modalForm(changeCopyApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
|
||||
// 修改密码表单
|
||||
onPassword(id) {
|
||||
this.$modalForm(merchantPasswordApi(id));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
|
@ -1,378 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="display: inline-block">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn,indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字:" label-width="80px" style="display: inline-block;">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入店铺关键字/店铺名/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-tabs v-if="headeNum.length > 0" v-model="tableFrom.status" @tab-click="getList(1),getHeadNum()">
|
||||
<el-tab-pane
|
||||
v-for="(item,index) in headeNum"
|
||||
:key="index"
|
||||
:name="item.type.toString()"
|
||||
:label="item.title +'('+item.count +')' "
|
||||
/>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="onAdd">添加超市</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData.data"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
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">
|
||||
<el-switch
|
||||
v-model="scope.row.is_best"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
disabled
|
||||
@click.native="onchangeIsShow(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="开启/关闭" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
disabled
|
||||
@click.native="onchangeIsClose(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="150" />
|
||||
<el-table-column prop="margin" label="保证金" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" min-width="100" />
|
||||
<el-table-column prop="mark" label="备注" min-width="200" />
|
||||
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <router-link
|
||||
v-if="tableFrom.status === '1'"
|
||||
:to="{path: roterPre+ '/merchant/list/reconciliation/' + scope.row.mer_id + '/1' }"
|
||||
>
|
||||
<el-button type="text" size="small" class="mr10">对账</el-button>
|
||||
</router-link> -->
|
||||
<el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onLogo(scope.row.mer_id)"
|
||||
>登录</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_id)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="onDetails(scope.row.mer_id)">详情</el-button>
|
||||
<el-button
|
||||
v-if="tableFrom.status === '0'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleDelete(scope.row.mer_id, scope.$index)"
|
||||
>删除</el-button>
|
||||
<!-- <el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onDeduct(scope.row.mer_id)"
|
||||
>扣除保证金</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--超市详情-->
|
||||
<mer-detail
|
||||
ref="merDetail"
|
||||
:merId="merId"
|
||||
@closeDrawer="closeDrawer"
|
||||
@changeDrawer="changeDrawer"
|
||||
@onPassword="onPassword"
|
||||
@handleTimes="handleTimes"
|
||||
@getList="getList"
|
||||
:drawer="drawer"
|
||||
:defaultMerchantType="4"
|
||||
></mer-detail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {
|
||||
merchantListApi,
|
||||
merchantCreateApi,
|
||||
merchantUpdateApi,
|
||||
merchantDeleteForm,
|
||||
merchantStatuseApi,
|
||||
merchantPasswordApi,
|
||||
merchantLoginApi,
|
||||
changeCopyApi,
|
||||
merchantCountApi,
|
||||
merchantIsCloseApi,
|
||||
getstoreTypeApi,
|
||||
getMerCateApi, marginDeductionForm
|
||||
} from "@/api/merchant";
|
||||
import merDetail from './handle/merDetails.vue';
|
||||
import { fromList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
import SettingMer from "@/libs/settingMer";
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
name: "MerchantList",
|
||||
components: { merDetail },
|
||||
data() {
|
||||
return {
|
||||
fromList: fromList,
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
headeNum: [
|
||||
{
|
||||
count: '',
|
||||
type: "1",
|
||||
title: "正常开启的超市"
|
||||
},
|
||||
{
|
||||
count: '',
|
||||
type: "0",
|
||||
title: "已关闭超市"
|
||||
}
|
||||
],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: "1",
|
||||
keyword: "",
|
||||
is_trader: "",
|
||||
is_best: "",
|
||||
category_id: '',
|
||||
type_id: "",
|
||||
merchant_type: 4
|
||||
},
|
||||
autoUpdate: true,
|
||||
merId: "",
|
||||
drawer: false,
|
||||
timeVal: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getHeadNum();
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
onLogo(id) {
|
||||
merchantLoginApi(id)
|
||||
.then(res => {
|
||||
Cookies.set("merchantToken", res.data.token);
|
||||
window.open(SettingMer.httpUrl + res.data.url);
|
||||
})
|
||||
.catch(res => {
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 获取开启超市数
|
||||
getHeadNum() {
|
||||
merchantCountApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.headeNum[0]["count"] = res.data.valid;
|
||||
this.headeNum[1]["count"] = res.data.invalid;
|
||||
})
|
||||
.catch(res => {});
|
||||
},
|
||||
// 超市分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
merchantListApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch(res => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
const title = row.is_best === 0 ? "是否开启推荐超市" : "是否关闭推荐超市";
|
||||
this.$modalSure(title).then(() => {
|
||||
merchantStatuseApi(row.mer_id, row.is_best === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 开启关闭
|
||||
onchangeIsClose(row) {
|
||||
merchantIsCloseApi(row.mer_id, row.status === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
onAdd() {
|
||||
// this.$modalForm(merchantCreateApi()).then(() => this.getList(""));
|
||||
this.drawer = true;
|
||||
this.$refs.merDetail.initData();
|
||||
|
||||
|
||||
},
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = true;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
|
||||
},
|
||||
// 详情
|
||||
onDetails(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = false;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
},
|
||||
changeDrawer(v) {
|
||||
this.drawer = v;
|
||||
},
|
||||
closeDrawer() {
|
||||
this.drawer = false;
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$modalForm(merchantDeleteForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 扣除保证金
|
||||
onDeduct(id) {
|
||||
this.$modalForm(marginDeductionForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 设置复制次数
|
||||
handleTimes(id) {
|
||||
this.$modalForm(changeCopyApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
|
||||
// 修改密码表单
|
||||
onPassword(id) {
|
||||
this.$modalForm(merchantPasswordApi(id));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
|
|
@ -1,378 +0,0 @@
|
|||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form size="small" label-width="100px" :inline="true">
|
||||
<el-form-item label="选择时间:" style="display: inline-block">
|
||||
<el-radio-group
|
||||
v-model="tableFrom.date"
|
||||
size="small"
|
||||
@change="selectChange(tableFrom.date)"
|
||||
>
|
||||
<el-radio-button
|
||||
v-for="(itemn,indexn) in fromList.fromTxt"
|
||||
:key="indexn"
|
||||
:label="itemn.val"
|
||||
>{{ itemn.text }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-date-picker
|
||||
v-model="timeVal"
|
||||
type="daterange"
|
||||
placeholder="选择日期"
|
||||
format="yyyy/MM/dd"
|
||||
value-format="yyyy/MM/dd"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="onchangeTime"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字:" label-width="80px" style="display: inline-block;">
|
||||
<el-input
|
||||
v-model="tableFrom.keyword"
|
||||
@keyup.enter.native="getList(1)"
|
||||
placeholder="请输入店铺关键字/店铺名/联系电话"
|
||||
class="selWidth"
|
||||
>
|
||||
<el-button slot="append" icon="el-icon-search" class="el-button-solt" @click="getList(1)" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-tabs v-if="headeNum.length > 0" v-model="tableFrom.status" @tab-click="getList(1),getHeadNum()">
|
||||
<el-tab-pane
|
||||
v-for="(item,index) in headeNum"
|
||||
:key="index"
|
||||
:name="item.type.toString()"
|
||||
:label="item.title +'('+item.count +')' "
|
||||
/>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-button size="small" type="primary" @click="onAdd">添加供应商</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="tableData.data"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
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">
|
||||
<el-switch
|
||||
v-model="scope.row.is_best"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
disabled
|
||||
@click.native="onchangeIsShow(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="status" label="开启/关闭" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
active-text="开启"
|
||||
inactive-text="关闭"
|
||||
disabled
|
||||
@click.native="onchangeIsClose(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建时间" min-width="150" />
|
||||
<el-table-column prop="margin" label="保证金" min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" min-width="100" />
|
||||
<el-table-column prop="mark" label="备注" min-width="200" />
|
||||
|
||||
<el-table-column label="操作" min-width="150" fixed="right" align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <router-link
|
||||
v-if="tableFrom.status === '1'"
|
||||
:to="{path: roterPre+ '/merchant/list/reconciliation/' + scope.row.mer_id + '/1' }"
|
||||
>
|
||||
<el-button type="text" size="small" class="mr10">对账</el-button>
|
||||
</router-link> -->
|
||||
<el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onLogo(scope.row.mer_id)"
|
||||
>登录</el-button>
|
||||
<el-button type="text" size="small" @click="onEdit(scope.row.mer_id)">编辑</el-button>
|
||||
<el-button type="text" size="small" @click="onDetails(scope.row.mer_id)">详情</el-button>
|
||||
<el-button
|
||||
v-if="tableFrom.status === '0'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleDelete(scope.row.mer_id, scope.$index)"
|
||||
>删除</el-button>
|
||||
<!-- <el-button
|
||||
v-if="tableFrom.status === '1'"
|
||||
type="text"
|
||||
size="small"
|
||||
@click="onDeduct(scope.row.mer_id)"
|
||||
>扣除保证金</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block">
|
||||
<el-pagination
|
||||
:page-sizes="[20, 40, 60, 80]"
|
||||
:page-size="tableFrom.limit"
|
||||
:current-page="tableFrom.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<!--供应商详情-->
|
||||
<mer-detail
|
||||
ref="merDetail"
|
||||
:merId="merId"
|
||||
@closeDrawer="closeDrawer"
|
||||
@changeDrawer="changeDrawer"
|
||||
@onPassword="onPassword"
|
||||
@handleTimes="handleTimes"
|
||||
@getList="getList"
|
||||
:drawer="drawer"
|
||||
:defaultMerchantType="2"
|
||||
></mer-detail>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {
|
||||
merchantListApi,
|
||||
merchantCreateApi,
|
||||
merchantUpdateApi,
|
||||
merchantDeleteForm,
|
||||
merchantStatuseApi,
|
||||
merchantPasswordApi,
|
||||
merchantLoginApi,
|
||||
changeCopyApi,
|
||||
merchantCountApi,
|
||||
merchantIsCloseApi,
|
||||
getstoreTypeApi,
|
||||
getMerCateApi, marginDeductionForm
|
||||
} from "@/api/merchant";
|
||||
import merDetail from './handle/merDetails.vue';
|
||||
import { fromList } from "@/libs/constants.js";
|
||||
import { roterPre } from "@/settings";
|
||||
import SettingMer from "@/libs/settingMer";
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
name: "MerchantList",
|
||||
components: { merDetail },
|
||||
data() {
|
||||
return {
|
||||
fromList: fromList,
|
||||
roterPre: roterPre,
|
||||
isChecked: false,
|
||||
listLoading: true,
|
||||
merCateList: [],
|
||||
storeType: [],
|
||||
headeNum: [
|
||||
{
|
||||
count: '',
|
||||
type: "1",
|
||||
title: "正常开启的供应商"
|
||||
},
|
||||
{
|
||||
count: '',
|
||||
type: "0",
|
||||
title: "已关闭供应商"
|
||||
}
|
||||
],
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0
|
||||
},
|
||||
tableFrom: {
|
||||
page: 1,
|
||||
limit: 20,
|
||||
date: "",
|
||||
status: "1",
|
||||
keyword: "",
|
||||
is_trader: "",
|
||||
is_best: "",
|
||||
category_id: '',
|
||||
type_id: "",
|
||||
merchant_type: 2
|
||||
},
|
||||
autoUpdate: true,
|
||||
merId: "",
|
||||
drawer: false,
|
||||
timeVal: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getHeadNum();
|
||||
this.getMerCategory();
|
||||
this.getStoreType();
|
||||
this.getList("");
|
||||
},
|
||||
methods: {
|
||||
onLogo(id) {
|
||||
merchantLoginApi(id)
|
||||
.then(res => {
|
||||
Cookies.set("merchantToken", res.data.token);
|
||||
window.open(SettingMer.httpUrl + res.data.url);
|
||||
})
|
||||
.catch(res => {
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
// 选择时间
|
||||
selectChange(tab) {
|
||||
this.tableFrom.date = tab;
|
||||
this.timeVal = [];
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 具体日期
|
||||
onchangeTime(e) {
|
||||
this.timeVal = e;
|
||||
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
|
||||
this.tableFrom.page = 1;
|
||||
this.getList("");
|
||||
},
|
||||
// 获取开启供应商数
|
||||
getHeadNum() {
|
||||
merchantCountApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.headeNum[0]["count"] = res.data.valid;
|
||||
this.headeNum[1]["count"] = res.data.invalid;
|
||||
})
|
||||
.catch(res => {});
|
||||
},
|
||||
// 供应商分类;
|
||||
getMerCategory() {
|
||||
getMerCateApi().then(res => {
|
||||
this.merCateList = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
getStoreType(){
|
||||
getstoreTypeApi().then(res => {
|
||||
this.storeType = res.data
|
||||
}).catch(res => {
|
||||
this.$message.error(res.message)
|
||||
})
|
||||
},
|
||||
// 列表
|
||||
getList(num) {
|
||||
this.listLoading = true;
|
||||
this.tableFrom.page = num ? num : this.tableFrom.page;
|
||||
merchantListApi(this.tableFrom)
|
||||
.then(res => {
|
||||
this.tableData.data = res.data.list;
|
||||
this.tableData.total = res.data.count;
|
||||
this.listLoading = false;
|
||||
})
|
||||
.catch(res => {
|
||||
this.listLoading = false;
|
||||
this.$message.error(res.message);
|
||||
});
|
||||
},
|
||||
pageChange(page) {
|
||||
this.tableFrom.page = page;
|
||||
this.getList("");
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.tableFrom.limit = val;
|
||||
this.getList(1);
|
||||
},
|
||||
// 修改状态
|
||||
onchangeIsShow(row) {
|
||||
const title = row.is_best === 0 ? "是否开启推荐供应商" : "是否关闭推荐供应商";
|
||||
this.$modalSure(title).then(() => {
|
||||
merchantStatuseApi(row.mer_id, row.is_best === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
});
|
||||
},
|
||||
// 开启关闭
|
||||
onchangeIsClose(row) {
|
||||
merchantIsCloseApi(row.mer_id, row.status === 1 ? 0 : 1)
|
||||
.then(({ message }) => {
|
||||
this.$message.success(message);
|
||||
this.getList("");
|
||||
})
|
||||
.catch(({ message }) => {
|
||||
this.$message.error(message);
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
onAdd() {
|
||||
// this.$modalForm(merchantCreateApi()).then(() => this.getList(""));
|
||||
this.drawer = true;
|
||||
this.$refs.merDetail.initData();
|
||||
|
||||
|
||||
},
|
||||
// 编辑
|
||||
onEdit(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = true;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
|
||||
},
|
||||
// 详情
|
||||
onDetails(id) {
|
||||
this.merId = id;
|
||||
this.$refs.merDetail.isEdit = false;
|
||||
this.$refs.merDetail.getInfo(id);
|
||||
this.drawer = true;
|
||||
},
|
||||
changeDrawer(v) {
|
||||
this.drawer = v;
|
||||
},
|
||||
closeDrawer() {
|
||||
this.drawer = false;
|
||||
},
|
||||
// 删除
|
||||
handleDelete(id) {
|
||||
this.$modalForm(merchantDeleteForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 扣除保证金
|
||||
onDeduct(id) {
|
||||
this.$modalForm(marginDeductionForm(id)).then(() => this.getList(""));
|
||||
},
|
||||
// 设置复制次数
|
||||
handleTimes(id) {
|
||||
this.$modalForm(changeCopyApi(id)).then(() => this.getList(""));
|
||||
},
|
||||
|
||||
// 修改密码表单
|
||||
onPassword(id) {
|
||||
this.$modalForm(merchantPasswordApi(id));
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
</style>
|
||||
Loading…
Reference in New Issue