index.vue 29 KB

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