index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
  4. <el-form-item label="订单号" label-width="60px">
  5. <el-input
  6. v-model="queryParams.id"
  7. placeholder="请输入订单号"
  8. clearable
  9. style="width: 240px;"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="收支类型">
  14. <el-select
  15. v-model="queryParams.incomeExpenses"
  16. placeholder="收支类型"
  17. clearable
  18. style="width: 100%"
  19. >
  20. <el-option
  21. v-for="dict in incomeExpensesList"
  22. :key="dict.id"
  23. :label="dict.name"
  24. :value="dict.value"
  25. />
  26. </el-select>
  27. </el-form-item>
  28. <el-form-item label="业务类型">
  29. <el-select
  30. v-model="queryParams.businessType"
  31. placeholder="业务类型"
  32. clearable
  33. style="width: 100%"
  34. >
  35. <el-option
  36. v-for="dict in businessTypeList"
  37. :key="dict.id"
  38. :label="dict.name"
  39. :value="dict.value"
  40. />
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  45. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  46. </el-form-item>
  47. </el-form>
  48. <el-row :gutter="10" class="mb8" style="margin-left: 0; margin-top: 10px">
  49. <el-button
  50. type="primary"
  51. size="mini"
  52. icon="el-icon-download"
  53. :disabled="tableData.length === 0"
  54. v-hasPermi="['flowingWaterMr:flowingWaterMr:downloadExcel']"
  55. @click="handleExport"
  56. v-loading.fullscreen.lock="handleExportLoading"
  57. element-loading-text="正在拼命生成数据中..."
  58. element-loading-spinner="el-icon-loading"
  59. element-loading-background="rgba(0, 0, 0, 0.5)"
  60. >导出excel</el-button>
  61. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  62. </el-row>
  63. <el-table ref="tables" v-loading="loading" :data="dataList" border>
  64. <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
  65. <el-table-column label="订单号" align="center" prop="id" />
  66. <el-table-column label="金额(元)" align="center" prop="type">
  67. <template slot-scope="scope">
  68. <span>¥{{ scope.row.orderPrice }}</span>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="收支类型" align="center" prop="incomeExpenses" />
  72. <el-table-column label="业务类型" align="center" prop="businessType" />
  73. <el-table-column label="产生渠道" align="center" prop="refundTime" width="160" >
  74. <template slot-scope="scope">
  75. <!-- <span>{{ sourceMap[scope.row.source] }}</span> -->
  76. <dict-tag :options="dict.type.order_form_type" :value="scope.row.source"/>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="产生时间" align="center" prop="createTime" width="160" >
  80. <template slot-scope="scope">
  81. <span>{{ parseTime(scope.row.createTime) }}</span>
  82. </template>
  83. </el-table-column>
  84. </el-table>
  85. <pagination
  86. v-show="total>0"
  87. :total="total"
  88. :page.sync="queryParams.pageNum"
  89. :limit.sync="queryParams.pageSize"
  90. @pagination="getList"
  91. />
  92. </div>
  93. </template>
  94. <script>
  95. import { pageList, downOrderListXls } from '@/api/financeMr/flowingWaterMr'
  96. import { exportExcel } from '@/utils/exportexcel'
  97. export default {
  98. name: "agreement",
  99. dicts: ['agreement_type','order_form_type'],
  100. data() {
  101. return {
  102. // 遮罩层
  103. loading: true,
  104. // 选中数组
  105. ids: [],
  106. // 非单个禁用
  107. single: true,
  108. // 非多个禁用
  109. multiple: true,
  110. // 显示搜索条件
  111. showSearch: true,
  112. // 总条数
  113. total: 0,
  114. // 用户表格数据
  115. dataList: null,
  116. // 弹出层标题
  117. title: "",
  118. // 是否显示弹出层
  119. open: false,
  120. // 日期范围
  121. dateRange: [],
  122. // 查询参数
  123. queryParams: {
  124. pageNum: 1,
  125. pageSize: 10,
  126. },
  127. statusList: [
  128. {id: 1, name: '申请中', value: 0},
  129. {id: 2, name: '退款成功', value: 1},
  130. {id: 3, name: '退款失败', value: 2},
  131. {id: 4, name: '退款中', value: 3},
  132. ],
  133. sourceMap: {
  134. 1: '小程序',
  135. 2: '美团',
  136. 3: '携程',
  137. 4: '公众号',
  138. 5: '支付宝',
  139. },
  140. incomeExpensesList: [
  141. {id: 1, name: '收入', value: '收入'},
  142. {id: 2, name: '支出', value: '支出'},
  143. ],
  144. businessTypeList: [
  145. {id: 1, name: '购买演出票', value: '购买演出票'},
  146. {id: 2, name: '票务退款', value: '票务退款'},
  147. ],
  148. visibleStatus: false,
  149. newObj: {},
  150. visibleType: '',
  151. handleExportLoading: false,
  152. tableData: {}
  153. };
  154. },
  155. created() {
  156. this.getList();
  157. },
  158. methods: {
  159. /** 查询列表 */
  160. getList() {
  161. this.loading = true;
  162. pageList(this.addDateRange(this.queryParams, this.dateRange))
  163. .then(response => {
  164. this.dataList = response.data.rows;
  165. this.total = response.data.total;
  166. this.loading = false;
  167. }
  168. );
  169. },
  170. // 取消按钮
  171. cancel() {
  172. this.open = false;
  173. },
  174. /** 搜索按钮操作 */
  175. handleQuery() {
  176. this.queryParams.pageNum = 1;
  177. this.getList();
  178. },
  179. /** 重置按钮操作 */
  180. resetQuery() {
  181. this.dateRange = [];
  182. this.$set(this.queryParams, 'id', '');
  183. this.$set(this.queryParams, 'businessType', '');
  184. this.$set(this.queryParams, 'incomeExpenses', '');
  185. this.queryParams.pageNum = 1;
  186. this.handleQuery();
  187. },
  188. /** 详情按钮操作 */
  189. openDetails(row, type) {
  190. this.$refs["detailsDia"].openDialog("详情", row, type);
  191. },
  192. /**
  193. * 导出报表
  194. * @date 2022-10-24
  195. * @returns {any}
  196. */
  197. handleExport() {
  198. this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
  199. confirmButtonText: '确定 ',
  200. cancelButtonText: '取消 ',
  201. type: 'warning'
  202. })
  203. .then(() => {
  204. this.handleExportLoading = true;
  205. // const { pageNum, pageSize} = this.params;
  206. let postMap = {}
  207. for (let key in this.queryParams) {
  208. if(key != 'pageNum' && key != 'pageSize'){
  209. postMap[key] = this.queryParams[key]
  210. }
  211. }
  212. downOrderListXls(postMap)
  213. .then((res) => {
  214. exportExcel(res, '流水管理', '.xlsx');
  215. this.handleExportLoading = false;
  216. })
  217. .catch(() => {
  218. this.handleExportLoading = false;
  219. });
  220. })
  221. .catch(() => {
  222. this.$message.info('您已取消导出!');
  223. });
  224. },
  225. }
  226. };
  227. </script>