index.vue 41 KB

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