|
@@ -1,6 +1,23 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+
|
|
|
+ <el-form-item label="是否结算" prop="categoryId">
|
|
|
+ <el-select
|
|
|
+ filterable
|
|
|
+ v-model="queryParams.status"
|
|
|
+ placeholder="选择媒体"
|
|
|
+ clearable
|
|
|
+ style="width: 240px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in queryParamsList.statusList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="达人名称" prop="promoterName">
|
|
|
<el-input
|
|
|
style="width: 240px"
|
|
@@ -41,7 +58,7 @@
|
|
|
|
|
|
<el-form-item label="选择日期">
|
|
|
<el-date-picker
|
|
|
- v-model="requestUploadDate"
|
|
|
+ v-model="uploadDate"
|
|
|
style="width: 240px"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
format="yyyy-MM-dd"
|
|
@@ -56,6 +73,14 @@
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="toAdd()"
|
|
|
+ >新增激励
|
|
|
+ </el-button>
|
|
|
|
|
|
<el-button
|
|
|
type="primary"
|
|
@@ -73,24 +98,40 @@
|
|
|
@click="downloadTem"
|
|
|
>下载模版
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ size="mini"
|
|
|
+ @click="upload"
|
|
|
+ style="margin-bottom: 15px"
|
|
|
+ >导出
|
|
|
+ </el-button
|
|
|
+ >
|
|
|
+
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
|
|
|
|
|
|
- <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
|
|
+ </el-form>
|
|
|
|
|
|
- <el-table-column
|
|
|
- label="结算类型"
|
|
|
- align="center"
|
|
|
- prop="activityItemStatus" width="100px"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-if="!!scope.row.promoterType">
|
|
|
- {{ scope.row.promoterType | promoterTypeName }}
|
|
|
- </div>
|
|
|
- <div v-else>-</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange"
|
|
|
+ :row-style="TableRowStyle"
|
|
|
+ >
|
|
|
+
|
|
|
+ <!-- <el-table-column
|
|
|
+ label="结算类型"
|
|
|
+ align="center"
|
|
|
+ prop="activityItemStatus" width="100px"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="!!scope.row.promoterType">
|
|
|
+ {{ scope.row.promoterType | promoterTypeName }}
|
|
|
+ </div>
|
|
|
+ <div v-else>-</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ <el-table-column label="渠道" align="center" prop="promoterCreateName"/>
|
|
|
+ <el-table-column label="招商" align="center" prop="itemCreateName"/>
|
|
|
<el-table-column label="日期" align="center" prop="statDate" width="100px"/>
|
|
|
<el-table-column label="达人名称" align="center" prop="promoterName" width="120px">
|
|
|
<template slot-scope="scope">
|
|
@@ -113,7 +154,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="达人ID" align="center" prop="promoterId" width="100px"/>
|
|
|
- <el-table-column label="渠道" align="center" prop="promoterCreateName" width="100px"/>
|
|
|
+
|
|
|
<el-table-column label="商品名称" align="center" prop="itemTitle" width="280px">
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display: flex; width: 100%">
|
|
@@ -135,7 +176,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="商品id" align="center" prop="itemId" width="140px"/>
|
|
|
- <el-table-column label="招商" align="center" prop="itemCreateName" width="100px"/>
|
|
|
+
|
|
|
<el-table-column label="累计结算单量" align="center" prop="totalSettlementNum" width="100px"/>
|
|
|
<el-table-column label="本次结算单量" align="center" prop="currentSettlementNum" width="100px"/>
|
|
|
<el-table-column label="结算单价" align="center" prop="settlementPrice" width="100px"/>
|
|
@@ -151,8 +192,13 @@
|
|
|
</el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px">
|
|
|
+
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160px">
|
|
|
+
|
|
|
<template slot-scope="scope">
|
|
|
+ <el-button size="mini" :disabled="scope.row.status == 2" type="text" @click="jiesuan(scope.row)">结算
|
|
|
+ </el-button>
|
|
|
+
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
@@ -266,23 +312,33 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {listInfo, getInfo, delInfo, addInfo, updateInfo, getTotal, importData} from "@/api/goodsManagement/financeData";
|
|
|
-import item from "@/layout/components/Sidebar/Item.vue";
|
|
|
+import {
|
|
|
+ listInfo,
|
|
|
+ getInfo,
|
|
|
+ delInfo,
|
|
|
+ addInfo,
|
|
|
+ updateInfo,
|
|
|
+ getTotal,
|
|
|
+ importData,
|
|
|
+ updateStatus
|
|
|
+} from "@/api/goodsManagement/financeData";
|
|
|
+import {downFilePost} from "@/api/supplyChain/supplyChain";
|
|
|
|
|
|
|
|
|
export default {
|
|
|
- name: "FinanceDataDetail",
|
|
|
+ name: "financeDataDetail",
|
|
|
+ dicts: ["sys_normal_disable"],
|
|
|
data() {
|
|
|
return {
|
|
|
importTitle: null,
|
|
|
+ title: null,
|
|
|
showItemSech: true,
|
|
|
showPromoterSech: true,
|
|
|
confirmLoading: false,
|
|
|
dateFile: null,
|
|
|
fileList: [],
|
|
|
importOpen: false,
|
|
|
- uploadDate: new Date(),
|
|
|
- requestUploadDate: [],
|
|
|
+ uploadDate: [new Date(), new Date()],
|
|
|
userId: null,
|
|
|
// 遮罩层
|
|
|
loading: false,
|
|
@@ -310,8 +366,16 @@ export default {
|
|
|
itemTitle: null,
|
|
|
promoterId: null,
|
|
|
promoterName: null,
|
|
|
+ status: null,
|
|
|
statDate: null
|
|
|
},
|
|
|
+ queryParamsList: {
|
|
|
+
|
|
|
+ statusList: [
|
|
|
+ {value: 1, label: "未结算"},
|
|
|
+ {value: 2, label: "已结算"},
|
|
|
+ ],
|
|
|
+ },
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
@@ -328,9 +392,9 @@ export default {
|
|
|
MM = MM < 10 ? "0" + MM : MM;
|
|
|
let dd = date.getDate();
|
|
|
dd = dd < 10 ? "0" + dd : dd;
|
|
|
- this.uploadDate = `${y}-${MM}-${dd}`;
|
|
|
-
|
|
|
+ this.uploadDate = [`${y}-${MM}-${dd}`, `${y}-${MM}-${dd}`];
|
|
|
this.getList();
|
|
|
+ this.getListTotal();
|
|
|
},
|
|
|
|
|
|
filters: {
|
|
@@ -345,6 +409,100 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
+ upload() {
|
|
|
+ if (this.$route.query.promoterId) {
|
|
|
+ this.queryParams.promoterId = this.$route.query.promoterId
|
|
|
+ this.uploadDate = []
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$route.query.itemId) {
|
|
|
+ this.queryParams.itemId = this.$route.query.itemId
|
|
|
+ this.uploadDate = []
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ downFilePost("/finance/reward/exportDetail",
|
|
|
+ this.addDateRange(
|
|
|
+ this.queryParams,
|
|
|
+ this.uploadDate,
|
|
|
+ "startDate",
|
|
|
+ "endDate"
|
|
|
+ )
|
|
|
+ ).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 = "激励结算详情.xlsx"; //下载后文件名
|
|
|
+ document.body.appendChild(downloadElement);
|
|
|
+ downloadElement.click(); //点击下载
|
|
|
+ document.body.removeChild(downloadElement); //下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(href); //释放掉blob对象
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getListTotal() {
|
|
|
+ if (this.$route.query.promoterId) {
|
|
|
+ this.queryParams.promoterId = this.$route.query.promoterId
|
|
|
+ this.uploadDate = []
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$route.query.itemId) {
|
|
|
+ this.queryParams.itemId = this.$route.query.itemId
|
|
|
+ this.uploadDate = []
|
|
|
+ }
|
|
|
+ getTotal(
|
|
|
+ this.addDateRange(
|
|
|
+ {
|
|
|
+ ...this.queryParams
|
|
|
+ },
|
|
|
+ this.uploadDate,
|
|
|
+ "startDate",
|
|
|
+ "endDate"
|
|
|
+ )
|
|
|
+ ).then((res) => {
|
|
|
+ this.itemSummary = [res].map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ itemTitle: "总计",
|
|
|
+ userName: "总计"
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ jiesuan(item) {
|
|
|
+ this.$modal
|
|
|
+ .confirm(`请确认是否结算此数据?`)
|
|
|
+ .then(() => {
|
|
|
+ var params = {};
|
|
|
+ params.id = item.id;
|
|
|
+ updateStatus(params)
|
|
|
+ .then((res) => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("结算成功");
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ TableRowStyle({row, rowIndex}) {
|
|
|
+ // 注意,这里返回的是一个对象
|
|
|
+ let rowBackground = {};
|
|
|
+ if (row.status == 2) {
|
|
|
+ rowBackground.background = "lightBlue";
|
|
|
+ } else {
|
|
|
+ rowBackground.background = "";
|
|
|
+ }
|
|
|
+ return rowBackground;
|
|
|
+ },
|
|
|
+
|
|
|
submitFile() {
|
|
|
console.log(this.dateFile)
|
|
|
this.$refs["importForm"].validate((valid) => {
|
|
@@ -366,7 +524,6 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error("请上传文件");
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -400,7 +557,6 @@ export default {
|
|
|
const fileName = file.name;
|
|
|
const fileStrArr = fileName.split(".");
|
|
|
const suffix = fileStrArr[fileStrArr.length - 1];
|
|
|
-
|
|
|
let result = fileSuffix.some((item) => {
|
|
|
return item === suffix;
|
|
|
});
|
|
@@ -418,18 +574,23 @@ export default {
|
|
|
this.reset();
|
|
|
this.importOpen = true;
|
|
|
this.importTitle = "导入激励";
|
|
|
-
|
|
|
},
|
|
|
|
|
|
-
|
|
|
downloadTem() {
|
|
|
window.location.href = `https://live-1301855440.cos.ap-chongqing.myqcloud.com/excle/%E5%A4%A7%E4%BD%AC%E7%BB%93%E7%AE%97%E6%A8%A1%E6%9D%BF.xlsx`
|
|
|
},
|
|
|
|
|
|
-
|
|
|
toAdd(item) {
|
|
|
+ let query = {};
|
|
|
+ if (this.$route.query.promoterId) {
|
|
|
+ query.promoterId = this.$route.query.promoterId
|
|
|
+ }
|
|
|
+ if (this.$route.query.itemId) {
|
|
|
+ query.itemId = this.$route.query.itemId
|
|
|
+ }
|
|
|
this.$router.replace({
|
|
|
path: "/goodsManagement/addFinanceData",
|
|
|
+ query: query
|
|
|
});
|
|
|
},
|
|
|
|
|
@@ -437,16 +598,25 @@ export default {
|
|
|
/** 查询【请填写功能名称】列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
+ if (this.$route.query.promoterId) {
|
|
|
+ this.queryParams.promoterId = this.$route.query.promoterId
|
|
|
+ this.uploadDate = []
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.$route.query.itemId) {
|
|
|
+ this.queryParams.itemId = this.$route.query.itemId
|
|
|
+ this.uploadDate = []
|
|
|
+ }
|
|
|
listInfo(
|
|
|
this.addDateRange(
|
|
|
{
|
|
|
...this.queryParams
|
|
|
},
|
|
|
- this.requestUploadDate,
|
|
|
+ this.uploadDate,
|
|
|
"startDate",
|
|
|
"endDate"
|
|
|
)).then(response => {
|
|
|
- this.infoList = response.rows;
|
|
|
+ this.infoList = this.itemSummary.concat(response.rows);
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
}).catch((err) => {
|
|
@@ -464,7 +634,7 @@ export default {
|
|
|
MM = MM < 10 ? "0" + MM : MM;
|
|
|
let dd = date.getDate();
|
|
|
dd = dd < 10 ? "0" + dd : dd;
|
|
|
- this.uploadDate = `${y}-${MM}-${dd}`;
|
|
|
+ this.uploadDate = [`${y}-${MM}-${dd}`, `${y}-${MM}-${dd}`];
|
|
|
},
|
|
|
|
|
|
|
|
@@ -505,10 +675,23 @@ export default {
|
|
|
handleQuery() {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
+ this.getListTotal();
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.requestUploadDate = [];
|
|
|
+
|
|
|
+ this.dateRange = [];
|
|
|
+ let start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
|
|
|
+ let date = new Date(start);
|
|
|
+ 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.queryParams.status = null;
|
|
|
+ console.log(this.routeItemId)
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
|
|
@@ -579,6 +762,7 @@ export default {
|
|
|
}, `info_${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
+;
|
|
|
|
|
|
</script>
|