index.vue 23 KB

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