index.vue 26 KB

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