index.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154
  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="$t('批文名称')" prop="approvalname" label-width="150">
  5. <el-input
  6. v-model="queryParams.approvalname"
  7. :placeholder="$t('请输入') + $t('批文名称')"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item :label="$t('证书编号')" prop="certno">
  14. <el-input
  15. v-model="queryParams.certno"
  16. :placeholder="$t('请输入') + $t('证书编号')"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item :label="$t('批准日期')" prop="effetiveYear">
  23. <el-date-picker clearable size="small" style="width: 200px"
  24. v-model="queryParams.effetiveYear"
  25. type="year"
  26. value-format="yyyy"
  27. :placeholder="$t('请选择') + $t('批准日期') + $t('年份')">
  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">{{ $t('搜索') }}</el-button>
  32. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</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="['ehs:environapproval:add']"
  43. >{{ $t('新增') }}</el-button>
  44. </el-col>
  45. <el-col :span="1.5">
  46. <el-button
  47. type="success"
  48. icon="el-icon-edit"
  49. size="mini"
  50. :disabled="single"
  51. @click="handleUpdate"
  52. v-hasPermi="['ehs:environapproval:edit']"
  53. >{{ $t('修改') }}</el-button>
  54. </el-col>
  55. <el-col :span="1.5">
  56. <el-button
  57. type="danger"
  58. icon="el-icon-delete"
  59. size="mini"
  60. :disabled="multiple"
  61. @click="handleDelete"
  62. v-hasPermi="['ehs:environapproval:remove']"
  63. >{{ $t('删除') }}</el-button>
  64. </el-col>
  65. <el-col :span="1.5">
  66. <el-button
  67. type="info"
  68. icon="el-icon-upload2"
  69. size="mini"
  70. @click="handleImport"
  71. v-hasPermi="['ehs:environapproval:edit']"
  72. >{{ $t('导入') }}</el-button>
  73. </el-col>
  74. <el-col :span="1.5">
  75. <el-button
  76. type="warning"
  77. icon="el-icon-download"
  78. size="mini"
  79. @click="handleExport"
  80. v-hasPermi="['ehs:environapproval:export']"
  81. >{{ $t('导出') }}</el-button>
  82. </el-col>
  83. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  84. </el-row>
  85. <el-table v-loading="loading" :data="environapprovalList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  86. <el-table-column type="selection" width="55" align="center" />
  87. <el-table-column :label="$t('批文名称')" align="center" width="300" prop="approvalname" :show-overflow-tooltip="true"/>
  88. <el-table-column :label="$t('证书编号')" align="center" width="300" prop="certno" :show-overflow-tooltip="true"/>
  89. <el-table-column :label="$t('批准日期')" align="center" prop="effetivedate" width="100">
  90. <template slot-scope="scope">
  91. <span>{{ parseTime(scope.row.effetivedate, '{y}-{m}-{d}') }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column :label="$t('适用范围')" align="center" width="400" prop="scope" />
  95. <el-table-column :label="$t('相关法规')" align="center" width="400" prop="relatedlaw" :show-overflow-tooltip="true"/>
  96. <el-table-column :label="$t('审批单位')" align="center" width="200" prop="responsauth" :show-overflow-tooltip="true"/>
  97. <el-table-column :label="$t('有效期是否永久')" align="center" prop="isPermanent" :formatter="isPermanentFormat" />
  98. <el-table-column :label="$t('证书有效期')" align="center" width="300" prop="validity" />
  99. <el-table-column :label="$t('是否需要跟进')" align="center" prop="follow" :formatter="followFormat"/>
  100. <el-table-column :label="$t('使用/储存/废物最大量')" align="center" prop="allowance" :show-overflow-tooltip="true"/>
  101. <el-table-column :label="$t('排放/监控要求')" align="center" width="300" :show-overflow-tooltip="true">
  102. <template slot-scope="scope">
  103. <span v-if="scope.row.reqPic === 'false'">{{ scope.row.requirements }}</span>
  104. <span v-if="scope.row.reqPic === 'true'">
  105. 废水
  106. <el-image
  107. style="width: 100px; height: 100px"
  108. :src="scope.row.reqWater"
  109. :preview-src-list="scope.row.srcWaterList">
  110. </el-image>
  111. 废气
  112. <el-image
  113. style="width: 100px; height: 100px"
  114. :src="scope.row.reqExhaust"
  115. :preview-src-list="scope.row.srcExhaustList">
  116. </el-image>
  117. </span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column :label="$t('主要内容')" align="center" width="300" prop="content">
  121. <template slot-scope="scope">
  122. <span v-if="scope.row.conPic === 'false'">{{ scope.row.content }}</span>
  123. <span v-if="scope.row.conPic === 'true'">
  124. 废水
  125. <el-image
  126. style="width: 100px; height: 100px"
  127. :src="scope.row.conWater"
  128. :preview-src-list="scope.row.conWaterList">
  129. </el-image>
  130. 废气
  131. <el-image
  132. style="width: 100px; height: 100px"
  133. :src="scope.row.conExhaust"
  134. :preview-src-list="scope.row.conExhaustList">
  135. </el-image>
  136. </span>
  137. </template>
  138. </el-table-column>
  139. <el-table-column :label="$t('负责人')" align="center" prop="owner" :show-overflow-tooltip="true"/>
  140. <el-table-column :label="$t('回顾人')" align="center" prop="reviewerName" :show-overflow-tooltip="true"/>
  141. <el-table-column :label="$t('本次回顾日期')" align="center" prop="reviewdate" width="100">
  142. <template slot-scope="scope">
  143. <span>{{ parseTime(scope.row.reviewdate, '{y}-{m}-{d}') }}</span>
  144. </template>
  145. </el-table-column>
  146. <el-table-column :label="$t('回顾结果')" align="center" prop="reviewResult" :show-overflow-tooltip="true"/>
  147. <el-table-column :label="$t('下次回顾日期')" align="center" prop="nextreviewdate" width="100">
  148. <template slot-scope="scope">
  149. <span>{{ parseTime(scope.row.nextreviewdate, '{y}-{m}-{d}') }}</span>
  150. </template>
  151. </el-table-column>
  152. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  153. <el-table-column :label="$t('操作')" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
  154. <template slot-scope="scope">
  155. <el-button
  156. size="mini"
  157. type="text"
  158. icon="el-icon-edit"
  159. @click="handleUpdate(scope.row)"
  160. v-hasPermi="['ehs:environapproval:edit']"
  161. >{{ $t('修改') }}</el-button>
  162. <el-button
  163. size="mini"
  164. type="text"
  165. icon="el-icon-delete"
  166. @click="handleDelete(scope.row)"
  167. v-hasPermi="['ehs:environapproval:remove']"
  168. >{{ $t('删除') }}</el-button>
  169. <el-button
  170. size="mini"
  171. type="text"
  172. icon="el-icon-document"
  173. @click="handleDoc(scope.row)"
  174. v-hasPermi="['ehs:environapproval:edit']"
  175. >{{ $t('附件') }}</el-button>
  176. <!--<el-button
  177. size="mini"
  178. type="text"
  179. icon="el-icon-folder"
  180. @click="handleEditTable(scope.row)"
  181. v-hasPermi="['ehs:environapproval:edit']"
  182. >{{ $t('主要内容') }}</el-button>-->
  183. </template>
  184. </el-table-column>
  185. </el-table>
  186. <pagination
  187. v-show="total>0"
  188. :total="total"
  189. :page.sync="queryParams.pageNum"
  190. :limit.sync="queryParams.pageSize"
  191. @pagination="getList"
  192. />
  193. <!-- 添加或修改环保批文清单对话框 -->
  194. <el-dialog v-dialogDrag :title="title" :visible.sync="open" width="1200px" append-to-body>
  195. <el-form ref="form" :model="form" :rules="rules" label-width="150px">
  196. <el-row>
  197. <el-col :span="12">
  198. <el-form-item :label="$t('装置名称')" prop="plantCode">
  199. <el-select v-model="form.plantCode" :placeholder="$t('请选择') + $t('装置名称')">
  200. <el-option
  201. v-for="dict in plantCodeOptions"
  202. :key="dict.dictValue"
  203. :label="dict.dictLabel"
  204. :value="dict.dictValue"
  205. ></el-option>
  206. </el-select>
  207. </el-form-item>
  208. </el-col>
  209. <el-col :span="12">
  210. <el-form-item :label="$t('批文名称')" prop="approvalname">
  211. <el-input v-model="form.approvalname" :placeholder="$t('请输入') + $t('批文名称')" />
  212. </el-form-item>
  213. </el-col>
  214. </el-row>
  215. <el-row>
  216. <el-col :span="12">
  217. <el-form-item :label="$t('证书编号')" prop="certno">
  218. <el-input v-model="form.certno" :placeholder="$t('请选择') + $t('证书编号')" />
  219. </el-form-item>
  220. </el-col>
  221. <el-col :span="12">
  222. <el-form-item :label="$t('批准日期')" prop="effetivedate">
  223. <el-date-picker clearable size="small" style="width: 200px"
  224. v-model="form.effetivedate"
  225. type="date"
  226. value-format="yyyy-MM-dd"
  227. :placeholder="$t('请选择') + $t('批准日期')">
  228. </el-date-picker>
  229. </el-form-item>
  230. </el-col>
  231. </el-row>
  232. <el-row>
  233. <el-col :span="12">
  234. <el-form-item :label="$t('适用范围')" prop="scope">
  235. <el-input
  236. type="textarea"
  237. :rows="4"
  238. :placeholder="$t('请输入') + $t('适用范围')"
  239. v-model="form.scope">
  240. </el-input>
  241. </el-form-item>
  242. </el-col>
  243. <el-col :span="12">
  244. <el-form-item :label="$t('相关法规')" prop="relatedlaw">
  245. <el-input v-model="form.relatedlaw" :placeholder="$t('请选择') + $t('相关法规')" />
  246. </el-form-item>
  247. </el-col>
  248. </el-row>
  249. <el-row>
  250. <el-col :span="12">
  251. <el-form-item :label="$t('审批单位')" prop="responsauth">
  252. <el-input v-model="form.responsauth" :placeholder="$t('请选择') + $t('审批单位')" />
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="12">
  256. <el-form-item :label="$t('有效期是否永久')" prop="isPermanent">
  257. <el-select v-model="form.isPermanent" :placeholder="$t('请选择') + $t('有效期是否永久')" @change="permanentChange($event)">
  258. <el-option
  259. v-for="dict in isPermanentOptions"
  260. :key="dict.dictValue"
  261. :label="dict.dictLabel"
  262. :value="parseInt(dict.dictValue)"
  263. ></el-option>
  264. </el-select>
  265. </el-form-item>
  266. </el-col>
  267. </el-row>
  268. <el-row>
  269. <el-col :span="12">
  270. <el-form-item :label="$t('是否需要跟进')" prop="follow">
  271. <el-select v-model="form.follow" :placeholder="$t('请选择') + $t('是否需要跟进')">
  272. <el-option
  273. v-for="dict in followOptions"
  274. :key="dict.dictValue"
  275. :label="dict.dictLabel"
  276. :value="dict.dictValue"
  277. ></el-option>
  278. </el-select>
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="12">
  282. <el-form-item :label="$t('证书有效期')">
  283. <el-date-picker
  284. v-model="chooseDate"
  285. type="daterange"
  286. align="right"
  287. unlink-panels
  288. :range-separator="$t('至')"
  289. :start-placeholder="$t('开始日期')"
  290. :end-placeholder="$t('结束日期')"
  291. value-format="yyyy-MM-dd"
  292. :picker-options="pickerOptions"
  293. :disabled="canChange">
  294. </el-date-picker>
  295. </el-form-item>
  296. </el-col>
  297. </el-row>
  298. <el-row>
  299. <el-col :span="12">
  300. <el-form-item :label="$t('使用/储存/废物最大量')" prop="allowance">
  301. <el-input v-model="form.allowance" :placeholder="$t('请输入') + $t('使用/储存/废物最大量')" />
  302. </el-form-item>
  303. </el-col>
  304. </el-row>
  305. <el-row>
  306. <el-col :span="12">
  307. <el-form-item :label="$t('排放/监控要求为图表')" prop="reqPic">
  308. <el-checkbox v-model="form.reqPic" @change="changereqPic"></el-checkbox>
  309. </el-form-item>
  310. </el-col>
  311. <el-col :span="12">
  312. <el-form-item :label="$t('主要内容为图表')" prop="conPic">
  313. <el-checkbox v-model="form.conPic"></el-checkbox>
  314. </el-form-item>
  315. </el-col>
  316. </el-row>
  317. <el-row>
  318. <el-col :span="12">
  319. <el-form-item :label="$t('排放/监控要求')" prop="requirements">
  320. <el-input v-if="form.reqPic === false" v-model="form.requirements" :placeholder="$t('请输入') + $t('排放/监控要求')" />
  321. <span v-if="form.reqPic === true">
  322. 废水
  323. <el-upload
  324. ref="picture"
  325. :headers="picture.headers"
  326. :action="picture.url + '?pType=requirementsWaterPic&pId=' + picture.pId"
  327. :show-file-list="false"
  328. :on-success="handleWaterAvatarSuccess"
  329. list-type="picture-card"
  330. style="display: inline-block">
  331. <img v-if="picWaterUrl" :src="picWaterUrl" class="avatar">
  332. <i v-else class="el-icon-plus "></i>
  333. </el-upload>
  334. 废气
  335. <el-upload
  336. ref="picture"
  337. :headers="picture.headers"
  338. :action="picture.url + '?pType=requirementsExhaustPic&pId=' + picture.pId"
  339. :show-file-list="false"
  340. :on-success="handleExhaustAvatarSuccess"
  341. list-type="picture-card"
  342. style="display: inline-block">
  343. <img v-if="picExhaustUrl" :src="picExhaustUrl" class="avatar">
  344. <i v-else class="el-icon-plus "></i>
  345. </el-upload>
  346. </span>
  347. </el-form-item>
  348. </el-col>
  349. <el-col :span="12">
  350. <el-form-item :label="$t('主要内容')" prop="content">
  351. <el-input v-if="form.conPic === false" v-model="form.content" type="textarea" :placeholder="$t('请输入') + $t('主要内容')" />
  352. <span v-if="form.conPic === true">
  353. 废水
  354. <el-upload
  355. ref="picture"
  356. :headers="picture.headers"
  357. :action="picture.url + '?pType=contentWaterPic&pId=' + picture.pId"
  358. :show-file-list="false"
  359. :on-success="handleWaterConSuccess"
  360. list-type="picture-card"
  361. style="display: inline-block">
  362. <img v-if="conWaterUrl" :src="conWaterUrl" class="avatar">
  363. <i v-else class="el-icon-plus "></i>
  364. </el-upload>
  365. 废气
  366. <el-upload
  367. ref="picture"
  368. :headers="picture.headers"
  369. :action="picture.url + '?pType=contentExhaustPic&pId=' + picture.pId"
  370. :show-file-list="false"
  371. :on-success="handleExhaustConSuccess"
  372. list-type="picture-card"
  373. style="display: inline-block">
  374. <img v-if="conExhaustUrl" :src="conExhaustUrl" class="avatar">
  375. <i v-else class="el-icon-plus "></i>
  376. </el-upload>
  377. </span>
  378. </el-form-item>
  379. </el-col>
  380. </el-row>
  381. <el-row>
  382. <el-col :span="12">
  383. <el-form-item :label="$t('负责人')" prop="owner">
  384. <el-input v-model="form.owner" :placeholder="$t('请选择') + $t('负责人')" />
  385. </el-form-item>
  386. </el-col>
  387. <el-col :span="12">
  388. <el-form-item :label="$t('回顾人')" prop="reviewer">
  389. <el-select v-model="form.reviewer" filterable :placeholder="$t('请选择') + $t('回顾人')">
  390. <el-option
  391. v-for="dict in reviewerOptions"
  392. :key="dict.staffid"
  393. :label="dict.name"
  394. :value="dict.staffid">
  395. <span style="float: left">{{ dict.name }}</span>
  396. <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
  397. </el-option>
  398. </el-select>
  399. </el-form-item>
  400. </el-col>
  401. </el-row>
  402. <el-row>
  403. <el-col :span="12">
  404. <el-form-item :label="$t('本次回顾日期')" prop="reviewdate">
  405. <el-date-picker clearable size="small" style="width: 200px"
  406. v-model="form.reviewdate"
  407. type="date"
  408. value-format="yyyy-MM-dd"
  409. :placeholder="$t('请选择') + $t('本次回顾日期')">
  410. </el-date-picker>
  411. </el-form-item>
  412. </el-col>
  413. <el-col :span="12">
  414. <el-form-item :label="$t('回顾结果')" prop="reviewResult">
  415. <el-input v-model="form.reviewResult" :placeholder="$t('请输入') + $t('回顾结果')" />
  416. </el-form-item>
  417. </el-col>
  418. </el-row>
  419. <el-row>
  420. <el-col :span="12">
  421. <el-form-item :label="$t('下次回顾日期')" prop="nextreviewdate">
  422. <el-date-picker clearable size="small" style="width: 200px"
  423. v-model="form.nextreviewdate"
  424. type="date"
  425. value-format="yyyy-MM-dd"
  426. :placeholder="$t('请选择') + $t('下次回顾日期')">
  427. </el-date-picker>
  428. </el-form-item>
  429. </el-col>
  430. <el-col :span="12">
  431. <el-form-item :label="$t('备注')" prop="remarks">
  432. <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
  433. </el-form-item>
  434. </el-col>
  435. </el-row>
  436. <el-row>
  437. <el-col :span="12">
  438. <el-form-item :label="$t('归属部门')" prop="deptId">
  439. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :placeholder="$t('请选择') + $t('归属部门')" />
  440. </el-form-item>
  441. </el-col>
  442. <el-col :span="12">
  443. </el-col>
  444. </el-row>
  445. </el-form>
  446. <div slot="footer" class="dialog-footer">
  447. <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
  448. <el-button @click="cancel">{{ $t('取 消') }}</el-button>
  449. </div>
  450. </el-dialog>
  451. <!-- 用户导入对话框 -->
  452. <el-dialog v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  453. <el-upload
  454. ref="upload"
  455. :limit="1"
  456. accept=".xlsx, .xls"
  457. :headers="upload.headers"
  458. :action="upload.url"
  459. :disabled="upload.isUploading"
  460. :on-progress="handleFileUploadProgress"
  461. :on-success="handleFileSuccess"
  462. :auto-upload="false"
  463. drag
  464. >
  465. <i class="el-icon-upload"></i>
  466. <div class="el-upload__text">
  467. {{ $t('将文件拖到此处,或') }}
  468. <em>{{ $t('点击上传') }}</em>
  469. </div>
  470. <div class="el-upload__tip" slot="tip">
  471. <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  472. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  473. </div>
  474. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  475. <input name="type" :value="upload.type" hidden />
  476. </form>
  477. <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  478. </el-upload>
  479. <div slot="footer" class="dialog-footer">
  480. <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
  481. <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
  482. </div>
  483. </el-dialog>
  484. <!-- 报告附件对话框 -->
  485. <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px" append-to-body>
  486. <el-upload
  487. ref="doc"
  488. :limit="50"
  489. :headers="doc.headers"
  490. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  491. :disabled="doc.isUploading"
  492. :on-progress="handleFileDocProgress"
  493. :on-success="handleFileDocSuccess"
  494. :auto-upload="true"
  495. drag
  496. >
  497. <i class="el-icon-upload"></i>
  498. <div class="el-upload__text">
  499. {{ $t('将文件拖到此处,或') }}
  500. <em>{{ $t('点击上传') }}</em>
  501. </div>
  502. </el-upload>
  503. <el-table :data="doc.commonfileList" border>
  504. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  505. <template slot-scope="scope">
  506. <a class="link-type" @click="handleDownload(scope.row)">
  507. <span>{{ scope.row.fileName }}</span>
  508. </a>
  509. </template>
  510. </el-table-column>
  511. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  512. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  513. <el-table-column :label="$t('操作')" align="center" width="150" class-name="small-padding fixed-width">
  514. <template slot-scope="scope">
  515. <el-button
  516. v-if="scope.row.fileName.endsWith('pdf')"
  517. size="mini"
  518. type="text"
  519. icon="el-icon-view"
  520. @click="handleSee(scope.row)"
  521. >{{ $t('预览') }}</el-button>
  522. <el-button
  523. size="mini"
  524. type="text"
  525. icon="el-icon-download"
  526. @click="handleDownload(scope.row)"
  527. >{{ $t('下载') }}</el-button>
  528. <el-button
  529. size="mini"
  530. type="text"
  531. icon="el-icon-delete"
  532. @click="handleDeleteDoc(scope.row)"
  533. >{{ $t('删除') }}</el-button>
  534. </template>
  535. </el-table-column>
  536. </el-table>
  537. <el-dialog v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" append-to-body>
  538. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  539. <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
  540. <div style="margin-top: -30px">
  541. <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
  542. </div>
  543. </el-dialog>
  544. <div slot="footer" class="dialog-footer">
  545. <!-- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
  546. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  547. </div>
  548. </el-dialog>
  549. </div>
  550. </template>
  551. <script>
  552. import { listEnvironapproval, getEnvironapproval, delEnvironapproval, addEnvironapproval, updateEnvironapproval, exportEnvironapproval } from "@/api/ehs/environapproval";
  553. import { listStaffmgr } from "@/api/plant/staffmgr";
  554. import { treeselect } from "@/api/system/dept";
  555. import { getToken } from "@/utils/auth";
  556. import Treeselect from "@riophae/vue-treeselect";
  557. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  558. import {allFileList, delCommonfile} from "@/api/common/commonfile";
  559. export default {
  560. name: "Environapproval",
  561. components: { Treeselect },
  562. data() {
  563. return {
  564. // 遮罩层
  565. loading: true,
  566. // 选中数组
  567. ids: [],
  568. // 非单个禁用
  569. single: true,
  570. // 非多个禁用
  571. multiple: true,
  572. // 显示搜索条件
  573. showSearch: false,
  574. // 总条数
  575. total: 0,
  576. // 环保批文清单表格数据
  577. environapprovalList: [],
  578. // 弹出层标题
  579. title: "",
  580. // 部门树选项
  581. deptOptions: undefined,
  582. clientHeight:300,
  583. // 是否显示弹出层
  584. open: false,
  585. //日期快速选择
  586. pickerOptions: {
  587. shortcuts: [{
  588. text: this.$t('最近一周'),
  589. onClick(picker) {
  590. const end = new Date();
  591. const start = new Date();
  592. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  593. picker.$emit('pick', [start, end]);
  594. }
  595. }, {
  596. text: this.$t('最近一个月'),
  597. onClick(picker) {
  598. const end = new Date();
  599. const start = new Date();
  600. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  601. picker.$emit('pick', [start, end]);
  602. }
  603. }, {
  604. text: this.$t('最近三个月'),
  605. onClick(picker) {
  606. const end = new Date();
  607. const start = new Date();
  608. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  609. picker.$emit('pick', [start, end]);
  610. }
  611. }]
  612. },
  613. //日期选择器
  614. chooseDate: [],
  615. // 装置字典
  616. plantCodeOptions: [],
  617. // 证书有效期是否永久字典
  618. isPermanentOptions: [],
  619. // 是否需要跟进字典
  620. followOptions: [],
  621. //回顾人字典
  622. reviewerOptions: [],
  623. //证书有效期是否可编辑
  624. canChange: false,
  625. // 用户导入参数
  626. upload: {
  627. //下载模板请求地址
  628. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  629. //下载模板类型
  630. type: "environapproval",
  631. // 是否显示弹出层(用户导入)
  632. open: false,
  633. // 弹出层标题(用户导入)
  634. title: "",
  635. // 是否禁用上传
  636. isUploading: false,
  637. // 是否更新已经存在的用户数据
  638. updateSupport: 0,
  639. // 设置上传的请求头部
  640. headers: { Authorization: "Bearer " + getToken() },
  641. // 上传的地址
  642. url: process.env.VUE_APP_BASE_API + "/ehs/environapproval/importData"
  643. },
  644. // 报告附件参数
  645. doc: {
  646. file: "123",
  647. // 是否显示弹出层(报告附件)
  648. open: false,
  649. // 弹出层标题(报告附件)
  650. title: "",
  651. // 是否禁用上传
  652. isUploading: false,
  653. // 是否更新已经存在的用户数据
  654. updateSupport: 0,
  655. // 报告附件上传位置编号
  656. ids: 0,
  657. // 设置上传的请求头部
  658. headers: { Authorization: "Bearer " + getToken() },
  659. // 上传的地址
  660. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  661. commonfileList: null,
  662. queryParams: {
  663. pId: null,
  664. pType: 'environapproval'
  665. },
  666. pType: 'environapproval',
  667. pId: null
  668. },
  669. pdf : {
  670. title: '',
  671. pdfUrl: '',
  672. numPages: null,
  673. open: false,
  674. pageNum: 1,
  675. pageTotalNum: 1,
  676. loadedRatio: 0,
  677. },
  678. picture: {
  679. file: "",
  680. // 报告附件上传位置编号
  681. ids: 0,
  682. // 设置上传的请求头部
  683. headers: { Authorization: "Bearer " + getToken() },
  684. // 上传的地址
  685. url: process.env.VUE_APP_BASE_API + "/ehs/environapproval/uploadPic",
  686. pType: '',
  687. pId: null
  688. },
  689. //图片url
  690. picWaterUrl: '',
  691. picExhaustUrl: '',
  692. conWaterUrl: '',
  693. conExhaustUrl: '',
  694. // 查询参数
  695. queryParams: {
  696. pageNum: 1,
  697. pageSize: 20,
  698. approvalname: null,
  699. certno: null,
  700. effetiveYear: null
  701. },
  702. //人员表查询参数
  703. staffmgrQueryParams: {},
  704. // 表单参数
  705. form: {},
  706. // 表单校验
  707. rules: {
  708. plantCode: [
  709. { required: true, message: this.$t('装置')+this.$t('不能为空'), trigger: "change" }
  710. ],
  711. approvalname: [
  712. { required: true, message: this.$t('批文名称')+this.$t('不能为空'), trigger: "blur" }
  713. ],
  714. certno: [
  715. { required: true, message: this.$t('证书编号')+this.$t('不能为空'), trigger: "blur" }
  716. ],
  717. effetivedate: [
  718. { required: true, message: this.$t('批准日期') + this.$t('不能为空'), trigger: "blur" }
  719. ],
  720. responsauth: [
  721. { required: true, message: this.$t('审批单位') + this.$t('不能为空'), trigger: "blur" }
  722. ],
  723. isPermanent: [
  724. { required: true, message: this.$t('有效期是否永久') + this.$t('不能为空'), trigger: "blur" }
  725. ],
  726. owner: [
  727. { required: true, message: this.$t('负责人') + this.$t('不能为空'), trigger: "blur" }
  728. ],
  729. scope: [
  730. { required: true, message: this.$t('适用范围') + this.$t('不能为空'), trigger: "blur" }
  731. ],
  732. reviewdate: [
  733. { required: true, message: this.$t('本次回顾日期') + this.$t('不能为空'), trigger: "blur" }
  734. ],
  735. nextreviewdate: [
  736. { required: true, message: this.$t('下次回顾日期') + this.$t('不能为空'), trigger: "blur" }
  737. ],
  738. follow: [
  739. { required: true, message: this.$t('是否需要跟进') + this.$t('不能为空'), trigger: "change" }
  740. ],
  741. reviewer: [
  742. { required: true, message: this.$t('回顾人') + this.$t('不能为空'), trigger: "blur" }
  743. ],
  744. reviewResult: [
  745. { required: true, message: this.$t('回顾结果') + this.$t('不能为空'), trigger: "blur" }
  746. ],
  747. deptId: [
  748. { required: true, message: this.$t('归属部门') + this.$t('不能为空'), trigger: "blur" }
  749. ]
  750. }
  751. };
  752. },
  753. watch: {
  754. // 根据名称筛选部门树
  755. deptName(val) {
  756. this.$refs.tree.filter(val);
  757. }
  758. },
  759. created() {
  760. //设置表格高度对应屏幕高度
  761. this.$nextTick(() => {
  762. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  763. })
  764. this.getList();
  765. this.getReviewer();
  766. this.getTreeselect();
  767. this.getDicts("PLANT_DIVIDE").then(response => {
  768. this.plantCodeOptions = response.data;
  769. });
  770. this.getDicts("YES_NO").then(response => {
  771. this.isPermanentOptions = response.data;
  772. });
  773. this.getDicts("YES_NO").then(response => {
  774. this.followOptions = response.data;
  775. });
  776. },
  777. methods: {
  778. /** 查询环保批文清单列表 */
  779. getList() {
  780. this.loading = true;
  781. listEnvironapproval(this.queryParams).then(response => {
  782. this.environapprovalList = response.rows;
  783. this.environapprovalList.forEach(function (item) {
  784. if (item.reqPic === 'true') {
  785. if (item.reqWater) {
  786. var srcWaterList = [];
  787. srcWaterList.push(process.env.VUE_APP_BASE_API + item.reqWater);
  788. item.srcWaterList = srcWaterList;
  789. item.reqWater = process.env.VUE_APP_BASE_API + item.reqWater;
  790. }
  791. if (item.reqExhaust) {
  792. var srcExhaustList = [];
  793. srcExhaustList.push(process.env.VUE_APP_BASE_API + item.reqExhaust);
  794. item.srcExhaustList = srcExhaustList;
  795. item.reqExhaust = process.env.VUE_APP_BASE_API + item.reqExhaust;
  796. }
  797. if (item.conWater) {
  798. var conWaterList = [];
  799. conWaterList.push(process.env.VUE_APP_BASE_API + item.conWater);
  800. item.conWaterList = conWaterList;
  801. item.conWater = process.env.VUE_APP_BASE_API + item.conWater;
  802. }
  803. if (item.conExhaust) {
  804. var conExhaustList = [];
  805. conExhaustList.push(process.env.VUE_APP_BASE_API + item.conExhaust);
  806. item.conExhaustList = conExhaustList;
  807. item.conExhaust = process.env.VUE_APP_BASE_API + item.conExhaust;
  808. }
  809. }
  810. })
  811. this.total = response.total;
  812. this.loading = false;
  813. });
  814. },
  815. getReviewer() {
  816. listStaffmgr(this.staffmgrQueryParams).then(response => {
  817. this.reviewerOptions = response.rows;
  818. });
  819. },
  820. /** 查询部门下拉树结构 */
  821. getTreeselect() {
  822. treeselect().then(response => {
  823. this.deptOptions = response.data;
  824. });
  825. },
  826. // 装置字典翻译
  827. plantCodeFormat(row, column) {
  828. return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
  829. },
  830. // 证书有效期是否永久字典翻译
  831. isPermanentFormat(row, column) {
  832. return this.selectDictLabel(this.isPermanentOptions, row.isPermanent);
  833. },
  834. // 是否需要跟进字典翻译
  835. followFormat(row, column) {
  836. return this.selectDictLabel(this.followOptions, row.follow);
  837. },
  838. // 取消按钮
  839. cancel() {
  840. this.open = false;
  841. this.reset();
  842. },
  843. // 表单重置
  844. reset() {
  845. this.picWaterUrl = '';
  846. this.picExhaustUrl = '';
  847. this.conWaterUrl = '';
  848. this.conExhaustUrl = '';
  849. this.form = {
  850. id: null,
  851. plantCode: null,
  852. approvalname: null,
  853. certno: null,
  854. effetivedate: null,
  855. validityBefore: null,
  856. relatedlaw: null,
  857. responsauth: null,
  858. owner: null,
  859. reviewdate: null,
  860. nextreviewdate: null,
  861. conttype: null,
  862. delFlag: null,
  863. createrCode: null,
  864. createdate: null,
  865. updaterCode: null,
  866. updatedate: null,
  867. deptId: null,
  868. remarks: null,
  869. isPermanent: null,
  870. scope: null,
  871. follow: null,
  872. allowance: null,
  873. requirements: null,
  874. reviewer: null,
  875. reviewResult: null,
  876. validityAfter: null,
  877. content: null,
  878. reqPic: null,
  879. reqWater: null,
  880. reqExhaust: null,
  881. conPic: null,
  882. conWater: null,
  883. conExhaust: null
  884. };
  885. this.chooseDate = []
  886. this.resetForm("form");
  887. },
  888. /** 搜索按钮操作 */
  889. handleQuery() {
  890. this.queryParams.pageNum = 1;
  891. this.getList();
  892. },
  893. /** 重置按钮操作 */
  894. resetQuery() {
  895. this.resetForm("queryForm");
  896. this.handleQuery();
  897. },
  898. // 多选框选中数据
  899. handleSelectionChange(selection) {
  900. this.ids = selection.map(item => item.id)
  901. this.single = selection.length!==1
  902. this.multiple = !selection.length
  903. },
  904. //证书有效期是否永久
  905. permanentChange(val) {
  906. if (val == 1) {
  907. this.canChange = true
  908. this.chooseDate = []
  909. }else if (val == 0){
  910. this.canChange = false
  911. }
  912. },
  913. /** 新增按钮操作 */
  914. handleAdd() {
  915. this.reset();
  916. this.open = true;
  917. this.form.reqPic = false;
  918. this.form.conPic = false;
  919. this.title = this.$t('新增') + " " + this.$t('环保批文清单');
  920. },
  921. /** 修改按钮操作 */
  922. handleUpdate(row) {
  923. if (row.isPermanent == 1) {
  924. this.canChange = true
  925. }else if (row.isPermanent == 0){
  926. this.canChange = false
  927. }
  928. this.reset();
  929. const id = row.id || this.ids
  930. getEnvironapproval(id).then(response => {
  931. this.form = response.data;
  932. if (this.form.isPermanent == 1) {
  933. this.canChange = true
  934. this.chooseDate = []
  935. }else if (this.form.isPermanent == 0){
  936. this.canChange = false
  937. this.chooseDate = this.$set(this.form,'chooseDate',[""+response.data.validityBefore+"",""+response.data.validityAfter+""]);
  938. }
  939. if (this.form.reqPic === 'true') {
  940. this.form.reqPic = true
  941. }else {
  942. this.form.reqPic = false
  943. }
  944. if (this.form.conPic === 'true') {
  945. this.form.conPic = true
  946. }else {
  947. this.form.conPic = false
  948. }
  949. if(response.data.reqWater) {
  950. this.picWaterUrl = process.env.VUE_APP_BASE_API + response.data.reqWater;
  951. }
  952. if(response.data.reqExhaust) {
  953. this.picExhaustUrl = process.env.VUE_APP_BASE_API + response.data.reqExhaust;
  954. }
  955. if(response.data.conWater) {
  956. this.conWaterUrl = process.env.VUE_APP_BASE_API + response.data.conWater;
  957. }
  958. if(response.data.conExhaust) {
  959. this.conExhaustUrl = process.env.VUE_APP_BASE_API + response.data.conExhaust;
  960. }
  961. this.picture.pId = row.id;
  962. this.open = true;
  963. this.title = this.$t('修改') + this.$t('环保批文清单');
  964. });
  965. },
  966. /** 主要内容操作 */
  967. handleEditTable(row) {
  968. const tableId = row.id || this.ids[0];
  969. this.$router.push("/environapproval/edit/" + tableId);
  970. },
  971. /** 提交按钮 */
  972. submitForm() {
  973. this.$refs["form"].validate(valid => {
  974. if (valid) {
  975. if (this.form.isPermanent === 0) {
  976. this.form.validityBefore = this.chooseDate[0];
  977. this.form.validityAfter = this.chooseDate[1];
  978. }
  979. if (this.form.id != null) {
  980. updateEnvironapproval(this.form).then(response => {
  981. this.msgSuccess(this.$t('修改成功'));
  982. this.open = false;
  983. this.getList();
  984. });
  985. } else {
  986. addEnvironapproval(this.form).then(response => {
  987. this.msgSuccess(this.$t('新增成功'));
  988. this.open = false;
  989. this.getList();
  990. });
  991. }
  992. }
  993. });
  994. },
  995. /** 删除按钮操作 */
  996. handleDelete(row) {
  997. const ids = row.id || this.ids;
  998. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  999. confirmButtonText: this.$t('确定'),
  1000. cancelButtonText: this.$t('取消'),
  1001. type: "warning"
  1002. }).then(function() {
  1003. return delEnvironapproval(ids);
  1004. }).then(() => {
  1005. this.getList();
  1006. this.msgSuccess(this.$t('删除成功'));
  1007. })
  1008. },
  1009. /** 导出按钮操作 */
  1010. handleExport() {
  1011. const queryParams = this.queryParams;
  1012. this.$confirm(this.$t('是否确认导出所有环保批文清单数据项?'), this.$t('警告'), {
  1013. confirmButtonText: this.$t('确定'),
  1014. cancelButtonText: this.$t('取消'),
  1015. type: "warning"
  1016. }).then(function() {
  1017. return exportEnvironapproval(queryParams);
  1018. }).then(response => {
  1019. this.download(response.msg);
  1020. })
  1021. },
  1022. /** 导入按钮操作 */
  1023. handleImport() {
  1024. this.upload.title = this.$t('用户导入');
  1025. this.upload.open = true;
  1026. },
  1027. /** 下载模板操作 */
  1028. importTemplate() {
  1029. this.$refs['downloadFileForm'].submit()
  1030. },
  1031. // 文件上传中处理
  1032. handleFileUploadProgress(event, file, fileList) {
  1033. this.upload.isUploading = true;
  1034. },
  1035. // 文件上传成功处理
  1036. handleFileSuccess(response, file, fileList) {
  1037. this.upload.open = false;
  1038. this.upload.isUploading = false;
  1039. this.$refs.upload.clearFiles();
  1040. if (response.data[0] != null) {
  1041. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1042. }else {
  1043. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1044. }
  1045. this.getList();
  1046. },
  1047. // 提交上传文件
  1048. submitFileForm() {
  1049. this.$refs.upload.submit();
  1050. },
  1051. /** 报告附件按钮操作 */
  1052. handleDoc(row) {
  1053. this.doc.id = row.id;
  1054. this.doc.title = row.filename;
  1055. this.doc.open = true;
  1056. this.doc.queryParams.pId = row.id
  1057. this.doc.pId = row.id
  1058. this.getFileList()
  1059. this.$nextTick(() => {
  1060. this.$refs.doc.clearFiles()
  1061. })
  1062. },
  1063. //上传图片改变选项
  1064. changereqPic() {
  1065. this.form.requirements = null;
  1066. },
  1067. getFileList (){
  1068. allFileList(this.doc.queryParams).then(response => {
  1069. this.doc.commonfileList = response;
  1070. });
  1071. },
  1072. //附件上传中处理
  1073. handleFileDocProgress(event, file, fileList) {
  1074. this.doc.file = file;
  1075. this.doc.isUploading = true;
  1076. },
  1077. //附件上传成功处理
  1078. handleFileDocSuccess(response, file, fileList) {
  1079. this.doc.isUploading = false;
  1080. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1081. this.getFileList()
  1082. },
  1083. /** 删除按钮操作 */
  1084. handleDeleteDoc(row) {
  1085. const ids = row.id || this.ids;
  1086. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1087. confirmButtonText: this.$t('确定'),
  1088. cancelButtonText: this.$t('取消'),
  1089. type: "warning"
  1090. }).then(function() {
  1091. return delCommonfile(ids);
  1092. }).then(() => {
  1093. this.getFileList()
  1094. this.msgSuccess(this.$t('删除成功'));
  1095. })
  1096. },
  1097. // 文件下载处理
  1098. handleDownload(row) {
  1099. var name = row.fileName;
  1100. var url = row.fileUrl;
  1101. var suffix = url.substring(url.lastIndexOf("."), url.length);
  1102. const a = document.createElement('a')
  1103. a.setAttribute('download', name)
  1104. a.setAttribute('target', '_blank')
  1105. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  1106. a.click()
  1107. },
  1108. //pdf预览
  1109. openPdf(){
  1110. window.open(this.pdf.pdfUrl);//path是文件的全路径地址
  1111. },
  1112. handleSee (row){
  1113. this.pdf.open =true
  1114. this.pdf.title = row.fileName
  1115. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  1116. },
  1117. handleWaterAvatarSuccess (res, file, fileList) {
  1118. this.picWaterUrl = URL.createObjectURL(file.raw);
  1119. this.$alert(res.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1120. },
  1121. handleExhaustAvatarSuccess (res, file, fileList) {
  1122. this.picExhaustUrl = URL.createObjectURL(file.raw);
  1123. this.$alert(res.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1124. },
  1125. handleWaterConSuccess (res, file, fileList) {
  1126. this.conWaterUrl = URL.createObjectURL(file.raw);
  1127. this.$alert(res.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1128. },
  1129. handleExhaustConSuccess (res, file, fileList) {
  1130. this.conExhaustUrl = URL.createObjectURL(file.raw);
  1131. this.$alert(res.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1132. },
  1133. }
  1134. };
  1135. </script>
  1136. <style>
  1137. .el-table .cell {
  1138. white-space: pre-line;
  1139. }
  1140. .avatar {
  1141. width: 120px;
  1142. height: 140px;
  1143. }
  1144. </style>