123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410 |
- <template>
- <div id="examArrangement">
- <table-list
- :tableSets="tableSet"
- :tableData="tableData"
- :navText="navText"
- @addClick="addClick"
- :loading="loading"
- @editInfo="editInfo"
- >
- <template slot="customize">
- <el-button size="medium" type="warning" @click="setExamAdress"
- >配置考试地点</el-button
- >
- </template>
- <template slot="btn" slot-scope="props">
- <el-button
- type="text"
- @click="beforeFunc(props.scope.row)"
- >前培设置</el-button
- >
- <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="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 $methodsTools.getGoodsType()" :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>
- <before-page ref="beforePage" />
- <applicable-products ref="applicableProducts" />
- </div>
- </template>
- <script>
- import searchBox from "@/components/searchBox";
- import tableList from "@/components/tableList";
- import pagination from "@/components/pagination";
- import applicableProducts from "./applicableProducts/index.vue";
- import beforePage from './applicableProducts/beforePage.vue';
- export default {
- name: "ExamArrangement",
- components: { searchBox, tableList, pagination, applicableProducts, beforePage },
- 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: "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,
- },
- ],
- dialoginfoWatch: false,
- infoData: {
- applyStatus: [],
- },
- };
- },
- mounted() {
- this.search();
- this.getExamPlace();
- },
- activated() {
- this.search();
- this.getExamPlace();
- },
- methods: {
- /**
- * 前培设置
- */
- beforeFunc(row){
- this.$refs.beforePage.openBox(row)
- },
- setExamAdress() {
- this.$router.push({
- path: "examPlace",
- });
- },
- loadingClose() {
- this.disabledBtn = false;
- },
- //修改适用商品
- editGoods(row) {
- this.$refs.applicableProducts.openBox(row);
- },
- 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);
- }else{
- res.data.applyStatus = []
- }
- 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>
|