index.vue 28 KB

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