index.vue 24 KB

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