index.vue 51 KB

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