123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="40px">
- <el-form-item label="日期">
- <el-date-picker
- style="width: 230px;"
- v-model="selectTime"
- type="daterange"
- @change="dataChange"
- value-format="yyyy-MM-dd"
- placeholder="日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="分销商类型" label-width="120px">
- <el-select
- v-model="queryParams.personType"
- placeholder="分销商类型"
- @change="getList"
- clearable
- style="width: 140px"
- >
- <el-option
- v-for="dict in dict.type.distribution_type"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <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-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8" style="margin-left: 0; margin-top: 10px">
- <el-button
- type="primary"
- size="mini"
- icon="el-icon-download"
- :disabled="dataList.length === 0"
- v-hasPermi="['session:session:downloadExcel']"
- @click="handleExport"
- v-loading.fullscreen.lock="handleExportLoading"
- element-loading-text="正在拼命生成数据中..."
- element-loading-spinner="el-icon-loading"
- element-loading-background="rgba(0, 0, 0, 0.5)"
- >导出excel</el-button>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
-
- <el-table ref="tables" v-loading="loading" :data="dataList" border>
- <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
- <!-- <el-table-column label="剧目名称" align="center" prop="performName" />
- <el-table-column label="票务名称" align="center" prop="goodsName" /> -->
- <el-table-column label="分销商类型" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.personType }}</span>
- </template>
- </el-table-column>
- <el-table-column label="分销商名称" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.personName }}</span>
- </template>
- </el-table-column>
- <el-table-column label="票种(元)" align="center">
-
- </el-table-column>
- <el-table-column label="结算价(元)" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.settlementAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="人次" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.personNext }}</span>
- </template>
- </el-table-column>
- <el-table-column label="收入" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.salePriceAmount }}</span>
- </template>
- </el-table-column>
- <el-table-column label="收入占比" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.incomeRatio?scope.row.incomeRatio+'%' : '-' }}</span>
- </template>
- </el-table-column>
- <el-table-column label="备注" align="center">
- <template slot-scope="scope">
- <span>{{ scope.row.remark }}</span>
- </template>
- </el-table-column>
- </el-table>
- <ul class="total-remark" v-if="responseData.saleTotalRemarkOnColor">
- <li><span class="til">合计:</span><div class="html-wap" v-html="responseData.saleTotalRemarkOnColor||'-'"></div> </li>
- </ul>
-
- <!-- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- /> -->
-
- </div>
- </template>
-
- <script>
-
- import { marketPersonSaleCount, downMarketPersonSaleCount } from '@/api/statisticalReport/statistics'
- import { exportExcel } from '@/utils/exportexcel'
- import { seatPricePageList } from '@/api/distribution/ticketMr'
- import moment from "moment"
- export default {
- name: "",
- dicts: ['distribution_type'],
- data() {
- return {
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 用户表格数据
- dataList: [],
- // 弹出层标题
- title: "",
-
- // 是否显示弹出层
- open: false,
- // 日期范围
- dateRange: [],
- // 查询参数
- queryParams: {
- // pageNum: 1,
- // pageSize: 10,
- },
- visibleStatus: false,
- newObj: {},
- visibleType: '',
- handleExportLoading: false,
- tableData: {},
- ticketList: [],
- seatList: [],
- selectTime:'',
- responseData:{},
- };
- },
- created() {
- this.$set(this,'selectTime',[moment().format("yyyy-MM-DD"),moment().format("yyyy-MM-DD")]);
- this.getList();
- this.ticketListApi();
- },
- methods: {
- /** 查询列表 */
- getList() {
- this.loading = true;
- if(this.selectTime){
- this.queryParams.beginDate = this.selectTime[0];
- this.queryParams.endDate = this.selectTime[1];
- }
- marketPersonSaleCount(this.addDateRange(this.queryParams, this.dateRange))
- .then(response => {
- this.responseData = response.data;
- this.dataList = response.data.dataList||[];
- this.total = response.data.total;
- this.loading = false;
- }
- );
- },
- dataChange(data) {
- this.getList()
- },
- /** 票务列表查询 */
- ticketListApi() {
- this.ticketList = []
- seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100}))
- .then(response => {
- let ticketItemList = []
- response.data.rows.forEach(item => {
- if(ticketItemList.indexOf(item.goodsId) == -1){
- this.ticketList.push(item);
- ticketItemList.push(item.goodsId);
- }
- })
- });
- },
- /** 座位类型列表 */
- getSeatTypeList(obj) {
- seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100, goodsId: obj.goodsId}))
- .then(response => {
- let ticketList = []
- response.data.rows.forEach(item => {
- if(ticketList.indexOf(item.seatTypeId) == -1){
- this.seatList.push(item);
- ticketList.push(item.seatTypeId);
- }
- })
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- },
- // 票务改变事件
- goodsChangeEven() {
- this.seatList = [];
- this.$set(this.queryParams, 'seatTypeId', '');
- let selectMap = {goodsId: this.queryParams.goodsId}
- this.getSeatTypeList(selectMap);
- },
- /** 搜索按钮操作 */
- handleQuery() {
- // this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.dateRange = [];
- this.seatList = [];
- this.$set(this.queryParams, 'time', '');
- this.$set(this.queryParams, 'performStartDate', '');
- this.$set(this.queryParams, 'performEndDate', '');
- this.$set(this.queryParams, 'goodsId', '');
- this.$set(this.queryParams, 'seatTypeId', '');
- this.$set(this.queryParams, 'personType', '');
- // this.queryParams.pageNum = 1;
- this.$set(this,'selectTime',[moment().format("yyyy-MM-DD"),moment().format("yyyy-MM-DD")]);
- this.handleQuery();
- },
- /**
- * 导出报表
- * @date 2022-10-24
- * @returns {any}
- */
- handleExport() {
- this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
- confirmButtonText: '确定 ',
- cancelButtonText: '取消 ',
- type: 'warning'
- })
- .then(() => {
- this.handleExportLoading = true;
- // const { pageNum, pageSize} = this.params;
- let postMap = {}
- for (let key in this.queryParams) {
- if(key != 'pageNum' && key != 'pageSize'){
- postMap[key] = this.queryParams[key]
- }
- }
- downMarketPersonSaleCount(postMap)
- .then((res) => {
- exportExcel(res, '分销明细', '.xlsx');
- this.handleExportLoading = false;
- })
- .catch(() => {
- this.handleExportLoading = false;
- });
- })
- .catch(() => {
- this.$message.info('您已取消导出!');
- });
- },
- }
- };
- </script>
- <style lang="scss" scoped>
- .total-remark{
- margin-top: 24px;
- margin-bottom: 24px;
- padding-left: 0;
- li{
- list-style: none;
- display: flex;
- ::v-deep .html-wap{
- span{
- color: blue;
- margin: 0 5px;
- display: inline-block;
- }
- }
- }
- .til{
- font-weight: bold;
- color: #333;
- }
- }
- </style>
|