studentPayBase.vue 8.8 KB

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