index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="位号/管线号" prop="tagNo">
  5. <el-input
  6. v-model="queryParams.tagNo"
  7. placeholder="请输入位号/管线号"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="设备名称" prop="equipmentName">
  14. <el-input
  15. v-model="queryParams.equipmentName"
  16. placeholder="请输入设备名称"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="图号" prop="pidNo">
  23. <el-input
  24. v-model="queryParams.pidNo"
  25. placeholder="请输入图号"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item>
  32. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  33. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  34. </el-form-item>
  35. </el-form>
  36. <el-row :gutter="10" class="mb8">
  37. <el-col :span="1.5">
  38. <el-button
  39. type="primary"
  40. icon="el-icon-plus"
  41. size="mini"
  42. @click="handleAdd"
  43. v-if="isApprove==0"
  44. v-hasPermi="['pssr:overhaulTower:add']"
  45. >新增
  46. </el-button>
  47. </el-col>
  48. <el-col :span="1.5">
  49. <el-button
  50. type="success"
  51. icon="el-icon-edit"
  52. size="mini"
  53. :disabled="single"
  54. @click="handleUpdate"
  55. v-if="isApprove==0"
  56. v-hasPermi="['pssr:overhaulTower:edit']"
  57. >修改
  58. </el-button>
  59. </el-col>
  60. <el-col :span="1.5">
  61. <el-button
  62. type="success"
  63. icon="el-icon-edit"
  64. size="mini"
  65. :disabled="multiple"
  66. @click="handleBatch"
  67. v-if="isApprove==0"
  68. v-hasPermi="['pssr:overhaulTower:edit']"
  69. >批量修改
  70. </el-button>
  71. </el-col>
  72. <el-col :span="1.5">
  73. <el-button
  74. type="danger"
  75. icon="el-icon-delete"
  76. size="mini"
  77. :disabled="multiple"
  78. @click="handleDelete"
  79. v-if="isApprove==0"
  80. v-hasPermi="['pssr:overhaulTower:remove']"
  81. >删除
  82. </el-button>
  83. </el-col>
  84. <el-col :span="1.5">
  85. <el-button
  86. type="info"
  87. icon="el-icon-upload2"
  88. size="mini"
  89. @click="handleImport"
  90. v-if="isApprove==0"
  91. v-hasPermi="['pssr:overhaulTower:edit']"
  92. >导入
  93. </el-button>
  94. </el-col>
  95. <el-col :span="1.5">
  96. <el-button
  97. type="warning"
  98. icon="el-icon-download"
  99. size="mini"
  100. @click="handleExport"
  101. v-if="isApprove==0"
  102. v-hasPermi="['pssr:overhaulTower:export']"
  103. >导出
  104. </el-button>
  105. </el-col>
  106. <el-col :span="1.5">
  107. <el-button
  108. type="success"
  109. icon="el-icon-s-promotion"
  110. size="mini"
  111. @click="handleApprove"
  112. v-if="isApprove==0"
  113. v-hasPermi="['pssr:overhaulTower:edit']"
  114. >发起审批
  115. </el-button>
  116. </el-col>
  117. <el-col :span="1.5">
  118. <el-button
  119. type="danger"
  120. icon="el-icon-refresh-left"
  121. size="mini"
  122. v-if="isApprove==2"
  123. :disabled="multiple"
  124. @click="handleTurnDown"
  125. v-hasPermi="['pssr:overhaulTower:edit']"
  126. >驳回
  127. </el-button>
  128. </el-col>
  129. <el-col :span="1.5">
  130. <el-button
  131. type="primary"
  132. icon="el-icon-check"
  133. size="mini"
  134. v-if="isApprove==4"
  135. @click="handleConfirmApprove"
  136. v-hasPermi="['pssr:overhaulTower:edit']"
  137. >确认
  138. </el-button>
  139. </el-col>
  140. <!-- <el-col :span="1.5">-->
  141. <!-- <el-button-->
  142. <!-- type="primary"-->
  143. <!-- icon="el-icon-upload"-->
  144. <!-- size="mini"-->
  145. <!-- @click="handleDoc"-->
  146. <!-- >附件-->
  147. <!-- </el-button>-->
  148. <!-- </el-col>-->
  149. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  150. </el-row>
  151. <div style="width: 100%;text-align: center;margin-bottom: 15px">
  152. <H2>塔罐检修清单</H2><br>
  153. <span>检查确认检修项目是否已经完成,检修项目已经完成的在“完成状态”栏中打“✔”,未完成的打“×”。</span><br>
  154. <span>未完成的检修项按照该条检修要求立即整改。如不能立即整改的,请立即汇报相关负责人并采取临时应对措施。</span>
  155. </div>
  156. <el-table v-loading="loading" :data="overhaulTowerList" @selection-change="handleSelectionChange"
  157. :height="clientHeight" border>
  158. <el-table-column type="selection" width="55" align="center" />
  159. <el-table-column label="审批状态" align="center" prop="approveStatus" width="120">
  160. <template slot-scope="scope">
  161. <dict-tag :options="dict.type.pssr_approve_status" :value="scope.row.approveStatus" :show-type="getTagType(scope.row.approveStatus)"/>
  162. </template>
  163. </el-table-column>
  164. <el-table-column label="位号/管线号" align="center" prop="tagNo" :show-overflow-tooltip="true"/>
  165. <el-table-column label="设备名称" align="center" prop="equipmentName" :show-overflow-tooltip="true"/>
  166. <el-table-column label="PI&D图号" align="center" prop="pidNo" :show-overflow-tooltip="true"/>
  167. <el-table-column label="检修内容" align="center" prop="workDes" :show-overflow-tooltip="true"/>
  168. <el-table-column label="完成状态" align="center" prop="completionStatus" :show-overflow-tooltip="true"/>
  169. <el-table-column label="确认人" align="center" prop="confirmerName" :show-overflow-tooltip="true"/>
  170. <el-table-column label="确认时间" align="center" prop="completionDate" >
  171. <template slot-scope="scope">
  172. <span>{{ parseTime(scope.row.completionDate, '{y}-{m}-{d}') }}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="驳回原因" align="center" prop="reason" :show-overflow-tooltip="true"/>
  176. <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  177. <el-table-column label="操作" align="center" v-if="isApprove==0"
  178. class-name="small-padding fixed-width">
  179. <template slot-scope="scope">
  180. <el-button
  181. size="mini"
  182. type="text"
  183. icon="el-icon-folder"
  184. @click="handleDocP(scope.row)"
  185. >附件
  186. </el-button>
  187. <el-button
  188. size="mini"
  189. type="text"
  190. icon="el-icon-edit"
  191. @click="handleUpdate(scope.row)"
  192. v-hasPermi="['pssr:overhaulTower:edit']"
  193. >修改
  194. </el-button>
  195. <el-button
  196. size="mini"
  197. type="text"
  198. icon="el-icon-delete"
  199. @click="handleDelete(scope.row)"
  200. v-hasPermi="['pssr:overhaulTower:remove']"
  201. >删除
  202. </el-button>
  203. </template>
  204. </el-table-column>
  205. </el-table>
  206. <pagination
  207. v-show="total>0"
  208. :total="total"
  209. :page.sync="queryParams.pageNum"
  210. :limit.sync="queryParams.pageSize"
  211. @pagination="getList"
  212. />
  213. <!-- 添加或修改检修项目-塔罐对话框 -->
  214. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
  215. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  216. <el-form-item label="位号/管线号" prop="tagNo">
  217. <el-input v-model="form.tagNo" placeholder="请输入位号/管线号"/>
  218. </el-form-item>
  219. <el-form-item label="设备名称" prop="equipmentName">
  220. <el-input v-model="form.equipmentName" placeholder="请输入设备名称"/>
  221. </el-form-item>
  222. <el-form-item label="检修内容" prop="workDes">
  223. <el-input v-model="form.workDes" placeholder="请输入检修内容"/>
  224. </el-form-item>
  225. <el-form-item label="图号" prop="pidNo">
  226. <el-input v-model="form.pidNo" placeholder="请输入图号"/>
  227. </el-form-item>
  228. <el-form-item label="完成状态" prop="completionStatus">
  229. <el-radio-group v-model="form.completionStatus">
  230. <el-radio label="✔">✔</el-radio>
  231. <el-radio label="✖">✖</el-radio>
  232. </el-radio-group>
  233. </el-form-item>
  234. <el-form-item label="确认人" prop="confirmedPerson">
  235. <el-select v-model="form.confirmedPerson" clearable filterable style="width: 100%;"
  236. placeholder="请选择确认人">
  237. <el-option v-for="user in userOptions"
  238. :label="user.nickName"
  239. :value="user.userId+''"
  240. :key="user.userId"/>
  241. </el-select>
  242. </el-form-item>
  243. <el-form-item label="备注" prop="remarks">
  244. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  245. </el-form-item>
  246. </el-form>
  247. <div slot="footer" class="dialog-footer">
  248. <el-button type="primary" @click="submitForm">确 定</el-button>
  249. <el-button @click="cancel">取 消</el-button>
  250. </div>
  251. </el-dialog>
  252. <!-- 批量修改对话框 -->
  253. <el-dialog :close-on-click-modal="false" title="批量修改" :visible.sync="openBatch" width="500px" append-to-body>
  254. <el-form ref="form" :model="form" label-width="80px">
  255. <el-form-item>
  256. <span>已选择 {{ ids.length }} 条数据</span>
  257. </el-form-item>
  258. <el-form-item label="确认人1" prop="confirmedPerson"
  259. v-if="isApprove==0">
  260. <el-select v-model="form.confirmedPerson" clearable filterable style="width: 100%;"
  261. placeholder="请选择确认人1">
  262. <el-option v-for="user in userOptions"
  263. :label="user.nickName"
  264. :value="user.userId+''"
  265. :key="user.userId"/>
  266. </el-select>
  267. </el-form-item>
  268. <el-form-item label="时间" v-hasPermi="['pssr:date:edit']" prop="completionDate">
  269. <el-date-picker clearable size="small" style="width: 200px"
  270. v-model="form.completionDate"
  271. type="date"
  272. value-format="yyyy-MM-dd"
  273. placeholder="选择时间">
  274. </el-date-picker>
  275. </el-form-item>
  276. <el-form-item label="备注" prop="remarks">
  277. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  278. </el-form-item>
  279. </el-form>
  280. <div slot="footer" class="dialog-footer">
  281. <el-button type="primary" @click="submitFormBatch">确 定</el-button>
  282. <el-button @click="cancelBatch">取 消</el-button>
  283. </div>
  284. </el-dialog>
  285. <!-- 用户导入对话框 -->
  286. <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" width="400px"
  287. append-to-body>
  288. <el-upload
  289. ref="upload"
  290. :limit="1"
  291. accept=".xlsx, .xls"
  292. :headers="upload.headers"
  293. :action="upload.url"
  294. :disabled="upload.isUploading"
  295. :on-progress="handleFileUploadProgress"
  296. :on-success="handleFileSuccess"
  297. :auto-upload="false"
  298. drag
  299. >
  300. <i class="el-icon-upload"></i>
  301. <div class="el-upload__text">
  302. 将文件拖到此处,或
  303. <em>点击上传</em>
  304. </div>
  305. <div class="el-upload__tip" slot="tip">
  306. <!--<el-checkbox v-model="upload.updateSupport"/>-->
  307. <!--是否更新已经存在的用户数据-->
  308. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  309. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  310. <input name="type" :value="upload.type" hidden />
  311. </form>
  312. </div>
  313. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  314. </el-upload>
  315. <div slot="footer" class="dialog-footer">
  316. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  317. <el-button @click="upload.open = false">取 消</el-button>
  318. </div>
  319. </el-dialog>
  320. <!-- 附件对话框 -->
  321. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px"
  322. append-to-body>
  323. <el-upload v-show="isApprove==0"
  324. ref="doc"
  325. :limit="50"
  326. :headers="doc.headers"
  327. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  328. :disabled="doc.isUploading"
  329. :on-progress="handleFileDocProgress"
  330. :on-success="handleFileDocSuccess"
  331. :auto-upload="true"
  332. drag
  333. >
  334. <i class="el-icon-upload"></i>
  335. <div class="el-upload__text">
  336. 将文件拖到此处,或
  337. <em>点击上传</em>
  338. </div>
  339. </el-upload>
  340. <el-table :data="doc.commonfileList" border>
  341. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  342. <template slot-scope="scope">
  343. <a class="link-type" @click="handleDownload(scope.row)">
  344. <span>{{ scope.row.fileName }}</span>
  345. </a>
  346. </template>
  347. </el-table-column>
  348. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true"
  349. width="80"/>
  350. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  351. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  352. <template slot-scope="scope">
  353. <el-button
  354. v-if="scope.row.fileName.endsWith('pdf')"
  355. size="mini"
  356. type="text"
  357. icon="el-icon-view"
  358. @click="handleSee(scope.row)"
  359. >预览
  360. </el-button>
  361. <el-button
  362. size="mini"
  363. type="text"
  364. icon="el-icon-download"
  365. @click="handleDownload(scope.row)"
  366. >下载
  367. </el-button>
  368. <el-button
  369. size="mini" v-if="isApprove==0"
  370. type="text"
  371. icon="el-icon-delete"
  372. @click="handleDeleteDoc(scope.row)"
  373. >删除
  374. </el-button>
  375. </template>
  376. </el-table-column>
  377. </el-table>
  378. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"
  379. append-to-body>
  380. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  381. <el-button size="mini" type="text" @click="openPdf">新页面打开PDF</el-button>
  382. </div>
  383. <div style="margin-top: -30px">
  384. <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
  385. </div>
  386. </el-dialog>
  387. <div slot="footer" class="dialog-footer">
  388. <el-button @click="doc.open = false">返 回</el-button>
  389. </div>
  390. </el-dialog>
  391. <!-- 附件对话框 -->
  392. <el-dialog v-dialogDrag :close-on-click-modal="false" :visible.sync="doc_p.open" append-to-body title="现场照片"
  393. width="1000px">
  394. <el-image v-for="file in doc_p.fileList" :key="file.id" :src="file.fileUrl" lazy></el-image>
  395. </el-dialog>
  396. <!-- 驳回原因对话框 -->
  397. <el-dialog v-dialogDrag :close-on-click-modal="false" :visible.sync="reason.open" append-to-body title="驳回"
  398. width="1000px">
  399. <el-table :data="items" border>
  400. <el-table-column label="位号/管线号" align="center" prop="tagNo" :show-overflow-tooltip="true"/>
  401. <el-table-column label="设备名称" align="center" prop="equipmentName" :show-overflow-tooltip="true"/>
  402. <el-table-column label="驳回原因" align="center" prop="reason" :show-overflow-tooltip="true">
  403. <template slot-scope="scope">
  404. <el-input v-model="scope.row.reason" placeholder="请输入驳回原因"/>
  405. </template>
  406. </el-table-column>
  407. </el-table>
  408. <div slot="footer" class="dialog-footer">
  409. <el-button type="primary" @click="submitReasonForm">确 定</el-button>
  410. <el-button @click="reasonCancel">取 消</el-button>
  411. </div>
  412. </el-dialog>
  413. </div>
  414. </template>
  415. <script>
  416. import {
  417. addOverhaulTower,
  418. delOverhaulTower,
  419. exportOverhaulTower,
  420. getOverhaulTower,
  421. handleConfirmApprove,
  422. handleTurnDownTower,
  423. importTemplate,
  424. listOverhaulTower,
  425. updateOverhaulTower,
  426. updateOverhaulTowerBatch,
  427. } from "@/api/pssr/overhaulTower";
  428. import {treeselect} from "@/api/system/dept";
  429. import {getToken} from "@/utils/auth";
  430. import Treeselect from "@riophae/vue-treeselect";
  431. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  432. import {groupList} from "@/api/pssr/region";
  433. import {getPssrUser} from "@/api/pssr/aboveall";
  434. import {listFile} from "@/api/pssr/file";
  435. import {doApprove} from "@/api/pssr/approve";
  436. import {getSubcontent} from "@/api/pssr/subcontent";
  437. import {allFileList, delCommonfile} from "@/api/common/commonfile";
  438. import {updateMaterialBatch} from "@/api/pssr/material";
  439. export default {
  440. dicts:['pssr_approve_status'],
  441. name: "OverhaulTower",
  442. components: {Treeselect},
  443. props: {
  444. subId: {
  445. type: Number,
  446. default: 0
  447. },
  448. isApprove: {
  449. type: Number,
  450. default: 0
  451. },
  452. },
  453. data() {
  454. return {
  455. reason: {
  456. open: false
  457. },
  458. doc_p: {
  459. file: "",
  460. // 是否显示弹出层(报告附件)
  461. open: false,
  462. fileList: [],
  463. queryParams: {
  464. itemId: null,
  465. subId: this.subId,
  466. forShort: 'jxxm-tg'
  467. },
  468. },
  469. doc: {
  470. file: "",
  471. // 是否显示弹出层(报告附件)
  472. open: false,
  473. // 弹出层标题(报告附件)
  474. title: "附件",
  475. // 是否禁用上传
  476. isUploading: false,
  477. // 是否更新已经存在的用户数据
  478. updateSupport: 0,
  479. // 报告附件上传位置编号
  480. ids: 0,
  481. // 设置上传的请求头部
  482. headers: {Authorization: "Bearer " + getToken()},
  483. // 上传的地址
  484. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  485. commonfileList: null,
  486. queryParams: {
  487. pId: null,
  488. pType: 'pssrJxxm'
  489. },
  490. pType: 'pssrJxxm',
  491. pId: null,
  492. form: {}
  493. },
  494. pdf: {
  495. title: '',
  496. pdfUrl: '',
  497. numPages: null,
  498. open: false,
  499. pageNum: 1,
  500. pageTotalNum: 1,
  501. loadedRatio: 0,
  502. },
  503. regionGroupOptions: [],
  504. unitOptions: [],
  505. userOptions: [],
  506. region: null,
  507. unit: null,
  508. unitDes: null,
  509. subStatus: null,
  510. // 遮罩层
  511. loading: true,
  512. // 选中数组
  513. ids: [],
  514. items: [],
  515. // 非单个禁用
  516. single: true,
  517. // 非多个禁用
  518. multiple: true,
  519. // 显示搜索条件
  520. showSearch: false,
  521. // 总条数
  522. total: 0,
  523. // 检修项目-塔罐表格数据
  524. overhaulTowerList: [],
  525. // 弹出层标题
  526. title: "",
  527. // 部门树选项
  528. deptOptions: undefined,
  529. clientHeight: 300,
  530. // 是否显示弹出层
  531. open: false,
  532. openBatch: false,
  533. // 用户导入参数
  534. upload: {
  535. //下载模板请求地址
  536. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  537. //下载模板类型
  538. type: 'overhaulTower',
  539. // 是否显示弹出层(用户导入)
  540. open: false,
  541. // 弹出层标题(用户导入)
  542. title: "",
  543. // 是否禁用上传
  544. isUploading: false,
  545. // 是否更新已经存在的用户数据
  546. updateSupport: 0,
  547. // 设置上传的请求头部
  548. headers: {Authorization: "Bearer " + getToken()},
  549. // 上传的地址
  550. url: process.env.VUE_APP_BASE_API + "/pssr/overhaulTower/importData?subId=" + this.subId
  551. },
  552. // 查询参数
  553. queryParams: {
  554. pageNum: 1,
  555. pageSize: 20,
  556. subId: this.subId,
  557. approveId: null,
  558. tagNo: null,
  559. equipmentName: null,
  560. workDes: null,
  561. pidNo: null,
  562. completionDate: null,
  563. confirmedPerson: null,
  564. createrCode: null,
  565. createdate: null,
  566. updaterCode: null,
  567. updatedate: null,
  568. deptId: null,
  569. remarks: null
  570. },
  571. // 表单参数
  572. form: {},
  573. // 表单校验
  574. rules: {
  575. confirmedPerson: [{required: true, message: "确认人不可为空", trigger: "blur"}],
  576. }
  577. };
  578. },
  579. watch: {
  580. // 根据名称筛选部门树
  581. deptName(val) {
  582. this.$refs.tree.filter(val);
  583. }
  584. },
  585. created() {
  586. //设置表格高度对应屏幕高度
  587. this.$nextTick(() => {
  588. this.clientHeight = document.body.clientHeight - 350
  589. })
  590. this.getList();
  591. this.getTreeselect();
  592. getPssrUser({}).then(res => {
  593. this.userOptions = res.data
  594. });
  595. groupList({}).then(res => {
  596. this.regionGroupOptions = res.data;
  597. });
  598. getSubcontent(this.subId).then(res => {
  599. this.unit = res.data.unit
  600. this.region = res.data.region
  601. this.unitDes = res.data.unitDes
  602. this.subStatus = res.data.approveStatus
  603. })
  604. },
  605. methods: {
  606. handleTurnDown(val) {
  607. this.reason.open=true;
  608. },
  609. getTagType(val){
  610. if (val==0){
  611. return ''
  612. }else if (val==1){
  613. return 'warning'
  614. }else if (val==2){
  615. return 'success'
  616. }
  617. },
  618. checkSelectable(row) {
  619. return (row.approveStatus == 1 && this.isApprove != 0) || this.isApprove == 0
  620. },
  621. handleConfirmApprove() {
  622. let data = {
  623. ids: this.ids,
  624. subId: this.subId,
  625. }
  626. handleConfirmApprove(data).then(res => {
  627. this.msgSuccess("确认成功");
  628. this.getList()
  629. })
  630. },
  631. /** 查询检修项目-塔罐列表 */
  632. getList() {
  633. this.loading = true;
  634. listOverhaulTower(this.queryParams).then(response => {
  635. this.overhaulTowerList = response.rows;
  636. this.total = response.total;
  637. this.loading = false;
  638. });
  639. },
  640. /** 查询部门下拉树结构 */
  641. getTreeselect() {
  642. treeselect().then(response => {
  643. this.deptOptions = response.data;
  644. });
  645. },
  646. // 取消按钮
  647. cancel() {
  648. this.open = false;
  649. this.reset();
  650. },
  651. // 表单重置
  652. reset() {
  653. this.form = {
  654. id: null,
  655. subId: this.subId,
  656. approveId: null,
  657. completionStatus: null,
  658. tagNo: null,
  659. equipmentName: null,
  660. workDes: null,
  661. pidNo: null,
  662. completionDate: null,
  663. confirmedPerson: null,
  664. delFlag: null,
  665. createrCode: null,
  666. createdate: null,
  667. updaterCode: null,
  668. updatedate: null,
  669. deptId: null,
  670. remarks: null
  671. };
  672. this.resetForm("form");
  673. },
  674. /** 搜索按钮操作 */
  675. handleQuery() {
  676. this.queryParams.pageNum = 1;
  677. this.getList();
  678. },
  679. /** 重置按钮操作 */
  680. resetQuery() {
  681. this.resetForm("queryForm");
  682. this.handleQuery();
  683. },
  684. // 多选框选中数据
  685. handleSelectionChange(selection) {
  686. this.items=selection;
  687. this.ids = selection.map(item => item.id)
  688. this.single = selection.length !== 1
  689. this.multiple = !selection.length
  690. },
  691. /** 新增按钮操作 */
  692. handleAdd() {
  693. this.reset();
  694. this.open = true;
  695. this.title = "添加检修项目-塔罐";
  696. },
  697. /** 修改按钮操作 */
  698. handleUpdate(row) {
  699. this.reset();
  700. const id = row.id || this.ids
  701. getOverhaulTower(id).then(response => {
  702. this.form = response.data;
  703. this.open = true;
  704. this.title = "修改检修项目-塔罐";
  705. });
  706. },
  707. /** 提交按钮 */
  708. submitForm() {
  709. this.$refs["form"].validate(valid => {
  710. if (valid) {
  711. if (this.form.id != null) {
  712. updateOverhaulTower(this.form).then(response => {
  713. this.msgSuccess("修改成功");
  714. this.open = false;
  715. this.getList();
  716. });
  717. } else {
  718. addOverhaulTower(this.form).then(response => {
  719. this.msgSuccess("新增成功");
  720. this.open = false;
  721. this.getList();
  722. });
  723. }
  724. }
  725. });
  726. },
  727. /** 删除按钮操作 */
  728. handleDelete(row) {
  729. const ids = row.id || this.ids;
  730. this.$confirm('是否确认删除?', "警告", {
  731. confirmButtonText: "确定",
  732. cancelButtonText: "取消",
  733. type: "warning"
  734. }).then(function () {
  735. return delOverhaulTower(ids);
  736. }).then(() => {
  737. this.getList();
  738. this.msgSuccess("删除成功");
  739. })
  740. },
  741. /** 导出按钮操作 */
  742. handleExport() {
  743. const queryParams = this.queryParams;
  744. this.$confirm('是否确认导出所有检修项目-塔罐数据项?', "警告", {
  745. confirmButtonText: "确定",
  746. cancelButtonText: "取消",
  747. type: "warning"
  748. }).then(function () {
  749. return exportOverhaulTower(queryParams);
  750. }).then(response => {
  751. this.download(response.msg);
  752. })
  753. },
  754. /** 导入按钮操作 */
  755. handleImport() {
  756. this.upload.title = "用户导入";
  757. this.upload.open = true;
  758. },
  759. /** 下载模板操作 */
  760. importTemplate() {
  761. this.$refs['downloadFileForm'].submit()
  762. },
  763. // 文件上传中处理
  764. handleFileUploadProgress(event, file, fileList) {
  765. this.upload.isUploading = true;
  766. },
  767. // 文件上传成功处理
  768. handleFileSuccess(response, file, fileList) {
  769. this.upload.open = false;
  770. this.upload.isUploading = false;
  771. this.$refs.upload.clearFiles();
  772. this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
  773. this.getList();
  774. },
  775. // 提交上传文件
  776. submitFileForm() {
  777. this.$refs.upload.submit();
  778. },
  779. /** 报告附件按钮操作 */
  780. handleDocP(row) {
  781. this.doc_p.fileList = []
  782. this.doc_p.open = true;
  783. this.doc_p.queryParams.itemId = row.id
  784. this.getPFileList()
  785. },
  786. getPFileList() {
  787. listFile(this.doc_p.queryParams).then(response => {
  788. this.doc_p.fileList = response.rows;
  789. this.doc_p.fileList.forEach(item => {
  790. item.fileUrl = process.env.VUE_APP_BASE_API + item.fileUrl;
  791. });
  792. });
  793. },
  794. /** 确认按钮操作*/
  795. handleApprove() {
  796. doApprove(this.subId).then(res => {
  797. this.msgSuccess("已发起确认流程");
  798. this.getList();
  799. })
  800. },
  801. /** 报告附件按钮操作 */
  802. handleDoc(row, fileType) {
  803. this.doc.id = row.id;
  804. this.doc.title = this.$t('附件');
  805. this.doc.open = true;
  806. this.doc.queryParams.pId = this.subId
  807. this.doc.pId = this.subId
  808. this.getFileList()
  809. this.$nextTick(() => {
  810. this.$refs.doc.clearFiles()
  811. })
  812. },
  813. getFileList() {
  814. allFileList(this.doc.queryParams).then(response => {
  815. response.forEach(element => {
  816. element["isEdit"] = false
  817. });
  818. response.forEach(element => {
  819. element["isAdd"] = false
  820. });
  821. this.doc.commonfileList = response;
  822. });
  823. },
  824. //附件上传中处理
  825. handleFileDocProgress(event, file, fileList) {
  826. this.doc.file = file;
  827. this.doc.isUploading = true;
  828. },
  829. //附件上传成功处理
  830. handleFileDocSuccess(response, file, fileList) {
  831. this.doc.isUploading = false;
  832. this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  833. this.getFileList()
  834. },
  835. // 文件下载处理
  836. handleDownload(row) {
  837. var name = row.fileName;
  838. var url = row.fileUrl;
  839. var suffix = url.substring(url.lastIndexOf("."), url.length);
  840. const a = document.createElement('a')
  841. a.setAttribute('download', name)
  842. a.setAttribute('target', '_blank')
  843. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  844. a.click()
  845. },
  846. openPdf() {
  847. window.open(this.pdf.pdfUrl);//path是文件的全路径地址
  848. },
  849. handleSee(row) {
  850. this.pdf.open = true
  851. this.pdf.title = row.fileName
  852. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  853. },
  854. /** 删除按钮操作 */
  855. handleDeleteDoc(row) {
  856. const ids = row.id || this.ids;
  857. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  858. confirmButtonText: this.$t('确定'),
  859. cancelButtonText: this.$t('取消'),
  860. type: "warning"
  861. }).then(function () {
  862. return delCommonfile(ids);
  863. }).then(() => {
  864. this.getFileList()
  865. this.msgSuccess(this.$t('删除成功'));
  866. })
  867. },
  868. reasonCancel() {
  869. this.reason.open = false;
  870. },
  871. submitReasonForm(){
  872. handleTurnDownTower(this.items).then(res => {
  873. this.msgSuccess("驳回成功");
  874. this.reason.open = false;
  875. this.$emit('refreshHisList');
  876. })
  877. },
  878. handleBatch(){
  879. this.reset();
  880. this.openBatch = true
  881. },
  882. // 取消按钮
  883. cancelBatch() {
  884. this.openBatch = false;
  885. this.reset();
  886. },
  887. /** 提交按钮 */
  888. submitFormBatch() {
  889. this.$refs["form"].validate(valid => {
  890. if (valid) {
  891. this.form.ids = this.ids
  892. updateOverhaulTowerBatch(this.form).then(response => {
  893. this.msgSuccess("修改成功");
  894. this.openBatch = false;
  895. this.getList();
  896. });
  897. }
  898. });
  899. },
  900. }
  901. };
  902. </script>