Commit 9aa7c14c by chenwq

feat(商户): 添加getMerchantList1接口并优化商户选择组件

- 在common.js中添加新的商户列表接口getMerchantList1
- 修改selectStore.vue组件使用新接口并优化表单重置逻辑
- 在userDetail.vue中注释掉详情按钮并调整积分类型显示
- 修复时间格式化显示问题(HH:MM:ss)
1 parent eb77a364
...@@ -9,6 +9,18 @@ const getMerchantList = params => { ...@@ -9,6 +9,18 @@ const getMerchantList = params => {
}) })
} }
const getMerchantList1 = params => {
params.method = 'scrm.api.carlife.merchant.listWithPageByCurMerchant1'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
getMerchantList getMerchantList,
getMerchantList1
} }
\ No newline at end of file \ No newline at end of file
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<GLTable ref="pointTable" :search-form="searchFormSearch" :table-params="tableParams" :get-list-api="getListApi" :pageConf="pageConf" :before-search-fn="beforeSearchFn"> <GLTable ref="pointTable" :search-form="searchFormSearch" :table-params="tableParams" :get-list-api="getListApi" :pageConf="pageConf" :before-search-fn="beforeSearchFn">
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">详情</el-button> <!-- <el-button type="text" @click="handleDetail(scope.scope)">详情</el-button> -->
<el-button type="text" v-if="channelSource == 1 && !scope.scope.relateId && scope.scope.infoName == '手动抵扣'" @click="handleRevocation(scope.scope)">撤销</el-button> <el-button type="text" v-if="channelSource == 1 && !scope.scope.relateId && scope.scope.infoName == '手动抵扣'" @click="handleRevocation(scope.scope)">撤销</el-button>
</div> </div>
</GLTable> </GLTable>
...@@ -129,15 +129,15 @@ export default { ...@@ -129,15 +129,15 @@ export default {
confLabel: "售后返回" confLabel: "售后返回"
}, },
{ {
confId: "购物抵扣", confId: "购物兑换",
confLabel: "购物抵扣" confLabel: "购物兑换"
} }
] ]
}, },
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list", listName: "list",
tableOption: true, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: "积分类型", label: "积分类型",
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
label: "积分变化时间", label: "积分变化时间",
prop: 'updatedTime', prop: 'updatedTime',
formatter: (cell) => { formatter: (cell) => {
return dayjs(cell.updatedTime).format('YYYY-MM-DD HH:MM:SS') return dayjs(cell.updatedTime).format('YYYY-MM-DD HH:MM:ss')
} }
}, },
{ {
...@@ -268,10 +268,10 @@ export default { ...@@ -268,10 +268,10 @@ export default {
}) })
}, },
// 查看详情 // 查看详情
handleDetail(data) { // handleDetail(data) {
this.recordInfo = data // this.recordInfo = data
this.detailVisible = true // this.detailVisible = true
}, // },
//撤销 //撤销
handleRevocation(data) { handleRevocation(data) {
this.recordInfo = data this.recordInfo = data
...@@ -310,8 +310,8 @@ export default { ...@@ -310,8 +310,8 @@ export default {
confLabel: "积分兑换" confLabel: "积分兑换"
}, },
{ {
confId: "购物抵扣", confId: "购物兑换",
confLabel: "购物抵扣" confLabel: "购物兑换"
}, },
{ {
confId: "售后返还", confId: "售后返还",
......
<template> <template>
<GLDialog <GLDialog bigTitle="选择商户" mode="big" :visible.sync="dialogVisible" :before-close="handleClose" :close-on-click-modal="false" @onOk="handleConfirm" @onCancel="handleClose" class="select-store">
bigTitle="选择商户" <glsx-combi-form ref="showSearch" labelWidth="105px" :formObj="searchForm" :formData="searchFormData">
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose"
class="select-store"
>
<glsx-combi-form
ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData"
>
<span slot="footer"> <span slot="footer">
<el-button <el-button :size="size" type="primary" @click="getTable">查询</el-button>
:size="size" <el-button :size="size" @click="resetTable">重置</el-button>
type="primary"
@click="getTable"
>查询</el-button>
<el-button
:size="size"
@click="resetTable"
>重置</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<GLTable <GLTable ref="storeRef" :tableTotal="total" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @refreshTable="getList" :tableData="storeList" :hasNum="false" :setTableFinishFun="setTableFinishFun">
ref="storeRef" <div slot="radioHtml" class="store-table" slot-scope="scope">
:tableTotal="total" <el-radio v-model="merchantId" :label="scope.scope.merchantNo" @click.native="handleClick(scope.scope)"></el-radio>
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
@refreshTable="getList"
:tableData="storeList"
:hasNum="false"
:setTableFinishFun="setTableFinishFun"
>
<div
slot="radioHtml"
class="store-table"
slot-scope="scope"
>
<el-radio
v-model="merchantId"
:label="scope.scope.merchantNo"
@click.native="handleClick(scope.scope)"
></el-radio>
</div> </div>
</GLTable> </GLTable>
</GLDialog> </GLDialog>
...@@ -55,7 +16,7 @@ ...@@ -55,7 +16,7 @@
<script> <script>
export default { export default {
name: 'selectStore', name: 'selectStore',
data () { data() {
return { return {
searchForm: { searchForm: {
merchantId: '', merchantId: '',
...@@ -151,26 +112,26 @@ export default { ...@@ -151,26 +112,26 @@ export default {
// } // }
}, },
watch: { watch: {
dialogVisible (n) { dialogVisible(n) {
if (n) this.init() if (n) this.init()
} }
}, },
mounted () { mounted() {
}, },
methods: { methods: {
init () { init() {
this.merchantId = String(this.merchantInfo.merchantId) this.merchantId = String(this.merchantInfo.merchantId)
this.merchantName = this.merchantInfo.merchantName this.merchantName = this.merchantInfo.merchantName
this.getList() this.getList()
}, },
getList (pageCon) { getList(pageCon) {
pageCon && (this.pageConfig = pageCon) pageCon && (this.pageConfig = pageCon)
var params = { var params = {
merchantId: this.merchantId, merchantId: this.merchantId,
...this.searchForm, ...this.searchForm,
...this.pageConfig ...this.pageConfig
} }
this.$apis.common.getMerchantList(params).then(res => { this.$apis.common.getMerchantList1(params).then(res => {
this.storeList = res.list this.storeList = res.list
this.total = res.total this.total = res.total
let nowIndex = this.pageConfig.pageSize * (this.pageConfig.currentPage - 1) let nowIndex = this.pageConfig.pageSize * (this.pageConfig.currentPage - 1)
...@@ -179,26 +140,29 @@ export default { ...@@ -179,26 +140,29 @@ export default {
}) })
}) })
}, },
getTable () { getTable() {
this.$refs.storeRef.page.currentPage = 1 this.$refs.storeRef.page.currentPage = 1
this.getList() this.getList()
}, },
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.staffRef.tableHeightValues = '460px' this.$refs.staffRef.tableHeightValues = '460px'
}, },
handleClick (val) { handleClick(val) {
this.merchantId = val.merchantNo this.merchantId = val.merchantNo
this.merchantName = val.merchantName this.merchantName = val.merchantName
}, },
resetTable () { resetTable() {
this.searchForm = {} this.searchForm = {
merchantId: '',
merchantName: ''
}
this.getTable() this.getTable()
}, },
handleClose () { handleClose() {
this.$emit('handleRelateStoreClose') this.$emit('handleRelateStoreClose')
}, },
handleConfirm () { handleConfirm() {
const { merchantId, merchantName } = this const { merchantId, merchantName } = this
if (merchantId && merchantName) this.$emit('handleRelateStoreConfirm', { if (merchantId && merchantName) this.$emit('handleRelateStoreConfirm', {
merchantId, merchantId,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!