index.vue 29 KB

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