index.vue 25 KB

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