index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <div class="testExamine">
  3. <div class="testTit">
  4. <div class="teaLis">
  5. <div
  6. class="teal"
  7. v-if="bArray.length"
  8. @click="cutPage(2)"
  9. :class="[pType == 2 ? 'Tbor' : '']"
  10. >
  11. 专任教师
  12. </div>
  13. <div
  14. class="teal"
  15. v-if="aArray.length"
  16. @click="cutPage(1)"
  17. :class="[pType == 1 ? 'Tbor' : '']"
  18. >
  19. 班主任
  20. </div>
  21. </div>
  22. <div class="operate">
  23. <el-input
  24. v-if="cutTable == 1"
  25. v-model="teacherName"
  26. @change="selectTeaName"
  27. placeholder="请输入教师姓名"
  28. ></el-input>
  29. <div style="margin: 0 20px;" v-if="timeListA.length>0 && pType == 1 && cutTable!=1">
  30. <el-select v-model="timeA" placeholder="请选择">
  31. <el-option
  32. v-for="item in timeListA"
  33. :key="item.value"
  34. :label="item.label"
  35. :value="item.value"
  36. >
  37. </el-option>
  38. </el-select>
  39. </div>
  40. <div style="margin: 0 20px;" v-if="timeListB.length>0 && pType == 2 && cutTable!=1">
  41. <el-select v-model="timeB" placeholder="请选择">
  42. <el-option
  43. v-for="item in timeListB"
  44. :key="item.value"
  45. :label="item.label"
  46. :value="item.value"
  47. >
  48. </el-option>
  49. </el-select>
  50. </div>
  51. <div style="margin: 0 20px;">
  52. <el-select v-model="cutTable" placeholder="请选择">
  53. <el-option
  54. v-for="item in cutTabOpts"
  55. :key="item.value"
  56. :label="item.label"
  57. :value="item.value"
  58. >
  59. </el-option>
  60. </el-select>
  61. </div>
  62. <div
  63. v-if="cutTable == 1"
  64. class="remindBtn"
  65. style="margin-right: 20px;"
  66. @click="excelBtn"
  67. >
  68. 导出
  69. </div>
  70. <div v-if="cutTable == 1" class="remindBtn" @click="personBtn">
  71. 提醒
  72. </div>
  73. </div>
  74. </div>
  75. <div class="testCon">
  76. <targetPage :pType="pType" :timeA="timeA" :timeB="timeB" v-if="cutTable == 0"></targetPage>
  77. <personPage
  78. ref="child"
  79. :pType="pType"
  80. :teacherName="teacherName"
  81. v-if="cutTable == 1"
  82. ></personPage>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import personPage from "./conpoments/personPage.vue";
  88. import targetPage from "./conpoments/targetPage";
  89. export default {
  90. components: {
  91. personPage,
  92. targetPage
  93. },
  94. data() {
  95. return {
  96. aArray: [],
  97. bArray: [],
  98. oid: this.$route.query.oid,
  99. org: this.$route.query.org,
  100. timeListA:[],
  101. timeListB:[],
  102. timeA:"",
  103. timeB:"",
  104. pType: 2,
  105. cutTable: 0,
  106. teacherName: "",
  107. cutTabOpts: [
  108. {
  109. value: 0,
  110. label: "按指标"
  111. },
  112. {
  113. value: 1,
  114. label: "按人员"
  115. }
  116. ]
  117. };
  118. },
  119. mounted () {
  120. this.getPageBase2(1)
  121. this.getPageBase2(2)
  122. },
  123. methods: {
  124. getPageBase2(type) {
  125. let params = {
  126. typ: type,
  127. org: this.org,
  128. oid: this.oid,
  129. time:""
  130. };
  131. this.ajax
  132. .get(this.$store.state.api + "selectTestExamineBase2", params)
  133. .then(res => {
  134. console.log('1111111111111111111111', res.data);
  135. if(type == 1){
  136. this.aArray = res.data[0];
  137. this.timeListA = this.aArray.map(i=>{return {value:i.time,label:i.timeLabel}})
  138. if(this.timeListA.length>0)this.timeA = this.timeListA[0].value;
  139. }else {
  140. this.bArray = res.data[0];
  141. this.timeListB = this.bArray.map(i=>{return {value:i.time,label:i.timeLabel}})
  142. if(this.timeListB.length>0)this.timeB = this.timeListB[0].value;
  143. if(!this.bArray.length){
  144. this.pType = 1
  145. }
  146. }
  147. })
  148. .catch(error => {
  149. console.log(error);
  150. });
  151. },
  152. // getPageBase2(type) {
  153. // let params = {
  154. // typ: type,
  155. // org: this.org,
  156. // oid: this.oid
  157. // };
  158. // this.ajax
  159. // .get(this.$store.state.api + "selectTestExamineBase", params)
  160. // .then(res => {
  161. // console.log('1111111111111111111111', res.data);
  162. // if(type == 1){
  163. // this.aArray = res.data[0];
  164. // }else {
  165. // this.bArray = res.data[0];
  166. // if(!this.bArray.length){
  167. // this.pType = 1
  168. // }
  169. // }
  170. // })
  171. // .catch(error => {
  172. // console.log(error);
  173. // });
  174. // },
  175. cutPage(e) {
  176. this.pType = e;
  177. },
  178. selectTeaName() {
  179. this.$refs.child.getData();
  180. },
  181. excelBtn() {
  182. this.$refs.child.getExcel();
  183. },
  184. personBtn() {
  185. this.$refs.child.remindExamine();
  186. }
  187. }
  188. };
  189. </script>
  190. <style scoped>
  191. .testExamine {
  192. width: 100%;
  193. /* min-width: calc(150px * 10); */
  194. min-height: 100%;
  195. padding: 10px;
  196. overflow: auto;
  197. box-sizing: border-box;
  198. background-color: #fff;
  199. }
  200. .testExamine > .testTit {
  201. height: 70px;
  202. display: flex;
  203. box-sizing: border-box;
  204. padding: 0 20px;
  205. justify-content: space-between;
  206. align-items: center;
  207. }
  208. .teaLis {
  209. display: flex;
  210. }
  211. .teal {
  212. padding: 10px 20px;
  213. cursor: pointer;
  214. }
  215. .Tbor {
  216. border-bottom: 2px rgba(54, 129, 252, 1) solid;
  217. font-weight: 600;
  218. }
  219. .testCon {
  220. box-sizing: border-box;
  221. padding: 20px;
  222. }
  223. .operate {
  224. display: flex;
  225. }
  226. .operate >>> .el-input {
  227. width: 200px !important;
  228. }
  229. .operate > .remindBtn {
  230. background: #409eff;
  231. padding: 10px 15px;
  232. box-sizing: border-box;
  233. width: 90px;
  234. text-align: center;
  235. border-radius: 4px;
  236. cursor: pointer;
  237. color: #fff;
  238. }
  239. </style>