index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <!-- 训练登记本领导 -->
  2. <template>
  3. <div class="arr_conten">
  4. <el-form
  5. :model="form"
  6. ref="form"
  7. :inline="true"
  8. label-width="68px"
  9. style="padding-left: 30px"
  10. >
  11. <el-form-item prop="year">
  12. <el-date-picker
  13. v-model="form.year"
  14. type="year"
  15. placeholder="选择年"
  16. @change="getSoulist"
  17. value-format="yyyy"
  18. :editable="false"
  19. >
  20. </el-date-picker>
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button size="btr" @click="resetQuery">重置</el-button>
  24. </el-form-item>
  25. </el-form>
  26. <div v-if="status == 1">
  27. <ul v-for="(item, i) in lieList" :key="i">
  28. <li v-for="(item1, i) in item" :key="i + ''">
  29. <div class="names">{{ item1.deptName }}</div>
  30. <div class="btn">
  31. <el-button size="btJS" @click="chaKan(item1.deptId)"
  32. v-hasPermi="['grassrootsregistration:bdglequips:query']"
  33. >查看</el-button
  34. >
  35. </div>
  36. </li>
  37. </ul>
  38. </div>
  39. <div v-if="status == 0">
  40. <ul>
  41. <li v-for="(item, i) in lieList" :key="i">
  42. <div class="names">{{ item.deptName }}</div>
  43. <div class="btn">
  44. <el-button size="btJS" @click="chaKan(item.deptId)">查看</el-button>
  45. </div>
  46. </li>
  47. </ul>
  48. </div>
  49. <!-- 查看 -->
  50. <el-dialog
  51. :visible.sync="menuRoleVisible"
  52. :title="title"
  53. append-to-body
  54. id="chakan"
  55. :close-on-click-modal="false"
  56. >
  57. <bdglequip
  58. v-if="menuRoleVisible"
  59. ref="menuRole"
  60. :message="wordInfo"
  61. ></bdglequip>
  62. </el-dialog>
  63. </div>
  64. </template>
  65. <script>
  66. import bdglequip from "@/components/look_word/bdglequip.vue";
  67. import { equipList, equipuntits } from "@/api/grassrootsregistration/bdglequip";
  68. export default {
  69. data() {
  70. return {
  71. lieList: [],
  72. //查看页面
  73. menuRoleVisible: false,
  74. wordInfo: [],
  75. title: null,
  76. form: {},
  77. year: null,
  78. status: null,
  79. };
  80. },
  81. created() {
  82. this.getSoulist();
  83. },
  84. methods: {
  85. resetQuery() {
  86. this.form.year = null;
  87. equipList().then((res) => {
  88. res.rows.forEach((item) => {
  89. this.status = 1;
  90. });
  91. this.lieList = res.rows;
  92. });
  93. },
  94. getSoulist() {
  95. if (this.form.year == null || this.form.year == "") {
  96. equipList().then((res) => {
  97. res.rows.forEach((item) => {
  98. this.status = 1;
  99. });
  100. this.lieList = res.rows;
  101. });
  102. } else {
  103. equipList(this.form.year).then((res) => {
  104. res.rows.forEach((item) => {
  105. this.status = 0;
  106. });
  107. this.lieList = res.rows;
  108. });
  109. }
  110. },
  111. chaKan(row) {
  112. const unitId = row;
  113. equipuntits(unitId).then((response) => {
  114. if (response.data.length > 0) {
  115. this.wordInfo = response.data;
  116. this.title = "查看训练器材/教材登记薄";
  117. this.menuRoleVisible = true;
  118. } else {
  119. this.$message.success("当前没有数据");
  120. }
  121. });
  122. },
  123. },
  124. components: {
  125. bdglequip,
  126. },
  127. computed: {},
  128. mounted() {},
  129. watch: {},
  130. };
  131. </script>
  132. <style scoped>
  133. ::v-deep .el-dialog {
  134. width: 1060px !important;
  135. }
  136. ::v-deep .el-dialog__body {
  137. margin: 10px 30px 20px 44px;
  138. padding-top: 20px !important;
  139. box-sizing: border-box;
  140. }
  141. ::v-deep .el-dialog__header {
  142. border-bottom: 1px solid #718a9d;
  143. }
  144. .arr_conten {
  145. padding-top: 20px;
  146. }
  147. ul {
  148. display: flex;
  149. /* justify-content: space-between; */
  150. padding: 0 22px;
  151. flex-wrap: wrap;
  152. }
  153. li {
  154. list-style: none;
  155. background: url("../../../assets/images/book.png") no-repeat;
  156. height: 140px;
  157. width: 222px;
  158. /* margin: 20px 0; */
  159. margin-bottom: 20px;
  160. background-size: 100% 100%;
  161. flex: 0 0 16%;
  162. margin-right: 10px;
  163. }
  164. .names {
  165. color: #fff;
  166. font-size: 14px;
  167. text-align: center;
  168. padding: 26px 26px 38px 26px;
  169. letter-spacing: 1px;
  170. }
  171. .btn {
  172. text-align: center;
  173. }
  174. ::v-deep .el-input__inner {
  175. cursor: pointer !important;
  176. }
  177. ::v-deep .el-input__inner {
  178. background: transparent;
  179. color: #fff;
  180. border: 1px solid white !important;
  181. border-color: #fff !important;
  182. }
  183. ::v-deep .el-input--medium .el-input__inner {
  184. height: 36px;
  185. line-height: 37px;
  186. }
  187. </style>