| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680 |
- <template>
- <div>
- <div class="personPage">
- <div
- style="width: 100%;display: flex;justify-content: flex-end;align-items: center;"
- >
- <!-- <el-select v-model="teas" multiple placeholder="请选择">
- <el-option
- v-for="item in TeaList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select> -->
- <!-- <div style="margin-left: 10px;">
- <el-button type="primary" @click="remindExamine" size="mini"
- >提醒</el-button
- >
- </div> -->
- </div>
- <el-table
- :data="copyTableData"
- class="scoTab"
- v-loading="tabLoading"
- style="width: 100%"
- >
- <el-table-column type="index" align="center" label="序号" width="180">
- </el-table-column>
- <el-table-column prop="username" align="center" label="教师姓名">
- </el-table-column>
- <el-table-column
- prop="tea"
- show-overflow-tooltip
- :filters="TeachingOptions"
- :filter-method="filterTea"
- align="center"
- label="教研室"
- width="180"
- >
- </el-table-column>
- <el-table-column
- :filters="[
- { text: '已完成', value: '已完成' },
- { text: '未完成', value: '未完成' }
- ]"
- :filter-method="filterExa"
- :filter-multiple="false"
- prop="state"
- align="center"
- label="考核进度"
- >
- <template slot-scope="scope">
- <div v-if="scope.row.step == scope.row.allStep">√</div>
- <div v-else>{{ scope.row.step }}/{{ scope.row.allStep }}</div>
- </template>
- </el-table-column>
- <el-table-column
- prop="evaSca"
- :sortable="true"
- :sort-method="sortEvaMethod"
- align="center"
- label="自评总分"
- >
- </el-table-column>
- <!-- <el-table-column align="center" label="一级指标评分" >
- <template slot-scope="scope">
- <div class= "scoreBox" v-for="item, index in scope.row.json" :key="index">
- <el-tooltip :content="item.name" placement="top" effect="dark">
- <span>{{ item.name }}</span>
- </el-tooltip>
- :<span>{{ scoreChildren(item.children) }}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="cogSco"
- :sortable="true"
- :sort-method="sortCogMethod"
- align="center"
- label="考核总分"
- >
- </el-table-column> -->
- <el-table-column
- align="center"
- label="状态"
- >
- <template slot-scope="scope">
- <div class="taskArea" v-if="[0,1].includes(scope.row.isReview)">
- <span :class="`task_${scope.row.isReview}`">{{ typeStatusList[scope.row.isReview] }}</span>
- </div>
- <span v-else>/</span>
- <!-- <div v-if="scope.row.state == '已完成'">已完成</div>
- <div v-else>未完成</div> -->
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作">
- <template slot-scope="scope">
- <div style="display: flex;justify-content: center;">
- <div class="TabBtn" @click="lookScore(scope.row)">评分</div>
- <div class="TabBtn" @click="withdraw(scope.row.id)">退回</div>
- <div class="TabBtn" @click="recordBtn(scope.row.id)">记录</div>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- 点击评分 -->
- <el-dialog
- title=""
- :visible.sync="diaSco"
- :append-to-body="true"
- width="95%"
- :before-close="handleClose"
- class="dialog_diy"
- >
- <div v-loading="digLoading" class="testPersonExamine">
- <div class="testTit">
- <div class="teaLis">
- <div
- class="teal"
- v-if="digType==2"
- @click="cutPage(2)"
- :class="[digType == 2 ? 'Tbor' : '']"
- >
- 专任教师
- </div>
- <div
- class="teal"
- @click="cutPage(1)"
- v-if="digType == 1"
- :class="[digType == 1 ? 'Tbor' : '']"
- >
- 班主任考核
- </div>
- </div>
- </div>
- <div class="digTop">
- <div
- style="width: 230px;display: flex;justify-content: space-between;align-items: center;margin-left: 15px;"
- >
- <div class="digUsernameCss">{{ digUsername }}</div>
- <div
- v-if="tableData.length > 0"
- style="display: flex;justify-content: space-between;width: 150px;"
- >
- <div style="margin-right:10px">
- <el-button type="primary" size="mini" @click="upTea"
- >上一个</el-button
- >
- </div>
- <div style="margin-right:10px">
- <el-button type="primary" size="mini" @click="nextTea"
- >下一个</el-button
- >
- </div>
- <div style="margin-right:10px">
- <el-button type="primary" size="mini" @click="saveBtn"
- >保存</el-button
- >
- </div>
- <div style="margin-right:10px">
- <el-button type="primary" size="mini" @click="exportExlec"
- >导出</el-button
- >
- </div>
- </div>
- </div>
- <div
- style="width: 650px;display: flex;justify-content: space-between;margin-left: 6px;"
- >
- <div style="display: flex;">
- <span>教研室:</span
- ><el-tooltip
- class="item"
- effect="dark"
- :content="disTeaClass"
- placement="top"
- >
- <div
- style="width: 100px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"
- >
- {{ disTeaClass }}
- </div>
- </el-tooltip>
- </div>
- <div>审核进度:{{ computedStep }}/{{ twoTarget }}</div>
- <div>自评分数:{{ DigSelfSco }}</div>
- <div>考核分数:{{ computedSco }}</div>
- </div>
- </div>
- <div style="height:100%;overflow: auto;padding-bottom: 80px;">
- <div class="sBox_table">
- <div class="table_title">
- <div style="width: 150px;">一级指标</div>
- <div style="width: 160px;">二级指标</div>
- <div style="width: 160px;">评价方法</div>
- <div style="width: 110px;">分值</div>
- <div style="width: 110px;">自评</div>
- <div style="flex: 1;">自评概述</div>
- <div style="width: 250px;">数据来源</div>
- <div style="width: 110px;">认定</div>
- <div style="flex: 1;">认定概述</div>
- </div>
- <div
- style="height: 100%;overflow: auto;overflow-x: hidden;border-left: 1px #ccc solid;"
- >
- <div
- class="table_Content"
- v-for="item in PageBaseData"
- :key="item.id"
- >
- <div class="twoCol">
- <div class="ColTit">{{ item.name }}</div>
- <div class="ColCon">
- <div class="twoCon" v-for="k in item.children" :key="k.id">
- <div>{{ k.name }}</div>
- <div style="padding: 10px;box-sizing: border-box;">
- {{ k.evaMethod }}
- </div>
- <div>{{ k.score }}</div>
- <div>
- {{ k.sco1 }}
- </div>
- <div>
- <div class="tArea">
- {{ k.selfSummary }}
- </div>
- </div>
- <div>
- <div v-if="!k.testid.test.length">/</div>
- <div v-else style="padding-top: 10px;">
- <!-- {{ reverseString(k.testid.test) }} -->
- <div
- v-for="(item2) in k.testid.test"
- :key="item2.courseId"
- class="orgData"
- >
- <div :style="item2.status==2?`color:red`:''" @click="lookUserPrize(item2.courseId)">
- {{ item2.title }}:{{ item2.num }}份
- </div>
- </div>
- </div>
- </div>
- <div style="display: flex;justify-content: center;">
- <div v-if="tableData.length > 0" class="ScoreStep">
- <el-input
- :style="{
- color: k.sco1 == k.sco2 ? '#000' : 'red'
- }"
- @blur="
- saveTab(
- k.id,
- k.sco2 > k.score
- ? (k.sco2 = k.score)
- : '' || k.sco2 < 0
- ? (k.sco2 = '')
- : ''
- )
- "
- v-model="k.sco2"
- v-stopMousewheel
- @input="val => {
- // 只允许输入数字(整数或小数)
- let num = val.replace(/[^0-9.]/g, '');
- // 防止多个小数点
- num = num.replace(/\.{2,}/g, '.');
- num = num.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');
- // 防止小数点开头
- if(num !== '' && num[0] === '.') num = '';
- // 防止小数点后多余数字
- if(num.split('.').length > 1 && num.split('.')[1].length > 2) {
- num = num.split('.')[0] + '.' + num.split('.')[1].slice(0, 2);
- }
- k.sco2 = num;
- }"
- ></el-input>
- </div>
- </div>
- <div style="display: flex;justify-content: center;">
- <textarea
- v-if="tableData.length > 0"
- @blur="saveTab(k.id)"
- v-model.trim="k.cogSum"
- />
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </el-dialog>
- <!-- 查看数据来源 -->
- <el-dialog
- title=""
- :visible.sync="diaIframe"
- :append-to-body="true"
- width="95%"
- :before-close="handleClose2"
- class="dialog_diy"
- >
- <div style="height: 100%;">
- <iframe
- ref="viframe"
- style="width: 100%; height: 99%; border: none"
- :src="ifmUrl"
- ></iframe>
- </div>
- </el-dialog>
- <!-- 提醒弹框 -->
- <shareBox
- :remDig.sync="remDig"
- :pType="pType"
- :TeaList="TeaList"
- ></shareBox>
- <el-dialog
- title="评分记录"
- :visible.sync="recordVisible"
- class="recordDig"
- :before-close="recordHandleClose"
- >
- <div>
- <el-table border height="500px" :data="RecordList" style="width: 100%">
- <el-table-column align="center" type="index" label="序号" width="80">
- </el-table-column>
- <el-table-column
- align="center"
- show-overflow-tooltip
- prop="username"
- label="教师姓名"
- >
- </el-table-column>
- <el-table-column align="center" prop="dateTime" label="评分时间">
- </el-table-column>
- </el-table>
- </div>
- </el-dialog>
- <!-- <el-dialog
- title="提醒"
- :visible.sync="remDig"
- :append-to-body="true"
- width="600"
- :before-close="handleClose3"
- class="dialog_remDig"
- >
- <div v-loading="digLoading" style="height: 100%;padding: 15px;">
- <div class="remFlex" style="align-items: center;">
- <div class="remFlexTit">填写范围:</div>
- <el-select v-model="teas" multiple placeholder="请选择">
- <el-option
- v-for="item in TeaList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- @change="remindExamine"
- >
- </el-option>
- </el-select>
- </div>
- <div class="remFlex">
- <div class="remFlexTit">需提交人数:</div>
- <div>{{ remindNum }}</div>
- </div>
- <div class="remFlex">
- <div class="remFlexTit">未完成人数:</div>
- <div>{{ remindList.length }}</div>
- </div>
- <div class="remFlex">
- <div class="remFlexTit">需提交人数:</div>
- <div class="remFlex" style="flex-wrap: wrap;">
- <div
- v-for="(item, index) in remindList"
- :key="index"
- style="margin-right: 2px;"
- >
- {{ item }},
- </div>
- </div>
- </div>
- </div>
- </el-dialog> -->
- </div>
- </template>
- <script>
- import shareBox from "./shareBox/index";
- export default {
- directives: {
- stopMousewheel: {
- inserted: function(el) {
- const ele = el.tagName === 'INPUT' ? el : el.querySelector('input');
- ele.addEventListener("mousewheel", () => {
- ele.blur();
- });
- }
- }
- },
- props: {
- pType: {
- //2专任教师 1班主任
- type: Number,
- default: 0
- },
- teacherName: {
- type: String,
- default: ""
- },
- timeA: {
- type:String,
- default:""
- },
- timeB: {
- type: String,
- default:""
- }
- },
- components: {
- shareBox
- },
- data() {
- return {
- digType: 2,
- diaSco: false,
- diaIframe: false,
- recordVisible: false,
- RecordList: [],
- ifmUrl: false,
- PageBaseData: [],
- digUserid: "", //用户id
- digTid: "", //表单id
- cutTeaNum: 0, //第几位教师
- disTeaClass: "", //教研室
- digLoading: false,
- DigSelfSco: 0,
- digUsername: "",
- twoTarget: 0,
- computedScoData: 0,
- computedStepData: 0,
- computedCogSCoData: 0,
- TeaList: [],
- tabLoading: false,
- userid: this.$route.query.userid, //用户id
- oid: this.$route.query.oid, //学校id
- org: this.$route.query.org, //组织id
- tableData: [],
- copyTableData:[],
- TeachingOptions: [],
- PageBaseDataTwo: [],
- remDig: false,
- timeSortList:[],
- typeStatusList:["待办","已完成",'/']
- };
- },
- watch: {
- pType(newVal, oldVal) {
- this.getData();
- },
- digType(newVal, oldVal) {
- this.getDataDig();
- },
- timeA(newVal){
- if(newVal){
- this.timeSortFn()
- }
- },
- timeB(newVal){
- if(newVal){
- this.timeSortFn()
- }
- }
- },
- computed: {
- computedSco() {
- this.computedScoData = 0; // 初始化一个局部变量来存储累加结果
- // 定义一个函数来执行累加操作
- const accumulateSco = () => {
- if (this.PageBaseData) {
- // 确保 this.PageBaseData 存在
- this.PageBaseData.forEach(e => {
- // 假设 e.children 是一个可以迭代的数组或类似结构
- e.children.forEach(i => {
- if (!!i.sco2) {
- this.computedScoData += i.sco2 * 1;
- }
- });
- });
- this.computedScoData = this.computedScoData.toFixed(2);
- }
- return this.computedScoData; // 返回累加结果
- };
- // 立即调用函数并返回结果
- return accumulateSco();
- },
- computedStep() {
- this.computedStepData = 0; // 初始化一个局部变量来存储累加结果
- // 定义一个函数来执行累加操作
- const accumulateSco2 = () => {
- if (this.PageBaseData) {
- this.PageBaseData.forEach(e => {
- e.children.forEach(i => {
- if (!!i.sco2) {
- this.computedStepData++;
- }
- });
- });
- }
- return this.computedStepData; // 返回累加结果
- };
- // 立即调用函数并返回结果
- return accumulateSco2();
- },
- scoreChildren() {
- return function(children){
- let score = 0;
- children.forEach(item => {
- if (item.sco2 && parseFloat(item.sco2) > 0) {
- score += parseFloat(item.sco2);
- }
- });
- return score;
- }
- },
- },
- mounted() {
- this.getData();
- this.getTeaList();
- },
- methods: {
- exportExlec(){
- let headers = [
- ['一级指标', '二级指标', '评价方法', '分值', '自评', '自评概述', '认定', '认定概述']
- ];
- var XLSX = require("xlsx");
- let data = [
- ...headers,
- ...this.PageBaseData.flatMap(parent =>
- parent.children.map(child => [
- parent.name, // 一级指标
- child.name, // 二级指标
- child.evaMethod, // 评分方法
- child.score, // 分值
- child.sco1, // 自评
- child.selfSummary, // 自评概述
- child.sco2, // 认定
- child.cogSum // 认定概述
- ]))
- ]
- const wb = XLSX.utils.book_new(); //创建一个新的工作簿对象
- // 创建一个Worksheet对象
- let ws = XLSX.utils.aoa_to_sheet(data);
- // 定义通用样式(包含居中)
- const commonStyle = {
- alignment: {
- horizontal: "center",
- vertical: "center"
- },
- font: {
- sz: 12
- }
- };
- // 定义表头特殊样式
- const headerStyle = {
- ...commonStyle,
- fill: { fgColor: { rgb: "FFFF00" } },
- font: { ...commonStyle.font, bold: true, sz: 14 }
- };
- // 应用样式到所有单元格
- for (let r = 0; r < data.length; ++r) {
- for (let c = 0; c < data[r].length; ++c) {
- const cellRef = XLSX.utils.encode_cell({ r, c });
- ws[cellRef] = ws[cellRef] || {};
- ws[cellRef].s = r === 0 ? headerStyle : commonStyle;
- }
- }
- // 设置列宽
- ws['!cols'] = [
- { wch: 20 }, // 一级指标
- { wch: 20 }, // 二级指标
- { wch: 30 }, // 评价方法
- { wch: 10 }, // 分值
- { wch: 10 }, // 自评
- { wch: 30 }, // 自评概述
- { wch: 10 }, // 认定
- { wch: 30 } // 认定概述
- ];
- // 设置行高
- ws['!rows'] = [
- { hpx: 30 }, // 表头行
- { hpx: 25 }, // 其他行的默认高度
- // 根据需要继续添加行高设置
- ];
- console.log('kk',data);
- // 合并单元格
- ws['!merges'] = [];
- // 记录合并单元格的逻辑
- let startRow = 1; // 数据开始行
- let previousParentName = null;
- let count = 0; // 计数连续相同的一级指标行
- for (let index = 1; index < data.length; index++) {
- const currentParentName = data[index][0]; // 当前行的一级指标
- if (currentParentName === previousParentName) {
- count++; // 继续计数
- } else {
- if (count > 0) { // 如果有连续的相同项
- ws['!merges'].push({
- s: { r: startRow, c: 0 },
- e: { r: startRow + count, c: 0 }
- });
- }
- // 更新开始行和计数
- startRow = index; // 更新为当前行的开始行
- count = 0; // 重置计数
- }
- previousParentName = currentParentName; // 更新前一个一级指标
- }
- // 检查最后一组
- if (count > 0) {
- ws['!merges'].push({
- s: { r: startRow, c: 0 },
- e: { r: startRow + count, c: 0 }
- });
- }
- XLSX.utils.book_append_sheet(wb, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
- XLSX.writeFile(wb, this.digUsername +'-'+ (this.digType == 1 ? '班主任考核' :'专任教师')+".xlsx");
- this.$message({
- message: "导出成功",
- type: "success"
- });
- },
- // 禁用滚轮事件
- handleWheel(event) {
- event.preventDefault();
- },
- // 获取页面数据
- getData() {
- this.tabLoading = true;
- let params = {
- oid: this.oid,
- org: this.org,
- type: this.pType,
- tname: this.teacherName
- };
- // console.log(params);
- this.ajax
- .get(this.$store.state.api + "selectTestExaminePersonData_filterTime", params)
- .then(async res => {
- let data = res.data[0];
- console.log(data)
- data.forEach(e => {
- e.json = JSON.parse(e.json);
- });
- data.forEach(e => {
- e.evaSca = 0;
- e.cogSco = 0;
- e.step = 0;
- e.allStep = 0;
- e.json.forEach(i => {
- i.children.forEach(k => {
- e.evaSca = e.evaSca + k.sco1 * 1;
- e.cogSco = e.cogSco + k.sco2 * 1;
- e.allStep++;
- if (!!k.sco2 * 1) {
- e.step++;
- }
- });
- });
- });
- data.forEach(e => {
- if (e.step == e.allStep) {
- e.state = "已完成";
- } else {
- e.state = "未完成";
- }
- if (!e.tea) {
- e.tea = "";
- }
- e.evaSca = e.evaSca.toFixed(2);
- e.cogSco = e.cogSco.toFixed(2);
- });
- for(let i = 0;i<data.length;i++){
- let testList = [];
- data[i].json.forEach(i2=>{
- if(i2.children.length>0){
- i2.children.forEach(i3=>{
- if(i3.testid.test.length>0){
- testList.push(...i3.testid.test)
- }
- })
- }
- })
- if(testList.length>0){
- let _time = data[i].timeValue?JSON.parse(data[i].timeValue):{};
- let testData = await this.computedTest(testList,data[i].userid,_time)
- let _isReviewNum = 0;
- let _num = 0;
- testData.forEach(i=>{
- _isReviewNum+=i.isReviewNum;
- _num+=i.num;
- })
- if(_num>0){
- if(_num==_isReviewNum){
- data[i].isReview = 1;
- }else{
- data[i].isReview = 0;
- }
- }else{
- data[i].isReview = 2;
- }
- }
- }
- this.tableData = data;
- this.copyTableData = data;
- this.tabLoading = false;
- this.timeSortFn()
- })
- .catch(error => {
- this.tabLoading = false;
- console.log(error);
- });
- },
- // 点击评分
- lookScore(val) {
- this.digLoading = true;
- // console.log("valvalvalval", val);
- // 重置自评分,二级指标个数
- this.DigSelfSco = 0;
- this.twoTarget = 0;
- this.digType = this.pType;
- this.digTid = val.id;
- this.diaSco = true;
- this.digUserid = val.userid;
- this.disTeaClass = val.tea;
- if(val.timeValue){
- this.timeSortList = JSON.parse(val.timeValue)
- }
- this.cutPerson();
- this.getPageBase();
- },
- // 获取教研室
- getTeaList() {
- let params = {
- oid: this.oid
- };
- this.ajax
- .get(this.$store.state.api + "selectTeacherOfficeBySchool", params)
- .then(res => {
- // return console.log("this.TeachingOptions", res.data[0]);
- let data = res.data[0];
- let dataCopy = [];
- data.forEach(e => {
- if(e.parentid == '6'){
- let a = {};
- a.value = e.name;
- a.text = e.name;
- dataCopy.push(a);
- }
- });
- data.forEach(e => {
- if(e.parentid == '6'){
- let a = {};
- a.id = e.id;
- a.name = e.name;
- this.TeaList.push(a);
- }
- });
- this.TeachingOptions = dataCopy;
- // console.log("this.TeachingOptions", this.TeachingOptions);
- })
- .catch(err => {
- console.error(err);
- });
- },
- // 撤回
- withdraw(id) {
- let params = [
- {
- tid: id
- }
- ];
- this.$confirm("是否确认退回?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: " info"
- })
- .then(() => {
- this.ajax
- .post(this.$store.state.api + "updateExamineState", params)
- .then(res => {
- this.getData();
- })
- .catch(error => {
- console.log(error);
- });
- })
- .catch(() => {
- // this.$message({
- // type: "info",
- // message: "已取消退回"
- // });
- });
- },
- recordBtn(val) {
- this.RecordList = [];
- this.recordVisible = true;
- this.getRecordData(val);
- },
- // 查看记录
- getRecordData(val) {
- let params = {
- tid: val,
- type: this.pType
- };
- this.ajax
- .get(this.$store.state.api + "selectExamineOperateRecord", params)
- .then(res => {
- // console.log(res.data[0]);
- this.RecordList = res.data[0];
- })
- .catch(err => {
- console.error(err);
- });
- },
- recordHandleClose(done) {
- done();
- },
- // 提醒
- remindExamine() {
- this.remDig = true;
- },
- // 下载excel
- getExcel() {
- var res = this.tableData;
- // console.log('导出数据',res);
- //如果value的json字段的key值和想要的headers值不一致时,可做如下更改
- //将和下面的Object.fromEntries结合,将json字段的key值改变为要求的excel的header值
- var array = [];
- for (var i = 0; i < res.length; i++) {
- var _json = {};
- _json["教师姓名"] = res[i].username;
- _json["教师账号"] = res[i].eName;
- _json["所属教研室"] = res[i].tea;
- _json["考核进度"] = `${res[i].step}/${res[i].allStep}`;
- _json["自评分数"] = res[i].evaSca;
- _json["考核分数"] = res[i].cogSco;
- array.push(_json);
- }
- var XLSX = require("xlsx");
- const workbook = XLSX.utils.book_new(); //创建一个新的工作簿对象
- let ws = XLSX.utils.json_to_sheet(array); //将json对象数组转化成工作表
- ws["!cols"] = [
- //设置每一列的宽度
- { wch: 20 },
- { wch: 30 },
- { wch: 30 },
- { wch: 30 },
- { wch: 30 },
- { wch: 30 }
- ];
- XLSX.utils.book_append_sheet(workbook, ws, "sheet1"); //把sheet添加到workbook里,第三个参数是sheet名
- XLSX.writeFile(workbook, "教师发展.xlsx");
- // const wopts = { bookType: "xlsx", bookSST: false, type: "array" };//写入的样式bookType:输出的文件类型,type:输出的数据类型,bookSST: 是否生成Shared String Table,官方解释是,如果开启生成速度会下降,但在低版本IOS设备上有更好的兼容性
- // const wbout = XLSX.write(workbook, wopts);// 浏览器端和node共有的API,实际上node可以直接使用xlsx.writeFile来写入文件,但是浏览器没有该API
- // FileSaver.saveAs(new Blob([wbout], { type: "application/octet-stream" }), `${title} demo.xlsx`);//保存文件
- this.$message({
- message: "导出成功",
- type: "success"
- });
- },
- // 按照数字大小排序 方法-
- sortCogMethod(before, after) {
- return Number(before.cogSco) - Number(after.cogSco);
- },
- sortEvaMethod(before, after) {
- return Number(before.evaSca) - Number(after.evaSca);
- },
- // 教研室筛选
- filterTea(value, row, column) {
- // console.log(value, row, column);
- const property = column["property"];
- return row[property].includes(value);
- },
- // 是否完成筛选
- filterExa(value, row, column) {
- // console.log(value, row, column);
- const property = column["property"];
- return row[property] == value;
- },
- // ----------------
- // 保存修改
- saveTab(id) {
- let a = { sco2: 0, cogSum: "" };
- let b = { sco2: 0, cogSum: "" };
- this.PageBaseData.forEach(e => {
- e.children.forEach(i => {
- if (i.id == id) {
- a.sco2 = i.sco2;
- a.cogSum = i.cogSum;
- }
- });
- });
- this.PageBaseDataTwo.forEach(e => {
- e.children.forEach(i => {
- if (i.id == id) {
- b.sco2 = i.sco2;
- b.cogSum = i.cogSum;
- }
- });
- });
- console.log(a, b, id);
- if (
- a.sco2 == b.sco2 &&
- JSON.stringify(a.cogSum) === JSON.stringify(b.cogSum)
- )
- return;
- let PageBaseDataCopy = JSON.parse(JSON.stringify(this.PageBaseData));
- for (const e of PageBaseDataCopy) {
- for (const k of e.children) {
- if (k.testid.test.length > 0) {
- k.testid.test = k.testid.test.map(item => item.courseId);
- }
- }
- }
- let params = [
- {
- uid: this.userid,
- tid: this.digTid,
- typ: this.pType,
- // json: JSON.stringify(PageBaseDataCopy)
- json: JSON.stringify(PageBaseDataCopy),
- rjson: JSON.stringify({
- rjson: PageBaseDataCopy,
- text: `按人员,进行修改`
- })
- }
- ];
- console.log("params",params[0])
- // return console.log(params);
- this.ajax
- .post(this.$store.state.api + "updateExamineCogDataCopy", params)
- .then(res => {
- // console.log("updateExamineCogDataCopy", res);
- // this.CopDigSco();
- this.getDigData();
- })
- .catch(error => {
- console.log(error);
- });
- },
- // 查看数据来源
- lookUserPrize(cid) {
- // return console.log(val);
- if (this.tableData.length <= 0)
- return this.$message.error("暂无人员提交");
- // this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?cid=${val}&oid=${this.oid}&org=${this.org}&type=2&role=0&peopleId=${this.userid}`;
- if(this.timeSortList){
- let timeValue = this.timeSortList.time
- this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?userid=${this.userid}&cid=${cid}&oid=${this.oid}&org=${this.org}&type=2&role=0&peopleId=${this.digUserid}&timeLimit=${timeValue}&review=1&disableBack=true`;
- }else{
- this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?userid=${this.userid}&cid=${cid}&oid=${this.oid}&org=${this.org}&type=2&role=0&peopleId=${this.digUserid}&review=1&disableBack=true`;
- }
- // this.ifmUrl = `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/test?userid=${this.userid}&oid=45facc0a-1211-11ec-80ad-005056b86db5&org=&role=0`;
- this.diaIframe = true;
- },
- // 弹框方法切换专任,班主任
- cutPage(e) {
- this.digType = e;
- this.digLoading = true;
- // this.getDataDig();
- },
- // 弹框内班主任与专任教师切换,刷新tableData数据
- getDataDig() {
- let params = {
- oid: this.oid,
- org: this.org,
- type: this.digType
- };
- // console.log(params);
- this.ajax
- .get(this.$store.state.api + "selectTestExamineSecondData", params)
- .then(res => {
- let data = res.data[0];
- this.tableData = data;
- // 这一步是为了获取弹窗表单第一个人,如果为空的话就清空数据
- if (this.tableData.length > 0) {
- this.DigSelfSco = 0; //弹框自评分
- this.twoTarget = 0; //二级指标个数
- this.digTid = this.tableData[0].id; //表单id
- // this.diaSco = true;
- this.digUserid = this.tableData[0].userid; //弹框tableData数组中第一个数据userid
- this.disTeaClass = this.tableData[0].tea; //弹框tableData数组中第一个数据教研室
- // 判断所处数组第几位,方便后面上下切换
- this.cutPerson();
- // 获取基础模版,重新开始渲染数据
- this.getPageBase();
- } else {
- // 切换后tableData里没有数据的话将,自评分什么的清空
- this.getPageBase2();
- }
- // console.log("this.tableData", this.tableData);
- })
- .catch(error => {
- console.log(error);
- });
- },
- // 弹框切换上一个教师
- upTea() {
- if (this.cutTeaNum <= 0) return this.$message.error("已经是第一个了");
- this.digLoading = true;
- this.cutTeaNum--;
- this.digUsername = this.copyTableData[this.cutTeaNum].username;
- this.disTeaClass = this.copyTableData[this.cutTeaNum].tea;
- this.digUserid = this.copyTableData[this.cutTeaNum].userid;
- this.digTid = this.copyTableData[this.cutTeaNum].id;
- this.getPageBase();
- },
- // 弹框切换下一个教师
- nextTea() {
- // console.log("this.tableData", this.tableData);
- if (this.cutTeaNum + 1 >= this.copyTableData.length)
- return this.$message.error("已经是最后一个了");
- this.digLoading = true;
- this.cutTeaNum++;
- this.digUsername = this.copyTableData[this.cutTeaNum].username;
- this.disTeaClass = this.copyTableData[this.cutTeaNum].tea;
- this.digUserid = this.copyTableData[this.cutTeaNum].userid;
- this.digTid = this.copyTableData[this.cutTeaNum].id;
- this.getPageBase();
- },
- // 弹框专任与班主任切换数据为空时,将表单清空
- getPageBase2() {
- let params = {
- typ: this.digType,
- org: this.org,
- oid: this.oid
- };
- this.ajax
- .get(this.$store.state.api + "selectTestExamineBase", params)
- .then(res => {
- // console.log("selectTestExamineBase", res.data[0][0]);
- this.DigSelfSco = 0;
- this.twoTarget = 0;
- this.digTid = "";
- this.digUserid = "";
- this.disTeaClass = "";
- this.digUsername = "暂无提交";
- this.PageBaseData = JSON.parse(res.data[0][0].json);
- // 处理数据来源
- this.handleData();
- this.digLoading = false;
- })
- .catch(error => {
- console.log(error);
- });
- },
- // 弹框获取页面基础ui信息
- getPageBase() {
- let params = {
- typ: this.digType,
- org: this.org,
- oid: this.oid
- };
- this.ajax
- .get(this.$store.state.api + "selectTestExamineBase", params)
- .then(res => {
- // console.log("selectTestExamineBase", res.data[0][0]);
- this.PageBaseData = JSON.parse(res.data[0][0].json);
- this.PageBaseDataTwo = JSON.parse(res.data[0][0].json);
- // 处理数据来源
- this.handleData();
- // 先获取基础模板,然后再获取用户又没有填写过,填写过就开始循环赋值给基础模板,最后提交基础模板
- this.getDigData();
- })
- .catch(error => {
- console.log(error);
- });
- },
- // 弹框获取页面渲染数据
- getDigData() {
- let params = {
- uid: this.digUserid,
- type: this.digType
- };
- this.ajax
- .get(this.$store.state.api + "getTestExamineByUserId", params)
- .then(res => {
- console.log("getTestExamineByUserId", res);
- if (res.data[0].length > 0) {
- let _data = res.data[0].find(i=>i.id==this.digTid)
- if(_data){
- let val = JSON.parse(_data.json);
- this.PageBaseData.forEach(e => {
- val.forEach(i => {
- if (e.id == i.id) {
- e.children.forEach(a => {
- i.children.forEach(b => {
- if (a.id == b.id) {
- a.sco1 = b.sco1;
- a.sco2 = b.sco2;
- a.cogSum = b.cogSum;
- a.selfSummary = b.selfSummary;
- }
- });
- });
- }
- });
- });
- this.PageBaseDataTwo = val;
- // 弹框计算自评分数,与二级指标个数
- this.getTwoRigData();
- }
- } else {
- // 清空自评分数,与二级指标个数
- this.DigSelfSco = 0;
- this.twoTarget = 0;
- }
- this.digLoading = false;
- })
- .catch(error => {
- console.log(error);
- });
- },
- // 弹框计算自评分数,与二级指标个数
- getTwoRigData() {
- this.DigSelfSco = 0;
- this.twoTarget = 0;
- // 计算自评分数,与二级指标个数
- this.PageBaseData.forEach(e => {
- e.children.forEach(i => {
- this.DigSelfSco += i.sco1 * 1;
- this.twoTarget++;
- });
- });
- this.DigSelfSco = this.DigSelfSco.toFixed(2);
- },
- // 获取用户列表位置,以及用户名称
- cutPerson() {
- this.tableData.forEach((e, index) => {
- if (e.userid == this.digUserid) {
- this.cutTeaNum = index;
- this.digUsername = e.username;
- }
- });
- },
- // 评分关闭弹框
- handleClose(done) {
- this.timeSortList = [];
- this.getData();
- done();
- },
- // 数据来源关闭弹框
- handleClose2(done) {
- this.digLoading = true;
- this.getPageBase();
- done();
- },
- // handleClose3(done) {
- // done();
- // },
- // 处理数据来源
- async handleData() {
- for (const e of this.PageBaseData) {
- for (const k of e.children) {
- if (k.testid.test.length > 0) {
- k.testid.test = await this.computedTest(k.testid.test);
- }
- }
- }
- },
- // 处理数据来源
- computedTest(val,uid='',timeSortList=this.timeSortList) {
- let params = [
- {
- uid: uid?uid:this.digUserid,
- testId: val.join(",")
- }
- ];
- let _fnStr = `selectExamineTestName`
- console.log("this.timeSortList",timeSortList)
- if(timeSortList && timeSortList.time && timeSortList.time.length>0){
- const timeValue = timeSortList.time;
- params[0].startTime = timeValue[0];
- params[0].endTime = timeValue[1];
- _fnStr = `selectExamineTestNameFilterTime`
- }
- return new Promise(resolve => {
- this.ajax
- .post(this.$store.state.api + _fnStr, params)
- .then(res => {
- let _data = res.data[0];
- _data.forEach(i=>{
- if(i.num>0){
- if(i.num==i.isReviewNum){
- i.status = 1;
- }else{
- i.status = 2;
- }
- }else{
- i.status = 0;
- }
- })
- console.log("_data",_data)
- resolve(_data);
- })
- .catch(error => {
- console.log(error);
- });
- });
- },
- //时间筛选
- timeSortFn(){
- console.log("timeSortFn",this.timeA,this.timeB)
- if(this.pType == 1 && this.timeA){
- this.copyTableData = this.tableData.filter(i=>i.time == this.timeA)
- }else if(this.pType == 2 && this.timeB){
- this.copyTableData = this.tableData.filter(i=>i.time == this.timeB)
- }
- },
- //保存按钮
- saveBtn(){
- let PageBaseDataCopy = JSON.parse(JSON.stringify(this.PageBaseData));
- for (const e of PageBaseDataCopy) {
- for (const k of e.children) {
- if (k.testid.test.length > 0) {
- k.testid.test = k.testid.test.map(item => item.courseId);
- }
- }
- }
- let params = [
- {
- uid: this.userid,
- tid: this.digTid,
- typ: this.pType,
- // json: JSON.stringify(PageBaseDataCopy)
- json: JSON.stringify(PageBaseDataCopy),
- rjson: JSON.stringify({
- rjson: PageBaseDataCopy,
- text: `按人员,进行修改`
- })
- }
- ];
- // return console.log(params);
- this.ajax
- .post(this.$store.state.api + "updateExamineCogDataCopy", params)
- .then(res => {
- // console.log("updateExamineCogDataCopy", res);
- // this.CopDigSco();
- this.getDigData();
- this.$message.success("保存成功")
- })
- .catch(error => {
- console.log(error);
- });
- }
- }
- };
- </script>
- <style scoped>
- .personPage >>> .el-table tr {
- height: 70px;
- }
- .digUsernameCss {
- width: 70px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .recordDig >>> .el-dialog {
- height: 600px;
- width: 500px !important;
- }
- .remFlex {
- display: flex;
- justify-content: flex-start;
- margin-bottom: 20px;
- }
- .remFlexTit {
- width: 80px;
- flex-shrink: 0;
- }
- .digTop {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin: 15px 0;
- }
- .TabBtn {
- cursor: pointer;
- color: #528df6;
- margin: 0 10px;
- }
- .dialog_remDig >>> .el-dialog {
- height: 700px;
- margin: 0 auto !important;
- margin-top: 20px !important;
- overflow: hidden;
- min-width: 800px !important;
- }
- .dialog_remDig >>> .el-dialog__header {
- background: #454545 !important;
- padding: 15px 20px;
- }
- .dialog_diy >>> .el-dialog {
- height: 95%;
- margin: 0 auto !important;
- margin-top: 20px !important;
- overflow: hidden;
- min-width: 800px !important;
- }
- .dialog_diy >>> .el-dialog__header {
- background: #454545 !important;
- padding: 25px 20px;
- }
- .dialog_diy >>> .el-dialog__body {
- height: calc(100% - 50px);
- box-sizing: border-box;
- padding: 0px;
- }
- .dialog_diy >>> .el-dialog__title {
- color: #fff;
- }
- .dialog_diy >>> .el-dialog__headerbtn {
- top: 19px;
- }
- .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
- color: #fff;
- }
- .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
- color: #fff;
- }
- .dialog_diy >>> .el-dialog__body,
- .dialog_diy >>> .el-dialog__footer {
- background: #fafafa;
- }
- .ScoreStep {
- height: 100%;
- width: 100%;
- }
- .ScoreStep > input {
- height: 100% !important;
- outline-style: none;
- padding: 5px;
- width: 100%;
- text-align: center;
- box-sizing: border-box;
- border-radius: 4px;
- border: none !important;
- /* border: 1px solid #dcdfe6 !important; */
- }
- .ScoreStep >>> .el-input-number {
- height: 100% !important;
- }
- .ScoreStep >>> .el-input {
- height: 100% !important;
- }
- .ScoreStep >>> .el-input__inner {
- height: 100%;
- padding-left: 15px;
- border: none;
- padding-right: 15px;
- }
- .testPersonExamine {
- width: 100%;
- min-width: calc(50px * 10);
- height: 100%;
- padding: 10px;
- display: flex;
- flex-direction: column;
- /* overflow: auto; */
- box-sizing: border-box;
- background-color: #fff;
- }
- .tArea {
- width: 100%;
- height: 100%;
- padding: 5px;
- box-sizing: border-box;
- display: block !important;
- text-align: left;
- }
- .testPersonExamine > .testTit {
- height: 100px;
- display: flex;
- padding: 15px 0;
- justify-content: space-between;
- align-items: center;
- }
- .teaLis {
- display: flex;
- }
- .teal {
- padding: 10px 20px;
- cursor: pointer;
- }
- .Tbor {
- border-bottom: 2px rgba(54, 129, 252, 1) solid;
- font-weight: 600;
- }
- .testCon {
- box-sizing: border-box;
- padding: 20px;
- }
- .orgData {
- cursor: pointer;
- color: #528df6;
- margin-bottom: 10px;
- }
- .sBox_table {
- width: 100%;
- min-width: 1500px;
- height: 100%;
- margin: 0 auto;
- /* min-width: 1520px; */
- font-size: 14px;
- }
- .table_title {
- width: calc(100% - 6px);
- /* min-width: calc(100px * 9); */
- height: 50px;
- background: #e0eafb;
- border: 1px solid #d5d8df;
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- align-items: center;
- }
- /* 取消[type='number']的input的上下箭头 */
- input::-webkit-inner-spin-button {
- -webkit-appearance: none !important;
- }
- input::-webkit-outer-spin-button {
- -webkit-appearance: none !important;
- }
- input[type="number"] {
- -moz-appearance: textfield;
- }
- .table_title > div {
- /* width: calc(100% / 9); */
- /* min-width: 110px; */
- text-align: center;
- box-sizing: border-box;
- height: 100%;
- line-height: 50px;
- border-right: 1px solid #d5d8df;
- }
- .table_title > div:last-child {
- border: none;
- }
- .table_Content {
- width: 100%;
- min-width: calc(100px * 9);
- /* border: 1px solid #d5d8df; */
- border: none;
- display: flex;
- flex-direction: row;
- flex-wrap: nowrap;
- text-align: center;
- align-items: center;
- }
- .twoCol {
- width: 100%;
- display: flex;
- }
- .ColTit {
- width: 150px !important;
- display: flex;
- justify-content: center;
- align-items: center;
- border-bottom: 1px #ccc solid;
- }
- .twoCon {
- display: flex;
- }
- .twoCon > div > input {
- border: none;
- width: 100%;
- height: 100%;
- outline-style: none;
- text-align: center;
- }
- .twoCon {
- display: flex;
- width: 100%;
- }
- .twoCon > div > textarea {
- border: none;
- width: 100%;
- height: 100%;
- resize: none;
- box-sizing: border-box;
- padding: 5px;
- outline-style: none;
- }
- .twoCon > div {
- /* width: 10%; */
- /* min-width: 110px; */
- min-height: 50px;
- /* line-height: 50px; */
- display: flex;
- box-sizing: border-box;
- justify-content: center;
- align-items: center;
- border-left: 1px #ccc solid;
- border-bottom: 1px #ccc solid;
- }
- .twoCon > div:nth-child(1) {
- width: 160px !important;
- }
- .twoCon > div:nth-child(2) {
- width: 160px !important;
- line-height: 20px;
- }
- .twoCon > div:nth-child(3) {
- width: 110px !important;
- }
- .twoCon > div:nth-child(4) {
- width: 110px !important;
- }
- .twoCon > div:nth-child(5) {
- flex: 1;
- }
- .twoCon > div:nth-child(6) {
- width: 250px !important;
- }
- .twoCon > div:nth-child(7) {
- width: 110px !important;
- }
- .twoCon > div:nth-child(8) {
- flex: 1;
- }
- .ColCon {
- flex: 1;
- }
- .scoreBox{
- display: flex;
- align-items: center;
- }
- .scoreBox > span:nth-child(1){
- max-width: 100px;
- width: 100px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- text-align: right;
- }
- .scoreBox > span:nth-child(2){
- margin-left: 10px;
- }
- .taskArea{
- display: flex;
- justify-content: center;
- }
- .task_0{
- padding: 6px 20px;
- background: #FEF5EC;
- border: solid 1px #FAD0A1;
- color: #F7933B;
- border-radius: 4px;
- }
- .task_1{
- padding: 6px 20px;
- background: #E6F9EA;
- border: solid 1px #A6E9B6;
- color: #21ba45;
- border-radius: 4px;
- }
- </style>
|