刘翔宇-旅管家 3 years ago
parent d45f98403b
commit 1334d445c5

@ -5,33 +5,34 @@
<slot> <slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;"> <div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Button class="select" icon="ios-add" type="primary" style="margin-right: 10px;" <Button class="select" icon="ios-add" type="primary" style="margin-right: 10px;"
@click="$refs['rechargeFine'].isShow = true,$refs['rechargeFine'].type = 'recharge'" @click="$refs['rechargeFine'].isShow = true,$refs['rechargeFine'].type = 'recharge'">商家充值
>商家充值
</Button> </Button>
<Button class="select" icon="ios-remove" type="primary" style="margin-right: 10px;" <Button class="select" icon="ios-remove" type="primary" style="margin-right: 10px;"
@click="$refs['rechargeFine'].isShow = true,$refs['rechargeFine'].type = 'fine'" @click="$refs['rechargeFine'].isShow = true,$refs['rechargeFine'].type = 'fine'">商家扣款
>商家罚款
</Button> </Button>
<Select v-model="select.merchantId" class="select" style="width:160px;margin-right: 10px;" :clearable="true" <Select v-model="select.merchantId" class="select" style="width:160px;margin-right: 10px;" :clearable="true"
placeholder="所属商家" filterable placeholder="所属商家" filterable>
> <Option v-for="item in merchants" :value="item.id" :key="item.id">{{ item.username }}</Option>
<Option v-for="item in merchants" :value="item.id" :key="item.id">{{ item.name }}</Option>
</Select> </Select>
<Select v-model="select.type" class="select" style="width:100px;margin-right: 10px;" :clearable="true" <Select v-model="select.type" class="select" style="width:100px;margin-right: 10px;" :clearable="true"
placeholder="类型" filterable placeholder="类型" filterable>
> <Option
<Option v-for="item in [{label:'',value:'fee'},{label:'',value:'recharge'},{label:'退',value:'refund'},{label:'',value:'fine'}]" v-for="item in [{label:'佣金',value:'fee'},{label:'充值',value:'recharge'},{label:'退款',value:'refund'},{label:'扣款',value:'fine'},{label:'手工返佣',value:'manually_refund_fee'},{label:'自动返佣',value:'auto_refund_fee'}]"
:value="item.value" :key="item.value" :value="item.value" :key="item.value">{{ item.label }}
>{{ item.label }}
</Option> </Option>
</Select> </Select>
<Input v-model="select.serial" style="width: 140px;margin-right: 10px;" clearable placeholder="请输入订单编号" /> <Input v-model="select.serial" style="width: 140px;margin-right: 10px;" clearable placeholder="请输入订单编号" />
<div>
<Input v-model="select.money_min" style="width: 90px;" clearable placeholder="开始金额" />
<span>~</span>
<Input v-model="select.money_max" style="width: 90px;margin-right: 10px;" clearable placeholder="结束金额" />
</div>
<Button icon="ios-search" type="primary" style="margin-right: 10px;" @click="getFlow"></Button> <Button icon="ios-search" type="primary" style="margin-right: 10px;" @click="getFlow"></Button>
<Button icon="ios-repeat" type="primary" style="margin-right: 10px;" <Button icon="ios-repeat" type="primary" style="margin-right: 10px;"
@click="select = {pageIndex:1,pageSize:10,merchantId:'',type:''},getFlow()" @click="select = {pageIndex:1,pageSize:10,merchantId:'',type:''},getFlow()">全部
>全部
</Button> </Button>
<Button icon="ios-download" type="primary" style="margin-right: 10px;" @click="downloadExel"></Button> <Button icon="ios-download" type="primary" style="margin-right: 10px;" @click="downloadExel"></Button>
</div> </div>
@ -40,8 +41,7 @@
</div> </div>
<xy-table :total="total" @pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange" :list="list" <xy-table :total="total" @pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange" :list="list"
:table-item="table" :table-item="table">
>
<template v-slot:btns> <template v-slot:btns>
<div></div> <div></div>
</template> </template>
@ -52,9 +52,16 @@
</template> </template>
<script> <script>
import { index, getMerchants } from '@/api/finance' import {
import { parseTime } from '@/utils' index,
import { download } from '@/utils/downloadRequest' getMerchants
} from '@/api/finance'
import {
parseTime
} from '@/utils'
import {
download
} from '@/utils/downloadRequest'
import rechargeFine from '@/views/finance/component/rechargeFine' import rechargeFine from '@/views/finance/component/rechargeFine'
@ -69,16 +76,17 @@ export default {
pageSize: 10, pageSize: 10,
merchantId: '', merchantId: '',
type: '', type: '',
serial:'' serial: '',
money_min: '',
money_max: ''
}, },
merchants: [], merchants: [],
total: 0, total: 0,
list: [], list: [],
table: [ table: [{
{ prop: 'merchant.username',
prop: 'merchant.name',
label: '商家名称', label: '商家名称',
width: 240, width: 240,
align: 'left', align: 'left',
@ -136,8 +144,7 @@ export default {
downloadExel() { downloadExel() {
download( download(
'/api/admin/finance/index', '/api/admin/finance/index',
'get', 'get', {
{
merchant_id: this.select.merchantId, merchant_id: this.select.merchantId,
type: this.select.type, type: this.select.type,
serial: this.select.serial, serial: this.select.serial,
@ -152,7 +159,9 @@ export default {
}, },
async getMerchant() { async getMerchant() {
const res = await getMerchants() const res = await getMerchants({
page_size: 9999
})
this.merchants = res this.merchants = res
}, },
async getFlow() { async getFlow() {
@ -160,8 +169,7 @@ export default {
page: this.select.pageIndex, page: this.select.pageIndex,
page_size: this.select.pageSize, page_size: this.select.pageSize,
merchant_id: this.select.merchantId, merchant_id: this.select.merchantId,
type: this.select.type, ...this.select
serial: this.select.serial
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total

@ -14,11 +14,9 @@
<div class="select-content-item"> <div class="select-content-item">
<div class="select-content-item-label">所属商户</div> <div class="select-content-item-label">所属商户</div>
<div> <div>
<el-select size="small" :value="select.merchant ? select.merchant.name : ''" placeholder="所属商户" <el-autocomplete @select="handleSelect" v-model="select.merchant.name" :fetch-suggestions="querySearchAsync" clearable
@change="e => select.merchant = e"> placeholder="请输入选择商家"></el-autocomplete>
<el-option v-for="item in merchants" :key="item.id" :value="item" :label="item.name">
</el-option>
</el-select>
<el-checkbox style="margin-left: 10px;" v-model="select.is_merchant"></el-checkbox> <el-checkbox style="margin-left: 10px;" v-model="select.is_merchant"></el-checkbox>
</div> </div>
</div> </div>
@ -148,6 +146,9 @@
import { import {
download download
} from '@/utils/downloadRequest' } from '@/utils/downloadRequest'
import {
index as merchantIndex
} from '@/api/merchant'
import orderLog from '@/views/order/component/orderLog' import orderLog from '@/views/order/component/orderLog'
import actions from '@/views/order/component/actions' import actions from '@/views/order/component/actions'
@ -280,20 +281,23 @@
return ( < div style = { return ( < div style = {
{ {
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'left',
justifyContent: 'center', justifyContent: 'left',
cursor: 'pointer', cursor: 'pointer',
color: "blue" color: "blue"
} }
} }
on={{ on = {
{
['click']: (e) => { ['click']: (e) => {
this.selectId = row.order.id; this.selectId = row.order.id;
this.isShowEdit = true; this.isShowEdit = true;
} }
}} }
}
> { >
{
row.order.member_address ? row.order.member_address : "修改服务地址" row.order.member_address ? row.order.member_address : "修改服务地址"
} < /div> ) } < /div> )
} }
@ -353,19 +357,19 @@
width: 100 width: 100
}, },
{ {
prop: "merchant.name", prop: "merchant.username",
label: "服务商家", label: "服务商家",
align: "left", align: "left",
width: 220 width: 160
}, },
{ {
label: "历史商家", label: "历史商家",
width: 220, width: 160,
align: "left", align: "left",
customFn: (row) => { customFn: (row) => {
return row.assign_merchant.map(item => { return row.assign_merchant.map(item => {
return ( < div > { return ( < div > {
item.name item.username
} < /div>) } < /div>)
}) })
} }
@ -389,6 +393,29 @@
} }
}, },
methods: { methods: {
handleSelect(item) {
console.log(item)
this.select.merchant = {
id: item.id,
name: item.value
};
},
querySearchAsync(queryString, cb) {
merchantIndex({
keyword: queryString,
page_size: 999
}).then(res => {
var data = res.data;
let _data = [];
for (var m of data) {
_data.push({
value: m.username,
id: m.id
})
}
cb(_data)
})
},
resetsearch() { resetsearch() {
this.select.page = 1; this.select.page = 1;
this.select.merchant = ''; this.select.merchant = '';

Loading…
Cancel
Save