| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592 |
- <template>
- <div>
- <div class="i-title">{{ title }}</div>
- <div>
- <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
- <el-tab-pane label="实际营收" name="1">
- <div class="header-bar">
- <div>
- <el-row>
- <el-col :span="3"><span class="text-title">实际营收</span></el-col>
- <el-col :span="3" :offset="1"><span class="text-title">托管</span></el-col>
- <el-col :span="3" :offset="1"><span class="text-title">退款</span></el-col>
- </el-row>
- </div>
- <div>
- <el-row>
- <el-col :span="3"><span class="red">{{ headerBar.revenue }}</span></el-col>
- <el-col :span="3" :offset="1"><span class="red">{{ headerBar.trusteeship }}</span></el-col>
- <el-col :span="3" :offset="1"><span class="green">{{ headerBar.refund }}</span></el-col>
- </el-row>
- </div>
- <div>
- <el-row>
- <el-col :span="3"><span>共{{ headerBar.revenueCount }}笔</span></el-col>
- <el-col :span="3" :offset="1"><span>共{{ headerBar.trusteeshipCount }}笔</span></el-col>
- <el-col :span="3" :offset="1"><span>共{{ headerBar.refundCount }}笔</span></el-col>
- </el-row>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="托管" name="2">
- <div class="header-bar">
- <div>
- <el-row>
- <el-col :span="3"><span class="text-title">实际营收</span></el-col>
- <el-col :span="3" :offset="1"><span class="text-title">托管</span></el-col>
- <el-col :span="3" :offset="1"><span class="text-title">退款</span></el-col>
- </el-row>
- </div>
- <div>
- <el-row>
- <el-col :span="3"><span class="red">{{ headerBar.revenue }}</span></el-col>
- <el-col :span="3" :offset="1"><span class="red">{{ headerBar.trusteeship }}</span></el-col>
- <el-col :span="3" :offset="1"><span class="green">{{ headerBar.refund }}</span></el-col>
- </el-row>
- </div>
- <div>
- <el-row>
- <el-col :span="3"><span>共{{ headerBar.revenueCount }}笔</span></el-col>
- <el-col :span="3" :offset="1"><span>共{{ headerBar.trusteeshipCount }}笔</span></el-col>
- <el-col :span="3" :offset="1"><span>共{{ headerBar.refundCount }}笔</span></el-col>
- </el-row>
- </div>
- </div>
- </el-tab-pane>
- <el-tab-pane label="退款" name="3">
- <div class="header-bar">
- <div>
- <el-row>
- <el-col :span="3"><span class="text-title">实际营收</span></el-col>
- <el-col :span="3" :offset="1"><span class="text-title">托管</span></el-col>
- <el-col :span="3" :offset="1"><span class="text-title">退款</span></el-col>
- </el-row>
- </div>
- <div>
- <el-row>
- <el-col :span="3"><span class="red">{{ headerBar.revenue }}</span></el-col>
- <el-col :span="3" :offset="1"><span class="red">{{ headerBar.trusteeship }}</span></el-col>
- <el-col :span="3" :offset="1"><span class="green">{{ headerBar.refund }}</span></el-col>
- </el-row>
- </div>
- <div>
- <el-row>
- <el-col :span="3"><span>共{{ headerBar.revenueCount }}笔</span></el-col>
- <el-col :span="3" :offset="1"><span>共{{ headerBar.trusteeshipCount }}笔</span></el-col>
- <el-col :span="3" :offset="1"><span>共{{ headerBar.refundCount }}笔</span></el-col>
- </el-row>
- </div>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- <div style="text-align: right;margin-bottom: 10px">
- <el-button @click="exportList" class="export-excel" type="primary">导出报表</el-button>
- </div>
- <div>
- <el-table :data="tableData" border width="100%">
- <el-table-column label="订单名称">
- <template slot-scope="scope">
- <span class="lblue point">
- <nuxt-link
- target="_blank"
- :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
- >{{ scope.row.product_title }}</nuxt-link>
- </span>
- </template>
- </el-table-column>
- <el-table-column label="用户">
- <template slot-scope="scope">
- <a
- class="link-type"
- :href="scope.row.user_url"
- target="_blank"
- >{{ scope.row.user_info.nickname }}({{ scope.row.uid }})</a>
- </template>
- </el-table-column>
- <el-table-column label="实际金额">
- <template slot-scope="scope">
- <template v-if="scope.row.channel != 'admin_confirm'">
- <!-- 技术信用-->
- <div
- v-if="scope.row.product_type == 13"
- >
- <!--退款-->
- <span
- v-if="scope.row.order_type == 8"
- >{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <template v-else-if="scope.row.order_type == 4">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance'" class="red">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </template>
- <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- </div>
- <!-- 提现-->
- <div v-else-if="scope.row.product_type == 200">
- <span class="green">
- {{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </div>
- <!-- 充值-->
- <div v-else-if="scope.row.product_type == 3">
- <div v-if="scope.row.operator_uid==41266">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </div>
- <div v-else>
- <span class="red">+{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- </div>
- </div>
- <!-- 扣款-->
- <div v-else-if="scope.row.product_type == 300">
- <div v-if="scope.row.operator_uid==41266">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </div>
- <div v-else>
- <span class="red">+{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- </div>
- </div>
- <!-- 云端意向金-->
- <div v-else-if="scope.row.product_type == 8">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance'" class="red">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </div>
- <!-- 雇佣-->
- <div v-else-if="scope.row.product_type == 4">
- <!--退款-->
- <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- <!--结薪-->
- <span v-else-if="scope.row.order_type == 5">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- <template v-else-if="scope.row.order_type == 4 || scope.row.order_type == 1">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance'" class="red">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </template>
- <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- </div>
- <!-- 云端押金-->
- <div v-else-if="scope.row.product_type == 400">
- <!--退款-->
- <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- <template v-else-if="scope.row.order_type == 1">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance'" class="red">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </template>
- <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- </div>
- <!-- 云端工作-->
- <div v-else-if="scope.row.product_type == 9">
- <!--退款-->
- <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- <!--结薪-->
- <template v-else-if="scope.row.order_type == 5">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" class="green">
- {{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- {{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </template>
- <!--托管-->
- <template v-else-if="scope.row.order_type == 1">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance'" class="red">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </template>
- <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- </div>
- <!-- 整包-->
- <div v-else-if="scope.row.product_type == 2">
- <!--退款-->
- <span v-if="scope.row.order_type == 8">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- <!--结薪-->
- <template v-else-if="scope.row.order_type == 5">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" class="green">
- {{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- {{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </template>
- <!--托管-->
- <template v-else-if="scope.row.order_type == 1">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" class="red">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </template>
- <!--解冻-->
- <template v-else-if="scope.row.order_type == 7">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance' && scope.row.channel != 'qingtuanbao'" class="green">
- {{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- {{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </template>
- <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- </div>
- <!-- 查看机会-->
- <div v-else-if="scope.row.product_type == 1">
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance'" class="red">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </div>
- <!-- 其他-->
- <div v-else>
- <!--如果不是余额购买-->
- <span v-if="scope.row.channel != 'balance'" class="red">
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- <span v-else>
- +{{ (scope.row.real_amount / 100).toFixed(2) }}
- </span>
- </div>
- </template>
- <template v-else>
- <div v-if="scope.row.operator_uid != '41266'">
- <span
- v-if="parseInt(scope.row.real_amount)>0"
- class="red"
- >+{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- <span
- v-else-if="parseInt(scope.row.real_amount) == 0">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- <span v-else class="green">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- </div>
- <div v-else>
- <span
- v-if="parseInt(scope.row.real_amount)>0"
- >+{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- <span
- v-else-if="parseInt(scope.row.real_amount) == 0">{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- <span v-else>{{ (scope.row.real_amount / 100).toFixed(2) }}</span>
- </div>
- </template>
- </template>
- </el-table-column>
- <el-table-column prop="channel_name" label="支付方式"></el-table-column>
- <el-table-column prop="order_state_name" label="订单状态"></el-table-column>
- <el-table-column prop label="创建时间">
- <template slot-scope="scope">
- <span>{{ formatDate(scope.row.created_at) }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="name" label="到账时间">
- <template slot-scope="scope">
- <span>{{ formatDate(scope.row.pay_time) }}</span>
- </template>
- </el-table-column>
- <el-table-column prop label="订单编号">
- <template slot-scope="scope">
- <nuxt-link
- target="_blank"
- :to="{path:'/main/orders_detail?id='+scope.row.order_no}"
- >{{ scope.row.order_no }}
- </nuxt-link>
- </template>
- </el-table-column>
- <el-table-column prop="out_order_id" label="支付编号"></el-table-column>
- <el-table-column width="100" label="订单类型">
- <template slot-scope="scope">{{ scope.row.product_type_name }}</template>
- </el-table-column>
- <el-table-column prop="order_type_name" label="交易类型">
- <template slot-scope="scope">
- <span>{{ scope.row.order_type_name }}</span>
- </template>
- </el-table-column>
- <el-table-column label="关联项目">
- <template slot-scope="scope">
- <a
- :href="scope.row.related_project.url?scope.row.related_project.url:'#'"
- target="_blank"
- >
- <span
- class="lblue"
- >{{ scope.row.related_project.name ? scope.row.related_project.name : "--" }}</span>
- </a>
- </template>
- </el-table-column>
- <el-table-column prop="operator_uid" label="人工">
- <template slot-scope="scope">
- <span v-if="scope.row.operator_info.nickname">{{ scope.row.operator_info.nickname }}</span>
- <span>({{ scope.row.operator_uid }})</span>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div>
- <el-pagination
- @current-change="onClickPage"
- :current-page.sync="pageInfo.page"
- :page-size="pageInfo.size"
- layout="total, prev, pager, next"
- :total="pageInfo.total"
- ></el-pagination>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- pageInfo: {
- page: 1,
- size: 20,
- total: 0,
- },
- headerBar: {
- revenue: 0,
- trusteeship: 0,
- refund: 0,
- revenueCount: 0,
- trusteeshipCount: 0,
- refundCount: 0,
- },
- title: "",
- activeName: '1',
- orderType: "",
- tableData: [],
- queryData: {}
- };
- },
- mounted() {
- if (!this.queryDataFormat()) {
- return false;
- }
- this.getHeaderBar();
- this.getTableData();
- },
- methods: {
- // 获取列表数据
- async getTableData() {
- this.$post("/api/admin/order/get_orders", this.queryData).then(res => {
- let data = res.data;
- if (res.status === 1) {
- this.tableData = data.orders;
- this.pageInfo.total = data.count;
- }
- });
- },
- async getHeaderBar() {
- if (!this.queryData.start_time || !this.queryData.end_time || !this.queryData.product_type) {
- this.$message.error('参数异常');
- return;
- }
- let data = {
- start_time: this.queryData.start_time,
- end_time: this.queryData.end_time,
- product_type: this.queryData.product_type
- };
- this.$post("/api/admin/ReportForm/getFormBar", data).then(res => {
- let data = res.data;
- if (res.status === 1) {
- this.headerBar.trusteeship = data.trusteeshipAmount * 1;
- this.headerBar.refund = data.refundAmount * 1;
- this.headerBar.trusteeshipCount = data.trusteeshipCount;
- this.headerBar.refundCount = data.refundCount;
- let amount = data.trusteeshipAmount - data.refundAmount;
- let count = data.trusteeshipCount - data.refundCount;
- this.headerBar.revenue = amount > 0 ? amount : 0;
- this.headerBar.revenueCount = count > 0 ? count : 0;
- }
- });
- },
- async exportList() {
- let url =
- window.location.host +
- "/api/admin/order/export?product_type=" +
- this.queryData.product_type +
- "&start_time=" +
- this.queryData.start_time +
- "&end_time=" +
- this.queryData.end_time +
- "&date_type=" +
- this.queryData.date_type +
- "&status=" +
- this.queryData.status +
- "&artificial_mark=" +
- 0;
- if (this.orderType !== "") {
- url += "&order_type=" + this.orderType;
- } else {
- url += "&active_name=all";
- }
- window.location.href = "http://" + url;
- },
- onClickPage(){
- this.queryDataFormat();
- this.getTableData();
- },
- handleClick(tab, event) {
- if (tab.name === "2") {
- this.orderType = "1"; //托管
- } else if (tab.name === "3") {
- this.orderType = "8"; //退款
- } else {
- this.orderType = "";
- }
- this.queryDataFormat();
- this.getTableData();
- },
- queryDataFormat() {
- let query = this.$route.query;
- if (JSON.stringify(query) === "{}") {
- this.$message.error('参数不正确');
- return false;
- }
- this.orderType = this.orderType !== "" ? this.orderType : query.orderType || this.orderType;
- let data = {
- view: "platform",
- product_type: query.product_type, //项目类型2整包4雇佣9云端
- start_time: query.start_time,
- end_time: query.end_time,
- date_type: query.date_type || 2, //1到账时间2创建时间
- status: 401, //401订单支付成功
- artificial_mark: 0, //0为开启人工财务1开启
- page: this.pageInfo.page,
- page_size: this.pageInfo.size
- }
- if (this.orderType !== "") {
- data.order_type = this.orderType;
- } else {
- data.active_name = 'all';
- }
- this.formatTitle(data.product_type);
- this.queryData = data;
- return true;
- },
- formatTitle(type) {
- type = type * 1;
- let title = '';
- switch (type) {
- case 2:
- title = '整包';
- break;
- case 4:
- title = '雇佣';
- break;
- case 9:
- title = '云端';
- break;
- case 11:
- title = '会员';
- break;
- case 12:
- title = '认证';
- break;
- case 55:
- title = '查看联系方式';
- break;
- }
- this.title = title + "项目详情";
- },
- formatDate(time) {
- if (time === "0") {
- return "--";
- }
- let now = new Date(time * 1000);
- let year = now.getFullYear();
- let month = now.getMonth() + 1;
- let date = now.getDate();
- let hour = now.getHours();
- let minute = now.getMinutes();
- let second = now.getSeconds();
- if (hour < 10) {
- hour = "0" + hour;
- }
- if (minute < 10) {
- minute = "0" + minute;
- }
- if (second < 10) {
- second = "0" + second;
- }
- return (
- year +
- "-" +
- month +
- "-" +
- date +
- " " +
- hour +
- ":" +
- minute +
- ":" +
- second
- );
- },
- }
- };
- </script>
- <style scoped>
- .i-title {
- margin: 0 0 10px 10px;
- font-size: 20px;
- font-weight: 600;
- }
- .table {
- height: calc(100% - 80px);
- }
- .text-title {
- font-weight: 600;
- }
- .header-bar > div {
- margin-bottom: 5px;
- }
- .green {
- color: rgba(37, 155, 36, 1);
- }
- .orange {
- color: rgba(255, 152, 0, 1);
- }
- .red {
- color: rgb(255, 2, 30);
- }
- </style>
|