team.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <!--
  2. * @Description:
  3. * @Author: gcz
  4. * @Date: 2024-04-23 10:30:35
  5. * @LastEditors: gcz
  6. * @LastEditTime: 2024-05-07 11:23:23
  7. * @FilePath: \great_webui\src\views\statisticalReport\team.vue
  8. * @Copyright: Copyright (c) 2016~2024 by gcz, All Rights Reserved.
  9. -->
  10. <template>
  11. <div class="app-container">
  12. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="40px">
  13. <!-- <el-form-item label="演出厅" prop="auditoriumId" label-width="70px">
  14. <el-select
  15. v-model="queryParams.auditoriumId"
  16. placeholder="演出厅"
  17. clearable
  18. style="width: 100%"
  19. @change="pagePerformTimeListFun(selectTime)"
  20. >
  21. <el-option
  22. v-for="dict in merchantTheatreAuditoriumListS"
  23. :key="dict.id"
  24. :label="dict.name"
  25. :value="dict.id"
  26. />
  27. </el-select>
  28. </el-form-item> -->
  29. <el-form-item label="场次日期" :required="true" label-width="85px">
  30. <el-date-picker
  31. style="width: 230px;"
  32. v-model="selectTime"
  33. type="daterange"
  34. @change="pagePerformTimeListFun"
  35. value-format="yyyy-MM-dd"
  36. placeholder="日期">
  37. </el-date-picker>
  38. </el-form-item>
  39. <el-form-item label="场次" v-if="!multiPerformDate" :required="!multiPerformDate" label-width="55px">
  40. <el-select
  41. v-model="queryParams.performTimeId"
  42. placeholder="场次"
  43. clearable
  44. style="width: 100%"
  45. >
  46. <el-option
  47. v-for="dict in pagePerformTimeList"
  48. :key="dict.id"
  49. :label="dict.timeSnapshot+'('+dict.performTimeStart+'-'+dict.performTimeEnd+')'"
  50. :value="dict.id"
  51. />
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item>
  55. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  56. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  57. </el-form-item>
  58. </el-form>
  59. <el-row :gutter="10" class="mb8" style="margin-left: 0; margin-top: 10px">
  60. <el-button
  61. type="primary"
  62. size="mini"
  63. icon="el-icon-download"
  64. :disabled="dataList.length === 0"
  65. v-hasPermi="['team:team:downloadExcel']"
  66. @click="handleExport"
  67. v-loading.fullscreen.lock="handleExportLoading"
  68. element-loading-text="正在拼命生成数据中..."
  69. element-loading-spinner="el-icon-loading"
  70. element-loading-background="rgba(0, 0, 0, 0.5)"
  71. >导出excel</el-button>
  72. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  73. </el-row>
  74. <el-table ref="tables" v-loading="loading" :data="dataList" border>
  75. <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
  76. <!-- <el-table-column label="场次日期" align="center">
  77. <template slot-scope="scope">
  78. <span>{{ scope.row.performDate }}</span>
  79. </template>
  80. </el-table-column> -->
  81. <el-table-column label="团队名称" align="center" prop="name" />
  82. <el-table-column label="订单数(笔)" align="center" prop="orderNum" />
  83. <el-table-column label="应收总额(元)" align="center" prop="price" />
  84. <el-table-column label="实收总额(元)" align="center" prop="realPrice" />
  85. <el-table-column label="已售票数(张)" align="center" prop="buyNum" />
  86. <el-table-column label="核销票数(张)" align="center" prop="checkNum" />
  87. <el-table-column label="未核销票数(张)" align="center" prop="noCheckNum" />
  88. <el-table-column label="退票数(张)" align="center" prop="refundNum" />
  89. <el-table-column label="退票金额(元)" align="center" prop="refundAmount" />
  90. </el-table>
  91. <pagination
  92. v-show="total>0"
  93. :total="total"
  94. :page.sync="queryParams.pageNum"
  95. :limit.sync="queryParams.pageSize"
  96. @pagination="getList"
  97. />
  98. </div>
  99. </template>
  100. <script>
  101. import {merchantTheatreAuditoriumList} from '@/api/windowTicketSales/ticketingSales'
  102. import { teamOrderCount, downTeamOrderListXls } from '@/api/statisticalReport/statistics'
  103. import { exportExcel } from '@/utils/exportexcel'
  104. import { seatPricePageList } from '@/api/distribution/ticketMr'
  105. import { pagePerformTimeList } from "@/api/schedulingMr/schedulingMr"
  106. import moment from "moment"
  107. export default {
  108. name: "agreement",
  109. dicts: ['agreement_type'],
  110. data() {
  111. return {
  112. // 遮罩层
  113. loading: true,
  114. // 选中数组
  115. ids: [],
  116. // 非单个禁用
  117. single: true,
  118. // 非多个禁用
  119. multiple: true,
  120. // 显示搜索条件
  121. showSearch: true,
  122. // 总条数
  123. total: 0,
  124. // 用户表格数据
  125. dataList: [],
  126. // 弹出层标题
  127. title: "",
  128. // 是否显示弹出层
  129. open: false,
  130. // 日期范围
  131. dateRange: [],
  132. // 查询参数
  133. queryParams: {
  134. auditoriumId:'',
  135. // pageNum: 1,
  136. // pageSize: 10,
  137. },
  138. visibleStatus: false,
  139. newObj: {},
  140. visibleType: '',
  141. handleExportLoading: false,
  142. tableData: {},
  143. ticketList: [],
  144. seatList: [],
  145. multiPerformDate:false,
  146. pagePerformTimeList: [], // 场次列表
  147. selectTime:'',
  148. merchantTheatreAuditoriumListS: [],//演出厅
  149. };
  150. },
  151. created() {
  152. // this.$set(this.queryParams,'time',moment().format("yyyy-MM-DD"))
  153. // this.merchantTheatreAuditoriumListFun();//演出厅
  154. this.$set(this,'selectTime',[moment().format("yyyy-MM-DD"),moment().format("yyyy-MM-DD")]);
  155. this.pagePerformTimeListFun(this.selectTime)
  156. // this.getList();
  157. // this.ticketListApi();
  158. },
  159. methods: {
  160. /** 查询列表 */
  161. getList() {
  162. this.loading = true;
  163. if(this.selectTime){
  164. this.queryParams.performDateStart = this.selectTime[0];
  165. this.queryParams.performDateEnd = this.selectTime[1];
  166. }
  167. // teamOrderCount(this.addDateRange(this.queryParams, this.dateRange))
  168. teamOrderCount(this.queryParams)
  169. .then(response => {
  170. this.dataList = response.data.rows;
  171. this.total = response.data.total;
  172. this.loading = false;
  173. }
  174. ).catch(response => {
  175. this.loading = false;
  176. });
  177. },
  178. /** 票务列表查询 */
  179. ticketListApi() {
  180. this.ticketList = []
  181. seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100}))
  182. .then(response => {
  183. let ticketItemList = []
  184. response.data.rows.forEach(item => {
  185. if(ticketItemList.indexOf(item.goodsId) == -1){
  186. this.ticketList.push(item);
  187. ticketItemList.push(item.goodsId);
  188. }
  189. })
  190. });
  191. },
  192. /** 座位类型列表 */
  193. getSeatTypeList(obj) {
  194. seatPricePageList(this.addDateRange({pageNum: 1, pageSize: 100, goodsId: obj.goodsId}))
  195. .then(response => {
  196. let ticketList = []
  197. response.data.rows.forEach(item => {
  198. if(ticketList.indexOf(item.seatTypeId) == -1){
  199. this.seatList.push(item);
  200. ticketList.push(item.seatTypeId);
  201. }
  202. })
  203. });
  204. },
  205. // 取消按钮
  206. cancel() {
  207. this.open = false;
  208. },
  209. // 票务改变事件
  210. goodsChangeEven() {
  211. this.seatList = [];
  212. this.$set(this.queryParams, 'seatTypeId', '');
  213. let selectMap = {goodsId: this.queryParams.goodsId}
  214. this.getSeatTypeList(selectMap);
  215. },
  216. /** 搜索按钮操作 */
  217. handleQuery() {
  218. // this.queryParams.pageNum = 1;
  219. this.getList();
  220. },
  221. /** 重置按钮操作 */
  222. resetQuery() {
  223. this.dateRange = [];
  224. this.seatList = [];
  225. this.$set(this.queryParams, 'time', '');
  226. this.$set(this, 'selectTime', '');
  227. this.$set(this.queryParams, 'auditoriumId', '');
  228. this.$set(this.queryParams, 'performDateStart', '');
  229. this.$set(this.queryParams, 'performDateEnd', '');
  230. this.$set(this.queryParams, 'goodsId', '');
  231. this.$set(this.queryParams, 'seatTypeId', '');
  232. this.$set(this.queryParams, 'performTimeId', '');
  233. // this.queryParams.pageNum = 1;
  234. this.multiPerformDate = false;
  235. //必须要有默认值
  236. this.$set(this,'selectTime',[moment().format("yyyy-MM-DD"),moment().format("yyyy-MM-DD")]);
  237. this.pagePerformTimeListFun(this.selectTime)
  238. // this.handleQuery();
  239. },
  240. /**
  241. * 导出报表
  242. * @date 2022-10-24
  243. * @returns {any}
  244. */
  245. handleExport() {
  246. this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
  247. confirmButtonText: '确定 ',
  248. cancelButtonText: '取消 ',
  249. type: 'warning'
  250. })
  251. .then(() => {
  252. this.handleExportLoading = true;
  253. // const { pageNum, pageSize} = this.params;
  254. let postMap = {}
  255. for (let key in this.queryParams) {
  256. if(key != 'pageNum' && key != 'pageSize'){
  257. postMap[key] = this.queryParams[key]
  258. }
  259. }
  260. downTeamOrderListXls(postMap)
  261. .then((res) => {
  262. exportExcel(res, '团队订单销售统计', '.xlsx');
  263. this.handleExportLoading = false;
  264. })
  265. .catch(() => {
  266. this.handleExportLoading = false;
  267. });
  268. })
  269. .catch(() => {
  270. this.$message.info('您已取消导出!');
  271. });
  272. },
  273. async pagePerformTimeListFun(value) {
  274. // console.log('value',value);
  275. try {
  276. this.pagePerformTimeList = []
  277. this.$set(this.queryParams,'performTimeId',null)
  278. if(!value){
  279. return
  280. }
  281. if(value.length==2&&value[0]==value[1]){
  282. this.multiPerformDate = false
  283. }else{
  284. this.multiPerformDate = true
  285. return
  286. }
  287. let { data,code } = await pagePerformTimeList({
  288. performDate: value[0],
  289. pageNum: 1,
  290. pageSize: 999
  291. })
  292. this.pagePerformTimeList = [].concat(data.rows);
  293. if(data.rows[0]){
  294. this.queryParams.performTimeId = data.rows[0].id;
  295. }
  296. this.getList();
  297. } catch (error) {
  298. }
  299. },
  300. /** 获取演出厅 */
  301. async merchantTheatreAuditoriumListFun(){
  302. try {
  303. let res = await merchantTheatreAuditoriumList({
  304. pageNum: 1,
  305. pageSize: 999
  306. })
  307. if(res.code == 200){
  308. this.merchantTheatreAuditoriumListS = res.data.rows
  309. if(this.merchantTheatreAuditoriumListS.length>0){
  310. this.$set(this.queryParams,'auditoriumId',this.merchantTheatreAuditoriumListS[0].id)
  311. this.pagePerformTimeListFun(this.selectTime)
  312. }
  313. }
  314. } catch (error) {
  315. }
  316. },
  317. }
  318. };
  319. </script>