123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814 |
- <template>
- <div class="app-container">
- <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
- <el-form-item label="当班班组" prop="shiftTeam">
- <el-input
- v-model="queryParams.shiftTeam"
- clearable
- placeholder="请输入当班班组"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item>
- <el-button icon="el-icon-search" size="mini" type="primary" @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
- v-hasPermi="['shiftmgr:log:add']"
- icon="el-icon-plus"
- plain
- size="mini"
- type="primary"
- @click="handleAdd"
- >新增
- </el-button>
- </el-col>
- <!-- <el-col :span="1.5">
- <el-button
- v-hasPermi="['shiftmgr:log:edit']"
- :disabled="single"
- icon="el-icon-edit"
- plain
- size="mini"
- type="success"
- @click="handleUpdate"
- >修改
- </el-button>
- </el-col>
- <el-col :span="1.5">
- <el-button
- v-hasPermi="['shiftmgr:log:remove']"
- :disabled="multiple"
- icon="el-icon-delete"
- plain
- size="mini"
- type="danger"
- @click="handleDelete"
- >删除
- </el-button>
- </el-col>-->
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="warning"-->
- <!-- plain-->
- <!-- icon="el-icon-download"-->
- <!-- size="mini"-->
- <!-- @click="handleExport"-->
- <!-- v-hasPermi="['shiftmgr:log:export']"-->
- <!-- >导出-->
- <!-- </el-button>-->
- <!-- </el-col>-->
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-loading="loading" :data="logList" :height="clientHeight" border
- @selection-change="handleSelectionChange">
- <el-table-column align="center" type="selection" width="55"/>
- <el-table-column align="center" label="当班班组" prop="shiftTeam"/>
- <el-table-column align="center" label="接班时间" prop="takeOverTime">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.takeOverTime, '{y}-{m}-{d} {h}:{i}') }} </span>
- </template>
- </el-table-column>
- <el-table-column align="center" label="交班时间" prop="giveOverTime">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.giveOverTime, '{y}-{m}-{d} {h}:{i}') }} </span>
- </template>
- </el-table-column>
- <el-table-column align="center" label="接班时工艺状况" prop="tocp"/>
- <el-table-column align="center" label="交班班组人员" prop="hoShiftSup">
- <template slot-scope="scope">
- <span>{{ bzFormat(scope.row.hoShiftSup) }} </span>
- </template>
- </el-table-column>
- <el-table-column align="center" label="接班班组人员" prop="toShiftSup">
- <template slot-scope="scope">
- <span>{{ bzFormat(scope.row.toShiftSup) }} </span>
- </template>
- </el-table-column>
- <el-table-column :formatter="statusFormat" align="center" label="状态" prop="status"/>
- <el-table-column align="center" label="备注" prop="remarks"/>
- <el-table-column align="center" label="操作">
- <template slot-scope="scope">
- <el-button
- icon="el-icon-download"
- size="mini"
- type="text"
- v-if="scope.row.status==1"
- @click="exportLog(scope.row.id)"
- >导出
- </el-button>
- <el-button
- icon="el-icon-document"
- size="mini"
- type="text"
- @click="openDetail(scope.row.id)"
- >详情
- </el-button>
- <el-button
- v-if="scope.row.status!=1&&scope.row.hoShiftSup==userId"
- v-hasPermi="['shiftmgr:log:edit']"
- icon="el-icon-edit"
- size="mini"
- type="text"
- @click="handleUpdate(scope.row)"
- >修改
- </el-button>
- <el-button
- v-if="scope.row.status!=1&&scope.row.hoShiftSup==userId"
- v-hasPermi="['shiftmgr:log:remove']"
- icon="el-icon-delete"
- size="mini"
- type="text"
- @click="handleDelete(scope.row)"
- >删除
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination
- v-show="total>0"
- :limit.sync="queryParams.pageSize"
- :page.sync="queryParams.pageNum"
- :total="total"
- @pagination="getList"
- />
- <!-- 添加或修改轮班日志对话框 -->
- <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" append-to-body
- contentClassName="content"
- width="60%">
- <el-form ref="form" :model="form" :rules="rules" label-width="auto">
- <el-collapse>
- <el-descriptions :column="4" border direction="vertical" label-class-name="des-label label-hh" size="">
- <el-descriptions-item :span="2" label="Shift team 当班班组:">
- <el-form-item prop="shiftTeam">
- <el-input v-if="this.isEdit" v-model="form.shiftTeam" disabled placeholder="请输入当班班组"/>
- <el-select v-if="!this.isEdit" v-model="hoShiftTeam" clearable filterable placeholder="请选择交班班组"
- style="width: 50%;">
- <el-option
- v-for="dict in teamOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"/>
- </el-select>
- <el-select v-if="!this.isEdit" v-model="toShiftTeam" clearable filterable placeholder="请选择接班班组"
- style="width: 50%;">
- <el-option
- v-for="dict in teamOptions"
- :key="dict.dictValue"
- :label="dict.dictLabel"
- :value="dict.dictValue"/>
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="Take-Over time 接班时间:">
- <el-form-item prop="takeOverTime">
- <el-date-picker v-model="form.takeOverTime"
- clearable
- format="yyyy-MM-dd HH:mm"
- placeholder="请选择接班时间"
- style="width: 100%"
- type="datetime"
- value-format="yyyy-MM-dd HH:mm">
- </el-date-picker>
- </el-form-item>
- </el-descriptions-item>
- </el-descriptions>
- <el-collapse-item title="►Take-Over Conditions of Process 接班时工艺状况:">
- <el-input v-model="form.tocp" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="►EHS and 5S briefing 安全、环保、健康及5S事项班前简报">
- <el-input v-model="form.ehs5sBriefing" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="►Plant Conditions and Actions/Quality 装置状况和操作/质量:">
- <el-collapse-item title="● Splitter and Oxidation/Absorption C4分离和氧化吸收">
- <el-input v-model="form.soa" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● Stripping and Hydrogenation 汽提和加氢">
- <el-input v-model="form.sh" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● BDO Cyclization BDO环化">
- <el-input v-model="form.bdoc" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● THF Distillation THF精馏">
- <el-input v-model="form.thfd" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● PTHF PTHF单元">
- <el-input v-model="form.pthfUnit" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● DBP Distillation DBP精馏">
- <el-input v-model="form.dbpd" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● TRU and Steam system TRU和蒸汽系统">
- <el-input v-model="form.truss" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● PolyTHF Complex Utility system PolyTHF Complex公用工程系统">
- <el-input v-model="form.pthfCus" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● BIP Utility system BIP公用工程系统">
- <el-input v-model="form.bipus" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- </el-collapse-item>
- <el-collapse-item title="►LPG and H2 (3rd party) 液化气和氢气(外部)">
- <el-input v-model="form.lpgH2" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="►Environment, Health and Safety 环境,健康和安全">
- <el-descriptions :column="4" border direction="vertical" label-class-name="des-label label-hh" size="">
- <el-descriptions-item
- :label="'● Environmental Protection Devices 环保设施状况'"
- :span="4"
- contentClassName="contentSty">
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="TRU CO Q125601">
- <el-radio-group v-model="form.q125601">
- <el-radio :label="'正常'">正常</el-radio>
- <el-radio :label="'异常'">异常</el-radio>
- </el-radio-group>
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="TRU 非甲烷总烃 Q125602">
- <el-radio-group v-model="form.q125602">
- <el-radio :label="'正常'">正常</el-radio>
- <el-radio :label="'异常'">异常</el-radio>
- </el-radio-group>
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="厂界 THF Q312018-Q1">
- <el-radio-group v-model="form.q312018Q1">
- <el-radio :label="'正常'">正常</el-radio>
- <el-radio :label="'异常'">异常</el-radio>
- </el-radio-group>
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="厂界 MeOH Q312018-Q2">
- <el-radio-group v-model="form.q312018Q2">
- <el-radio :label="'正常'">正常</el-radio>
- <el-radio :label="'异常'">异常</el-radio>
- </el-radio-group>
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="厂界 MeAC Q312018-Q3">
- <el-radio-group v-model="form.q312018Q3">
- <el-radio :label="'正常'">正常</el-radio>
- <el-radio :label="'异常'">异常</el-radio>
- </el-radio-group>
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="厂界 Xylene Q312018-Q4">
- <el-radio-group v-model="form.q312018Q4">
- <el-radio :label="'正常'">正常</el-radio>
- <el-radio :label="'异常'">异常</el-radio>
- </el-radio-group>
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="雨水总管 TOC Q312000">
- <el-radio-group v-model="form.q312000">
- <el-radio :label="'正常'">正常</el-radio>
- <el-radio :label="'异常'">异常</el-radio>
- </el-radio-group>
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="雨水总管 PH Q312001">
- <el-radio-group v-model="form.q312001">
- <el-radio :label="'正常'">正常</el-radio>
- <el-radio :label="'异常'">异常</el-radio>
- </el-radio-group>
- </el-descriptions-item>
- </el-descriptions>
- <el-descriptions-item :span="4" label="异常状况描述:">
- <el-input v-model="form.epdOther" placeholder="请输入内容" type="textarea"/>
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● Other 其他">
- <el-input v-model="form.ehsOther" placeholder="请输入内容" type="textarea"/>
- </el-descriptions-item>
- </el-collapse-item>
- <el-collapse-item title="►Quality and Analytical Report 产品质量和分析报告">
- <el-input v-model="form.qar" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="►Maintenance Activities 电仪和机械维修">
- <el-collapse-item title="● E&I电气及仪表">
- <el-input v-model="form.maEi" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● Mechanical 机械">
- <el-input v-model="form.maMechanical" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- </el-collapse-item>
- <el-collapse-item title="►Third Party Communication 第三方联系">
- <el-input v-model="form.thirdPartyCommunication" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="►Follow-up Activities for Maintenance part 接班班组需继续的维修工作">
- <el-collapse-item title="● E&I电气及仪表">
- <el-input v-model="form.fampEi" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="● Mechanical 机械">
- <el-input v-model="form.fampMechanical" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- </el-collapse-item>
- <el-collapse-item title="►Follow-up Activities for Operation part 接班班组需继续的操作">
- <el-input v-model="form.faop" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-collapse-item title="►Miscellaneous / Comments 其他/评述">
- <el-input v-model="form.comments" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- <el-descriptions :column="4" border direction="vertical" label-class-name="des-label label-hh" size="">
- <el-descriptions-item :span="2" label="Hand-Over Shift Supervisor 交班班组人员">
- <el-form-item prop="hoShiftSup">
- <el-select v-model="form.hoShiftSup" clearable filterable placeholder="请选择交班班组人员"
- style="width: 100%;">
- <el-option v-for="user in userList"
- :key="user.userId"
- :label="user.nickName"
- :value="user.userId"
- />
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="Take-Over Shift Supervisor 接班班组人员">
- <el-form-item prop="toShiftSup">
- <el-select v-model="form.toShiftSup" clearable filterable placeholder="请选择接班班组人员"
- style="width: 100%;">
- <el-option v-for="user in userList"
- :key="user.userId"
- :label="user.nickName"
- :value="user.userId"
- />
- </el-select>
- </el-form-item>
- </el-descriptions-item>
- </el-descriptions>
- <el-collapse-item title="备注">
- <el-input v-model="form.remarks" placeholder="请输入内容" type="textarea"/>
- </el-collapse-item>
- </el-collapse>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">保 存</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <el-dialog :close-on-click-modal="false" :visible.sync="detail.open" append-to-body title="轮班日志详情"
- width="60%">
- <el-descriptions :column="4" border direction="vertical" label-class-name="label-hh" size="default">
- <el-descriptions-item :span="2" label="Shift team 当班班组:">
- {{ detail.data.shiftTeam }}
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="Take-Over time 接班时间:">
- {{ detail.data.takeOverTime }}
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="Hand-Over time 交班时间:">
- {{ detail.data.giveOverTime }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="►Take-Over Conditions of Process 接班时工艺状况:">
- {{ detail.data.tocp }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="►EHS and 5S briefing 安全、环保、健康及5S事项班前简报">
- {{ detail.data.ehs5sBriefing }}
- </el-descriptions-item>
- <el-descriptions-item
- :label="'►Plant Conditions and Actions/Quality 装置状况和操作/质量:\n● Splitter and Oxidation/Absorption C4分离和氧化吸收'"
- :span="4">
- {{ detail.data.soa }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● Stripping and Hydrogenation 汽提和加氢">
- {{ detail.data.sh }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● BDO Cyclization BDO环化">
- {{ detail.data.bdoc }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● THF Distillation THF精馏">
- {{ detail.data.thfd }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● PTHF PTHF单元">
- {{ detail.data.pthfUnit }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● DBP Distillation DBP精馏">
- {{ detail.data.dbpd }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● TRU and Steam system TRU和蒸汽系统">
- {{ detail.data.truss }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● PolyTHF Complex Utility system PolyTHF Complex公用工程系统">
- {{ detail.data.pthfCus }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● BIP Utility system BIP公用工程系统">
- {{ detail.data.bipus }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="►LPG and H2 (3rd party) 液化气和氢气(外部)">
- {{ detail.data.lpgH2 }}
- </el-descriptions-item>
- <el-descriptions-item
- :label="'►Environment, Health and Safety 环境,健康和安全\n● Environmental Protection Devices 环保设施状况'"
- :span="4"
- contentClassName="contentSty">
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="TRU CO Q125601">
- {{ detail.data.q125601 }}
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="TRU 非甲烷总烃 Q125602">
- {{ detail.data.q125602 }}
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="厂界 THF Q312018-Q1">
- {{ detail.data.q312018Q1 }}
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="厂界 MeOH Q312018-Q2">
- {{ detail.data.q312018Q2 }}
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="厂界 MeAC Q312018-Q3">
- {{ detail.data.q312018Q3 }}
- </el-descriptions-item>
- <el-descriptions-item :span="1" label="厂界 Xylene Q312018-Q4">
- {{ detail.data.q312018Q4 }}
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="雨水总管 TOC Q312000">
- {{ detail.data.q312000 }}
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="雨水总管 PH Q312001">
- {{ detail.data.q312001 }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="异常状况描述:">
- {{ detail.data.epdOther }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● Other 其他">
- {{ detail.data.ehsOther }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="►Quality and Analytical Report 产品质量和分析报告">
- {{ detail.data.qar }}
- </el-descriptions-item>
- <el-descriptions-item :label="'Maintenance Activities 电仪和机械维修\n● E&I电气及仪表'" :span="4">
- {{ detail.data.maEi }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● Mechanical 机械">
- {{ detail.data.maMechanical }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="►Third Party Communication 第三方联系">
- {{ detail.data.thirdPartyCommunication }}
- </el-descriptions-item>
- <el-descriptions-item
- :label="'►Follow-up Activities for Maintenance part 接班班组需继续的维修工作\n● E&I电气及仪表'"
- :span="4">
- {{ detail.data.fampEi }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="● Mechanical 机械">
- {{ detail.data.fampMechanical }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="►Follow-up Activities for Operation part 接班班组需继续的操作">
- {{ detail.data.faop }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="►Miscellaneous / Comments 其他/评述">
- {{ detail.data.comments }}
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="Hand-Over Shift Supervisor 交班班组人员">
- {{ bzFormat(detail.data.hoShiftSup) }}
- </el-descriptions-item>
- <el-descriptions-item :span="2" label="Take-Over Shift Supervisor 接班班组人员">
- {{ bzFormat(detail.data.toShiftSup) }}
- </el-descriptions-item>
- <el-descriptions-item :span="4" label="备注">
- {{ detail.data.remark }}
- </el-descriptions-item>
- </el-descriptions>
- <div v-if="detail.data.toShiftSup==userId" slot="footer" class="dialog-footer">
- <el-button type="primary" @click="conform">确 认</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import {addLog, delLog, getLog, listLog, updateLog,getLastData, wordView} from "@/api/shiftmgr/log";
- import {listPostUser} from "@/api/system/user";
- export default {
- name: "Log",
- data() {
- return {
- detail: {
- open: false,
- data: {},
- },
- // 页面高度
- clientHeight: 300,
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- userId: '',
- hoShiftTeam: '',
- toShiftTeam: '',
- userList: [],
- teamList: [],
- // 非单个禁用
- single: true,
- isEdit: false,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: false,
- // 总条数
- total: 0,
- // 轮班日志表格数据
- logList: [],
- // 班组字典
- teamOptions: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 20,
- shiftTeam: null,
- takeOverTime: null,
- giveOverTime: null,
- tocp: null,
- ehs5sBriefing: null,
- soa: null,
- sh: null,
- bdoc: null,
- thfd: null,
- pthfUnit: null,
- dbpd: null,
- truss: null,
- pthfCus: null,
- bipus: null,
- lpgH2: null,
- q125601: null,
- q125602: null,
- q312018Q1: null,
- q312018Q2: null,
- q312018Q3: null,
- q312018Q4: null,
- q312000: null,
- q312001: null,
- epdOther: null,
- ehsOther: null,
- qar: null,
- maEi: null,
- maMechanical: null,
- thirdPartyCommunication: null,
- fampEi: null,
- fampMechanical: null,
- faop: null,
- comments: null,
- hoShiftSup: null,
- toShiftSup: null,
- status: null,
- createrCode: null,
- createdate: null,
- updaterCode: null,
- updatedate: null,
- deptId: null,
- remarks: null
- },
- // 表单参数
- form: {},
- // 表单校验
- rules: {
- shiftTeam: [
- {required: true, message: "当班班组不能为空", trigger: "blur"}
- ],
- hoShiftSup: [
- {required: true, message: "交班班组人员不能为空", trigger: "blur"}
- ],
- toShiftSup: [
- {required: true, message: "接班班组人员不能为空", trigger: "blur"}
- ],
- }
- };
- },
- created() {
- this.getList();
- //设置表格高度对应屏幕高度
- this.$nextTick(() => {
- this.clientHeight = (document.body.clientHeight - 80) * 0.8
- });
- this.getDicts("TEAM_DIVIDE").then(res => {
- this.teamOptions = res.data;
- });
- this.getBzUser();
- },
- methods: {
- statusFormat(row) {
- return row.status == 1 ? '已确认' : '未确认'
- },
- bzFormat(userId) {
- for (let user of this.userList) {
- if (userId == user.userId) {
- return user.nickName;
- }
- }
- },
- getBzUser() {
- listPostUser({postCode: 'se'}).then(response => {
- this.userList = response;
- });
- },
- openDetail(id) {
- getLog(id).then(response => {
- this.detail.data = response.data;
- this.detail.open = true;
- });
- },
- /** 查询轮班日志列表 */
- getList() {
- this.loading = true;
- listLog(this.queryParams).then(response => {
- this.logList = response.data.rows;
- this.total = response.data.total;
- this.userId = response.msg;
- this.loading = false;
- });
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.detail.open = false;
- this.reset();
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- shiftTeam: null,
- takeOverTime: null,
- giveOverTime: null,
- tocp: null,
- ehs5sBriefing: null,
- soa: null,
- sh: null,
- bdoc: null,
- thfd: null,
- pthfUnit: null,
- dbpd: null,
- truss: null,
- pthfCus: null,
- bipus: null,
- lpgH2: null,
- q125601: null,
- q125602: null,
- q312018Q1: null,
- q312018Q2: null,
- q312018Q3: null,
- q312018Q4: null,
- q312000: null,
- q312001: null,
- epdOther: null,
- ehsOther: null,
- qar: null,
- maEi: null,
- maMechanical: null,
- thirdPartyCommunication: null,
- fampEi: null,
- fampMechanical: null,
- faop: null,
- comments: null,
- hoShiftSup: null,
- toShiftSup: null,
- delFlag: null,
- status: 0,
- createrCode: null,
- createdate: null,
- updaterCode: null,
- updatedate: null,
- deptId: null,
- remarks: 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.id)
- this.single = selection.length !== 1
- this.multiple = !selection.length
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.isEdit = false;
- this.reset();
- this.open = true;
- this.title = "添加轮班日志";
- getLastData({}).then(res => {
- if (res.data) {
- this.form = res.data;
- this.form.id = null;
- this.form.status = null;
- this.form.takeOverTime = this.form.giveOverTime
- this.form.giveOverTime = null;
- this.form.hoShiftSup = parseInt(this.userId);
- this.form.toShiftSup = "";
- }
- })
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- this.isEdit = true;
- const id = row.id || this.ids
- getLog(id).then(response => {
- response.data.toShiftSup = parseInt(response.data.toShiftSup);
- response.data.hoShiftSup = parseInt(response.data.hoShiftSup);
- this.form = response.data;
- this.open = true;
- this.title = "修改轮班日志";
- });
- },
- /** 提交按钮 */
- submitForm() {
- if (this.hoShiftTeam && this.hoShiftTeam) {
- if (this.hoShiftTeam === this.toShiftTeam) {
- return this.$message.error("交班班组不能为接班班组!")
- }
- for (let team of this.teamOptions) {
- if (team.dictValue === this.hoShiftTeam) {
- this.hoShiftTeam = team.dictLabel
- }
- if (team.dictValue === this.toShiftTeam) {
- this.toShiftTeam = team.dictLabel
- }
- }
- this.form.shiftTeam = this.hoShiftTeam + "->" + this.toShiftTeam;
- }
- if (this.form.giveOverTime) {
- this.form.giveOverTime.format("yyyy-MM-dd HH:mm")
- }
- this.$refs["form"].validate(valid => {
- if (valid) {
- if (this.form.id != null) {
- updateLog(this.form).then(response => {
- this.$modal.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- addLog(this.form).then(response => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- conform() {
- this.detail.data.status = 1;
- updateLog(this.detail.data).then(response => {
- this.$modal.msgSuccess("确认成功");
- this.detail.open = false;
- this.getList();
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$confirm('是否确认删除数据项?').then(function () {
- return delLog(ids);
- }).then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- }).catch(() => {
- });
- },
- /** 导出按钮操作 */
- handleExport() {
- this.download('shiftmgr/log/export', {
- ...this.queryParams
- }, `log_${new Date().getTime()}.xlsx`)
- },
- exportLog(id) {
- wordView(id).then(res => {
- if (res.msg)
- window.open(process.env.VUE_APP_BASE_API + res.msg);
- })
- }
- }
- };
- </script>
- <style>
- .des-label {
- color: #3a3a3a !important;
- font-size: 14px;
- }
- .label-hh {
- white-space: pre-line !important;
- width: 240px !important;
- }
- .contentSty {
- display: none !important;
- }
- </style>
|