Commit 09312624 by 张权

显示操作列

1 parent 96185c5a
<template>
<div class="equity-wrap">
<template if="showTableOperate">
<GLButton fn="开通配置" class="addGood" type="primary" icon="el-icon-plus" @click="jump('add')">开通配置</GLButton>
<!-- <el-button fn="开通配置" class="addGood" type="primary" icon="el-icon-plus" @click="jump('add')">开通配置</el-button> -->
<div class="equity-wrap contain merchant-select">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="85px" label-position="right">
<el-row>
<el-form-item size="small" label="">
<el-input placeholder="请输入内容" v-model="selectInput" class="input-with-select">
<el-select v-model="select" slot="prepend" placeholder="请选择">
<el-option label="商户名称" value="1"></el-option>
<el-option label="商户号" value="2"></el-option>
</el-select>
</el-input>
</el-form-item>
<el-form-item class="open-status" size="small" label="开通状态" style="margin-left: -10px">
<el-select size="small" v-model="openFlag">
<el-option v-for="item in openFlagList" :key="item.value" :label="item.label" :value="item.value"></el-option>
<GLButton fn="开通配置" class="addGood" type="primary" icon="el-icon-plus" @click="jump('add')">开通配置</GLButton>
<!-- <el-button fn="开通配置" class="addGood" type="primary" icon="el-icon-plus" @click="jump('add')">开通配置</el-button> -->
<div class="equity-wrap contain merchant-select">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="85px" label-position="right">
<el-row>
<el-form-item size="small" label="">
<el-input placeholder="请输入内容" v-model="selectInput" class="input-with-select">
<el-select v-model="select" slot="prepend" placeholder="请选择">
<el-option label="商户名称" value="1"></el-option>
<el-option label="商户号" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" class="fr-mr0">
<el-button size="small" @click="selConfig('reset')">重置</el-button>
<el-button size="small" type="primary" @click="selConfig">查询</el-button>
<el-button size="small" @click="exportTable">导出</el-button>
</el-form-item>
</el-row>
</el-form>
<div class="row-btns" style="margin-top: 20px">
<!-- <el-button size="small" @click="toggleAll">全选</el-button> -->
<!-- <el-checkbox v-model="checkbox" @change="toggleAll" style="margin-left:20px">全选</el-checkbox> -->
<div style="float: right">
<el-button size="small" @click="batchOperation(1)">批量开通</el-button>
<el-button size="small" @click="batchOperation(2)">批量关闭</el-button>
</div>
</el-input>
</el-form-item>
<el-form-item class="open-status" size="small" label="开通状态" style="margin-left: -10px">
<el-select size="small" v-model="openFlag">
<el-option v-for="item in openFlagList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" class="fr-mr0">
<el-button size="small" @click="selConfig('reset')">重置</el-button>
<el-button size="small" type="primary" @click="selConfig">查询</el-button>
<el-button size="small" @click="exportTable">导出</el-button>
</el-form-item>
</el-row>
</el-form>
<div class="row-btns" style="margin-top: 20px">
<!-- <el-button size="small" @click="toggleAll">全选</el-button> -->
<!-- <el-checkbox v-model="checkbox" @change="toggleAll" style="margin-left:20px">全选</el-checkbox> -->
<div style="float: right">
<el-button size="small" @click="batchOperation(1)">批量开通</el-button>
<el-button size="small" @click="batchOperation(2)">批量关闭</el-button>
</div>
<GLTable v-if="flag" ref="table" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :getListApi="getConfigList" :beforeSearchFn="check">
<span slot="operate" slot-scope="scope">
<GLButton fn="修改配置" type="text" @click="jump(scope.scope.merchantId)">修改配置</GLButton>
<!-- <el-button fn="修改配置" type="text" @click="jump(scope.scope.merchantId)">修改配置</el-button> -->
</span>
<span slot="openFlag" slot-scope="scope">
<el-switch :value="scope.scope.openFlag == 1" active-color="#5850ff" inactive-color="#eee" @change="changStatus(scope.scope.openFlag, scope.scope.id)"></el-switch>
</span>
</GLTable>
</div>
</template>
<GLTable v-if="flag" ref="table" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :getListApi="getConfigList" :beforeSearchFn="check">
<span slot="operate" slot-scope="scope">
<GLButton fn="修改配置" type="text" @click="jump(scope.scope.merchantId)">修改配置</GLButton>
<!-- <el-button fn="修改配置" type="text" @click="jump(scope.scope.merchantId)">修改配置</el-button> -->
</span>
<span slot="openFlag" slot-scope="scope">
<el-switch :value="scope.scope.openFlag == 1" active-color="#5850ff" inactive-color="#eee" @change="changStatus(scope.scope.openFlag, scope.scope.id)"></el-switch>
</span>
</GLTable>
</div>
</div>
</template>
......@@ -110,84 +108,7 @@ export default {
value: '0'
}
],
tableParams: {},
goodsBrandList: [],
selectStatus: false
}
},
mounted() {
},
created(){
// this.diffHost()
this.tableColData()
},
methods: {
// 区分滴加和广汇
diffHost(){
let href = window.location.host;
// 从域名判断是不是广汇的
let gxurl1 = 'http://scrm.cgacar.com'
let gxurl2 = 'https://scrm.cgacar.com'
if (href == gxurl1 || href == gxurl2) {
this.showGh = true
}else{
this.showGh = false
}
},
tableColData(){
const tableParams = {
listName: 'list',
mutiSelectName: 'configIndex',
mutiSelectUniqueKey: 'id',
tableOption: false,
tableColumns: [
{
label: '商户名称',
prop: 'merchantName'
},
{
label: '商户号',
prop: 'merchantId'
},
{
label: '状态',
prop: 'openFlag',
formatter: cell => {
return cell.openFlag == 0 ? '未开通' : '已开通'
}
},
{
prop: 'createdDate',
label: '开通时间',
formatter: cellValue => {
return this.date_format(cellValue.createdDate)
}
},
{
label: '操作人',
prop: 'updatedBy'
},
// {
// label: '操作',
// minWidth: '200',
// addHtml: 'operate'
// },
{
label: '开通开关',
addHtml: 'openFlag',
formatter: cellValue => {
if (cellValue.openFlag == '1') {
return true
} else {
return false
}
}
}
]
}
const tableParamsOperate = {
tableParams: {
listName: 'list',
mutiSelectName: 'configIndex',
mutiSelectUniqueKey: 'id',
......@@ -236,9 +157,28 @@ export default {
}
}
]
},
goodsBrandList: [],
selectStatus: false
}
},
mounted() {
},
created(){
},
methods: {
// 区分滴加和广汇
diffHost(){
let href = window.location.host;
// 从域名判断是不是广汇的
let gxurl1 = 'http://scrm.cgacar.com'
let gxurl2 = 'https://scrm.cgacar.com'
if (href == gxurl1 || href == gxurl2) {
this.showGh = true
}else{
this.showGh = false
}
this.tableParams = this.showGh ? tableParams : tableParamsOperate
this.showTableOperate = true;
},
check() {
return new Promise((resolve, reject) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!