index.vue 28 KB

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