12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634 |
- <template>
- <div id="examArrangement">
- <table-list
- :tableSets="tableSet"
- :tableData="tableData"
- :navText="navText"
- @addClick="addClick"
- :loading="loading"
- @editInfo="editInfo"
- >
- <template slot="btn" slot-scope="props">
- <el-button
- type="text"
- @click="addClick(props.scope.row, 0)"
- :disabled="props.scope.row.status === 1"
- >修改计划</el-button
- >
- <el-button
- type="text"
- @click="setExams(props.scope.row, 1)"
- :disabled="props.scope.row.status === 1"
- >考点设置</el-button
- >
- <el-button
- type="text"
- @click="setExams(props.scope.row, 2)"
- :disabled="props.scope.row.status === 1"
- >考培设置</el-button
- >
- <el-button
- type="text"
- @click="editGoods(props.scope.row)"
- :disabled="props.scope.row.status === 1"
- >适用商品</el-button
- >
- <el-button type="text" @click="watchs(props.scope.row)">预览</el-button>
- <el-button
- type="text"
- @click="del(props.scope.row, 1)"
- v-if="props.scope.row.status === 0"
- >启用</el-button
- >
- <el-button
- type="text"
- @click="del(props.scope.row, 2)"
- v-if="props.scope.row.status === 1"
- >关闭</el-button
- >
- <el-button type="text" @click="del(props.scope.row, 3)">删除</el-button>
- </template>
- </table-list>
- <pagination
- :total="total"
- :pageSize="pageSize"
- :currentPage="currentPage"
- @handleSizeChange="handleSizeChange"
- @handleCurrentChange="handleCurrentChange"
- />
- <el-dialog
- @closed="loadingClose"
- :visible.sync="dialogVisible"
- width="610px"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">
- {{ statusPop === 1 ? "添加" : statusPop === 0 ? "修改" : "详情" }}
- </div>
- <div class="rightBoxs">
- <img src="@/assets/images/Close@2x.png" alt="" @click="close" />
- </div>
- </div>
- <div>
- <el-form
- label-position="right"
- label-width="150px"
- :model="listData"
- :rules="rules"
- ref="listData"
- >
- <el-form-item label="考试封面" prop="applyUrl">
- <div class="dis_fs">
- <img
- class="imgBoxs"
- :src="$methodsTools.splitImgHost(listData.applyUrl)"
- alt="加载失败"
- />
- <label class="btns"
- >修改封面
- <input
- ref="file"
- type="file"
- style="display: none"
- @change="editImg"
- />
- </label>
- </div>
- <div
- style="
- font-size: 12px;
- color: #999;
- line-height: 20px;
- margin-top: 10px;
- "
- >
- 注:请上传小于300kb,尺寸为1920*930的像素图片,支持gif、jpg、jpeg、png等类型
- </div>
- </el-form-item>
- <el-form-item label="考试标题" prop="applyName">
- <el-input
- :disabled="statusPop === 2"
- v-model="listData.applyName"
- ></el-input>
- </el-form-item>
- <el-form-item label="考试简介" prop="applyIntroduce">
- <el-input
- type="textarea"
- :rows="4"
- :disabled="statusPop === 2"
- v-model="listData.applyIntroduce"
- ></el-input>
- </el-form-item>
- <el-form-item label="可报学员" prop="applyStatus">
- <el-checkbox-group
- v-model="listData.applyStatus"
- style="width: 60%; display: inline-block"
- >
- <el-checkbox :label="1">非补考学员</el-checkbox>
- <el-checkbox :label="2">补考学员</el-checkbox>
- </el-checkbox-group>
- <span style="font-size: 12px; color: #999">注:可多选</span>
- </el-form-item>
- <el-form-item label="报名开放时间" required>
- <el-col :span="11">
- <el-form-item prop="applyStartTime">
- <el-date-picker
- type="datetime"
- placeholder="开始日期"
- @change="changeEndTime(1)"
- v-model="listData.applyStartTime"
- style="width: 100%"
- value-format="timestamp"
- ></el-date-picker>
- </el-form-item>
- </el-col>
- <el-col class="line" style="text-align: center" :span="2">-</el-col>
- <el-col :span="11">
- <el-form-item prop="applyEndTime">
- <el-date-picker
- type="datetime"
- placeholder="结束日期"
- @change="changeEndTime(2)"
- v-model="listData.applyEndTime"
- style="width: 100%"
- value-format="timestamp"
- ></el-date-picker>
- </el-form-item>
- </el-col>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="close">取 消</el-button>
- <el-button
- type="primary"
- :loading="disabledBtn"
- v-if="statusPop !== 2"
- @click="submit('listData')"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- @closed="loadingClose"
- :visible.sync="dialogExamBoxs"
- width="620px"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">
- {{
- intStatus === 1
- ? "设置考试地点"
- : intStatus === 2
- ? "设置考培地点"
- : "未知"
- }}
- </div>
- <div class="rightBoxs">
- <img
- src="@/assets/images/Close@2x.png"
- alt=""
- @click="dialogExamBoxs = false"
- />
- </div>
- </div>
- <div>
- <el-button type="text" @click="openExamPlace">{{
- intStatus === 1
- ? "添加考试地点"
- : intStatus === 2
- ? "添加考前培训地点"
- : "未知"
- }}</el-button>
- <div
- v-for="(item, index) in examPlaces"
- :key="index"
- style="margin-bottom: 10px"
- >
- <div class="dis_fs">
- <div class="bors">
- {{ item.siteAddress }}
- <i
- class="el-icon-error"
- style="
- color: #f56c6c;
- font-size: 14px;
- margin: 0px 6px;
- cursor: pointer;
- "
- @click="examPlaces.splice(index, 1)"
- ></i>
- </div>
- <el-button
- style="margin-left: 10px"
- type="text"
- size="mini"
- @click="
- item.examApplySiteTime.push({
- examTime: '',
- examApplySiteTimeTwo: [{}],
- })
- "
- >{{
- intStatus === 1
- ? "添加考试时间"
- : intStatus === 2
- ? "添加考培时间"
- : "未知"
- }}</el-button
- >
- </div>
- <div
- v-for="(items, indexs) in item.examApplySiteTime"
- :key="indexs"
- class="dis_fs"
- >
- <div class="mar_bgc">
- <div class="dis_fs jbtw">
- <el-date-picker
- size="mini"
- v-model="items.examTime"
- type="date"
- placeholder="选择日期"
- format="yyyy 年 MM 月 dd 日"
- value-format="timestamp"
- >
- </el-date-picker>
- <el-button
- size="mini"
- type="text"
- @click="items.examApplySiteTimeTwo.push({})"
- >添加时间点</el-button
- >
- </div>
- <ul>
- <li
- class="dis_fs"
- style="margin-bottom: 6px"
- v-for="(its, ids) in items.examApplySiteTimeTwo"
- :key="ids"
- >
- <div class="dis_fs">
- <el-time-picker
- style="width: 130px"
- size="mini"
- v-model="its.startTime"
- format="HH:mm"
- value-format="HH:mm"
- placeholder="开始时间"
- @change="
- its.endTime && its.startTime > its.endTime
- ? (its.startTime = '')
- : ''
- "
- >
- </el-time-picker
- ><span style="margin: 0px 10px">至</span>
- <el-time-picker
- style="width: 130px"
- size="mini"
- v-model="its.endTime"
- format="HH:mm"
- value-format="HH:mm"
- placeholder="结束时间"
- @change="
- its.startTime && its.endTime < its.startTime
- ? (its.endTime = '')
- : ''
- "
- >
- </el-time-picker>
- </div>
- <div style="margin-left: 14px">
- 人数上限:<el-input-number
- style="width: 60px"
- :precision="0"
- size="mini"
- :min="1"
- :max="item.people"
- v-model="its.num"
- :controls="false"
- ></el-input-number
- ><el-button
- style="margin-left: 6px"
- type="text"
- size="mini"
- @click="items.examApplySiteTimeTwo.splice(ids, 1)"
- >删除</el-button
- >
- </div>
- </li>
- </ul>
- </div>
- <div style="width: 10%; text-align: center; align-self: start">
- <el-button
- type="text"
- @click="item.examApplySiteTime.splice(indexs, 1)"
- >删除</el-button
- >
- </div>
- </div>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogExamBoxs = false">取 消</el-button>
- <el-button
- type="primary"
- v-if="statusPop !== 2"
- :loading="disabledBtn"
- @click="submitPla('listData')"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- @closed="loadingClose"
- :visible.sync="dialogExamPlace"
- width="860px"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">考试地点列表</div>
- <div class="rightBoxs">
- <img
- src="@/assets/images/Close@2x.png"
- alt=""
- @click="dialogExamPlace = false"
- />
- </div>
- </div>
- <div>
- <el-table
- ref="multipleTable2"
- :data="boxtableData2"
- border
- @select-all="selectAll2"
- @select="select2"
- :row-key="getRowKeys2"
- :header-cell-style="{
- 'background-color': '#eee',
- padding: '8px',
- color: '#333',
- }"
- >
- <el-table-column
- align="center"
- type="selection"
- width="55"
- header-align="center"
- :selectable="checkboxT2"
- :reserve-selection="true"
- >
- </el-table-column>
- <template v-for="(item, index) in tableSetTSBBOX2">
- <el-table-column
- v-if="item.scope !== 'inputs'"
- :width="item.width"
- :key="index"
- :label="item.label"
- align="center"
- :show-overflow-tooltip="true"
- header-align="center"
- >
- <template slot-scope="scope">
- <span v-if="item.scope === 'status'">
- {{ scope.row[item.prop] === 1 ? "启用" : "关闭" }}
- </span>
- <span v-else>{{ scope.row[item.prop] }}</span></template
- >
- </el-table-column></template
- >
- </el-table>
- <pagination
- :total="total2"
- :pageSize="pageSize2"
- :currentPage="currentPage2"
- @handleSizeChange="handleSizeChange2"
- @handleCurrentChange="handleCurrentChange2"
- />
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogExamPlace = false">取 消</el-button>
- <el-button
- type="primary"
- v-if="statusPop !== 2"
- @click="submitPlaces"
- :loading="disabledBtn"
- :disabled="!activeLists.length"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- :visible.sync="dialogVisiblenew"
- width="560px"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">适用商品</div>
- <div class="rightBoxs">
- <img
- src="@/assets/images/Close@2x.png"
- alt=""
- @click="dialogVisiblenew = false"
- />
- </div>
- </div>
- <div>
- <el-form
- label-position="right"
- label-width="150px"
- :model="listDataGoods"
- :rules="rulesnew"
- ref="listDataGoods"
- >
- <el-form-item label="商品类型" prop="goodsType">
- <el-select
- v-model="listDataGoods.goodsType"
- placeholder="请选择"
- disabled
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="业务层级" prop="educationTypeId">
- <el-select
- v-model="listDataGoods.educationTypeId"
- placeholder="选择教育类型"
- @change="listDataGoods.businessId = ''"
- :disabled="statusPop === 0"
- >
- <el-option
- v-for="item in educationType"
- :key="item.id"
- :label="item.educationName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- label=""
- prop="businessId"
- v-if="listDataGoods.educationTypeId"
- >
- <el-select
- v-model="listDataGoods.businessId"
- :disabled="statusPop === 0"
- placeholder="选择业务层次"
- >
- <el-option
- v-for="item in businessList"
- :key="item.id"
- :label="item.projectName + '-' + item.businessName"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="适用商品" prop="goodsId">
- <span v-if="!listDataGoods.businessId" style="color: #f56c6c"
- >请先选择业务层级</span
- >
- <el-checkbox-group
- style="overflow: auto; max-height: 500px"
- v-model="listDataGoods.goodsId"
- v-else-if="listDataGoods.businessId && goodsList.length"
- >
- <el-checkbox
- v-for="(item, index) in goodsList"
- :key="index"
- :label="item.goodsId"
- :disabled="
- item.goodsStatus === 0 &&
- bfListData.goodsId.indexOf(item.goodsId) === -1
- "
- >{{ item.code + "-" + item.goodsName + "-" }}
- <span
- :style="
- item.goodsStatus === 0 &&
- bfListData.goodsId.indexOf(item.goodsId) === -1
- ? ''
- : 'color:#F56C6C'
- "
- >¥{{ item.standPrice }}</span
- ></el-checkbox
- >
- </el-checkbox-group>
- <span style="color: #f56c6c" v-else>该业务层级下,无适用商品</span>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisiblenew = false">取 消</el-button>
- <el-button
- type="primary"
- v-if="statusPop !== 2"
- @click="submitnew('listDataGoods')"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- :visible.sync="dialoginfoWatch"
- width="900px"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">【{{ infoData.applyName }}】预览</div>
- <div class="rightBoxs">
- <img
- src="@/assets/images/Close@2x.png"
- alt=""
- @click="dialoginfoWatch = false"
- />
- </div>
- </div>
- <div>
- <el-form :model="infoData" class="demo-form-inline" label-width="130px">
- <el-row :gutter="20">
- <el-col :span="12" style="border-right: 1px solid #999">
- <el-button type="info" style="margin-bottom: 20px" size="mini"
- >考试计划信息</el-button
- >
- <el-form-item label="考试封面:">
- <div class="imgBoxWatch">
- <img
- :src="$methodsTools.splitImgHost(infoData.applyUrl)"
- alt="加载失败"
- />
- </div>
- </el-form-item>
- <el-form-item label="考试标题:">
- <span>{{ infoData.applyName }}</span>
- </el-form-item>
- <el-form-item label="考试简介:">
- <span>{{ infoData.applyIntroduce }}</span>
- </el-form-item>
- <el-form-item label="报考学员:">
- <span v-for="(item, index) in infoData.applyStatus" :key="index"
- >{{ item === 1 ? "非补考学员" : item === 2 ? "补考学员" : ""
- }}{{
- index === infoData.applyStatus.length - 1 ? "" : "、"
- }}</span
- >
- </el-form-item>
- <el-form-item label="报名开放时间:">
- <span>{{
- $methodsTools.onlyForma(infoData.applyStartTime)
- }}</span>
- 至
- <span>{{
- $methodsTools.onlyForma(infoData.applyEndTime)
- }}</span>
- </el-form-item>
- <el-form-item label="考试地点和时间:">
- <div
- v-for="(item, index) in infoData.examApplySite"
- :key="index"
- >
- <span>{{ item.siteAddress }}({{ item.people }})</span>
- <div
- v-for="(items, indexs) in item.examApplySiteTime"
- :key="indexs"
- style="
- margin-bottom: 10px;
- background-color: #eee;
- padding: 0px 10px;
- "
- >
- <div
- v-for="(itemsxs, indexsx) in items.siteTime"
- :key="indexsx"
- >
- {{ $methodsTools.onlyForma(items.examTime, false) }}
- {{ itemsxs.startTime }}-{{
- itemsxs.endTime
- }}
- (人数上限:{{ itemsxs.num }})
- </div>
- </div>
- </div>
- </el-form-item>
- <el-form-item label="考培地点和时间:">
- <div
- v-for="(item, index) in infoData.examApplySiteTrain"
- :key="index"
- >
- <span>{{ item.siteAddress }}({{ item.people }})</span>
- <div
- v-for="(items, indexs) in item.examApplySiteTime"
- :key="indexs"
- style="
- margin-bottom: 10px;
- background-color: #eee;
- padding: 0px 10px;
- "
- >
- <div
- v-for="(itemsxs, indexsx) in items.siteTime"
- :key="indexsx"
- >
- {{ $methodsTools.onlyForma(items.examTime, false) }}
- {{ itemsxs.startTime }}-{{
- itemsxs.endTime
- }}
- (人数上限:{{ itemsxs.num }})
- </div>
- </div>
- </div>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-button type="info" style="margin-bottom: 20px" size="mini"
- >适用商品</el-button
- >
- <el-form-item label="商品类型:">
- <span v-for="(item, index) in options" :key="index">{{
- item.value === infoData.goodsType ? item.label : ""
- }}</span>
- </el-form-item>
- <el-form-item label="业务层级:">
- <span
- >{{ infoData.educationName }}-{{ infoData.projectName }}-{{
- infoData.businessName
- }}</span
- >
- </el-form-item>
- <el-form-item label="适用商品:">
- <div
- v-for="(item, index) in infoData.examNumberGoods"
- :key="index"
- >
- {{ index + 1 }}.{{ item.code }}-{{ item.goodsName }}-<span
- style="color: #f56c6c"
- >¥{{ item.standPrice }}</span
- >
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialoginfoWatch = false">取 消</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import { mapGetters } from "vuex";
- import searchBox from "@/components/searchBox";
- import tableList from "@/components/tableList";
- import pagination from "@/components/pagination";
- export default {
- name: "ExamArrangement",
- components: { searchBox, tableList, pagination },
- data() {
- return {
- disabledBtn: false,
- total2: 0,
- pageSize2: 10,
- currentPage2: 1,
- loading: false, //当前表单加载是否加载动画
- navText: {
- title: "考试安排",
- index: 0,
- ch: "条",
- num: true,
- changeWidth: "300px",
- choice: true,
- border: true,
- addHide: false,
- backFatherBtn: {
- status: false,
- title: "未定义",
- },
- },
- // 表单
- tableSet: [
- {
- label: "考试编码",
- prop: "code",
- hidden: true,
- },
- {
- label: "考试标题",
- prop: "applyName",
- hidden: true,
- },
- {
- label: "可报学员",
- prop: "applyStatus",
- hidden: true,
- scope: "morePeople",
- },
- {
- label: "报名开放时间",
- prop1: "applyStartTime",
- prop2: "applyEndTime",
- hidden: true,
- scope: "TimeLists",
- Diszing: false,
- },
- {
- label: "使用状态",
- prop: "status",
- hidden: true,
- width: "120px",
- scope: "isOptions",
- options: [
- {
- label: "进行中",
- value: 1,
- },
- {
- label: "未启用",
- value: 0,
- },
- {
- label: "删除",
- value: -1,
- },
- {
- label: "已过期",
- value: 2,
- },
- ],
- },
- {
- label: "预约/取消(人次)",
- prop: "people",
- prop1: "cancelPeople",
- hidden: true,
- scope: "jumpPeolpe",
- type: 1,
- width: "140px",
- },
- ],
- tableData: [], //表单数据
- total: 0, //一共多少条
- pageSize: 10, //每页多少条数据
- currentPage: 1, //当前页码
- // 弹窗数据
- listData: {
- applyStatus: [],
- },
- statusPop: -1,
- dialogVisible: false,
- //表单验证
- rules: {
- applyUrl: [
- {
- required: true,
- message: "请上传考试封面",
- trigger: "change",
- },
- ],
- applyName: [
- { required: true, message: "请输入考试安排", trigger: "blur" },
- ],
- applyStatus: [
- {
- type: "array",
- required: true,
- message: "请至少选择一个可报学员",
- trigger: "change",
- },
- ],
- applyStartTime: [
- {
- type: "date",
- required: true,
- message: "请选择报名开始时间",
- trigger: "change",
- },
- ],
- applyEndTime: [
- {
- type: "date",
- required: true,
- message: "请选择报名结束时间",
- trigger: "change",
- },
- ],
- },
- dialogExamBoxs: false, //考点
- dialogExamPlace: false, //考试地点列表
- dialogVisiblenew: false,
- examPlaces: [],
- activeLists: [], //当前选中地点
- boxtableData2: [],
- newOpenId: "",
- intStatus: 0, //1考试地点2考培地点
- tableSetTSBBOX2: [
- {
- label: "考试地点编码",
- prop: "code",
- hidden: true,
- },
- {
- label: "考试地点",
- prop: "siteAddress",
- hidden: true,
- },
- {
- label: "同时间可容纳人数",
- prop: "people",
- hidden: true,
- },
- {
- label: "状态",
- prop: "status",
- hidden: true,
- scope: "status",
- },
- ],
- options: [
- {
- label: "视频",
- value: 1,
- },
- {
- label: "题库",
- value: 2,
- },
- {
- label: "补考",
- value: 3,
- },
- {
- label: "前培",
- value: 4,
- },
- ],
- //表单验证
- rulesnew: {
- goodsType: [
- { required: true, message: "请选择商品类型", trigger: "change" },
- ],
- educationTypeId: [
- { required: true, message: "请选择教育类型", trigger: "change" },
- ],
- businessId: [
- { required: true, message: "请选择业务层次", trigger: "change" },
- ],
- goodsId: [
- {
- type: "array",
- required: true,
- message: "请至少选择一个商品",
- trigger: "change",
- },
- ],
- },
- busList: [],
- businessList: [],
- goodsList: [],
- bfListData: {},
- listDataGoods: {},
- dialoginfoWatch: false,
- infoData: {
- applyStatus: [],
- },
- };
- },
- mounted() {
- this.getDict();
- this.search();
- this.getExamPlace();
- },
- activated() {
- this.getDict();
- this.search();
- this.getExamPlace();
- },
- watch: {
- "listDataGoods.educationTypeId"(value) {
- this.businessList = this.busList.filter((item) => {
- return item.educationId == value;
- });
- },
- "listDataGoods.businessId"(value) {
- if (value) {
- if (this.statusPop === 1) {
- this.listDataGoods.goodsId = [];
- }
- this.$api
- .inquirepayservelistGoods({ businessId: value, goodsType: 1 })
- .then((res) => {
- this.goodsList = res.rows;
- });
- }
- },
- },
- computed: { ...mapGetters(["educationType"]) },
- methods: {
- loadingClose() {
- this.disabledBtn = false;
- },
- //修改适用商品
- editGoods(row) {
- this.$api
- .inquirepayservegoodsInfo({ applyId: row.applyId })
- .then((res) => {
- this.$api
- .inquirepayservelistGoods({
- businessId: res.data.businessId,
- goodsType: 1,
- })
- .then((result) => {
- this.goodsList = result.rows;
- });
- if (res.data.goodsType && res.data.goodsId.length) {
- this.statusPop = 0;
- this.bfListData = JSON.parse(JSON.stringify(res.data));
- this.listDataGoods = JSON.parse(JSON.stringify(res.data));
- } else {
- this.statusPop = 1;
- this.bfListData = {
- goodsId: [],
- };
- this.listDataGoods = {
- applyId: row.applyId,
- goodsType: 1,
- businessId: "",
- goodsId: [],
- };
- }
- this.$nextTick(() => {
- this.$refs.listDataGoods.clearValidate();
- });
- this.dialogVisiblenew = true;
- });
- },
- //提交验证适用商品表单
- submitnew(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.rulesTableSumbitnew();
- } else {
- return false;
- }
- });
- },
- //验证通过
- rulesTableSumbitnew() {
- var data = JSON.parse(JSON.stringify(this.listDataGoods));
- this.busList.map((item) => {
- if (item.id === data.businessId) {
- data.projectId = item.projectId;
- }
- });
- this.$api.systemapplyaddGoods(data).then((res) => {
- this.$message.success("适用商品设置成功");
- this.dialogVisiblenew = false;
- this.search();
- });
- },
- //获取初始基础参数
- getDict() {
- this.$api.inquirebusinessList({ status: 1 }).then((res) => {
- this.busList = res.rows;
- });
- },
- submitPla() {
- var data = JSON.parse(JSON.stringify(this.examPlaces));
- if (!data.length) {
- if (this.intStatus === 1) {
- this.$message.warning("请添加考试地点");
- return;
- }
- if (this.intStatus === 2) {
- this.$message.warning("请添加考培地点");
- return;
- }
- }
- for (let i = 0; i < data.length; i++) {
- if (this.intStatus === 1) {
- data[i].status = 1;
- }
- if (this.intStatus === 2) {
- data[i].status = 2;
- }
- if (!data[i].examApplySiteTime.length) {
- if (this.intStatus === 1) {
- this.$message.warning("您还有考试日期没有设置考试时间点,请先设置");
- return;
- }
- if (this.intStatus === 2) {
- this.$message.warning("您还有考培日期没有设置考培时间点,请先设置");
- return;
- }
- } else {
- for (let j = 0; j < data[i].examApplySiteTime.length; j++) {
- if (!data[i].examApplySiteTime[j].examTime) {
- if (this.intStatus === 1) {
- this.$message.warning("您还有考试日期没有设置,请先设置");
- }
- if (this.intStatus === 2) {
- this.$message.warning("您还有考培日期没有设置,请先设置");
- }
- return;
- } else {
- data[i].examApplySiteTime[j].examTime =
- this.$methodsTools.time10to13(
- data[i].examApplySiteTime[j].examTime,
- 1
- );
- }
- if (!data[i].examApplySiteTime[j].examApplySiteTimeTwo.length) {
- if (this.intStatus === 1) {
- this.$message.warning("您还有考试时间点没有设置,请先设置");
- }
- if (this.intStatus === 2) {
- this.$message.warning("您还有考培时间点没有设置,请先设置");
- }
- return;
- } else {
- for (
- let k = 0;
- k < data[i].examApplySiteTime[j].examApplySiteTimeTwo.length;
- k++
- ) {
- if (
- !data[i].examApplySiteTime[j].examApplySiteTimeTwo[k]
- .startTime
- ) {
- this.$message.warning("您还有开始时间没有设置,请先设置");
- return;
- }
- if (
- !data[i].examApplySiteTime[j].examApplySiteTimeTwo[k].endTime
- ) {
- this.$message.warning("您还有结束时间没有设置,请先设置");
- return;
- }
- if (!data[i].examApplySiteTime[j].examApplySiteTimeTwo[k].num) {
- this.$message.warning("您还有人数上限没有设置,请先设置");
- return;
- }
- }
- const stsTime1 = data[i].examApplySiteTime[
- j
- ].examApplySiteTimeTwo.map(
- (val) => val.startTime + "-" + val.endTime
- );
- const idsSet1 = new Set(stsTime1);
- if (idsSet1.size == stsTime1.length) {
- } else {
- if (this.intStatus === 1) {
- this.$message.warning(
- "同一考试日期下的时间点,出现重复,请修改"
- );
- }
- if (this.intStatus === 2) {
- this.$message.warning(
- "同一考培日期下的时间点,出现重复,请修改"
- );
- }
- return;
- }
- }
- }
- const stsTime = data[i].examApplySiteTime.map((val) => val.examTime);
- const idsSet = new Set(stsTime);
- if (idsSet.size == stsTime.length) {
- } else {
- if (this.intStatus === 1) {
- this.$message.warning(
- "同一考试地点下的考试日期,出现重复,请修改"
- );
- }
- if (this.intStatus === 2) {
- this.$message.warning(
- "同一考培地点下的考培日期,出现重复,请修改"
- );
- }
- return;
- }
- }
- }
- this.disabledBtn = true;
- this.$api
- .systemapplyaddSite(data)
- .then((res) => {
- if (this.intStatus === 1) {
- this.$message.success("设置考试地点时间成功");
- }
- if (this.intStatus === 2) {
- this.$message.success("设置考培地点时间成功");
- }
- this.dialogExamBoxs = false;
- this.search();
- })
- .catch(() => {
- this.disabledBtn = false;
- });
- },
- //添加考点地点
- submitPlaces() {
- this.disabledBtn = true;
- let array = [];
- this.activeLists.forEach((item) => {
- array.push({
- applyId: this.newOpenId,
- siteId: item.siteId,
- siteAddress: item.siteAddress,
- people: item.people,
- examApplySiteTime: [{ examTime: "", examApplySiteTimeTwo: [{}] }],
- });
- });
- this.examPlaces = this.examPlaces.concat(array);
- this.dialogExamPlace = false;
- },
- getExamPlace() {
- var data = {
- status: 1,
- pageSize: this.pageSize2,
- pageNum: this.currentPage2,
- };
- this.$api.inquiresystemsite(data).then((res) => {
- this.boxtableData2 = res.rows;
- this.total2 = res.total;
- });
- },
- openExamPlace() {
- this.activeListExamPlace = [];
- this.examPlaces.forEach((item) => {
- this.activeListExamPlace.push(item.siteId);
- });
- this.dialogExamPlace = true;
- this.$nextTick(function () {
- this.activeLists = [];
- this.$refs.multipleTable2.clearSelection();
- });
- },
- //设置考点
- setExams(row, int) {
- this.intStatus = int;
- this.newOpenId = row.applyId;
- this.$api
- .inquirepayservesiteInfo({ addressStatus: int, applyId: row.applyId })
- .then((res) => {
- res.rows.forEach((item) => {
- item.examApplySiteTime.forEach((items) => {
- items.examTime = this.$methodsTools.time10to13(items.examTime, 2);
- items.examApplySiteTimeTwo = JSON.parse(items.siteTime);
- });
- });
- this.examPlaces = res.rows;
- this.dialogExamBoxs = true;
- });
- },
- // 判断选择时间逻辑
- changeEndTime(int) {
- if (this.listData.applyStartTime === this.listData.applyEndTime) {
- this.$message.warning("开始时间与结束时间不允许相同");
- if (int === 1) {
- this.listData.applyStartTime = "";
- }
- if (int === 2) {
- this.listData.applyEndTime = "";
- }
- return;
- }
- if (
- int === 1 &&
- this.listData.applyEndTime &&
- this.listData.applyStartTime > this.listData.applyEndTime
- ) {
- this.$message.warning(
- "当前选择的开始时间大于结束时间,请重新选择开始时间!"
- );
- this.listData.applyStartTime = "";
- return;
- }
- if (
- int === 2 &&
- this.listData.applyStartTime &&
- this.listData.applyEndTime < this.listData.applyStartTime
- ) {
- this.$message.warning(
- "当前选择的结束时间小于开始时间,请重新选择结束时间!"
- );
- this.listData.applyEndTime = "";
- return;
- }
- },
- editInfo(v) {
- this.addClick(v, 0);
- },
- editImg(e) {
- var file = e.target.files[0];
- if (file === undefined) {
- return;
- }
- if (file.size > 0.3 * 1024 * 1024) {
- this.$message.warning("图片不得大于300kb");
- return;
- }
- var type = this.$refs.file.value.toLowerCase().split(".").splice(-1);
- if (
- type[0] != "jpg" &&
- type[0] != "png" &&
- type[0] != "jpeg" &&
- type[0] != "gif"
- ) {
- this.$message.warning("上传格式需为:.jpg/.png/.jpeg/gif");
- this.$refs.file.value = "";
- return;
- }
- this.$upload.upload(file, 0).then((res) => {
- this.listData.applyUrl = res;
- });
- },
- search(v) {
- this.loading = true;
- var data = {
- status: "0,1,2",
- pageSize: this.pageSize,
- pageNum: this.currentPage,
- };
- this.$api
- .inquiresystemapplyList(data)
- .then((res) => {
- this.tableData = res.rows;
- this.total = res.total;
- this.navText.index = res.total;
- })
- .finally(() => {
- this.loading = false;
- });
- },
- init() {
- this.search();
- },
- watchs(v) {
- this.$api.obtainsystemapply(v.applyId).then((res) => {
- if (res.data.applyStatus) {
- res.data.applyStatus = res.data.applyStatus.split(",").map(Number);
- }
- if (res.data.examApplySite.length) {
- for (let i = 0; i < res.data.examApplySite.length; i++) {
- for (
- let j = 0;
- j < res.data.examApplySite[i].examApplySiteTime.length;
- j++
- ) {
- res.data.examApplySite[i].examApplySiteTime[j].siteTime =
- JSON.parse(
- res.data.examApplySite[i].examApplySiteTime[j].siteTime
- );
- }
- }
- }
- if (res.data.examApplySiteTrain.length) {
- for (let i = 0; i < res.data.examApplySiteTrain.length; i++) {
- for (
- let j = 0;
- j < res.data.examApplySiteTrain[i].examApplySiteTime.length;
- j++
- ) {
- res.data.examApplySiteTrain[i].examApplySiteTime[j].siteTime =
- JSON.parse(
- res.data.examApplySiteTrain[i].examApplySiteTime[j].siteTime
- );
- }
- }
- }
- this.infoData = res.data;
- this.dialoginfoWatch = true;
- });
- },
- del(v, int) {
- this.$alert(
- `确定${
- int === 1 ? "启用" : int === 2 ? "关闭" : int === 3 ? "删除" : "xxx"
- }考试计划【${v.applyName}】?<br />${
- int === 1
- ? "启用后,学员端预约考试的入口同步开通,请慎重考虑!"
- : int === 2
- ? "关闭后,学员端预约考试的入口同步关闭,请慎重考虑!"
- : int === 3
- ? "内容删除后将无法恢复,请慎重考虑"
- : "xxx"
- }`,
- "操作提示",
- {
- dangerouslyUseHTMLString: true,
- }
- )
- .then(() => {
- var data = {
- applyId: v.applyId,
- };
- if (int === 1) {
- data.status = 1;
- }
- if (int === 2) {
- data.status = 0;
- }
- if (int === 3) {
- data.status = -1;
- }
- this.$api.editsystemapply(data).then((res) => {
- this.$message.success(
- `${
- int === 1
- ? "启用"
- : int === 2
- ? "关闭"
- : int === 3
- ? "删除"
- : "xxx"
- }成功`
- );
- this.search();
- this.listDataGoods.businessId = "";
- this.$store.commit("EXAMLIST");
- });
- })
- .catch(() => {
- // this.$message({
- // type: "info",
- // message: "已取消删除",
- // });
- });
- },
- addClick(v, int) {
- if (v === undefined) {
- this.statusPop = 1;
- this.listData = {
- applyStatus: [],
- applyUrl: "oss/images/avatar/20211013/1634097664410_1397766697",
- };
- this.$nextTick(() => {
- this.$refs.listData.clearValidate();
- });
- this.dialogVisible = true;
- } else {
- this.statusPop = int;
- this.$api.obtainsystemapply(v.applyId).then((res) => {
- if (res.data.applyStatus) {
- res.data.applyStatus = res.data.applyStatus.split(",").map(Number);
- }
- if (res.data.applyStartTime) {
- res.data.applyStartTime = this.$methodsTools.time10to13(
- res.data.applyStartTime,
- 2
- );
- }
- if (res.data.applyEndTime) {
- res.data.applyEndTime = this.$methodsTools.time10to13(
- res.data.applyEndTime,
- 2
- );
- }
- this.listData = res.data;
- this.$nextTick(() => {
- this.$refs.listData.clearValidate();
- });
- this.dialogVisible = true;
- });
- }
- },
- submit(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.rulesTableSumbit();
- } else {
- return false;
- }
- });
- },
- rulesTableSumbit() {
- this.disabledBtn = true;
- var data = JSON.parse(JSON.stringify(this.listData));
- data.applyStatus = data.applyStatus.toString();
- data.applyStartTime = this.$methodsTools.time10to13(
- data.applyStartTime,
- 1
- );
- data.applyEndTime = this.$methodsTools.time10to13(data.applyEndTime, 1);
- if (this.statusPop === 1) {
- data.status = 0;
- this.$api
- .appsystemapply(data)
- .then((res) => {
- this.$message.success("新增成功");
- this.dialogVisible = false;
- this.search();
- this.$store.commit("EXAMLIST");
- })
- .catch(() => {
- this.disabledBtn = false;
- });
- }
- if (this.statusPop === 0) {
- this.$api
- .editsystemapply(data)
- .then((res) => {
- this.$message.success("修改成功");
- this.dialogVisible = false;
- this.search();
- this.$store.commit("EXAMLIST");
- })
- .catch(() => {
- this.disabledBtn = false;
- });
- }
- },
- close() {
- this.dialogVisible = false;
- },
- handleSizeChange(v) {
- this.pageSize = v;
- this.currentPage = 1;
- this.search();
- },
- handleCurrentChange(v) {
- this.currentPage = v;
- this.search();
- },
- handleSizeChange2(v) {
- this.pageSize2 = v;
- this.currentPage2 = 1;
- this.getExamPlace();
- },
- handleCurrentChange2(v) {
- this.currentPage2 = v;
- this.getExamPlace();
- },
- selectAll2(value) {
- this.activeLists = value;
- },
- select2(value) {
- this.activeLists = value;
- },
- checkboxT2(row, index) {
- if (this.activeListExamPlace.indexOf(row.siteId) !== -1) {
- return false;
- } else {
- return true;
- }
- },
- getRowKeys2(row) {
- return row.siteId;
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .imgBoxWatch {
- width: 200px;
- height: 110px;
- border: 1px solid #eee;
- img {
- width: 100%;
- height: 100%;
- }
- }
- /deep/.el-button {
- border-radius: 8px;
- }
- /deep/.el-dialog {
- border-radius: 8px;
- .el-dialog__header {
- padding: 0;
- .hearders {
- height: 40px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0px 18px 0px 20px;
- border-bottom: 1px solid #e2e2e2;
- .leftTitle {
- font-size: 14px;
- font-weight: bold;
- color: #2f4378;
- }
- .rightBoxs {
- display: flex;
- align-items: center;
- img {
- width: 14px;
- height: 14px;
- margin-left: 13px;
- cursor: pointer;
- }
- }
- }
- }
- .el-dialog__footer {
- padding: 0;
- .dialog-footer {
- padding: 0px 40px;
- height: 70px;
- border-top: 1px solid #e2e2e2;
- display: flex;
- align-items: center;
- justify-content: flex-end;
- }
- }
- }
- .imgBox {
- width: 100%;
- // height: 210px;
- border: 1px solid #e2e2e2;
- border-radius: 8px;
- padding: 8px 8px 3px;
- display: flex;
- flex-direction: column;
- align-items: center;
- .imgLabel {
- flex: 1;
- width: 100%;
- border: 1px dotted #e2e2e2;
- color: #999;
- font-size: 14px;
- cursor: pointer;
- border-radius: 8px;
- .msPhoto {
- display: flex;
- justify-content: center;
- align-items: center;
- max-width: 100%;
- max-height: 270px;
- img {
- max-width: 100%;
- max-height: 270px;
- }
- }
- .imgbbx {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- width: 100%;
- height: 100%;
- i {
- font-weight: bold;
- margin: 14px 0;
- font-size: 24px;
- }
- }
- }
- p {
- margin: 5px 0px;
- }
- }
- .dis_fs {
- display: flex;
- align-items: center;
- .imgBoxs {
- width: 200px;
- height: 130px;
- border: 1px solid #999;
- margin-right: 6px;
- }
- .btns {
- align-self: end;
- border: 1px solid #999;
- font-size: 12px;
- height: 28px;
- line-height: 28px;
- padding: 0px 10px;
- border-radius: 4px;
- cursor: pointer;
- }
- }
- .jbtw {
- justify-content: space-between;
- }
- .bors {
- border: 1px solid #999;
- padding: 0px 8px;
- height: 30px;
- line-height: 30px;
- border-radius: 4px;
- }
- .mar_bgc {
- width: 90%;
- padding: 12px;
- margin-top: 12px;
- background-color: #eee;
- }
- </style>
|