backMoney.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <div class="m-container">
  3. <h2>
  4. <div class="squrt"></div>
  5. 退费管理
  6. </h2>
  7. <div class="m-core">
  8. <!-- 搜索类型 -->
  9. <save-form
  10. :inline="true"
  11. class="searchForm"
  12. ref="searchForm"
  13. noclear
  14. :model="searchForm"
  15. @submit="search"
  16. @reset="onReSet"
  17. >
  18. <el-form-item prop="organId">
  19. <el-select
  20. class="multiple"
  21. v-model.trim="searchForm.organId"
  22. clearable
  23. filterable
  24. placeholder="请选择分部"
  25. >
  26. <el-option
  27. v-for="(item, index) in selects.branchs"
  28. :key="index"
  29. :label="item.name"
  30. :value="item.id"
  31. ></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <!-- @change="searchOrderDate" -->
  35. <el-form-item prop="orderDate">
  36. <el-date-picker
  37. style="width: 410px"
  38. v-model.trim="searchForm.orderDate"
  39. type="daterange"
  40. value-format="yyyy-MM-dd"
  41. range-separator="至"
  42. start-placeholder="申请开始日期"
  43. end-placeholder="申请结束日期"
  44. :picker-options="{
  45. firstDayOfWeek: 1,
  46. }"
  47. >
  48. </el-date-picker>
  49. </el-form-item>
  50. <el-form-item>
  51. <el-button native-type="submit" type="danger">搜索</el-button>
  52. <el-button native-type="reset" type="primary">重置</el-button>
  53. </el-form-item>
  54. </save-form>
  55. <!-- 列表 -->
  56. <div class="tableWrap">
  57. <el-table
  58. :data="tableList"
  59. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  60. >
  61. <el-table-column
  62. align="center"
  63. width="150"
  64. prop="createTime"
  65. label="申请时间"
  66. >
  67. <template slot-scope="scope">
  68. <div>
  69. {{ scope.row.createTime | dateForMinFormat }}
  70. </div>
  71. </template>
  72. </el-table-column>
  73. <el-table-column align="center" prop="orderNo" label="原订单编号">
  74. </el-table-column>
  75. <el-table-column
  76. align="center"
  77. prop="studentPaymentOrder.expectAmount"
  78. label="应付金额"
  79. >
  80. <template slot-scope="scope">
  81. <div>
  82. {{ scope.row.studentPaymentOrder.expectAmount | moneyFormat }}
  83. </div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column
  87. align="center"
  88. prop="studentPaymentOrder.actualAmount"
  89. label="实付金额"
  90. >
  91. <template slot-scope="scope">
  92. <div>
  93. {{ scope.row.studentPaymentOrder.actualAmount | moneyFormat }}
  94. </div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="center" prop="user.username" label="学员姓名">
  98. </el-table-column>
  99. <el-table-column align="center" prop="remark" label="退费说明">
  100. </el-table-column>
  101. <el-table-column
  102. align="center"
  103. prop="expectAmount"
  104. label="预退费金额"
  105. >
  106. <template slot-scope="scope">
  107. <div>
  108. {{ scope.row.expectAmount | moneyFormat }}
  109. </div>
  110. </template>
  111. </el-table-column>
  112. <el-table-column
  113. align="center"
  114. prop="actualAmount"
  115. label="实退费金额"
  116. >
  117. <template slot-scope="scope">
  118. <div>
  119. {{ scope.row.actualAmount | moneyFormat }}
  120. </div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column align="center" label="退费状态">
  124. <template slot-scope="scope">
  125. {{ scope.row.status | returnStatus }}
  126. </template>
  127. </el-table-column>
  128. <el-table-column align="center" label="操作">
  129. <template
  130. slot-scope="scope"
  131. v-if="scope.row.status == 'WAIT_PAYMENT'"
  132. >
  133. <el-button
  134. @click="onBackMoney(scope.row)"
  135. v-permission="'vipGroupManage/applyRefundAudit'"
  136. type="text"
  137. >退费</el-button
  138. >
  139. </template>
  140. </el-table-column>
  141. </el-table>
  142. <pagination
  143. sync
  144. :total.sync="pageInfo.total"
  145. :page.sync="pageInfo.page"
  146. :limit.sync="pageInfo.limit"
  147. :page-sizes="pageInfo.page_size"
  148. @pagination="getList"
  149. />
  150. </div>
  151. <el-dialog
  152. title="退费确认"
  153. :visible.sync="backStatus"
  154. @close="onFormClose('ruleForm')"
  155. width="500px"
  156. >
  157. <el-form :model="form" :rules="rules" ref="ruleForm">
  158. <el-form-item
  159. label="退费路径"
  160. prop="name"
  161. :label-width="formLabelWidth"
  162. >
  163. <el-input disabled value="余额" autocomplete="off"></el-input>
  164. </el-form-item>
  165. <el-form-item
  166. label="退费金额"
  167. prop="amount"
  168. :label-width="formLabelWidth"
  169. >
  170. <el-input
  171. v-model.trim.number="form.amount"
  172. autocomplete="off"
  173. ></el-input>
  174. </el-form-item>
  175. </el-form>
  176. <span slot="footer" class="dialog-footer">
  177. <el-button
  178. type="danger"
  179. @click="onTeachingSubmit('ruleForm', 'REJECT')"
  180. >拒绝退费</el-button
  181. >
  182. <el-button
  183. type="primary"
  184. @click="onTeachingSubmit('ruleForm', 'DONE')"
  185. >确认退费</el-button
  186. >
  187. </span>
  188. </el-dialog>
  189. </div>
  190. </div>
  191. </template>
  192. <script>
  193. import pagination from "@/components/Pagination/index";
  194. import { studentRefundsQueryPage, applyRefundAudit } from "@/api/orderManager";
  195. import { getEmployeeOrgan } from "@/api/buildTeam";
  196. import { getTimes } from "@/utils";
  197. import store from "@/store";
  198. export default {
  199. components: { pagination },
  200. name: "backMoney",
  201. data() {
  202. return {
  203. searchForm: {
  204. startTime: null,
  205. endTime: null,
  206. organId: null,
  207. orderDate: [],
  208. },
  209. tableList: [],
  210. organList: [],
  211. pageInfo: {
  212. // 分页规则
  213. limit: 10, // 限制显示条数
  214. page: 1, // 当前页
  215. total: 0, // 总条数
  216. page_size: [10, 20, 40, 50], // 选择限制显示条数
  217. },
  218. backStatus: false,
  219. formLabelWidth: "100px",
  220. form: {
  221. id: null,
  222. amount: null,
  223. },
  224. rules: {
  225. amount: [
  226. {
  227. required: true,
  228. type: "number",
  229. message: "请输入金额",
  230. trigger: "blur",
  231. },
  232. ],
  233. },
  234. };
  235. },
  236. mounted() {
  237. // getEmployeeOrgan().then(res => {
  238. // if (res.code == 200) {
  239. // this.organList = res.data;
  240. // }
  241. // })
  242. this.$store.dispatch("setBranchs");
  243. if (this.searchForm?.orderDate?.length < 1) {
  244. this.getNow();
  245. }
  246. this.getList();
  247. },
  248. methods: {
  249. getNow() {
  250. let startDate = this.$helpers.dayjs(new Date()).format("YYYY-MM-DD");
  251. this.$set(this.searchForm, "orderDate", []);
  252. this.searchForm.orderDate.push(startDate);
  253. this.searchForm.orderDate.push(startDate);
  254. },
  255. search() {
  256. this.pageInfo.page = 1;
  257. this.getList();
  258. },
  259. onTeachingSubmit(formName, status) {
  260. // 添加数据
  261. this.$refs[formName].validate((valid) => {
  262. if (valid) {
  263. this.form.status = status;
  264. applyRefundAudit(this.form).then((res) => {
  265. if (res.code == 200) {
  266. this.$message.success("操作成功");
  267. this.backStatus = false;
  268. this.getList();
  269. } else {
  270. this.$message.error(res.msg);
  271. }
  272. });
  273. } else {
  274. return false;
  275. }
  276. });
  277. },
  278. getList() {
  279. (this.searchForm.orderDate);
  280. let { orderDate, ...rest } = this.searchForm;
  281. let params = {
  282. ...rest,
  283. page: this.pageInfo.page,
  284. rows: this.pageInfo.limit,
  285. ...getTimes(orderDate, ["startTime", "endTime"]),
  286. };
  287. studentRefundsQueryPage(params).then((res) => {
  288. let result = res.data;
  289. if (res.code == 200) {
  290. this.tableList = result.rows;
  291. this.pageInfo.total = result.total;
  292. }
  293. });
  294. },
  295. // searchOrderDate(value) {
  296. // (value)
  297. // if (value) {
  298. // this.searchForm.startTime = value[0];
  299. // this.searchForm.endTime = value[1];
  300. // } else {
  301. // this.searchForm.startTime = null;
  302. // this.searchForm.endTime = null;
  303. // }
  304. // },
  305. onReSet() {
  306. this.$refs["searchForm"].resetFields();
  307. this.getNow();
  308. this.search();
  309. },
  310. onFormClose(formName) {
  311. // 关闭弹窗重置验证
  312. this.$refs[formName].clearValidate();
  313. },
  314. onBackMoney(row) {
  315. // 退费
  316. this.backStatus = true;
  317. this.form = {
  318. id: row.id,
  319. amount: row.expectAmount,
  320. };
  321. // applyRefundAudit()
  322. },
  323. },
  324. };
  325. </script>
  326. <style lang="scss">
  327. </style>