index.vue 25 KB

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