|
@@ -1,13 +1,13 @@
|
|
|
<style scoped lang="scss">
|
|
|
- ::v-deep a {
|
|
|
- color: #409eff;
|
|
|
- display: block;
|
|
|
- }
|
|
|
+::v-deep a {
|
|
|
+ color: #409eff;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
|
|
|
- p {
|
|
|
- text-align: left;
|
|
|
- margin: 0;
|
|
|
- }
|
|
|
+p {
|
|
|
+ text-align: left;
|
|
|
+ margin: 0;
|
|
|
+}
|
|
|
</style>
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
@@ -69,74 +69,6 @@
|
|
|
>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <!-- <el-table
|
|
|
- v-loading="loadingTotal"
|
|
|
- :data="itemSummary"
|
|
|
- style="margin-bottom: 25px"
|
|
|
- stripe
|
|
|
- >
|
|
|
- <el-table-column label="订单数" align="center" prop="orderNum">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="有效订单数" align="center" prop="validOrderNUm" />
|
|
|
- <el-table-column label="有效率" align="center" prop="validRadio">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{
|
|
|
- scope.row.validRadio
|
|
|
- ? (scope.row.validRadio * 100).toFixed(2) + "%"
|
|
|
- : "-"
|
|
|
- }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="失效订单数"
|
|
|
- align="center"
|
|
|
- prop="invalidOrderNUm"
|
|
|
- />
|
|
|
- <el-table-column label="发货数" align="center" prop="deliveryNum">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="发货率" align="center" prop="deliveryRadio">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{
|
|
|
- scope.row.deliveryRadio
|
|
|
- ? (scope.row.deliveryRadio * 100).toFixed(2) + "%"
|
|
|
- : "-"
|
|
|
- }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="未发货数" align="center" prop="notDeliveryNum">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="实付金额" align="center" prop="payAmount">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ (scope.row.payAmount / 100).toFixed(2) }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="预估服务费收入"
|
|
|
- align="center"
|
|
|
- prop="regimentalPromotionAmount"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{
|
|
|
- scope.row.regimentalPromotionAmount
|
|
|
- ? (scope.row.regimentalPromotionAmount / 100).toFixed(2)
|
|
|
- : "-"
|
|
|
- }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="结算服务费收入"
|
|
|
- align="center"
|
|
|
- prop="totalRegimentalSettleAmount"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{
|
|
|
- scope.row.totalRegimentalSettleAmount
|
|
|
- ? (scope.row.totalRegimentalSettleAmount / 100).toFixed(2)
|
|
|
- : "-"
|
|
|
- }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table> -->
|
|
|
<el-table
|
|
|
v-loading="loading"
|
|
|
:data="typeList"
|
|
@@ -170,9 +102,9 @@
|
|
|
<p>
|
|
|
佣金率:
|
|
|
{{
|
|
|
- scope.row.itemCommissionRate
|
|
|
- ? scope.row.itemCommissionRate / 10 + "%"
|
|
|
- : "-"
|
|
|
+ scope.row.itemCommissionRate
|
|
|
+ ? scope.row.itemCommissionRate / 10 + "%"
|
|
|
+ : "-"
|
|
|
}}
|
|
|
</p>
|
|
|
</div>
|
|
@@ -180,6 +112,16 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="认领人" align="center" prop="userName"></el-table-column>
|
|
|
+ <el-table-column label="ccr" align="center" prop="ccrValue">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <font v-if="scope.row.ccrInt >= 1.5" color="red">
|
|
|
+ {{ scope.row.ccrValue }}
|
|
|
+ </font>
|
|
|
+ <font v-if="scope.row.ccrInt < 1.5">
|
|
|
+ {{ scope.row.ccrValue }}
|
|
|
+ </font>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="商品单价" align="center" prop="reservePrice">
|
|
|
<template slot-scope="scope">
|
|
|
<p
|
|
@@ -226,9 +168,9 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
{{
|
|
|
- scope.row.shippingGreen
|
|
|
- ? (scope.row.shippingGreen * 100).toFixed(2) + "%"
|
|
|
- : "-"
|
|
|
+ scope.row.shippingGreen
|
|
|
+ ? (scope.row.shippingGreen * 100).toFixed(2) + "%"
|
|
|
+ : "-"
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -250,9 +192,9 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
{{
|
|
|
- scope.row.deliveryRadio
|
|
|
- ? (scope.row.deliveryRadio * 100).toFixed(2) + "%"
|
|
|
- : "-"
|
|
|
+ scope.row.deliveryRadio
|
|
|
+ ? (scope.row.deliveryRadio * 100).toFixed(2) + "%"
|
|
|
+ : "-"
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -267,9 +209,9 @@
|
|
|
<el-table-column label="服务费率" align="center" prop="regimentalPromotionRate">
|
|
|
<template slot-scope="scope">
|
|
|
{{
|
|
|
- !!scope.row.regimentalPromotionRate
|
|
|
- ? scope.row.regimentalPromotionRate / 10 + "%"
|
|
|
- : "-"
|
|
|
+ !!scope.row.regimentalPromotionRate
|
|
|
+ ? scope.row.regimentalPromotionRate / 10 + "%"
|
|
|
+ : "-"
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -285,9 +227,9 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
{{
|
|
|
- scope.row.regimentalPromotionAmount
|
|
|
- ? allMoney(scope.row.regimentalPromotionAmount / 100)
|
|
|
- : "-"
|
|
|
+ scope.row.regimentalPromotionAmount
|
|
|
+ ? allMoney(scope.row.regimentalPromotionAmount / 100)
|
|
|
+ : "-"
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -298,9 +240,9 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
{{
|
|
|
- scope.row.totalRegimentalSettleAmount
|
|
|
- ? allMoney(scope.row.totalRegimentalSettleAmount / 100)
|
|
|
- : "-"
|
|
|
+ scope.row.totalRegimentalSettleAmount
|
|
|
+ ? allMoney(scope.row.totalRegimentalSettleAmount / 100)
|
|
|
+ : "-"
|
|
|
}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -317,86 +259,332 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- listType,
|
|
|
- getType,
|
|
|
- delType,
|
|
|
- addType,
|
|
|
- updateType,
|
|
|
- refreshCache,
|
|
|
- } from "@/api/system/dict/type";
|
|
|
- import {
|
|
|
- getOrderList,
|
|
|
- getItemDetail,
|
|
|
- downFilePost,
|
|
|
- getUserItemDetail,
|
|
|
- getUserItemTotal,
|
|
|
- } from "@/api/supplyChain/supplyChain";
|
|
|
+import {
|
|
|
+ listType,
|
|
|
+ getType,
|
|
|
+ delType,
|
|
|
+ addType,
|
|
|
+ updateType,
|
|
|
+ refreshCache,
|
|
|
+} from "@/api/system/dict/type";
|
|
|
+import {
|
|
|
+ getOrderList,
|
|
|
+ getItemDetail,
|
|
|
+ downFilePost,
|
|
|
+ getUserItemDetail,
|
|
|
+ getUserItemTotal,
|
|
|
+} from "@/api/supplyChain/supplyChain";
|
|
|
|
|
|
- var echarts = require("echarts");
|
|
|
- export default {
|
|
|
- name: "ClaimOk",
|
|
|
- dicts: ["sys_normal_disable"],
|
|
|
- data() {
|
|
|
- return {
|
|
|
- downLoadLoading: false,
|
|
|
- dialogTableVisible: false,
|
|
|
- logPage: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- },
|
|
|
- logData: [],
|
|
|
- logTotal: 0,
|
|
|
- logLoading: false,
|
|
|
- // 遮罩层
|
|
|
- loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
- showSearch: true,
|
|
|
- // 总条数
|
|
|
- total: 0,
|
|
|
- // 字典表格数据
|
|
|
- typeList: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
- // 分配销售
|
|
|
- openAllocation: false,
|
|
|
- // 选择的销售id
|
|
|
- saleId: undefined,
|
|
|
- // 获取用户id
|
|
|
- userId: undefined,
|
|
|
- // 销售列表
|
|
|
- saleList: [],
|
|
|
- // 分配销售确定loading
|
|
|
- confirmLoadingSale: false,
|
|
|
- // 日期范围
|
|
|
- dateRange: [],
|
|
|
- // 查询参数
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- itemId: undefined,
|
|
|
- itemTitle: undefined,
|
|
|
- orderStartDate: undefined,
|
|
|
- orderEndDate: undefined,
|
|
|
+var echarts = require("echarts");
|
|
|
+export default {
|
|
|
+ name: "ClaimOk",
|
|
|
+ dicts: ["sys_normal_disable"],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ downLoadLoading: false,
|
|
|
+ dialogTableVisible: false,
|
|
|
+ logPage: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+ logData: [],
|
|
|
+ logTotal: 0,
|
|
|
+ logLoading: false,
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 字典表格数据
|
|
|
+ typeList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 分配销售
|
|
|
+ openAllocation: false,
|
|
|
+ // 选择的销售id
|
|
|
+ saleId: undefined,
|
|
|
+ // 获取用户id
|
|
|
+ userId: undefined,
|
|
|
+ // 销售列表
|
|
|
+ saleList: [],
|
|
|
+ // 分配销售确定loading
|
|
|
+ confirmLoadingSale: false,
|
|
|
+ // 日期范围
|
|
|
+ dateRange: [],
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ itemId: undefined,
|
|
|
+ itemTitle: undefined,
|
|
|
+ orderStartDate: undefined,
|
|
|
+ orderEndDate: undefined,
|
|
|
+ },
|
|
|
+ uploadDate: [new Date(), new Date()],
|
|
|
+ //查询参数所用下拉数据
|
|
|
+ queryParamsList: {},
|
|
|
+ prop: "orderNum",
|
|
|
+ sort: "desc",
|
|
|
+ itemSummary: [],
|
|
|
+ loadingTotal: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ if (
|
|
|
+ this.$route &&
|
|
|
+ this.$route.query.id &&
|
|
|
+ this.$route.query.orderStartDate &&
|
|
|
+ this.$route.query.orderEndDate
|
|
|
+ ) {
|
|
|
+ this.uploadDate = [
|
|
|
+ this.$route.query.orderStartDate,
|
|
|
+ this.$route.query.orderEndDate,
|
|
|
+ ];
|
|
|
+ this.getUserItemTotal();
|
|
|
+ this.getUserItemDetail();
|
|
|
+ } else {
|
|
|
+ let date = new Date();
|
|
|
+ let y = date.getFullYear();
|
|
|
+ let MM = date.getMonth() + 1;
|
|
|
+ MM = MM < 10 ? "0" + MM : MM;
|
|
|
+ let dd = date.getDate();
|
|
|
+ dd = dd < 10 ? "0" + dd : dd;
|
|
|
+ this.uploadDate = [`${y}-${MM}-${dd}`, `${y}-${MM}-${dd}`];
|
|
|
+ this.getUserItemTotal();
|
|
|
+ this.getUserItemDetail();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.downLoadLoading = true;
|
|
|
+ downFilePost(
|
|
|
+ "/isv/supply_chain/exportUserItemDetail",
|
|
|
+ this.addDateRange(
|
|
|
+ {
|
|
|
+ ...this.queryParams,
|
|
|
+ userId: !!this.$route.query.id
|
|
|
+ ? this.$route.query.id
|
|
|
+ : this.$store.getters.roles[0] == "admin" ||
|
|
|
+ this.$store.getters.roles[0] == "supplyChainAdmin"
|
|
|
+ ? null
|
|
|
+ : this.$store.getters.userId,
|
|
|
+ },
|
|
|
+ this.uploadDate,
|
|
|
+ "orderStartDate",
|
|
|
+ "orderEndDate"
|
|
|
+ )
|
|
|
+ ).then((res) => {
|
|
|
+ let blob = new Blob([res], {
|
|
|
+ type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
|
+ });
|
|
|
+ let downloadElement = document.createElement("a");
|
|
|
+ let href = window.URL.createObjectURL(blob); //创建下载的链接
|
|
|
+ downloadElement.href = href;
|
|
|
+ downloadElement.download = `认领列表_${this.uploadDate[0]}-${this.uploadDate[1]}.xlsx`; //下载后文件名
|
|
|
+ document.body.appendChild(downloadElement);
|
|
|
+ downloadElement.click(); //点击下载
|
|
|
+ document.body.removeChild(downloadElement); //下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(href); //释放掉blob对象
|
|
|
+ this.downLoadLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ arraySpanMethod({row, column, rowIndex, columnIndex}) {
|
|
|
+ if (rowIndex === 0) {
|
|
|
+ if (columnIndex === 0) {
|
|
|
+ return [0, 0];
|
|
|
+ } else if (columnIndex === 1) {
|
|
|
+ return [0, 0];
|
|
|
+ } else if (columnIndex === 2) {
|
|
|
+ return [1, 3];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getUserItemTotal() {
|
|
|
+ this.loadingTotal = true;
|
|
|
+ getUserItemTotal(
|
|
|
+ this.addDateRange(
|
|
|
+ {
|
|
|
+ userId: !!this.$route.query.id
|
|
|
+ ? this.$route.query.id
|
|
|
+ : this.$store.getters.roles[0] == "admin" ||
|
|
|
+ this.$store.getters.roles[0] == "supplyChainAdmin"
|
|
|
+ ? null
|
|
|
+ : this.$store.getters.userId,
|
|
|
+ },
|
|
|
+ this.uploadDate,
|
|
|
+ "orderStartDate",
|
|
|
+ "orderEndDate"
|
|
|
+ )
|
|
|
+ ).then((res) => {
|
|
|
+ this.loadingTotal = false;
|
|
|
+ this.itemSummary = [res].map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ itemTitle: "总计",
|
|
|
+ userName: "总计",
|
|
|
+ reservePrice: "总计",
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ sortChange(col, prop, order) {
|
|
|
+ this.prop = col.prop;
|
|
|
+ this.sort = !!col.order ? (col.order == "descending" ? "desc" : "asc") : "desc";
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ toDetail(id) {
|
|
|
+ },
|
|
|
+ toIndexDetail(item) {
|
|
|
+ this.$router.replace({
|
|
|
+ path: "/supplyChain/kuaishou/indexDetails",
|
|
|
+ query: {
|
|
|
+ id: item.promoterId,
|
|
|
+ name: item.promoterNickName,
|
|
|
+ orderStartDate: this.$route.query.orderStartDate,
|
|
|
+ orderEndDate: this.$route.query.orderEndDate,
|
|
|
},
|
|
|
- uploadDate: [new Date(), new Date()],
|
|
|
- //查询参数所用下拉数据
|
|
|
- queryParamsList: {},
|
|
|
- prop: "orderNum",
|
|
|
- sort: "desc",
|
|
|
- itemSummary: [],
|
|
|
- loadingTotal: false,
|
|
|
- };
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getUserItemDetail() {
|
|
|
+ this.loading = true;
|
|
|
+ getUserItemDetail(
|
|
|
+ this.addDateRange(
|
|
|
+ {
|
|
|
+ ...this.queryParams,
|
|
|
+ fieId: this.prop,
|
|
|
+ sort: this.sort,
|
|
|
+ userId: !!this.$route.query.id
|
|
|
+ ? this.$route.query.id
|
|
|
+ : this.$store.getters.roles[0] == "admin" ||
|
|
|
+ this.$store.getters.roles[0] == "supplyChainAdmin"
|
|
|
+ ? null
|
|
|
+ : this.$store.getters.userId,
|
|
|
+ },
|
|
|
+ this.uploadDate,
|
|
|
+ "orderStartDate",
|
|
|
+ "orderEndDate"
|
|
|
+ )
|
|
|
+ ).then((response) => {
|
|
|
+ this.typeList = this.itemSummary.concat(response.rows);
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getSummaries(param) {
|
|
|
+ console.log(param);
|
|
|
+ const {columns, data} = param;
|
|
|
+ const sums = [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = "总计";
|
|
|
+ return;
|
|
|
+ } else if (index == 1) {
|
|
|
+ sums[index] = "N/A";
|
|
|
+ return;
|
|
|
+ } else if (index == 9) {
|
|
|
+ sums[index] = "-";
|
|
|
+ return;
|
|
|
+ } else if (index == 2) {
|
|
|
+ sums[index] = "-";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (const key in this.itemSummary[0]) {
|
|
|
+ if (key == column.property) {
|
|
|
+ if (key == "validRadio" || key == "deliveryRadio") {
|
|
|
+ sums[index] = this.itemSummary[0][key]
|
|
|
+ ? (this.itemSummary[0][key] * 100).toFixed(2) + "%"
|
|
|
+ : "-";
|
|
|
+ } else if (
|
|
|
+ key == "payAmount" ||
|
|
|
+ key == "regimentalPromotionAmount" ||
|
|
|
+ key == "totalRegimentalSettleAmount"
|
|
|
+ ) {
|
|
|
+ sums[index] = this.itemSummary[0][key]
|
|
|
+ ? this.itemSummary[0][key] / 100
|
|
|
+ : "-";
|
|
|
+ } else {
|
|
|
+ sums[index] = this.itemSummary[0][key];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // const values = data.map((item) => Number(item[column.property]));
|
|
|
+ // console.log(values)
|
|
|
+ // if (!values.every((value) => isNaN(value))) {
|
|
|
+ // sums[index] = values.reduce((prev, curr) => {
|
|
|
+ // const value = Number(curr);
|
|
|
+ // if (!isNaN(value)) {
|
|
|
+ // return prev + curr;
|
|
|
+ // } else {
|
|
|
+ // return prev;
|
|
|
+ // }
|
|
|
+ // }, 0);
|
|
|
+ // // sums[index] += " 元";
|
|
|
+ // } else {
|
|
|
+ // sums[index] = "N/A";
|
|
|
+ // }
|
|
|
+ });
|
|
|
+
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
+ /** 查询字典类型列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ getOrderList(
|
|
|
+ this.addDateRange(
|
|
|
+ this.queryParams,
|
|
|
+ this.uploadDate,
|
|
|
+ "orderStartDate",
|
|
|
+ "orderEndDate"
|
|
|
+ )
|
|
|
+ ).then((response) => {
|
|
|
+ this.typeList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
},
|
|
|
- created() {
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.confirmLoading = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {};
|
|
|
+ this.dateFile = null;
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getUserItemTotal();
|
|
|
+ this.getUserItemDetail();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.dateRange = [];
|
|
|
+ // let date = new Date();
|
|
|
+ // let y = date.getFullYear();
|
|
|
+ // let MM = date.getMonth() + 1;
|
|
|
+ // MM = MM < 10 ? "0" + MM : MM;
|
|
|
+ // let dd = date.getDate();
|
|
|
+ // dd = dd < 10 ? "0" + dd : dd;
|
|
|
if (
|
|
|
this.$route &&
|
|
|
this.$route.query.id &&
|
|
@@ -407,7 +595,6 @@
|
|
|
this.$route.query.orderStartDate,
|
|
|
this.$route.query.orderEndDate,
|
|
|
];
|
|
|
- this.getUserItemTotal();
|
|
|
this.getUserItemDetail();
|
|
|
} else {
|
|
|
let date = new Date();
|
|
@@ -417,261 +604,16 @@
|
|
|
let dd = date.getDate();
|
|
|
dd = dd < 10 ? "0" + dd : dd;
|
|
|
this.uploadDate = [`${y}-${MM}-${dd}`, `${y}-${MM}-${dd}`];
|
|
|
- this.getUserItemTotal();
|
|
|
this.getUserItemDetail();
|
|
|
}
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.handleQuery();
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.$nextTick(() => {
|
|
|
- });
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- this.downLoadLoading = true;
|
|
|
- downFilePost(
|
|
|
- "/isv/supply_chain/exportUserItemDetail",
|
|
|
- this.addDateRange(
|
|
|
- {
|
|
|
- ...this.queryParams,
|
|
|
- userId: !!this.$route.query.id
|
|
|
- ? this.$route.query.id
|
|
|
- : this.$store.getters.roles[0] == "admin" ||
|
|
|
- this.$store.getters.roles[0] == "supplyChainAdmin"
|
|
|
- ? null
|
|
|
- : this.$store.getters.userId,
|
|
|
- },
|
|
|
- this.uploadDate,
|
|
|
- "orderStartDate",
|
|
|
- "orderEndDate"
|
|
|
- )
|
|
|
- ).then((res) => {
|
|
|
- let blob = new Blob([res], {
|
|
|
- type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
|
- });
|
|
|
- let downloadElement = document.createElement("a");
|
|
|
- let href = window.URL.createObjectURL(blob); //创建下载的链接
|
|
|
- downloadElement.href = href;
|
|
|
- downloadElement.download = `认领列表_${this.uploadDate[0]}-${this.uploadDate[1]}.xlsx`; //下载后文件名
|
|
|
- document.body.appendChild(downloadElement);
|
|
|
- downloadElement.click(); //点击下载
|
|
|
- document.body.removeChild(downloadElement); //下载完成移除元素
|
|
|
- window.URL.revokeObjectURL(href); //释放掉blob对象
|
|
|
- this.downLoadLoading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- arraySpanMethod({row, column, rowIndex, columnIndex}) {
|
|
|
- if (rowIndex === 0) {
|
|
|
- if (columnIndex === 0) {
|
|
|
- return [0, 0];
|
|
|
- } else if (columnIndex === 1) {
|
|
|
- return [0, 0];
|
|
|
- } else if (columnIndex === 2) {
|
|
|
- return [1, 3];
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- getUserItemTotal() {
|
|
|
- this.loadingTotal = true;
|
|
|
- getUserItemTotal(
|
|
|
- this.addDateRange(
|
|
|
- {
|
|
|
- userId: !!this.$route.query.id
|
|
|
- ? this.$route.query.id
|
|
|
- : this.$store.getters.roles[0] == "admin" ||
|
|
|
- this.$store.getters.roles[0] == "supplyChainAdmin"
|
|
|
- ? null
|
|
|
- : this.$store.getters.userId,
|
|
|
- },
|
|
|
- this.uploadDate,
|
|
|
- "orderStartDate",
|
|
|
- "orderEndDate"
|
|
|
- )
|
|
|
- ).then((res) => {
|
|
|
- this.loadingTotal = false;
|
|
|
- this.itemSummary = [res].map((item) => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- itemTitle: "总计",
|
|
|
- userName: "总计",
|
|
|
- reservePrice: "总计",
|
|
|
- };
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- sortChange(col, prop, order) {
|
|
|
- this.prop = col.prop;
|
|
|
- this.sort = !!col.order ? (col.order == "descending" ? "desc" : "asc") : "desc";
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- toDetail(id) {
|
|
|
- },
|
|
|
- toIndexDetail(item) {
|
|
|
- this.$router.replace({
|
|
|
- path: "/supplyChain/kuaishou/indexDetails",
|
|
|
- query: {
|
|
|
- id: item.promoterId,
|
|
|
- name: item.promoterNickName,
|
|
|
- orderStartDate: this.$route.query.orderStartDate,
|
|
|
- orderEndDate: this.$route.query.orderEndDate,
|
|
|
- },
|
|
|
- });
|
|
|
- },
|
|
|
- getUserItemDetail() {
|
|
|
- this.loading = true;
|
|
|
- getUserItemDetail(
|
|
|
- this.addDateRange(
|
|
|
- {
|
|
|
- ...this.queryParams,
|
|
|
- fieId: this.prop,
|
|
|
- sort: this.sort,
|
|
|
- userId: !!this.$route.query.id
|
|
|
- ? this.$route.query.id
|
|
|
- : this.$store.getters.roles[0] == "admin" ||
|
|
|
- this.$store.getters.roles[0] == "supplyChainAdmin"
|
|
|
- ? null
|
|
|
- : this.$store.getters.userId,
|
|
|
- },
|
|
|
- this.uploadDate,
|
|
|
- "orderStartDate",
|
|
|
- "orderEndDate"
|
|
|
- )
|
|
|
- ).then((response) => {
|
|
|
- this.typeList = this.itemSummary.concat(response.rows);
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- getSummaries(param) {
|
|
|
- console.log(param);
|
|
|
- const {columns, data} = param;
|
|
|
- const sums = [];
|
|
|
- columns.forEach((column, index) => {
|
|
|
- if (index === 0) {
|
|
|
- sums[index] = "总计";
|
|
|
- return;
|
|
|
- } else if (index == 1) {
|
|
|
- sums[index] = "N/A";
|
|
|
- return;
|
|
|
- } else if (index == 9) {
|
|
|
- sums[index] = "-";
|
|
|
- return;
|
|
|
- } else if (index == 2) {
|
|
|
- sums[index] = "-";
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- for (const key in this.itemSummary[0]) {
|
|
|
- if (key == column.property) {
|
|
|
- if (key == "validRadio" || key == "deliveryRadio") {
|
|
|
- sums[index] = this.itemSummary[0][key]
|
|
|
- ? (this.itemSummary[0][key] * 100).toFixed(2) + "%"
|
|
|
- : "-";
|
|
|
- } else if (
|
|
|
- key == "payAmount" ||
|
|
|
- key == "regimentalPromotionAmount" ||
|
|
|
- key == "totalRegimentalSettleAmount"
|
|
|
- ) {
|
|
|
- sums[index] = this.itemSummary[0][key]
|
|
|
- ? this.itemSummary[0][key] / 100
|
|
|
- : "-";
|
|
|
- } else {
|
|
|
- sums[index] = this.itemSummary[0][key];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // const values = data.map((item) => Number(item[column.property]));
|
|
|
- // console.log(values)
|
|
|
- // if (!values.every((value) => isNaN(value))) {
|
|
|
- // sums[index] = values.reduce((prev, curr) => {
|
|
|
- // const value = Number(curr);
|
|
|
- // if (!isNaN(value)) {
|
|
|
- // return prev + curr;
|
|
|
- // } else {
|
|
|
- // return prev;
|
|
|
- // }
|
|
|
- // }, 0);
|
|
|
- // // sums[index] += " 元";
|
|
|
- // } else {
|
|
|
- // sums[index] = "N/A";
|
|
|
- // }
|
|
|
- });
|
|
|
-
|
|
|
- return sums;
|
|
|
- },
|
|
|
- /** 查询字典类型列表 */
|
|
|
- getList() {
|
|
|
- this.loading = true;
|
|
|
- getOrderList(
|
|
|
- this.addDateRange(
|
|
|
- this.queryParams,
|
|
|
- this.uploadDate,
|
|
|
- "orderStartDate",
|
|
|
- "orderEndDate"
|
|
|
- )
|
|
|
- ).then((response) => {
|
|
|
- this.typeList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.confirmLoading = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {};
|
|
|
- this.dateFile = null;
|
|
|
- this.resetForm("form");
|
|
|
- },
|
|
|
- /** 搜索按钮操作 */
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getUserItemTotal();
|
|
|
- this.getUserItemDetail();
|
|
|
- },
|
|
|
- /** 重置按钮操作 */
|
|
|
- resetQuery() {
|
|
|
- this.dateRange = [];
|
|
|
- // let date = new Date();
|
|
|
- // let y = date.getFullYear();
|
|
|
- // let MM = date.getMonth() + 1;
|
|
|
- // MM = MM < 10 ? "0" + MM : MM;
|
|
|
- // let dd = date.getDate();
|
|
|
- // dd = dd < 10 ? "0" + dd : dd;
|
|
|
- if (
|
|
|
- this.$route &&
|
|
|
- this.$route.query.id &&
|
|
|
- this.$route.query.orderStartDate &&
|
|
|
- this.$route.query.orderEndDate
|
|
|
- ) {
|
|
|
- this.uploadDate = [
|
|
|
- this.$route.query.orderStartDate,
|
|
|
- this.$route.query.orderEndDate,
|
|
|
- ];
|
|
|
- this.getUserItemDetail();
|
|
|
- } else {
|
|
|
- let date = new Date();
|
|
|
- let y = date.getFullYear();
|
|
|
- let MM = date.getMonth() + 1;
|
|
|
- MM = MM < 10 ? "0" + MM : MM;
|
|
|
- let dd = date.getDate();
|
|
|
- dd = dd < 10 ? "0" + dd : dd;
|
|
|
- this.uploadDate = [`${y}-${MM}-${dd}`, `${y}-${MM}-${dd}`];
|
|
|
- this.getUserItemDetail();
|
|
|
- }
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map((item) => item.id);
|
|
|
- },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
},
|
|
|
- };
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|