index.vue 24 KB

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