index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item>
  5. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  6. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  7. </el-form-item>
  8. </el-form>
  9. <el-row :gutter="10" class="mb8">
  10. <el-col :span="1.5">
  11. <el-button
  12. type="primary"
  13. icon="el-icon-plus"
  14. size="mini"
  15. @click="handleAdd"
  16. v-hasPermi="['eoeg:eoegChange:add']"
  17. >新增
  18. </el-button>
  19. </el-col>
  20. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  21. </el-row>
  22. <el-table v-loading="loading" :data="eoegChangeList" @selection-change="handleSelectionChange"
  23. :height="clientHeight" border>
  24. <el-table-column type="selection" width="55" align="center" fixed="left"/>
  25. <el-table-column label="申请状态" align="center" prop="approveStatus" :formatter="approveStatusFormat"
  26. :show-overflow-tooltip="true" width="150" fixed="left"/>
  27. <el-table-column label="完成状态" align="center" prop="status" :formatter="statusFormat"
  28. :show-overflow-tooltip="true" width="150" fixed="left"/>
  29. <el-table-column label="锁编号" align="center" prop="lockNo" :show-overflow-tooltip="true" width="200"
  30. fixed="left"/>
  31. <el-table-column label="措施变更描述" align="center" prop="changeDescribe" :show-overflow-tooltip="true"
  32. width="200"/>
  33. <el-table-column label="状态变更原因" align="center" prop="changeReason" :show-overflow-tooltip="true"
  34. width="200"/>
  35. <el-table-column label="申请人" align="center" prop="applicantName" :show-overflow-tooltip="true" width="200"/>
  36. <el-table-column label="申请时间" align="center" prop="applicationTime" width="100">
  37. <template slot-scope="scope">
  38. <span>{{ parseTime(scope.row.applicationTime, '{y}-{m}-{d}') }}</span>
  39. </template>
  40. </el-table-column>
  41. <el-table-column label="评估及临时的安全措施" align="center" prop="safa" :show-overflow-tooltip="true"
  42. width="200"/>
  43. <el-table-column label="评估人" align="center" prop="safaerName" :show-overflow-tooltip="true" width="200"/>
  44. <el-table-column label="评估时间" align="center" prop="safaTime" width="100">
  45. <template slot-scope="scope">
  46. <span>{{ parseTime(scope.row.safaTime, '{y}-{m}-{d}') }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="批准人" align="center" prop="approverName" :show-overflow-tooltip="true" width="200"/>
  50. <el-table-column label="批准时间" align="center" prop="approveTime" width="100">
  51. <template slot-scope="scope">
  52. <span>{{ parseTime(scope.row.approveTime, '{y}-{m}-{d}') }}</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="措施确认人" align="center" prop="confirmerName"
  56. :show-overflow-tooltip="true" width="200"/>
  57. <el-table-column label="措施确认时间" align="center" prop="confirmTime" width="100">
  58. <template slot-scope="scope">
  59. <span>{{ parseTime(scope.row.confirmTime, '{y}-{m}-{d}') }}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="措施执行人" align="center" prop="executorName" :show-overflow-tooltip="true" width="200"/>
  63. <el-table-column label="措施执行时间" align="center" prop="executionTime" width="100">
  64. <template slot-scope="scope">
  65. <span>{{ parseTime(scope.row.executionTime, '{y}-{m}-{d}') }}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="变更确认人" align="center" prop="changeConfirmerName" :show-overflow-tooltip="true"
  69. width="200"/>
  70. <el-table-column label="变更确认人确认时间" align="center" prop="changeConfirmTime" width="180">
  71. <template slot-scope="scope">
  72. <span>{{ parseTime(scope.row.changeConfirmTime, '{y}-{m}-{d}') }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="变更执行人" align="center" prop="changeExecutorName" :show-overflow-tooltip="true"
  76. width="200"/>
  77. <el-table-column label="变更执行时间" align="center" prop="changeExecutorTime" width="100">
  78. <template slot-scope="scope">
  79. <span>{{ parseTime(scope.row.changeExecutorTime, '{y}-{m}-{d}') }}</span>
  80. </template>
  81. </el-table-column>
  82. <!-- <el-table-column label="班长" align="center" prop="monitorName" :show-overflow-tooltip="true" width="200"/>-->
  83. <!-- <el-table-column label="班长确认时间" align="center" prop="monitorTime" width="100">-->
  84. <!-- <template slot-scope="scope">-->
  85. <!-- <span>{{ parseTime(scope.row.monitorTime, '{y}-{m}-{d}') }}</span>-->
  86. <!-- </template>-->
  87. <!-- </el-table-column>-->
  88. <el-table-column label="状态恢复后,之前采取的安全措施是否已撤销:" align="center" prop="revokeConfirm"
  89. :show-overflow-tooltip="true" width="200"/>
  90. <el-table-column label="组织保护措施状态变更执行" align="center" prop="changeExecution"
  91. :show-overflow-tooltip="true" width="200"/>
  92. <el-table-column label="组织保护措施是否已经恢复至变更前的状态" align="center" prop="resetConfirm"
  93. :show-overflow-tooltip="true" width="200"/>
  94. <el-table-column label="确认人1" align="center" prop="resetConfirmerName1"
  95. :show-overflow-tooltip="true" width="200"/>
  96. <el-table-column label="确认时间1" align="center" prop="resetConfirmTime1" width="100">
  97. <template slot-scope="scope">
  98. <span>{{ parseTime(scope.row.resetConfirmTime1, '{y}-{m}-{d}') }}</span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column label="确认人2" align="center" prop="resetConfirmerName2"
  102. :show-overflow-tooltip="true" width="200"/>
  103. <el-table-column label="确认时间2" align="center" prop="resetConfirmTime2" width="100">
  104. <template slot-scope="scope">
  105. <span>{{ parseTime(scope.row.resetConfirmTime2, '{y}-{m}-{d}') }}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="200"/>
  109. <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  110. <template slot-scope="scope">
  111. <el-button
  112. size="mini"
  113. type="text"
  114. icon="el-icon-document"
  115. @click="openDetail(scope.row)"
  116. >详情
  117. </el-button>
  118. <el-button v-if="scope.row.approveStatus == 2"
  119. size="mini"
  120. type="text"
  121. icon="el-icon-document"
  122. @click="wordView(scope.row)"
  123. >预览
  124. </el-button>
  125. </template>
  126. </el-table-column>
  127. </el-table>
  128. <pagination
  129. v-show="total>0"
  130. :total="total"
  131. :page.sync="queryParams.pageNum"
  132. :limit.sync="queryParams.pageSize"
  133. @pagination="getList"
  134. />
  135. <el-dialog title="详情" :visible.sync="detail.open" width="70%" append-to-body :close-on-click-modal="false">
  136. <el-descriptions class="margin-top" :column="2" border :label-style="{'width': '200px'}">
  137. <el-descriptions-item label="申请状态">
  138. <el-tag size="small" :type="approveStatusFlag">{{ approveStatus[detail.detailData.approveStatus] }}</el-tag>
  139. </el-descriptions-item>
  140. <el-descriptions-item label="完成状态">
  141. <el-tag size="small" :type="statusFlag">{{ status[detail.detailData.status] }}</el-tag>
  142. </el-descriptions-item>
  143. <el-descriptions-item label="锁编号">{{ detail.detailData.lockNo }}</el-descriptions-item>
  144. <el-descriptions-item label="措施变更描述">{{ detail.detailData.changeDescribe }}</el-descriptions-item>
  145. <el-descriptions-item label="状态变更原因">{{ detail.detailData.changeReason }}</el-descriptions-item>
  146. <el-descriptions-item label="评估及临时的安全措施">{{ detail.detailData.safa }}</el-descriptions-item>
  147. <el-descriptions-item label="申请人">{{ detail.detailData.applicantName }}</el-descriptions-item>
  148. <el-descriptions-item label="申请时间">{{
  149. parseTime(detail.detailData.applicationTime, '{y}-{m}-{d}')
  150. }}
  151. </el-descriptions-item>
  152. <el-descriptions-item label="评估人">{{ detail.detailData.safaerName }}</el-descriptions-item>
  153. <el-descriptions-item label="评估时间">{{
  154. parseTime(detail.detailData.safaTime, '{y}-{m}-{d}')
  155. }}
  156. </el-descriptions-item>
  157. <el-descriptions-item :span="2" label="组织保护措施状态变更执行">{{
  158. detail.detailData.changeExecution
  159. }}
  160. </el-descriptions-item>
  161. <el-descriptions-item label="批准人">{{ detail.detailData.approverName }}</el-descriptions-item>
  162. <el-descriptions-item label="批准时间">{{
  163. parseTime(detail.detailData.approveTime, '{y}-{m}-{d}')
  164. }}
  165. </el-descriptions-item>
  166. <el-descriptions-item label="措施确认人">{{ detail.detailData.confirmerName }}</el-descriptions-item>
  167. <el-descriptions-item label="措施确认时间">{{
  168. parseTime(detail.detailData.confirmTime, '{y}-{m}-{d}')
  169. }}
  170. </el-descriptions-item>
  171. <el-descriptions-item label="措施执行人">{{ detail.detailData.executorName }}</el-descriptions-item>
  172. <el-descriptions-item label="措施执行时间">{{
  173. parseTime(detail.detailData.executionTime, '{y}-{m}-{d}')
  174. }}
  175. </el-descriptions-item>
  176. <el-descriptions-item label="变更确认人">{{ detail.detailData.changeConfirmerName }}</el-descriptions-item>
  177. <el-descriptions-item label="变更确认人确认时间">
  178. {{ parseTime(detail.detailData.changeConfirmTime, '{y}-{m}-{d}') }}
  179. </el-descriptions-item>
  180. <el-descriptions-item label="变更执行人">{{ detail.detailData.changeExecutorName }}</el-descriptions-item>
  181. <el-descriptions-item label="变更执行时间">{{
  182. parseTime(detail.detailData.changeExecutorTime, '{y}-{m}-{d}')
  183. }}
  184. </el-descriptions-item>
  185. <el-descriptions-item label="确认人1">{{ detail.detailData.resetConfirmerName1 }}</el-descriptions-item>
  186. <el-descriptions-item label="确认时间1">{{
  187. parseTime(detail.detailData.resetConfirmTime1, '{y}-{m}-{d}')
  188. }}
  189. </el-descriptions-item>
  190. <el-descriptions-item label="确认人2">{{ detail.detailData.resetConfirmerName2 }}</el-descriptions-item>
  191. <el-descriptions-item label="确认时间2">{{
  192. parseTime(detail.detailData.resetConfirmTime2, '{y}-{m}-{d}')
  193. }}
  194. </el-descriptions-item>
  195. <el-descriptions-item label="状态恢复后,之前采取的安全措施是否已撤销:">{{
  196. detail.detailData.revokeConfirm
  197. }}
  198. </el-descriptions-item>
  199. <el-descriptions-item label="组织保护措施是否已经恢复至变更前的状态">{{
  200. detail.detailData.resetConfirm
  201. }}
  202. </el-descriptions-item>
  203. <el-descriptions-item :span="2" label="备注">{{ detail.detailData.remarks }}</el-descriptions-item>
  204. </el-descriptions>
  205. <div class="mt5">
  206. <el-table :data="historyList" border v-loading="historyLoading" style="width: 100%;">
  207. <el-table-column prop="taskName" header-align="center" align="center"
  208. :label="$t('流程进度')"></el-table-column>
  209. <el-table-column prop="userName" header-align="center" align="center" :label="$t('姓名')"></el-table-column>
  210. <el-table-column prop="taskCreateTime" header-align="center" align="center"
  211. :label="$t('开始时间')"></el-table-column>
  212. <el-table-column prop="taskEndTime" header-align="center" align="center"
  213. :label="$t('结束时间')"></el-table-column>
  214. <el-table-column prop="comment" header-align="center" align="center"
  215. :label="$t('审批意见')"></el-table-column>
  216. </el-table>
  217. </div>
  218. </el-dialog>
  219. <!-- 添加或修改EOEG 锁开锁关申请对话框 -->
  220. <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body :close-on-click-modal="false">
  221. <el-form ref="form" :model="form" :rules="rules" label-width="180px">
  222. <el-form-item label="破锁编号" prop="lockNo">
  223. <el-select v-model="form.lockNo" placeholder="请选择锁编号" clearable size="small" filterable
  224. style="width: 100%">
  225. <el-option v-for="item in lockList" :key="item.uniqueIdentifier" :label="item.uniqueIdentifier"
  226. :value="item.uniqueIdentifier">
  227. </el-option>
  228. </el-select>
  229. </el-form-item>
  230. <el-form-item label="组织保护措施变更描述" prop="changeDescribe">
  231. <el-input type="textarea" v-model="form.changeDescribe" placeholder="请输入组织保护措施变更描述"/>
  232. </el-form-item>
  233. <el-form-item label="状态变更原因" prop="changeReason">
  234. <el-input type="textarea" v-model="form.changeReason" placeholder="请输入状态变更原因"/>
  235. </el-form-item>
  236. <el-row>
  237. <el-col :span="12">
  238. <el-form-item label="评估人" prop="safaer">
  239. <el-select clearable filterable v-model="form.safaer">
  240. <el-option v-for="item in staffmgrOptions" :key="item.userId" :label="item.name" :value="item.userId">
  241. </el-option>
  242. </el-select>
  243. </el-form-item>
  244. </el-col>
  245. <el-col :span="12">
  246. <el-form-item label="措施执行人" prop="executor">
  247. <el-select clearable filterable v-model="form.executor" @change="compareToStaff('executor')">
  248. <el-option v-for="item in classStaffOptions" :key="item.userId" :label="item.name" :value="item.userId">
  249. </el-option>
  250. </el-select>
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. <el-row>
  255. <el-col :span="12">
  256. <el-form-item label="变更执行人" prop="changeExecutor">
  257. <el-select clearable filterable v-model="form.changeExecutor" @change="compareToStaff('changeExecutor')">
  258. <el-option v-for="item in classStaffOptions" :key="item.userId" :label="item.name" :value="item.userId">
  259. </el-option>
  260. </el-select>
  261. </el-form-item>
  262. </el-col>
  263. <el-col :span="12">
  264. <el-form-item label="变更确认人" prop="changeConfirmer">
  265. <el-select clearable filterable v-model="form.changeConfirmer"
  266. @change="compareToStaff('changeConfirmer')">
  267. <el-option v-for="item in classStaffOptions" :key="item.userId" :label="item.name" :value="item.userId">
  268. </el-option>
  269. </el-select>
  270. </el-form-item>
  271. </el-col>
  272. </el-row>
  273. <el-form-item label="备注" prop="remarks">
  274. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  275. </el-form-item>
  276. </el-form>
  277. <div slot="footer" class="dialog-footer">
  278. <el-button type="primary" @click="submitForm">确 定</el-button>
  279. <el-button @click="cancel">取 消</el-button>
  280. </div>
  281. </el-dialog>
  282. <el-dialog :close-on-click-modal="false" v-loading="loadingFlash" element-loading-background="rgba(0,0,0,0.2)"
  283. v-dialogDrag :title="pdf.title"
  284. :visible.sync="pdf.open" width="1300px" :center="true" append-to-body>
  285. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  286. <el-button size="mini" type="text" @click="openPdf">{{ $t('新页面打开PDF') }}</el-button>
  287. </div>
  288. <div style="margin-top: -30px">
  289. <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"
  290. v-if="ppt"></iframe>
  291. </div>
  292. <div style="padding: 30px; width: 100%; height: 100%;">
  293. <el-carousel class="" ref="carousel" arrow="always" v-if="pptView"
  294. height="700px" trigger="click" :autoplay="false" indicator-position="outside">
  295. <el-carousel-item class="lun_img" v-for="item in imgs" v-bind:key="item">
  296. <img :src="item" width="100%" height="100%" object-fit="cover"/>
  297. </el-carousel-item>
  298. </el-carousel>
  299. </div>
  300. </el-dialog>
  301. </div>
  302. </template>
  303. <script>
  304. import {
  305. listEoegChange,
  306. getEoegChange,
  307. delEoegChange,
  308. addEoegChange,
  309. updateEoegChange,
  310. exportEoegChange,
  311. importTemplate,
  312. wordView
  313. } from "@/api/eoeg/eoegChange";
  314. import {treeselect} from "@/api/system/dept";
  315. import {getToken} from "@/utils/auth";
  316. import Treeselect from "@riophae/vue-treeselect";
  317. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  318. import {listEoegLock} from "@/api/eoeg/eoegLock";
  319. import {listStaffmgrByActualposts} from "@/api/eoeg/eoegStaffmgr";
  320. import {getHistorylist} from "@/api/ehs/approvedanger";
  321. import {listLockApply} from "@/api/eoeg/lockApply";
  322. export default {
  323. name: "EoegChange",
  324. components: {Treeselect},
  325. data() {
  326. return {
  327. detail: {
  328. open: false,
  329. detailData: {}
  330. },
  331. pdf: {
  332. title: '',
  333. pdfUrl: '',
  334. numPages: null,
  335. open: false,
  336. pageNum: 1,
  337. pageTotalNum: 1,
  338. loadedRatio: 0,
  339. },
  340. statusFlag: '',
  341. approveStatusFlag: '',
  342. status: {0: "未完成", 1: "已完成"},
  343. approveStatus: {1: "申请中", 2: "已通过", 3: "已拒绝"},
  344. // 字典
  345. statusList: [],
  346. approveStatusList: [],
  347. //流转列表
  348. historyList: [],
  349. historyLoading: true,
  350. // 遮罩层
  351. loading: true,
  352. // 选中数组
  353. ids: [],
  354. lockList: [],
  355. staffmgrOptions: [],
  356. classStaffOptions: [],
  357. // 非单个禁用
  358. single: true,
  359. // 非多个禁用
  360. multiple: true,
  361. // 显示搜索条件
  362. showSearch: false,
  363. // 总条数
  364. total: 0,
  365. // EOEG 锁开锁关申请表格数据
  366. eoegChangeList: [],
  367. // 弹出层标题
  368. title: "",
  369. // 部门树选项
  370. deptOptions: undefined,
  371. clientHeight: 300,
  372. // 是否显示弹出层
  373. open: false,
  374. // 用户导入参数
  375. upload: {
  376. // 是否显示弹出层(用户导入)
  377. open: false,
  378. // 弹出层标题(用户导入)
  379. title: "",
  380. // 是否禁用上传
  381. isUploading: false,
  382. // 是否更新已经存在的用户数据
  383. updateSupport: 0,
  384. // 设置上传的请求头部
  385. headers: {Authorization: "Bearer " + getToken()},
  386. // 上传的地址
  387. url: process.env.VUE_APP_BASE_API + "/eoeg/eoegChange/importData"
  388. },
  389. // 查询参数
  390. queryParams: {
  391. pageNum: 1,
  392. pageSize: 20,
  393. changeDescribe: null,
  394. changeReason: null,
  395. applicant: null,
  396. applicantName: null,
  397. applicationTime: null,
  398. safa: null,
  399. safaer: null,
  400. safaerName: null,
  401. safaTime: null,
  402. approver: null,
  403. approverName: null,
  404. approveTime: null,
  405. executor: null,
  406. executorName: null,
  407. executionTime: null,
  408. confirmer: null,
  409. confirmerName: null,
  410. confirmTime: null,
  411. changeExecution: null,
  412. changeExecutor: null,
  413. changeExecutorName: null,
  414. changeExecutorTime: null,
  415. resetConfirm: null,
  416. resetConfirmer1: null,
  417. resetConfirmerName1: null,
  418. resetConfirmTime1: null,
  419. resetConfirmer2: null,
  420. resetConfirmerName2: null,
  421. resetConfirmTime2: null,
  422. revokeConfirm: null,
  423. remarks: null,
  424. status: null,
  425. createrCode: null,
  426. createdate: null,
  427. updaterCode: null,
  428. updatedate: null,
  429. deptId: null,
  430. approveStatus: null,
  431. apNo: null,
  432. processId: null,
  433. lockNo: null,
  434. changeConfirmer: null,
  435. changeConfirmerName: null,
  436. changeConfirmTime: null,
  437. monitor: null,
  438. monitorName: null,
  439. monitorTime: null
  440. },
  441. // 表单参数
  442. form: {},
  443. // 表单校验
  444. rules: {
  445. lockNo: [
  446. {required: true, message: '锁编号不能为空', trigger: 'change'}
  447. ],
  448. changeDescribe: [
  449. {required: true, message: '组织保护措施变更描述不能为空', trigger: 'blur'}
  450. ],
  451. changeReason: [
  452. {required: true, message: '状态变更原因不能为空', trigger: 'blur'}
  453. ],
  454. safa: [
  455. {required: true, message: '安全评估及临时的安全措施不能为空', trigger: 'blur'}
  456. ],
  457. safaer: [
  458. {required: true, message: '评估人不能为空', trigger: 'change'}
  459. ],
  460. executor: [
  461. {required: true, message: '措施执行人不能为空', trigger: 'change'}
  462. ],
  463. changeExecutor: [
  464. {required: true, message: '变更执行人不能为空', trigger: 'change'}
  465. ],
  466. changeConfirmer: [
  467. {required: true, message: '变更确认人不能为空', trigger: 'change'}
  468. ],
  469. }
  470. };
  471. },
  472. watch: {
  473. // 根据名称筛选部门树
  474. deptName(val) {
  475. this.$refs.tree.filter(val);
  476. }
  477. },
  478. created() {
  479. //设置表格高度对应屏幕高度
  480. this.$nextTick(() => {
  481. this.clientHeight = document.body.clientHeight - 250
  482. })
  483. this.getList();
  484. this.getTreeselect();
  485. this.getLockList();
  486. this.getSaferList();
  487. this.getClassStaffList();
  488. this.getDicts("apply_status").then(response => {
  489. this.statusList = response.data;
  490. });
  491. this.getDicts("apply_approve_status").then(response => {
  492. this.approveStatusList = response.data;
  493. });
  494. },
  495. methods: {
  496. wordView(row) {
  497. wordView(row.id).then(response => {
  498. console.log(response.msg)
  499. this.handleSee("申请单", response.msg)
  500. });
  501. },
  502. handleSee(fileName, url) {
  503. //office预览
  504. this.loadingFlash = true
  505. this.pdf.open = true
  506. this.pdf.title = fileName
  507. this.pdf.pdfUrl = ""
  508. this.pptView = false
  509. this.ppt = true
  510. //如果是PDF等直接可以打开的就不调接口,否则调用接口
  511. if (fileName.endsWith('pdf')) {
  512. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + url
  513. this.loadingFlash = false
  514. } else {
  515. const formatDate = new FormData();
  516. formatDate.append("filepath", url)
  517. //调用文件预览api
  518. let res = this.officeConvert.bookConvertCommon(formatDate)
  519. //查看接受全局方法的返回结果 console.log(res)
  520. //利用.then方法接受Promise对象
  521. res.then((result) => {
  522. //关闭加载中
  523. this.loadingFlash = false
  524. if (result.msg.includes("csv")) {
  525. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
  526. this.$alert(result.msg, this.$t('检查乱码'), {dangerouslyUseHTMLString: true});
  527. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  528. } else if (result.msg.includes("不存在")) {
  529. //文件不存在时提示
  530. this.pdf.pdfUrl = ""
  531. this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
  532. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  533. this.pdf.open = false
  534. } else if (result.msg.includes("不支持此格式")) {
  535. this.pdf.pdfUrl = ""
  536. this.$alert(result.msg, this.$t('预览失败'), {dangerouslyUseHTMLString: true});
  537. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  538. this.pdf.open = false
  539. } else {
  540. //成功时直接给地址
  541. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + result.data
  542. }
  543. }).catch(result => {
  544. //请求失败,关闭loading,pdf地址直接为为空,不显示
  545. this.pdf.pdfUrl = ""
  546. this.loadingFlash = false;
  547. })
  548. }
  549. },
  550. //文件预览
  551. openPdf() {
  552. //ppt就跳路由预览,office就直接打开文件新页面
  553. const didi = {imgs: this.imgs}
  554. if (this.pptView == true && this.ppt == false) {
  555. let routeUrl = this.$router.resolve({
  556. path: "/cpms/index.html#/pptyulan",
  557. query: didi
  558. });
  559. window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
  560. console.log(this.imgs)
  561. } else {
  562. window.open(this.pdf.pdfUrl)
  563. }
  564. },
  565. // 字典翻译
  566. approveStatusFormat(row, column) {
  567. let s = this.selectDictLabel(this.approveStatusList, row.approveStatus)
  568. let type = '';
  569. if (row.approveStatus === '2') {
  570. type = 'success';
  571. } else if (row.approveStatus === '1') {
  572. type = 'warning';
  573. } else if (row.approveStatus === '3') {
  574. type = 'danger';
  575. }
  576. return <el-tag type={type}>{s}</el-tag>;
  577. },
  578. // 字典翻译
  579. statusFormat(row, column) {
  580. let s = this.selectDictLabel(this.statusList, row.status);
  581. let type = '';
  582. if (row.status === 1) {
  583. type = 'success';
  584. }
  585. return <el-tag type={type}>{s}</el-tag>;
  586. },
  587. compareToStaff(field) {
  588. // 定义验证规则:字段名和错误消息
  589. const validationRules = [
  590. {
  591. fields: ['changeConfirmer', 'executor'],
  592. message: '变更确认人不能与措施执行人为同一人!'
  593. },
  594. {
  595. fields: ['changeConfirmer', 'changeExecutor'],
  596. message: '变更确认人不能与变更执行人为同一人!'
  597. },
  598. {
  599. fields: ['executor', 'changeExecutor'],
  600. message: '措施执行人不能与变更执行人为同一人!'
  601. }
  602. ];
  603. const isValidValue = (value) => {
  604. return value !== null && value !== undefined && value !== '';
  605. };
  606. // 使用循环检查所有规则
  607. for (const rule of validationRules) {
  608. const [field1, field2] = rule.fields;
  609. const value1 = this.form[field1];
  610. const value2 = this.form[field2];
  611. // 只有当两个字段都有有效值且相等时才提示
  612. if (isValidValue(value1) && isValidValue(value2) && value1 === value2) {
  613. this.$alert(rule.message, "警告", {dangerouslyUseHTMLString: true});
  614. this.form[field] = null;
  615. break;
  616. }
  617. }
  618. },
  619. getSaferList() {
  620. listStaffmgrByActualposts({actualposts: "14,16,24,25,26"}).then(response => {
  621. this.staffmgrOptions = response.data;
  622. });
  623. },
  624. getClassStaffList() {
  625. listStaffmgrByActualposts({actualposts: "10,11,12,34"}).then(response => {
  626. this.classStaffOptions = response.data;
  627. });
  628. },
  629. openDetail(row) {
  630. this.detail.open = true;
  631. this.detail.detailData = row;
  632. this.statusFlag = '';
  633. this.approveStatusFlag = '';
  634. if (row.status === 1) {
  635. this.statusFlag = 'success';
  636. }
  637. if (row.approveStatus === '2') {
  638. this.approveStatusFlag = 'success';
  639. } else if (row.approveStatus === '1') {
  640. this.approveStatusFlag = 'warning';
  641. } else if (row.approveStatus === '3') {
  642. this.approveStatusFlag = 'danger';
  643. }
  644. let processId;
  645. listLockApply({changeId: row.id}).then(res => {
  646. processId = res.rows[0].processId;
  647. getHistorylist({processId: processId}).then(response => {
  648. this.historyList = response.rows;
  649. this.historyLoading = false
  650. });
  651. })
  652. },
  653. getLockList() {
  654. listEoegLock({status: 0}).then(response => {
  655. this.lockList = response.rows;
  656. });
  657. },
  658. /** 查询EOEG 锁开锁关申请列表 */
  659. getList() {
  660. this.loading = true;
  661. listEoegChange(this.queryParams).then(response => {
  662. this.eoegChangeList = response.rows;
  663. this.total = response.total;
  664. this.loading = false;
  665. });
  666. },
  667. /** 查询部门下拉树结构 */
  668. getTreeselect() {
  669. treeselect().then(response => {
  670. this.deptOptions = response.data;
  671. });
  672. },
  673. // 取消按钮
  674. cancel() {
  675. this.open = false;
  676. this.reset();
  677. },
  678. // 表单重置
  679. reset() {
  680. this.form = {
  681. id: null,
  682. changeDescribe: null,
  683. changeReason: null,
  684. applicant: null,
  685. applicantName: null,
  686. applicationTime: null,
  687. safa: null,
  688. safaer: null,
  689. safaerName: null,
  690. safaTime: null,
  691. approver: null,
  692. approverName: null,
  693. approveTime: null,
  694. executor: null,
  695. executorName: null,
  696. executionTime: null,
  697. confirmer: null,
  698. confirmerName: null,
  699. confirmTime: null,
  700. changeExecution: null,
  701. changeExecutor: null,
  702. changeExecutorName: null,
  703. changeExecutorTime: null,
  704. resetConfirm: null,
  705. resetConfirmer1: null,
  706. resetConfirmerName1: null,
  707. resetConfirmTime1: null,
  708. resetConfirmer2: null,
  709. resetConfirmerName2: null,
  710. resetConfirmTime2: null,
  711. revokeConfirm: null,
  712. remarks: null,
  713. status: 0,
  714. delFlag: null,
  715. createrCode: null,
  716. createdate: null,
  717. updaterCode: null,
  718. updatedate: null,
  719. deptId: null,
  720. approveStatus: "0",
  721. apNo: null,
  722. processId: null,
  723. lockNo: null,
  724. changeConfirmer: null,
  725. changeConfirmerName: null,
  726. changeConfirmTime: null,
  727. monitor: null,
  728. monitorName: null,
  729. monitorTime: null
  730. };
  731. this.resetForm("form");
  732. },
  733. /** 搜索按钮操作 */
  734. handleQuery() {
  735. this.queryParams.pageNum = 1;
  736. this.getList();
  737. },
  738. /** 重置按钮操作 */
  739. resetQuery() {
  740. this.resetForm("queryForm");
  741. this.handleQuery();
  742. },
  743. // 多选框选中数据
  744. handleSelectionChange(selection) {
  745. this.ids = selection.map(item => item.id)
  746. this.single = selection.length !== 1
  747. this.multiple = !selection.length
  748. },
  749. /** 新增按钮操作 */
  750. handleAdd() {
  751. this.reset();
  752. this.open = true;
  753. this.title = "添加EOEG 锁开锁关申请";
  754. },
  755. /** 修改按钮操作 */
  756. handleUpdate(row) {
  757. this.reset();
  758. const id = row.id || this.ids
  759. getEoegChange(id).then(response => {
  760. this.form = response.data;
  761. this.open = true;
  762. this.title = "修改EOEG 锁开锁关申请";
  763. });
  764. },
  765. /** 提交按钮 */
  766. submitForm() {
  767. this.$refs["form"].validate(valid => {
  768. if (valid) {
  769. if (this.form.id != null) {
  770. updateEoegChange(this.form).then(response => {
  771. this.msgSuccess("修改成功");
  772. this.open = false;
  773. this.getList();
  774. });
  775. } else {
  776. addEoegChange(this.form).then(response => {
  777. this.msgSuccess("新增成功");
  778. this.open = false;
  779. this.getList();
  780. });
  781. }
  782. }
  783. });
  784. },
  785. /** 删除按钮操作 */
  786. handleDelete(row) {
  787. const ids = row.id || this.ids;
  788. this.$confirm('是否确认删除?', "警告", {
  789. confirmButtonText: "确定",
  790. cancelButtonText: "取消",
  791. type: "warning"
  792. }).then(function () {
  793. return delEoegChange(ids);
  794. }).then(() => {
  795. this.getList();
  796. this.msgSuccess("删除成功");
  797. })
  798. },
  799. /** 导出按钮操作 */
  800. handleExport() {
  801. const queryParams = this.queryParams;
  802. this.$confirm('是否确认导出所有EOEG 锁开锁关申请数据项?', "警告", {
  803. confirmButtonText: "确定",
  804. cancelButtonText: "取消",
  805. type: "warning"
  806. }).then(function () {
  807. return exportEoegChange(queryParams);
  808. }).then(response => {
  809. this.download(response.msg);
  810. })
  811. },
  812. /** 导入按钮操作 */
  813. handleImport() {
  814. this.upload.title = "用户导入";
  815. this.upload.open = true;
  816. },
  817. /** 下载模板操作 */
  818. importTemplate() {
  819. importTemplate().then(response => {
  820. this.download(response.msg);
  821. });
  822. },
  823. // 文件上传中处理
  824. handleFileUploadProgress(event, file, fileList) {
  825. this.upload.isUploading = true;
  826. },
  827. // 文件上传成功处理
  828. handleFileSuccess(response, file, fileList) {
  829. this.upload.open = false;
  830. this.upload.isUploading = false;
  831. this.$refs.upload.clearFiles();
  832. this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
  833. this.getList();
  834. },
  835. // 提交上传文件
  836. submitFileForm() {
  837. this.$refs.upload.submit();
  838. }
  839. }
  840. };
  841. </script>