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