| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615 |
- <?php
- use common\helpers\ComponentHelper;
- ?>
- <style>
- @media screen and (max-width: 1370px) {
- #stat_pay {
- min-width: 1131px;
- }
- }
- .order_stat {
- background: #FFF;
- padding: 10px 10px 0;
- margin-bottom: 10px;
- }
- .title {
- font-size: 18px;
- font-weight: bold;
- display: flex;
- align-items: center;
- height: 40px;
- }
- .order_stat>.title>.time {
- font-size: 13px;
- font-weight: 400;
- color: #BFBFBF;
- margin-left: 20px;
- flex: 1;
- }
- .order_stat .stat_details {
- padding: 10px 0;
- display: flex;
- }
- .stat_details .order_module {
- flex: 1;
- background: #F2F2F2;
- margin: 0 5px;
- padding: 20px 25px;
- }
- .order_module {
- display: flex;
- flex-direction: column;
- }
- .order_module:last-child {
- margin-right: 0;
- }
- .order_module:first-child {
- margin-left: 0;
- }
- .price {
- font-size: 22px;
- font-weight: bold;
- flex: 1;
- word-break: break-all;
- }
- .oirder_modul_title {
- font-size: 12px;
- margin: 10px 0;
- /* display: flex;
- align-items: center; */
- }
- .oirder_modul_title .text {
- margin-right: 10px;
- }
- .stat_icon {
- font-size: 19px;
- color: #BFBFBF;
- }
- .total {
- display: flex;
- margin-bottom: 10px;
- }
- .pay_total {
- flex: 1;
- flex-basis: 764px;
- background: #FFF;
- padding: 10px 10px 15px;
- }
- .pay_total:last-child {
- margin-left: 12px;
- }
- .el-date-editor .el-range-separator {
- padding: 0;
- }
- .pay_modules {
- margin-top: 20px;
- display: flex;
- flex-wrap: wrap;
- }
- .module {
- /* width: 350px; */
- width: 46%;
- background: #F7F7F7;
- padding: 20px 25px;
- margin-bottom: 15px;
- display: flex;
- }
- .module_two {
- width: 33%;
- background: #F7F7F7;
- padding: 20px 25px;
- margin-bottom: 15px;
- display: flex;
- }
- .module:nth-child(2n) {
- margin-left: 30px
- }
- .no_open {
- flex: 1;
- color: #2E8FF4;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- }
- .pay_button {
- display: flex;
- border: 1px solid #2E8FF4;
- border-radius: 4px;
- color: #464646;
- }
- .pay_button div {
- background: #FFF;
- padding: 10px;
- font-size: 14px;
- font-weight: 500;
- width: 80px;
- height: 36px;
- border-radius: 4px;
- text-align: center;
- }
- .assets {
- color: #848484;
- }
- .data_chart {
- background: #FFF;
- padding: 10px 10px 15px;
- width: 100%;
- position: relative;
- /* display: flex; */
- }
- .data_chart_time {
- position: absolute;
- top: 10px;
- right: 50px;
- display: flex;
- font-size: 16px;
- }
- .sel_time {
- margin-right: 20px;
- padding-bottom: 5px;
- }
- .sel_time:hover {
- cursor: pointer
- }
- .sel_color {
- border-bottom: 2px solid #5ED9A9;
- }
- .top_title {
- display: flex;
- padding: 18px 0;
- background-color: white;
- margin: 10px 0;
- align-items: center;
- }
- .top_title div:nth-of-type(1) {
- padding: 0 30px 0 20px;
- font-weight: bold;
- font-size: 16px;
- }
- .div_text_center {
- text-align: center;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .input-item {
- display: inline-block;
- width: 250px;
- margin: 0 20px 20px 0;
- }
- .input-item .el-input__inner {
- /* border-right: 0; */
- height: 32px;
- line-height: 32px;
- font-size: 12px;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- /* border-right: 0; */
- /* outline: 0; */
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- /* border-right: 0; */
- /* outline: 0; */
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- /* border-left: 0; */
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .table-info-img {
- max-width: 50px !important;
- }
- .table-body .el-input__icon {
- line-height: 32px;
- }
- </style>
- <div id="stat_pay" v-cloak>
- <div class="top_title">
- <div>分红池</div>
- <el-button type="primary" :loading="runLoading" style="float:right" size="small" @click="doRun">执行分红</el-button>
- </div>
- <div class="order_stat">
- <div class="stat_details">
- <div class="order_module" v-for="(item,index) in dataOverview" :key="item.type">
- <div class="oirder_modul_title">
- <div class="price div_text_center">
- {{item.value}}
- </div>
- <div class="div_text_center">
- {{item.name}}
- <div v-if="index=='now_amount'" style="color:green;cursor:pointer;" @click="recharge()">
- 调整分红池额度
- </div>
- <!-- <el-tooltip class="item" effect="dark" v-if="item.prompt" :content="item.prompt" placement="bottom">
- <i class="el-icon-question stat_icon"></i>
- </el-tooltip> -->
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="table-body">
- <div class="input-item" v-if="!user_id">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入会员ID" v-model="searchData.user_id" clearable @clear="search">
- </el-input>
- </div>
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入昵称/手机号" v-model="searchData.keyword" clearable @clear="search">
- </el-input>
- </div>
- <div class="input-item">
- <el-input @keyup.enter.native="search" size="small" placeholder="订单号" v-model="searchData.order_no" clearable @clear="search">
- </el-input>
- </div>
- <div class="input-item">
- <template>
- <el-select v-model="searchData.change_type" placeholder="请选择类型" clearable @change="search" @clear="search">
- <el-option v-for="item in options" :key="item.name" :label="item.label" :value="item.name">
- </el-option>
- </el-select>
- </template>
- </div>
- <el-date-picker size="small" style="margin-top: 1px; float: left;margin-right:20px" @change="selectDateTime" v-model="searchData.date" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" style="margin-right: 20px"></el-date-picker>
- <div class="input-item">
- <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button" style="margin-right: 10px;">搜索</el-button>
- <el-button v-if="isSearch" type="waring" size="small" icon="el-icon-search" @click="reset_search"
- style="margin-right: 10px;">重置</el-button>
- </div>
- <el-table :data="form" stripe style="width: 100%" v-loading="listLoading">
- <el-table-column prop="user_id" label="会员ID" min-width="100" align="center"></el-table-column>
- <el-table-column label="用户信息" min-width="180">
- <template slot-scope="scope">
- <div style="display:flex;align-items:center;" v-if="scope.row.user_id>0">
- <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div style="padding-left:8px;">
- <div class="over2" v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
- <div>{{scope.row.user.mobile}}</div>
- </div>
- </div>
- <div style="display:flex;align-items:center;" v-if="scope.row.user_id==0">管理员操作</div>
- </template>
- </el-table-column>
- <el-table-column prop="amount" label="分红金额变动">
- <template slot-scope="scope">
- <div v-if='scope.row.amount>0' style="color:green">+{{scope.row.amount}}</div>
- <div v-if='scope.row.amount<0' style="color:red">{{scope.row.amount}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="before_amount" label="变动前金额">
- </el-table-column>
- <el-table-column prop="after_amount" label="变动后金额">
- </el-table-column>
- <el-table-column prop="desc" label="备注">
- </el-table-column>
- <el-table-column label="创建时间" align="center">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <!-- <el-table-column label="操作" width="250" align="center">
- <template slot-scope="scope">
- <el-button circle size="small" type="text" @click="recharge(scope.row.user_id)">调整金额</el-button>
- </template>
- </el-table-column> -->
- </el-table>
- <!--工具条 批量操作和分页-->
- <el-col :span="24" class="toolbar">
- <div style="height:20px;"></div>
- <el-pagination background layout="prev, pager, next" @current-change="pageChange" :page-count="pageCount" style="float:right;margin:15px">
- </el-col>
- </div>
- <el-dialog :title="'调整分红池'" :visible.sync="dialogBalance" width="30%" @close="closePop" center>
- <el-form :model="balanceForm" label-width="100px" ref="integralForm">
- <el-form-item prop="price" size="small">
- <el-col :span="4">
- <label>金额</label>
- </el-col>
- <el-col :span="12">
- <el-input type="number" v-model="balanceForm.price" placeholder="请输入要加/减的(-1代表减1)"></el-input>
- </el-col>
- </el-form-item>
- <el-form-item prop="remark" size="small">
- <el-col :span="4">
- <label>备注</label>
- </el-col>
- <el-col :span="12">
- <el-input type="textarea" v-model="balanceForm.remark"></el-input>
- </el-col>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="dialogBalance = false" style="padding:8px 18px;font-size:13px;">取消</el-button>
- <el-button :loading="btnLoading" type="primary" style="padding:8px 16px;font-size:13px;" @click="balanceSubmit">确定</el-button>
- </div>
- </el-dialog>
- </div>
- <script>
- new Vue({
- el: '#stat_pay',
- data() {
- return {
- status: 1, //0 未结算 1已结算
- options: [{
- label: '增加',
- name: 'add'
- },
- {
- label: '减少',
- name: 'sub'
- },
- ],
- exportList: {},
- searchData: {
- keyword: '',
- user_id: null,
- change_type: '',
- date: '',
- order_no: '',
- },
- dialogBalance: false,
- btnLoading: false,
- balanceForm: {
- price: 0,
- remark: '',
- },
- listLoading: false,
- user_id: null, // 外部链接传递进来的 user_id
- pageCount: 0,
- form: [],
- runLoading:false,
- fromTypeList: [],
- dataOverview: {
- "total_amount": {
- type: 'total_amount',
- name: '累计金额',
- value: '0.00',
- },
- "total_settle_amount": {
- type: 'tatal_settle_amount',
- name: '累计结算金额',
- value: '0.00',
- },
- "total_send_amount": {
- type: 'tatal_send_amount',
- name: '已发放金额',
- value: '0.00',
- },
- "now_amount": {
- type: 'now_amount',
- name: '当前金额',
- value: '0.00',
- },
- },
- }
- },
- created() {
- },
- computed: {
- isSearch() {
- return this.searchData.keyword || this.searchData.user_id || this.searchData.date || this.searchData
- .order_no || this.searchData.change_type
- }
- },
- mounted: function() {
- this.getList();
- },
- methods: {
- reset_search(){
- this.searchData = {
- keyword: '',
- user_id: '',
- date: '',
- order_no: '',
- change_type: ''
- };
- this.search()
- },
- exportConfirm() {
- },
- selectDateTime(e) {
- this.searchData.date = e;
- this.page = 1;
- this.search();
- },
- recharge() {
- this.dialogBalance = true;
- },
- closePop() {
- this.dialogBalance = false;
- this.btnLoading = false;
- this.balanceForm.price = 0;
- this.balanceForm.remark = '';
- },
- doRun() {
- var self=this
- this.runLoading = true;
- this.$confirm('是否确认执行?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- request({
- params: {
- r: 'happiness/store-weight/do-run',
- },
- method: 'get',
- data: null
- }).then(e => {
- if (e.data.code == 0) {
- self.$message.success(e.data.msg);
- } else {
- self.$message.error(e.data.msg);
- }
- self.runLoading = false;
- }).catch(e => {
- self.$message.error(e);
- self.runLoading = false;
- })
- }).catch(() => {
- self.runLoading=false
- });
- },
- balanceSubmit() {
- this.btnLoading = true;
- if (this.balanceForm.price == 0) {
- this.$message.error('充值金额不能为0');
- return;
- }
- request({
- params: {
- r: 'happiness/store-weight/recharge',
- },
- method: 'post',
- data: this.balanceForm
- }).then(e => {
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- this.getList()
- } else {
- this.$message.error(e.data.msg);
- }
- this.closePop()
- }).catch(e => {
- this.$message.error(e);
- this.closePop()
- })
- },
- pageChange(currentPage) {
- this.page = currentPage;
- this.getList();
- },
- search() {
- this.page = 1;
- this.getList();
- },
- getList() {
- let user_id = this.user_id ? this.user_id : this.searchData.user_id;
- let params = {
- r: 'happiness/store-weight/index',
- page: this.page,
- date: this.searchData.date,
- user_id: user_id,
- keyword: this.searchData.keyword,
- order_no: this.searchData.order_no,
- change_type: this.searchData.change_type
- };
- // if (this.searchData.date) {
- // Object.assign(params, {
- // start_time: this.searchData.date[0],
- // end_time: this.searchData.date[1],
- // });
- // }
- request({
- params,
- }).then(e => {
- if (e.data.code === 0) {
- console.log(e.data.data);
- this.form = e.data.data.list;
- this.pagination = e.data.data.pagination;
- this.pageSize = e.data.data.page_size;
- this.pageCount = e.data.data.page_count;
- //订单概况
- for (let field in this.dataOverview) {
- if (e.data.data.orderStatistics[field]) {
- this.dataOverview[field]['value'] = e.data.data.orderStatistics[field];
- } else {
- this.dataOverview[field]['value'] = '0.00';
- }
- }
- console.log(this.pageCount);
- } else {
- this.$message.error(e.data.msg);
- }
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- this.listLoading = true;
- }
- }
- })
- </script>
|