Browse Source

0805-0059-h01

Zory 6 hours ago
parent
commit
a224933905

+ 7 - 1
src/views/manage/finance/bills/index.vue

@@ -27,7 +27,8 @@ export default {
     data() {
         return {
             activeName:"day",
-            elType:"1"
+            elType:"1",
+            searchKey:{}
         }
     },
     methods: {
@@ -43,6 +44,11 @@ export default {
         },
         handleClick(name){
             this.activeName = name;
+            if (name == 'mon') {
+                this.elType = "2";
+            } else {
+                this.elType = "1";
+            }
             this.searchKey.type = name;
             this.$refs.tablePage.upData(this.searchKey)
         }

+ 2 - 16
src/views/merchant/cps/index/components/table.vue

@@ -14,8 +14,7 @@
                 </el-tooltip>
             </template>
             <template #default="scope">
-                <span v-if="scope.row.done_money">{{ scope.row.done_money }}</span>
-                <span v-else>-</span>
+                {{ scope.row.done_money?$TOOL.money(scope.row.done_money):'-' }}
             </template>
         </el-table-column>
         <el-table-column label="成交金额(元)" prop="category_id">
@@ -26,20 +25,7 @@
                 </el-tooltip>
             </template>
             <template #default="scope">
-                <span v-if="scope.row.order_money">{{ scope.row.order_money }}</span>
-                <span v-else>-</span>
-            </template>
-        </el-table-column>
-        <el-table-column label="达人佣金(元)" prop="star_money">
-            <template #default="scope">
-                <span v-if="scope.row.star_money">{{ scope.row.star_money }}</span>
-                <span v-else>-</span>
-            </template>
-        </el-table-column>
-        <el-table-column label="订单量" prop="category_id">
-            <template #default="scope">
-                <span v-if="scope.row.order_num">{{ scope.row.order_num }}</span>
-                <span v-else>-</span>
+                {{ scope.row.order_money?$TOOL.money(scope.row.order_money):'-' }}
             </template>
         </el-table-column>
         <el-table-column label="状态" prop="enable" width="120" align="center">

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

@@ -8,8 +8,8 @@
                 <div class="form-left">
                     <el-row :gutter="10">
                         <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>

+ 173 - 0
src/views/merchant/finance/bills/components/table.vue

@@ -0,0 +1,173 @@
+<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="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="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.sys_fee?$TOOL.money(scope.row.sys_fee):'-' }}</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-group>
+            </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(() => {
+                
+            })
+        },
+        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>

+ 26 - 13
src/views/merchant/finance/bills/index.vue

@@ -4,40 +4,53 @@
             <div class="first-title">财务对账</div>
             <el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleClick">
                 <el-tab-pane label="日汇总" name="day"></el-tab-pane>
-                <el-tab-pane label="月汇总" name="mon"></el-tab-pane>
-                <el-tab-pane label="自定义汇总" name="custom"></el-tab-pane>
+                <!-- <el-tab-pane label="月汇总" name="mon"></el-tab-pane>
+                <el-tab-pane label="自定义汇总" name="custom"></el-tab-pane> -->
             </el-tabs>
             <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 {
             activeName:"day",
-            elType:"1"
+            elType:"1",
+            searchKey:{}
         }
     },
     methods: {
-        handleClick(event){
-            this.activeName = event;
-            if (event=='mon') {
-                this.elType = 2
+        tableHandle(data){
+            this.dataSelect = data;
+        },
+        tableHandleFull(data){
+            this.dataSelectFull = data;
+        },
+        handleSuccess(data){
+            this.searchKey = data;
+            this.$refs.tablePage.upData(data)
+        },
+        handleClick(name){
+            this.activeName = name;
+            if (name == 'mon') {
+                this.elType = "2";
             } else {
-                this.elType = 1
+                this.elType = "1";
             }
-        },
-        handleSuccess(){
-            
+            this.searchKey.type = name;
+            this.$refs.tablePage.upData(this.searchKey)
         }
     }
 }