detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div>
  3. <el-form
  4. :inline="true"
  5. :model="searchForm"
  6. ref="searchForm"
  7. @submit.native.prevent="search"
  8. @reset.native.prevent="onReSet"
  9. >
  10. <el-form-item prop="search">
  11. <el-input
  12. v-model.trim="searchForm.search"
  13. clearable
  14. @keyup.enter.native="search"
  15. placeholder="学生姓名或手机号"
  16. ></el-input>
  17. </el-form-item>
  18. <el-form-item prop="subjectId">
  19. <el-select
  20. v-model.trim="searchForm.subjectId"
  21. filterable
  22. clearable
  23. placeholder="请选择声部"
  24. @change="changeSound"
  25. >
  26. <el-option
  27. v-for="(item, i) in selects.subjects"
  28. :key="i"
  29. :label="item.name"
  30. :value="item.id"
  31. ></el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item prop="specification">
  35. <el-select
  36. v-model.trim="searchForm.specification"
  37. filterable
  38. clearable
  39. placeholder="请选择品牌型号"
  40. :disabled="!searchForm.subjectId"
  41. >
  42. <el-option
  43. v-for="(item, index) in branchList"
  44. :key="index"
  45. :label="item.name"
  46. :value="item.id"
  47. ></el-option>
  48. </el-select>
  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. </el-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="userId"
  64. label="学员编号"
  65. ></el-table-column>
  66. <el-table-column
  67. align="center"
  68. prop="userName"
  69. label="学员姓名"
  70. ></el-table-column>
  71. <el-table-column
  72. align="center"
  73. prop="mobileNo"
  74. label="联系电话"
  75. ></el-table-column>
  76. <el-table-column
  77. align="center"
  78. prop="subjectName"
  79. label="声部"
  80. ></el-table-column>
  81. <el-table-column align="center" prop="studentId" label="品牌型号">
  82. <template slot-scope="scope">
  83. <div>{{ scope.row.brand }}{{ scope.row.specification }}</div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column
  87. align="center"
  88. prop="payStatus"
  89. label="缴费状态"
  90. >
  91. <template slot-scope="scope">
  92. <div>
  93. {{scope.row.payStatus|replacementInsFilter}}
  94. </div>
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="center" label="其他建议">
  98. <template slot-scope="scope">
  99. <Tooltip
  100. :content="
  101. scope.row.otherSuggestion ? scope.row.otherSuggestion : ''
  102. "
  103. />
  104. </template>
  105. </el-table-column>
  106. <el-table-column align="center" prop="studentId" label="操作">
  107. <template slot-scope="scope">
  108. <div>
  109. <el-button
  110. type="text"
  111. @click="resetMusic(scope.row)"
  112. v-if="permission('replacementInstrumentActivity/update')&&scope.row.payStatus==0"
  113. >修改</el-button
  114. >
  115. </div>
  116. </template>
  117. </el-table-column>
  118. </el-table>
  119. <pagination
  120. sync
  121. :total.sync="rules.total"
  122. :page.sync="rules.page"
  123. :limit.sync="rules.limit"
  124. :page-sizes="rules.page_size"
  125. @pagination="getList"
  126. />
  127. </div>
  128. <el-dialog
  129. title="修改信息"
  130. :visible.sync="dialogVisible"
  131. width="600px"
  132. append-to-body
  133. v-if="dialogVisible"
  134. >
  135. <resetInfo
  136. @close="close"
  137. :detail="resetRow"
  138. ref="resetInfo"
  139. @getList="getList"
  140. />
  141. <div slot="footer">
  142. <el-button @click="dialogVisible = false">取 消</el-button>
  143. <el-button type="primary" @click="updateInfo">确认修改</el-button>
  144. </div>
  145. </el-dialog>
  146. </div>
  147. </template>
  148. <script>
  149. import pagination from "@/components/Pagination/index";
  150. import resetInfo from "./resetInfo";
  151. import { getInstrumentSoundList, getInstrumentActivityList } from "../api";
  152. import ItemVue from "@/layout/components/Sidebar/Item.vue";
  153. import Tooltip from "@/components/Tooltip/index";
  154. import { permission } from "@/utils/directivePage";
  155. export default {
  156. components: { pagination, resetInfo, Tooltip },
  157. props: ["detail"],
  158. data() {
  159. return {
  160. searchForm: {
  161. cooperationOrganId: "",
  162. specification: "",
  163. search: "",
  164. subjectId: "",
  165. },
  166. tableList: [],
  167. rules: {
  168. // 分页规则
  169. limit: 10, // 限制显示条数
  170. page: 1, // 当前页
  171. total: 0, // 总条数
  172. page_size: [10, 20, 40, 50], // 选择限制显示条数
  173. },
  174. dialogVisible: false,
  175. branchList: [],
  176. resetRow: null,
  177. };
  178. },
  179. mounted() {
  180. this.init();
  181. },
  182. methods: {
  183. async init() {
  184. this.searchForm.cooperationOrganId = this.detail.cooperationOrganId;
  185. await this.$store.dispatch("setSubjects");
  186. this.getList();
  187. },
  188. async getList() {
  189. try {
  190. const res = await getInstrumentActivityList({
  191. ...this.searchForm,
  192. page: this.rules.page,
  193. rows: this.rules.limit,
  194. });
  195. this.tableList = res.data.rows;
  196. this.rules.total = res.data.total;
  197. } catch (e) {}
  198. },
  199. search() {
  200. this.rules.page = 1;
  201. this.getList();
  202. },
  203. onReSet() {
  204. this.$refs.searchForm.resetFields();
  205. this.searchForm.cooperationOrganId = this.detail.cooperationOrganId;
  206. this.search();
  207. },
  208. resetMusic(row) {
  209. this.resetRow = row;
  210. this.dialogVisible = true;
  211. },
  212. close() {
  213. this.dialogVisible = false;
  214. },
  215. async changeSound(val) {
  216. this.searchForm.brand = "";
  217. if (val) {
  218. try {
  219. const res = await getInstrumentSoundList({
  220. subjectId: val,
  221. page: 1,
  222. rows: 999,
  223. });
  224. this.branchList = res.data.rows.map((item) => {
  225. return {
  226. name: item.brand + item.specification,
  227. id: item.specification,
  228. };
  229. });
  230. console.log(res);
  231. } catch (e) {
  232. console.log(e);
  233. }
  234. }
  235. },
  236. updateInfo() {
  237. this.$refs.resetInfo.submited();
  238. },
  239. permission(str, parent) {
  240. return permission(str, parent);
  241. },
  242. },
  243. };
  244. </script>