12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
- <el-form-item :label="$t('姓名')" prop="name">
- <el-input
- v-model="queryParams.name"
- :placeholder="$t('请输入') + $t('姓名')"
- clearable
- size="small"
- @input="handleQuery"
- />
- </el-form-item>
- <el-form-item :label="$t('员工号')" prop="employeeid" label-width="50">
- <el-input
- v-model="queryParams.employeeid"
- :placeholder="$t('请输入') + $t('员工号')"
- clearable
- size="small"
- @input="handleQuery"
- />
- </el-form-item>
- <el-form-item :label="$t('班值')" prop="classes">
- <el-select v-model="queryParams.classes" @change="handleQuery" :placeholder="$t('请选择') + $t('班值')" clearable size="small">
- <el-option
- v-for="dict in classesOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('入职')" prop="onboard">
- <el-select v-model="queryParams.onboard" @change="handleQuery" :placeholder="$t('请选择') + $t('入职')" clearable size="small">
- <el-option
- v-for="dict in onboardOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="TDS" prop="tds">
- <el-select v-model="queryParams.tds" @change="handleQuery" :placeholder="$t('请选择')+'TDS'" clearable size="small">
- <el-option
- v-for="dict in tdsOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('上岗证复证')" prop="postCard">
- <el-select v-model="queryParams.postCard" @change="handleQuery" :placeholder="$t('请选择') + $t('上岗证复证')" clearable size="small">
- <el-option
- v-for="dict in postCardOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('工艺培训')" prop="craft">
- <el-select v-model="queryParams.craft" @change="handleQuery" :placeholder="$t('请选择') + $t('工艺培训')" clearable size="small">
- <el-option
- v-for="dict in craftOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('公司级培训')" prop="company">
- <el-select v-model="queryParams.company" @change="handleQuery" :placeholder="$t('请选择') + $t('公司级培训')" clearable size="small">
- <el-option
- v-for="dict in companyOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('装置级培训')" prop="device">
- <el-select v-model="queryParams.device" @change="handleQuery" :placeholder="$t('请选择') + $t('装置级培训')" clearable size="small">
- <el-option
- v-for="dict in deviceOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- icon="el-icon-time"
- size="mini"
- @click="handleTime"
- >{{ $t('人员培训时长') }}</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- icon="el-icon-tickets"
- size="mini"
- @click="handleCompany"
- >{{ $t('公司级培训记录') }}</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="info"
- icon="el-icon-document"
- size="mini"
- @click="handleDevice"
- >{{ $t('装置级培训记录') }}</el-button>
- </el-col>
- <!--<el-col :span="1.5">
- <el-button
- type="danger"
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['training:trainingrecords:remove']"
- >{{ $t('删除') }}</el-button>
- </el-col>-->
- <!-- <el-col :span="1.5">
- <el-button
- type="info"
- icon="el-icon-upload2"
- size="mini"
- @click="handleImport"
- v-hasPermi="['training:trainingrecords:edit']"
- >{{ $t('导入') }}</el-button>
- </el-col>--><!-- <el-col :span="1.5">
- <el-button
- type="info"
- icon="el-icon-upload2"
- size="mini"
- @click="handleImport"
- v-hasPermi="['training:trainingrecords:edit']"
- >{{ $t('导入') }}</el-button>
- </el-col>-->
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['training:trainingrecords:export']"
- >{{ $t('导出') }}</el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-loading="loading" :data="trainingrecordsList" @selection-change="handleSelectionChange" :cell-style="tableCellStyle" @sort-change="sortChange" :height="clientHeight" border>
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column :label="$t('姓名')" align="center" prop="name" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('员工号')" align="center" prop="employeeid" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('班值')" align="center" prop="classes" :formatter="classesFormat" />
- <el-table-column :label="$t('入职')" align="center" prop="onboard" :formatter="onboardFormat" >
- <template slot-scope="scope">
- <span> {{onboardFormat(scope.row)}}</span>
- <el-button icon="el-icon-folder" style="color:#6e96fa;" v-if="scope.row.onboard !== '3'" @click="handleDoc(scope.row , 'trainingrecords-onbord')" circle></el-button>
- </template>
- </el-table-column>
- <el-table-column label="TDS" align="center" prop="tds" :formatter="tdsFormat">
- <template slot-scope="scope">
- <span> {{tdsFormat(scope.row)}}</span>
- <el-button icon="el-icon-folder" style="color:#6e96fa;" v-if="scope.row.tds !== '3'" @click="handleDoc(scope.row , 'trainingrecords-tds')" circle></el-button>
- </template>
- </el-table-column>
- <el-table-column :label="$t('上岗证复证')" align="center" prop="postCard" :formatter="postCardFormat">
- <template slot-scope="scope">
- <span> {{postCardFormat(scope.row)}}</span>
- <el-button icon="el-icon-folder" style="color:#6e96fa;" v-if="scope.row.postCard !== '3'" @click="openWorklicense(scope.row)" circle></el-button>
- <!--<el-button icon="el-icon-folder" v-if="scope.row.postCard !== '3'" @click="handleDoc(scope.row , 'trainingrecords-postCard')" circle></el-button>-->
- </template>
- </el-table-column>
- <el-table-column :label="$t('工艺培训')" align="center" prop="craft" :formatter="craftFormat">
- <template slot-scope="scope">
- <span> {{craftFormat(scope.row)}}</span>
- <el-button icon="el-icon-folder" style="color:#6e96fa;" v-if="scope.row.craft !== '3'" @click="handleDoc(scope.row , 'trainingrecords-craft')" circle></el-button>
- </template>
- </el-table-column>
- <el-table-column :label="$t('公司级培训')" align="center" prop="company" :formatter="companyFormat">
- <template slot-scope="scope">
- <span> {{companyFormat(scope.row)}}</span>
- <el-button icon="el-icon-folder" style="color:#6e96fa;" v-if="scope.row.company !== '3'" @click="openCompany(scope.row)" circle></el-button>
- </template>
- </el-table-column>
- <el-table-column :label="$t('装置级培训')" align="center" prop="device" :formatter="deviceFormat">
- <template slot-scope="scope">
- <span> {{deviceFormat(scope.row)}}</span>
- <el-button icon="el-icon-folder" style="color:#6e96fa;" v-if="scope.row.device !== '3'" @click="openDevice(scope.row)" circle></el-button>
- </template>
- </el-table-column>
- <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['training:trainingrecords:edit']"
- >{{ $t('修改') }}</el-button>
- <!--<el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['training:trainingrecords:remove']"
- >{{ $t('删除') }}</el-button>-->
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改培训成绩对话框 -->
- <el-dialog v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
- <el-form-item :label="$t('装置名称')" prop="plantCode">
- <el-select v-model="form.plantCode" :placeholder="$t('请选择') + $t('装置名称')">
- <el-option
- v-for="dict in plantCodeOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('姓名')" prop="name">
- <el-input v-model="form.name" :placeholder="$t('请输入') + $t('姓名')" />
- </el-form-item>
- <el-form-item :label="$t('员工号')" prop="employeeid">
- <el-input v-model="form.employeeid" :placeholder="$t('请输入') + $t('员工号')" />
- </el-form-item>
- <el-form-item :label="$t('班值')" prop="classes">
- <el-select v-model="form.classes" :placeholder="$t('请选择') + $t('班值')">
- <el-option
- v-for="dict in classesOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('入职')" prop="onboard">
- <el-select v-model="form.onboard" :placeholder="$t('请选择') + $t('入职')">
- <el-option
- v-for="dict in onboardOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="TDS" prop="tds">
- <el-select v-model="form.tds" :placeholder="$t('请选择') + 'TDS'">
- <el-option
- v-for="dict in tdsOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('上岗证复证')" prop="postCard">
- <el-select v-model="form.postCard" :placeholder="$t('请选择') + $t('上岗证复证')">
- <el-option
- v-for="dict in postCardOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('工艺培训')" prop="craft">
- <el-select v-model="form.craft" :placeholder="$t('请选择') + $t('工艺培训')">
- <el-option
- v-for="dict in craftOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('公司级培训')" prop="company">
- <el-select v-model="form.company" :placeholder="$t('请选择') + $t('公司级培训')">
- <el-option
- v-for="dict in companyOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('装置级培训')" prop="device">
- <el-select v-model="form.device" :placeholder="$t('请选择') + $t('装置级培训')">
- <el-option
- v-for="dict in deviceOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('备注')" prop="remarks">
- <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
- </el-form-item>
- <el-form-item :label="$t('归属部门')" prop="deptId">
- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :placeholder="$t('请选择') + $t('归属部门')" />
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
- <el-button @click="cancel">{{ $t('取 消') }}</el-button>
- </div>
- </el-dialog>
- <!-- 用户导入对话框 -->
- <el-dialog v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
- <el-upload
- ref="upload"
- :limit="1"
- accept=".xlsx, .xls"
- :headers="upload.headers"
- :action="upload.url"
- :disabled="upload.isUploading"
- :on-progress="handleFileUploadProgress"
- :on-success="handleFileSuccess"
- :auto-upload="false"
- drag
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- {{ $t('将文件拖到此处,或') }}
- <em>{{ $t('点击上传') }}</em>
- </div>
- <div class="el-upload__tip" slot="tip">
- <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
- <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
- </div>
- <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
- <input name="type" :value="upload.type" hidden />
- </form>
- <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
- </el-upload>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
- <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
- </div>
- </el-dialog>
- <!-- 公司级培训跟踪矩阵对话框 -->
- <el-dialog v-dialogDrag :title="companyTrainingTitle" :visible.sync="companyTrainingOpen" width="1400px" append-to-body @close="closeDialog()">
- <div>
- <svg-icon icon-class="rectangleGreen" class="rectangleGreen"></svg-icon>
- <span>{{ $t('需参加培训,已经完成培训人员') }}</span>
- <svg-icon icon-class="rectanglered" class="rectangleRed"></svg-icon>
- <span style="line-height: 40px">{{ $t('需参加培训,尚未进行培训人员') }}</span>
- </div>
- <el-table v-if="tableShow" border :data="companylevelList"
- v-loading="companyTrainingLoad"
- class="companyLevelTable" height="600px" border
- :span-method="colspanMethod"
- :cell-class-name="tableCellClassName"
- :row-style="{height:'40px'}"
- ref="companyTable"
- >
- <el-table-column :label="$t('课程代码')" align="center" width="120" fixed>
- <template slot-scope="scope">
- {{scope.row[0]}}
- </template>
- </el-table-column>
- <el-table-column :label="$t('公司级') + $t('空格') +$t('培训课程') + $t('空格') + $t('名称')" align="center" width="350" fixed>
- <template slot-scope="scope">
- {{scope.row[1]}}
- </template>
- </el-table-column>
- <el-table-column :label="$t('频率')" align="center" width="120" fixed>
- <template slot-scope="scope">
- {{scope.row[2]}}
- </template>
- </el-table-column>
- <el-table-column v-for="(item, index) in transTitle" width="150" :label="item.actualpost" :key="index" align="center">
- <el-table-column width="150" :label="item.name" :key="index" align="center">
- <template slot-scope="scope">
- {{scope.row[index + 3]}}
- </template>
- </el-table-column>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!-- 装置级培训跟踪矩阵对话框 -->
- <el-dialog v-dialogDrag :title="deviceTrainingTitle" :visible.sync="deviceTrainingOpen" width="1400px" append-to-body @close="closeDialog()">
- <el-form :model="deviceParams" ref="deviceParamsForm" label-width="68px" :inline="true">
- <el-form-item :label="$t('年份')" prop="year">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="deviceParams.year"
- type="year"
- value-format="yyyy"
- :placeholder="$t('请选择')+$t('年份')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('培训类型')" prop="trainingType">
- <el-select v-model="deviceParams.trainingType" :placeholder="$t('请选择') + $t('培训类型')" clearable size="small">
- <el-option
- v-for="dict in trainingTypeOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleDeviceQuery" style="margin-left: 20px;">{{ $t('搜索') }}</el-button>
- <el-row style="text-align: right">
- <svg-icon icon-class="rectangleGreen" class="rectangleGreen"></svg-icon>
- <span>{{ $t('需参加培训,已经完成培训人员') }}</span>
- <svg-icon icon-class="rectanglered" class="rectangleRed"></svg-icon>
- <span style="line-height: 40px">{{ $t('需参加培训,尚未进行培训人员') }}</span>
- </el-row>
- </el-form>
- <el-table v-if="tableShow" border :data="devicelevelList"
- v-loading="deviceTrainingLoad"
- class="companyLevelTable" height="600px" border
- :span-method="colspanDeviceMethod"
- :cell-class-name="tableCellClassName"
- :row-style="{height:'40px'}"
- ref="deviceTable"
- >
- <el-table-column :label="$t('课程代码')" align="center" width="100" fixed>
- <template slot-scope="scope">
- {{scope.row[0]}}
- </template>
- </el-table-column>
- <el-table-column :label="$t('装置级') +$t('空格') + $t('培训课程')+$t('空格') + $t('名称')" align="center" width="250" fixed>
- <template slot-scope="scope">
- {{scope.row[1]}}
- </template>
- </el-table-column>
- <el-table-column v-for="(item, index) in transTitle" width="150" :label="item.actualpost" :key="index" align="center">
- <el-table-column width="150" :label="item.name" :key="index" align="center">
- <template slot-scope="scope">
- {{scope.row[index + 2]}}
- </template>
- </el-table-column>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!-- 人员培训时长对话框 -->
- <el-dialog v-dialogDrag class="trainingTime" :title="trainingTimeTitle" :visible.sync="trainingTimeOpen" width="700px" append-to-body>
- <el-button type="primary" style="margin-bottom: 10px" @click="exportTrainingTime">{{ $t('导出') }}<i class="el-icon-download el-icon--right"></i></el-button>
- <el-table v-loading="loading" :data="transTitle" height="600px" border>
- <el-table-column :label="$t('员工姓名')" align="center" prop="name" width="300" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('培训时长')" align="center" prop="trainingTime" :show-overflow-tooltip="true"/>
- </el-table>
- </el-dialog>
- <!-- 上岗证培训列表对话框 -->
- <el-dialog v-dialogDrag :title="worklicenseTitle" :visible.sync="worklicenseOpen" width="800px" append-to-body>
- <el-table v-loading="loading" :data="worklicenseList" border>
- <el-table-column :label="$t('上岗证类型')" align="center" prop="worklicenseType" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('上岗证')+$t('空格')+$t('证件号')" align="center" prop="worklicenseIdnum" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleDoc(scope.row , 'trainingrecords-worklicense' + scope.row.worklicenseType)"
- >{{ $t('附件') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!-- 公司级培训对话框 -->
- <el-dialog v-dialogDrag :title="companyTitle" :visible.sync="companyOpen" width="1400px" append-to-body>
- <el-table v-loading="loading" :data="participantsList" border>
- <el-table-column :label="$t('课程代码')" align="center" prop="courseCode" width="150" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('公司级') + $t('空格') + $t('培训课程') + $t('空格') + $t('名称')" align="center" prop="companyItem" width="400" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('开始日期')" align="center" prop="startDate" width="250">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('结束日期')" align="center" prop="endDate" width="250">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('培训时长')" align="center" prop="trainingDuration" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="participantsHandleDelete(scope.row)"
- v-hasPermi="['training:trainingrecords:remove']"
- >{{ $t('删除') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
- <!-- 装置级培训对话框 -->
- <el-dialog v-dialogDrag :title="deviceTitle" :visible.sync="deviceOpen" width="1400px" append-to-body>
- <el-form :model="queryDeviceParams" ref="queryRegularForm" label-width="68px" :inline="true">
- <el-form-item :label="$t('年份')" prop="year">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="queryDeviceParams.year"
- type="year"
- value-format="yyyy"
- :placeholder="$t('请选择') + $t('年份')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('培训类型')" prop="trainingType">
- <el-select v-model="queryDeviceParams.trainingType" :placeholder="$t('请选择') + $t('培训类型')" clearable size="small">
- <el-option
- v-for="dict in trainingTypeOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- />
- </el-select>
- </el-form-item>
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="staffDeviceQuery" style="margin-left: 20px;">
- {{ $t('搜索') }}</el-button>
- </el-form>
- <el-table v-loading="loading" :data="devicceList" border>
- <el-table-column :label="$t('课程代码')" align="center" prop="courseCode" width="200" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('课程名称')" align="center" prop="item" width="350" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('授课人')" align="center" prop="lecturerName" width="150" :show-overflow-tooltip="true" />
- <el-table-column :label="$t('课时')" align="center" prop="hour" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('开始日期')" align="center" prop="startDate" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.supplementary === '0' && scope.row.trainingType === '10'">{{ parseTime(scope.row.startDate, '{y}-{m}') }}</span>
- <span v-else>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
- </el-table>
- </el-dialog>
- <!-- 报告附件对话框 -->
- <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px" append-to-body >
- <el-upload v-hasPermi="['training:trainingrecords:file']"
- ref="doc"
- :limit="50"
- :headers="doc.headers"
- :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
- :disabled="doc.isUploading"
- :on-progress="handleFileDocProgress"
- :on-success="handleFileDocSuccess"
- :auto-upload="true"
- drag
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- {{ $t('将文件拖到此处,或') }}
- <em>{{ $t('点击上传') }}</em>
- </div>
- </el-upload>
- <el-table :data="doc.commonfileList" border>
- <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
- <template slot-scope="scope">
- <a class="link-type" @click="handleDownload(scope.row)">
- <span>{{ scope.row.fileName }}</span>
- </a>
- </template>
- </el-table-column>
- <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
- <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
- <el-table-column :label="$t('培训日期')" align="center" prop="pDate" width="150">
- <template slot-scope="scope">
- <el-date-picker
- v-if="scope.row.isEdit"
- v-model="scope.row.pDate"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('日期')">
- </el-date-picker>
- <span v-else>{{ parseTime(scope.row.pDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.fileName.endsWith('pdf')"
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleSee(scope.row)"
- >{{ $t('预览') }}</el-button>
- <el-button v-hasPermi="['training:trainingrecords:file']" type="text" size="small" v-if="scope.row.isEdit" @click="save(scope.row)">{{ $t('保存') }}</el-button>
- <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelFile(scope.row, scope.$index)">{{ $t('取消') }}</el-button>
- <el-button v-hasPermi="['training:trainingrecords:file']" v-if="!scope.row.isEdit" @click="edit(scope.row)" icon="el-icon-edit" type="text" size="mini">{{ $t('编辑') }}</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-download"
- @click="handleDownload(scope.row)"
- >{{ $t('下载') }}</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDeleteDoc(scope.row)"
- v-hasPermi="['training:trainingrecords:file']"
- >{{ $t('删除') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-dialog v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" append-to-body>
- <div style="margin-top: -60px;float: right;margin-right: 40px;">
- <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
- <div style="margin-top: -30px">
- <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
- </div>
- </el-dialog>
- <div slot="footer" class="dialog-footer">
- <!-- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
- <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { listTrainingrecords, getTrainingrecords, delTrainingrecords, addTrainingrecords, updateTrainingrecords, exportTrainingrecords, exportTrainingTime } from "@/api/training/trainingrecords";
- import { listCompanylevel } from "@/api/training/companylevel";
- import { listTraining } from "@/api/training/worklicense";
- import { listParticipants, companyListParticipants, delParticipants } from "@/api/training/participants";
- import { listDevice, deviceListParticipants} from "@/api/training/device";
- import { treeselect } from "@/api/system/dept";
- import { selectTimeStaffmgr } from "@/api/plant/staffmgr";
- import { getToken } from "@/utils/auth";
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import {allFileList, delCommonfile ,updateCommonfile ,addCommonfile} from "@/api/common/commonfile";
- import {addTrainingNon, updateTrainingNon} from "@/api/training/trainingNon";
- export default {
- name: "Trainingrecords",
- components: { Treeselect},
- data() {
- return {
- transTitle: [], // transTitle 该标题为转化后的标题, 注意多一列, 因为原来的标题变成了竖着显示了, 所以多一列标题, 第一个为空即可
- companylevelList: [],
- companylevelListTemp: [],
- devicelevelList: [],
- devicelevelListTemp: [],
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: false,
- // 总条数
- total: 0,
- // 培训成绩表格数据
- trainingrecordsList: [],
- // 人员-公司级培训关系表格数据
- participantsList: [],
- // 人员-装置级培训关系表格数据
- devicceList: [],
- //上岗证培训列表
- worklicenseList: [],
- // 弹出层标题
- title: "",
- companyTitle: "",
- deviceTitle: "",
- companyTrainingTitle: "",
- trainingTimeTitle: "",
- deviceTrainingTitle: "",
- worklicenseTitle: "",
- // 部门树选项
- deptOptions: undefined,
- clientHeight:300,
- // 是否显示弹出层
- open: false,
- companyOpen: false,
- deviceOpen: false,
- companyTrainingOpen: false,
- deviceTrainingOpen: false,
- worklicenseOpen: false,
- companyTrainingLoad: false,
- deviceTrainingLoad: false,
- tableShow: true,
- trainingTimeOpen: false,
- // 装置名称字典
- plantCodeOptions: [],
- // 班值字典
- classesOptions: [],
- // SUB字典
- subOptions: [],
- // 裂解字典
- crackingOptions: [],
- // 热区字典
- hotareaOptions: [],
- // 冷区字典
- coldareaOptions: [],
- // AEU/PGU字典
- aeupguOptions: [],
- // 入职字典
- onboardOptions: [],
- // TDS字典
- tdsOptions: [],
- // 上岗证复证字典
- postCardOptions: [],
- // 工艺培训字典
- craftOptions: [],
- //公司级培训字典
- companyOptions: [],
- //装置级培训字典
- deviceOptions: [],
- // 培训岗位字典
- positionOptions: [],
- //培训类型字典
- trainingTypeOptions: [],
- //点击查看的员工号
- employeeid: '',
- // 用户导入参数
- upload: {
- downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
- //下载模板类型
- type: "trainingrecords",
- // 是否显示弹出层(用户导入)
- open: false,
- // 弹出层标题(用户导入)
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/training/trainingrecords/importData"
- },
- // 报告附件参数
- doc: {
- file: "",
- // 是否显示弹出层(报告附件)
- open: false,
- // 弹出层标题(报告附件)
- title: this.$t('附件'),
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 报告附件上传位置编号
- ids: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
- commonfileList: null,
- queryParams: {
- pId: null,
- pType: 'traning'
- },
- pType: 'traning',
- pId: null,
- form: {}
- },
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 20,
- name: null,
- employeeid: null,
- classes: null,
- sortDate: null,
- sortOrder: null,
- onboard: null,
- tds: null,
- postCard: null,
- craft: null,
- company: null
- },
- //人员表查询参数
- staffmgrQueryParams: {
- units: "10,18,20",
- leftYear: this.getNowTime(),
- },
- queryCompanyParams: {
- staffId: null,
- companyId: null,
- },
- queryDeviceParams: {
- staffId: null,
- regularId: null,
- year: this.getNowTime(),
- trainingType: null
- },
- deviceParams: {
- units: "10,18",
- staffId: null,
- regularId: null,
- year: null,
- trainingType: null
- },
- worklicenseParams: {
- employeeid: null,
- },
- companyQueryParams: {},
- // 表单参数
- form: {},
- pdf : {
- title: '',
- pdfUrl: '',
- numPages: null,
- open: false,
- pageNum: 1,
- pageTotalNum: 1,
- loadedRatio: 0,
- },
- // 表单校验
- rules: {
- plantCode: [
- { required: true, message: this.$t('装置名称') + this.$t('不能为空'), trigger: "change" }
- ],
- year: [
- { required: true, message: this.$t('年份') + this.$t('不能为空'), trigger: "blur" }
- ],
- deptId: [
- { required: true, message: this.$t('部门编号') + this.$t('不能为空'), trigger: "blur" }
- ]
- },
- };
- },
- watch: {
- // 根据名称筛选部门树
- deptName(val) {
- this.$refs.tree.filter(val);
- }
- },
- created() {
- //设置表格高度对应屏幕高度
- this.$nextTick(() => {
- this.clientHeight = (document.body.clientHeight - 80) * 0.8
- })
- this.getList();
- this.getStaffmar();
- this.getTreeselect();
- this.getDicts("PLANT_DIVIDE").then(response => {
- this.plantCodeOptions = response.data;
- });
- this.getDicts("TEAM_DIVIDE").then(response => {
- this.classesOptions = response.data;
- });
- this.getDicts("TICK_CROSS").then(response => {
- this.subOptions = response.data;
- });
- this.getDicts("TICK_CROSS").then(response => {
- this.crackingOptions = response.data;
- });
- this.getDicts("TICK_CROSS").then(response => {
- this.hotareaOptions = response.data;
- });
- this.getDicts("TICK_CROSS").then(response => {
- this.coldareaOptions = response.data;
- });
- this.getDicts("TICK_CROSS").then(response => {
- this.aeupguOptions = response.data;
- });
- this.getDicts("TRAINING_QUALIFY").then(response => {
- this.onboardOptions = response.data;
- });
- this.getDicts("TRAINING_QUALIFY").then(response => {
- this.tdsOptions = response.data;
- });
- this.getDicts("TRAINING_QUALIFY").then(response => {
- this.postCardOptions = response.data;
- });
- this.getDicts("TRAINING_QUALIFY").then(response => {
- this.craftOptions = response.data;
- });
- this.getDicts("TRAINING_QUALIFY").then(response => {
- this.companyOptions = response.data;
- });
- this.getDicts("TRAINING_QUALIFY").then(response => {
- this.deviceOptions = response.data;
- });
- this.getDicts("ACTUALPOST").then(response => {
- this.positionOptions = response.data;
- });
- this.getDicts("TRAINING_TYPE").then(response => {
- this.trainingTypeOptions = response.data;
- });
- },
- methods: {
- colspanMethod({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0) {
- const _row = this.setTable(this.companylevelList).merge[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- if (columnIndex === 1 ) {
- const _row = this.setTable(this.companylevelList).merge[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- if (columnIndex === 2 ) {
- const _row = this.setTable(this.companylevelList).merge[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- },
- colspanDeviceMethod({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 0) {
- const _row = this.setTable(this.devicelevelList).merge[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- if (columnIndex === 1 ) {
- const _row = this.setTable(this.devicelevelList).merge[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- },
- setTable(tableData) {
- let spanArr = [],
- concat = 0;
- tableData.forEach((item, index) => {
- if (index === 0) {
- spanArr.push(1);
- } else {
- if (item[1] === tableData[index - 1][1] && item[0] === tableData[index - 1][0]) {
- //第一列需合并相同内容的判断条件
- spanArr[concat] += 1;
- spanArr.push(0);
- } else {
- spanArr.push(1);
- concat = index;
- }
- }
- });
- return {
- merge: spanArr
- };
- },
- //根据是否存在最后培训时间显示颜色提示
- tableCellClassName({ row, column, rowIndex, columnIndex }) {
- // for (let i = 2; i < this.transTitle.length + 2; i++) {
- // if (columnIndex == i){
- // return this.changeColor(row[i])
- // }
- // }
- return this.changeColor(row[columnIndex])
- },
- changeColor (value) {
- if (value == null) {
- return 'companyNot'
- }
- if (value.trim().startsWith('20')){
- return 'companyFinish'
- }
- if (value === "-"){
- return 'companyUrgent'
- }
- if (value === "尚未开始培训") {
- return 'companyNot'
- }
- },
- /** 查询培训成绩列表 */
- getList() {
- this.loading = true;
- listTrainingrecords(this.queryParams).then(response => {
- this.trainingrecordsList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- //获取人员表
- getStaffmar() {
- selectTimeStaffmgr(this.staffmgrQueryParams).then(response => {
- const allData = response.rows
- const data = [];
- for (let i = 0; i < allData.length; i++) {
- data.push({
- name: allData[i].name,
- actualpost: this.selectDictLabel(this.positionOptions, allData[i].actualpost),
- trainingTime: allData[i].trainingTime
- });
- }
- this.transTitle = data;
- })
- },
- //获取公司级培训列表
- getCompanyTraining() {
- companyListParticipants(this.companyQueryParams).then(response => {
- this.companylevelListTemp = response;
- this.companylevelList = response
- this.companyTrainingLoad = false
- this.$nextTick(() => {
- this.$refs.companyTable.doLayout(); // 解决表格错位
- });
- })
- },
- //获取装置级培训列表
- getDeviceTraining() {
- this.staffmgrQueryParams.leftYear = this.deviceParams.year
- selectTimeStaffmgr(this.staffmgrQueryParams).then(response => {
- const allData = response.rows
- const data = [];
- for (let i = 0; i < allData.length; i++) {
- data.push({
- name: allData[i].name,
- actualpost: this.selectDictLabel(this.positionOptions, allData[i].actualpost),
- trainingTime: allData[i].trainingTime
- });
- }
- this.transTitle = data;
- this.$nextTick(() => {
- deviceListParticipants(this.deviceParams).then(response => {
- this.devicelevelListTemp = response;
- this.devicelevelList = response
- this.deviceTrainingLoad = false
- this.$nextTick(() => {
- this.$refs.deviceTable.doLayout(); // 解决表格错位
- });
- })
- });
- })
- },
- /** 查询部门下拉树结构 */
- getTreeselect() {
- treeselect().then(response => {
- this.deptOptions = response.data;
- });
- },
- // 装置名称字典翻译
- plantCodeFormat(row, column) {
- return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
- },
- // 班值字典翻译
- classesFormat(row, column) {
- return this.selectDictLabel(this.classesOptions, row.classes);
- },
- // SUB字典翻译
- subFormat(row, column) {
- return this.selectDictLabel(this.subOptions, row.sub);
- },
- // 裂解字典翻译
- crackingFormat(row, column) {
- return this.selectDictLabel(this.crackingOptions, row.cracking);
- },
- // 热区字典翻译
- hotareaFormat(row, column) {
- return this.selectDictLabel(this.hotareaOptions, row.hotarea);
- },
- // 冷区字典翻译
- coldareaFormat(row, column) {
- return this.selectDictLabel(this.coldareaOptions, row.coldarea);
- },
- // AEU/PGU字典翻译
- aeupguFormat(row, column) {
- return this.selectDictLabel(this.aeupguOptions, row.aeupgu);
- },
- // 入职字典翻译
- onboardFormat(row, column) {
- return this.selectDictLabel(this.onboardOptions, row.onboard);
- },
- // TDS字典翻译
- tdsFormat(row, column) {
- return this.selectDictLabel(this.tdsOptions, row.tds);
- },
- // 上岗证复证字典翻译
- postCardFormat(row, column) {
- return this.selectDictLabel(this.postCardOptions, row.postCard);
- },
- // 工艺培训字典翻译
- craftFormat(row, column) {
- return this.selectDictLabel(this.craftOptions, row.craft);
- },
- //公司级培训字典翻译
- companyFormat(row, column) {
- return this.selectDictLabel(this.companyOptions, row.company);
- },
- //装置级培训字典翻译
- deviceFormat(row, column) {
- return this.selectDictLabel(this.deviceOptions, row.device);
- },
- // 培训类型翻译
- trainingTypeFormat(row, column) {
- return this.selectDictLabel(this.trainingTypeOptions, row.trainingType);
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- plantCode: null,
- name: null,
- employeeid: null,
- classes: null,
- companysafe: null,
- plantsafe: null,
- teamsafe: null,
- sub: null,
- cracking: null,
- hotarea: null,
- coldarea: null,
- aeupgu: null,
- upscore: null,
- downscore: null,
- delFlag: null,
- createrCode: null,
- createdate: null,
- updaterCode: null,
- updatedate: null,
- remarks: null,
- deptId: null,
- onboard: null,
- tds: null,
- postCard: null,
- craft: null,
- company: null,
- device: null
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- //搜索按钮
- handleDeviceQuery() {
- this.deviceTrainingLoad = true;
- this.$nextTick(() => {
- this.getDeviceTraining();
- });
- },
- staffDeviceQuery() {
- this.getDevice(this.employeeid)
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.id)
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
- //根据分数显示颜色提示
- tableCellStyle({ row, column, rowIndex, columnIndex }) {
- if (columnIndex === 4 && row.onboard === "2"){
- return "color: rgba(255, 26, 26, 0.98) "
- }else if (columnIndex === 5 && row.tds === "2"){
- return "color: rgba(255, 26, 26, 0.98) "
- }else if (columnIndex === 6 && row.postCard === "2"){
- return "color: rgba(255, 26, 26, 0.98) "
- }else if (columnIndex === 7 && row.craft === "2"){
- return "color: rgba(255, 26, 26, 0.98) "
- }else if (columnIndex === 8 && row.company === "2"){
- return "color: rgba(255, 26, 26, 0.98) "
- }
- },
- //排序
- sortChange(val){
- if (val.prop == 'companysafe'){
- this.queryParams.sortDate = 'companysafe';
- }else if (val.prop == 'plantsafe'){
- this.queryParams.sortDate = 'plantsafe';
- }else if (val.prop == 'teamsafe'){
- this.queryParams.sortDate = 'teamsafe';
- }
- if (val.order === 'descending') {
- this.queryParams.sortOrder = 'desc'
- } else {
- this.queryParams.sortOrder = 'asc'
- }
- this.getList()
- },
- /** 获取当前年份 */
- getNowTime() {
- var now = new Date();
- var year = now.getFullYear(); //得到年份
- var defaultDate = `${year}`;
- defaultDate = `${year}`
- return defaultDate;
- },
- /** 公司级培训矩阵按钮操作 */
- handleCompany() {
- this.companyTrainingLoad =true
- this.companyTrainingTitle = this.$t('参加')+this.$t('空格')+this.$t('公司级')+this.$t('空格')+this.$t('培训人员')+this.$t('空格') +this.$t('名单')
- this.companyTrainingOpen = true
- // loading.close();
- this.tableShow = true
- setTimeout(() => {
- this.getCompanyTraining();
- }, 10);
- },
- /** 装置级培训矩阵按钮操作 */
- handleDevice() {
- this.deviceTrainingLoad =true
- this.resetForm("queryRegularForm");
- this.deviceTrainingTitle =this.$t('参加') +this.$t('空格') + this.$t('装置级') +this.$t('空格') + this.$t('培训人员') +this.$t('空格') + this.$t('名单')
- this.deviceTrainingOpen = true
- this.tableShow = true
- this.deviceParams.year = this.getNowTime();
- this.$nextTick(() => {
- deviceListParticipants(this.deviceParams).then(response => {
- this.devicelevelListTemp = response;
- this.devicelevelList = response
- this.deviceTrainingLoad = false
- this.$nextTick(() => {
- this.$refs.deviceTable.doLayout(); // 解决表格错位
- });
- })
- });
- // setTimeout(() => {
- // this.getDeviceTraining();
- // }, 10);
- },
- /** 人员培训时长按钮操作 */
- handleTime() {
- this.trainingTimeOpen = true;
- this.trainingTimeTitle = this.$t('人员培训时长');
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.open = true;
- this.title = this.$t('新增') + this.$t('空格') + this.$t('培训成绩');
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- const id = row.id || this.ids
- getTrainingrecords(id).then(response => {
- this.form = response.data;
- if (response.data.sub == 10) { this.form.sub = true }
- if (response.data.cracking == 10) { this.form.cracking = true }
- if (response.data.hotarea == 10) { this.form.hotarea = true }
- if (response.data.coldarea == 10) { this.form.coldarea = true }
- if (response.data.aeupgu == 10) { this.form.aeupgu = true }
- this.open = true;
- this.title = this.$t('修改') + this.$t('培训成绩');
- });
- },
- /** 提交按钮 */
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.form.id != null) {
- updateTrainingrecords(this.form).then(response => {
- this.msgSuccess(this.$t('修改成功'));
- this.open = false;
- this.getList();
- });
- } else {
- addTrainingrecords(this.form).then(response => {
- this.msgSuccess(this.$t('新增成功'));
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function() {
- return delTrainingrecords(ids);
- }).then(() => {
- this.getList();
- this.msgSuccess(this.$t('删除成功'));
- })
- },
- /** 公司级培训删除按钮操作 */
- participantsHandleDelete(row) {
- const ids = row.id
- this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function() {
- return delParticipants(ids);
- }).then(() => {
- this.getParticipants(row.staffId)
- this.msgSuccess(this.$t('删除成功'));
- })
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$confirm(this.$t('是否确认导出所有培训成绩数据项?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function() {
- return exportTrainingrecords(queryParams);
- }).then(response => {
- this.download(response.msg);
- })
- },
- /** 导出人员培训时长按钮操作 */
- exportTrainingTime() {
- const queryParams = this.transTitle;
- this.$confirm(this.$t('是否确认导出人员培训时长?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function() {
- return exportTrainingTime();
- }).then(response => {
- this.download(response.msg);
- })
- },
- /** 导入按钮操作 */
- handleImport() {
- this.upload.title = this.$t('用户导入');
- this.upload.open = true;
- },
- /** 下载模板操作 */
- importTemplate() {
- this.$refs['downloadFileForm'].submit()
- },
- // 文件上传中处理
- handleFileUploadProgress(event, file, fileList) {
- this.upload.isUploading = true;
- },
- // 文件上传成功处理
- handleFileSuccess(response, file, fileList) {
- this.upload.open = false;
- this.upload.isUploading = false;
- this.$refs.upload.clearFiles();
- if (response.data[0] != null) {
- this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
- }else {
- this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
- }
- this.getList();
- },
- // 提交上传文件
- submitFileForm() {
- this.$refs.upload.submit();
- },
- /** 报告附件按钮操作 */
- handleDoc(row , fileType) {
- this.doc.pType = fileType
- this.doc.queryParams.pType = fileType
- this.doc.id = row.id;
- var titleType = '';
- if (fileType === 'trainingrecords-onbord') {
- titleType = row.name + this.$t('空格') + this.$t('的')+this.$t('入职')+ this.$t('空格') + this.$t('培训')
- }else if (fileType === 'trainingrecords-tds') {
- titleType = row.name + this.$t('空格') + this.$t('的')+this.$t('TDS培训')
- }else if (fileType === 'trainingrecords-craft') {
- titleType = row.name + this.$t('空格') + this.$t('的')+this.$t('工艺培训')
- }else {
- titleType =this.$t('上岗证') + this.$t('空格') + this.$t('培训')
- }
- this.doc.title = titleType;
- this.doc.open = true;
- this.doc.queryParams.pId = row.id
- this.doc.pId = row.id
- this.getFileList()
- this.$nextTick(() => {
- this.$refs.doc.clearFiles()
- })
- },
- getFileList (){
- allFileList(this.doc.queryParams).then(response => {
- response.forEach(element => {
- element["isEdit"] = false
- });
- response.forEach(element => {
- element["isAdd"] = false
- });
- this.doc.commonfileList = response;
- });
- },
- //附件上传中处理
- handleFileDocProgress(event, file, fileList) {
- this.doc.file = file;
- this.doc.isUploading = true;
- },
- //附件上传成功处理
- handleFileDocSuccess(response, file, fileList) {
- this.doc.isUploading = false;
- this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
- this.getFileList()
- },
- // 文件下载处理
- handleDownload(row) {
- var name = row.fileName;
- var url = row.fileUrl;
- var suffix = url.substring(url.lastIndexOf("."), url.length);
- const a = document.createElement('a')
- a.setAttribute('download', name)
- a.setAttribute('target', '_blank')
- a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
- a.click()
- },
- //pdf预览
- openPdf(){
- window.open(this.pdf.pdfUrl);//path是文件的全路径地址
- },
- handleSee (row){
- this.pdf.open =true
- this.pdf.title = row.fileName
- this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
- },
- /** 打开上岗证复证列表 */
- openWorklicense(row) {
- this.worklicenseOpen = true;
- this.worklicenseTitle = row.name + this.$t('的')+this.$t('上岗证复证')+this.$t('列表');
- this.worklicenseParams.employeeid = row.employeeid
- listTraining(this.worklicenseParams).then(response => {
- this.worklicenseList = response;
- });
- },
- /** 打开公司级培训列表 */
- openCompany(row) {
- this.companyOpen = true;
- this.companyTitle = row.name+ this.$t('空格') + this.$t('的')+this.$t('公司级') + this.$t('空格') +this.$t('培训信息');
- this.$nextTick(() => {
- this.getParticipants(row.employeeid)
- })
- },
- /** 打开装置级培训列表 */
- openDevice(row) {
- this.deviceOpen = true;
- this.resetForm("queryRegularForm");
- this.deviceTitle = row.name + this.$t('空格') + this.$t('的')+this.$t('装置级') + this.$t('空格') +this.$t('培训信息');
- this.employeeid = row.employeeid;
- this.queryDeviceParams.year = this.getNowTime();
- this.$nextTick(() => {
- this.getDevice(row.employeeid)
- })
- },
- getParticipants(employeeid) {
- this.queryCompanyParams.staffId = employeeid
- listParticipants(this.queryCompanyParams).then(response => {
- this.participantsList = response.rows;
- });
- },
- getDevice(employeeid) {
- this.queryDeviceParams.staffId = employeeid
- listDevice(this.queryDeviceParams).then(response => {
- this.devicceList = response.rows;
- });
- },
- // 取消
- cancelFile(row, index) {
- // 如果是新增的数据
- if (row.isAdd) {
- this.doc.commonfileList.splice(index, 1)
- } else {
- // 不是新增的数据 还原数据
- for (const i in row.oldRow) {
- row[i] = row.oldRow[i]
- }
- row.isEdit = false
- }
- },
- edit(row) {
- // 备份原始数据
- row['oldRow'] = JSON.parse(JSON.stringify(row));
- this.$nextTick(() => {
- row.isEdit = true;
- })
- },
- save(row) {
- row.isEdit = false;
- var that = this;
- that.loading = true;
- this.form = row;
- if (row.isAdd == true) {
- addCommonfile(this.form).then(response => {
- this.msgSuccess(this.$t('新增成功'));
- this.open = false;
- this.getList();
- });
- }else {
- updateCommonfile(this.form).then(response => {
- this.msgSuccess(this.$t('修改成功'));
- this.open = false;
- this.getList();
- });
- }
- },
- /** 删除按钮操作 */
- handleDeleteDoc(row) {
- const ids = row.id || this.ids;
- this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function() {
- return delCommonfile(ids);
- }).then(() => {
- this.getFileList()
- this.msgSuccess(this.$t('删除成功'));
- })
- },
- /** 公司级培训修改按钮操作 */
- handleCompanyUpdate(row) {
- this.reset();
- const id = row.id || this.ids
- },
- closeDialog(){
- this.companylevelList = []
- this.devicelevelList = []
- this.tableShow =false
- },
- }
- };
- </script>
- <style>
- .companyLevelTable {
- color: black;
- }
- .el-dialog__body {
- padding-top: 0px
- }
- .el-table--scrollable-x .el-table__body-wrapper {
- z-index: 1;
- }
- .rectangleRed {
- width: 60px !important;
- height: 30px !important;
- margin-bottom: -8px;
- }
- .rectangleGreen {
- width: 60px !important;
- height: 30px !important;
- margin-bottom: -8px;
- }
- </style>
|