studentPayBase.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <!-- -->
  2. <template>
  3. <!-- <div class="m-container">
  4. <el-page-header @back="goBack"
  5. content="学员缴费记录">
  6. </el-page-header> -->
  7. <div class="m-core">
  8. <el-form :inline="true"
  9. :model="searchForm">
  10. <el-form-item>
  11. <el-input v-model.trim="searchForm.search"
  12. @keyup.enter.native="search"
  13. placeholder='学生编号'></el-input>
  14. </el-form-item>
  15. <el-form-item>
  16. <el-select v-model.trim="searchForm.subjectId"
  17. style="width:180px"
  18. clearable
  19. filterable
  20. placeholder="请选择声部">
  21. <el-option v-for="(item,index) in soundList"
  22. :key="index"
  23. :label="item.name"
  24. :value="item.id"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item>
  28. <el-button @click="search"
  29. type="danger">搜索</el-button>
  30. <el-button @click="onReSet"
  31. type="primary">重置</el-button>
  32. </el-form-item>
  33. </el-form>
  34. <!-- <div class="newBand"
  35. @click="resetPays"
  36. v-permission="'musicGroupStudentFee/batchUpdateCourseFee'">修改缴费金额</div> -->
  37. <div class="tableWrap">
  38. <el-table style="width: 100%"
  39. :header-cell-style="{background:'#EDEEF0',color:'#444'}"
  40. :data="tableList"
  41. ref='multipleTable'
  42. max-height="300"
  43. @selection-change="handleSelectionChange">
  44. <el-table-column type="selection"
  45. width="55">
  46. </el-table-column>
  47. <el-table-column align="center"
  48. prop="userId"
  49. label="学员编号"></el-table-column>
  50. <el-table-column align="center"
  51. prop="name"
  52. label="学员姓名">
  53. <!-- <template slot-scope="scope">
  54. <div v-if="scope.row.sysUser">
  55. {{scope.row.sysUser.username}}
  56. </div>
  57. </template> -->
  58. </el-table-column>
  59. <el-table-column align="center"
  60. prop="subjectName"
  61. label="学员声部"></el-table-column>
  62. <!-- <el-table-column align="center"
  63. prop="studentId"
  64. label="联系电话">
  65. <template slot-scope="scope">
  66. <div v-if="scope.row.sysUser">
  67. {{scope.row.sysUser.phone}}
  68. </div>
  69. </template>
  70. </el-table-column> -->
  71. <!-- <el-table-column align="center"
  72. prop="courseFee"
  73. label="缴费金额(元)"></el-table-column> -->
  74. <!-- <el-table-column align="center"
  75. label="操作">
  76. <template slot-scope="scope">
  77. <div>
  78. <el-button type="text"
  79. v-permission="'musicGroupStudentFee/batchUpdateCourseFee'"
  80. @click="resetPay(scope.row)">修改金额</el-button>
  81. </div>
  82. </template>
  83. </el-table-column> -->
  84. </el-table>
  85. <!-- <pagination :total="rules.total"
  86. :page.sync="rules.page"
  87. :limit.sync="rules.limit"
  88. :page-sizes="rules.page_size"
  89. @pagination="getList" /> -->
  90. </div>
  91. <el-dialog :visible.sync="resetPayVisible"
  92. append-to-body
  93. width="500px"
  94. title="修改缴费金额">
  95. <el-form :model="resetPayForm"
  96. :inline="true"
  97. label-width="120px"
  98. label-position="right"
  99. ref='resetPayForm'>
  100. <!-- <el-form-item label="学生姓名"
  101. :rules="[{ required: true, message: '学生姓名',trigger: 'blur'}]"
  102. prop="startDate">
  103. <el-input disabled
  104. value="张三"></el-input>
  105. </el-form-item> -->
  106. <el-form-item label="应缴金额"
  107. :rules="[{ required: true, message: '请输入预计缴费金额',trigger: 'blur'},{pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/, message: '请输入正确的金额',trigger: 'blur' }]"
  108. prop="momey">
  109. <el-input v-model="resetPayForm.momey"></el-input>
  110. </el-form-item>
  111. </el-form>
  112. <div slot="footer"
  113. class="dialog-footer">
  114. <el-button @click="resetPayVisible = false">取 消</el-button>
  115. <el-button type="primary"
  116. v-if="isSigan"
  117. @click="submitSigan(true)">确 定</el-button>
  118. <el-button type="primary"
  119. v-if="!isSigan"
  120. @click="submitSigan(false)">确 定</el-button>
  121. </div>
  122. </el-dialog>
  123. </div>
  124. </template>
  125. <script>
  126. import pagination from "@/components/Pagination/index";
  127. import { findSound, getMusicGroupStudentFee, resetMusicGroupStudentFee, queryCanAddStudent } from "@/api/buildTeam";
  128. export default {
  129. components: { pagination },
  130. props: ['clearStduent', 'musicGroupPaymentCalenderId', 'batchNo'],
  131. data () {
  132. return {
  133. searchForm: {
  134. search: null,
  135. subjectId: null,
  136. },
  137. teacherList: [],
  138. soundList: [],
  139. tableList: [{}],
  140. rules: {
  141. // 分页规则
  142. limit: 999, // 限制显示条数
  143. page: 1, // 当前页
  144. total: 0, // 总条数
  145. page_size: [10, 20, 40, 50] // 选择限制显示条数
  146. },
  147. payVisible: false,
  148. resetPayVisible: false,
  149. pickerOptions: {
  150. disabledDate (time) {
  151. return time.getTime() + 86400000 <= new Date().getTime();
  152. }
  153. },
  154. payForm: {
  155. startDate: null
  156. },
  157. resetPayForm: {
  158. momey: null
  159. },
  160. activeChiose: [],
  161. isSigan: false,
  162. };
  163. },
  164. //生命周期 - 创建完成(可以访问当前this实例)
  165. created () {
  166. console.log('create')
  167. },
  168. //生命周期 - 挂载完成(可以访问DOM元素)
  169. mounted () {
  170. // 获取声部
  171. // 获取分部
  172. this.init();
  173. },
  174. activated () {
  175. this.init();
  176. },
  177. methods: {
  178. init () {
  179. this.teamid = this.$route.query.id;
  180. findSound({ musicGroupId: this.teamid }).then(res => {
  181. if (res.code == 200) {
  182. this.soundList = res.data;
  183. }
  184. });
  185. this.getList()
  186. },
  187. getList () {
  188. // this.searchForm.page = this.rules.page;
  189. // this.searchForm.rows = this.rules.limit;
  190. this.searchForm.musicGroupId = this.teamid;
  191. queryCanAddStudent({
  192. ...this.searchForm,
  193. batchNo: this.batchNo,
  194. }).then(res => {
  195. if (res.code == 200) {
  196. // this.rules.total = res.data.total;
  197. this.tableList = res.data;
  198. }
  199. })
  200. },
  201. search () {
  202. this.rules.page = 1;
  203. this.getList()
  204. },
  205. onReSet () {
  206. this.searchForm = {
  207. search: null,
  208. subjectId: null,
  209. }
  210. this.getList()
  211. },
  212. clearTable () {
  213. this.$refs.multipleTable.clearSelection()
  214. },
  215. startPay (row) { },
  216. resetPay (row) {
  217. this.activeRow = row;
  218. this.resetPayForm.momey = row.courseFee;
  219. this.isSigan = true
  220. this.resetPayVisible = true
  221. },
  222. resetPays () {
  223. this.isSigan = false
  224. if (this.activeChiose.length <= 0) {
  225. this.$message.error('请至少勾选一名学生')
  226. return
  227. }
  228. this.resetPayVisible = true
  229. },
  230. resetTime () {
  231. this.payVisible = true;
  232. },
  233. goBack () {
  234. let query = this.$route.query
  235. sessionStorage.setItem('resetCode', 3)
  236. this.$router.push({ path: '/business/resetTeaming', query })
  237. },
  238. handleSelectionChange (val) {
  239. this.activeChiose = val;
  240. this.$emit('chioseStudent', val)
  241. },
  242. submitSigan (sigan) {
  243. let obj = {}
  244. if (sigan) {
  245. obj.ids = this.activeRow.id
  246. } else {
  247. obj.ids = this.activeChiose.map(item => {
  248. return item.id
  249. }).join(',')
  250. }
  251. // obj.courseFee = this.resetPayForm.momey;
  252. // if (!obj.courseFee || obj.courseFee < 0) {
  253. // this.$message.error('请输入正确的金额')
  254. // return
  255. // }
  256. resetMusicGroupStudentFee(obj).then(res => {
  257. if (res.code == 200) {
  258. this.$message.success('修改成功')
  259. this.resetPayVisible = false
  260. this.getList()
  261. if (this.$listeners.submited) {
  262. this.$listeners.submited()
  263. }
  264. }
  265. })
  266. }
  267. },
  268. watch: {
  269. resetPayVisible (val) {
  270. if (!val) {
  271. this.resetPayForm = {
  272. momey: null
  273. },
  274. this.$refs['resetPayForm'].resetFields()
  275. }
  276. }
  277. }
  278. };
  279. </script>
  280. <style lang='scss' scoped>
  281. .tableWrap {
  282. // height: 300px;
  283. overflow: auto;
  284. }
  285. </style>