12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715 |
- <template>
- <div class="app-container-list">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
- <el-form-item :label="$t('泄露位置')" label-width="50" prop="leakLocation">
- <el-input
- v-model="queryParams.leakLocation"
- :placeholder="$t('请输入') + $t('泄露位置')"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item :label="$t('标题')" prop="title">
- <el-input
- v-model="queryParams.title"
- :placeholder="$t('请输入') + $t('标题')"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item :label="$t('备注')" prop="remarks">
- <el-input
- v-model="queryParams.remarks"
- :placeholder="$t('请输入') + $t('备注')"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </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-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['process:moc:add']"
- >{{ $t('新增') }}</el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- icon="el-icon-edit"
- size="mini"
- :disabled="single"
- @click="handleUpdate"
- v-hasPermi="['process:moc:edit']"
- >{{ $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="['process:moc: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="['process:moc: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="['process:moc:export']"-->
- <!-->{{ $t('导出') }}</el-button>-->
- <!--</el-col>-->
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-row class="colorMark">
- <svg-icon icon-class="rectangleLightgreen" class="rectangleLightgreen" style="fill:#000000;"></svg-icon>{{ $t('已移除') }}
- <svg-icon icon-class="rectangleFlesh" class="rectangleFlesh"></svg-icon>{{ $t('7天内到期') }}
- <svg-icon icon-class="rectangleYellow" class="rectangleYellow"></svg-icon>{{ $t('7-14天内到期') }}
- </el-row>
- <el-table
- v-loading="loading"
- :data="mocList"
- @selection-change="handleSelectionChange"
- :cell-style="tableCellStyle"
- :cell-class-name="tableCellClassName"
- :height="clientHeight"
- border
- :default-sort = "{prop: 'mocNo', order: 'descending'}">
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column :label="$t('MOC编号')" align="center" width="120" prop="mocNo" :show-overflow-tooltip="true" sortable/>
- <el-table-column :label="$t('公司MOC编号')" align="center" width="120" prop="companyMocNo" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('工艺单元')" align="center" width="120" prop="processUnit" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('部门')" align="center" prop="department">
- <template slot="header">
- <span
- @click="departmentChart.open = true"
- id="department">
- 部门
- <i class="el-icon-s-data"></i>
- </span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('泄露位置')" align="center" prop="leakLocation">
- <template slot="header">
- <span
- @click="leakLocationChart.open = true"
- id="leakLocation">
- 泄露位置
- <i class="el-icon-s-data"></i>
- </span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('标题')" align="center" width="320" prop="title" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('操作压力 (MPaG)')" align="center" width="150" prop="pressure" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('操作温度 (℃)')" align="center" width="120" prop="temperature" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('泄露介质')" align="center" width="100" prop="leakFluid" :show-overflow-tooltip="true"/>
- <el-table-column :label="$t('介质类型')" align="center" prop="materialType">
- <template slot="header">
- <span
- @click="materialTypeChart.open = true"
- id="materialType">
- 介质类型
- <i class="el-icon-s-data"></i>
- </span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('方案日期')" align="center" prop="planDate" width="100">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.planDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('堵漏日期')" align="center" prop="sealDate">
- <template slot="header">
- <span
- @click="sealDateChart.open = true"
- id="sealDate">
- 堵漏日期
- <i class="el-icon-s-data"></i>
- </span>
- </template>
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.sealDate, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('第一次延期')" align="center" prop="extention1" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.extention1 == null && scope.row.status == 0">N.A.</span>
- <span>{{ parseTime(scope.row.extention1, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('第二次延期')" align="center" prop="extention2" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.extention2 == null && scope.row.status == 0">N.A.</span>
- <span>{{ parseTime(scope.row.extention2, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('第三次延期')" align="center" prop="extention3" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.extention3 == null && scope.row.status == 0">N.A.</span>
- <span>{{ parseTime(scope.row.extention3, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('第四次延期')" align="center" prop="extention4" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.extention4 == null && scope.row.status == 0">N.A.</span>
- <span>{{ parseTime(scope.row.extention4, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('第五次延期')" align="center" prop="extention5" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.extention5 == null && scope.row.status == 0">N.A.</span>
- <span>{{ parseTime(scope.row.extention5, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('第六次延期')" align="center" prop="extention6" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.extention6 == null && scope.row.status == 0">N.A.</span>
- <span>{{ parseTime(scope.row.extention6, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('第七次延期')" align="center" prop="extention7" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.extention7 == null && scope.row.status == 0">N.A.</span>
- <span>{{ parseTime(scope.row.extention7, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('第八次延期')" align="center" prop="extention8" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.extention8 == null && scope.row.status == 0">N.A.</span>
- <span>{{ parseTime(scope.row.extention8, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('第九次延期')" align="center" prop="extention9" width="100">
- <template slot-scope="scope">
- <span v-if="scope.row.extention9 == null && scope.row.status == 0">N.A.</span>
- <span>{{ parseTime(scope.row.extention9, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('到期时间')" align="center" prop="extention9" width="100">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.expTime, '{y}-{m}-{d}') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('卡具状态')" align="center" prop="status" :formatter="mocStatusFormat">
- <template slot="header">
- <span
- @click="statusChart.open = true"
- id="status">
- 卡具状态
- <i class="el-icon-s-data"></i>
- </span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('移除时间')" align="center" prop="removeTime" :show-overflow-tooltip="true" width="100"/>
- <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true" width="130" />
- <el-table-column :label="$t('操作')" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-s-release"
- @click="handleDelay(scope.row, 1)"
- v-hasPermi="['process:moc:edit']"
- v-if="scope.row.extention9 == null && scope.row.status == 1"
- >{{ $t('自动延期') }}</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-s-release"
- @click="handleDelay(scope.row, 2)"
- v-hasPermi="['process:moc:edit']"
- v-if="scope.row.extention9 == null && scope.row.status == 1"
- >{{ $t('手动延期') }}</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-circle-close"
- @click="handleRemove(scope.row)"
- v-hasPermi="['process:moc:edit']"
- v-if="scope.row.status == 1"
- >{{ $t('移除') }}</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['process:moc:edit']"
- >{{ $t('修改') }}</el-button>
- <el-button
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['process:moc: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="delayDialog.title" :visible.sync="delayDialog.open" width="500px" append-to-body>
- <el-form ref="form" :model="delayForm" :rules="delayRules" label-width="80px">
- <el-form-item :label="$t('延期时间')" prop="extention">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="delayForm.extention"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('延期时间')">
- </el-date-picker>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitDelayForm">{{ $t('确 定') }}</el-button>
- <el-button @click="cancelDelay">{{ $t('取 消') }}</el-button>
- </div>
- </el-dialog>
- <!-- 添加或修改MOC管理对话框 -->
- <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('MOC编号')" prop="mocNo">
- <el-input v-model="form.mocNo" :placeholder="$t('请输入') + $t('MOC编号')" />
- </el-form-item>
- <el-form-item :label="$t('公司MOC编号')" prop="companyMocNo">
- <el-input v-model="form.companyMocNo" :placeholder="$t('请输入') + $t('公司MOC编号')" />
- </el-form-item>
- <el-form-item :label="$t('工艺单元')" prop="processUnit">
- <el-input v-model="form.processUnit" :placeholder="$t('请输入') + $t('工艺单元')" />
- </el-form-item>
- <el-form-item :label="$t('部门')" prop="department">
- <el-input v-model="form.department" :placeholder="$t('请输入') + $t('部门')" />
- </el-form-item>
- <el-form-item :label="$t('泄露位置')" prop="leakLocation">
- <el-input v-model="form.leakLocation" :placeholder="$t('请输入') + $t('泄露位置')" />
- </el-form-item>
- <!--<el-form-item :label="$t('项目号')" prop="projectNo">-->
- <!--<el-input v-model="form.projectNo" :placeholder="$t('请输入') + $t('项目号')" />-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('区域')" prop="area">-->
- <!--<el-select v-model="form.area" :placeholder="$t('请选择') + $t('区域')">-->
- <!--<el-option-->
- <!--v-for="dict in areaOptions"-->
- <!--:key="dict.dictValue"-->
- <!--:label="dict.dictLabel"-->
- <!--:value="dict.dictValue"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <el-form-item :label="$t('标题')" prop="title">
- <el-input v-model="form.title" :placeholder="$t('请输入') + $t('标题')" />
- </el-form-item>
- <el-form-item :label="$t('操作压力 (MPaG)')" prop="pressure">
- <el-input v-model="form.pressure" :placeholder="$t('请输入') + $t('操作压力')" />
- </el-form-item>
- <el-form-item :label="$t('操作温度 (℃)')" prop="temperature">
- <el-input v-model="form.temperature" :placeholder="$t('请输入') + $t('操作温度')" />
- </el-form-item>
- <el-form-item :label="$t('泄露介质')" prop="leakFluid">
- <el-input v-model="form.leakFluid" :placeholder="$t('请输入') + $t('泄露介质')" />
- </el-form-item>
- <el-form-item :label="$t('介质类型')" prop="materialType">
- <el-input v-model="form.materialType" :placeholder="$t('请输入') + $t('介质类型')" />
- </el-form-item>
- <el-form-item :label="$t('方案日期')" prop="planDate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.planDate"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('方案日期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('堵漏日期')" prop="sealDate">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.sealDate"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('堵漏日期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('第一次延期')" prop="extention1">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.extention1"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('第一次延期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('第二次延期')" prop="extention2">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.extention2"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('第二次延期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('第三次延期')" prop="extention3">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.extention3"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('第三次延期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('第四次延期')" prop="extention4">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.extention4"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('第四次延期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('第五次延期')" prop="extention5">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.extention5"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('第五次延期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('第六次延期')" prop="extention6">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.extention6"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('第六次延期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('第七次延期')" prop="extention7">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.extention7"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('第七次延期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('第八次延期')" prop="extention8">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.extention8"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('第八次延期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('第九次延期')" prop="extention9">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.extention9"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('第九次延期')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('卡具状态')" prop="area">
- <el-select v-model="form.status" :placeholder="$t('请选择') + $t('卡具状态')">
- <el-option
- v-for="dict in mocStatusOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('到期时间')" prop="extention9">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.expTime"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('到期时间')">
- </el-date-picker>
- </el-form-item>
- <!--<el-form-item :label="$t('MOC类型')" prop="mocType">-->
- <!--<el-select v-model="form.mocType" :placeholder="$t('请选择') + $t('MOC类型')">-->
- <!--<el-option-->
- <!--v-for="dict in mocTypeOptions"-->
- <!--:key="dict.dictValue"-->
- <!--:label="dict.dictLabel"-->
- <!--:value="dict.dictValue"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('负责人')" prop="owner">-->
- <!--<el-input v-model="form.owner" :placeholder="$t('请输入') + $t('负责人')" />-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('申请时间')" prop="approveTime">-->
- <!--<el-date-picker clearable size="small" style="width: 200px"-->
- <!--v-model="form.approveTime"-->
- <!--type="date"-->
- <!--value-format="yyyy-MM-dd"-->
- <!--:placeholder="$t('请选择') + $t('申请时间')">-->
- <!--</el-date-picker>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('MC时间')" prop="mcTime">-->
- <!--<el-date-picker clearable size="small" style="width: 200px"-->
- <!--v-model="form.mcTime"-->
- <!--type="date"-->
- <!--value-format="yyyy-MM-dd"-->
- <!--:placeholder="$t('请选择') + $t('MC时间')">-->
- <!--</el-date-picker>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('MC情况')" prop="mcDetail">-->
- <!--<el-select v-model="form.mcDetail" :placeholder="$t('请选择') + $t('MC情况')">-->
- <!--<el-option-->
- <!--v-for="dict in mcDetailOptions"-->
- <!--:key="dict.dictValue"-->
- <!--:label="dict.dictLabel"-->
- <!--:value="dict.dictValue"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('完成时间')" prop="endtime">-->
- <!--<el-date-picker clearable size="small" style="width: 200px"-->
- <!--v-model="form.endtime"-->
- <!--type="date"-->
- <!--value-format="yyyy-MM-dd"-->
- <!--:placeholder="$t('请选择') + $t('完成时间')">-->
- <!--</el-date-picker>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('实施情况')" prop="trueState">-->
- <!--<el-select v-model="form.trueState" :placeholder="$t('请选择') + $t('实施情况')" @change="changeTrueState($event)">-->
- <!--<el-option-->
- <!--v-for="dict in trueStateOptions"-->
- <!--:key="dict.dictValue"-->
- <!--:label="dict.dictLabel"-->
- <!--:value="dict.dictValue"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('变更性质')" prop="changeNature">-->
- <!--<el-select v-model="form.changeNature" :placeholder="$t('请选择') + $t('变更性质')" @change="changeChangeNature($event)">-->
- <!--<el-option-->
- <!--v-for="dict in changeNatureOptions"-->
- <!--:key="dict.dictValue"-->
- <!--:label="dict.dictLabel"-->
- <!--:value="dict.dictValue"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('到期时间')" prop="overTime">-->
- <!--<el-date-picker clearable size="small" style="width: 200px"-->
- <!--v-model="form.overTime"-->
- <!--type="date"-->
- <!--value-format="yyyy-MM-dd"-->
- <!--:placeholder="$t('请选择') + $t('到期时间')">-->
- <!--</el-date-picker>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('临时MOC状态')" prop="temporaryState">-->
- <!--<el-select v-model="form.temporaryState" :placeholder="$t('请选择') + $t('临时MOC状态')">-->
- <!--<el-option-->
- <!--v-for="dict in temporaryStateOptions"-->
- <!--: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" type="textarea" :placeholder="$t('请输入') + $t('备注')" />
- </el-form-item>
- <!--<el-form-item :label="$t('风险等级')" prop="riskLevel">-->
- <!--<el-select v-model="form.riskLevel" :placeholder="$t('请选择') + $t('风险等级')">-->
- <!--<el-option-->
- <!--v-for="dict in riskLevelOptions"-->
- <!--:key="dict.dictValue"-->
- <!--:label="dict.dictLabel"-->
- <!--:value="dict.dictValue"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('EHS评估/审查')" prop="ehsCheck">-->
- <!--<el-date-picker clearable size="small" style="width: 200px"-->
- <!--v-model="form.ehsCheck"-->
- <!--type="date"-->
- <!--value-format="yyyy-MM-dd"-->
- <!--:placeholder="$t('请选择') + $t('EHS评估/审查')">-->
- <!--</el-date-picker>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('培训')" prop="training">-->
- <!--<el-date-picker clearable size="small" style="width: 200px"-->
- <!--v-model="form.training"-->
- <!--type="date"-->
- <!--value-format="yyyy-MM-dd"-->
- <!--:placeholder="$t('请选择') + $t('培训')"-->
- <!--:picker-options="trainingDatePicker">-->
- <!--</el-date-picker>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('PID更新')" prop="pidMaster">-->
- <!--<el-select v-model="form.pidMaster" :placeholder="$t('请选择') + $t('PID更新')">-->
- <!--<el-option-->
- <!--v-for="dict in pidMasterOptions"-->
- <!--:key="dict.dictValue"-->
- <!--:label="dict.dictLabel"-->
- <!--:value="dict.dictValue"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('SOP更新')" prop="sopUpdate">-->
- <!--<el-select v-model="form.sopUpdate" :placeholder="$t('请选择') + $t('SOP更新')">-->
- <!--<el-option-->
- <!--v-for="dict in sopUpdateOptions"-->
- <!--:key="dict.dictValue"-->
- <!--:label="dict.dictLabel"-->
- <!--:value="dict.dictValue"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('文档更新')" prop="docUpdate">-->
- <!--<el-select v-model="form.docUpdate" :placeholder="$t('请选择') + $t('文档更新')">-->
- <!--<el-option-->
- <!--v-for="dict in docUpdateOptions"-->
- <!--:key="dict.dictValue"-->
- <!--:label="dict.dictLabel"-->
- <!--:value="dict.dictValue"-->
- <!--></el-option>-->
- <!--</el-select>-->
- <!--</el-form-item>-->
- <!--<el-form-item label="PSSR" prop="pssr">-->
- <!--<el-date-picker clearable size="small" style="width: 200px"-->
- <!--v-model="form.pssr"-->
- <!--type="date"-->
- <!--value-format="yyyy-MM-dd"-->
- <!--:placeholder="$t('请选择') + 'PSSR'"-->
- <!--:picker-options="pssrDatePicker">-->
- <!--</el-date-picker>-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('PSSR编号')" prop="pssrNo">-->
- <!--<el-input v-model="form.pssrNo" :placeholder="$t('请输入') + $t('PSSR编号')" />-->
- <!--</el-form-item>-->
- <!--<el-form-item :label="$t('装置编号')" prop="plantNumber">
- <el-input v-model="form.plantNumber" :placeholder="$t('请输入') + $t('装置编号')" />
- </el-form-item>
- <el-form-item :label="$t('通知单')" prop="noticeLetter">
- <el-input v-model="form.noticeLetter" :placeholder="$t('请输入') + $t('通知单')" />
- </el-form-item>
- <el-form-item :label="$t('工作单')" prop="workLetter">
- <el-input v-model="form.workLetter" :placeholder="$t('请输入') + $t('工作单')" />
- </el-form-item>
- <el-form-item :label="$t('CTE工作号')" prop="cteNo">
- <el-input v-model="form.cteNo" :placeholder="$t('请输入') + $t('CTE工作号')" />
- </el-form-item>
- <el-form-item :label="$t('投资费用(RMB)')" prop="investCost">
- <el-input v-model="form.investCost" :placeholder="$t('请输入') + $t('投资费用(RMB)')" />
- </el-form-item>
- <el-form-item :label="$t('类别')" prop="category">
- <el-select v-model="form.category" :placeholder="$t('请选择') + $t('类别')">
- <el-option
- v-for="dict in categoryOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('重要性')" prop="significance">
- <el-input v-model="form.significance" :placeholder="$t('请输入') + $t('重要性')" />
- </el-form-item>
- <el-form-item :label="$t('分类')" prop="classification">
- <el-input v-model="form.classification" :placeholder="$t('请输入') + $t('分类')" />
- </el-form-item>
- <el-form-item :label="$t('仪表控制')" prop="dashControl">
- <el-input v-model="form.dashControl" :placeholder="$t('请输入') + $t('仪表控制')" />
- </el-form-item>
- <el-form-item :label="$t('预计完成时间')" prop="estimateEndtime">
- <el-date-picker clearable size="small" style="width: 200px"
- v-model="form.estimateEndtime"
- type="date"
- value-format="yyyy-MM-dd"
- :placeholder="$t('请选择') + $t('预计完成时间')">
- </el-date-picker>
- </el-form-item>
- <el-form-item :label="$t('EHS审查数据库')" prop="ehsDb">
- <el-input v-model="form.ehsDb" :placeholder="$t('请输入') + $t('EHS审查数据库')" />
- </el-form-item>
- <el-form-item :label="$t('PSSR数据库')" prop="pssrDb">
- <el-input v-model="form.pssrDb" :placeholder="$t('请输入') + $t('PSSR数据库')" />
- </el-form-item>
- <el-form-item :label="$t('CAPEX计划')" prop="capex">
- <el-input v-model="form.capex" :placeholder="$t('请输入') + $t('CAPEX计划')" />
- </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="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" 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">编辑</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>
- <!-- MOC类型说明对话框 -->
- <el-dialog v-dialogDrag :title="mocTypeInfo.title" :visible.sync="mocTypeInfo.open" width="1000px" append-to-body>
- <el-image
- style="width: 947px; height: 394px"
- :src="require('@/assets/image/moc/mocTypeInfo.png')"
- fit="fill"></el-image>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="mocTypeInfo.open = false">{{ $t('确 定') }}</el-button>
- </div>
- </el-dialog>
- <!-- 卡具状态对话框 -->
- <el-dialog v-dialogDrag :title="statusChart.title" :visible.sync="statusChart.open" width="500px" append-to-body>
- <status-chart :timeliness="2" :tempCategory="1"></status-chart>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="statusChart.open = false">{{ $t('确 定') }}</el-button>
- </div>
- </el-dialog>
- <!-- 部门对话框 -->
- <el-dialog v-dialogDrag :title="departmentChart.title" :visible.sync="departmentChart.open" width="500px" append-to-body>
- <department-chart :timeliness="2" :tempCategory="1"></department-chart>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="departmentChart.open = false">{{ $t('确 定') }}</el-button>
- </div>
- </el-dialog>
- <!-- 泄露位置对话框 -->
- <el-dialog v-dialogDrag :title="leakLocationChart.title" :visible.sync="leakLocationChart.open" width="500px" append-to-body>
- <leak-location-chart :timeliness="2" :tempCategory="1"></leak-location-chart>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="leakLocationChart.open = false">{{ $t('确 定') }}</el-button>
- </div>
- </el-dialog>
- <!-- 介质类型对话框 -->
- <el-dialog v-dialogDrag :title="materialTypeChart.title" :visible.sync="materialTypeChart.open" width="500px" append-to-body>
- <material-type-chart :timeliness="2" :tempCategory="1"></material-type-chart>
- <material-type-chart2 :timeliness="2" :tempCategory="1"></material-type-chart2>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="materialTypeChart.open = false">{{ $t('确 定') }}</el-button>
- </div>
- </el-dialog>
- <!-- 堵漏日期对话框 -->
- <el-dialog v-dialogDrag :title="sealDateChart.title" :visible.sync="sealDateChart.open" width="500px" append-to-body>
- <seal-date-chart :timeliness="2" :tempCategory="1"></seal-date-chart>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="sealDateChart.open = false">{{ $t('确 定') }}</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { delay, listPermanent, listTemporary, listAquifier, listFacility, listInterlock, getMoc, delMoc, addMoc, updateMoc, exportMoc } from "@/api/process/moc";
- import { treeselect } from "@/api/system/dept";
- import { getToken } from "@/utils/auth";
- import Treeselect from "@riophae/vue-treeselect";
- import "@riophae/vue-treeselect/dist/vue-treeselect.css";
- import {addCommonfile, allFileList, delCommonfile, updateCommonfile} from "@/api/common/commonfile";
- import statusChart from "../chart/statusChart";
- import departmentChart from "../chart/departmentChart";
- import leakLocationChart from "../chart/leakLocationChart";
- import materialTypeChart from "../chart/materialTypeChart";
- import materialTypeChart2 from "../chart/materialTypeChart2";
- import sealDateChart from "../chart/sealDateChart";
- export default {
- name: "Aquifier",
- components: { sealDateChart, materialTypeChart, materialTypeChart2, leakLocationChart, departmentChart, statusChart, Treeselect },
- data() {
- var validateDocUpdate = (rule, value, callback) => {
- if (value == 1) {
- if (this.form.pidMaster == 0 && this.form.sopUpdate == 0) {
- return callback(new Error('PID/SOP未更新'));
- } else {
- return callback();
- }
- } else {
- return callback();
- }
- };
- return {
- sealDateChart: {
- open: false,
- title: '堵漏日期数据统计'
- },
- materialTypeChart: {
- open: false,
- title: '介质类型数据统计'
- },
- leakLocationChart: {
- open: false,
- title: '泄露位置数据统计'
- },
- departmentChart: {
- open: false,
- title: '部门数据统计'
- },
- statusChart: {
- open: false,
- title: '卡具状态数据统计'
- },
- delayForm: {
- id: null,
- extention: null,
- },
- delayDialog: {
- open: false,
- title: null,
- },
- mocTypeInfo: {
- open: false,
- title: 'MOC类型说明'
- },
- drawer: false,
- direction: 'rtl',
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: false,
- // 总条数
- total: 0,
- // MOC管理表格数据
- mocList: [],
- // 弹出层标题
- title: "",
- // 部门树选项
- deptOptions: undefined,
- clientHeight:300,
- // 是否显示弹出层
- open: false,
- // 卡具状态字典
- mocStatusOptions: [],
- // 装置字典
- plantCodeOptions: [],
- // 类别字典
- categoryOptions: [],
- // 区域字典
- areaOptions: [],
- // PID MASTER更新字典
- pidMasterOptions: [],
- // 临时MOC状态字典
- temporaryStateOptions: [],
- // SOP更新字典
- sopUpdateOptions: [],
- // 文件更新字典
- docUpdateOptions:[],
- // 实施情况字典
- trueStateOptions: [],
- // 变更性质字典
- changeNatureOptions: [],
- // 风险等级字典
- riskLevelOptions: [],
- // MOC类型字典
- mocTypeOptions: [],
- // MC情况字典
- mcDetailOptions: [],
- //时间选择限制
- ehsCheckDate: '',
- trainingDatePicker: this.pickerOptionsTraining(),
- pssrDatePicker: this.pickerOptionsPssr(),
- // 用户导入参数
- upload: {
- //下载模板请求地址
- downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
- //下载模板类型
- type: 'moc',
- // 是否显示弹出层(用户导入)
- open: false,
- // 弹出层标题(用户导入)
- title: "",
- // 是否禁用上传
- isUploading: false,
- // 是否更新已经存在的用户数据
- updateSupport: 0,
- // 设置上传的请求头部
- headers: { Authorization: "Bearer " + getToken() },
- // 上传的地址
- url: process.env.VUE_APP_BASE_API + "/process/moc/importData"
- },
- // 报告附件参数
- doc: {
- file: "",
- // 是否显示弹出层(报告附件)
- open: false,
- // 弹出层标题(报告附件)
- title: "附件",
- // 是否禁用上传
- 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: 'moc'
- },
- pType: 'moc',
- pId: null,
- form: {}
- },
- pdf : {
- title: '',
- pdfUrl: '',
- numPages: null,
- open: false,
- pageNum: 1,
- pageTotalNum: 1,
- loadedRatio: 0,
- },
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 20,
- plantCode: null,
- mocNo: null,
- plantNumber: null,
- noticeLetter: null,
- workLetter: null,
- cteNo: null,
- investCost: null,
- category: null,
- significance: null,
- classification: null,
- area: null,
- dashControl: null,
- title: null,
- owner: null,
- approveTime: null,
- estimateEndtime: null,
- endtime: null,
- trueState: null,
- changeNature: null,
- overTime: null,
- riskLevel: null,
- training: null,
- pssr: null,
- ehsCheck: null,
- ehsDb: null,
- pidMaster: null,
- pssrDb: null,
- capex: null,
- remarks: null,
- companyMocNo: null,
- projectNo: null,
- mocType: null,
- mcTime: null,
- mcDetail: null,
- docUpdate: null,
- pssrNo: null,
- timeliness: null,
- tempCategory: null,
- expTime: null,
- tempState: null,
- location: null,
- finishDate: null,
- processUnit: null,
- department: null,
- leakLocation: null,
- pressure: null,
- temperature: null,
- leakFluid: null,
- materialType: null,
- planDate: null,
- sealDate: null,
- extention1: null,
- extention2: null,
- extention3: null,
- extention4: null,
- extention5: null,
- extention6: null,
- extention7: null,
- extention8: null,
- extention9: null,
- status: null,
- },
- chartParams: {
- year : 2021
- },
- yearOption: [2020,2021],
- // 表单参数
- form: {},
- // 表单校验
- delayRules: {
- extention: [
- {required: true, message: this.$t('延期日期') + this.$t('不能为空'), trigger: "change"}
- ],
- },
- rules: {
- mocNo: [
- { required: true, message: this.$t('MOC编号') + this.$t('不能为空'), trigger: "change" }
- ],
- docUpdate: [
- // { required: true, message: this.$t('文档更新') + this.$t('不能为空'), trigger: "change" },
- { validator: validateDocUpdate, trigger: 'change' }
- ],
- deptId: [
- { required: true, message: this.$t('归属部门') + this.$t('不能为空'), trigger: "change" }
- ],
- },
- };
- },
- watch: {
- // 根据名称筛选部门树
- deptName(val) {
- this.$refs.tree.filter(val);
- }
- },
- created() {
- //设置表格高度对应屏幕高度
- this.$nextTick(() => {
- this.clientHeight = (document.body.clientHeight - 80) * 0.8
- })
- this.getList();
- this.getTreeselect();
- this.getDicts("MOC_STATUS").then(response => {
- this.mocStatusOptions = response.data;
- });
- this.getDicts("MC_DETAIL").then(response => {
- this.mcDetailOptions = response.data;
- });
- this.getDicts("MOC_TYPE").then(response => {
- this.mocTypeOptions = response.data;
- });
- this.getDicts("PLANT_DIVIDE").then(response => {
- this.plantCodeOptions = response.data;
- });
- this.getDicts("MOC_CATEGORY").then(response => {
- this.categoryOptions = response.data;
- });
- this.getDicts("MOC_AREA").then(response => {
- this.areaOptions = response.data;
- });
- this.getDicts("YES_NO_EN").then(response => {
- this.pidMasterOptions = response.data;
- this.sopUpdateOptions = response.data;
- this.docUpdateOptions = response.data;
- });
- this.getDicts("MOC_TEMPORARYSTATE").then(response => {
- this.temporaryStateOptions = response.data;
- });
- this.getDicts("MOC_STATE").then(response => {
- this.trueStateOptions = response.data;
- });
- this.getDicts("MOC_CHANGE").then(response => {
- this.changeNatureOptions = response.data;
- });
- this.getDicts("MOC_RISKLEVEL").then(response => {
- this.riskLevelOptions = response.data;
- });
- },
- methods: {
- /** 移除按钮操作 */
- handleRemove(row) {
- this.$confirm(this.$t('是否确认移除?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function() {
- updateMoc({id: row.id, status: 0});
- }).then(() => {
- this.getList();
- this.msgSuccess(this.$t('移除成功'));
- })
- },
- /** 查询MOC管理列表 */
- getList() {
- this.loading = true;
- let _this = this
- listAquifier(this.queryParams).then(response => {
- this.mocList = response.rows;
- this.mocList.forEach(function (value,key,arr) {
- if (value.overTime == null) {
- _this.mocList[key].overTime = "N.A."
- }
- });
- this.total = response.total;
- this.loading = false;
- });
- },
- // 单元格样式
- tableCellStyle( {row, column, rowIndex, columnIndex} ) {
- let today = new Date(); // 当前时间
- let expTime = new Date(row.expTime);
- if (today.getTime() < expTime.getTime()) {
- let difference = expTime.getTime() - today.getTime(); // 时间差
- if (row.status == 0) { // 移除的数据
- return "background-color: rgba(146, 208, 80, 1);";
- } else if (row.expTime != null && row.expTime != '') {
- if (difference <= 7 * 24 * 60 * 60 * 1000) { // 到期时间 - 当前时间 <= 7
- return "background-color: rgba(250, 191, 143, 1);";
- } else if (difference >= 7 * 24 * 60 * 60 * 1000
- && difference <= 14 * 24 * 60 * 60 * 1000) { // 7 <= 到期时间 - 当前时间 <= 14
- return "background-color: rgba(255, 255, 0, 1);";
- }
- }
- }
- },
- //根据分数显示颜色提示
- // tableCellStyle({ row, column, rowIndex, columnIndex }) {
- // if (columnIndex == 3 && row.trueState == 10){
- // return "color: rgba(45, 58, 79, 0.98) "
- // }else if (columnIndex == 3 && row.trueState == 12){
- // return "color: rgba(255, 26, 26, 0.98) "
- // }else if (columnIndex == 3 && row.trueState == 14){
- // return "color: rgba(95, 153, 248, 0.98) "
- // }
- // },
- /** 查询部门下拉树结构 */
- getTreeselect() {
- treeselect().then(response => {
- this.deptOptions = response.data;
- });
- },
- // 卡具状态字典翻译
- mocStatusFormat(row, column) {
- return this.selectDictLabel(this.mocStatusOptions, row.status);
- },
- // 装置字典翻译
- plantCodeFormat(row, column) {
- return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
- },
- // 类别字典翻译
- categoryFormat(row, column) {
- return this.selectDictLabel(this.categoryOptions, row.category);
- },
- // 实施情况字典翻译
- trueStateFormat(row, column) {
- return this.selectDictLabel(this.trueStateOptions, row.trueState);
- },
- // 变更性质字典翻译
- changeNatureFormat(row, column) {
- return this.selectDictLabel(this.changeNatureOptions, row.changeNature);
- },
- // 风险等级字典翻译
- riskLevelFormat(row, column) {
- return this.selectDictLabel(this.riskLevelOptions, row.riskLevel);
- },
- // 区域字典翻译
- areaFormat(row, column) {
- return this.selectDictLabel(this.areaOptions, row.area);
- },
- // PID MASTER更新字典翻译
- pidMasterFormat(row, column) {
- return this.selectDictLabel(this.pidMasterOptions, row.pidMaster);
- },
- // 临时MOC状态字典翻译
- temporaryStateFormat(row, column) {
- return this.selectDictLabel(this.temporaryStateOptions, row.temporaryState);
- },
- // SOP更新字典翻译
- sopUpdateFormat(row, column) {
- return this.selectDictLabel(this.sopUpdateOptions, row.sopUpdate);
- },
- // MC情况字典翻译
- mcDetailFormat(row, column) {
- return this.selectDictLabel(this.mcDetailOptions, row.mcDetail);
- },
- // MOC类型字典翻译
- mocTypeFormat(row, column) {
- return this.selectDictLabel(this.mocTypeOptions, row.mocType);
- },
- // 文件更新字典翻译
- docUpdateFormat(row, column) {
- return this.selectDictLabel(this.docUpdateOptions, row.docUpdate);
- },
- // 取消按钮
- cancelDelay() {
- this.delayDialog.open = false;
- },
- cancel() {
- this.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- plantCode: null,
- mocNo: null,
- plantNumber: null,
- noticeLetter: null,
- workLetter: null,
- cteNo: null,
- investCost: null,
- category: null,
- significance: null,
- classification: null,
- area: null,
- dashControl: null,
- title: null,
- owner: null,
- approveTime: null,
- estimateEndtime: null,
- endtime: null,
- trueState: null,
- changeNature: null,
- overTime: null,
- riskLevel: null,
- training: null,
- pssr: null,
- ehsCheck: null,
- ehsDb: null,
- pidMaster: null,
- pssrDb: null,
- capex: null,
- delFlag: null,
- createrCode: null,
- createdate: null,
- updaterCode: null,
- updatedate: null,
- deptId: null,
- remarks: null,
- temporaryState: null,
- sopUpdate: null
- };
- this.resetForm("form");
- },
- // 限制时间范围
- pickerOptionsTraining() {
- const self = this
- return {
- disabledDate(time){
- return time.getTime() < new Date(self.form.ehsCheck).getTime()
- }
- }
- },
- pickerOptionsPssr() {
- const self = this
- return {
- disabledDate(time){
- if (self.form.training != null) {
- return time.getTime() < new Date(self.form.training).getTime()
- }else {
- return time.getTime() < new Date(self.form.ehsCheck).getTime()
- }
- }
- }
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.id)
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.open = true;
- this.title = this.$t('新增') + " " + this.$t('MOC管理');
- },
- //实施情况Finished变更
- changeTrueState(val) {
- if (val == 10) {
- }else {
- this.$refs['form'].clearValidate();
- }
- },
- changeChangeNature(val) {
- if (val == 10) {
- }else if (val = 12) {
- this.$refs['form'].clearValidate();
- this.form.temporaryState = "14";
- this.form.overTime = "";
- }
- },
- //根据分数显示颜色提示
- tableCellClassName({ row, column, rowIndex, columnIndex }) {
- if (columnIndex == 13){
- return this.changeColor(row.isEhsCheck, row.ehsCheck)
- }
- if (columnIndex == 14){
- return this.changeColor(row.isTraining, row.training)
- }
- if (columnIndex == 15){
- return this.changeColor(row.isPssr, row.pssr)
- }
- },
- changeColor (value, dateValue) {
- if (value !== "1" && dateValue !== null){
- return 'cellMoc'
- }
- },
- /** 延期按钮操作 */
- handleDelay(row, type) {
- if (type == 1) { // 自动延期
- if (row.sealDate == null) {
- this.msgError(this.$t('未填写堵漏日期,不可执行延期操作。'));
- } else {
- this.$confirm(this.$t('是否确认延期?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function() {
- return delay({id: row.id, extention: null});
- }).then(() => {
- this.getList();
- this.msgSuccess(this.$t('延期成功'));
- })
- }
- } else if (type == 2) { // 手动延期
- this.delayForm.id = row.id;
- this.delayDialog.open = true;
- this.delayDialog.title = row.mocNo.toString() + '延期操作';
- }
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- const id = row.id || this.ids
- getMoc(id).then(response => {
- this.form = response.data;
- this.open = true;
- this.title = this.$t('修改') + this.$t('MOC管理');
- });
- },
- /** 提交按钮 */
- submitDelayForm() {
- delay(this.delayForm).then(response => {
- this.msgSuccess(this.$t('延期成功'));
- this.delayDialog.open = false;
- this.getList();
- });
- },
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.form.trueState == "10") {
- if (this.form.mocNo != null && this.form.plantNumber != null && this.form.category != null && this.form.significance != null && this.form.classification != null
- && this.form.area != null && this.form.title != null && this.form.owner != null && this.form.approveTime != null && this.form.estimateEndtime != null
- && this.form.endtime != null && this.form.changeNature != null && this.form.riskLevel != null && this.form.training != null && this.form.pssr != null) {
- if (this.form.id != null) {
- updateMoc(this.form).then(response => {
- this.msgSuccess(this.$t('修改成功'));
- this.open = false;
- this.getList();
- });
- } else {
- this.form.timeliness = 2;
- this.form.tempCategory = 1;
- addMoc(this.form).then(response => {
- this.msgSuccess(this.$t('新增成功'));
- this.open = false;
- this.getList();
- });
- }
- } else {
- this.msgError(this.$t('存在必填项未填,实施情况修改Finished失败'));
- }
- }else {
- if (this.form.id != null) {
- updateMoc(this.form).then(response => {
- this.msgSuccess(this.$t('修改成功'));
- this.open = false;
- this.getList();
- });
- } else {
- this.form.timeliness = 2;
- this.form.tempCategory = 1;
- addMoc(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 delMoc(ids);
- }).then(() => {
- this.getList();
- this.msgSuccess(this.$t('删除成功'));
- })
- },
- /** 导出按钮操作 */
- handleExport() {
- const queryParams = this.queryParams;
- this.$confirm(this.$t('是否确认导出所有MOC管理数据项?'), this.$t('警告'), {
- confirmButtonText: this.$t('确定'),
- cancelButtonText: this.$t('取消'),
- type: "warning"
- }).then(function() {
- return exportMoc(queryParams);
- }).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();
- },
- //数据分析
- handleData(){
- var now = new Date();
- var year = now.getFullYear(); //得到年份
- this.yearOption = [year-2 , year-1 ,year]
- this.drawer = true
- },
- /** 报告附件按钮操作 */
- handleDoc(row , fileType) {
- this.doc.pType = fileType
- this.doc.queryParams.pType = fileType
- this.doc.id = row.id;
- this.doc.title = row.title;
- 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
- },
- // 取消
- 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('删除成功'));
- })
- },
- }
- };
- </script>
- <style>
- .colorMark {
- color: #6f6f6f;
- text-align: right;
- font-weight:bold;
- font-size: 13px;
- padding-bottom: 5px;
- }
- .rectangleLightgreen {
- width: 40px !important;
- height: 20px !important;
- }
- .rectangleFlesh {
- width: 40px !important;
- height: 20px !important;
- }
- .rectangleYellow {
- width: 40px !important;
- height: 20px !important;
- }
- #sealDate:hover{
- cursor: pointer;
- }
- #materialType:hover{
- cursor: pointer;
- }
- #leakLocation:hover{
- cursor: pointer;
- }
- #department:hover{
- cursor: pointer;
- }
- #status:hover{
- cursor: pointer;
- }
- #moc-type:hover{
- cursor: pointer;
- }
- .text {
- font-size: 14px;
- }
- .item {
- margin-bottom: 18px;
- }
- .clearfix {
- color: #1e1e1e;
- }
- .clearfix:before,
- .clearfix:after {
- display: table;
- content: "";
- }
- .clearfix:after {
- clear: both
- }
- .box-card {
- width: 100%;
- }
- .el-drawer__body {
- overflow: auto;
- }
- .el-drawer__container ::-webkit-scrollbar {
- display: none;
- }
- </style>
|