cateringRefundManagement.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <!--用户数据-->
  5. <el-col :span="24" :xs="24">
  6. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
  7. <el-form-item label="原订单号">
  8. <el-input
  9. v-model="queryParams.orderId"
  10. placeholder="请输入原订单号"
  11. clearable
  12. style="width: 240px;"
  13. @keyup.enter.native="handleQuery"
  14. />
  15. </el-form-item>
  16. <el-form-item label="退款单号">
  17. <el-input
  18. v-model="queryParams.refundNo"
  19. placeholder="请输入退款单号"
  20. clearable
  21. style="width: 240px;"
  22. @keyup.enter.native="handleQuery"
  23. />
  24. </el-form-item>
  25. <el-form-item label="联系电话">
  26. <el-input
  27. v-model="queryParams.refundMobile"
  28. placeholder="请输入联系电话"
  29. clearable
  30. style="width: 240px;"
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item label="退款状态">
  35. <el-select
  36. v-model="queryParams.status"
  37. placeholder="退款状态"
  38. clearable
  39. style="width: 100%"
  40. >
  41. <el-option
  42. v-for="dict in dict.type.tourism_orderRefund_status"
  43. :key="dict.value"
  44. :label="dict.label"
  45. :value="dict.value"
  46. />
  47. </el-select>
  48. </el-form-item>
  49. <el-form-item label="退款申请时间">
  50. <el-date-picker
  51. v-model="queryParams.time"
  52. type="datetimerange"
  53. range-separator="至"
  54. start-placeholder="开始日期"
  55. value-format="yyyy-MM-dd HH:mm:ss"
  56. end-placeholder="结束日期">
  57. </el-date-picker>
  58. </el-form-item>
  59. <el-form-item>
  60. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  61. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  62. </el-form-item>
  63. </el-form>
  64. <el-row :gutter="10" class="mb8">
  65. <el-col :span="1.5">
  66. <el-button
  67. type="warning"
  68. plain
  69. icon="el-icon-download"
  70. size="mini"
  71. @click="handleExport"
  72. v-hasPermi="configPermi.export"
  73. >导出</el-button>
  74. </el-col>
  75. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
  76. </el-row>
  77. <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
  78. <el-table-column type="index" label="序号" align="center" />
  79. <el-table-column label="退款单号" align="center" key="refundNo" prop="refundNo" v-if="columns[0].visible" :show-overflow-tooltip="true" />
  80. <el-table-column label="原订单号" align="center" key="orderId" prop="orderId" v-if="columns[1].visible" :show-overflow-tooltip="true" />
  81. <el-table-column label="支付单号" align="center" key="transactionId" prop="transactionId" v-if="columns[2].visible" :show-overflow-tooltip="true" />
  82. <el-table-column label="联系电话" align="center" key="refundMobile" prop="refundMobile" v-if="columns[3].visible" :show-overflow-tooltip="true" />
  83. <el-table-column label="订单来源" align="center" key="source" prop="source" v-if="columns[4].visible">
  84. <template slot-scope="scope">
  85. <dict-tag :options="dict.type.tourism_ticketOrders_source" :value="scope.row.source"/>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="退款申请时间" align="center" key="createTime" prop="createTime" v-if="columns[5].visible" :show-overflow-tooltip="true" />
  89. <el-table-column label="退款金额(元)" align="center" key="refundAmount" prop="refundAmount" v-if="columns[6].visible" :show-overflow-tooltip="true" />
  90. <el-table-column label="申请原因" align="center" key="refundReason" prop="refundReason" v-if="columns[7].visible" :show-overflow-tooltip="true" />
  91. <el-table-column label="退款状态" align="center" key="status" prop="status" v-if="columns[8].visible" :show-overflow-tooltip="true">
  92. <template slot-scope="scope">
  93. <dict-tag :options="dict.type.tourism_orderRefund_status" :value="scope.row.status"/>
  94. </template>
  95. </el-table-column>
  96. <el-table-column
  97. label="操作"
  98. align="center"
  99. width="160"
  100. class-name="small-padding fixed-width"
  101. >
  102. <template slot-scope="scope" >
  103. <el-button
  104. size="mini"
  105. type="text"
  106. icon="el-icon-document"
  107. @click="handleDetails(scope.row)"
  108. v-hasPermi="configPermi.details"
  109. >详情</el-button>
  110. <el-button
  111. size="mini"
  112. type="text"
  113. icon="el-icon-coordinate"
  114. v-if="scope.row.status == 0"
  115. @click="refundAuditFun(scope.row)"
  116. v-hasPermi="configPermi.refundAudit"
  117. >审核</el-button>
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. <pagination
  122. v-show="total>0"
  123. :total="total"
  124. :page.sync="queryParams.pageNum"
  125. :limit.sync="queryParams.pageSize"
  126. @pagination="getList"
  127. />
  128. </el-col>
  129. </el-row>
  130. <!-- 详情 -->
  131. <detailsBox ref="detailsBox" @refresh="getList" />
  132. </div>
  133. </template>
  134. <script>
  135. import {
  136. listTableApi,
  137. delTableParamsApi,
  138. updateTableApi
  139. } from "@/api/CURD";
  140. import detailsBox from "./detailsBox/cateringRefundManagementDetails.vue"
  141. export default {
  142. name: "User",
  143. dicts: ['tourism_orderRefund_status','tourism_ticketOrders_source'],
  144. components: {detailsBox},
  145. data() {
  146. return {
  147. title: "餐饮退款管理",// 通用标题
  148. configPermi: {
  149. add: [''], // 新增权限
  150. details: ['financialManagement:cateringRefundManagement:details'], // 详情权限
  151. delect: [], // 删除权限
  152. edit: [], // 编辑权限
  153. upload: [],// 导入权限
  154. export: ['financialManagement:cateringRefundManagement:export'],// 导出权限
  155. refundAudit: ['financialManagement:cateringRefundManagement:refundAudit'], //审核
  156. },
  157. configUrl: {
  158. list: '/merchant/merchantOrder/orderRefundList', // 列表地址
  159. delect: '', // 删除地址
  160. upload: '',// 导入地址
  161. download:'', // 下载模板地址
  162. export: '/merchant/merchantOrder/exportFoodExcel',// 导出地址
  163. edit: '', // 编辑地址
  164. },
  165. // 遮罩层
  166. loading: true,
  167. // 选中数组
  168. ids: [],
  169. // 非单个禁用
  170. single: true,
  171. // 非多个禁用
  172. multiple: true,
  173. // 显示搜索条件
  174. showSearch: true,
  175. // 总条数
  176. total: 0,
  177. // 用户表格数据
  178. tableList: null,
  179. // 查询参数
  180. queryParams: {
  181. pageNum: 1,
  182. pageSize: 10,
  183. },
  184. dateRange: [],
  185. // 控制列表是否显示
  186. columns: [
  187. { key: 0, label: `退款单号`, visible: true },
  188. { key: 1, label: `原订单号`, visible: true },
  189. { key: 2, label: `支付单号`, visible: true },
  190. { key: 3, label: `联系电话`, visible: true },
  191. { key: 4, label: `订单来源`, visible: true },
  192. { key: 5, label: `退款申请时间`, visible: true },
  193. { key: 6, label: `退款金额`, visible: true },
  194. { key: 7, label: `申请原因`, visible: true },
  195. { key: 8, label: `退款状态`, visible: true },
  196. ],
  197. };
  198. },
  199. created() {
  200. this.getList();
  201. },
  202. methods: {
  203. /** 查询用户列表 */
  204. getList() {
  205. this.loading = true;
  206. let params = JSON.parse(JSON.stringify({
  207. ...this.queryParams,
  208. orderType: 4,
  209. startCreateTime: this.queryParams.time&&this.queryParams.time[0]?this.queryParams.time[0]:null,
  210. endCreateTime: this.queryParams.time&&this.queryParams.time[1]?this.queryParams.time[1]:null,
  211. }))
  212. delete params.time;
  213. listTableApi(
  214. this.configUrl.list,
  215. this.addDateRange(
  216. params,
  217. this.dateRange)).then(response => {
  218. this.tableList = response.data.rows;
  219. this.total = response.data.total;
  220. this.loading = false;
  221. }
  222. ).catch (error=>{
  223. console.error('获取列表失败!!!!',error)
  224. this.tableList = [];
  225. this.total = 0;
  226. this.loading = false
  227. })
  228. },
  229. /** 搜索按钮操作 */
  230. handleQuery() {
  231. this.queryParams.pageNum = 1;
  232. this.getList();
  233. },
  234. /** 重置按钮操作 */
  235. resetQuery() {
  236. this.dateRange = [];
  237. this.queryParams = {
  238. pageNum: 1,
  239. pageSize: 10,
  240. }
  241. this.handleQuery();
  242. },
  243. // 多选框选中数据
  244. handleSelectionChange(selection) {
  245. this.ids = selection.map(item => item.id);
  246. this.single = selection.length != 1;
  247. this.multiple = !selection.length;
  248. },
  249. /** 新增按钮操作 */
  250. handleAdd() {
  251. if(this.$refs.addAndEdit) {
  252. this.$refs.addAndEdit.initData(this.title + '新增', "ADD",{})
  253. }
  254. },
  255. /** 修改按钮操作 */
  256. handleUpdate(row) {
  257. if(this.$refs.addAndEdit) {
  258. this.$refs.addAndEdit.initData(this.title + '编辑', "EDITInit",{...row})
  259. }
  260. },
  261. /** */
  262. handleDetails(row){
  263. if(this.$refs.detailsBox) {
  264. this.$refs.detailsBox.initData(this.title + '详情',"DEATILSInit", row)
  265. }
  266. },
  267. /** */
  268. refundAuditFun(row){
  269. if(this.$refs.detailsBox) {
  270. this.$refs.detailsBox.initData(this.title + '审核',"DEATILSADD", row)
  271. }
  272. },
  273. /** 删除按钮操作 */
  274. handleDelete(row) {
  275. const ids = row.id || this.ids;
  276. this.$modal.confirm('是否确认删除数据项?').then( () => {
  277. return delTableParamsApi(this.configUrl.delect,{
  278. id: ids
  279. });
  280. }).then(() => {
  281. this.getList();
  282. this.$modal.msgSuccess("删除成功");
  283. }).catch((e) => {
  284. console.error("删除失败====",e)
  285. });
  286. },
  287. /** 导出按钮操作 */
  288. /** 导出按钮操作 */
  289. handleExport() {
  290. let params = JSON.parse(JSON.stringify({
  291. ...this.queryParams,
  292. startCreateTime: this.queryParams.time&&this.queryParams.time[0]?this.queryParams.time[0]:null,
  293. endCreateTime: this.queryParams.time&&this.queryParams.time[1]?this.queryParams.time[1]:null,
  294. orderType: 4,
  295. }))
  296. delete params.time;
  297. delete params.pageSize;
  298. delete params.pageNum;
  299. this.downloadGet(this.configUrl.export, {
  300. ...params
  301. }, `${this.title }_${new Date().getTime()}.xlsx`)
  302. },
  303. /** 导入按钮操作 */
  304. handleImport() {
  305. if(this.$refs.upload) {
  306. this.$refs.upload.initData({
  307. width: '400px',
  308. // 弹出层标题(用户导入)
  309. title: this.title + "导入",
  310. // 下载模板地址
  311. importTemplate: this.configUrl.download,
  312. // 上传的地址
  313. url: this.configUrl.upload
  314. })
  315. }
  316. },
  317. /** 开/闭 园 */
  318. openAttraction(row) {
  319. console.log("row======",row)
  320. this.$modal.confirm(`是否确认${row.status == 1 ? '关闭' : '打开'} ${row.titleName}吗?`).then( () => {
  321. return updateTableApi(this.configUrl.edit,{
  322. ...row,
  323. status: row.status == 1 ? 0 : 1
  324. });
  325. }).then(() => {
  326. this.getList();
  327. this.$modal.msgSuccess(`${row.status == 1 ? '打开' : '关闭'}成功`);
  328. }).catch((e) => {
  329. console.error("失败====",e)
  330. });
  331. },
  332. }
  333. };
  334. </script>