Zory 1 день назад
Родитель
Сommit
789eaacfb6

+ 12 - 0
src/api/model/bills.js

@@ -0,0 +1,12 @@
+import config from "@/config";
+import http from "@/utils/request";
+
+export default {
+    list: {
+        url: `${config.API_URL}/bills/list`,
+        name: "-",
+        get: async function (data = {}) {
+            return await http.get(this.url, data);
+        },
+    },
+}

+ 17 - 2
src/views/manage/finance/bills/components/search.vue

@@ -7,9 +7,19 @@
             <div class="search-form">
                 <div class="form-left">
                     <el-row :gutter="10">
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="6">
+                            <el-input v-model="searchKey.poi_name" placeholder="请选择商家" clearbale readonly :style="{width:'100%'}" @click="selectStore">
+                                <template #append>
+                                    <el-tooltip effect="dark" content="点这里,清除选择" placement="top-start">
+                                        <div class="remove-a" @click="clearStore">清除</div>
+                                    </el-tooltip>
+                                </template>
+                                <template #prepend>所属商家</template>
+                            </el-input>
+                        </el-col>
                         <el-col :xs="12" :sm="12" :md="8" :lg="8" :xl="8">
-                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" :shortcuts="shortcutsDay" unlink-panels v-if="type=='1'" />
-                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="monthrange" range-separator="至" @change="searchForm" :shortcuts="shortcutsMon" unlink-panels v-if="type=='2'" />
+                            <el-date-picker v-model="searchKey.day" :style="{width: '100%'}" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" :shortcuts="shortcutsDay" unlink-panels v-if="type=='1'" />
+                            <el-date-picker v-model="searchKey.day" :style="{width: '100%'}" start-placeholder="开始时间" end-placeholder="结束时间" type="monthrange" range-separator="至" @change="searchForm" :shortcuts="shortcutsMon" unlink-panels v-if="type=='2'" />
                         </el-col>
                     </el-row>
                 </div>
@@ -20,10 +30,15 @@
             </div>
         </el-form>
     </fieldset>
+    <storeData ref="storeData" :multiple="false" @success="handleStore"></storeData>
 </template>
 
 <script>
