index.vue 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410
  1. <template>
  2. <div id="examArrangement">
  3. <table-list
  4. :tableSets="tableSet"
  5. :tableData="tableData"
  6. :navText="navText"
  7. @addClick="addClick"
  8. :loading="loading"
  9. @editInfo="editInfo"
  10. >
  11. <template slot="customize">
  12. <el-button size="medium" type="warning" @click="setExamAdress"
  13. >配置考试地点</el-button
  14. >
  15. </template>
  16. <template slot="btn" slot-scope="props">
  17. <el-button
  18. type="text"
  19. @click="beforeFunc(props.scope.row)"
  20. >前培设置</el-button
  21. >
  22. <el-button
  23. type="text"
  24. @click="addClick(props.scope.row, 0)"
  25. :disabled="props.scope.row.status === 1"
  26. >修改计划</el-button
  27. >
  28. <el-button
  29. type="text"
  30. @click="setExams(props.scope.row, 1)"
  31. :disabled="props.scope.row.status === 1"
  32. >考点设置</el-button
  33. >
  34. <el-button
  35. type="text"
  36. @click="setExams(props.scope.row, 2)"
  37. :disabled="props.scope.row.status === 1"
  38. >考培设置</el-button
  39. >
  40. <el-button
  41. type="text"
  42. @click="editGoods(props.scope.row)"
  43. :disabled="props.scope.row.status === 1"
  44. >适用商品</el-button
  45. >
  46. <el-button type="text" @click="watchs(props.scope.row)">预览</el-button>
  47. <el-button
  48. type="text"
  49. @click="del(props.scope.row, 1)"
  50. v-if="props.scope.row.status === 0"
  51. >启用</el-button
  52. >
  53. <el-button
  54. type="text"
  55. @click="del(props.scope.row, 2)"
  56. v-if="props.scope.row.status === 1"
  57. >关闭</el-button
  58. >
  59. <el-button type="text" @click="del(props.scope.row, 3)">删除</el-button>
  60. </template>
  61. </table-list>
  62. <pagination
  63. :total="total"
  64. :pageSize="pageSize"
  65. :currentPage="currentPage"
  66. @handleSizeChange="handleSizeChange"
  67. @handleCurrentChange="handleCurrentChange"
  68. />
  69. <el-dialog
  70. @closed="loadingClose"
  71. :visible.sync="dialogVisible"
  72. width="610px"
  73. :show-close="false"
  74. :close-on-click-modal="false"
  75. >
  76. <div slot="title" class="hearders">
  77. <div class="leftTitle">
  78. {{ statusPop === 1 ? "添加" : statusPop === 0 ? "修改" : "详情" }}
  79. </div>
  80. <div class="rightBoxs">
  81. <img src="@/assets/images/Close@2x.png" alt="" @click="close" />
  82. </div>
  83. </div>
  84. <div>
  85. <el-form
  86. label-position="right"
  87. label-width="150px"
  88. :model="listData"
  89. :rules="rules"
  90. ref="listData"
  91. >
  92. <el-form-item label="考试封面" prop="applyUrl">
  93. <div class="dis_fs">
  94. <img
  95. class="imgBoxs"
  96. :src="$methodsTools.splitImgHost(listData.applyUrl)"
  97. alt="加载失败"
  98. />
  99. <label class="btns"
  100. >修改封面
  101. <input
  102. ref="file"
  103. type="file"
  104. style="display: none"
  105. @change="editImg"
  106. />
  107. </label>
  108. </div>
  109. <div
  110. style="
  111. font-size: 12px;
  112. color: #999;
  113. line-height: 20px;
  114. margin-top: 10px;
  115. "
  116. >
  117. 注:请上传小于300kb,尺寸为1920*930的像素图片,支持gif、jpg、jpeg、png等类型
  118. </div>
  119. </el-form-item>
  120. <el-form-item label="考试标题" prop="applyName">
  121. <el-input
  122. :disabled="statusPop === 2"
  123. v-model="listData.applyName"
  124. ></el-input>
  125. </el-form-item>
  126. <el-form-item label="考试简介" prop="applyIntroduce">
  127. <el-input
  128. type="textarea"
  129. :rows="4"
  130. :disabled="statusPop === 2"
  131. v-model="listData.applyIntroduce"
  132. ></el-input>
  133. </el-form-item>
  134. <el-form-item label="可报学员" prop="applyStatus">
  135. <el-checkbox-group
  136. v-model="listData.applyStatus"
  137. style="width: 60%; display: inline-block"
  138. >
  139. <el-checkbox :label="1">非补考学员</el-checkbox>
  140. <el-checkbox :label="2">补考学员</el-checkbox>
  141. </el-checkbox-group>
  142. <span style="font-size: 12px; color: #999">注:可多选</span>
  143. </el-form-item>
  144. <el-form-item label="报名开放时间" required>
  145. <el-col :span="11">
  146. <el-form-item prop="applyStartTime">
  147. <el-date-picker
  148. type="datetime"
  149. placeholder="开始日期"
  150. @change="changeEndTime(1)"
  151. v-model="listData.applyStartTime"
  152. style="width: 100%"
  153. value-format="timestamp"
  154. ></el-date-picker>
  155. </el-form-item>
  156. </el-col>
  157. <el-col class="line" style="text-align: center" :span="2">-</el-col>
  158. <el-col :span="11">
  159. <el-form-item prop="applyEndTime">
  160. <el-date-picker
  161. type="datetime"
  162. placeholder="结束日期"
  163. @change="changeEndTime(2)"
  164. v-model="listData.applyEndTime"
  165. style="width: 100%"
  166. value-format="timestamp"
  167. ></el-date-picker>
  168. </el-form-item>
  169. </el-col>
  170. </el-form-item>
  171. </el-form>
  172. </div>
  173. <span slot="footer" class="dialog-footer">
  174. <el-button @click="close">取 消</el-button>
  175. <el-button
  176. type="primary"
  177. :loading="disabledBtn"
  178. v-if="statusPop !== 2"
  179. @click="submit('listData')"
  180. >确 定</el-button
  181. >
  182. </span>
  183. </el-dialog>
  184. <el-dialog
  185. @closed="loadingClose"
  186. :visible.sync="dialogExamBoxs"
  187. width="620px"
  188. :show-close="false"
  189. :close-on-click-modal="false"
  190. >
  191. <div slot="title" class="hearders">
  192. <div class="leftTitle">
  193. {{
  194. intStatus === 1
  195. ? "设置考试地点"
  196. : intStatus === 2
  197. ? "设置考培地点"
  198. : "未知"
  199. }}
  200. </div>
  201. <div class="rightBoxs">
  202. <img
  203. src="@/assets/images/Close@2x.png"
  204. alt=""
  205. @click="dialogExamBoxs = false"
  206. />
  207. </div>
  208. </div>
  209. <div>
  210. <el-button type="text" @click="openExamPlace">{{
  211. intStatus === 1
  212. ? "添加考试地点"
  213. : intStatus === 2
  214. ? "添加考前培训地点"
  215. : "未知"
  216. }}</el-button>
  217. <div
  218. v-for="(item, index) in examPlaces"
  219. :key="index"
  220. style="margin-bottom: 10px"
  221. >
  222. <div class="dis_fs">
  223. <div class="bors">
  224. {{ item.siteAddress }}
  225. <i
  226. class="el-icon-error"
  227. style="
  228. color: #f56c6c;
  229. font-size: 14px;
  230. margin: 0px 6px;
  231. cursor: pointer;
  232. "
  233. @click="examPlaces.splice(index, 1)"
  234. ></i>
  235. </div>
  236. <el-button
  237. style="margin-left: 10px"
  238. type="text"
  239. size="mini"
  240. @click="
  241. item.examApplySiteTime.push({
  242. examTime: '',
  243. examApplySiteTimeTwo: [{}],
  244. })
  245. "
  246. >{{
  247. intStatus === 1
  248. ? "添加考试时间"
  249. : intStatus === 2
  250. ? "添加考培时间"
  251. : "未知"
  252. }}</el-button
  253. >
  254. </div>
  255. <div
  256. v-for="(items, indexs) in item.examApplySiteTime"
  257. :key="indexs"
  258. class="dis_fs"
  259. >
  260. <div class="mar_bgc">
  261. <div class="dis_fs jbtw">
  262. <el-date-picker
  263. size="mini"
  264. v-model="items.examTime"
  265. type="date"
  266. placeholder="选择日期"
  267. format="yyyy 年 MM 月 dd 日"
  268. value-format="timestamp"
  269. >
  270. </el-date-picker>
  271. <el-button
  272. size="mini"
  273. type="text"
  274. @click="items.examApplySiteTimeTwo.push({})"
  275. >添加时间点</el-button
  276. >
  277. </div>
  278. <ul>
  279. <li
  280. class="dis_fs"
  281. style="margin-bottom: 6px"
  282. v-for="(its, ids) in items.examApplySiteTimeTwo"
  283. :key="ids"
  284. >
  285. <div class="dis_fs">
  286. <el-time-picker
  287. style="width: 130px"
  288. size="mini"
  289. v-model="its.startTime"
  290. format="HH:mm"
  291. value-format="HH:mm"
  292. placeholder="开始时间"
  293. @change="
  294. its.endTime && its.startTime > its.endTime
  295. ? (its.startTime = '')
  296. : ''
  297. "
  298. >
  299. </el-time-picker
  300. ><span style="margin: 0px 10px">至</span>
  301. <el-time-picker
  302. style="width: 130px"
  303. size="mini"
  304. v-model="its.endTime"
  305. format="HH:mm"
  306. value-format="HH:mm"
  307. placeholder="结束时间"
  308. @change="
  309. its.startTime && its.endTime < its.startTime
  310. ? (its.endTime = '')
  311. : ''
  312. "
  313. >
  314. </el-time-picker>
  315. </div>
  316. <div style="margin-left: 14px">
  317. 人数上限:<el-input-number
  318. style="width: 60px"
  319. :precision="0"
  320. size="mini"
  321. :min="1"
  322. :max="item.people"
  323. v-model="its.num"
  324. :controls="false"
  325. ></el-input-number
  326. ><el-button
  327. style="margin-left: 6px"
  328. type="text"
  329. size="mini"
  330. @click="items.examApplySiteTimeTwo.splice(ids, 1)"
  331. >删除</el-button
  332. >
  333. </div>
  334. </li>
  335. </ul>
  336. </div>
  337. <div style="width: 10%; text-align: center; align-self: start">
  338. <el-button
  339. type="text"
  340. @click="item.examApplySiteTime.splice(indexs, 1)"
  341. >删除</el-button
  342. >
  343. </div>
  344. </div>
  345. </div>
  346. </div>
  347. <span slot="footer" class="dialog-footer">
  348. <el-button @click="dialogExamBoxs = false">取 消</el-button>
  349. <el-button
  350. type="primary"
  351. v-if="statusPop !== 2"
  352. :loading="disabledBtn"
  353. @click="submitPla('listData')"
  354. >确 定</el-button
  355. >
  356. </span>
  357. </el-dialog>
  358. <el-dialog
  359. @closed="loadingClose"
  360. :visible.sync="dialogExamPlace"
  361. width="860px"
  362. :show-close="false"
  363. :close-on-click-modal="false"
  364. >
  365. <div slot="title" class="hearders">
  366. <div class="leftTitle">考试地点列表</div>
  367. <div class="rightBoxs">
  368. <img
  369. src="@/assets/images/Close@2x.png"
  370. alt=""
  371. @click="dialogExamPlace = false"
  372. />
  373. </div>
  374. </div>
  375. <div>
  376. <el-table
  377. ref="multipleTable2"
  378. :data="boxtableData2"
  379. border
  380. @select-all="selectAll2"
  381. @select="select2"
  382. :row-key="getRowKeys2"
  383. :header-cell-style="{
  384. 'background-color': '#eee',
  385. padding: '8px',
  386. color: '#333',
  387. }"
  388. >
  389. <el-table-column
  390. align="center"
  391. type="selection"
  392. width="55"
  393. header-align="center"
  394. :selectable="checkboxT2"
  395. :reserve-selection="true"
  396. >
  397. </el-table-column>
  398. <template v-for="(item, index) in tableSetTSBBOX2">
  399. <el-table-column
  400. v-if="item.scope !== 'inputs'"
  401. :width="item.width"
  402. :key="index"
  403. :label="item.label"
  404. align="center"
  405. :show-overflow-tooltip="true"
  406. header-align="center"
  407. >
  408. <template slot-scope="scope">
  409. <span v-if="item.scope === 'status'">
  410. {{ scope.row[item.prop] === 1 ? "启用" : "关闭" }}
  411. </span>
  412. <span v-else>{{ scope.row[item.prop] }}</span></template
  413. >
  414. </el-table-column></template
  415. >
  416. </el-table>
  417. <pagination
  418. :total="total2"
  419. :pageSize="pageSize2"
  420. :currentPage="currentPage2"
  421. @handleSizeChange="handleSizeChange2"
  422. @handleCurrentChange="handleCurrentChange2"
  423. />
  424. </div>
  425. <span slot="footer" class="dialog-footer">
  426. <el-button @click="dialogExamPlace = false">取 消</el-button>
  427. <el-button
  428. type="primary"
  429. v-if="statusPop !== 2"
  430. @click="submitPlaces"
  431. :loading="disabledBtn"
  432. :disabled="!activeLists.length"
  433. >确 定</el-button
  434. >
  435. </span>
  436. </el-dialog>
  437. <el-dialog
  438. :visible.sync="dialoginfoWatch"
  439. width="900px"
  440. :show-close="false"
  441. :close-on-click-modal="false"
  442. >
  443. <div slot="title" class="hearders">
  444. <div class="leftTitle">【{{ infoData.applyName }}】预览</div>
  445. <div class="rightBoxs">
  446. <img
  447. src="@/assets/images/Close@2x.png"
  448. alt=""
  449. @click="dialoginfoWatch = false"
  450. />
  451. </div>
  452. </div>
  453. <div>
  454. <el-form :model="infoData" class="demo-form-inline" label-width="130px">
  455. <el-row :gutter="20">
  456. <el-col :span="12" style="border-right: 1px solid #999">
  457. <el-button type="info" style="margin-bottom: 20px" size="mini"
  458. >考试计划信息</el-button
  459. >
  460. <el-form-item label="考试封面:">
  461. <div class="imgBoxWatch">
  462. <img
  463. :src="$methodsTools.splitImgHost(infoData.applyUrl)"
  464. alt="加载失败"
  465. />
  466. </div>
  467. </el-form-item>
  468. <el-form-item label="考试标题:">
  469. <span>{{ infoData.applyName }}</span>
  470. </el-form-item>
  471. <el-form-item label="考试简介:">
  472. <span>{{ infoData.applyIntroduce }}</span>
  473. </el-form-item>
  474. <el-form-item label="报考学员:">
  475. <span v-for="(item, index) in infoData.applyStatus" :key="index"
  476. >{{ item === 1 ? "非补考学员" : item === 2 ? "补考学员" : ""
  477. }}{{
  478. index === infoData.applyStatus.length - 1 ? "" : "、"
  479. }}</span
  480. >
  481. </el-form-item>
  482. <el-form-item label="报名开放时间:">
  483. <span>{{
  484. $methodsTools.onlyForma(infoData.applyStartTime)
  485. }}</span>
  486. <span>{{
  487. $methodsTools.onlyForma(infoData.applyEndTime)
  488. }}</span>
  489. </el-form-item>
  490. <el-form-item label="考试地点和时间:">
  491. <div
  492. v-for="(item, index) in infoData.examApplySite"
  493. :key="index"
  494. >
  495. <span>{{ item.siteAddress }}({{ item.people }})</span>
  496. <div
  497. v-for="(items, indexs) in item.examApplySiteTime"
  498. :key="indexs"
  499. style="
  500. margin-bottom: 10px;
  501. background-color: #eee;
  502. padding: 0px 10px;
  503. "
  504. >
  505. <div
  506. v-for="(itemsxs, indexsx) in items.siteTime"
  507. :key="indexsx"
  508. >
  509. {{ $methodsTools.onlyForma(items.examTime, false) }}
  510. {{ itemsxs.startTime }}-{{
  511. itemsxs.endTime
  512. }}
  513. (人数上限:{{ itemsxs.num }})
  514. </div>
  515. </div>
  516. </div>
  517. </el-form-item>
  518. <el-form-item label="考培地点和时间:">
  519. <div
  520. v-for="(item, index) in infoData.examApplySiteTrain"
  521. :key="index"
  522. >
  523. <span>{{ item.siteAddress }}({{ item.people }})</span>
  524. <div
  525. v-for="(items, indexs) in item.examApplySiteTime"
  526. :key="indexs"
  527. style="
  528. margin-bottom: 10px;
  529. background-color: #eee;
  530. padding: 0px 10px;
  531. "
  532. >
  533. <div
  534. v-for="(itemsxs, indexsx) in items.siteTime"
  535. :key="indexsx"
  536. >
  537. {{ $methodsTools.onlyForma(items.examTime, false) }}
  538. {{ itemsxs.startTime }}-{{
  539. itemsxs.endTime
  540. }}
  541. (人数上限:{{ itemsxs.num }})
  542. </div>
  543. </div>
  544. </div>
  545. </el-form-item>
  546. </el-col>
  547. <el-col :span="12">
  548. <el-button type="info" style="margin-bottom: 20px" size="mini"
  549. >适用商品</el-button
  550. >
  551. <el-form-item label="商品类型:">
  552. <span v-for="(item, index) in $methodsTools.getGoodsType()" :key="index">{{
  553. item.value === infoData.goodsType ? item.label : ""
  554. }}</span>
  555. </el-form-item>
  556. <el-form-item label="业务层级:">
  557. <span
  558. >{{ infoData.educationName }}-{{ infoData.projectName }}-{{
  559. infoData.businessName
  560. }}</span
  561. >
  562. </el-form-item>
  563. <el-form-item label="适用商品:">
  564. <div
  565. v-for="(item, index) in infoData.examNumberGoods"
  566. :key="index"
  567. >
  568. {{ index + 1 }}.{{ item.code }}-{{ item.goodsName }}-<span
  569. style="color: #f56c6c"
  570. >¥{{ item.standPrice }}</span
  571. >
  572. </div>
  573. </el-form-item>
  574. </el-col>
  575. </el-row>
  576. </el-form>
  577. </div>
  578. <span slot="footer" class="dialog-footer">
  579. <el-button @click="dialoginfoWatch = false">取 消</el-button>
  580. </span>
  581. </el-dialog>
  582. <before-page ref="beforePage" />
  583. <applicable-products ref="applicableProducts" />
  584. </div>
  585. </template>
  586. <script>
  587. import searchBox from "@/components/searchBox";
  588. import tableList from "@/components/tableList";
  589. import pagination from "@/components/pagination";
  590. import applicableProducts from "./applicableProducts/index.vue";
  591. import beforePage from './applicableProducts/beforePage.vue';
  592. export default {
  593. name: "ExamArrangement",
  594. components: { searchBox, tableList, pagination, applicableProducts, beforePage },
  595. data() {
  596. return {
  597. disabledBtn: false,
  598. total2: 0,
  599. pageSize2: 10,
  600. currentPage2: 1,
  601. loading: false, //当前表单加载是否加载动画
  602. navText: {
  603. title: "考试安排",
  604. index: 0,
  605. ch: "条",
  606. num: true,
  607. changeWidth: "300px",
  608. choice: true,
  609. border: true,
  610. addHide: false,
  611. backFatherBtn: {
  612. status: false,
  613. title: "未定义",
  614. },
  615. },
  616. // 表单
  617. tableSet: [
  618. {
  619. label: "考试编码",
  620. prop: "code",
  621. hidden: true,
  622. },
  623. {
  624. label: "考试标题",
  625. prop: "applyName",
  626. hidden: true,
  627. },
  628. {
  629. label: "可报学员",
  630. prop: "applyStatus",
  631. hidden: true,
  632. scope: "morePeople",
  633. },
  634. {
  635. label: "报名开放时间",
  636. prop1: "applyStartTime",
  637. prop2: "applyEndTime",
  638. hidden: true,
  639. scope: "TimeLists",
  640. Diszing: false,
  641. },
  642. {
  643. label: "预约/取消(人次)",
  644. prop: "people",
  645. prop1: "cancelPeople",
  646. hidden: true,
  647. scope: "jumpPeolpe",
  648. type: 1,
  649. width: "140px",
  650. },
  651. ],
  652. tableData: [], //表单数据
  653. total: 0, //一共多少条
  654. pageSize: 10, //每页多少条数据
  655. currentPage: 1, //当前页码
  656. // 弹窗数据
  657. listData: {
  658. applyStatus: [],
  659. },
  660. statusPop: -1,
  661. dialogVisible: false,
  662. //表单验证
  663. rules: {
  664. applyUrl: [
  665. {
  666. required: true,
  667. message: "请上传考试封面",
  668. trigger: "change",
  669. },
  670. ],
  671. applyName: [
  672. { required: true, message: "请输入考试安排", trigger: "blur" },
  673. ],
  674. applyStatus: [
  675. {
  676. type: "array",
  677. required: true,
  678. message: "请至少选择一个可报学员",
  679. trigger: "change",
  680. },
  681. ],
  682. applyStartTime: [
  683. {
  684. type: "date",
  685. required: true,
  686. message: "请选择报名开始时间",
  687. trigger: "change",
  688. },
  689. ],
  690. applyEndTime: [
  691. {
  692. type: "date",
  693. required: true,
  694. message: "请选择报名结束时间",
  695. trigger: "change",
  696. },
  697. ],
  698. },
  699. dialogExamBoxs: false, //考点
  700. dialogExamPlace: false, //考试地点列表
  701. dialogVisiblenew: false,
  702. examPlaces: [],
  703. activeLists: [], //当前选中地点
  704. boxtableData2: [],
  705. newOpenId: "",
  706. intStatus: 0, //1考试地点2考培地点
  707. tableSetTSBBOX2: [
  708. {
  709. label: "考试地点编码",
  710. prop: "code",
  711. hidden: true,
  712. },
  713. {
  714. label: "考试地点",
  715. prop: "siteAddress",
  716. hidden: true,
  717. },
  718. {
  719. label: "同时间可容纳人数",
  720. prop: "people",
  721. hidden: true,
  722. },
  723. {
  724. label: "状态",
  725. prop: "status",
  726. hidden: true,
  727. scope: "status",
  728. },
  729. ],
  730. options: [
  731. {
  732. label: "视频",
  733. value: 1,
  734. },
  735. {
  736. label: "题库",
  737. value: 2,
  738. },
  739. {
  740. label: "补考",
  741. value: 3,
  742. },
  743. {
  744. label: "前培",
  745. value: 4,
  746. },
  747. ],
  748. dialoginfoWatch: false,
  749. infoData: {
  750. applyStatus: [],
  751. },
  752. };
  753. },
  754. mounted() {
  755. this.search();
  756. this.getExamPlace();
  757. },
  758. activated() {
  759. this.search();
  760. this.getExamPlace();
  761. },
  762. methods: {
  763. /**
  764. * 前培设置
  765. */
  766. beforeFunc(row){
  767. this.$refs.beforePage.openBox(row)
  768. },
  769. setExamAdress() {
  770. this.$router.push({
  771. path: "examPlace",
  772. });
  773. },
  774. loadingClose() {
  775. this.disabledBtn = false;
  776. },
  777. //修改适用商品
  778. editGoods(row) {
  779. this.$refs.applicableProducts.openBox(row);
  780. },
  781. submitPla() {
  782. var data = JSON.parse(JSON.stringify(this.examPlaces));
  783. if (!data.length) {
  784. if (this.intStatus === 1) {
  785. this.$message.warning("请添加考试地点");
  786. return;
  787. }
  788. if (this.intStatus === 2) {
  789. this.$message.warning("请添加考培地点");
  790. return;
  791. }
  792. }
  793. for (let i = 0; i < data.length; i++) {
  794. if (this.intStatus === 1) {
  795. data[i].status = 1;
  796. }
  797. if (this.intStatus === 2) {
  798. data[i].status = 2;
  799. }
  800. if (!data[i].examApplySiteTime.length) {
  801. if (this.intStatus === 1) {
  802. this.$message.warning("您还有考试日期没有设置考试时间点,请先设置");
  803. return;
  804. }
  805. if (this.intStatus === 2) {
  806. this.$message.warning("您还有考培日期没有设置考培时间点,请先设置");
  807. return;
  808. }
  809. } else {
  810. for (let j = 0; j < data[i].examApplySiteTime.length; j++) {
  811. if (!data[i].examApplySiteTime[j].examTime) {
  812. if (this.intStatus === 1) {
  813. this.$message.warning("您还有考试日期没有设置,请先设置");
  814. }
  815. if (this.intStatus === 2) {
  816. this.$message.warning("您还有考培日期没有设置,请先设置");
  817. }
  818. return;
  819. } else {
  820. data[i].examApplySiteTime[j].examTime =
  821. this.$methodsTools.time10to13(
  822. data[i].examApplySiteTime[j].examTime,
  823. 1
  824. );
  825. }
  826. if (!data[i].examApplySiteTime[j].examApplySiteTimeTwo.length) {
  827. if (this.intStatus === 1) {
  828. this.$message.warning("您还有考试时间点没有设置,请先设置");
  829. }
  830. if (this.intStatus === 2) {
  831. this.$message.warning("您还有考培时间点没有设置,请先设置");
  832. }
  833. return;
  834. } else {
  835. for (
  836. let k = 0;
  837. k < data[i].examApplySiteTime[j].examApplySiteTimeTwo.length;
  838. k++
  839. ) {
  840. if (
  841. !data[i].examApplySiteTime[j].examApplySiteTimeTwo[k]
  842. .startTime
  843. ) {
  844. this.$message.warning("您还有开始时间没有设置,请先设置");
  845. return;
  846. }
  847. if (
  848. !data[i].examApplySiteTime[j].examApplySiteTimeTwo[k].endTime
  849. ) {
  850. this.$message.warning("您还有结束时间没有设置,请先设置");
  851. return;
  852. }
  853. if (!data[i].examApplySiteTime[j].examApplySiteTimeTwo[k].num) {
  854. this.$message.warning("您还有人数上限没有设置,请先设置");
  855. return;
  856. }
  857. }
  858. const stsTime1 = data[i].examApplySiteTime[
  859. j
  860. ].examApplySiteTimeTwo.map(
  861. (val) => val.startTime + "-" + val.endTime
  862. );
  863. const idsSet1 = new Set(stsTime1);
  864. if (idsSet1.size == stsTime1.length) {
  865. } else {
  866. if (this.intStatus === 1) {
  867. this.$message.warning(
  868. "同一考试日期下的时间点,出现重复,请修改"
  869. );
  870. }
  871. if (this.intStatus === 2) {
  872. this.$message.warning(
  873. "同一考培日期下的时间点,出现重复,请修改"
  874. );
  875. }
  876. return;
  877. }
  878. }
  879. }
  880. const stsTime = data[i].examApplySiteTime.map((val) => val.examTime);
  881. const idsSet = new Set(stsTime);
  882. if (idsSet.size == stsTime.length) {
  883. } else {
  884. if (this.intStatus === 1) {
  885. this.$message.warning(
  886. "同一考试地点下的考试日期,出现重复,请修改"
  887. );
  888. }
  889. if (this.intStatus === 2) {
  890. this.$message.warning(
  891. "同一考培地点下的考培日期,出现重复,请修改"
  892. );
  893. }
  894. return;
  895. }
  896. }
  897. }
  898. this.disabledBtn = true;
  899. this.$api
  900. .systemapplyaddSite(data)
  901. .then((res) => {
  902. if (this.intStatus === 1) {
  903. this.$message.success("设置考试地点时间成功");
  904. }
  905. if (this.intStatus === 2) {
  906. this.$message.success("设置考培地点时间成功");
  907. }
  908. this.dialogExamBoxs = false;
  909. this.search();
  910. })
  911. .catch(() => {
  912. this.disabledBtn = false;
  913. });
  914. },
  915. //添加考点地点
  916. submitPlaces() {
  917. this.disabledBtn = true;
  918. let array = [];
  919. this.activeLists.forEach((item) => {
  920. array.push({
  921. applyId: this.newOpenId,
  922. siteId: item.siteId,
  923. siteAddress: item.siteAddress,
  924. people: item.people,
  925. examApplySiteTime: [{ examTime: "", examApplySiteTimeTwo: [{}] }],
  926. });
  927. });
  928. this.examPlaces = this.examPlaces.concat(array);
  929. this.dialogExamPlace = false;
  930. },
  931. getExamPlace() {
  932. var data = {
  933. status: 1,
  934. pageSize: this.pageSize2,
  935. pageNum: this.currentPage2,
  936. };
  937. this.$api.inquiresystemsite(data).then((res) => {
  938. this.boxtableData2 = res.rows;
  939. this.total2 = res.total;
  940. });
  941. },
  942. openExamPlace() {
  943. this.activeListExamPlace = [];
  944. this.examPlaces.forEach((item) => {
  945. this.activeListExamPlace.push(item.siteId);
  946. });
  947. this.dialogExamPlace = true;
  948. this.$nextTick(function () {
  949. this.activeLists = [];
  950. this.$refs.multipleTable2.clearSelection();
  951. });
  952. },
  953. //设置考点
  954. setExams(row, int) {
  955. this.intStatus = int;
  956. this.newOpenId = row.applyId;
  957. this.$api
  958. .inquirepayservesiteInfo({ addressStatus: int, applyId: row.applyId })
  959. .then((res) => {
  960. res.rows.forEach((item) => {
  961. item.examApplySiteTime.forEach((items) => {
  962. items.examTime = this.$methodsTools.time10to13(items.examTime, 2);
  963. items.examApplySiteTimeTwo = JSON.parse(items.siteTime);
  964. });
  965. });
  966. this.examPlaces = res.rows;
  967. this.dialogExamBoxs = true;
  968. });
  969. },
  970. // 判断选择时间逻辑
  971. changeEndTime(int) {
  972. if (this.listData.applyStartTime === this.listData.applyEndTime) {
  973. this.$message.warning("开始时间与结束时间不允许相同");
  974. if (int === 1) {
  975. this.listData.applyStartTime = "";
  976. }
  977. if (int === 2) {
  978. this.listData.applyEndTime = "";
  979. }
  980. return;
  981. }
  982. if (
  983. int === 1 &&
  984. this.listData.applyEndTime &&
  985. this.listData.applyStartTime > this.listData.applyEndTime
  986. ) {
  987. this.$message.warning(
  988. "当前选择的开始时间大于结束时间,请重新选择开始时间!"
  989. );
  990. this.listData.applyStartTime = "";
  991. return;
  992. }
  993. if (
  994. int === 2 &&
  995. this.listData.applyStartTime &&
  996. this.listData.applyEndTime < this.listData.applyStartTime
  997. ) {
  998. this.$message.warning(
  999. "当前选择的结束时间小于开始时间,请重新选择结束时间!"
  1000. );
  1001. this.listData.applyEndTime = "";
  1002. return;
  1003. }
  1004. },
  1005. editInfo(v) {
  1006. this.addClick(v, 0);
  1007. },
  1008. editImg(e) {
  1009. var file = e.target.files[0];
  1010. if (file === undefined) {
  1011. return;
  1012. }
  1013. if (file.size > 0.3 * 1024 * 1024) {
  1014. this.$message.warning("图片不得大于300kb");
  1015. return;
  1016. }
  1017. var type = this.$refs.file.value.toLowerCase().split(".").splice(-1);
  1018. if (
  1019. type[0] != "jpg" &&
  1020. type[0] != "png" &&
  1021. type[0] != "jpeg" &&
  1022. type[0] != "gif"
  1023. ) {
  1024. this.$message.warning("上传格式需为:.jpg/.png/.jpeg/gif");
  1025. this.$refs.file.value = "";
  1026. return;
  1027. }
  1028. this.$upload.upload(file, 0).then((res) => {
  1029. this.listData.applyUrl = res;
  1030. });
  1031. },
  1032. search(v) {
  1033. this.loading = true;
  1034. var data = {
  1035. status: "0,1,2",
  1036. pageSize: this.pageSize,
  1037. pageNum: this.currentPage,
  1038. };
  1039. this.$api
  1040. .inquiresystemapplyList(data)
  1041. .then((res) => {
  1042. this.tableData = res.rows;
  1043. this.total = res.total;
  1044. this.navText.index = res.total;
  1045. })
  1046. .finally(() => {
  1047. this.loading = false;
  1048. });
  1049. },
  1050. init() {
  1051. this.search();
  1052. },
  1053. watchs(v) {
  1054. this.$api.obtainsystemapply(v.applyId).then((res) => {
  1055. if (res.data.applyStatus) {
  1056. res.data.applyStatus = res.data.applyStatus.split(",").map(Number);
  1057. }
  1058. if (res.data.examApplySite.length) {
  1059. for (let i = 0; i < res.data.examApplySite.length; i++) {
  1060. for (
  1061. let j = 0;
  1062. j < res.data.examApplySite[i].examApplySiteTime.length;
  1063. j++
  1064. ) {
  1065. res.data.examApplySite[i].examApplySiteTime[j].siteTime =
  1066. JSON.parse(
  1067. res.data.examApplySite[i].examApplySiteTime[j].siteTime
  1068. );
  1069. }
  1070. }
  1071. }
  1072. if (res.data.examApplySiteTrain.length) {
  1073. for (let i = 0; i < res.data.examApplySiteTrain.length; i++) {
  1074. for (
  1075. let j = 0;
  1076. j < res.data.examApplySiteTrain[i].examApplySiteTime.length;
  1077. j++
  1078. ) {
  1079. res.data.examApplySiteTrain[i].examApplySiteTime[j].siteTime =
  1080. JSON.parse(
  1081. res.data.examApplySiteTrain[i].examApplySiteTime[j].siteTime
  1082. );
  1083. }
  1084. }
  1085. }
  1086. this.infoData = res.data;
  1087. this.dialoginfoWatch = true;
  1088. });
  1089. },
  1090. del(v, int) {
  1091. this.$alert(
  1092. `确定${
  1093. int === 1 ? "启用" : int === 2 ? "关闭" : int === 3 ? "删除" : "xxx"
  1094. }考试计划【${v.applyName}】?<br />${
  1095. int === 1
  1096. ? "启用后,学员端预约考试的入口同步开通,请慎重考虑!"
  1097. : int === 2
  1098. ? "关闭后,学员端预约考试的入口同步关闭,请慎重考虑!"
  1099. : int === 3
  1100. ? "内容删除后将无法恢复,请慎重考虑"
  1101. : "xxx"
  1102. }`,
  1103. "操作提示",
  1104. {
  1105. dangerouslyUseHTMLString: true,
  1106. }
  1107. )
  1108. .then(() => {
  1109. var data = {
  1110. applyId: v.applyId,
  1111. };
  1112. if (int === 1) {
  1113. data.status = 1;
  1114. }
  1115. if (int === 2) {
  1116. data.status = 0;
  1117. }
  1118. if (int === 3) {
  1119. data.status = -1;
  1120. }
  1121. this.$api.editsystemapply(data).then((res) => {
  1122. this.$message.success(
  1123. `${
  1124. int === 1
  1125. ? "启用"
  1126. : int === 2
  1127. ? "关闭"
  1128. : int === 3
  1129. ? "删除"
  1130. : "xxx"
  1131. }成功`
  1132. );
  1133. this.search();
  1134. this.listDataGoods.businessId = "";
  1135. this.$store.commit("EXAMLIST");
  1136. });
  1137. })
  1138. .catch(() => {
  1139. // this.$message({
  1140. // type: "info",
  1141. // message: "已取消删除",
  1142. // });
  1143. });
  1144. },
  1145. addClick(v, int) {
  1146. if (v === undefined) {
  1147. this.statusPop = 1;
  1148. this.listData = {
  1149. applyStatus: [],
  1150. applyUrl: "oss/images/avatar/20211013/1634097664410_1397766697",
  1151. };
  1152. this.$nextTick(() => {
  1153. this.$refs.listData.clearValidate();
  1154. });
  1155. this.dialogVisible = true;
  1156. } else {
  1157. this.statusPop = int;
  1158. this.$api.obtainsystemapply(v.applyId).then((res) => {
  1159. if (res.data.applyStatus) {
  1160. res.data.applyStatus = res.data.applyStatus.split(",").map(Number);
  1161. }else{
  1162. res.data.applyStatus = []
  1163. }
  1164. if (res.data.applyStartTime) {
  1165. res.data.applyStartTime = this.$methodsTools.time10to13(
  1166. res.data.applyStartTime,
  1167. 2
  1168. );
  1169. }
  1170. if (res.data.applyEndTime) {
  1171. res.data.applyEndTime = this.$methodsTools.time10to13(
  1172. res.data.applyEndTime,
  1173. 2
  1174. );
  1175. }
  1176. this.listData = res.data;
  1177. this.$nextTick(() => {
  1178. this.$refs.listData.clearValidate();
  1179. });
  1180. this.dialogVisible = true;
  1181. });
  1182. }
  1183. },
  1184. submit(formName) {
  1185. this.$refs[formName].validate((valid) => {
  1186. if (valid) {
  1187. this.rulesTableSumbit();
  1188. } else {
  1189. return false;
  1190. }
  1191. });
  1192. },
  1193. rulesTableSumbit() {
  1194. this.disabledBtn = true;
  1195. var data = JSON.parse(JSON.stringify(this.listData));
  1196. data.applyStatus = data.applyStatus.toString();
  1197. data.applyStartTime = this.$methodsTools.time10to13(
  1198. data.applyStartTime,
  1199. 1
  1200. );
  1201. data.applyEndTime = this.$methodsTools.time10to13(data.applyEndTime, 1);
  1202. if (this.statusPop === 1) {
  1203. data.status = 0;
  1204. this.$api
  1205. .appsystemapply(data)
  1206. .then((res) => {
  1207. this.$message.success("新增成功");
  1208. this.dialogVisible = false;
  1209. this.search();
  1210. this.$store.commit("EXAMLIST");
  1211. })
  1212. .catch(() => {
  1213. this.disabledBtn = false;
  1214. });
  1215. }
  1216. if (this.statusPop === 0) {
  1217. this.$api
  1218. .editsystemapply(data)
  1219. .then((res) => {
  1220. this.$message.success("修改成功");
  1221. this.dialogVisible = false;
  1222. this.search();
  1223. this.$store.commit("EXAMLIST");
  1224. })
  1225. .catch(() => {
  1226. this.disabledBtn = false;
  1227. });
  1228. }
  1229. },
  1230. close() {
  1231. this.dialogVisible = false;
  1232. },
  1233. handleSizeChange(v) {
  1234. this.pageSize = v;
  1235. this.currentPage = 1;
  1236. this.search();
  1237. },
  1238. handleCurrentChange(v) {
  1239. this.currentPage = v;
  1240. this.search();
  1241. },
  1242. handleSizeChange2(v) {
  1243. this.pageSize2 = v;
  1244. this.currentPage2 = 1;
  1245. this.getExamPlace();
  1246. },
  1247. handleCurrentChange2(v) {
  1248. this.currentPage2 = v;
  1249. this.getExamPlace();
  1250. },
  1251. selectAll2(value) {
  1252. this.activeLists = value;
  1253. },
  1254. select2(value) {
  1255. this.activeLists = value;
  1256. },
  1257. checkboxT2(row, index) {
  1258. if (this.activeListExamPlace.indexOf(row.siteId) !== -1) {
  1259. return false;
  1260. } else {
  1261. return true;
  1262. }
  1263. },
  1264. getRowKeys2(row) {
  1265. return row.siteId;
  1266. },
  1267. },
  1268. };
  1269. </script>
  1270. <style lang="less" scoped>
  1271. .imgBoxWatch {
  1272. width: 200px;
  1273. height: 110px;
  1274. border: 1px solid #eee;
  1275. img {
  1276. width: 100%;
  1277. height: 100%;
  1278. }
  1279. }
  1280. /deep/.el-button {
  1281. border-radius: 8px;
  1282. }
  1283. /deep/.el-dialog {
  1284. border-radius: 8px;
  1285. .el-dialog__header {
  1286. padding: 0;
  1287. .hearders {
  1288. height: 40px;
  1289. display: flex;
  1290. align-items: center;
  1291. justify-content: space-between;
  1292. padding: 0px 18px 0px 20px;
  1293. border-bottom: 1px solid #e2e2e2;
  1294. .leftTitle {
  1295. font-size: 14px;
  1296. font-weight: bold;
  1297. color: #2f4378;
  1298. }
  1299. .rightBoxs {
  1300. display: flex;
  1301. align-items: center;
  1302. img {
  1303. width: 14px;
  1304. height: 14px;
  1305. margin-left: 13px;
  1306. cursor: pointer;
  1307. }
  1308. }
  1309. }
  1310. }
  1311. .el-dialog__footer {
  1312. padding: 0;
  1313. .dialog-footer {
  1314. padding: 0px 40px;
  1315. height: 70px;
  1316. border-top: 1px solid #e2e2e2;
  1317. display: flex;
  1318. align-items: center;
  1319. justify-content: flex-end;
  1320. }
  1321. }
  1322. }
  1323. .imgBox {
  1324. width: 100%;
  1325. // height: 210px;
  1326. border: 1px solid #e2e2e2;
  1327. border-radius: 8px;
  1328. padding: 8px 8px 3px;
  1329. display: flex;
  1330. flex-direction: column;
  1331. align-items: center;
  1332. .imgLabel {
  1333. flex: 1;
  1334. width: 100%;
  1335. border: 1px dotted #e2e2e2;
  1336. color: #999;
  1337. font-size: 14px;
  1338. cursor: pointer;
  1339. border-radius: 8px;
  1340. .msPhoto {
  1341. display: flex;
  1342. justify-content: center;
  1343. align-items: center;
  1344. max-width: 100%;
  1345. max-height: 270px;
  1346. img {
  1347. max-width: 100%;
  1348. max-height: 270px;
  1349. }
  1350. }
  1351. .imgbbx {
  1352. display: flex;
  1353. flex-direction: column;
  1354. align-items: center;
  1355. justify-content: center;
  1356. width: 100%;
  1357. height: 100%;
  1358. i {
  1359. font-weight: bold;
  1360. margin: 14px 0;
  1361. font-size: 24px;
  1362. }
  1363. }
  1364. }
  1365. p {
  1366. margin: 5px 0px;
  1367. }
  1368. }
  1369. .dis_fs {
  1370. display: flex;
  1371. align-items: center;
  1372. .imgBoxs {
  1373. width: 200px;
  1374. height: 130px;
  1375. border: 1px solid #999;
  1376. margin-right: 6px;
  1377. }
  1378. .btns {
  1379. align-self: end;
  1380. border: 1px solid #999;
  1381. font-size: 12px;
  1382. height: 28px;
  1383. line-height: 28px;
  1384. padding: 0px 10px;
  1385. border-radius: 4px;
  1386. cursor: pointer;
  1387. }
  1388. }
  1389. .jbtw {
  1390. justify-content: space-between;
  1391. }
  1392. .bors {
  1393. border: 1px solid #999;
  1394. padding: 0px 8px;
  1395. height: 30px;
  1396. line-height: 30px;
  1397. border-radius: 4px;
  1398. }
  1399. .mar_bgc {
  1400. width: 90%;
  1401. padding: 12px;
  1402. margin-top: 12px;
  1403. background-color: #eee;
  1404. }
  1405. </style>