|
@@ -1,51 +1,52 @@
|
|
|
<template>
|
|
|
- <div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent v-show="showSearch">
|
|
|
- <el-form-item label="关联企业" prop="companyId">
|
|
|
- <el-input v-model="queryParams.companyId" placeholder="请输入关联企业" @keyup.enter.native="handleQuery" clearable class="inp"/>
|
|
|
+ <div class="cmain">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
|
|
|
+ <el-form-item label="交易类型" prop="type">
|
|
|
+ <el-select v-model="queryParams.type" placeholder="交易类型" clearable style="width: 125px">
|
|
|
+ <el-option value="0" label="充值"></el-option>
|
|
|
+ <el-option value="1" label="提现"></el-option>
|
|
|
+ <el-option value="2" label="结算发放"></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="关联充值" prop="opId">
|
|
|
- <el-input v-model="queryParams.opId" placeholder="请输入关联充值" @keyup.enter.native="handleQuery" clearable class="inp"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="金额" prop="money">
|
|
|
- <el-input v-model="queryParams.money" placeholder="请输入金额" @keyup.enter.native="handleQuery" clearable class="inp"/>
|
|
|
+ <el-form-item label="交易日期">
|
|
|
+ <el-date-picker v-model="dateRange" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-row :gutter="10" class="mb8">
|
|
|
- <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:record:add']">新增</el-button>
|
|
|
- <el-button type="success" icon="el-icon-edit" :disabled="ids.length != 1" @click="op('edit',ids)" v-hasPermi="['work:record:edit']">修改</el-button>
|
|
|
- <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:record:remove']">删除{{ids.length>0?'('+ids.length+')':''}}</el-button>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-table :data="response.rows" border height="calc(100vh - 270px)">
|
|
|
- <el-table-column label="关联充值" align="center" prop="opId" />
|
|
|
- <el-table-column label="交易类型" align="center" prop="type" />
|
|
|
- <el-table-column label="金额" align="center" prop="money" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <el-table :data="response.rows" border>
|
|
|
+ <el-table-column type="index" label="序号" align="center" width="80" />
|
|
|
+ <el-table-column label="交易类型" align="center" prop="type">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag type="success" v-if="scope.row.type == 0">充值</el-tag>
|
|
|
+ <el-tag type="warning" v-if="scope.row.type == 1">提现</el-tag>
|
|
|
+ <el-tag type="primary" v-if="scope.row.type == 2">结算发放</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="交易金额(元)" align="center" prop="money">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit',scope.row)" v-hasPermi="['work:record:edit']">修改</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:record:remove']">删除</el-button>
|
|
|
+ <span v-if="scope.row.type == 0" style="color: orangered">+{{ scope.row.money }}</span>
|
|
|
+ <span v-if="scope.row.type == 1">-{{ scope.row.money }}</span>
|
|
|
+ <span v-if="scope.row.type == 2">-{{ scope.row.money }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="交易日期" align="center" prop="createTime" />
|
|
|
<template slot="empty">
|
|
|
- <el-empty></el-empty>
|
|
|
+ <el-empty></el-empty>
|
|
|
</template>
|
|
|
</el-table>
|
|
|
- <pagination v-if="response.total>0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList"/>
|
|
|
+ <pagination v-if="response.total > 0" :total="response.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- name: "Record",
|
|
|
+ name: 'Record',
|
|
|
data() {
|
|
|
return {
|
|
|
- showSearch:true,
|
|
|
+ dateRange: [],
|
|
|
response: {},
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
@@ -64,8 +65,12 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
getList() {
|
|
|
- this.ajax({ url: '/work/record/list', data: this.queryParams }).then(response => {
|
|
|
- this.response = response;
|
|
|
+ if (this.dateRange) {
|
|
|
+ this.queryParams.dateBegin = this.dateRange[0];
|
|
|
+ this.queryParams.dateEnd = this.dateRange[1];
|
|
|
+ }
|
|
|
+ this.ajax({ url: '/work/record/list', data: this.queryParams }).then((response) => {
|
|
|
+ this.response = response;
|
|
|
});
|
|
|
},
|
|
|
handleQuery() {
|
|
@@ -73,25 +78,9 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
+ this.resetForm('queryForm');
|
|
|
+ this.dateRange = [];
|
|
|
this.handleQuery();
|
|
|
- },
|
|
|
- op(tag, row) {
|
|
|
- if (tag == 'add') {
|
|
|
- this.iframe({ obj: edit, param: {}, title:'新增',width: '45%', height: '55%'});
|
|
|
- }
|
|
|
- if (tag == 'edit') {
|
|
|
- const id = row.id || this.ids[0];
|
|
|
- this.iframe({ obj: edit, param: {id: id}, title:'编辑',width: '50%', height: '50%'});
|
|
|
- }
|
|
|
- },
|
|
|
- del(row) {
|
|
|
- this.$confirm('是否确认删除选中数据?', '警告', { type: 'warning' }).then(() => {
|
|
|
- this.get({ url: '/work/record/remove/' + (row.id || this.ids) }).then(response => {
|
|
|
- this.$modal.msgSuccess('删除成功');
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- });
|
|
|
}
|
|
|
}
|
|
|
};
|