index.vue 25 KB

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