payschoolList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <template>
  2. <div class="m-container">
  3. <el-page-header @back="goBack" :content="name"> </el-page-header>
  4. <div class="m-core" style="margin-top:20px;">
  5. <save-form
  6. :inline="true"
  7. :model="searchForm"
  8. ref="searchForm"
  9. @submit="search"
  10. @reset="onReSet"
  11. >
  12. <el-form-item prop="search">
  13. <el-input
  14. v-model.trim="searchForm.search"
  15. clearable
  16. @keyup.enter.native="
  17. (e) => {
  18. e.target.blur();
  19. $refs.saveForm.save();
  20. search();
  21. }
  22. "
  23. placeholder="乐团名称"
  24. ></el-input>
  25. </el-form-item>
  26. <el-form-item prop="refundStatus">
  27. <el-select
  28. v-model.trim="searchForm.refundStatus"
  29. clearable
  30. placeholder="付款状态"
  31. >
  32. <el-option label="回款中" value="ING"></el-option>
  33. <el-option label="已回款" value="END"></el-option>
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item prop="payTime">
  37. <el-date-picker
  38. v-model.trim="searchForm.payTime"
  39. style="width: 400px"
  40. type="daterange"
  41. range-separator="至"
  42. start-placeholder="缴费开始日期"
  43. end-placeholder="缴费结束日期"
  44. value-format="yyyy-MM-dd"
  45. :picker-options="{
  46. firstDayOfWeek: 1,
  47. }"
  48. ></el-date-picker>
  49. </el-form-item>
  50. <el-form-item>
  51. <el-button native-type="submit" type="primary">搜索</el-button>
  52. <el-button native-type="reset" type="danger">重置</el-button>
  53. </el-form-item>
  54. </save-form>
  55. <div class="tableWrap">
  56. <el-table
  57. style="width: 100%"
  58. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  59. :data="tableList"
  60. >
  61. <el-table-column
  62. align="center"
  63. prop="musicGroupName"
  64. label="乐团名称"
  65. ></el-table-column>
  66. <el-table-column
  67. align="center"
  68. prop="batchNo"
  69. label="缴费批次"
  70. ></el-table-column>
  71. <el-table-column align="center" prop="studentId" label="缴费类型">
  72. <template slot-scope="scope">
  73. <div>
  74. {{ scope.row.paymentType | userPaymentTypeFormat }}
  75. </div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column align="center" prop="studentId" label="计价标准">
  79. <template slot-scope="scope">
  80. <div v-if="scope.row.calenderFeeType">
  81. {{
  82. scope.row.calenderFeeType == "TEACHER" ? "按老师" : "按学员"
  83. }}
  84. </div>
  85. <div v-else>--</div>
  86. </template>
  87. </el-table-column>
  88. <el-table-column align="center" prop="studentId" label="应收总额">
  89. <template slot-scope="scope">
  90. <div>
  91. {{ scope.row.receivable | moneyFormat }}
  92. </div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column align="center" prop="studentId" label="实收总额">
  96. <template slot-scope="scope">
  97. <div>
  98. {{ scope.row.income | moneyFormat }}
  99. </div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="center" prop="studentId" label="待收金额">
  103. <template slot-scope="scope">
  104. <div>
  105. {{ scope.row.prepaidFee | moneyFormat }}
  106. </div>
  107. </template>
  108. </el-table-column>
  109. <el-table-column
  110. align="center"
  111. prop="educationUserName"
  112. label="下一回款日期"
  113. >
  114. <template slot-scope="scope">
  115. <div>
  116. {{ scope.row.nextRefundDate | dayjsFormat }}
  117. </div>
  118. </template>
  119. </el-table-column>
  120. <el-table-column
  121. align="center"
  122. prop="educationUserName"
  123. label="回款状态"
  124. width="100px"
  125. >
  126. <template slot-scope="scope">
  127. <div>
  128. {{ scope.row.refundStatus == "ING" ? "回款中" : "已回款" }}
  129. </div>
  130. </template>
  131. </el-table-column>
  132. <el-table-column align="center" prop="studentId" label="操作">
  133. <template slot-scope="scope">
  134. <div>
  135. <auth auths="musicGroupPaymentCalender/getDetail/barnch">
  136. <el-button type="text" @click="lookList(scope.row)"
  137. >详情</el-button
  138. >
  139. </auth>
  140. <el-button
  141. type="text"
  142. :disabled="!scope.row.contractUrl"
  143. @click="downLoad(scope.row)"
  144. >下载合同</el-button
  145. >
  146. </div>
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. <pagination
  151. sync
  152. :total.sync="rules.total"
  153. :page.sync="rules.page"
  154. :limit.sync="rules.limit"
  155. :page-sizes="rules.page_size"
  156. @pagination="getList"
  157. />
  158. </div>
  159. <el-dialog
  160. title="查看"
  161. :visible.sync="reviewVisible"
  162. width="900px"
  163. v-if="reviewVisible"
  164. >
  165. <reviewDetail
  166. @close="reviewVisible = false"
  167. @submited="getList"
  168. :detail="viewDetail"
  169. :musicGroupId="$route.query.id"
  170. destroy-on-close
  171. />
  172. <div slot="footer" class="dialog-footer">
  173. <el-button type="primary" @click="reviewVisible = false"
  174. >关闭</el-button
  175. >
  176. </div>
  177. </el-dialog>
  178. </div>
  179. </div>
  180. </template>
  181. <script>
  182. import axios from "axios";
  183. import { getToken } from "@/utils/auth";
  184. import pagination from "@/components/Pagination/index";
  185. import { getTimes } from "@/utils";
  186. import load from "@/utils/loading";
  187. import { backTypeList } from "@/utils/searchArray";
  188. import { Export } from "@/utils/downLoadFile";
  189. import { getCoopCalenderList } from "./api";
  190. import { queryByOrganId } from "@/api/systemManage";
  191. import reviewDetail from "@/views/resetTeaming/modals/review-detail";
  192. import qs from "qs";
  193. export default {
  194. components: { pagination, reviewDetail },
  195. data() {
  196. return {
  197. searchForm: {
  198. cooperationId: this.$route.query.id,
  199. refundStatus:''
  200. },
  201. name: this.$route.query.name,
  202. backTypeList,
  203. tableList: [],
  204. cooperationList: [],
  205. activeRow: null,
  206. rules: {
  207. // 分页规则
  208. limit: 10, // 限制显示条数
  209. page: 1, // 当前页
  210. total: 0, // 总条数
  211. page_size: [10, 20, 40, 50], // 选择限制显示条数
  212. },
  213. form: {
  214. id: null,
  215. },
  216. reviewVisible: false,
  217. viewDetail: null,
  218. };
  219. },
  220. //生命周期 - 创建完成(可以访问当前this实例)
  221. created() {},
  222. //生命周期 - 挂载完成(可以访问DOM元素)
  223. async mounted() {
  224. // 获取分部
  225. await this.$store.dispatch("setBranchs");
  226. this.init();
  227. },
  228. methods: {
  229. init() {
  230. this.getList();
  231. },
  232. async getList() {
  233. let { payTime, ...rest } = this.searchForm;
  234. let params = {
  235. ...rest,
  236. ...getTimes(payTime, ["refundStartDate", "refundEndDate"]),
  237. page: this.rules.page,
  238. rows: this.rules.limit,
  239. };
  240. try {
  241. const res = await getCoopCalenderList(params);
  242. this.tableList = res.data.rows;
  243. this.rules.total = res.data.total;
  244. } catch (e) {
  245. console.log(e);
  246. }
  247. },
  248. search() {
  249. this.rules.page = 1;
  250. this.getList();
  251. },
  252. onReSet() {
  253. this.$refs["searchForm"].resetFields();
  254. this.searchForm.cooperationId = this.$route.query.id;
  255. this.search();
  256. },
  257. goBack() {
  258. this.$store.dispatch('delVisitedViews', this.$route)
  259. this.$router.push('/branchPayManager')
  260. },
  261. lookList(row) {
  262. this.viewDetail = row;
  263. this.viewDetail.id = row.calenderId;
  264. this.reviewVisible = true;
  265. },
  266. async downLoad(row) {
  267. try {
  268. await this.$confirm(`是否下载批次号为${row.batchNo}合同`, "提示", {
  269. type: "warning",
  270. });
  271. window.open(row.contractUrl);
  272. } catch (e) {
  273. console.log(e);
  274. }
  275. },
  276. resetBackForm(row) {
  277. this.activeRow = row;
  278. this.form = { ...row };
  279. this.resetVisible = true;
  280. },
  281. resetRorm() {
  282. this.$refs.form.validate(async (flag) => {
  283. if (flag) {
  284. try {
  285. if (!this.form.transNo) {
  286. this.form.payTime = null;
  287. }
  288. const res = await resetUserCashAccountLog(this.form);
  289. this.$message.success("修改成功");
  290. this.resetVisible = false;
  291. this.getList();
  292. } catch (e) {
  293. console.log(e);
  294. }
  295. }
  296. });
  297. },
  298. exportBack() {
  299. let { backTime, payTime, organId, ...rest } = this.searchForm;
  300. let params = {
  301. ...rest,
  302. page: this.rules.page,
  303. rows: this.rules.limit,
  304. organId: organId.join(","),
  305. ...getTimes(backTime, ["createStartTime", "createEndTime"]),
  306. ...getTimes(payTime, ["payStartTime", "payEndTime"]),
  307. };
  308. Export(
  309. this,
  310. {
  311. url: "/api-web/export/userCashAccountLog",
  312. fileName: "退费列表.xls",
  313. method: "post",
  314. params: qs.stringify(params),
  315. },
  316. "您确定导出退费列表?"
  317. );
  318. },
  319. changeOrgan(val) {
  320. this.searchForm.cooperationId = null;
  321. },
  322. },
  323. watch: {
  324. // "searchForm.organId"(val) {
  325. // if (val) {
  326. // queryByOrganId({ organId: val }).then((res) => {
  327. // if (res.code == 200) {
  328. // this.cooperationList = res.data;
  329. // }
  330. // });
  331. // }
  332. // },
  333. // "searchForm.cooperationId"(val) {
  334. // if (val) {
  335. // getMusicGroup({ cooperationId: val }).then((res) => {
  336. // this.musicList = res.data;
  337. // });
  338. // }
  339. // },
  340. },
  341. };
  342. </script>
  343. <style lang='scss' scoped>
  344. .search {
  345. ::v-deep .el-input__inner {
  346. width: 260px !important;
  347. }
  348. }
  349. .form {
  350. ::v-deep .el-input {
  351. width: 220px;
  352. }
  353. }
  354. </style>