searchBoxNew.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. <template>
  2. <div id="searchBoxNew">
  3. <div class="inputListBox" v-if="topType">
  4. <div class="fon_s">商品类型:</div>
  5. <div>
  6. <el-button
  7. :type="formData.goodsType === item.value ? 'primary' : ''"
  8. v-for="(item, index) in $methodsTools.getGoodsType(false)"
  9. :key="index"
  10. @click="topSearch(item.value)"
  11. >{{ item.label }}</el-button
  12. >
  13. </div>
  14. </div>
  15. <div class="inputListBox" v-if="shType">
  16. <div class="fon_s">审核状态:</div>
  17. <div>
  18. <el-button
  19. :type="formData.status === item.value ? 'primary' : ''"
  20. v-for="(item, index) in lists5"
  21. :key="index"
  22. @click="topSearchsh(item.value)"
  23. >{{ item.label }}</el-button
  24. >
  25. </div>
  26. </div>
  27. <div class="inputListBoxs">
  28. <div
  29. class="fon_s"
  30. style="padding-top: 10px; width: 70px; text-align: end"
  31. v-if="redIcon !== false && false"
  32. >
  33. 筛选:
  34. </div>
  35. <el-form
  36. @submit.native.prevent="() => {}"
  37. :inline="true"
  38. :model="formData"
  39. class="tsxnz demo-form-inline"
  40. >
  41. <el-form-item
  42. v-for="(item, index) in formListComput(formList)"
  43. :key="index"
  44. :label="item.label"
  45. >
  46. <!-- 教育类型 -->
  47. <el-select
  48. v-if="item.scope === 'educationType'"
  49. v-model="formData[item.prop]"
  50. :placeholder="item.placeholder"
  51. @change="changeEducationType"
  52. >
  53. <el-option
  54. v-for="(items, indexs) in educationType"
  55. v-show="
  56. !item.filter ||
  57. (item.filter && items.educationName === '继续教育')
  58. "
  59. :key="indexs"
  60. :label="
  61. item.schemeName && items.schemeName
  62. ? items.schemeName + ' - ' + items.educationName
  63. : items.educationName
  64. "
  65. :value="items.id"
  66. ></el-option>
  67. </el-select>
  68. <!-- 项目类型 -->
  69. <el-select
  70. v-else-if="item.scope === 'projectLevel'"
  71. v-model="formData[item.prop]"
  72. :placeholder="item.placeholder"
  73. >
  74. <el-option
  75. v-for="(items, indexs) in newProjectLevel"
  76. :key="indexs"
  77. :label="items.projectName"
  78. :value="items.id"
  79. ></el-option>
  80. </el-select>
  81. <!-- 业务层次 -->
  82. <el-select
  83. v-else-if="item.scope === 'businessLevel'"
  84. v-model="formData[item.prop]"
  85. :placeholder="item.placeholder"
  86. @change="changeBusinessLevel($event)"
  87. >
  88. <el-option
  89. v-for="(items, indexs) in newBusinessLevel"
  90. :key="indexs"
  91. v-show="
  92. !item.filter ||
  93. (item.filter &&
  94. (items.projectName === '造价师' ||
  95. items.projectName === '建造师') &&
  96. items.businessName === '二级')
  97. "
  98. :label="items.projectName + '-' + items.businessName"
  99. :value="items.id"
  100. ></el-option>
  101. </el-select>
  102. <!-- 店铺管理列表 -->
  103. <el-select
  104. v-else-if="item.scope === 'merList'"
  105. v-model="formData[item.prop]"
  106. :placeholder="item.placeholder"
  107. clearable
  108. filterable
  109. >
  110. <el-option
  111. v-for="(items, indexs) in merList"
  112. :key="indexs"
  113. :label="items.merName"
  114. :value="items.merId"
  115. ></el-option>
  116. </el-select>
  117. <!-- 商户店铺列表 -->
  118. <el-select
  119. v-else-if="item.scope === 'storeList'"
  120. v-model="formData[item.prop]"
  121. :placeholder="item.placeholder"
  122. clearable
  123. filterable
  124. >
  125. <el-option
  126. v-for="(items, indexs) in storeList"
  127. :key="indexs"
  128. :label="items.storeName"
  129. :value="items.storeId"
  130. ></el-option>
  131. </el-select>
  132. <!-- 机构列表 -->
  133. <el-select
  134. v-else-if="item.scope === 'systemtenantlist'"
  135. v-model="formData[item.prop]"
  136. :placeholder="item.placeholder"
  137. clearable
  138. :multiple="item.multiple"
  139. filterable
  140. >
  141. <el-option
  142. v-for="(items, indexs) in systemtenantlist"
  143. :key="indexs"
  144. :label="items.tenantName"
  145. :value="items.tenantId"
  146. ></el-option>
  147. </el-select>
  148. <!-- 职能机构列表 -->
  149. <el-select
  150. v-else-if="item.scope === 'topinstitutionList'"
  151. v-model="formData[item.prop]"
  152. :placeholder="item.placeholder"
  153. clearable
  154. filterable
  155. >
  156. <el-option
  157. v-for="(items, indexs) in topinstitutionList"
  158. :key="indexs"
  159. :label="items.instName"
  160. :value="items.instId"
  161. ></el-option>
  162. </el-select>
  163. <!-- 成本分类列表 -->
  164. <el-select
  165. v-else-if="item.scope === 'topinstcategoryList'"
  166. v-model="formData[item.prop]"
  167. :placeholder="item.placeholder"
  168. clearable
  169. filterable
  170. >
  171. <el-option
  172. v-for="(items, indexs) in topinstcategoryList"
  173. :key="indexs"
  174. :label="items.categoryName"
  175. :value="items.costCatId"
  176. ></el-option>
  177. </el-select>
  178. <!-- 院校 -->
  179. <el-select
  180. v-else-if="item.scope === 'schoolList'"
  181. v-model="formData[item.prop]"
  182. :placeholder="item.placeholder"
  183. >
  184. <el-option
  185. v-for="(items, indexs) in newSchoolList"
  186. :key="indexs"
  187. :label="items.schoolName"
  188. :value="items.id"
  189. ></el-option>
  190. </el-select>
  191. <!-- 专业-根据教育类型筛选 -->
  192. <el-select
  193. v-else-if="item.scope === 'Professional'"
  194. v-model="formData[item.prop]"
  195. :placeholder="item.placeholder"
  196. >
  197. <el-option
  198. v-for="(items, indexs) in newProfessional"
  199. :key="indexs"
  200. :label="items.categoryName"
  201. :value="items.id"
  202. ></el-option>
  203. </el-select>
  204. <!-- 角色列表 -->
  205. <el-select
  206. v-else-if="item.scope === 'roleList'"
  207. v-model="formData[item.prop]"
  208. :placeholder="item.placeholder"
  209. clearable
  210. >
  211. <el-option
  212. v-for="(items, indexs) in roleList"
  213. :key="indexs"
  214. :label="items.roleName"
  215. :value="items.roleId"
  216. ></el-option>
  217. </el-select>
  218. <!-- 专业 -->
  219. <el-select
  220. v-else-if="item.scope === 'ProfessionalList'"
  221. v-model="formData[item.prop]"
  222. :placeholder="item.placeholder"
  223. >
  224. <el-option
  225. v-for="(items, indexs) in Professional"
  226. :key="indexs"
  227. :label="items.categoryName"
  228. :value="items.id"
  229. ></el-option>
  230. </el-select>
  231. <!-- 科目 -->
  232. <el-select
  233. v-else-if="item.scope === 'sujectType'"
  234. v-model="formData[item.prop]"
  235. :placeholder="item.placeholder"
  236. >
  237. <el-option
  238. v-for="(items, indexs) in newSujectType"
  239. :key="indexs"
  240. :label="items.subjectName"
  241. :value="items.id"
  242. ></el-option>
  243. </el-select>
  244. <!-- 题目类型 -->
  245. <el-select
  246. v-else-if="item.scope === 'selectBank'"
  247. v-model="formData[item.prop]"
  248. :placeholder="item.placeholder"
  249. >
  250. <el-option
  251. v-for="(items, indexs) in optionsBank"
  252. :key="indexs"
  253. :label="items.label"
  254. :value="items.value"
  255. ></el-option>
  256. </el-select>
  257. <!-- 证书类型 -->
  258. <el-select
  259. v-else-if="item.scope === 'certificate'"
  260. v-model="formData[item.prop]"
  261. :placeholder="item.placeholder"
  262. >
  263. <el-option
  264. v-for="(items, indexs) in certificate"
  265. :key="indexs"
  266. :label="items.certificateName"
  267. :value="items.id"
  268. ></el-option>
  269. </el-select>
  270. <!-- 自定义select -->
  271. <el-select
  272. :clearable="item.noClear === false ? false : true"
  273. :filterable="item.filterable ? true : false"
  274. :multiple="item.multiple ? true : false"
  275. v-else-if="item.scope === 'select'"
  276. v-model="formData[item.prop]"
  277. :placeholder="item.placeholder"
  278. >
  279. <el-option
  280. v-for="(items, indexs) in item.options"
  281. :key="indexs"
  282. :label="items[item.selectLabel || 'label']"
  283. :value="items[item.selectValue || 'value']"
  284. :disabled="items.disable"
  285. ></el-option>
  286. </el-select>
  287. <div v-else-if="item.scope === 'numList'">
  288. <el-input-number
  289. :controls="false"
  290. v-model="formData[item.prop1]"
  291. controls-position="right"
  292. :min="0"
  293. :max="100"
  294. @change="
  295. handleChanges(formData[item.prop1], formData[item.prop2])
  296. "
  297. ></el-input-number
  298. >~
  299. <el-input-number
  300. :controls="false"
  301. v-model="formData[item.prop2]"
  302. controls-position="right"
  303. :min="0"
  304. :max="100"
  305. @change="
  306. handleChanges(formData[item.prop1], formData[item.prop2])
  307. "
  308. ></el-input-number>
  309. </div>
  310. <div v-else-if="item.scope === 'numList1'">
  311. <el-input-number
  312. :controls="false"
  313. v-model="formData[item.prop1]"
  314. controls-position="right"
  315. :placeholder="item.placeholder1 || ''"
  316. :min="0"
  317. @change="
  318. handleChanges(formData[item.prop1], formData[item.prop2])
  319. "
  320. >
  321. </el-input-number>
  322. {{ item.ch || "~" }}
  323. <el-input-number
  324. :controls="false"
  325. v-model="formData[item.prop2]"
  326. controls-position="right"
  327. :placeholder="item.placeholder2 || ''"
  328. :min="0"
  329. @change="
  330. handleChanges(formData[item.prop1], formData[item.prop2])
  331. "
  332. ></el-input-number>
  333. </div>
  334. <el-input-number
  335. v-else-if="item.scope === 'inputNumber'"
  336. v-model="formData[item.prop]"
  337. controls-position="right"
  338. :min="0"
  339. :max="100"
  340. ></el-input-number>
  341. <el-input
  342. v-else-if="item.scope === 'textarea' && formData[item.prop]"
  343. type="textarea"
  344. readonly
  345. :rows="3"
  346. placeholder="请输入身份证"
  347. v-model.trim="formData[item.prop]"
  348. >
  349. </el-input>
  350. <el-cascader
  351. v-else-if="item.scope === 'cascader'"
  352. v-model="formData[item.prop]"
  353. :options="item.options"
  354. :props="{
  355. label: item.props.label,
  356. value: item.props.value,
  357. checkStrictly: true,
  358. emitPath: false,
  359. }"
  360. ></el-cascader>
  361. <el-cascader
  362. v-else-if="item.scope === 'cascaderDZ'"
  363. v-model="formData[item.prop]"
  364. :options="item.options"
  365. :props="{
  366. label: item.props.label,
  367. value: item.props.value,
  368. checkStrictly: true,
  369. emitPath: false,
  370. }"
  371. clearable
  372. ></el-cascader>
  373. <!-- pickerOptions json处理后丢失 取原值 -->
  374. <el-date-picker
  375. v-else-if="item.scope === 'datePicker'"
  376. v-model="formData[item.prop]"
  377. :type="item.type || 'datetimerange'"
  378. :picker-options="
  379. item.pickerOptions ? formList[index].pickerOptions : pickerOptions
  380. "
  381. range-separator="至"
  382. start-placeholder="开始日期"
  383. end-placeholder="结束日期"
  384. align="right"
  385. :default-time="['00:00:00', '23:59:59']"
  386. value-format="timestamp"
  387. :default-value="item.defaultValue"
  388. >
  389. </el-date-picker>
  390. <el-date-picker
  391. v-else-if="item.scope === 'datePickerA'"
  392. v-model="formData[item.prop]"
  393. :type="item.type || 'datetime'"
  394. :placeholder="item.placeholder"
  395. value-format="timestamp"
  396. >
  397. </el-date-picker>
  398. <div v-else-if="item.scope === 'moreDataPicker'">
  399. <el-date-picker
  400. v-model="formData[item.prop1]"
  401. :type="item.Diszing ? 'datetime' : 'date'"
  402. value-format="timestamp"
  403. :placeholder="item.placeholder1"
  404. @change="change1(item.prop1, item.prop2)"
  405. >
  406. </el-date-picker>
  407. <el-date-picker
  408. style="margin-left: 10px"
  409. v-model="formData[item.prop2]"
  410. :type="item.Diszing ? 'datetime' : 'date'"
  411. value-format="timestamp"
  412. :placeholder="item.placeholder2"
  413. @change="change2(item.prop1, item.prop2)"
  414. >
  415. </el-date-picker>
  416. </div>
  417. <el-date-picker
  418. v-else-if="item.scope === 'moreMonth'"
  419. type="months"
  420. v-model="formData[item.prop]"
  421. :placeholder="item.placeholder || '选择月份'"
  422. value-format="timestamp"
  423. >
  424. </el-date-picker>
  425. <el-date-picker
  426. v-else-if="item.scope === 'years'"
  427. type="years"
  428. v-model="formData[item.prop]"
  429. :placeholder="item.placeholder || '选择年份'"
  430. :value-format="item.format || 'timestamp'"
  431. >
  432. </el-date-picker>
  433. <slot v-else-if="item.scope === 'slot'" name="slotSearch"></slot>
  434. <el-input
  435. :style="item.prop === 'searchKey' ? 'width:260px;' : ''"
  436. v-else-if="!item.scope"
  437. clearable
  438. v-model.trim="formData[item.prop]"
  439. :placeholder="item.placeholder"
  440. @keyup.enter.native="search"
  441. ></el-input>
  442. </el-form-item>
  443. <el-form-item>
  444. <el-button v-if="advanced" type="success" @click="emitAdvanced">{{
  445. advancedName
  446. }}</el-button>
  447. <el-button type="primary" @click="search">查询</el-button>
  448. <el-button @click="init">重置</el-button>
  449. <slot name="customize"></slot>
  450. </el-form-item>
  451. </el-form>
  452. </div>
  453. </div>
  454. </template>
  455. <script>
  456. import { mapGetters } from "vuex";
  457. export default {
  458. props: [
  459. "formList",
  460. "topType",
  461. "formData",
  462. "shType",
  463. "redIcon",
  464. "advanced",
  465. "advancedName",
  466. ], //参考文档 component.md
  467. data() {
  468. return {
  469. tireStatus: "", //当前选择的教育类型tireStatus
  470. lists: [
  471. {
  472. label: "全部",
  473. value: "",
  474. },
  475. {
  476. label: "视频",
  477. value: 1,
  478. },
  479. {
  480. label: "题库",
  481. value: 2,
  482. },
  483. {
  484. label: "补考",
  485. value: 3,
  486. },
  487. {
  488. label: "前培",
  489. value: 4,
  490. },
  491. ],
  492. classType: [
  493. {
  494. label: "全部",
  495. value: "",
  496. },
  497. {
  498. label: "已开班",
  499. value: 1,
  500. },
  501. {
  502. label: "预报名(未开班)",
  503. value: 0,
  504. },
  505. ],
  506. pendlists: [
  507. {
  508. label: "初审",
  509. value: 0,
  510. },
  511. {
  512. label: "复审",
  513. value: "1,2",
  514. },
  515. {
  516. label: "不通过",
  517. value: "-1,-2",
  518. },
  519. {
  520. label: "已通过",
  521. value: 3,
  522. },
  523. ],
  524. lists5: [
  525. {
  526. label: "全部",
  527. value: "",
  528. },
  529. {
  530. label: "待审核",
  531. value: 2,
  532. },
  533. {
  534. label: "不通过",
  535. value: 3,
  536. },
  537. {
  538. label: "通过",
  539. value: 1,
  540. },
  541. ],
  542. lists6: [
  543. {
  544. label: "待审核",
  545. value: 2,
  546. },
  547. {
  548. label: "审核中",
  549. value: 3,
  550. },
  551. ],
  552. // classLists: [
  553. // {
  554. // label: "全部",
  555. // value: "",
  556. // },
  557. // {
  558. // label: "二建继教",
  559. // value: 1,
  560. // },
  561. // {
  562. // label: "七大员继教",
  563. // value: 2,
  564. // },
  565. // {
  566. // label: "七大员新考",
  567. // value: 3,
  568. // },
  569. // ],
  570. paperType: [
  571. {
  572. label: "发布",
  573. value: 1,
  574. },
  575. {
  576. label: "未发布",
  577. value: 0,
  578. },
  579. ],
  580. optionsBank: [
  581. {
  582. label: "单选题",
  583. value: 1,
  584. },
  585. {
  586. label: "多选题",
  587. value: 2,
  588. },
  589. {
  590. label: "判断题",
  591. value: 3,
  592. },
  593. {
  594. label: "案例题",
  595. value: 4,
  596. },
  597. {
  598. label: "简答题",
  599. value: 5,
  600. },
  601. ], //题目类型
  602. size: "small", //输入框尺寸类型
  603. newProjectLevel: [], //项目类型-筛选后的数据
  604. newBusinessLevel: [], //业务层次-筛选后的数据
  605. newSchoolList: [], //院校-筛选后的数据
  606. newProfessional: [], //专业-筛选后的数据
  607. newSujectType: [], //科目-筛选后的数据
  608. applySiteAddressX: [], //考试地点-根据考试计划过滤而来
  609. pickerOptions: {},
  610. };
  611. },
  612. computed: {
  613. ...mapGetters([
  614. "educationType",
  615. "Professional",
  616. "examList",
  617. "examLists",
  618. "beforeList",
  619. "beforeLists",
  620. "applySiteAddress",
  621. "certificate",
  622. "systemtenantlist",
  623. "roleList",
  624. "merList",
  625. "storeList",
  626. "topinstitutionList",
  627. "topinstcategoryList",
  628. ]),
  629. /**
  630. * @remarks 过滤选择器列表
  631. */
  632. formListComput: function () {
  633. return function (item) {
  634. var newOption = JSON.parse(JSON.stringify(item));
  635. const arrsy = newOption.filter((items) => {
  636. if (
  637. items.scope === "businessLevel" ||
  638. items.scope === "schoolList" ||
  639. items.scope === "Professional" ||
  640. items.scope === "sujectType"
  641. ) {
  642. if (!this.formData[items.edu]) {
  643. } else {
  644. if (this.educationType) {
  645. const indexType = this.educationType.findIndex((its) => {
  646. return its.id === this.formData[items.edu];
  647. });
  648. if (
  649. items.scope === "businessLevel" &&
  650. this.educationType[indexType].tireStatus?.indexOf("2") !== -1
  651. ) {
  652. return items;
  653. }
  654. if (
  655. items.scope === "schoolList" &&
  656. this.educationType[indexType].tireStatus?.indexOf("3") !==
  657. -1 &&
  658. this.formData["businessId"]
  659. ) {
  660. return items;
  661. }
  662. if (
  663. items.scope === "Professional" &&
  664. this.educationType[indexType].tireStatus?.indexOf("4") !==
  665. -1 &&
  666. this.formData["businessId"]
  667. ) {
  668. return items;
  669. }
  670. if (
  671. items.scope === "sujectType" &&
  672. this.formData["businessId"]
  673. ) {
  674. return items;
  675. }
  676. }
  677. }
  678. } else {
  679. if (items.diff === "gfxs") {
  680. if (
  681. this.formData["studyStatus"] == 2 &&
  682. this.formData["periodStatus"] == 1
  683. ) {
  684. return items;
  685. }
  686. } else if (items.diff === "ksdd") {
  687. if (this.formData["applyId"]) {
  688. return items;
  689. }
  690. } else if (items.scope === "projectLevel") {
  691. if (this.formData["educationId"]) {
  692. return items;
  693. }
  694. } else {
  695. return items;
  696. }
  697. }
  698. });
  699. return arrsy;
  700. };
  701. },
  702. },
  703. methods: {
  704. /**
  705. * 手动过滤考试地点
  706. */
  707. getChangeAdress(id) {
  708. this.$api
  709. .inquirepayservesiteInfo({
  710. applyId: id,
  711. addressStatus: 1,
  712. })
  713. .then((res) => {
  714. this.applySiteAddressX = res.rows;
  715. });
  716. },
  717. /**
  718. * @remark 高级搜索
  719. */
  720. emitAdvanced() {
  721. this.$emit("Advanced", this.formData);
  722. },
  723. /**
  724. *
  725. * @param {int} data1
  726. * @param {int} data2
  727. * @remark 日期搜索-时间开始选择器触发
  728. */
  729. change1(data1, data2) {
  730. if (this.formData[data1]) {
  731. if (
  732. this.formData[data2] &&
  733. this.formData[data1] > this.formData[data2]
  734. ) {
  735. this.formData[data1] = "";
  736. this.$message.warning("开始时间不能大于结束时间,请重新选择开始时间");
  737. }
  738. }
  739. },
  740. /**
  741. *
  742. * @param {int} data1
  743. * @param {int} data2
  744. * @remark 日期搜索-时间结束选择器触发
  745. */
  746. change2(data1, data2) {
  747. if (this.formData[data2]) {
  748. if (
  749. this.formData[data1] &&
  750. this.formData[data2] < this.formData[data1]
  751. ) {
  752. this.formData[data2] = "";
  753. this.$message.warning("结束时间不能小于开始时间,请重新选择结束时间");
  754. }
  755. }
  756. },
  757. /**
  758. *
  759. * @param {int} status
  760. * @remark 顶部定制按钮-根据商品类型点击快速搜索
  761. */
  762. topSearch(status) {
  763. this.formData.goodsType = status;
  764. this.$emit("search", 3);
  765. },
  766. /**
  767. *
  768. * @param {int} status
  769. * @remark 顶部定制按钮-根据审核状态点击快速搜索
  770. */
  771. topSearchsh(types) {
  772. this.formData.status = types;
  773. this.$emit("search", 3);
  774. },
  775. /**
  776. * @remark 搜索
  777. */
  778. search() {
  779. this.$emit("search", 1);
  780. },
  781. /**
  782. * @remark 重置
  783. */
  784. init() {
  785. this.$emit("init");
  786. },
  787. /**
  788. *
  789. * @param {int} int1
  790. * @param {int} int2
  791. * @remark 数值取值范围选择器
  792. */
  793. handleChanges(int1, int2) {
  794. if (int1 !== undefined && int2 !== undefined) {
  795. if (int1 > int2) {
  796. this.$message.error("请规范输入取值范围");
  797. }
  798. }
  799. },
  800. /**
  801. *
  802. * @param {int} id
  803. * @param {bool} status1 //是否不清空业务层级
  804. * @remark 点击教育类型触发事件
  805. */
  806. changeEducationType(id, status1) {
  807. if (!id) {
  808. return;
  809. }
  810. const indexs = this.educationType.findIndex((item) => {
  811. return item.id === id;
  812. });
  813. this.tireStatus = this.educationType[indexs].tireStatus || "";
  814. if (!status1) {
  815. if (this.formData.projectId) {
  816. this.formData.projectId = "";
  817. }
  818. if (this.formData.businessId) {
  819. this.formData.businessId = "";
  820. }
  821. }
  822. if (this.formData.subjectId) {
  823. this.formData.subjectId = "";
  824. }
  825. this.$api
  826. .inquireCourseProjectType({ status: 1, educationId: id })
  827. .then((res) => {
  828. this.newProjectLevel = res.rows;
  829. });
  830. this.$api
  831. .inquirebusinessList({ status: 1, educationId: id })
  832. .then((res) => {
  833. this.newBusinessLevel = res.rows;
  834. });
  835. if (!status1) {
  836. this.$api
  837. .inquireCourseSubject({ status: 1, educationId: id })
  838. .then((res) => {
  839. this.newSujectType = res.rows;
  840. });
  841. }
  842. },
  843. /**
  844. *
  845. * @param {int} id
  846. * @remark 点击业务层次触发事件
  847. */
  848. changeBusinessLevel(v) {
  849. if (this.formData.schoolId) {
  850. this.formData.schoolId = "";
  851. }
  852. this.$api.inquireUserSchool({ status: 1, businessId: v }).then((res) => {
  853. this.newSchoolList = res.rows;
  854. });
  855. if (this.formData.majorId) {
  856. this.formData.majorId = "";
  857. }
  858. this.$api.inquireCourseMajor({ status: 1, businessId: v }).then((res) => {
  859. this.newProfessional = res.rows;
  860. });
  861. if (this.formData.subjectId) {
  862. this.formData.subjectId = "";
  863. }
  864. this.$api
  865. .inquireCourseSubject({ status: 1, businessId: v })
  866. .then((res) => {
  867. this.newSujectType = res.rows;
  868. });
  869. },
  870. /**
  871. * 外部调用-商品新增编辑页
  872. */
  873. changeSuject(v) {
  874. if (v) {
  875. this.$api
  876. .inquireCourseSubject({ status: 1, projectId: v })
  877. .then((res) => {
  878. this.newSujectType = res.rows;
  879. });
  880. } else {
  881. this.newSujectType = [];
  882. }
  883. },
  884. },
  885. };
  886. </script>
  887. <style lang="less" scoped>
  888. ::v-deep .el-input__inner {
  889. &::placeholder {
  890. color: #a4a4a4;
  891. }
  892. }
  893. .fon_s {
  894. font-size: 14px;
  895. color: #6b6b6b;
  896. }
  897. .fon_sIcon {
  898. width: 50px;
  899. display: flex;
  900. align-items: center;
  901. justify-content: center;
  902. }
  903. .iconStyS {
  904. font-size: 24px;
  905. font-weight: bold;
  906. color: red;
  907. }
  908. .inputListBox {
  909. display: flex;
  910. align-items: center;
  911. margin-bottom: 12px;
  912. }
  913. .inputListBoxs {
  914. display: flex;
  915. margin-bottom: 12px;
  916. }
  917. .tsxnz {
  918. flex: 1;
  919. /deep/ .el-form-item {
  920. margin-bottom: 8px;
  921. }
  922. }
  923. </style>