choose_subjects_2.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. 高考省份
  3. <span v-for="(item,index) in data.allareaList" @click="chooseAreaId(item)">&nbsp;
  4. {{item.name}}
  5. </span>
  6. <br>
  7. 时间: <span v-for="(item,index) in yearArr" @click="chooseYear(item)">
  8. {{item}}&nbsp;
  9. </span>
  10. <br>
  11. 选考科目:
  12. <div v-show="universityForm.selstyle != 2 && universityForm.selstyle != undefined">
  13. <el-checkbox-group v-model="subjectArr">
  14. <el-checkbox value="物理">物理</el-checkbox>
  15. <el-checkbox value="化学">化学</el-checkbox>
  16. <el-checkbox value="生物">生物</el-checkbox>
  17. <el-checkbox value="历史">历史</el-checkbox>
  18. <el-checkbox value="地理">地理</el-checkbox>
  19. <el-checkbox value="政治">政治</el-checkbox>
  20. </el-checkbox-group>
  21. </div>
  22. <div v-show="universityForm.selstyle == 2">
  23. <el-radio-group v-model="subjectArr1">
  24. <el-radio value="物理">物理</el-radio>
  25. <el-radio value="历史">历史</el-radio>
  26. </el-radio-group>
  27. <el-checkbox-group v-model="subjectArr2">
  28. <el-checkbox value="化学">化学</el-checkbox>
  29. <el-checkbox value="生物">生物</el-checkbox>
  30. <el-checkbox value="地理">地理</el-checkbox>
  31. <el-checkbox value="政治">政治</el-checkbox>
  32. </el-checkbox-group>
  33. </div>
  34. 专业倾向:
  35. <el-button @click="showZY">选择专业</el-button>
  36. 您已选择的专业<br>----------------------------
  37. <div v-for="(item,index) in zyArr">
  38. {{item.name}}
  39. <el-button @click="removeChooseZY(item)">X</el-button>
  40. </div>
  41. <el-dialog v-model="zyFlag" width="600px" title="选择专业" append-to-body>
  42. 学历层次:-----------------------------<br>
  43. <div @click="xlccChoose(1,1)">本科</div>
  44. <div @click="xlccChoose(2,1)">专科</div>
  45. 专业门类:---------------------------<br>
  46. <div v-for="(item,index) in data.levelList2" @click="xlccChoose(item.oldid,2)">
  47. {{item.name}}
  48. </div>
  49. 专业类:-------------------------<br>
  50. <div v-for="(item,index) in data.levelList3" @click="xlccChoose(item.oldid,3)">
  51. {{item.name}}
  52. </div>
  53. 选择专业(可多选):-------------------<br>
  54. <div v-for="(item,index) in data.levelList4">
  55. <el-checkbox v-model="item.checked" @change="(e) => selectZY(e,item)">{{item.name}}</el-checkbox>
  56. </div>
  57. 您已选择的专业<br>----------------------------
  58. <div v-for="(item,index) in zyArr">
  59. {{item.name}}
  60. <el-button @click="removeChooseZY(item)">X</el-button>
  61. </div>
  62. <el-button @click="closeZY">确定</el-button>
  63. </el-dialog>
  64. <el-dialog v-model="gxFlag" width="800px" title="选择院校" append-to-body>
  65. 学历层次:-----------------------------###<br>
  66. <span @click="choose_educationlevel(null,null)">全部</span>&nbsp;
  67. <span @click="choose_educationlevel(1,'本科')">本科</span>&nbsp;&nbsp;
  68. <span @click="choose_educationlevel(2,'专科')">专科</span><br>
  69. 院校所在地:<span @click="choose_areaid(null)">全部</span>
  70. <span v-for="(item,index) in data.allareaList" @click="choose_areaid(item)">&nbsp;
  71. {{item.name}}
  72. </span>
  73. <br>
  74. 院校特色:
  75. <span v-for="(item,index) in educationlevel_decision">&nbsp;&nbsp;
  76. <el-checkbox v-model="item.checked" @change="(e) => selectTS(e,item)">{{item.label}}</el-checkbox>
  77. </span>
  78. <br>
  79. 院校分类:<span @click="choose_categoryid(null)">全部</span>&nbsp;
  80. <span v-for="(item,index) in school_category" @click="choose_categoryid(item)">
  81. {{item.label}}
  82. </span>
  83. <br>
  84. <br>
  85. 选择高校(可多选)<br>
  86. <span v-for="(item,index) in data_list.rows">
  87. {{item.name}}
  88. <el-checkbox v-model="item.checked" @change="(e) => selectGX(e,item)">{{item.name}}</el-checkbox>
  89. </span>
  90. <pagination v-show="data_list.total > 0" :total="data_list.total" v-model:page="universityForm.pageNum"
  91. v-model:limit="universityForm.pageSize" @pagination="getUniversity"/>
  92. 您已选择的高校<br>----------------------------
  93. <div v-for="(item,index) in gxArr">
  94. {{item.name}}
  95. <el-button @click="removeChooseGX(item)">X</el-button>
  96. </div>
  97. </el-dialog>
  98. <br>
  99. 高校倾向:
  100. <el-button @click="showGX">选择高校</el-button>
  101. <div>
  102. 选择结果:
  103. </div>
  104. <div>
  105. <div v-show="gxArr.length == 0">
  106. <div v-if="universityForm.educationname != null">
  107. {{universityForm.educationname}}
  108. <el-button @click="choose_educationlevel(null)">x</el-button>
  109. </div>
  110. <div v-if="universityForm.name != null">
  111. {{universityForm.name}}
  112. <el-button @click="choose_areaid(null)">x</el-button>
  113. </div>
  114. <div v-for="(item,index) in tsArr">
  115. {{item.label}}
  116. <el-button @click="removeChooseTS(item)">x</el-button>
  117. </div>
  118. <div v-if="universityForm.categoryname != null">
  119. {{universityForm.categoryname}}
  120. <el-button @click="removeChooseCategory(null)">x</el-button>
  121. </div>
  122. </div>
  123. <div v-for="(item,index) in gxArr">
  124. {{item.name}}
  125. <el-button>x</el-button>
  126. </div>
  127. </div>
  128. <el-button @click="querySpecialtySelect">开始查询</el-button>
  129. <el-table :data="specialty_list.rows">
  130. <el-table-column label="ARWU排名" align="center" prop="sortnum"/>
  131. <el-table-column label="院校名称" align="center" prop="universityname"/>
  132. <el-table-column label="专业名称" align="center" prop="specialtyname"/>
  133. <el-table-column label="必考" align="center">
  134. <template #default="scope">
  135. <div v-if="scope.row.mustsubject == null">
  136. --
  137. </div>
  138. <div v-if="scope.row.mustsubject != null">
  139. {{scope.row.mustsubject}}
  140. </div>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="选考" align="center" prop="needSubject"/>
  144. </el-table>
  145. <pagination v-show="specialty_list.total > 0" :total="specialty_list.total" v-model:page="queryForm.pageNum"
  146. v-model:limit="queryForm.pageSize" @pagination="querySpecialtySelect"/>
  147. </template>
  148. <script setup>
  149. import {
  150. specialtySelect,
  151. getSpecData,
  152. getUniversityList,
  153. specialtySelectList,
  154. subjectSelect,
  155. getStyle
  156. } from '@/api/xjc-integratedmachine/decision/limitsubject.js'
  157. const {proxy} = getCurrentInstance()
  158. const {school_category, educationlevel_decision} = proxy.useDict('school_category', 'educationlevel_decision')
  159. const zyFlag = ref(false)
  160. const gxFlag = ref(false)
  161. function showZY() {
  162. zyFlag.value = true
  163. }
  164. function showGX() {
  165. gxFlag.value = true
  166. }
  167. const data = ref({})
  168. function init() {
  169. specialtySelect().then(resp => {
  170. data.value = resp
  171. })
  172. }
  173. function xlccChoose(value, level) {
  174. getSpecData({
  175. value: value
  176. }).then(resp => {
  177. if (level == 1) {
  178. data.value.levelList2 = resp
  179. } else if (level == 2) {
  180. data.value.levelList3 = resp
  181. } else if (level == 3) {
  182. data.value.levelList4 = resp
  183. }
  184. })
  185. }
  186. const zyArr = ref([])
  187. //---------------------------------------专业选择----------------------------------------------
  188. function selectZY(e, item) {
  189. if (e == true) {
  190. item.checked = true
  191. zyArr.value.push(item)
  192. } else {
  193. item.checked = false
  194. zyArr.value = zyArr.value.filter((element, idx) => item.oldid !== element.oldid);
  195. }
  196. }
  197. function removeChooseZY(item) {
  198. zyArr.value = zyArr.value.filter((element, idx) => item.oldid !== element.oldid);
  199. data.value.levelList4.forEach(function (it, ind) {
  200. if (it.oldid == item.oldid) {
  201. item.checked = false
  202. }
  203. })
  204. }
  205. function closeZY() {
  206. zyFlag.value = false
  207. }
  208. //---------------------------------------高校选择----------------------------------------------
  209. function choose_educationlevel(item, name) {
  210. if (item == null) {
  211. universityForm.value.educationlevel = null
  212. universityForm.value.educationname = null
  213. } else {
  214. universityForm.value.educationlevel = item
  215. universityForm.value.educationname = name
  216. }
  217. getUniversity()
  218. }
  219. function choose_areaid(item) {
  220. if (item == null) {
  221. universityForm.value.areaid = null
  222. universityForm.value.name = null
  223. } else {
  224. universityForm.value.areaid = item.id
  225. universityForm.value.name = item.name
  226. }
  227. getUniversity()
  228. }
  229. function choose_yxts(item) {
  230. if (item.value == 1) {
  231. universityForm.value.too = 1
  232. } else if (item.value == 2) {
  233. universityForm.value.nef = 1
  234. } else if (item.value == 3) {
  235. universityForm.value.self = 1
  236. } else if (item.value == 4) {
  237. universityForm.value.graduate = 1
  238. } else if (item.value == 5) {
  239. universityForm.value.istopschool = 1
  240. } else if (item.value == 6) {
  241. universityForm.value.istopsubject = 1
  242. }
  243. getUniversity()
  244. }
  245. const gxArr = ref([])
  246. function choose_categoryid(item) {
  247. universityForm.value.categoryid = item.value
  248. universityForm.value.categoryname = item.label
  249. getUniversity()
  250. }
  251. function removeChooseCategory(item) {
  252. universityForm.value.categoryid = null
  253. universityForm.value.categoryname = null
  254. getUniversity()
  255. }
  256. const universityForm = ref({
  257. educationlevel: null,
  258. areaid: null,
  259. graduate: null,
  260. categoryid: null,
  261. pageNum: 1,
  262. pageSize: 10,
  263. })
  264. const data_list = ref({})
  265. function getUniversity() {
  266. getUniversityList(universityForm.value).then(resp => {
  267. data_list.value.rows = resp.university_list.rows
  268. data_list.value.total = resp.university_list.total
  269. data_list.value.rows.forEach(function (it, ind) {
  270. let isHave = false
  271. gxArr.value.forEach(function (item, index) {
  272. if (item.id == it.id) {
  273. isHave = true
  274. }
  275. })
  276. if (isHave) {
  277. it.checked = true
  278. } else {
  279. it.checked = false
  280. }
  281. })
  282. //console.log("!!!!",data_list.value.rows)
  283. })
  284. }
  285. function selectGX(e, item) {
  286. if (e == true) {
  287. item.checked = true
  288. gxArr.value.push(item)
  289. } else {
  290. item.checked = false
  291. gxArr.value = gxArr.value.filter((element, idx) => item.id !== element.id);
  292. }
  293. }
  294. function removeChooseGX(item) {
  295. gxArr.value = gxArr.value.filter((element, idx) => item.id !== element.id);
  296. data_list.value.rows.forEach(function (it, ind) {
  297. if (it.id == item.id) {
  298. item.checked = false
  299. }
  300. })
  301. }
  302. //特色
  303. const tsArr = ref([])
  304. function selectTS(e, item) {
  305. if (e == true) {
  306. item.checked = true
  307. tsArr.value.push(item)
  308. } else {
  309. item.checked = false
  310. tsArr.value = tsArr.value.filter((element, idx) => item.value !== element.value);
  311. }
  312. choose_yxts(item)
  313. }
  314. function removeChooseTS(item) {
  315. tsArr.value = tsArr.value.filter((element, idx) => item.value !== element.value);
  316. }
  317. //
  318. const queryForm = ref({
  319. pageSize: 10,
  320. pageNum: 1
  321. })
  322. //
  323. const yearArr = ref([])
  324. function chooseAreaId(item) {
  325. universityForm.value.areaid = item.id
  326. getStyle(universityForm.value).then(resp => {
  327. yearArr.value = resp.yearMap[universityForm.value.areaid]
  328. })
  329. }
  330. const specialty_list = ref([])
  331. function querySpecialtySelect() {
  332. if (universityForm.value.selstyle != 2 && universityForm.value.selstyle != undefined && checksubject()) {
  333. subjectSelect(queryForm.value).then(resp => {
  334. specialty_list.value = resp.data_list
  335. })
  336. } else if (universityForm.value.selstyle == 2 && universityForm.value.selstyle != undefined && checksubject2()) {
  337. subjectSelect(queryForm.value).then(resp => {
  338. specialty_list.value = resp.data_list
  339. })
  340. }
  341. }
  342. const subjectArr = ref([])
  343. function checksubject() {
  344. if (subjectArr.value.length != 3) {
  345. proxy.$modal.msgError("必须选3科")
  346. return false
  347. } else {
  348. queryForm.value.selsubject = ""
  349. subjectArr.value.forEach(function (item, index) {
  350. queryForm.value.selsubject += (item + ",")
  351. })
  352. queryForm.value.selsubject = queryForm.value.selsubject.substr(0, queryForm.value.selsubject.length - 1)
  353. return true
  354. }
  355. }
  356. function chooseYear(item) {
  357. universityForm.value.year = item
  358. queryForm.value.year = item
  359. getStyle(universityForm.value).then(resp => {
  360. universityForm.value.selstyle = resp.selstyle
  361. })
  362. }
  363. const subjectArr1 = ref([]);
  364. const subjectArr2 = ref([]);
  365. function checksubject2() {
  366. if (subjectArr1.value.length == 0) {
  367. proxy.$modal.msgError("物理、历史必选一科")
  368. return false
  369. } else if (subjectArr2.value.length != 2) {
  370. proxy.$modal.msgError("最多选3科")
  371. return false
  372. } else {
  373. subjectArr1.value.forEach(function (item, index) {
  374. queryForm.value.selsubject += (item + ",")
  375. })
  376. subjectArr2.value.forEach(function (item, index) {
  377. queryForm.value.selsubject += (item + ",")
  378. })
  379. return true
  380. }
  381. }
  382. init()
  383. </script>
  384. <style scoped>
  385. </style>