+import storeData from '@/views/manage/components/agent';
 export default {
+    components: {
+        storeData
+    },
     props: {
         type: { type: String, default: "1" },
     },

+ 201 - 0
src/views/manage/finance/bills/components/table.vue

@@ -0,0 +1,201 @@
+<template>
+    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id" :row-class-name="tableRowClassName">
+        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
+        <el-table-column label="订单编号" width="180" fixed="left" prop="title"></el-table-column>
+        <el-table-column label="所属商家" prop="id" width="260">
+            <template #default="scope">
+                <div class="goods-img">
+                    <div class="name" v-if="scope.row.store">
+                        <span>{{ scope.row.store.poi_name }}({{ scope.row.store.poi_city }})</span>
+                        <span class="dec">{{ scope.row.store.poi_address }}</span>
+                    </div>
+                    <div v-else>-</div>
+                </div>
+            </template>
+        </el-table-column>
+        <el-table-column label="结算状态" prop="id" width="120">
+            <template #default="scope">
+                <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 已结算</div>
+                <div class="status-danger" v-if="scope.row.status==2"><sc-status-indicator type="danger"></sc-status-indicator> 结算中</div>
+                <div class="status-info" v-if="scope.row.status==0"><sc-status-indicator type="info"></sc-status-indicator> 待结算</div>
+            </template>
+        </el-table-column>
+        <el-table-column label="结算完成日期" prop="id" width="180">
+            <template #default="scope">
+                <div>
+                    {{ scope.row.end_day?scope.row.end_day:'-' }}
+                    <span v-if="scope.row.status!==1">(预计)</span>
+                </div>
+            </template>
+        </el-table-column>
+        <el-table-column label="核销总额(元)" prop="id" width="180" align="left">
+            <template #default="scope">
+                <span>{{ scope.row.order_money?$TOOL.money(scope.row.order_money):'-' }}</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="抖音结算(元)" prop="id" width="180" align="left">
+            <template #default="scope">
+                <span>{{ scope.row.order_money?$TOOL.money(scope.row.order_money-scope.row.life_fee_total):'-' }}</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="核销订单(笔)" prop="id" width="120" align="left">
+            <template #default="scope">
+                <span>{{ scope.row.order_num?scope.row.order_num:'-' }}</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="商家应得(元)" prop="id" width="180" align="left">
+            <template #default="scope">
+                <span>{{ scope.row.store_money?$TOOL.money(scope.row.store_money):'-' }}</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="达人佣金(元)" prop="id" width="180" align="left">
+            <template #default="scope">
+                <span>{{ scope.row.star_fee_total?$TOOL.money(scope.row.star_fee_total):'-' }}</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="来客服务费(元)" prop="id" width="180" align="left">
+            <template #default="scope">
+                <span>{{ scope.row.life_fee_total?$TOOL.money(scope.row.life_fee_total):'-' }}</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="系统服务费(元)" prop="id" width="180" align="left">
+            <template #default="scope">
+                <span>{{ scope.row.sys_fee_total?$TOOL.money(scope.row.sys_fee_total):'-' }}</span>
+            </template>
+        </el-table-column>
+        <el-table-column label="操作" width="140" align="left" fixed="right">
+            <template #default="scope">
+                <el-button-group>
+                    <el-button size="small" text @click="table_view(scope.row)">详情</el-button>
+                    <el-button type="danger" size="small" text @click="table_error(scope.row)" v-if="trade==2 && scope.row.status==2 && scope.row.is_error==0">标记异常</el-button>
+                </el-button-group>
+                <template v-if="scope.row.is_error==0">
+                    <el-button-group>
+                        <el-button type="danger" size="small" text @click="table_cancel(scope.row)" v-if="trade==2 && scope.row.status==2 && scope.row.express_status==1">取消</el-button>
+                    </el-button-group>
+                </template>
+            </template>
+        </el-table-column>
+    </scTable>
+</template>
+
+<script>
+export default {
+    props: {
+        trade: { type: String, default: "0" },
+    },
+    data(){
+        return {
+            list: {
+                apiObj: this.$API.bills.list
+            },
+            dataSelect:[],
+            dataSelectFull:[],
+            searchKey:{}
+        }
+    },
+    methods: {
+        tableRowClassName(row, rowIndex) {
+            if (row.row.is_error === 1) {
+                return 'error-row';
+            } else {
+                return 'success-row';
+            }
+        },
+        orderSuccess(){
+            this.$refs.table.refresh()
+        },
+        table_view(data){
+            this.$nextTick(() => {
+                data.order = data.out_order_no
+                this.$refs.orderDetail.open("edit").setData(data)
+            })
+        },
+        table_del(data){
+            
+        },
+        table_cancel(data){
+            this.$confirm(`取消该笔订单的核销,并非是直接退款,订单状态将恢复到【待使用】状态`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var resp = await this.$API.merOrder.save.post({"order":data.out_order_no,"field":'status',"val":1});
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$refs.table.refresh()
+            }).catch(() => {
+
+            })
+        },
+        table_error(data){
+            this.$confirm(`订单标记异常后,该笔订单只能通过【异常订单】中进行下一步的操作,并且需等待24小时后系统判定后方可操作`, '提示', {
+                type: 'warning'
+            }).then(async () => {
+                var resp = await this.$API.merOrder.save.post({"order":data.out_order_no,"field":'is_error',"val":1});
+                if (resp.code == 0) {
+                    return this.$message.error(resp.msg);
+                }
+                this.$message.success(resp.msg);
+                this.$refs.table.refresh()
+            }).catch(() => {
+
+            })
+        },
+        refresh(){
+            this.$refs.table.refresh()
+        },
+        upData(data){
+            this.$refs.table.upData(data)
+        },
+        handleSuccess(){
+            this.$refs.table.refresh()
+        },
+        sortChange(event){
+            if (event.order) {
+                var data = {
+                    "field":event.prop,
+                    "order":event.order
+                }
+                this.$refs.table.upData(data)
+            } else {
+                this.$refs.table.reload(this.searchKey)
+            }
+            return ;
+        },
+        selectionChange(event){
+            this.dataSelect = [];
+            var arr = [];
+            var arrCompany = [];
+            event.forEach(function(val,index){
+                arr[index] = val.id;
+                arrCompany[index] = val;
+            });
+            this.dataSelectFull = arrCompany;
+            this.dataSelect = arr;
+            this.$emit("success",this.dataSelect);
+            this.$emit("successFull",this.dataSelectFull);
+        },
+    }
+}
+</script>
+
+<style>
+.order-name span{display: block;}
+.order-name span.dec{color: #999;font-size: 12px;}
+.goods-img{display: flex;gap: 5px;}
+.goods-img .name span{display: block;}
+.goods-img .name span.dec{color: #999;font-size: 12px;}
+.goods-price,.price{display: flex;align-items: center;gap: 5px;font-size: 14px;}
+.goods-price .del{text-decoration: line-through;}
+.goods-price span{background-color: #fff !important;
+    border: 1px solid #d3d9e0 !important;
+    border-radius: 4px;
+    box-sizing: border-box;
+    color: #6c737a !important;
+    display: inline-flex;
+    flex: none;
+    font-size: 12px;
+    line-height: 18px !important;
+    padding: 1px 6px !important;text-decoration: none;}
+</style>

+ 18 - 11
src/views/manage/finance/bills/index.vue

@@ -10,16 +10,19 @@
             <search @success="handleSuccess" :type="elType"></search>
         </div>
         <el-main class="nopadding">
-            
+            <div class="table-container">
+                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull"></tablePage>
+            </div>
         </el-main>
     </el-container>
 </template>
 
 <script>
 import search from './components/search';
+import tablePage from './components/table';
 export default {
     components: {
-        search
+        search,tablePage
     },
     data() {
         return {
@@ -28,16 +31,20 @@ export default {
         }
     },
     methods: {
-        handleClick(event){
-            this.activeName = event;
-            if (event=='mon') {
-                this.elType = 2
-            } else {
-                this.elType = 1
-            }
+        tableHandle(data){
+            this.dataSelect = data;
         },
-        handleSuccess(){
-            
+        tableHandleFull(data){
+            this.dataSelectFull = data;
+        },
+        handleSuccess(data){
+            this.searchKey = data;
+            this.$refs.tablePage.upData(data)
+        },
+        handleClick(name){
+            this.activeName = name;
+            this.searchKey.type = name;
+            this.$refs.tablePage.upData(this.searchKey)
         }
     }
 }

+ 5 - 0
src/views/manage/order/index/components/table.vue

@@ -145,6 +145,11 @@
                 {{ scope.row.pay_at?scope.row.pay_at:'未支付' }}
             </template>
         </el-table-column>
+        <el-table-column label="核销时间" prop="pay_at" width="160">
+            <template #default="scope">
+                {{ scope.row.done_at?scope.row.done_at:'-' }}
+            </template>
+        </el-table-column>
         <el-table-column label="操作" width="140" align="left" fixed="right">
             <template #default="scope">
                 <el-button-group>

+ 5 - 0
src/views/merchant/order/index/components/table.vue

@@ -124,6 +124,11 @@
                 {{ scope.row.pay_at?scope.row.pay_at:'未支付' }}
             </template>
         </el-table-column>
+        <el-table-column label="核销时间" prop="pay_at" width="160">
+            <template #default="scope">
+                {{ scope.row.done_at?scope.row.done_at:'-' }}
+            </template>
+        </el-table-column>
         <el-table-column label="操作" width="140" align="left" fixed="right">
             <template #default="scope">
                 <el-button-group>

+ 5 - 0
src/views/service/order/index/components/table.vue

@@ -142,6 +142,11 @@
                 {{ scope.row.pay_at?scope.row.pay_at:'未支付' }}
             </template>
         </el-table-column>
+        <el-table-column label="核销时间" prop="pay_at" width="160">
+            <template #default="scope">
+                {{ scope.row.done_at?scope.row.done_at:'-' }}
+            </template>
+        </el-table-column>
         <el-table-column label="操作" width="140" align="left" fixed="right">
             <template #default="scope">
                 <el-button-group>