1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468 |
- <template>
- <div class="app-container">
- <!-- 搜索条件 -->
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
- <el-form-item label="登记人部门" prop="applicantDept">
- <el-form-item prop="applicantDept">
- <el-select
- clearable
- v-model="queryParams.applicantDept"
- placeholder="请选择部门">
- <el-option
- v-for="dict in applicantDeptOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form-item>
- <el-form-item label="登记人班组" prop="applicantTeam">
- <el-form-item prop="applicantTeam">
- <el-select
- clearable
- v-model="queryParams.applicantTeam"
- placeholder="请选择班组">
- <el-option
- v-for="dict in applicantTeamOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form-item>
- <el-form-item label="不安全状态" prop="unsafeStatus">
- <el-select v-model="queryParams.unsafeStatus" placeholder="请选择不安全状态" clearable>
- <el-option
- v-for="dict in unsafeStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="不安全行为" prop="unsafeAction">
- <el-select v-model="queryParams.unsafeAction" placeholder="请选择不安全行为" clearable>
- <el-option
- v-for="dict in unsafeActionOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="申请状态" prop="applyStatus">
- <el-select v-model="queryParams.applyStatus" placeholder="请选择申请状态">
- <el-option
- v-for="dict in applyStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="问题描述" prop="description">
- <el-input
- v-model="queryParams.description"
- placeholder="请输入问题描述"
- clearable
- size="small"
- />
- </el-form-item>
- <el-form-item label="登记时间" prop="applyDate">
- <el-date-picker
- size="small"
- style="width: 200px"
- v-model="queryParams.applyDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择登记时间">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="预计完成时间" prop="estimateFinishDate">
- <el-date-picker
- size="small"
- style="width: 200px"
- v-model="queryParams.estimateFinishDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择预计完成时间">
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</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-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['production:apply:add']"
- >新增申请单</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="info"
- icon="el-icon-upload2"
- size="mini"
- @click="handleImport"
- v-hasPermi="['production:apply:edit']"
- >导入</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['production:apply:export']"
- >导出</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- size="mini"
- @click="handleAddSai"
- v-hasPermi="['production:sai:add']"
- >统计至SAI检查台账</el-button>
- </el-col>
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <!-- 总表 -->
- <el-table v-loading="loading" :data="applyList" @selection-change="handleSelectionChange" :height="clientHeight" border>
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="问题描述" align="center" prop="description" :show-overflow-tooltip="true" width="200"/>
- <el-table-column label="申请状态" align="center" prop="applyStatus" :show-overflow-tooltip="true" :formatter="applyStatusFormat"/>
- <el-table-column label="登记人部门" align="center" prop="applicantDeptName" :show-overflow-tooltip="true"/>
- <el-table-column label="登记人班组" align="center" prop="applicantTeam" :show-overflow-tooltip="true" :formatter="teamFormat"/>
- <el-table-column label="登记人" align="center" prop="applicantName" :show-overflow-tooltip="true"/>
- <el-table-column label="当前处理人" align="center" prop="handlerName" :show-overflow-tooltip="true"/>
- <el-table-column label="整改负责人" align="center" prop="executorName" :show-overflow-tooltip="true"/>
- <el-table-column label="登记时间" align="center" prop="applyDate" width="100" sortable>
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column label="预计完成时间" align="center" prop="estimateFinishDate" width="100" sortable>
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.estimateFinishDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column label="实际完成时间" align="center" prop="actualFinishDate" width="100">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.actualFinishDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column label="是否录入开项系统" align="center" prop="isRecorded" :show-overflow-tooltip="true">
- <template slot-scope="scope">
- <span>{{ scope.row.isRecorded == 1 ? "是" : "否" }}</span>
- </template>
- </el-table-column>
- <el-table-column label="开项编号" align="center" prop="recordNo" :show-overflow-tooltip="true"/>
- <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <!-- 申请已提交操作 -->
- <!-- 申请状态为进行中/待验收 -->
- <!-- 当前登录用户为张力飞 -->
- <el-button
- size="mini"
- type="text"
- @click="handleDelay(scope.row)"
- v-if="(scope.row.applyStatus == 2 || scope.row.applyStatus == 3)
- && loginStaffInfo.userId == '20276'"
- >延期</el-button>
- <!-- 申请状态为待评估/进行中/待验收 -->
- <!-- 当前登录用户为处理人(之一)或张力飞 -->
- <el-button
- size="mini"
- type="text"
- @click="handleDetail(scope.row)"
- icon="el-icon-edit-outline"
- v-if="(scope.row.applyStatus == 1 || scope.row.applyStatus == 2 || scope.row.applyStatus == 3)
- && ((scope.row.handler.indexOf(loginStaffInfo.userId) != -1) || loginStaffInfo.userId == '20276')"
- >处理</el-button>
- <!-- 申请状态为已完成/已中止-->
- <el-button
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleDetail(scope.row)"
- v-if="scope.row.applyStatus == 4 || scope.row.applyStatus == 5"
- >详情</el-button>
- <el-button
- size="mini"
- type="text"
- @click="processImg(scope.row.processId)"
- v-if="scope.row.applyStatus != 0"
- >{{ $t('流程图') }}</el-button>
- <!-- 申请未提交操作 -->
- <!-- 申请状态为未提交 -->
- <!-- 当前登录用户为处理人(之一) -->
- <span v-if="scope.row.applyStatus == 0 && scope.row.handler.indexOf(loginStaffInfo.userId) != -1">
- <el-button
- size="mini"
- type="text"
- @click="handleSubmit(scope.row)"
- v-hasPermi="['production:apply:edit']"
- icon="el-icon-s-claim"
- >提交申请</el-button>
- <!--<el-button-->
- <!--size="mini"-->
- <!--type="text"-->
- <!--icon="el-icon-document"-->
- <!--@click="handleDoc(scope.row)"-->
- <!-->上传附件</el-button>-->
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['production:apply:edit']"
- >修改</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['production:apply:remove']"
- >删除</el-button>
- </span>
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页 -->
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <!-- 添加或修改SAI开项管理对话框 -->
- <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="0px">
- <el-descriptions title="" :column="3" border>
- <el-descriptions-item label="登记人部门">
- <el-form-item prop="applicantDept">
- <el-select
- filterable
- clearable
- v-model="form.applicantDept"
- @change="handleDeptOrTeamChange"
- placeholder="请选择部门">
- <el-option
- v-for="dict in applicantDeptOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="登记人班组">
- <el-form-item prop="applicantTeam">
- <el-select
- filterable
- clearable
- v-model="form.applicantTeam"
- @change="handleDeptOrTeamChange"
- :disabled="applicantTeamDisabled"
- placeholder="请选择班组">
- <el-option
- v-for="dict in applicantTeamOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="登记人">
- <el-form-item prop="applicant">
- <el-select
- filterable
- clearable
- v-model="form.applicant"
- placeholder="请选择登记人">
- <el-option
- v-for="dict in applicantOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="问题描述" :span="3">
- <el-form-item prop="description">
- <el-input v-model="form.description" placeholder="请输入问题描述" type="textarea" :rows="3" />
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="SAI级别" :span="1">
- <el-form-item prop="saiLevel">
- <el-select v-model="form.saiLevel" placeholder="请选择SAI级别">
- <el-option key="1" label="1" value="1"></el-option>
- <el-option key="2" label="2" value="2"></el-option>
- <el-option key="3" label="3" value="3"></el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="SAI类别" :span="2">
- <el-form-item prop="category">
- <el-input v-model="form.category" placeholder="请输入SAI类别" />
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="隐患" :span="3">
- <el-radio v-model="unsafeChoice" label="1" @change="handleUnsafeChoiceChange" style="margin-right: 10px;">不安全状态</el-radio>
- <el-form-item prop="unsafeStatus" style="display: inline-block;">
- <el-select v-model="form.unsafeStatus" filterable placeholder="请选择不安全状态" :disabled="unsafeStatusDisabled" style="margin-right: 20px;" clearable>
- <el-option
- v-for="dict in unsafeStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-radio v-model="unsafeChoice" label="2" @change="handleUnsafeChoiceChange" style="margin-right: 10px;">不安全行为</el-radio>
- <el-form-item prop="unsafeAction" style="display: inline-block;">
- <el-select v-model="form.unsafeAction" filterable placeholder="请选择不安全行为" :disabled="unsafeActionDisabled" clearable>
- <el-option
- v-for="dict in unsafeActionOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="附件" :span="3">
- <el-form-item label="" prop="fileUrl">
- <el-upload
- ref="doc"
- :limit="5"
- :headers="doc.headers"
- :action="doc.url"
- :disabled="doc.isUploading"
- :on-progress="handleFileDocProgress"
- :on-success="handleFileDocSuccess"
- :on-remove="handleRemove"
- :auto-upload="true"
- :file-list="fileList"
- drag
- >
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">
- {{ $t('将文件拖到此处,或') }}
- <em>{{ $t('点击上传') }}</em>
- </div>
- </el-upload>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item label="登记时间">
- <el-form-item prop="applyDate">
- <el-date-picker
- size="small"
- style="width: 200px"
- v-model="form.applyDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择登记时间">
- </el-date-picker>
- </el-form-item>
- </el-descriptions-item>
- </el-descriptions>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="handleSaveAndSubmit">提 交</el-button>
- <el-button @click="submitForm">保 存</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 延期对话框 -->
- <el-dialog :title="title" :visible.sync="delayOpen" width="25%" append-to-body>
- <el-form ref="delayForm" :model="delayForm" :rules="delayRules" label-width="136px">
- <el-form-item prop="estimateFinishDate" label="预计完成时间">
- <el-date-picker
- clearable
- size="small"
- style="width: 200px"
- v-model="delayForm.estimateFinishDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="选择预计完成时间">
- </el-date-picker>
- </el-form-item>
- <el-form-item prop="isRecorded" label="是否录入开项系统">
- <el-radio v-model="delayForm.isRecorded" label="1" @change="handleIsRecordedChange">是</el-radio>
- <el-radio v-model="delayForm.isRecorded" label="0" @change="handleIsRecordedChange">否</el-radio>
- </el-form-item>
- <el-form-item prop="recordNo" label="开项编号">
- <el-input v-model="delayForm.recordNo" placeholder="请输入开项编号" :disabled="recordNoDisabled"/>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitDelayForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 用户导入对话框 -->
- <el-dialog :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">
- 将文件拖到此处,或
- <em>点击上传</em>
- </div>
- <div class="el-upload__tip" slot="tip">
- <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</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">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
- </el-upload>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
- <el-button @click="upload.open = false">取 消</el-button>
- </div>
- </el-dialog>
- <!-- SAI开项管理流转详情对话框 -->
- <sai-apply-detail v-if="saiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></sai-apply-detail>
- <!-- 流程图对话框 -->
- <process-img v-if="processImgVisible" ref="processImg" @refreshDataList="getList"></process-img>
- <!-- 附件对话框 -->
- <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px" append-to-body>
- <el-upload
- 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="createdate" :show-overflow-tooltip="true" width="120"/>
- <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
- ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
- ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
- ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
- ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
- ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleSee(scope.row)"
- > {{ $t('预览') }}</el-button>
- <el-button
- v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
- size="mini"
- type="text"
- icon="el-icon-view"
- @click="handleSeePPT(scope.row)"
- > {{ $t('ppt预览') }}</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)"
- >{{ $t('删除') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
- </div>
- </el-dialog>
- <!-- 统计至SAI检查台账对话框 -->
- <el-dialog title="统计至SAI检查台账" :visible.sync="saiOpen" width="80%" append-to-body>
- <el-table v-loading="loading" :data="saiList" @selection-change="handleSelectionChange" :height="clientHeight" border>
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="检查的装置/设施" align="center" prop="plantId" :show-overflow-tooltip="true"/>
- <el-table-column label="检查日期/时间" align="center" prop="inspectionDate">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.inspectionDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column label="识别出的安全问题" align="center" prop="dificiency" :show-overflow-tooltip="true"/>
- <el-table-column label="SAI级别" align="center" prop="saiLevel" :show-overflow-tooltip="true" width="100">
- <template slot-scope="scope">
- <el-select v-model="scope.row.saiLevel" placeholder="请选择">
- <el-option key="1" label="1" value="1"></el-option>
- <el-option key="2" label="2" value="2"></el-option>
- <el-option key="3" label="3" value="3"></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="SAI类别" align="center" prop="category" :show-overflow-tooltip="true">
- <template slot-scope="scope">
- <el-input v-model="scope.row.category" placeholder="请输入" />
- </template>
- </el-table-column>
- <el-table-column label="采取或要采取的措施" align="center" prop="actions" :show-overflow-tooltip="true"/>
- <el-table-column label="用户" align="center" prop="userDeptId" :show-overflow-tooltip="true"/>
- <el-table-column label="数据来源" align="center" prop="source" :show-overflow-tooltip="true"/>
- <el-table-column label="检查人" align="center" prop="applicantName" :show-overflow-tooltip="true"/>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitSaiForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 预览对话框 -->
- <el-dialog v-loading="loadingFlash" element-loading-background="rgba(0,0,0,0.2)" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" :center="true" 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 id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px" v-if="ppt"></iframe>
- </div>
- <div style="padding: 30px; width: 100%; height: 100%;" >
- <el-carousel class="" ref="carousel" arrow="always" v-if="pptView"
- height="700px" trigger="click" :autoplay="false" indicator-position="outside">
- <el-carousel-item class="lun_img" v-for="item in imgs" v-bind:key="item" >
- <img :src="item" width="100%" height="100%" object-fit="cover" />
- </el-carousel-item>
- </el-carousel>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { saveAndSubmitApply, submitApply, listApply, getApply, delApply, addApply, updateApply, exportApply, importTemplate} from "@/api/production/apply";
- import { addSai } from "@/api/production/sai";
- import { treeselect, listDept } from "@/api/system/dept";
- import { getToken } from "@/utils/auth";
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import SaiApplyDetail from "@/views/approve/approveDetail/sai-apply-detail";
- import ProcessImg from '@/views/approve/processImg/index';
- import { listStaffmgrByDeptAndTeam, getLoginStaffInfo } from "@/api/plant/staffmgr";
- import { allFileList, delCommonfile } from "@/api/common/commonfile";
- export default {
- name: "Apply",
- components: { Treeselect, SaiApplyDetail, ProcessImg },
- data() {
- var validateRecordNo = (rule, value, callback) => {
- if (this.delayForm.isRecorded == '1') {
- if (this.delayForm.recordNo == null) {
- return callback(new Error('开项编号不能为空'));
- } else {
- return callback();
- }
- } else {
- return callback();
- }
- };
- var validateApplicantTeam = (rule, value, callback) => {
- if (this.form.applicantDept == '103') {
- if (this.form.applicantTeam == null) {
- return callback(new Error('登记人班组不能为空'));
- } else {
- return callback();
- }
- } else {
- return callback();
- }
- };
- var validateUnsafeStatus = (rule, value, callback) => {
- if (this.unsafeChoice == '1') {
- if (this.form.unsafeStatus == null) {
- return callback(new Error('不安全状态不能为空'));
- } else {
- return callback();
- }
- } else {
- return callback();
- }
- };
- var validateUnsafeAction = (rule, value, callback) => {
- if (this.unsafeChoice == '2') {
- if (this.form.unsafeAction == null) {
- return callback(new Error('不安全行为不能为空'));
- } else {
- return callback();
- }
- } else {
- return callback();
- }
- };
- return {
- fileList: [],
- // 统计至SAI检查台账的数据
- saiList: [],
- // 是显示用统计至SAI检查台账对话框
- saiOpen: false,
- // 是否禁用开项编号输入框
- recordNoDisabled: true,
- // 当前登录员工
- loginStaffInfo: {},
- //图片集合 打开关闭按钮 等等
- imgs:[],
- jpgList:[],
- ppt:false,
- pptView:false,
- loadingFlash:false,
- doc: {
- file: "",
- // 是否显示弹出层(报告附件)
- open: false,
- // 弹出层标题(报告附件)
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 报告附件上传位置编号
- ids: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/production/saiFile/uploadFile",
- commonfileList: null,
- queryParams: {
- pId: null,
- pType: 'saiApply'
- },
- pType: 'saiApply',
- pId: null
- },
- // pdf文件参数
- pdf : {
- title: '',
- pdfUrl: '',
- numPages: null,
- open: false,
- pageNum: 1,
- pageTotalNum: 1,
- loadedRatio: 0,
- },
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: false,
- // 总条数
- total: 0,
- // SAI开项管理表格数据
- applyList: [],
- // 弹出层标题
- title: "",
- // 部门树选项
- deptOptions: undefined,
- clientHeight:300,
- // 是否显示弹出层
- open: false,
- // 是否显示延期弹出层
- delayOpen: false,
- // 用户导入参数
- upload: {
- //下载模板请求地址
- downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
- //下载模板类型
- type: 'saiApply',
- // 是否显示弹出层(用户导入)
- open: false,
- // 弹出层标题(用户导入)
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/production/apply/importData"
- },
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 20,
- saiApplyId: null,
- deptId: null,
- applyStatus: null,
- apNo: null,
- processId: null,
- applicant: null,
- assessor: null,
- executor: null,
- inspectors: null,
- applicantDept: null,
- applicantTeam: null,
- description: null,
- unsafeStatus: null,
- unsafeAction: null,
- applyDate: null,
- taskId: null,
- handler: null,
- taskName: null,
- estimateFinishDate: null,
- actualFinishDate: null,
- isRecorded: null,
- recordNo: null,
- reaction: null,
- needVe: null,
- veItems: null,
- veResult: null,
- veItemOther: null,
- },
- // 表单参数
- form: {},
- // 延期表单参数
- delayForm: {},
- // 延期表单校验
- delayRules: {
- estimateFinishDate: [
- { required: true, message: this.$t('预计完成时间') + this.$t('不能为空'), trigger: "change" }
- ],
- isRecorded: [
- { required: true, message: this.$t('是否录入开项系统') + this.$t('不能为空'), trigger: "change" }
- ],
- recordNo: [
- { validator: validateRecordNo, trigger: 'change' }
- ],
- },
- // 新增/修改表单校验
- rules: {
- description: [
- { required: true, message: this.$t('问题描述') + this.$t('不能为空'), trigger: "change" }
- ],
- applicantDept: [
- { required: true, message: this.$t('登记人部门') + this.$t('不能为空'), trigger: "change" }
- ],
- applicantTeam: [
- { validator: validateApplicantTeam, trigger: 'change' }
- ],
- applicant: [
- { required: true, message: this.$t('登记人') + this.$t('不能为空'), trigger: "change" }
- ],
- applyDate: [
- { required: true, message: this.$t('记录日期') + this.$t('不能为空'), trigger: "change" }
- ],
- unsafeStatus: [
- { validator: validateUnsafeStatus, trigger: 'change' }
- ],
- unsafeAction: [
- { validator: validateUnsafeAction, trigger: 'change' }
- ],
- },
- // 申请状态字典
- applyStatusOptions: [],
- // 登记人班组字典
- applicantTeamOptions: [],
- // 登记人部门列表
- applicantDeptOptions: [],
- // 登记人列表
- applicantOptions: [],
- // 不安全状态字典
- unsafeStatusOptions: [],
- // 不安全行为字典
- unsafeActionOptions: [],
- // 是否显示SAI开项申请详情对话框
- saiApplyVisible: false,
- // 是否显示流程图对话框
- processImgVisible: null,
- // 不安全状态/行为选项
- unsafeChoice: '1',
- // 是否禁用不安全状态下拉框
- unsafeStatusDisabled: false,
- // 是否禁用不安全行为下拉框
- unsafeActionDisabled: true,
- // 是否禁用班组下拉框
- applicantTeamDisabled: false,
- };
- },
- watch: {
- // 根据名称筛选部门树
- deptName(val) {
- this.$refs.tree.filter(val);
- }
- },
- created() {
- //设置表格高度对应屏幕高度
- this.$nextTick(() => {
- this.clientHeight = document.body.clientHeight -250
- })
- this.getList();
- this.getTreeselect();
- // 加载申请状态字典
- this.getDicts("SAI_APPLY_STATUS").then(response => {
- this.applyStatusOptions = response.data;
- });
- // 加载登记人班组字典
- this.getDicts("TEAM_DIVIDE").then(response => {
- this.applicantTeamOptions = response.data;
- });
- // 加载登记人部门列表
- this.getApplicantDeptOptions();
- // 加载登记人列表
- this.listStaffmgrByDeptAndTeam(null, null);
- // 加载不安全状态字典
- this.getDicts("SAI_UNSAFE_STATUS").then(response => {
- this.unsafeStatusOptions = response.data;
- });
- // 加载不安全行为字典
- this.getDicts("SAI_UNSAFE_ACTION").then(response => {
- this.unsafeActionOptions = response.data;
- });
- // 加载当前登录员工信息
- this.getLoginStaffInfo();
- },
- methods: {
- /** 是否录入开项系统单选按钮值改变事件 */
- handleIsRecordedChange() {
- if (this.delayForm.isRecorded == '1') {
- this.recordNoDisabled = false;
- } else if (this.delayForm.isRecorded == '0') {
- this.recordNoDisabled = true;
- this.delayForm.recordNo = null;
- }
- },
- /** 文件下载处理 */
- 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()
- },
- /** 报告附件按钮操作 */
- handleDoc(row) {
- this.doc.id = row.saiApplyId;
- this.doc.title = "附件";
- this.doc.open = true;
- this.doc.queryParams.pId = row.saiApplyId
- this.doc.pId = row.saiApplyId
- this.getFileList()
- this.$nextTick(() => {
- this.$refs.doc.clearFiles()
- })
- },
- getFileList() {
- allFileList(this.doc.queryParams).then(response => {
- 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()
- // },
- //附件上传成功处理
- handleFileDocSuccess(response, file, fileList) {
- this.doc.isUploading = false;
- this.fileList = fileList
- if (response.code == 200){
- this.$alert(this.$t('导入成功'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
- }else {
- this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
- }
- },
- handleRemove (file, fileList) {
- this.fileList = fileList
- },
- /** 删除按钮操作 */
- 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('删除成功'));
- })
- },
- //文件预览
- openPdf(){
- //ppt就跳路由预览,office就直接打开文件新页面
- const didi={ imgs:this.imgs}
- if( this.pptView==true&&this.ppt==false){
- let routeUrl = this.$router.resolve({
- path: "/cpms/index.html#/pptyulan",
- query:didi
- });
- window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
- console.log(this.imgs)
- }else {
- window.open(this.pdf.pdfUrl)
- }
- },
- handleSeePPT (row){
- //ppt预览
- this.loadingFlash=true
- this.pdf.open =true
- this.pdf.title = row.fileName
- this.pdf.pdfUrl = row.fileUrl
- this.pptView=true
- this.ppt=false
- const formatDate =new FormData();
- formatDate.append("filepath",row.fileUrl)
- //调用文件预览api
- let res= this.officeConvert.pptConvertCommon(formatDate)
- //查看接受的全局方法的返回结果 console.log(res)
- //利用.then方法接受Promise对象
- res.then((result)=>{
- //关闭加载中
- this.loadingFlash=false
- //成功时直接给地址
- this.videoList = result.data.imagePathList
- //将返回的地址集合遍历添加到绑定的数组中
- this.imgs=[]
- for (var key=0;key<this.videoList.length;key++) {
- this.imgs.push( process.env.VUE_APP_BASE_API+ this.videoList[key] );
- }
- }).catch(result => {
- //请求失败,关闭loading,pdf地址直接为为空,不显示
- this.pdf.pdfUrl =""
- this.loadingFlash = false;
- })
- },
- handleSee (row){
- //office预览
- this.loadingFlash=true
- this.pdf.open =true
- this.pdf.title = row.fileName
- this.pdf.pdfUrl =""
- this.pptView=false
- this.ppt=true
- //如果是PDF等直接可以打开的就不调接口,否则调用接口
- if(row.fileName.endsWith('pdf')){
- this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
- this.loadingFlash=false
- }
- else{
- const formatDate =new FormData();
- formatDate.append("filepath",row.fileUrl)
- //调用文件预览api
- let res= this.officeConvert.officeConvertCommon(formatDate)
- //查看接受的全局方法的返回结果 console.log(res)
- //利用.then方法接受Promise对象
- res.then((result)=>{
- //关闭加载中
- this.loadingFlash=false
- if(result.msg.includes("csv")){
- this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
- this.$alert(result.msg, this.$t('检查乱码'), { dangerouslyUseHTMLString: true });
- // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
- }else if(result.msg.includes("不存在")){
- //文件不存在时提示
- this.pdf.pdfUrl =""
- this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
- // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
- this.pdf.open =false
- }else if(result.msg.includes("不支持此格式")){
- this.pdf.pdfUrl =""
- this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
- // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
- this.pdf.open =false
- } else{
- //成功时直接给地址
- this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
- }
- // this.$nextTick(() => {
- // const iframe = window.frames['iFrame']
- // const handleLoad = () => {
- // setTimeout(() => {
- // const Do = (iframe.contentWindow || iframe.contentDocument)
- // console.log(Do.document.getElementsByTagName('table')[0])
- // Do.document.getElementsByTagName('table')[0].style.width = "100%"
- // Do.document.getElementsByTagName('table')[0].setAttribute("class","table")
- // }, 500)
- // }
- // iframe.addEventListener('load', handleLoad, true)
- // })
- }).catch(result => {
- //请求失败,关闭loading,pdf地址直接为为空,不显示
- this.pdf.pdfUrl =""
- this.loadingFlash = false;
- })
- }
- },
- /** 加载当前登录员工信息 */
- getLoginStaffInfo() {
- getLoginStaffInfo().then(response => {
- let staff = response.data;
- if (staff != null) {
- this.loginStaffInfo = response.data;
- this.form.applicantDept = staff.unit;
- if (staff.unit == '10') {
- this.form.applicantTeam = staff.team;
- }
- this.form.applicant = staff.userId;
- }
- });
- },
- /** 加载登记人部门列表 */
- getApplicantDeptOptions() {
- // listDept(null).then(response => {
- // let deptList = response.data;
- // this.applicantDeptOptions = [];
- // for (let i = 0; i < deptList.length; i++) {
- // if (deptList[i].deptId == 103 || deptList[i].deptId == 10058 || deptList[i].deptId == 10042) {
- // this.applicantDeptOptions.push({
- // dictLabel: deptList[i].deptName,
- // dictValue: deptList[i].deptId
- // });
- // }
- // }
- // });
- this.applicantDeptOptions.push({ dictLabel: "CBP/C", dictValue: '10' });
- this.applicantDeptOptions.push({ dictLabel: "CTA/B", dictValue: '12' });
- this.applicantDeptOptions.push({ dictLabel: "CTM/B", dictValue: '14' });
- },
- /** 部门/班组值改变事件 */
- handleDeptOrTeamChange() {
- this.applicantOptions = [];
- this.form.applicant = null;
- let applicantDept = this.form.applicantDept;
- if (applicantDept != '10') {
- this.applicantTeamDisabled = true;
- this.form.applicantTeam = null;
- } else {
- this.applicantTeamDisabled = false;
- }
- let applicantTeam = this.form.applicantTeam;
- // 加载登记人列表
- this.listStaffmgrByDeptAndTeam(applicantDept, applicantTeam);
- },
- /** 加载登记人列表 */
- listStaffmgrByDeptAndTeam(applicantDept, applicantTeam) {
- listStaffmgrByDeptAndTeam({
- deptId: applicantDept,
- team: applicantTeam
- }).then(response => {
- let staffList = response.rows;
- this.applicantOptions = [];
- for (let i = 0; i < staffList.length; i++) {
- let staffOption = {
- dictLabel: staffList[i].name,
- dictValue: staffList[i].userId
- }
- this.applicantOptions.push(staffOption);
- }
- });
- },
- /** 不安全行为/状态单选按钮值改变事件 */
- handleUnsafeChoiceChange() {
- if (this.unsafeChoice == '1') {
- this.form.unsafeAction = null;
- this.unsafeStatusDisabled = false;
- this.unsafeActionDisabled = true;
- } else if (this.unsafeChoice == '2') {
- this.form.unsafeStatus = null;
- this.unsafeStatusDisabled = true;
- this.unsafeActionDisabled = false;
- }
- },
- /** 流程图 */
- processImg (processId) {
- this.processImgVisible = true;
- this.$nextTick(() => {
- this.$refs.processImg.init(processId);
- })
- },
- /** 处理延期操作 */
- handleDelay(row) {
- this.reset();
- const saiApplyId = row.saiApplyId || this.ids
- getApply(saiApplyId).then(response => {
- this.delayForm = response.data;
- if (this.delayForm.isRecorded != null) {
- this.delayForm.isRecorded = this.delayForm.isRecorded.toString();
- }
- this.delayOpen = true;
- this.title = "SAI开项申请延期";
- });
- },
- /** 处理/详情操作 */
- handleDetail(row) {
- this.saiApplyVisible = true;
- this.$nextTick(() => {
- this.$refs.saiApplyDetail.init(row.saiApplyId, row.taskId, row.processId, row.taskName);
- });
- },
- /** 提交申请操作 */
- handleSubmit(row) {
- this.$confirm('是否确认提交申请?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return submitApply(row.saiApplyId);
- }).then(() => {
- this.getList();
- this.msgSuccess("提交申请成功");
- })
- },
- // 申请状态字典翻译
- applyStatusFormat(row, column) {
- return this.selectDictLabel(this.applyStatusOptions, row.applyStatus);
- },
- // 班组字典翻译
- teamFormat(row, column) {
- return this.selectDictLabel(this.applicantTeamOptions, row.applicantTeam);
- },
- /** 查询SAI开项管理列表 */
- getList() {
- this.loading = true;
- getLoginStaffInfo().then(response => {
- let staff = response.data;
- if (staff != null) {
- this.loginStaffInfo = response.data;
- }
- listApply(this.queryParams).then(response => {
- let rows = response.rows;
- this.applyList = [];
- for (let i = 0; i < rows.length; i++) {
- // 当前用户为登记人、评估人、整改负责人或验证人(之一)
- if ((rows[i].applicant != null && rows[i].applicant.indexOf(this.loginStaffInfo.userId) != -1)
- || (rows[i].assessor != null && rows[i].assessor.indexOf(this.loginStaffInfo.userId) != -1)
- || (rows[i].executor != null && rows[i].executor.indexOf(this.loginStaffInfo.userId) != -1)
- || (rows[i].inspectors != null && rows[i].inspectors.indexOf(this.loginStaffInfo.userId) != -1)) {
- this.applyList.push(rows[i]);
- }
- }
- this.total = response.total;
- this.loading = false;
- });
- });
- },
- /** 查询部门下拉树结构 */
- getTreeselect() {
- treeselect().then(response => {
- this.deptOptions = response.data;
- });
- },
- // 取消按钮
- cancel() {
- this.delayOpen = false;
- this.saiOpen = false;
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- saiApplyId: null,
- delFlag: null,
- createBy: null,
- createTime: null,
- updateBy: null,
- updateTime: null,
- deptId: null,
- applyStatus: null,
- apNo: null,
- processId: null,
- applicant: null,
- assessor: null,
- executor: null,
- inspectors: null,
- applicantDept: null,
- applicantTeam: null,
- description: null,
- unsafeStatus: null,
- unsafeAction: null,
- applyDate: new Date(),
- taskId: null,
- handler: null,
- taskName: null,
- estimateFinishDate: null,
- actualFinishDate: null,
- isRecorded: null,
- recordNo: null,
- reaction: null,
- needVe: null,
- veItems: null,
- veResult: null,
- veItemOther: null,
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.saiApplyId)
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.fileList = [];
- this.open = true;
- this.title = "添加SAI开项申请";
- // 加载当前登录员工信息
- this.getLoginStaffInfo();
- this.applicantTeamDisabled = false;
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- const saiApplyId = row.saiApplyId || this.ids
- getApply(saiApplyId).then(response => {
- this.form = response.data;
- if (this.form.unsafeStatus != null && this.form.unsafeStatus != "") {
- this.form.unsafeStatus = this.form.unsafeStatus.toString();
- }
- if (this.form.unsafeAction != null && this.form.unsafeAction != "") {
- this.form.unsafeAction = this.form.unsafeAction.toString();
- }
- this.fileList = [];
- if (this.form.files.length > 0) {
- console.log(this.form.files);
- for (let i = 0; i < this.form.files.length; i++) {
- let obj = {}
- obj.name = this.form.files[i].fileName
- obj.response = {};
- obj.response.msg = this.form.files[i].fileUrl
- this.fileList.push(obj)
- }
- }
- this.open = true;
- this.title = "修改SAI开项申请";
- });
- },
- /** 新增/修改保存按钮 */
- submitForm() {
- this.form.files = []
- if (this.fileList.length > 0) {
- for (let i = 0; i < this.fileList.length; i++) {
- let obj = {}
- obj.fileName = this.fileList[i].name
- obj.fileUrl = this.fileList[i].response.msg
- this.form.files.push(obj)
- }
- }
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.form.saiApplyId != null) {
- updateApply(this.form).then(response => {
- this.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- addApply(this.form).then(response => {
- this.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 新增/修改提交按钮 */
- handleSaveAndSubmit() {
- this.form.files = []
- if (this.fileList.length > 0) {
- for (let i = 0; i < this.fileList.length; i++) {
- let obj = {}
- obj.fileName = this.fileList[i].name
- obj.fileUrl = this.fileList[i].response.msg
- this.form.files.push(obj)
- }
- }
- this.$refs["form"].validate(valid => {
- if (valid) {
- saveAndSubmitApply(this.form).then(response => {
- this.msgSuccess("提交成功");
- this.open = false;
- this.getList();
- });
- }
- });
- },
- /** 统计至SAI检查台账提交按钮 */
- submitSaiForm() {
- for (let i = 0; i < this.saiList.length; i++) {
- this.saiList[i].plantId = 103;
- this.saiList[i].userDept = 103;
- addSai(this.saiList[i]);
- }
- this.msgSuccess("提交成功");
- this.saiOpen = false;
- },
- /** 延期提交按钮 */
- submitDelayForm() {
- this.$refs["delayForm"].validate(valid => {
- if (valid) {
- updateApply(this.delayForm).then(response => {
- this.msgSuccess("延期成功");
- this.delayOpen = false;
- this.getList();
- });
- }
- });
- },
- /** 统计至SAI检查台账按钮操作 */
- handleAddSai(row) {
- const saiApplyIds = row.saiApplyId || this.ids;
- if(saiApplyIds.length != 0) {
- this.saiList = [];
- for (let i = 0; i < saiApplyIds.length; i ++) {
- getApply(saiApplyIds[i]).then(response => {
- let apply = response.data;
- let sai = {};
- sai.saiApplyId = apply.saiApplyId;
- sai.plantId = "CBP/C";
- sai.userDeptId = "CBP/C";
- sai.inspectionDate = apply.applyDate;
- sai.dificiency = apply.description;
- sai.actions = apply.reaction;
- sai.source = "装置";
- sai.deptId = 103;
- sai.saiLevel = apply.saiLevel;
- sai.category = apply.category;
- sai.applicant = apply.applicant;
- sai.applicantName = apply.applicantName;
- this.saiList.push(sai);
- });
- }
- this.saiOpen = true;
- }
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const saiApplyIds = row.saiApplyId || this.ids;
- this.$confirm('是否确认删除?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return delApply(saiApplyIds);
- }).then(() => {
- this.getList();
- this.msgSuccess("删除成功");
- })
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$confirm('是否确认导出所有SAI开项管理数据项?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- return exportApply(queryParams);
- }).then(response => {
- this.download(response.msg);
- })
- },
- /** 导入按钮操作 */
- handleImport() {
- this.upload.title = "用户导入";
- 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();
- }
- }
- };
- </script>
|