1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609 |
- <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
- :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"
- v-if="statusPop !== 2"
- @click="submit('listData')"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- :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"
- @click="submitPla('listData')"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- :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"
- :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 {
- 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,
- width: "140px",
- },
- {
- label: "考试标题",
- prop: "applyName",
- hidden: true,
- width: "120px",
- },
- {
- label: "可报学员",
- prop: "applyStatus",
- hidden: true,
- width: "160px",
- scope: "morePeople",
- },
- {
- label: "报名开放时间",
- prop1: "applyStartTime",
- prop2: "applyEndTime",
- hidden: true,
- scope: "TimeLists",
- Diszing: false,
- width: "220px",
- },
- {
- label: "使用状态",
- prop: "status",
- hidden: true,
- 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 })
- .then((res) => {
- console.log(1121, res.rows);
- this.goodsList = res.rows;
- });
- }
- },
- },
- computed: { ...mapGetters(["educationType"]) },
- methods: {
- //修改适用商品
- editGoods(row) {
- this.$api
- .inquirepayservegoodsInfo({ applyId: row.applyId })
- .then((res) => {
- this.$api
- .inquirepayservelistGoods({ businessId: res.data.businessId })
- .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.$api.systemapplyaddSite(data).then((res) => {
- if (this.intStatus === 1) {
- this.$message.success("设置考试地点时间成功");
- }
- if (this.intStatus === 2) {
- this.$message.success("设置考培地点时间成功");
- }
- this.dialogExamBoxs = false;
- this.search();
- });
- },
- //添加考点地点
- submitPlaces() {
- 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) {
- console.log(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
- );
- }
- }
- }
- console.log(res.data);
- 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() {
- 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");
- });
- }
- if (this.statusPop === 0) {
- this.$api.editsystemapply(data).then((res) => {
- this.$message.success("修改成功");
- this.dialogVisible = false;
- this.search();
- this.$store.commit("EXAMLIST");
- });
- }
- },
- 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>
|