index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814
  1. <template>
  2. <div class="app-container">
  3. <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px" size="small">
  4. <el-form-item label="当班班组" prop="shiftTeam">
  5. <el-input
  6. v-model="queryParams.shiftTeam"
  7. clearable
  8. placeholder="请输入当班班组"
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
  14. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <el-row :gutter="10" class="mb8">
  18. <el-col :span="1.5">
  19. <el-button
  20. v-hasPermi="['shiftmgr:log:add']"
  21. icon="el-icon-plus"
  22. plain
  23. size="mini"
  24. type="primary"
  25. @click="handleAdd"
  26. >新增
  27. </el-button>
  28. </el-col>
  29. <!-- <el-col :span="1.5">
  30. <el-button
  31. v-hasPermi="['shiftmgr:log:edit']"
  32. :disabled="single"
  33. icon="el-icon-edit"
  34. plain
  35. size="mini"
  36. type="success"
  37. @click="handleUpdate"
  38. >修改
  39. </el-button>
  40. </el-col>
  41. <el-col :span="1.5">
  42. <el-button
  43. v-hasPermi="['shiftmgr:log:remove']"
  44. :disabled="multiple"
  45. icon="el-icon-delete"
  46. plain
  47. size="mini"
  48. type="danger"
  49. @click="handleDelete"
  50. >删除
  51. </el-button>
  52. </el-col>-->
  53. <!-- <el-col :span="1.5">-->
  54. <!-- <el-button-->
  55. <!-- type="warning"-->
  56. <!-- plain-->
  57. <!-- icon="el-icon-download"-->
  58. <!-- size="mini"-->
  59. <!-- @click="handleExport"-->
  60. <!-- v-hasPermi="['shiftmgr:log:export']"-->
  61. <!-- >导出-->
  62. <!-- </el-button>-->
  63. <!-- </el-col>-->
  64. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  65. </el-row>
  66. <el-table v-loading="loading" :data="logList" :height="clientHeight" border
  67. @selection-change="handleSelectionChange">
  68. <el-table-column align="center" type="selection" width="55"/>
  69. <el-table-column align="center" label="当班班组" prop="shiftTeam"/>
  70. <el-table-column align="center" label="接班时间" prop="takeOverTime">
  71. <template slot-scope="scope">
  72. <span>{{ parseTime(scope.row.takeOverTime, '{y}-{m}-{d} {h}:{i}') }} </span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column align="center" label="交班时间" prop="giveOverTime">
  76. <template slot-scope="scope">
  77. <span>{{ parseTime(scope.row.giveOverTime, '{y}-{m}-{d} {h}:{i}') }} </span>
  78. </template>
  79. </el-table-column>
  80. <el-table-column align="center" label="接班时工艺状况" prop="tocp"/>
  81. <el-table-column align="center" label="交班班组人员" prop="hoShiftSup">
  82. <template slot-scope="scope">
  83. <span>{{ bzFormat(scope.row.hoShiftSup) }} </span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column align="center" label="接班班组人员" prop="toShiftSup">
  87. <template slot-scope="scope">
  88. <span>{{ bzFormat(scope.row.toShiftSup) }} </span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column :formatter="statusFormat" align="center" label="状态" prop="status"/>
  92. <el-table-column align="center" label="备注" prop="remarks"/>
  93. <el-table-column align="center" label="操作">
  94. <template slot-scope="scope">
  95. <el-button
  96. icon="el-icon-download"
  97. size="mini"
  98. type="text"
  99. v-if="scope.row.status==1"
  100. @click="exportLog(scope.row.id)"
  101. >导出
  102. </el-button>
  103. <el-button
  104. icon="el-icon-document"
  105. size="mini"
  106. type="text"
  107. @click="openDetail(scope.row.id)"
  108. >详情
  109. </el-button>
  110. <el-button
  111. v-if="scope.row.status!=1&&scope.row.hoShiftSup==userId"
  112. v-hasPermi="['shiftmgr:log:edit']"
  113. icon="el-icon-edit"
  114. size="mini"
  115. type="text"
  116. @click="handleUpdate(scope.row)"
  117. >修改
  118. </el-button>
  119. <el-button
  120. v-if="scope.row.status!=1&&scope.row.hoShiftSup==userId"
  121. v-hasPermi="['shiftmgr:log:remove']"
  122. icon="el-icon-delete"
  123. size="mini"
  124. type="text"
  125. @click="handleDelete(scope.row)"
  126. >删除
  127. </el-button>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <pagination
  132. v-show="total>0"
  133. :limit.sync="queryParams.pageSize"
  134. :page.sync="queryParams.pageNum"
  135. :total="total"
  136. @pagination="getList"
  137. />
  138. <!-- 添加或修改轮班日志对话框 -->
  139. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" append-to-body
  140. contentClassName="content"
  141. width="60%">
  142. <el-form ref="form" :model="form" :rules="rules" label-width="auto">
  143. <el-collapse>
  144. <el-descriptions :column="4" border direction="vertical" label-class-name="des-label label-hh" size="">
  145. <el-descriptions-item :span="2" label="Shift team 当班班组:">
  146. <el-form-item prop="shiftTeam">
  147. <el-input v-if="this.isEdit" v-model="form.shiftTeam" disabled placeholder="请输入当班班组"/>
  148. <el-select v-if="!this.isEdit" v-model="hoShiftTeam" clearable filterable placeholder="请选择交班班组"
  149. style="width: 50%;">
  150. <el-option
  151. v-for="dict in teamOptions"
  152. :key="dict.dictValue"
  153. :label="dict.dictLabel"
  154. :value="dict.dictValue"/>
  155. </el-select>
  156. <el-select v-if="!this.isEdit" v-model="toShiftTeam" clearable filterable placeholder="请选择接班班组"
  157. style="width: 50%;">
  158. <el-option
  159. v-for="dict in teamOptions"
  160. :key="dict.dictValue"
  161. :label="dict.dictLabel"
  162. :value="dict.dictValue"/>
  163. </el-select>
  164. </el-form-item>
  165. </el-descriptions-item>
  166. <el-descriptions-item :span="2" label="Take-Over time 接班时间:">
  167. <el-form-item prop="takeOverTime">
  168. <el-date-picker v-model="form.takeOverTime"
  169. clearable
  170. format="yyyy-MM-dd HH:mm"
  171. placeholder="请选择接班时间"
  172. style="width: 100%"
  173. type="datetime"
  174. value-format="yyyy-MM-dd HH:mm">
  175. </el-date-picker>
  176. </el-form-item>
  177. </el-descriptions-item>
  178. </el-descriptions>
  179. <el-collapse-item title="►Take-Over Conditions of Process 接班时工艺状况:">
  180. <el-input v-model="form.tocp" placeholder="请输入内容" type="textarea"/>
  181. </el-collapse-item>
  182. <el-collapse-item title="►EHS and 5S briefing 安全、环保、健康及5S事项班前简报">
  183. <el-input v-model="form.ehs5sBriefing" placeholder="请输入内容" type="textarea"/>
  184. </el-collapse-item>
  185. <el-collapse-item title="►Plant Conditions and Actions/Quality 装置状况和操作/质量:">
  186. <el-collapse-item title="● Splitter and Oxidation/Absorption C4分离和氧化吸收">
  187. <el-input v-model="form.soa" placeholder="请输入内容" type="textarea"/>
  188. </el-collapse-item>
  189. <el-collapse-item title="● Stripping and Hydrogenation 汽提和加氢">
  190. <el-input v-model="form.sh" placeholder="请输入内容" type="textarea"/>
  191. </el-collapse-item>
  192. <el-collapse-item title="● BDO Cyclization BDO环化">
  193. <el-input v-model="form.bdoc" placeholder="请输入内容" type="textarea"/>
  194. </el-collapse-item>
  195. <el-collapse-item title="● THF Distillation THF精馏">
  196. <el-input v-model="form.thfd" placeholder="请输入内容" type="textarea"/>
  197. </el-collapse-item>
  198. <el-collapse-item title="● PTHF PTHF单元">
  199. <el-input v-model="form.pthfUnit" placeholder="请输入内容" type="textarea"/>
  200. </el-collapse-item>
  201. <el-collapse-item title="● DBP Distillation DBP精馏">
  202. <el-input v-model="form.dbpd" placeholder="请输入内容" type="textarea"/>
  203. </el-collapse-item>
  204. <el-collapse-item title="● TRU and Steam system TRU和蒸汽系统">
  205. <el-input v-model="form.truss" placeholder="请输入内容" type="textarea"/>
  206. </el-collapse-item>
  207. <el-collapse-item title="● PolyTHF Complex Utility system PolyTHF Complex公用工程系统">
  208. <el-input v-model="form.pthfCus" placeholder="请输入内容" type="textarea"/>
  209. </el-collapse-item>
  210. <el-collapse-item title="● BIP Utility system BIP公用工程系统">
  211. <el-input v-model="form.bipus" placeholder="请输入内容" type="textarea"/>
  212. </el-collapse-item>
  213. </el-collapse-item>
  214. <el-collapse-item title="►LPG and H2 (3rd party) 液化气和氢气(外部)">
  215. <el-input v-model="form.lpgH2" placeholder="请输入内容" type="textarea"/>
  216. </el-collapse-item>
  217. <el-collapse-item title="►Environment, Health and Safety 环境,健康和安全">
  218. <el-descriptions :column="4" border direction="vertical" label-class-name="des-label label-hh" size="">
  219. <el-descriptions-item
  220. :label="'● Environmental Protection Devices 环保设施状况'"
  221. :span="4"
  222. contentClassName="contentSty">
  223. </el-descriptions-item>
  224. <el-descriptions-item :span="2" label="TRU CO Q125601">
  225. <el-radio-group v-model="form.q125601">
  226. <el-radio :label="'正常'">正常</el-radio>
  227. <el-radio :label="'异常'">异常</el-radio>
  228. </el-radio-group>
  229. </el-descriptions-item>
  230. <el-descriptions-item :span="2" label="TRU 非甲烷总烃 Q125602">
  231. <el-radio-group v-model="form.q125602">
  232. <el-radio :label="'正常'">正常</el-radio>
  233. <el-radio :label="'异常'">异常</el-radio>
  234. </el-radio-group>
  235. </el-descriptions-item>
  236. <el-descriptions-item :span="1" label="厂界 THF Q312018-Q1">
  237. <el-radio-group v-model="form.q312018Q1">
  238. <el-radio :label="'正常'">正常</el-radio>
  239. <el-radio :label="'异常'">异常</el-radio>
  240. </el-radio-group>
  241. </el-descriptions-item>
  242. <el-descriptions-item :span="1" label="厂界 MeOH Q312018-Q2">
  243. <el-radio-group v-model="form.q312018Q2">
  244. <el-radio :label="'正常'">正常</el-radio>
  245. <el-radio :label="'异常'">异常</el-radio>
  246. </el-radio-group>
  247. </el-descriptions-item>
  248. <el-descriptions-item :span="1" label="厂界 MeAC Q312018-Q3">
  249. <el-radio-group v-model="form.q312018Q3">
  250. <el-radio :label="'正常'">正常</el-radio>
  251. <el-radio :label="'异常'">异常</el-radio>
  252. </el-radio-group>
  253. </el-descriptions-item>
  254. <el-descriptions-item :span="1" label="厂界 Xylene Q312018-Q4">
  255. <el-radio-group v-model="form.q312018Q4">
  256. <el-radio :label="'正常'">正常</el-radio>
  257. <el-radio :label="'异常'">异常</el-radio>
  258. </el-radio-group>
  259. </el-descriptions-item>
  260. <el-descriptions-item :span="2" label="雨水总管 TOC Q312000">
  261. <el-radio-group v-model="form.q312000">
  262. <el-radio :label="'正常'">正常</el-radio>
  263. <el-radio :label="'异常'">异常</el-radio>
  264. </el-radio-group>
  265. </el-descriptions-item>
  266. <el-descriptions-item :span="2" label="雨水总管 PH Q312001">
  267. <el-radio-group v-model="form.q312001">
  268. <el-radio :label="'正常'">正常</el-radio>
  269. <el-radio :label="'异常'">异常</el-radio>
  270. </el-radio-group>
  271. </el-descriptions-item>
  272. </el-descriptions>
  273. <el-descriptions-item :span="4" label="异常状况描述:">
  274. <el-input v-model="form.epdOther" placeholder="请输入内容" type="textarea"/>
  275. </el-descriptions-item>
  276. <el-descriptions-item :span="4" label="● Other 其他">
  277. <el-input v-model="form.ehsOther" placeholder="请输入内容" type="textarea"/>
  278. </el-descriptions-item>
  279. </el-collapse-item>
  280. <el-collapse-item title="►Quality and Analytical Report 产品质量和分析报告">
  281. <el-input v-model="form.qar" placeholder="请输入内容" type="textarea"/>
  282. </el-collapse-item>
  283. <el-collapse-item title="►Maintenance Activities 电仪和机械维修">
  284. <el-collapse-item title="● E&I电气及仪表">
  285. <el-input v-model="form.maEi" placeholder="请输入内容" type="textarea"/>
  286. </el-collapse-item>
  287. <el-collapse-item title="● Mechanical 机械">
  288. <el-input v-model="form.maMechanical" placeholder="请输入内容" type="textarea"/>
  289. </el-collapse-item>
  290. </el-collapse-item>
  291. <el-collapse-item title="►Third Party Communication 第三方联系">
  292. <el-input v-model="form.thirdPartyCommunication" placeholder="请输入内容" type="textarea"/>
  293. </el-collapse-item>
  294. <el-collapse-item title="►Follow-up Activities for Maintenance part 接班班组需继续的维修工作">
  295. <el-collapse-item title="● E&I电气及仪表">
  296. <el-input v-model="form.fampEi" placeholder="请输入内容" type="textarea"/>
  297. </el-collapse-item>
  298. <el-collapse-item title="● Mechanical 机械">
  299. <el-input v-model="form.fampMechanical" placeholder="请输入内容" type="textarea"/>
  300. </el-collapse-item>
  301. </el-collapse-item>
  302. <el-collapse-item title="►Follow-up Activities for Operation part 接班班组需继续的操作">
  303. <el-input v-model="form.faop" placeholder="请输入内容" type="textarea"/>
  304. </el-collapse-item>
  305. <el-collapse-item title="►Miscellaneous / Comments 其他/评述">
  306. <el-input v-model="form.comments" placeholder="请输入内容" type="textarea"/>
  307. </el-collapse-item>
  308. <el-descriptions :column="4" border direction="vertical" label-class-name="des-label label-hh" size="">
  309. <el-descriptions-item :span="2" label="Hand-Over Shift Supervisor 交班班组人员">
  310. <el-form-item prop="hoShiftSup">
  311. <el-select v-model="form.hoShiftSup" clearable filterable placeholder="请选择交班班组人员"
  312. style="width: 100%;">
  313. <el-option v-for="user in userList"
  314. :key="user.userId"
  315. :label="user.nickName"
  316. :value="user.userId"
  317. />
  318. </el-select>
  319. </el-form-item>
  320. </el-descriptions-item>
  321. <el-descriptions-item :span="2" label="Take-Over Shift Supervisor 接班班组人员">
  322. <el-form-item prop="toShiftSup">
  323. <el-select v-model="form.toShiftSup" clearable filterable placeholder="请选择接班班组人员"
  324. style="width: 100%;">
  325. <el-option v-for="user in userList"
  326. :key="user.userId"
  327. :label="user.nickName"
  328. :value="user.userId"
  329. />
  330. </el-select>
  331. </el-form-item>
  332. </el-descriptions-item>
  333. </el-descriptions>
  334. <el-collapse-item title="备注">
  335. <el-input v-model="form.remarks" placeholder="请输入内容" type="textarea"/>
  336. </el-collapse-item>
  337. </el-collapse>
  338. </el-form>
  339. <div slot="footer" class="dialog-footer">
  340. <el-button type="primary" @click="submitForm">保 存</el-button>
  341. <el-button @click="cancel">取 消</el-button>
  342. </div>
  343. </el-dialog>
  344. <el-dialog :close-on-click-modal="false" :visible.sync="detail.open" append-to-body title="轮班日志详情"
  345. width="60%">
  346. <el-descriptions :column="4" border direction="vertical" label-class-name="label-hh" size="default">
  347. <el-descriptions-item :span="2" label="Shift team 当班班组:">
  348. {{ detail.data.shiftTeam }}
  349. </el-descriptions-item>
  350. <el-descriptions-item :span="1" label="Take-Over time 接班时间:">
  351. {{ detail.data.takeOverTime }}
  352. </el-descriptions-item>
  353. <el-descriptions-item :span="1" label="Hand-Over time 交班时间:">
  354. {{ detail.data.giveOverTime }}
  355. </el-descriptions-item>
  356. <el-descriptions-item :span="4" label="►Take-Over Conditions of Process 接班时工艺状况:">
  357. {{ detail.data.tocp }}
  358. </el-descriptions-item>
  359. <el-descriptions-item :span="4" label="►EHS and 5S briefing 安全、环保、健康及5S事项班前简报">
  360. {{ detail.data.ehs5sBriefing }}
  361. </el-descriptions-item>
  362. <el-descriptions-item
  363. :label="'►Plant Conditions and Actions/Quality 装置状况和操作/质量:\n● Splitter and Oxidation/Absorption C4分离和氧化吸收'"
  364. :span="4">
  365. {{ detail.data.soa }}
  366. </el-descriptions-item>
  367. <el-descriptions-item :span="4" label="● Stripping and Hydrogenation 汽提和加氢">
  368. {{ detail.data.sh }}
  369. </el-descriptions-item>
  370. <el-descriptions-item :span="4" label="● BDO Cyclization BDO环化">
  371. {{ detail.data.bdoc }}
  372. </el-descriptions-item>
  373. <el-descriptions-item :span="4" label="● THF Distillation THF精馏">
  374. {{ detail.data.thfd }}
  375. </el-descriptions-item>
  376. <el-descriptions-item :span="4" label="● PTHF PTHF单元">
  377. {{ detail.data.pthfUnit }}
  378. </el-descriptions-item>
  379. <el-descriptions-item :span="4" label="● DBP Distillation DBP精馏">
  380. {{ detail.data.dbpd }}
  381. </el-descriptions-item>
  382. <el-descriptions-item :span="4" label="● TRU and Steam system TRU和蒸汽系统">
  383. {{ detail.data.truss }}
  384. </el-descriptions-item>
  385. <el-descriptions-item :span="4" label="● PolyTHF Complex Utility system PolyTHF Complex公用工程系统">
  386. {{ detail.data.pthfCus }}
  387. </el-descriptions-item>
  388. <el-descriptions-item :span="4" label="● BIP Utility system BIP公用工程系统">
  389. {{ detail.data.bipus }}
  390. </el-descriptions-item>
  391. <el-descriptions-item :span="4" label="►LPG and H2 (3rd party) 液化气和氢气(外部)">
  392. {{ detail.data.lpgH2 }}
  393. </el-descriptions-item>
  394. <el-descriptions-item
  395. :label="'►Environment, Health and Safety 环境,健康和安全\n● Environmental Protection Devices 环保设施状况'"
  396. :span="4"
  397. contentClassName="contentSty">
  398. </el-descriptions-item>
  399. <el-descriptions-item :span="2" label="TRU CO Q125601">
  400. {{ detail.data.q125601 }}
  401. </el-descriptions-item>
  402. <el-descriptions-item :span="2" label="TRU 非甲烷总烃 Q125602">
  403. {{ detail.data.q125602 }}
  404. </el-descriptions-item>
  405. <el-descriptions-item :span="1" label="厂界 THF Q312018-Q1">
  406. {{ detail.data.q312018Q1 }}
  407. </el-descriptions-item>
  408. <el-descriptions-item :span="1" label="厂界 MeOH Q312018-Q2">
  409. {{ detail.data.q312018Q2 }}
  410. </el-descriptions-item>
  411. <el-descriptions-item :span="1" label="厂界 MeAC Q312018-Q3">
  412. {{ detail.data.q312018Q3 }}
  413. </el-descriptions-item>
  414. <el-descriptions-item :span="1" label="厂界 Xylene Q312018-Q4">
  415. {{ detail.data.q312018Q4 }}
  416. </el-descriptions-item>
  417. <el-descriptions-item :span="2" label="雨水总管 TOC Q312000">
  418. {{ detail.data.q312000 }}
  419. </el-descriptions-item>
  420. <el-descriptions-item :span="2" label="雨水总管 PH Q312001">
  421. {{ detail.data.q312001 }}
  422. </el-descriptions-item>
  423. <el-descriptions-item :span="4" label="异常状况描述:">
  424. {{ detail.data.epdOther }}
  425. </el-descriptions-item>
  426. <el-descriptions-item :span="4" label="● Other 其他">
  427. {{ detail.data.ehsOther }}
  428. </el-descriptions-item>
  429. <el-descriptions-item :span="4" label="►Quality and Analytical Report 产品质量和分析报告">
  430. {{ detail.data.qar }}
  431. </el-descriptions-item>
  432. <el-descriptions-item :label="'Maintenance Activities 电仪和机械维修\n● E&I电气及仪表'" :span="4">
  433. {{ detail.data.maEi }}
  434. </el-descriptions-item>
  435. <el-descriptions-item :span="4" label="● Mechanical 机械">
  436. {{ detail.data.maMechanical }}
  437. </el-descriptions-item>
  438. <el-descriptions-item :span="4" label="►Third Party Communication 第三方联系">
  439. {{ detail.data.thirdPartyCommunication }}
  440. </el-descriptions-item>
  441. <el-descriptions-item
  442. :label="'►Follow-up Activities for Maintenance part 接班班组需继续的维修工作\n● E&I电气及仪表'"
  443. :span="4">
  444. {{ detail.data.fampEi }}
  445. </el-descriptions-item>
  446. <el-descriptions-item :span="4" label="● Mechanical 机械">
  447. {{ detail.data.fampMechanical }}
  448. </el-descriptions-item>
  449. <el-descriptions-item :span="4" label="►Follow-up Activities for Operation part 接班班组需继续的操作">
  450. {{ detail.data.faop }}
  451. </el-descriptions-item>
  452. <el-descriptions-item :span="4" label="►Miscellaneous / Comments 其他/评述">
  453. {{ detail.data.comments }}
  454. </el-descriptions-item>
  455. <el-descriptions-item :span="2" label="Hand-Over Shift Supervisor 交班班组人员">
  456. {{ bzFormat(detail.data.hoShiftSup) }}
  457. </el-descriptions-item>
  458. <el-descriptions-item :span="2" label="Take-Over Shift Supervisor 接班班组人员">
  459. {{ bzFormat(detail.data.toShiftSup) }}
  460. </el-descriptions-item>
  461. <el-descriptions-item :span="4" label="备注">
  462. {{ detail.data.remark }}
  463. </el-descriptions-item>
  464. </el-descriptions>
  465. <div v-if="detail.data.toShiftSup==userId" slot="footer" class="dialog-footer">
  466. <el-button type="primary" @click="conform">确 认</el-button>
  467. <el-button @click="cancel">取 消</el-button>
  468. </div>
  469. </el-dialog>
  470. </div>
  471. </template>
  472. <script>
  473. import {addLog, delLog, getLog, listLog, updateLog,getLastData, wordView} from "@/api/shiftmgr/log";
  474. import {listPostUser} from "@/api/system/user";
  475. export default {
  476. name: "Log",
  477. data() {
  478. return {
  479. detail: {
  480. open: false,
  481. data: {},
  482. },
  483. // 页面高度
  484. clientHeight: 300,
  485. // 遮罩层
  486. loading: true,
  487. // 选中数组
  488. ids: [],
  489. userId: '',
  490. hoShiftTeam: '',
  491. toShiftTeam: '',
  492. userList: [],
  493. teamList: [],
  494. // 非单个禁用
  495. single: true,
  496. isEdit: false,
  497. // 非多个禁用
  498. multiple: true,
  499. // 显示搜索条件
  500. showSearch: false,
  501. // 总条数
  502. total: 0,
  503. // 轮班日志表格数据
  504. logList: [],
  505. // 班组字典
  506. teamOptions: [],
  507. // 弹出层标题
  508. title: "",
  509. // 是否显示弹出层
  510. open: false,
  511. // 查询参数
  512. queryParams: {
  513. pageNum: 1,
  514. pageSize: 20,
  515. shiftTeam: null,
  516. takeOverTime: null,
  517. giveOverTime: null,
  518. tocp: null,
  519. ehs5sBriefing: null,
  520. soa: null,
  521. sh: null,
  522. bdoc: null,
  523. thfd: null,
  524. pthfUnit: null,
  525. dbpd: null,
  526. truss: null,
  527. pthfCus: null,
  528. bipus: null,
  529. lpgH2: null,
  530. q125601: null,
  531. q125602: null,
  532. q312018Q1: null,
  533. q312018Q2: null,
  534. q312018Q3: null,
  535. q312018Q4: null,
  536. q312000: null,
  537. q312001: null,
  538. epdOther: null,
  539. ehsOther: null,
  540. qar: null,
  541. maEi: null,
  542. maMechanical: null,
  543. thirdPartyCommunication: null,
  544. fampEi: null,
  545. fampMechanical: null,
  546. faop: null,
  547. comments: null,
  548. hoShiftSup: null,
  549. toShiftSup: null,
  550. status: null,
  551. createrCode: null,
  552. createdate: null,
  553. updaterCode: null,
  554. updatedate: null,
  555. deptId: null,
  556. remarks: null
  557. },
  558. // 表单参数
  559. form: {},
  560. // 表单校验
  561. rules: {
  562. shiftTeam: [
  563. {required: true, message: "当班班组不能为空", trigger: "blur"}
  564. ],
  565. hoShiftSup: [
  566. {required: true, message: "交班班组人员不能为空", trigger: "blur"}
  567. ],
  568. toShiftSup: [
  569. {required: true, message: "接班班组人员不能为空", trigger: "blur"}
  570. ],
  571. }
  572. };
  573. },
  574. created() {
  575. this.getList();
  576. //设置表格高度对应屏幕高度
  577. this.$nextTick(() => {
  578. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  579. });
  580. this.getDicts("TEAM_DIVIDE").then(res => {
  581. this.teamOptions = res.data;
  582. });
  583. this.getBzUser();
  584. },
  585. methods: {
  586. statusFormat(row) {
  587. return row.status == 1 ? '已确认' : '未确认'
  588. },
  589. bzFormat(userId) {
  590. for (let user of this.userList) {
  591. if (userId == user.userId) {
  592. return user.nickName;
  593. }
  594. }
  595. },
  596. getBzUser() {
  597. listPostUser({postCode: 'se'}).then(response => {
  598. this.userList = response;
  599. });
  600. },
  601. openDetail(id) {
  602. getLog(id).then(response => {
  603. this.detail.data = response.data;
  604. this.detail.open = true;
  605. });
  606. },
  607. /** 查询轮班日志列表 */
  608. getList() {
  609. this.loading = true;
  610. listLog(this.queryParams).then(response => {
  611. this.logList = response.data.rows;
  612. this.total = response.data.total;
  613. this.userId = response.msg;
  614. this.loading = false;
  615. });
  616. },
  617. // 取消按钮
  618. cancel() {
  619. this.open = false;
  620. this.detail.open = false;
  621. this.reset();
  622. },
  623. // 表单重置
  624. reset() {
  625. this.form = {
  626. id: null,
  627. shiftTeam: null,
  628. takeOverTime: null,
  629. giveOverTime: null,
  630. tocp: null,
  631. ehs5sBriefing: null,
  632. soa: null,
  633. sh: null,
  634. bdoc: null,
  635. thfd: null,
  636. pthfUnit: null,
  637. dbpd: null,
  638. truss: null,
  639. pthfCus: null,
  640. bipus: null,
  641. lpgH2: null,
  642. q125601: null,
  643. q125602: null,
  644. q312018Q1: null,
  645. q312018Q2: null,
  646. q312018Q3: null,
  647. q312018Q4: null,
  648. q312000: null,
  649. q312001: null,
  650. epdOther: null,
  651. ehsOther: null,
  652. qar: null,
  653. maEi: null,
  654. maMechanical: null,
  655. thirdPartyCommunication: null,
  656. fampEi: null,
  657. fampMechanical: null,
  658. faop: null,
  659. comments: null,
  660. hoShiftSup: null,
  661. toShiftSup: null,
  662. delFlag: null,
  663. status: 0,
  664. createrCode: null,
  665. createdate: null,
  666. updaterCode: null,
  667. updatedate: null,
  668. deptId: null,
  669. remarks: null
  670. };
  671. this.resetForm("form");
  672. },
  673. /** 搜索按钮操作 */
  674. handleQuery() {
  675. this.queryParams.pageNum = 1;
  676. this.getList();
  677. },
  678. /** 重置按钮操作 */
  679. resetQuery() {
  680. this.resetForm("queryForm");
  681. this.handleQuery();
  682. },
  683. // 多选框选中数据
  684. handleSelectionChange(selection) {
  685. this.ids = selection.map(item => item.id)
  686. this.single = selection.length !== 1
  687. this.multiple = !selection.length
  688. },
  689. /** 新增按钮操作 */
  690. handleAdd() {
  691. this.isEdit = false;
  692. this.reset();
  693. this.open = true;
  694. this.title = "添加轮班日志";
  695. getLastData({}).then(res => {
  696. if (res.data) {
  697. this.form = res.data;
  698. this.form.id = null;
  699. this.form.status = null;
  700. this.form.takeOverTime = this.form.giveOverTime
  701. this.form.giveOverTime = null;
  702. this.form.hoShiftSup = parseInt(this.userId);
  703. this.form.toShiftSup = "";
  704. }
  705. })
  706. },
  707. /** 修改按钮操作 */
  708. handleUpdate(row) {
  709. this.reset();
  710. this.isEdit = true;
  711. const id = row.id || this.ids
  712. getLog(id).then(response => {
  713. response.data.toShiftSup = parseInt(response.data.toShiftSup);
  714. response.data.hoShiftSup = parseInt(response.data.hoShiftSup);
  715. this.form = response.data;
  716. this.open = true;
  717. this.title = "修改轮班日志";
  718. });
  719. },
  720. /** 提交按钮 */
  721. submitForm() {
  722. if (this.hoShiftTeam && this.hoShiftTeam) {
  723. if (this.hoShiftTeam === this.toShiftTeam) {
  724. return this.$message.error("交班班组不能为接班班组!")
  725. }
  726. for (let team of this.teamOptions) {
  727. if (team.dictValue === this.hoShiftTeam) {
  728. this.hoShiftTeam = team.dictLabel
  729. }
  730. if (team.dictValue === this.toShiftTeam) {
  731. this.toShiftTeam = team.dictLabel
  732. }
  733. }
  734. this.form.shiftTeam = this.hoShiftTeam + "->" + this.toShiftTeam;
  735. }
  736. if (this.form.giveOverTime) {
  737. this.form.giveOverTime.format("yyyy-MM-dd HH:mm")
  738. }
  739. this.$refs["form"].validate(valid => {
  740. if (valid) {
  741. if (this.form.id != null) {
  742. updateLog(this.form).then(response => {
  743. this.$modal.msgSuccess("修改成功");
  744. this.open = false;
  745. this.getList();
  746. });
  747. } else {
  748. addLog(this.form).then(response => {
  749. this.$modal.msgSuccess("新增成功");
  750. this.open = false;
  751. this.getList();
  752. });
  753. }
  754. }
  755. });
  756. },
  757. conform() {
  758. this.detail.data.status = 1;
  759. updateLog(this.detail.data).then(response => {
  760. this.$modal.msgSuccess("确认成功");
  761. this.detail.open = false;
  762. this.getList();
  763. });
  764. },
  765. /** 删除按钮操作 */
  766. handleDelete(row) {
  767. const ids = row.id || this.ids;
  768. this.$confirm('是否确认删除数据项?').then(function () {
  769. return delLog(ids);
  770. }).then(() => {
  771. this.getList();
  772. this.$modal.msgSuccess("删除成功");
  773. }).catch(() => {
  774. });
  775. },
  776. /** 导出按钮操作 */
  777. handleExport() {
  778. this.download('shiftmgr/log/export', {
  779. ...this.queryParams
  780. }, `log_${new Date().getTime()}.xlsx`)
  781. },
  782. exportLog(id) {
  783. wordView(id).then(res => {
  784. if (res.msg)
  785. window.open(process.env.VUE_APP_BASE_API + res.msg);
  786. })
  787. }
  788. }
  789. };
  790. </script>
  791. <style>
  792. .des-label {
  793. color: #3a3a3a !important;
  794. font-size: 14px;
  795. }
  796. .label-hh {
  797. white-space: pre-line !important;
  798. width: 240px !important;
  799. }
  800. .contentSty {
  801. display: none !important;
  802. }
  803. </style>