index.vue 31 KB

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