index.vue 26 KB

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