| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-export-dialog', '@backend/views/components/common');
- ?>
- <style>
- .order_stat {
- background: #FFF;
- padding: 10px 10px 0;
- margin-bottom: 10px;
- }
- .title {
- font-size: 18px;
- font-weight: bold;
- display: flex;
- align-items: baseline;
- height: 40px;
- justify-content: space-between;
- flex-direction: row;
- padding: 10px;
- }
- .order_stat>.title>.time {
- font-size: 13px;
- font-weight: 400;
- color: #BFBFBF;
- margin-left: 20px;
- flex: 1;
- }
- .order_stat .stat_details {
- padding: 15px 0;
- display: flex;
- }
- .default-avatar {
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- .user_img {
- position: relative;
- margin-right: 8px;
- /* height: 50px;
- width: 50px; */
- }
- .flex {
- display: flex;
- align-items: center;
- }
- .el-table .cell {
- text-align: left;
- }
- </style>
- <div id="app" v-cloak>
- <div class="order_stat">
- <div class="title">
- <span>门店财务数据</span>
- <div style="display:flex;">
- <div style="margin-right:5px;">
- <el-date-picker
- stlye="float:left;"
- type="daterange"
- size="small"
- v-model="staticDate"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- @change="changeDate"
- >
- </el-date-picker>
- </div>
- <com-export-dialog :field_list='exportList' :action_url="exportUrl" :params="searchData"> </com-export-dialog>
- </div>
- </div>
- <div class="stat_details">
- <div class="order_module" v-for="(item,index) in orderTotalArr" :key="item.type">
- <div class="oirder_modul_title">
- <div class="text">{{item.name}}</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 class="price">
- {{item.value}}
- </div>
- </div>
- </div>
- <div class="stat_details">
- <div class="order_module" v-for="(item,index) in orderTotalArr2" :key="item.type">
- <div class="oirder_modul_title">
- <div class="text">{{item.name}}</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 class="price">
- {{item.value}}
- </div>
- </div>
- </div>
- </div>
- <el-card shadow="never" style="border:0;min-width: 800px;">
- <el-tabs type="card" v-model="activityTab" @tab-click="handleTabClick">
- <el-tab-pane label="订单明细" name="order-detail">
- <div style="padding-bottom: 20px;">
- <div class="table-body">
- <el-form :inline="true" :model="searchData" size="small" class="demo-form-inline">
-
- <el-form-item label="">
- <el-date-picker
- stlye="float:left;"
- v-model="searchData.date"
- type="daterange"
- size="small"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入消费者ID/昵称/手机号" v-model="searchData.keyword" clearable></el-input>
- </el-form-item>
- <el-form-item label="">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入商品名称/ID" v-model="searchData.goods_keyword" clearable></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <el-table :data="form" stripe style="width: 100%" v-loading="listLoading" v-if="activityTab == 'order-detail'">
- <el-table-column prop="store_id" label="门店ID" min-width="100" align="center"></el-table-column>
- <el-table-column label="门店信息" width="200" prop="store_name" align="center">
- <template slot-scope="scope">
- <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.store.logo_img"></com-image>
- <div>{{scope.row.store.store_name}}</div>
- <div>{{scope.row.store.shop_mobile}}</div>
- </template>
- </el-table-column>
- <el-table-column label="消费者" width="200">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <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 class="table-info-text">
- <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
- <div>{{scope.row.user.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="user.mobile" label="手机号" min-width="120" align="center"></el-table-column>
- <el-table-column prop="order.order_no" label="订单编号" min-width="220" align="center"></el-table-column>
- <el-table-column label="商品信息" width="200" prop="store_name" align="center">
- <template slot-scope="scope">
- <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.pic_url"></com-image>
- <div>{{scope.row.goods_name}}</div>
- <div>{{scope.row.goods_attr_name || '默认'}}</div>
- </template>
- </el-table-column>
- <el-table-column prop="order_money" label="价格/数量" min-width="100" align="center">
- <template slot-scope="scope">
- <div style="display:flex;flex-direction:column;">
- <span>¥{{scope.row.price}}</span>
- <span>{{scope.row.num}} 件</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="order_money" label="成交价(元)" min-width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.goods_price}}
- </template>
- </el-table-column>
- <el-table-column prop="scope" min-width="150" label="成交时间" align="center">
- <template slot-scope="scope">
- {{scope.row.order.pay_time|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column prop="order_money" label="订单状态" min-width="100" align="center">
- <template slot-scope="scope">
- {{order_status_list[scope.row.order_status]}}
- </template>
- </el-table-column>
- <el-table-column prop="order_money" label="到账金额(元)" min-width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.commission_data.amount_received}}
- </template>
- </el-table-column>
- <el-table-column label="操作" fixed="right" align="center">
- <template slot-scope="scope">
- <el-button type="text" size="small" @click="showDetail(scope.row)">查看明细</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--工具条 批量操作和分页-->
- <div style="display: flex; margin-top: 20px;">
- <el-col :span="24" class="toolbar">
- <el-pagination v-if="pagination" style="float: right;" background @current-change="pageChange" layout="prev, pager, next" :page-count="pageCount">
- </el-pagination>
- </el-col>
- </div>
- </el-tab-pane>
- <el-tab-pane label="收银台" name="cashier">
- <div style="padding-bottom: 20px;">
- <div class="table-body">
- <el-form :inline="true" :model="searchData" size="small" class="demo-form-inline">
-
- <el-form-item label="">
- <el-date-picker
- stlye="float:left;"
- v-model="searchData.date"
- type="daterange"
- size="small"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="">
- <el-input @keyup.enter.native="search" size="small" placeholder="请输入消费者ID/昵称/手机号" v-model="searchData.keyword" clearable></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" size="small" icon="el-icon-search" @click="search" class="search_button">搜索</el-button>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <el-table :data="form" stripe style="width: 100%" v-loading="listLoading" v-if="activityTab == 'cashier'">
- <el-table-column prop="id" label="id" min-width="100" align="center"></el-table-column>
- <el-table-column prop="store_id" label="门店ID" min-width="100" align="center"></el-table-column>
- <el-table-column label="门店信息" width="200" prop="store_name" align="center">
- <template slot-scope="scope">
- <com-image style="float: left;margin-right: 10px;" mode="aspectFill" :src="scope.row.store.logo_img"></com-image>
- <div>{{scope.row.store.store_name}}</div>
- <div>{{scope.row.store.shop_mobile}}</div>
- </template>
- </el-table-column>
- <el-table-column label="消费者" width="200">
- <template slot-scope="scope">
- <div class="table-info-img-text" v-if='scope.row.user != null'>
- <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 class="table-info-text">
- <div v-if="scope.row.user.nickname">{{scope.row.user.nickname}}</div>
- <div>{{scope.row.user.mobile}}</div>
- </div>
- </div>
- <div v-else> - </div>
- </template>
- </el-table-column>
- <el-table-column prop="user.mobile" label="手机号" min-width="120" align="center"></el-table-column>
- <el-table-column prop="order_no" label="订单编号" min-width="220" align="center"></el-table-column>
-
- <el-table-column prop="order_money" label="成交价(元)" min-width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.pay_money}}
- </template>
- </el-table-column>
- <el-table-column prop="scope" min-width="150" label="成交时间" align="center">
- <template slot-scope="scope">
- {{scope.row.pay_time|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- <el-table-column prop="order_money" label="到账金额(元)" min-width="100" align="center">
- <template slot-scope="scope">
- {{scope.row.commission_data.amount_received}}
- </template>
- </el-table-column>
- <el-table-column label="操作" fixed="right" align="center">
- <template slot-scope="scope">
- <el-button type="text" size="small" @click="showDetail(scope.row)">查看明细</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--工具条 批量操作和分页-->
- <div style="display: flex; margin-top: 20px;">
- <el-col :span="24" class="toolbar">
- <el-pagination v-if="pagination" style="float: right;" background @current-change="pageChange" layout="prev, pager, next" :page-count="pageCount">
- </el-pagination>
- </el-col>
- </div>
- </el-tab-pane>
- </el-tabs>
- </el-card>
- <el-dialog title="订单承担明细" :visible.sync="dialogTableVisible" width="80%">
- <el-table :data="commissionData">
- <el-table-column property="order_money" label="订单金额" min-width="80px"></el-table-column>
- <el-table-column property="discount_money" label="优惠金额" min-width="80px"></el-table-column>
- <el-table-column property="score_deduction_bear" label="积分抵扣承担" min-width="120px">
- <template slot-scope="scope">
- <span v-if='scope.row.score_deduction_bear == 0'>平台</span>
- <span v-if='scope.row.score_deduction_bear == 1'>门店</span>
- <span v-if='scope.row.score_deduction_bear == -1'>暂无</span>
- </template>
- </el-table-column>
- <el-table-column property="pay_money" label="支付金额" min-width="80px"></el-table-column>
- <el-table-column property="addons_bonus" label="插件(佣金)" min-width="100px"></el-table-column>
- <el-table-column prop="settle_type" label="佣金来源" min-width="80px" align="center">
- <template slot-scope="scope">
- <div v-if="scope.row.settle_type == '4'">门店承担</div>
- <div v-else>平台承担</div>
- </template>
- </el-table-column>
- <el-table-column prop="store_send_commission" label="门店股东(佣金)" min-width="120px" align="center"></el-table-column>
- <el-table-column prop="service_charge" label="服务费" min-width="80px" align="center"></el-table-column>
- <el-table-column prop="higo_reward" label="嗨呗不足扣除" min-width="120px" align="center" v-if="commission_data.higo_reward > 0"></el-table-column>
- <el-table-column prop="store_contributing_money" label="会员折扣金额" min-width="120px" align="center" v-if="commission_data.store_contributing_money > 0"></el-table-column>
- <el-table-column prop="amount_received" label="到账金额" min-width="80px" align="center"></el-table-column>
- <el-table-column prop="amount_received_score" label="到账积分" min-width="80px" align="center" v-if="commission_data.amount_received_score > 0"></el-table-column>
- </el-table>
- </el-dialog>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- created() {
- this.searchData.store_id = getQuery('store_id');
- this.getStoreStatics();
- },
- data() {
- return {
- searchData: {
- goods_keyword: '',
- date: [],
- keyword: '',
- tabname: 'order-detail',
- },
- activityTab: 'order-detail',
- form: [],
- pageCount: 0,
- page: 1,
- pagination: null,
- listLoading: false,
- store_name: '',
- staticDate: [],
- orderTotalArr: [{
- type: 'today_pay_money',
- name: '今日成交金额',
- value: '0.00',
- prompt: '',
- }, {
- type: 'today_refund_money',
- name: '今日退款金额',
- value: '0.00',
- prompt: '',
- }, {
- type: 'today_commission_money',
- name: '今日预计到账金额',
- value: '0.00',
- prompt: '',
- }, {
- type: 'today_order_num',
- name: '今日订单数量',
- value: '0.00',
- prompt: '',
- }],
- orderTotalArr2: [{
- type: 'total_pay_money',
- name: '累计成交金额',
- value: '0.00',
- prompt: '',
- }, {
- type: 'total_refund_money',
- name: '累计退款金额',
- value: '0.00',
- prompt: '',
- }, {
- type: 'total_commission_money',
- name: '累计到账金额',
- value: '0.00',
- prompt: '',
- }, {
- type: 'total_order_num',
- name: '累计已付款订单数量',
- value: '0.00',
- prompt: '',
- }],
- order_status_list: {
- '0': "待付款",
- '1': "待发货",
- '2': "已发货",
- '3': "已收货",
- '4': "已完成",
- '6': "待自提",
- '7': "自提成功",
- '-4': "已关闭",
- '-2': "退款中",
- '-1': "售后申请"
- },
- dialogTableVisible: false,
- commissionData: [],
- commission_data: [],
- exportList: [],
- exportUrl: 'store/client/store-finance/index',
- };
- },
- methods: {
- pageChange(currentPage) {
- this.page = currentPage;
- this.getList();
- },
- handleTabClick(e) {
- this.searchData.tabname = this.activityTab;
- this.getList();
- },
- search() {
- this.page = 1;
- this.getList();
- },
- getList() {
- let params = {
- r: 'store/client/store-finance/index',
- page: this.page,
- keyword: this.searchData.keyword,
- goods_keyword: this.searchData.goods_keyword,
- store_id: this.searchData.store_id,
- date: this.searchData.date,
- tabname: this.searchData.tabname,
- };
- request({
- params,
- }).then(e => {
- if (e.data.code === 0) {
- this.form = e.data.data.list;
- this.exportList = e.data.data.export_list;
- this.pagination = e.data.data.pagination;
- this.pageCount = e.data.data.page_count;
- // this.orderTotalArr = e.data.data.order_total_arr;
- // this.orderTotalArr2 = e.data.data.order_total_arr2;
- this.store_name = e.data.data.store_name
- console.log('form----'.this.form);
- } else {
- this.$message.error(e.data.msg);
- }
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- this.listLoading = true;
- },
- showDetail(data) {
- this.commissionData = [];
- this.commission_data = data.commission_data;
- this.commissionData.push(data.commission_data);
- this.dialogTableVisible = true;
- },
- changeDate(val) {
- this.staticDate = val;
- this.getStoreStatics();
- // console.log('changeDate', val);
- },
- getStoreStatics() {
- let params = {
- r: 'store/client/store-finance/get-store-statics',
- page: this.page,
- keyword: this.searchData.keyword,
- store_id: this.searchData.store_id,
- date: this.staticDate,
- };
- request({
- params,
- }).then(e => {
- if (e.data.code === 0) {
- this.orderTotalArr = e.data.data.order_total_arr;
- this.orderTotalArr2 = e.data.data.order_total_arr2;
- } else {
- this.$message.error(e.data.msg);
- }
- this.listLoading = false;
- }).catch(e => {
- this.listLoading = false;
- });
- this.listLoading = true;
- },
- },
- mounted: function() {
- this.searchData.user_id = getQuery('user_id');
- this.getList();
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .input-item {
- display: inline-block;
- /* width: 250px; */
- margin: 0 0 20px 20px;
- }
- .date-item {
- display: inline-block;
- margin: 0 0 20px 20px;
- }
- .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-body .el-button {
- padding: 0!important;
- border: 0;
- margin: 0 5px;
- } */
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper,
- .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .stat_details {
- padding-bottom: 30px;
- display: flex;
- }
- .order_module {
- flex: 1;
- background: #F2F2F2;
- margin: 0 5px;
- padding: 20px 25px;
- }
- .order_module:last-child {
- margin-right: 0;
- }
- .order_module:first-child {
- margin-left: 0;
- }
- .price {
- font-size: 22px;
- font-weight: bold;
- }
- .oirder_modul_title {
- font-size: 12px;
- margin-bottom: 10px;
- display: flex;
- align-items: center;
- }
- .oirder_modul_title .text {
- margin-right: 10px;
- }
- .stat_icon {
- font-size: 19px;
- color: #BFBFBF;
- }
- </style>
|