index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <!-- -->
  2. <template>
  3. <div class="m-container">
  4. <h2>
  5. <div class="squrt"></div>
  6. 乐器维护
  7. </h2>
  8. <div class="m-core">
  9. <save-form
  10. :inline="true"
  11. :model="searchForm"
  12. @submit="search"
  13. @reset="onReSet"
  14. >
  15. <el-form-item>
  16. <el-input
  17. v-model.trim="searchForm.search"
  18. clearable
  19. @keyup.enter.native="search"
  20. placeholder="学生姓名、编号、电话"
  21. ></el-input>
  22. </el-form-item>
  23. <el-form-item>
  24. <el-select
  25. class="multiple"
  26. v-model.trim="searchForm.organId"
  27. filterable
  28. clearable
  29. placeholder="请选择分部"
  30. >
  31. <el-option
  32. v-for="(item, index) in selects.branchs"
  33. :key="index"
  34. :label="item.name"
  35. :value="item.id"
  36. ></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-select
  41. placeholder="请选择乐器分类"
  42. v-model="searchForm.goodsCategoryId"
  43. clearable
  44. filterable
  45. >
  46. <el-option
  47. v-for="(item) in categoryList"
  48. :key="item.value"
  49. :label="item.label"
  50. :value="item.value"
  51. ></el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item prop="status">
  55. <el-select
  56. v-model.trim="searchForm.status"
  57. filterable
  58. clearable
  59. placeholder="是否乐保"
  60. >
  61. <el-option value="0" label="否"></el-option>
  62. <el-option value="1" label="是"></el-option>
  63. </el-select>
  64. </el-form-item>
  65. <el-form-item>
  66. <el-button native-type="submit" type="primary">搜索</el-button>
  67. <el-button native-type="reset" type="danger">重置</el-button>
  68. </el-form-item>
  69. </save-form>
  70. <div class="tableWrap">
  71. <el-table
  72. style="width: 100%"
  73. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  74. :data="tableList"
  75. >
  76. <el-table-column
  77. align="center"
  78. prop="id"
  79. label="维护编号"
  80. ></el-table-column>
  81. <el-table-column
  82. align="center"
  83. prop="organName"
  84. label="分部"
  85. ></el-table-column>
  86. <el-table-column
  87. align="center"
  88. prop="studentId"
  89. label="学员编号"
  90. ></el-table-column>
  91. <el-table-column
  92. align="center"
  93. prop="studentName"
  94. label="学员姓名"
  95. ></el-table-column>
  96. <el-table-column
  97. align="center"
  98. prop="phone"
  99. label="联系电话"
  100. ></el-table-column>
  101. <el-table-column
  102. align="center"
  103. prop="goodsName"
  104. label="乐器名称"
  105. ></el-table-column>
  106. <el-table-column
  107. align="center"
  108. prop="goodsCategoryName"
  109. label="乐器种类"
  110. ></el-table-column>
  111. <el-table-column
  112. align="center"
  113. prop="goodsId"
  114. label="乐器编号"
  115. ></el-table-column>
  116. <el-table-column
  117. align="center"
  118. prop="studentId"
  119. label="有效期"
  120. >
  121. <template slot-scope="scope">
  122. <div>
  123. {{ scope.row.startTime|formatTimer}}~{{scope.row.endTime | formatTimer}}
  124. </div>
  125. </template>
  126. </el-table-column>
  127. <el-table-column align="center" prop="studentId" label="操作">
  128. <template slot-scope="scope">
  129. <div>
  130. <el-button type="text" @click="lookRepair(scope.row)">查看维修单</el-button>
  131. </div>
  132. </template>
  133. </el-table-column>
  134. </el-table>
  135. <pagination
  136. sync
  137. :total.sync="rules.total"
  138. :page.sync="rules.page"
  139. :limit.sync="rules.limit"
  140. :page-sizes="rules.page_size"
  141. @pagination="getList"
  142. />
  143. </div>
  144. </div>
  145. </div>
  146. </template>
  147. <script>
  148. import axios from "axios";
  149. import { getToken } from "@/utils/auth";
  150. import pagination from "@/components/Pagination/index";
  151. import { categoryListTree } from "@/api/businessManager";
  152. import { getInstrument } from "@/api/buildTeam";
  153. import load from "@/utils/loading";
  154. export default {
  155. components: { pagination },
  156. data() {
  157. return {
  158. searchForm: {
  159. search: null,
  160. organId:'',
  161. goodsCategoryId:'',
  162. status:''
  163. },
  164. soundLists: [],
  165. organList: [],
  166. tableList:[],
  167. rules: {
  168. // 分页规则
  169. limit: 10, // 限制显示条数
  170. page: 1, // 当前页
  171. total: 0, // 总条数
  172. page_size: [10, 20, 40, 50], // 选择限制显示条数
  173. },
  174. categoryList:[]
  175. };
  176. },
  177. //生命周期 - 创建完成(可以访问当前this实例)
  178. created() {},
  179. //生命周期 - 挂载完成(可以访问DOM元素)
  180. mounted() {
  181. // 获取分部
  182. this.$store.dispatch("setBranchs");
  183. this.init();
  184. this.getList()
  185. },
  186. methods: {
  187. init() {
  188. this.getCategory()
  189. },
  190. search() {
  191. this.rules.page = 1;
  192. this.getList()
  193. },
  194. onReSet() {},
  195. async getList() {
  196. try{
  197. const res = await getInstrument({...this.searchForm,rows:this.rules.limit,page:this.rules.page})
  198. this.tableList = res.data.rows
  199. }catch(e){
  200. console.log(e)
  201. }
  202. },
  203. getCategory() {
  204. let params = {
  205. delFlag: 0,
  206. rows: 9999,
  207. };
  208. categoryListTree(params).then((res) => {
  209. let result = res.data;
  210. if (res.code == 200) {
  211. let tempArray = [];
  212. result.rows.forEach((row) => {
  213. tempArray.push({
  214. label: row.name,
  215. value: row.id,
  216. });
  217. });
  218. this.categoryList = tempArray;
  219. }
  220. });
  221. },
  222. lookRepair(row){
  223. this.$router.push({path:'/business/repairList',query:{hasExemptionAmount:'1',studentInstrumentId:row.id}})
  224. }
  225. },
  226. };
  227. </script>
  228. <style lang='scss' scoped>
  229. </style>