|
@@ -1,35 +1,93 @@
|
|
|
<template>
|
|
|
<div class="container registration-details">
|
|
|
- <el-table :data="tableData" show-summary style="width: 100%" border>
|
|
|
- <el-table-column align="center" prop="name" label="分享人"> </el-table-column>
|
|
|
- <el-table-column align="center" prop="date" label="报名数量">
|
|
|
- <template scope="{row}">
|
|
|
- <span class="editsty" @click="numberHandler(row)">{{ row.date }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <moneyDetailsChart />
|
|
|
+ <div class="content">
|
|
|
+ <div>
|
|
|
+ <el-table :data="tableData" show-summary style="width: 538px" border>
|
|
|
+ <el-table-column align="center" prop="RealName" label="分享人">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span>{{ row.RealName }}({{ row.CompanyName }})</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="Count"
|
|
|
+ label="报名数量"
|
|
|
+ width="196"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <span class="editsty" @click="numberHandler(row)">{{
|
|
|
+ row.Count
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="chart-content">
|
|
|
+ <moneyDetailsChart :chartData="chartData" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<!-- 点击量详情 -->
|
|
|
- <el-dialog :visible.sync="showDetails" :modal-append-to-body="false" v-dialogDrag width="65vw">
|
|
|
- <div slot="title">时代-报名详情</div>
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="showDetails"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ v-dialogDrag
|
|
|
+ width="65vw"
|
|
|
+ @close="cancelHandle"
|
|
|
+ >
|
|
|
+ <div slot="title">{{ shareInfo.RealName }}-报名详情</div>
|
|
|
<div style="margin-bottom: 118px">
|
|
|
- <el-table :data="detailsList" style="width: 100%; margin: 20px 0 30px" ref="clickNumberRef" border @sort-change="detailSortChange">
|
|
|
- <el-table-column prop="CompanyName" label="公司名称" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="RealName" label="姓名" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="Mobile" label="手机号" align="center"> </el-table-column>
|
|
|
- <el-table-column prop="CreateTime" label="报名时间" align="center" min-width="140"> </el-table-column>
|
|
|
- <el-table-column label="付款金额(元)" align="center" min-width="140">
|
|
|
+ <el-table
|
|
|
+ :data="detailsList"
|
|
|
+ style="width: 100%; margin: 20px 0 30px"
|
|
|
+ ref="clickNumberRef"
|
|
|
+ border
|
|
|
+ @sort-change="detailSortChange"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ prop="CustomCompanyName"
|
|
|
+ label="公司名称"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="CustomName" label="姓名" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="CustomMobile" label="手机号" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="CreateTime"
|
|
|
+ label="报名时间"
|
|
|
+ align="center"
|
|
|
+ min-width="140"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="Amount"
|
|
|
+ label="付款金额(元)"
|
|
|
+ align="center"
|
|
|
+ min-width="140"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<!-- 如果数据为空,则默认显示输入框 -->
|
|
|
- <div v-if="!scope.row.ClickNum">
|
|
|
- <el-input v-model="inputModel[scope.$index]" @blur="handleBlur(scope.$index, scope.row)"></el-input>
|
|
|
+ <div v-if="!scope.row.Amount">
|
|
|
+ <el-input
|
|
|
+ v-model="inputModel[scope.$index]"
|
|
|
+ @blur="handleBlur(scope.$index, scope.row)"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
<!-- 如果数据不为空,则双击后显示输入框 -->
|
|
|
- <div v-else @dblclick="handleDoubleClick(scope.$index, scope.row)">
|
|
|
+ <div
|
|
|
+ v-else
|
|
|
+ @dblclick="handleDoubleClick(scope.$index, scope.row)"
|
|
|
+ >
|
|
|
<span class="editsty" v-if="editingIndex !== scope.$index">
|
|
|
- {{ scope.row.ClickNum }}
|
|
|
+ {{ scope.row.Amount }}
|
|
|
</span>
|
|
|
- <el-input v-if="editingIndex === scope.$index" v-model="inputModel[scope.$index]" @input="handleInput(scope.$index, scope.row)" @blur="handleBlur(scope.$index, scope.row)"></el-input>
|
|
|
+ <el-input
|
|
|
+ v-if="editingIndex === scope.$index"
|
|
|
+ v-model="inputModel[scope.$index]"
|
|
|
+ @input="handleInput(scope.$index, scope.row)"
|
|
|
+ @blur="handleBlur(scope.$index, scope.row)"
|
|
|
+ ></el-input>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -40,6 +98,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { departInterence } from "@/api/api.js";
|
|
|
+
|
|
|
import moneyDetailsChart from "./components/moneyDetailsChart.vue";
|
|
|
export default {
|
|
|
data() {
|
|
@@ -49,58 +109,30 @@ export default {
|
|
|
detailsList: [],
|
|
|
editingIndex: -1,
|
|
|
inputModel: {},
|
|
|
+ chartData: [],
|
|
|
+ shareInfo: {},
|
|
|
};
|
|
|
},
|
|
|
components: { moneyDetailsChart },
|
|
|
mounted() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.tableData = [
|
|
|
- {
|
|
|
- date: 6,
|
|
|
- name: "王小虎",
|
|
|
- },
|
|
|
- {
|
|
|
- date: 5,
|
|
|
- name: "王小虎",
|
|
|
- },
|
|
|
- {
|
|
|
- date: 5,
|
|
|
- name: "王小虎",
|
|
|
- },
|
|
|
- {
|
|
|
- date: 16,
|
|
|
- name: "王小虎",
|
|
|
- },
|
|
|
- ];
|
|
|
- });
|
|
|
+ this.getDataList();
|
|
|
},
|
|
|
methods: {
|
|
|
// 点击了数量
|
|
|
- numberHandler() {
|
|
|
+ numberHandler(row) {
|
|
|
this.showDetails = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.detailsList = [
|
|
|
- {
|
|
|
- CompanyName: "弘则研究",
|
|
|
- RealName: "陈芊烨",
|
|
|
- Mobile: "13588818597",
|
|
|
- CreateTime: "2024-04-16 15:30:21",
|
|
|
- ClickNum: "",
|
|
|
- },
|
|
|
- {
|
|
|
- CompanyName: "弘则研究",
|
|
|
- RealName: "张怀民",
|
|
|
- Mobile: "13588818597",
|
|
|
- CreateTime: "2024-04-16 15:30:21",
|
|
|
- ClickNum: 100,
|
|
|
- },
|
|
|
- ];
|
|
|
- });
|
|
|
+ this.shareInfo = row;
|
|
|
+ this.getdetailsDataList(row);
|
|
|
+ },
|
|
|
+ // 关闭了弹框
|
|
|
+ cancelHandle() {
|
|
|
+ this.showDetails = false;
|
|
|
+ this.shareInfo = {};
|
|
|
},
|
|
|
// 双击切换输入框
|
|
|
handleDoubleClick(index, row) {
|
|
|
this.editingIndex = index;
|
|
|
- this.inputModel[index] = row.ClickNum;
|
|
|
+ this.inputModel[index] = row.Amount;
|
|
|
},
|
|
|
// 失去焦点后的请求
|
|
|
handleBlur(index, row) {
|
|
@@ -110,16 +142,61 @@ export default {
|
|
|
console.log(`发送请求,索引:${index}, 新值:${newValue}`);
|
|
|
|
|
|
// 可能需要更新tableData来反映新输入的值
|
|
|
- row.ClickNum = newValue;
|
|
|
-
|
|
|
+ row.Amount = newValue;
|
|
|
+ this.editAmount(newValue, row);
|
|
|
// 完成编辑,隐藏输入框
|
|
|
this.editingIndex = -1;
|
|
|
},
|
|
|
// 输入框的值
|
|
|
handleInput(index, row) {
|
|
|
- row.ClickNum = this.inputModel[index];
|
|
|
+ row.Amount = this.inputModel[index];
|
|
|
+ },
|
|
|
+ // 获取数据
|
|
|
+ async getDataList() {
|
|
|
+ const res = await departInterence.getResearchStatisticsItem({
|
|
|
+ BannerId: +this.$route.query.id,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.tableData = res.Data.List || [];
|
|
|
+ this.chartData = [res.Data.HasPayed, res.Data.NoPay];
|
|
|
+ }
|
|
|
},
|
|
|
+ // 获取数据
|
|
|
+ async getdetailsDataList(row) {
|
|
|
+ const res = await departInterence.getResearchStatisticsDetail({
|
|
|
+ Mobile: row.Mobile,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.detailsList = res.Data || [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 修改金额
|
|
|
+ async editAmount(Amount, row) {
|
|
|
+ const res = await departInterence.getResearchStatisticsAmount({
|
|
|
+ YbResearchSignupStatisticsId: row.YbResearchSignupStatisticsId,
|
|
|
+ Amount,
|
|
|
+ });
|
|
|
+ if (res.Ret === 200) {
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ beforeRouteEnter(to, from, next) {
|
|
|
+ if (to.query.name) {
|
|
|
+ to.matched[1].name = to.query.name + "报名详情";
|
|
|
+ }
|
|
|
+ next();
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
-<style scoped lang="scss"></style>
|
|
|
+<style scoped lang="scss">
|
|
|
+.registration-details {
|
|
|
+ .content {
|
|
|
+ display: flex;
|
|
|
+ .chart-content {
|
|
|
+ flex: 1;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|