|
@@ -1,15 +1,15 @@
|
|
|
<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="promoterName">
|
|
|
- <el-input
|
|
|
- style="width: 240px"
|
|
|
- v-model="queryParams.promoterName"
|
|
|
- placeholder="请输入达人名称"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>-->
|
|
|
+ <el-form-item label="达人名称" prop="promoterName">
|
|
|
+ <el-input
|
|
|
+ style="width: 240px"
|
|
|
+ v-model="queryParams.promoterName"
|
|
|
+ placeholder="请输入达人名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="达人ID" prop="promoterId" v-if="showPromoterSech">
|
|
|
<el-input
|
|
|
style="width: 240px"
|
|
@@ -19,15 +19,15 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="商品名称" prop="itemTitle">
|
|
|
- <el-input
|
|
|
- style="width: 240px"
|
|
|
- v-model="queryParams.itemTitle"
|
|
|
- placeholder="请输入商品名称"
|
|
|
- clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
- </el-form-item>-->
|
|
|
+ <el-form-item label="商品名称" prop="itemTitle">
|
|
|
+ <el-input
|
|
|
+ style="width: 240px"
|
|
|
+ v-model="queryParams.itemTitle"
|
|
|
+ placeholder="请输入商品名称"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="商品id" prop="itemId" v-if="showItemSech">
|
|
|
<el-input
|
|
|
style="width: 240px"
|
|
@@ -56,12 +56,42 @@
|
|
|
<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-document-add"
|
|
|
+ size="mini"
|
|
|
+ @click="importData"
|
|
|
+ >导入大佬激励
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ size="mini"
|
|
|
+ @click="downloadTem"
|
|
|
+ >下载模版
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
|
|
- <!-- <el-table-column type="selection" width="55" align="center"/>-->
|
|
|
+
|
|
|
+ <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="statDate" width="100px"/>
|
|
|
<el-table-column label="达人名称" align="center" prop="promoterName" width="120px">
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display: flex; width: 100%">
|
|
@@ -83,7 +113,7 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="达人ID" align="center" prop="promoterId" width="100px"/>
|
|
|
- <el-table-column label="渠道" align="center" prop="promoterCreateName"/>
|
|
|
+ <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%">
|
|
@@ -105,26 +135,13 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="商品id" align="center" prop="itemId" width="140px"/>
|
|
|
- <el-table-column label="招商" align="center" prop="itemCreateName"/>
|
|
|
- <el-table-column
|
|
|
- label="结算类型"
|
|
|
- align="center"
|
|
|
- prop="activityItemStatus"
|
|
|
- >
|
|
|
- <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="statDate" width="100px"/>
|
|
|
- <el-table-column label="累计结算单量" align="center" prop="totalSettlementNum"/>
|
|
|
- <el-table-column label="本次结算单量" align="center" prop="currentSettlementNum"/>
|
|
|
- <el-table-column label="结算单价" align="center" prop="settlementPrice"/>
|
|
|
- <el-table-column label="主播奖励金额" align="center" prop="anchorAmount"/>
|
|
|
- <el-table-column label="推荐人奖励金额" align="center" prop="referenceAmount"/>
|
|
|
- <el-table-column label="合计金额" align="center" prop="totalAmount"/>
|
|
|
+ <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"/>
|
|
|
+ <el-table-column label="主播奖励金额" align="center" prop="anchorAmount" width="100px"/>
|
|
|
+ <el-table-column label="推荐人奖励金额" align="center" prop="referenceAmount" width="120px"/>
|
|
|
+ <el-table-column label="合计金额" align="center" prop="totalAmount" width="100px"/>
|
|
|
<el-table-column width="200" label="备注" align="center" prop="remarks">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
@@ -210,6 +227,41 @@
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog :title="importTitle" :visible.sync="importOpen" width="500px" append-to-body>
|
|
|
+
|
|
|
+ <el-form ref="importForm" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ action="http://192.168.1.181:9003/isv/supply_chain/insertRewardBaseInfoByExcel"
|
|
|
+ :before-upload="handleBeforeUpload"
|
|
|
+ :on-preview="handlePreview"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ accept=""
|
|
|
+ :on-exceed="handleExceed"
|
|
|
+ :file-list="fileList"
|
|
|
+ :show-file-list="false"
|
|
|
+ >
|
|
|
+ <el-button size="small" icon="el-icon-upload">点击上传</el-button>
|
|
|
+ <div slot="tip" class="el-upload__tip">
|
|
|
+ 只能上传.csv .xlsx .xls文件
|
|
|
+ <br/>
|
|
|
+ <span v-if="!!dateFile">{{ dateFile.name }}</span>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitFile" :loading="confirmLoading"
|
|
|
+ >确 定
|
|
|
+ </el-button
|
|
|
+ >
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -222,6 +274,7 @@ export default {
|
|
|
name: "FinanceDataDetail",
|
|
|
data() {
|
|
|
return {
|
|
|
+ importTitle: null,
|
|
|
showItemSech: true,
|
|
|
showPromoterSech: true,
|
|
|
confirmLoading: false,
|
|
@@ -276,12 +329,7 @@ export default {
|
|
|
let dd = date.getDate();
|
|
|
dd = dd < 10 ? "0" + dd : dd;
|
|
|
this.uploadDate = `${y}-${MM}-${dd}`;
|
|
|
- if (this.$route.query.itemId) {
|
|
|
- this.showItemSech = false;
|
|
|
- }
|
|
|
- if (this.$route.query.promoterId) {
|
|
|
- this.showPromoterSech = false;
|
|
|
- }
|
|
|
+
|
|
|
this.getList();
|
|
|
},
|
|
|
|
|
@@ -297,6 +345,88 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
|
+ submitFile() {
|
|
|
+ console.log(this.dateFile)
|
|
|
+ this.$refs["importForm"].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.dateFile) {
|
|
|
+ this.confirmLoading = true;
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("file", this.dateFile);
|
|
|
+ importData(formData)
|
|
|
+ .then((res) => {
|
|
|
+ this.confirmLoading = false;
|
|
|
+ this.$message.success("上传成功");
|
|
|
+ this.cancel();
|
|
|
+ this.handleQuery();
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.confirmLoading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error("请上传文件");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ handleExceed(files, fileList) {
|
|
|
+ this.$message.warning(
|
|
|
+ `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
|
|
|
+ files.length + fileList.length
|
|
|
+ } 个文件`
|
|
|
+ );
|
|
|
+ },
|
|
|
+
|
|
|
+ beforeRemove(file, fileList) {
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 删除文件 */
|
|
|
+ handleRemove(file, fileList) {
|
|
|
+ console.log(file, fileList);
|
|
|
+ },
|
|
|
+
|
|
|
+ /** 上传文件 */
|
|
|
+ handlePreview(file) {
|
|
|
+ console.log(file);
|
|
|
+ },
|
|
|
+ /** 上传文件前验证 */
|
|
|
+ handleBeforeUpload(file) {
|
|
|
+ console.log(file);
|
|
|
+ const fileSuffix = ["xlsx", "xls", "csv"];
|
|
|
+ const fileName = file.name;
|
|
|
+ const fileStrArr = fileName.split(".");
|
|
|
+ const suffix = fileStrArr[fileStrArr.length - 1];
|
|
|
+
|
|
|
+ let result = fileSuffix.some((item) => {
|
|
|
+ return item === suffix;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!result) {
|
|
|
+ this.$message.error("不支持该文件类型");
|
|
|
+ this.loadDisabled = false;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.dateFile = file;
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+
|
|
|
+ importData() {
|
|
|
+ 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) {
|
|
|
this.$router.replace({
|
|
|
path: "/goodsManagement/addFinanceData",
|
|
@@ -307,27 +437,10 @@ export default {
|
|
|
/** 查询【请填写功能名称】列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- let query = {};
|
|
|
- if (this.$route.query.itemId && this.$route.query.promoterId) {
|
|
|
- query.itemId = this.$route.query.itemId;
|
|
|
- query.promoterId = this.$route.query.promoterId;
|
|
|
- } else if (this.$route.query.itemId && !!!this.$route.query.promoterId) {
|
|
|
- query.itemId = this.$route.query.itemId;
|
|
|
- if (this.queryParams.promoterId) {
|
|
|
- query.promoterId = this.queryParams.promoterId;
|
|
|
- }
|
|
|
- } else if (!!!this.$route.query.itemId && this.$route.query.promoterId) {
|
|
|
- query.promoterId = this.$route.query.promoterId;
|
|
|
- if (this.queryParams.itemId) {
|
|
|
- query.itemId = this.queryParams.itemId;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
listInfo(
|
|
|
this.addDateRange(
|
|
|
{
|
|
|
- ...query
|
|
|
+ ...this.queryParams
|
|
|
},
|
|
|
this.requestUploadDate,
|
|
|
"startDate",
|