12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226 |
- <template>
- <div id="byTrainee">
- <div class="dis_fs">
- <div class="dis_left">
- <div class="dis_fs">
- <input type="text" class="inputSty" v-model="formData.searchKey" />
- <div class="btnSearchSty" @click="getStudent">查询</div>
- <div class="btnSearchSty" @click="getStudent(1)">重置</div>
- </div>
- <ul>
- <li
- class="listy"
- :class="active === item.userId ? 'active' : ''"
- v-for="(item, index) in studentList"
- :key="index"
- @click="changeNewActive(item)"
- >
- {{ item.realname }} {{ item.idCard }}
- </li>
- </ul>
- <el-pagination
- style="text-align: center"
- small
- layout="prev, pager, next"
- :total="total"
- :current-page.sync="formData.pageNum"
- @current-change="handleCurrentChange"
- >
- </el-pagination>
- </div>
- <div class="dis_right" v-if="active">
- <el-table
- ref="multipleTable"
- :data="tableData"
- border
- :header-cell-style="{
- 'background-color': '#eee',
- padding: '8px',
- color: '#333',
- }"
- @expand-change="expandChange"
- >
- <!-- 插槽 -->
- <el-table-column type="expand">
- <template slot-scope="props">
- <el-table
- ref="multipleTable"
- :data="props.row.children"
- border
- :header-cell-style="{
- 'background-color': '#eee',
- padding: '8px',
- color: '#333',
- }"
- >
- <el-table-column
- v-for="(item, index) in tableSet"
- :width="item.width"
- :key="index"
- :label="item.label"
- align="center"
- :show-overflow-tooltip="true"
- header-align="center"
- >
- <template slot-scope="scope">
- <div v-if="item.scope === 'isOptions'">
- <template v-for="(itemt, indext) in item.options">
- <span
- :key="indext"
- v-if="itemt.value === scope.row[item.prop]"
- >{{ itemt.label }}</span
- >
- </template>
- </div>
- <div v-else-if="item.scope === 'resultType'">
- {{ scope.row[item.prop1] }}
- <span
- :style="
- scope.row[item.prop2] === 1
- ? 'color:purple'
- : scope.row[item.prop2] === 0
- ? 'color:red;'
- : ''
- "
- >
- {{
- scope.row[item.prop2] === 1
- ? "通过"
- : scope.row[item.prop2] === 0
- ? "不通过"
- : ""
- }}
- </span>
- </div>
- <div v-else-if="item.scope === 'goodsInfos'">
- {{
- scope.row[item.prop1] +
- "-" +
- scope.row[item.prop2] +
- "-"
- }}<span style="color: red"
- >¥{{ scope.row[item.prop3] }}</span
- >
- </div>
- <div v-else-if="item.scope === 'applyInfos'">
- <div>{{ scope.row[item.prop] }}</div>
- {{
- $methodsTools.onlyForma(scope.row[item.prop1], false)
- }}
- {{
- scope.row[item.prop2]
- ? scope.row[item.prop2].replace("-", ":")
- : ""
- }}-{{
- scope.row[item.prop3]
- ? scope.row[item.prop3].replace("-", ":")
- : ""
- }}
- </div>
- <span v-else-if="item.scope === 'aTimeList'">{{
- scope.row[item.prop] === null
- ? "--"
- : $methodsTools.onlyForma(scope.row[item.prop])
- }}</span>
- <div v-else>{{ scope.row[item.prop] }}</div>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- fixed="right"
- width="180px"
- v-if="false"
- >
- <template slot-scope="scope">
- <el-button
- type="text"
- :disabled="
- scope.row.subscribeStatus === 2 ||
- scope.row.examStatus !== 0
- "
- @click="openClearYX(scope.row)"
- >取消预约</el-button
- ><el-button
- type="text"
- :disabled="scope.row.subscribeStatus === 2"
- @click="editExam(scope.row)"
- >考试登记</el-button
- ><el-button
- type="text"
- :disabled="scope.row.subscribeStatus === 2"
- @click="openZS(scope.row)"
- >成绩和证书登记</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </template></el-table-column
- >
- <!-- 插槽 -->
- <template v-for="(item, index) in tableList">
- <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">
- <div v-if="item.scope === 'goodsName'">
- {{ scope.row[item.prop1] }}-{{ scope.row[item.prop2] }}-
- <span style="color: red">¥{{ scope.row[item.prop3] }}</span>
- </div>
- <div v-else-if="item.scope === 'numTypes'">
- 总:{{ scope.row[item.prop1] }} 消耗:{{
- scope.row[item.prop2]
- }}
- 剩余:{{ scope.row[item.prop1] - scope.row[item.prop2] }}
- <el-button type="text" @click="seeInfos(scope.row, item.type)"
- >查看</el-button
- >
- </div></template
- >
- </el-table-column></template
- >
- </el-table>
- <pagination
- :total="totalRight"
- :pageSize="tabSearchData.pageSize"
- :currentPage="tabSearchData.pageNum"
- @handleSizeChange="handleSizeChange"
- @handleCurrentChange="handleCurrentChanges"
- />
- </div>
- <p v-else style="text-align: center; width: 100%">请选择学员</p>
- </div>
- <el-dialog
- :visible.sync="dialogCG"
- 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="dialogCG = false"
- />
- </div>
- </div>
- <div>
- <div class="aListBottom">{{ listData.realname }}</div>
- <el-form
- :model="listData"
- label-width="120px"
- class="demo-ruleForm"
- :rules="rules"
- ref="listData"
- >
- <el-form-item label="考试登记状态" prop="examStatus">
- <el-radio-group v-model="listData.examStatus">
- <el-radio :label="1">正常</el-radio>
- <el-radio :label="2">缺考</el-radio>
- <el-radio :label="3">作弊</el-radio>
- <el-radio :label="4">替考</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="考试登记补充" prop="remark">
- <el-input
- v-model="listData.remark"
- type="textarea"
- :rows="4"
- ></el-input>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogCG = false">取消</el-button>
- <el-button
- :disabled="
- listData.performance != null || listData.performance != undefined
- "
- type="primary"
- @click="submitChecks('listData')"
- >确定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- :visible.sync="dialogDJ"
- width="420px"
- :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="dialogDJ = false"
- />
- </div>
- </div>
- <div>
- <div class="aListBottom">{{ listData.realname }}</div>
- <p style="margin: 0px">您确定要取消所选学员的考试预约吗?</p>
- <p style="margin: 0px">取消后将无法恢复,请慎重考虑!</p>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogDJ = false">取消</el-button>
- <el-button type="primary" @click="submitChecksDJ">确定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- :visible.sync="dialogPLS"
- width="460px"
- :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="dialogPLS = false"
- />
- </div>
- </div>
- <div>
- <div class="aListBottom">{{ listData.realname }}</div>
- <el-form label-width="100px">
- <el-form-item label="考试成绩" required>
- <el-input-number
- :controls="false"
- v-model="listData.performance"
- :min="0"
- ></el-input-number
- >分
- </el-form-item>
- <el-form-item label="考试结果" required>
- <el-radio-group v-model="listData.result">
- <el-radio :label="1">通过</el-radio>
- <el-radio :label="0">不通过</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="证书编号">
- <el-input v-model="listData.certificateCode"></el-input>
- </el-form-item>
- <el-form-item label="登记补充">
- <el-input
- v-model="listData.remark"
- type="textarea"
- :rows="4"
- ></el-input>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogPLS = false">取消</el-button>
- <el-button type="primary" @click="submitChecksPals">确定</el-button>
- </span>
- </el-dialog>
- <el-dialog
- :visible.sync="dialoginfoWatch"
- width="760px"
- :show-close="false"
- :close-on-click-modal="false"
- >
- <div slot="title" class="hearders">
- <div class="leftTitle">
- {{
- activeInfoType === 1
- ? "考试次数"
- : activeInfoType === 2
- ? "前培次数"
- : "未知"
- }}
- </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="120px">
- <el-button type="info" style="margin-bottom: 20px" size="mini"
- >商品自带{{
- activeInfoType === 1
- ? "考试次数"
- : activeInfoType === 2
- ? "前培次数"
- : "未知"
- }}</el-button
- >
- <el-form-item label="商品名称:">
- <span
- >{{ infoData.goodsCode }}-{{ infoData.goodsName }}-¥{{
- infoData.standPrice
- }}</span
- >
- </el-form-item>
- <el-form-item
- :label="
- activeInfoType === 1
- ? '考试次数:'
- : activeInfoType === 2
- ? '前培次数:'
- : '未知'
- "
- >
- <span>{{
- activeInfoType === 1
- ? infoData.examNumber - infoData.examNumberAll
- : activeInfoType === 2
- ? infoData.doNumber - infoData.doNumberAll
- : ""
- }}</span>
- </el-form-item>
- <div v-if="activeInfoType === 1 && infoData.userExamGoodsSupplement && infoData.userExamGoodsSupplement.length > 0">
- <el-button type="info" style="margin-bottom: 20px" size="mini"
- >补考商品自带考试次数</el-button
- >
- <div
- v-for="(item, index) in infoData.userExamGoodsSupplement"
- :key="index"
- >
- <el-form-item label="商品名称:">
- <span
- >{{ item.code }}-{{ item.goodsName }}({{
- item.educationName +
- "-" +
- item.projectName +
- "-" +
- item.businessName
- }})-¥{{ item.standPrice }}</span
- >
- </el-form-item>
- <el-col :span="24"
- ><el-form-item label="考试次数:">{{
- item.examNumber
- }}</el-form-item></el-col
- >
- <!-- <el-col :span="16"
- ><el-form-item label="使用有效期:"
- >{{ $methodsTools.onlyForma(item.makeStartTime, false) }}至{{
- $methodsTools.onlyForma(item.makeEndTime, false)
- }}</el-form-item
- ></el-col
- > -->
- </div>
- </div>
- <div v-if="activeInfoType === 2 && infoData.userExamGoodsSupplementVos && infoData.userExamGoodsSupplementVos.length > 0">
- <el-button type="info" style="margin-bottom: 20px" size="mini"
- >前培商品自带前培次数</el-button
- >
- <div
- v-for="(item, index) in infoData.userExamGoodsSupplementVos"
- :key="index"
- >
- <el-form-item label="商品名称:">
- <span
- >{{ item.code }}-{{ item.goodsName }}({{
- item.educationName +
- "-" +
- item.projectName +
- "-" +
- item.businessName
- }})-¥{{ item.standPrice }}</span
- >
- </el-form-item>
- <el-col :span="24"
- ><el-form-item label="前培次数:">{{
- item.doNumber
- }}</el-form-item></el-col
- >
- <!-- <el-col :span="16"
- ><el-form-item label="使用有效期:"
- >{{ $methodsTools.onlyForma(item.makeStartTime, false) }}至{{
- $methodsTools.onlyForma(item.makeEndTime, false)
- }}</el-form-item
- ></el-col
- > -->
- </div>
- </div>
- <el-button type="info" style="margin-bottom: 20px" size="mini"
- >消耗{{
- activeInfoType === 1
- ? "考试次数"
- : activeInfoType === 2
- ? "前培次数"
- : "未知"
- }}</el-button
- >
- <el-form-item
- :label="
- activeInfoType === 1
- ? '考试次数:'
- : activeInfoType === 2
- ? '前培次数:'
- : '未知'
- "
- >
- <span>{{
- activeInfoType === 1
- ? infoData.expendNumber
- : activeInfoType === 2
- ? infoData.expendBefore
- : ""
- }}</span>
- </el-form-item>
- <el-button type="info" style="margin-bottom: 20px" size="mini">{{
- activeInfoType === 1
- ? "剩余考试次数"
- : activeInfoType === 2
- ? "剩余前培次数"
- : "未知"
- }}</el-button>
- <el-form-item
- :label="
- activeInfoType === 1
- ? '剩余考试次数:'
- : activeInfoType === 2
- ? '剩余前培次数:'
- : '未知'
- "
- >
- <span>{{
- activeInfoType === 1
- ? infoData.examNumber - infoData.expendNumber
- : activeInfoType === 2
- ? infoData.doNumber - infoData.expendBefore
- : ""
- }}</span>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialoginfoWatch = false">取 消</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import pagination from "@/components/pagination";
- export default {
- name: "ByTrainee",
- components: { pagination },
- data() {
- return {
- active: "",
- studentList: [],
- formData: {
- pageNum: 1,
- pageSize: 10,
- },
- tabSearchData: {
- userId: "",
- pageNum: 1,
- pageSize: 10,
- },
- totalRight: 0,
- tableList: [
- {
- label: "所购商品",
- prop1: "goodsCode",
- prop2: "goodsName",
- prop3: "standPrice",
- scope: "goodsName",
- },
- {
- label: "考试次数",
- prop1: "examNumber",
- prop2: "expendNumber",
- scope: "numTypes",
- type: 1,
- },
- {
- label: "前培次数",
- prop1: "doNumber",
- prop2: "expendBefore",
- scope: "numTypes",
- type: 2,
- },
- ],
- tableData: [],
- tableSet: [
- {
- label: "预约考试",
- prop: "subscribeStatus",
- hidden: true,
- width: "130px",
- scope: "isOptions",
- options: [
- {
- label: "正常",
- value: 1,
- },
- {
- label: "取消",
- value: 2,
- },
- ],
- },
- {
- label: "前培标记",
- prop: "beforeStatus",
- hidden: true,
- width: "130px",
- scope: "isOptions",
- options: [
- {
- label: "已开通",
- value: 1,
- },
- {
- label: "未开通",
- value: 0,
- },
- ],
- },
- {
- label: "考试登记",
- prop: "examStatus",
- hidden: true,
- width: "130px",
- scope: "isOptions",
- options: [
- {
- label: "待登记",
- value: 0,
- },
- {
- label: "正常",
- value: 1,
- },
- {
- label: "缺考",
- value: 2,
- },
- {
- label: "作弊",
- value: 3,
- },
- {
- label: "替考",
- value: 4,
- },
- ],
- },
- {
- label: "考试成绩和结果",
- prop1: "performance",
- prop2: "result",
- hidden: true,
- width: "130px",
- scope: "resultType",
- },
- {
- label: "证书编号",
- prop: "certificateCode",
- hidden: true,
- width: "130px",
- },
- {
- label: "考试标题",
- prop: "applyName",
- hidden: true,
- width: "130px",
- },
- {
- label: "学员姓名",
- prop: "realname",
- hidden: true,
- width: "130px",
- },
- {
- label: "学员身份证",
- prop: "idCard",
- hidden: true,
- width: "170px",
- },
- {
- label: "所购商品",
- prop1: "goodsCode",
- prop2: "goodsName",
- prop3: "standPrice",
- hidden: true,
- width: "220px",
- scope: "goodsInfos",
- },
- {
- label: "学员报考类型",
- prop: "studentType",
- hidden: true,
- width: "130px",
- scope: "isOptions",
- options: [
- {
- label: "非补考学员",
- value: 1,
- },
- {
- label: "补考学员",
- value: 2,
- },
- ],
- },
- {
- label: "所报专业",
- prop: "categoryName",
- hidden: true,
- width: "130px",
- },
- {
- label: "预约场次(考试地点和时间)",
- prop: "applySiteAddress",
- prop1: "applySiteExamTime",
- prop2: "applySiteStartTime",
- prop3: "applySiteEndTime",
- hidden: true,
- width: "280px",
- scope: "applyInfos",
- },
- {
- label: "考试次数消耗",
- prop: "examExpend",
- hidden: true,
- width: "130px",
- },
- {
- label: "预约场次(考培地点和时间)",
- prop: "applySiteAddressTrain",
- prop1: "applySiteExamTrainTime",
- prop2: "applySiteStartTrainTime",
- prop3: "applySiteEndTrainTime",
- hidden: true,
- width: "280px",
- scope: "applyInfos",
- },
- {
- label: "前培次数消耗",
- prop: "beforeExpend",
- hidden: true,
- width: "130px",
- },
- {
- label: "创建时间",
- prop: "createTime",
- hidden: true,
- scope: "aTimeList",
- width: "160px",
- },
- ],
- total: 0,
- dialogDJ: false,
- dialogCG: false,
- dialogPLS: false,
- dialoginfoWatch: false,
- listData: {},
- infoData: {},
- activeInfoType: 0, //1考试次数2前培次数---头部标题变化
- rules: {
- examStatus: [
- { required: true, message: "请选择考试登记状态", trigger: "change" },
- ],
- },
- };
- },
- mounted() {
- this.getStudent();
- },
- activated() {
- this.getStudent();
- },
- methods: {
- seeInfos(row, int) {
- this.activeInfoType = int;
- this.$api
- .inquiresystemsubscribeUserExam({
- goodsId: row.goodsId,
- userId: row.userId,
- orderGoodsId:row.orderGoodsId
- })
- .then((res) => {
- this.infoData = JSON.parse(JSON.stringify(res.data));
- this.infoData.doNumberAll = 0;
- this.infoData.examNumberAll = 0;
- this.infoData.userExamGoodsSupplement.forEach((item) => {
- this.infoData.examNumberAll += item.examNumber;
- });
- this.infoData.userExamGoodsSupplementVos.forEach((item) => {
- this.infoData.doNumberAll += item.doNumber;
- });
- this.dialoginfoWatch = true;
- });
- },
- openZS(row) {
- if (row.examStatus !== 1) {
- this.$message.warning("考试登记状态为正常的计划才可执行该操作");
- return;
- }
- this.listData = JSON.parse(JSON.stringify(row));
- this.dialogPLS = true;
- },
- submitChecksPals() {
- if (!this.listData.performance && this.listData.performance !== 0) {
- this.$message.warning(`未填写考试成绩,请填写考试成绩!`);
- return;
- }
- if (!this.listData.result && this.listData.result !== 0) {
- this.$message.warning(`未选择考试结果,请选择考试结果!`);
- return;
- }
- var data = JSON.parse(JSON.stringify(this.listData));
- this.$api.appsystemsubscribe([data]).then((res) => {
- var dat = {
- subscribeId: this.listData.subscribeId,
- };
- this.$api.inquiresystemsubscribelist(dat).then((res) => {
- for (let k = 0; k < res.rows.length; k++) {
- for (let i = 0; i < res.rows[k].examApplySite.length; i++) {
- for (
- let j = 0;
- j < res.rows[k].examApplySite[i].examApplySiteTime.length;
- j++
- ) {
- res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime =
- JSON.parse(
- res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime
- );
- }
- }
- for (let i = 0; i < res.rows[k].examApplySiteTrain.length; i++) {
- for (
- let j = 0;
- j < res.rows[k].examApplySiteTrain[i].examApplySiteTime.length;
- j++
- ) {
- res.rows[k].examApplySiteTrain[i].examApplySiteTime[
- j
- ].siteTime = JSON.parse(
- res.rows[k].examApplySiteTrain[i].examApplySiteTime[j]
- .siteTime
- );
- }
- }
- }
- let ast = res.rows[0];
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.tableData[i].goodsId === data.goodsId) {
- for (let k = 0; k < this.tableData[i].children.length; k++) {
- if (
- this.tableData[i].children[k].subscribeId === data.subscribeId
- ) {
- this.$set(this.tableData[i].children, k, ast);
- }
- }
- }
- }
- this.$message.success("已修改成绩和证书登记");
- this.dialogPLS = false;
- });
- });
- },
- openClearYX(row) {
- this.listData = JSON.parse(JSON.stringify(row));
- this.dialogDJ = true;
- },
- submitChecksDJ() {
- var data = JSON.parse(JSON.stringify(this.listData));
- data.subscribeId = [data.subscribeId];
- data.subscribeStatus = 2;
- this.$api.editsystemsubscribe(data).then((res) => {
- var dat = {
- subscribeId: this.listData.subscribeId,
- };
- this.$api.inquiresystemsubscribelist(dat).then((res) => {
- for (let k = 0; k < res.rows.length; k++) {
- for (let i = 0; i < res.rows[k].examApplySite.length; i++) {
- for (
- let j = 0;
- j < res.rows[k].examApplySite[i].examApplySiteTime.length;
- j++
- ) {
- res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime =
- JSON.parse(
- res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime
- );
- }
- }
- for (let i = 0; i < res.rows[k].examApplySiteTrain.length; i++) {
- for (
- let j = 0;
- j < res.rows[k].examApplySiteTrain[i].examApplySiteTime.length;
- j++
- ) {
- res.rows[k].examApplySiteTrain[i].examApplySiteTime[
- j
- ].siteTime = JSON.parse(
- res.rows[k].examApplySiteTrain[i].examApplySiteTime[j]
- .siteTime
- );
- }
- }
- }
- let ast = res.rows[0];
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.tableData[i].goodsId === data.goodsId) {
- for (let k = 0; k < this.tableData[i].children.length; k++) {
- if (
- this.tableData[i].children[k].subscribeId ===
- data.subscribeId[0]
- ) {
- this.$set(this.tableData[i].children, k, ast);
- }
- }
- }
- }
- });
- this.$message.success("已取消预约");
- this.dialogDJ = false;
- });
- },
- editExam(row) {
- this.listData = JSON.parse(JSON.stringify(row));
- this.dialogCG = true;
- },
- submitChecks(formName) {
- this.$refs[formName].validate((valid) => {
- if (valid) {
- if (!this.listData.examStatus) {
- this.$message.warning("请选择考试登记状态");
- return;
- }
- this.submitForm();
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- submitForm() {
- var data = JSON.parse(JSON.stringify(this.listData));
- data.subscribeId = [data.subscribeId];
- this.$api.editsystemsubscribe(data).then((res) => {
- var dat = {
- subscribeId: this.listData.subscribeId,
- };
- this.$api.inquiresystemsubscribelist(dat).then((res) => {
- for (let k = 0; k < res.rows.length; k++) {
- for (let i = 0; i < res.rows[k].examApplySite.length; i++) {
- for (
- let j = 0;
- j < res.rows[k].examApplySite[i].examApplySiteTime.length;
- j++
- ) {
- res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime =
- JSON.parse(
- res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime
- );
- }
- }
- for (let i = 0; i < res.rows[k].examApplySiteTrain.length; i++) {
- for (
- let j = 0;
- j < res.rows[k].examApplySiteTrain[i].examApplySiteTime.length;
- j++
- ) {
- res.rows[k].examApplySiteTrain[i].examApplySiteTime[
- j
- ].siteTime = JSON.parse(
- res.rows[k].examApplySiteTrain[i].examApplySiteTime[j]
- .siteTime
- );
- }
- }
- }
- let ast = res.rows[0];
- for (let i = 0; i < this.tableData.length; i++) {
- if (this.tableData[i].goodsId === data.goodsId) {
- for (let k = 0; k < this.tableData[i].children.length; k++) {
- if (
- this.tableData[i].children[k].subscribeId ===
- data.subscribeId[0]
- ) {
- this.$set(this.tableData[i].children, k, ast);
- }
- }
- }
- }
- });
- this.$message.success("考试登记修改成功");
- this.dialogCG = false;
- });
- },
- async expandChange(row, e) {
- if (e.length > 0) {
- //获取后台数据
- const result = await this.getApis({
- userId: row.userId,
- goodsId: row.goodsId,
- orderGoodsId:row.orderGoodsId
- });
- //便利table数组,找到符合本行数据,赋值
- this.tableData.forEach((item, index) => {
- if (row.orderGoodsId === item.orderGoodsId) {
- item.children = result;
- }
- });
- }
- },
- getApis(data) {
- return new Promise((resolve, reject) => {
- this.$api.inquiresystemsubscribelist(data).then((res) => {
- // for (let k = 0; k < res.rows.length; k++) {
- // for (let i = 0; i < res.rows[k].examApplySite.length; i++) {
- // for (
- // let j = 0;
- // j < res.rows[k].examApplySite[i].examApplySiteTime.length;
- // j++
- // ) {
- // res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime =
- // JSON.parse(
- // res.rows[k].examApplySite[i].examApplySiteTime[j].siteTime
- // );
- // }
- // }
- // for (let i = 0; i < res.rows[k].examApplySiteTrain.length; i++) {
- // for (
- // let j = 0;
- // j < res.rows[k].examApplySiteTrain[i].examApplySiteTime.length;
- // j++
- // ) {
- // res.rows[k].examApplySiteTrain[i].examApplySiteTime[
- // j
- // ].siteTime = JSON.parse(
- // res.rows[k].examApplySiteTrain[i].examApplySiteTime[j]
- // .siteTime
- // );
- // }
- // }
- // }
- resolve(res.rows);
- });
- });
- },
- acs(int) {
- if (int === 2) {
- this.tabSearchData.pageSize = 10;
- this.tabSearchData.pageNum = 1;
- }
- this.$api
- .inquiresystemsubscribelistUserExam(this.tabSearchData)
- .then((res) => {
- this.totalRight = res.total;
- this.active = this.tabSearchData.userId;
- this.tableData = res.rows.map((item) => {
- return {
- ...item,
- children: [],
- //新增空数组children装展开行内容
- };
- });
- });
- },
- changeNewActive(item) {
- if (item.userId === this.active) {
- return;
- }
- this.tabSearchData.userId = item.userId;
- this.acs(2);
- },
- getStudent(int) {
- if (int === 1) {
- this.formData = {
- pageNum: 1,
- pageSize: 10,
- };
- }
- this.$api.inquiresystemsubscribelistUser(this.formData).then((res) => {
- this.total = res.total;
- this.studentList = res.rows;
- });
- },
- handleCurrentChange(v) {
- this.formData.pageNum = v;
- this.getStudent();
- },
- handleSizeChange(v) {
- this.tabSearchData.pageSize = v;
- this.tabSearchData.pageNum = 1;
- this.acs();
- },
- handleCurrentChanges(v) {
- this.tabSearchData.pageNum = v;
- this.acs();
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .dis_fs {
- margin-top: 12px;
- display: flex;
- .dis_left {
- min-width: 250px;
- background-color: #eee;
- margin-right: 20px;
- padding: 10px 14px;
- .inputSty {
- width: 133px;
- outline: none;
- height: 26px;
- }
- .btnSearchSty {
- border: 1px solid #666;
- background-color: #fff;
- padding: 0px 6px;
- font-size: 14px;
- height: 26px;
- line-height: 26px;
- border-left: none;
- cursor: pointer;
- }
- }
- .dis_right {
- flex: 1;
- }
- }
- .listy {
- margin-bottom: 6px;
- padding: 4px;
- font-size: 14px;
- cursor: pointer;
- border: 1px solid transparent;
- }
- .active {
- border: 1px solid #000;
- background-color: #fff;
- }
- /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;
- }
- }
- .aListBottom {
- margin-bottom: 20px;
- padding: 0px 6px;
- border: 1px solid #999;
- border-radius: 4px;
- height: 30px;
- line-height: 30px;
- display: inline-block;
- }
- .liBVS {
- margin-right: 20px;
- margin-bottom: 12px;
- padding: 0px 6px;
- border: 1px solid #999;
- border-radius: 4px;
- height: 30px;
- line-height: 30px;
- display: inline-block;
- float: left;
- }
- .clsw {
- margin-left: 4px;
- cursor: pointer;
- color: #f56c6c;
- }
- </style>
|