index.vue 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715
  1. <template>
  2. <div class="app-container-list">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item :label="$t('泄露位置')" label-width="50" prop="leakLocation">
  5. <el-input
  6. v-model="queryParams.leakLocation"
  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="title">
  14. <el-input
  15. v-model="queryParams.title"
  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="remarks">
  23. <el-input
  24. v-model="queryParams.remarks"
  25. :placeholder="$t('请输入') + $t('备注')"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item>
  32. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
  33. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
  34. </el-form-item>
  35. </el-form>
  36. <el-row :gutter="10" class="mb8">
  37. <el-col :span="1.5">
  38. <el-button
  39. type="primary"
  40. icon="el-icon-plus"
  41. size="mini"
  42. @click="handleAdd"
  43. v-hasPermi="['process:moc:add']"
  44. >{{ $t('新增') }}</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="single"
  52. @click="handleUpdate"
  53. v-hasPermi="['process:moc:edit']"
  54. >{{ $t('修改') }}</el-button>
  55. </el-col>
  56. <el-col :span="1.5">
  57. <el-button
  58. type="danger"
  59. icon="el-icon-delete"
  60. size="mini"
  61. :disabled="multiple"
  62. @click="handleDelete"
  63. v-hasPermi="['process:moc:remove']"
  64. >{{ $t('删除') }}</el-button>
  65. </el-col>
  66. <!--<el-col :span="1.5">-->
  67. <!--<el-button-->
  68. <!--type="info"-->
  69. <!--icon="el-icon-upload2"-->
  70. <!--size="mini"-->
  71. <!--@click="handleImport"-->
  72. <!--v-hasPermi="['process:moc:edit']"-->
  73. <!--&gt;{{ $t('导入') }}</el-button>-->
  74. <!--</el-col>-->
  75. <!--<el-col :span="1.5">-->
  76. <!--<el-button-->
  77. <!--type="warning"-->
  78. <!--icon="el-icon-download"-->
  79. <!--size="mini"-->
  80. <!--@click="handleExport"-->
  81. <!--v-hasPermi="['process:moc:export']"-->
  82. <!--&gt;{{ $t('导出') }}</el-button>-->
  83. <!--</el-col>-->
  84. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  85. </el-row>
  86. <el-row class="colorMark">
  87. <svg-icon icon-class="rectangleLightgreen" class="rectangleLightgreen" style="fill:#000000;"></svg-icon>{{ $t('已移除') }}
  88. <svg-icon icon-class="rectangleFlesh" class="rectangleFlesh"></svg-icon>{{ $t('7天内到期') }}
  89. <svg-icon icon-class="rectangleYellow" class="rectangleYellow"></svg-icon>{{ $t('7-14天内到期') }}
  90. </el-row>
  91. <el-table
  92. v-loading="loading"
  93. :data="mocList"
  94. @selection-change="handleSelectionChange"
  95. :cell-style="tableCellStyle"
  96. :cell-class-name="tableCellClassName"
  97. :height="clientHeight"
  98. border
  99. :default-sort = "{prop: 'mocNo', order: 'descending'}">
  100. <el-table-column type="selection" width="55" align="center" />
  101. <el-table-column :label="$t('MOC编号')" align="center" width="120" prop="mocNo" :show-overflow-tooltip="true" sortable/>
  102. <el-table-column :label="$t('公司MOC编号')" align="center" width="120" prop="companyMocNo" :show-overflow-tooltip="true"/>
  103. <el-table-column :label="$t('工艺单元')" align="center" width="120" prop="processUnit" :show-overflow-tooltip="true"/>
  104. <el-table-column :label="$t('部门')" align="center" prop="department">
  105. <template slot="header">
  106. <span
  107. @click="departmentChart.open = true"
  108. id="department">
  109. 部门
  110. <i class="el-icon-s-data"></i>
  111. </span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column :label="$t('泄露位置')" align="center" prop="leakLocation">
  115. <template slot="header">
  116. <span
  117. @click="leakLocationChart.open = true"
  118. id="leakLocation">
  119. 泄露位置
  120. <i class="el-icon-s-data"></i>
  121. </span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column :label="$t('标题')" align="center" width="320" prop="title" :show-overflow-tooltip="true"/>
  125. <el-table-column :label="$t('操作压力 (MPaG)')" align="center" width="150" prop="pressure" :show-overflow-tooltip="true"/>
  126. <el-table-column :label="$t('操作温度 (℃)')" align="center" width="120" prop="temperature" :show-overflow-tooltip="true"/>
  127. <el-table-column :label="$t('泄露介质')" align="center" width="100" prop="leakFluid" :show-overflow-tooltip="true"/>
  128. <el-table-column :label="$t('介质类型')" align="center" prop="materialType">
  129. <template slot="header">
  130. <span
  131. @click="materialTypeChart.open = true"
  132. id="materialType">
  133. 介质类型
  134. <i class="el-icon-s-data"></i>
  135. </span>
  136. </template>
  137. </el-table-column>
  138. <el-table-column :label="$t('方案日期')" align="center" prop="planDate" width="100">
  139. <template slot-scope="scope">
  140. <span>{{ parseTime(scope.row.planDate, '{y}-{m}-{d}') }}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column :label="$t('堵漏日期')" align="center" prop="sealDate">
  144. <template slot="header">
  145. <span
  146. @click="sealDateChart.open = true"
  147. id="sealDate">
  148. 堵漏日期
  149. <i class="el-icon-s-data"></i>
  150. </span>
  151. </template>
  152. <template slot-scope="scope">
  153. <span>{{ parseTime(scope.row.sealDate, '{y}-{m}-{d}') }}</span>
  154. </template>
  155. </el-table-column>
  156. <el-table-column :label="$t('第一次延期')" align="center" prop="extention1" width="100">
  157. <template slot-scope="scope">
  158. <span v-if="scope.row.extention1 == null && scope.row.status == 0">N.A.</span>
  159. <span>{{ parseTime(scope.row.extention1, '{y}-{m}-{d}') }}</span>
  160. </template>
  161. </el-table-column>
  162. <el-table-column :label="$t('第二次延期')" align="center" prop="extention2" width="100">
  163. <template slot-scope="scope">
  164. <span v-if="scope.row.extention2 == null && scope.row.status == 0">N.A.</span>
  165. <span>{{ parseTime(scope.row.extention2, '{y}-{m}-{d}') }}</span>
  166. </template>
  167. </el-table-column>
  168. <el-table-column :label="$t('第三次延期')" align="center" prop="extention3" width="100">
  169. <template slot-scope="scope">
  170. <span v-if="scope.row.extention3 == null && scope.row.status == 0">N.A.</span>
  171. <span>{{ parseTime(scope.row.extention3, '{y}-{m}-{d}') }}</span>
  172. </template>
  173. </el-table-column>
  174. <el-table-column :label="$t('第四次延期')" align="center" prop="extention4" width="100">
  175. <template slot-scope="scope">
  176. <span v-if="scope.row.extention4 == null && scope.row.status == 0">N.A.</span>
  177. <span>{{ parseTime(scope.row.extention4, '{y}-{m}-{d}') }}</span>
  178. </template>
  179. </el-table-column>
  180. <el-table-column :label="$t('第五次延期')" align="center" prop="extention5" width="100">
  181. <template slot-scope="scope">
  182. <span v-if="scope.row.extention5 == null && scope.row.status == 0">N.A.</span>
  183. <span>{{ parseTime(scope.row.extention5, '{y}-{m}-{d}') }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column :label="$t('第六次延期')" align="center" prop="extention6" width="100">
  187. <template slot-scope="scope">
  188. <span v-if="scope.row.extention6 == null && scope.row.status == 0">N.A.</span>
  189. <span>{{ parseTime(scope.row.extention6, '{y}-{m}-{d}') }}</span>
  190. </template>
  191. </el-table-column>
  192. <el-table-column :label="$t('第七次延期')" align="center" prop="extention7" width="100">
  193. <template slot-scope="scope">
  194. <span v-if="scope.row.extention7 == null && scope.row.status == 0">N.A.</span>
  195. <span>{{ parseTime(scope.row.extention7, '{y}-{m}-{d}') }}</span>
  196. </template>
  197. </el-table-column>
  198. <el-table-column :label="$t('第八次延期')" align="center" prop="extention8" width="100">
  199. <template slot-scope="scope">
  200. <span v-if="scope.row.extention8 == null && scope.row.status == 0">N.A.</span>
  201. <span>{{ parseTime(scope.row.extention8, '{y}-{m}-{d}') }}</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column :label="$t('第九次延期')" align="center" prop="extention9" width="100">
  205. <template slot-scope="scope">
  206. <span v-if="scope.row.extention9 == null && scope.row.status == 0">N.A.</span>
  207. <span>{{ parseTime(scope.row.extention9, '{y}-{m}-{d}') }}</span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column :label="$t('到期时间')" align="center" prop="extention9" width="100">
  211. <template slot-scope="scope">
  212. <span>{{ parseTime(scope.row.expTime, '{y}-{m}-{d}') }}</span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column :label="$t('卡具状态')" align="center" prop="status" :formatter="mocStatusFormat">
  216. <template slot="header">
  217. <span
  218. @click="statusChart.open = true"
  219. id="status">
  220. 卡具状态
  221. <i class="el-icon-s-data"></i>
  222. </span>
  223. </template>
  224. </el-table-column>
  225. <el-table-column :label="$t('移除时间')" align="center" prop="removeTime" :show-overflow-tooltip="true" width="100"/>
  226. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true" width="130" />
  227. <el-table-column :label="$t('操作')" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
  228. <template slot-scope="scope">
  229. <el-button
  230. size="mini"
  231. type="text"
  232. icon="el-icon-s-release"
  233. @click="handleDelay(scope.row, 1)"
  234. v-hasPermi="['process:moc:edit']"
  235. v-if="scope.row.extention9 == null && scope.row.status == 1"
  236. >{{ $t('自动延期') }}</el-button>
  237. <el-button
  238. size="mini"
  239. type="text"
  240. icon="el-icon-s-release"
  241. @click="handleDelay(scope.row, 2)"
  242. v-hasPermi="['process:moc:edit']"
  243. v-if="scope.row.extention9 == null && scope.row.status == 1"
  244. >{{ $t('手动延期') }}</el-button>
  245. <el-button
  246. size="mini"
  247. type="text"
  248. icon="el-icon-circle-close"
  249. @click="handleRemove(scope.row)"
  250. v-hasPermi="['process:moc:edit']"
  251. v-if="scope.row.status == 1"
  252. >{{ $t('移除') }}</el-button>
  253. <el-button
  254. size="mini"
  255. type="text"
  256. icon="el-icon-edit"
  257. @click="handleUpdate(scope.row)"
  258. v-hasPermi="['process:moc:edit']"
  259. >{{ $t('修改') }}</el-button>
  260. <el-button
  261. size="mini"
  262. type="text"
  263. icon="el-icon-delete"
  264. @click="handleDelete(scope.row)"
  265. v-hasPermi="['process:moc:remove']"
  266. >{{ $t('删除') }}</el-button>
  267. </template>
  268. </el-table-column>
  269. </el-table>
  270. <pagination
  271. v-show="total>0"
  272. :total="total"
  273. :page.sync="queryParams.pageNum"
  274. :limit.sync="queryParams.pageSize"
  275. @pagination="getList"
  276. />
  277. <!-- 延期对话框 -->
  278. <el-dialog v-dialogDrag :title="delayDialog.title" :visible.sync="delayDialog.open" width="500px" append-to-body>
  279. <el-form ref="form" :model="delayForm" :rules="delayRules" label-width="80px">
  280. <el-form-item :label="$t('延期时间')" prop="extention">
  281. <el-date-picker clearable size="small" style="width: 200px"
  282. v-model="delayForm.extention"
  283. type="date"
  284. value-format="yyyy-MM-dd"
  285. :placeholder="$t('请选择') + $t('延期时间')">
  286. </el-date-picker>
  287. </el-form-item>
  288. </el-form>
  289. <div slot="footer" class="dialog-footer">
  290. <el-button type="primary" @click="submitDelayForm">{{ $t('确 定') }}</el-button>
  291. <el-button @click="cancelDelay">{{ $t('取 消') }}</el-button>
  292. </div>
  293. </el-dialog>
  294. <!-- 添加或修改MOC管理对话框 -->
  295. <el-dialog v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
  296. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  297. <!--<el-form-item :label="$t('装置名称')" prop="plantCode">-->
  298. <!--<el-select v-model="form.plantCode" :placeholder="$t('请选择') + $t('装置名称')">-->
  299. <!--<el-option-->
  300. <!--v-for="dict in plantCodeOptions"-->
  301. <!--:key="dict.dictValue"-->
  302. <!--:label="dict.dictLabel"-->
  303. <!--:value="dict.dictValue"-->
  304. <!--&gt;</el-option>-->
  305. <!--</el-select>-->
  306. <!--</el-form-item>-->
  307. <el-form-item :label="$t('MOC编号')" prop="mocNo">
  308. <el-input v-model="form.mocNo" :placeholder="$t('请输入') + $t('MOC编号')" />
  309. </el-form-item>
  310. <el-form-item :label="$t('公司MOC编号')" prop="companyMocNo">
  311. <el-input v-model="form.companyMocNo" :placeholder="$t('请输入') + $t('公司MOC编号')" />
  312. </el-form-item>
  313. <el-form-item :label="$t('工艺单元')" prop="processUnit">
  314. <el-input v-model="form.processUnit" :placeholder="$t('请输入') + $t('工艺单元')" />
  315. </el-form-item>
  316. <el-form-item :label="$t('部门')" prop="department">
  317. <el-input v-model="form.department" :placeholder="$t('请输入') + $t('部门')" />
  318. </el-form-item>
  319. <el-form-item :label="$t('泄露位置')" prop="leakLocation">
  320. <el-input v-model="form.leakLocation" :placeholder="$t('请输入') + $t('泄露位置')" />
  321. </el-form-item>
  322. <!--<el-form-item :label="$t('项目号')" prop="projectNo">-->
  323. <!--<el-input v-model="form.projectNo" :placeholder="$t('请输入') + $t('项目号')" />-->
  324. <!--</el-form-item>-->
  325. <!--<el-form-item :label="$t('区域')" prop="area">-->
  326. <!--<el-select v-model="form.area" :placeholder="$t('请选择') + $t('区域')">-->
  327. <!--<el-option-->
  328. <!--v-for="dict in areaOptions"-->
  329. <!--:key="dict.dictValue"-->
  330. <!--:label="dict.dictLabel"-->
  331. <!--:value="dict.dictValue"-->
  332. <!--&gt;</el-option>-->
  333. <!--</el-select>-->
  334. <!--</el-form-item>-->
  335. <el-form-item :label="$t('标题')" prop="title">
  336. <el-input v-model="form.title" :placeholder="$t('请输入') + $t('标题')" />
  337. </el-form-item>
  338. <el-form-item :label="$t('操作压力 (MPaG)')" prop="pressure">
  339. <el-input v-model="form.pressure" :placeholder="$t('请输入') + $t('操作压力')" />
  340. </el-form-item>
  341. <el-form-item :label="$t('操作温度 (℃)')" prop="temperature">
  342. <el-input v-model="form.temperature" :placeholder="$t('请输入') + $t('操作温度')" />
  343. </el-form-item>
  344. <el-form-item :label="$t('泄露介质')" prop="leakFluid">
  345. <el-input v-model="form.leakFluid" :placeholder="$t('请输入') + $t('泄露介质')" />
  346. </el-form-item>
  347. <el-form-item :label="$t('介质类型')" prop="materialType">
  348. <el-input v-model="form.materialType" :placeholder="$t('请输入') + $t('介质类型')" />
  349. </el-form-item>
  350. <el-form-item :label="$t('方案日期')" prop="planDate">
  351. <el-date-picker clearable size="small" style="width: 200px"
  352. v-model="form.planDate"
  353. type="date"
  354. value-format="yyyy-MM-dd"
  355. :placeholder="$t('请选择') + $t('方案日期')">
  356. </el-date-picker>
  357. </el-form-item>
  358. <el-form-item :label="$t('堵漏日期')" prop="sealDate">
  359. <el-date-picker clearable size="small" style="width: 200px"
  360. v-model="form.sealDate"
  361. type="date"
  362. value-format="yyyy-MM-dd"
  363. :placeholder="$t('请选择') + $t('堵漏日期')">
  364. </el-date-picker>
  365. </el-form-item>
  366. <el-form-item :label="$t('第一次延期')" prop="extention1">
  367. <el-date-picker clearable size="small" style="width: 200px"
  368. v-model="form.extention1"
  369. type="date"
  370. value-format="yyyy-MM-dd"
  371. :placeholder="$t('请选择') + $t('第一次延期')">
  372. </el-date-picker>
  373. </el-form-item>
  374. <el-form-item :label="$t('第二次延期')" prop="extention2">
  375. <el-date-picker clearable size="small" style="width: 200px"
  376. v-model="form.extention2"
  377. type="date"
  378. value-format="yyyy-MM-dd"
  379. :placeholder="$t('请选择') + $t('第二次延期')">
  380. </el-date-picker>
  381. </el-form-item>
  382. <el-form-item :label="$t('第三次延期')" prop="extention3">
  383. <el-date-picker clearable size="small" style="width: 200px"
  384. v-model="form.extention3"
  385. type="date"
  386. value-format="yyyy-MM-dd"
  387. :placeholder="$t('请选择') + $t('第三次延期')">
  388. </el-date-picker>
  389. </el-form-item>
  390. <el-form-item :label="$t('第四次延期')" prop="extention4">
  391. <el-date-picker clearable size="small" style="width: 200px"
  392. v-model="form.extention4"
  393. type="date"
  394. value-format="yyyy-MM-dd"
  395. :placeholder="$t('请选择') + $t('第四次延期')">
  396. </el-date-picker>
  397. </el-form-item>
  398. <el-form-item :label="$t('第五次延期')" prop="extention5">
  399. <el-date-picker clearable size="small" style="width: 200px"
  400. v-model="form.extention5"
  401. type="date"
  402. value-format="yyyy-MM-dd"
  403. :placeholder="$t('请选择') + $t('第五次延期')">
  404. </el-date-picker>
  405. </el-form-item>
  406. <el-form-item :label="$t('第六次延期')" prop="extention6">
  407. <el-date-picker clearable size="small" style="width: 200px"
  408. v-model="form.extention6"
  409. type="date"
  410. value-format="yyyy-MM-dd"
  411. :placeholder="$t('请选择') + $t('第六次延期')">
  412. </el-date-picker>
  413. </el-form-item>
  414. <el-form-item :label="$t('第七次延期')" prop="extention7">
  415. <el-date-picker clearable size="small" style="width: 200px"
  416. v-model="form.extention7"
  417. type="date"
  418. value-format="yyyy-MM-dd"
  419. :placeholder="$t('请选择') + $t('第七次延期')">
  420. </el-date-picker>
  421. </el-form-item>
  422. <el-form-item :label="$t('第八次延期')" prop="extention8">
  423. <el-date-picker clearable size="small" style="width: 200px"
  424. v-model="form.extention8"
  425. type="date"
  426. value-format="yyyy-MM-dd"
  427. :placeholder="$t('请选择') + $t('第八次延期')">
  428. </el-date-picker>
  429. </el-form-item>
  430. <el-form-item :label="$t('第九次延期')" prop="extention9">
  431. <el-date-picker clearable size="small" style="width: 200px"
  432. v-model="form.extention9"
  433. type="date"
  434. value-format="yyyy-MM-dd"
  435. :placeholder="$t('请选择') + $t('第九次延期')">
  436. </el-date-picker>
  437. </el-form-item>
  438. <el-form-item :label="$t('卡具状态')" prop="area">
  439. <el-select v-model="form.status" :placeholder="$t('请选择') + $t('卡具状态')">
  440. <el-option
  441. v-for="dict in mocStatusOptions"
  442. :key="dict.dictValue"
  443. :label="dict.dictLabel"
  444. :value="dict.dictValue"
  445. ></el-option>
  446. </el-select>
  447. </el-form-item>
  448. <el-form-item :label="$t('到期时间')" prop="extention9">
  449. <el-date-picker clearable size="small" style="width: 200px"
  450. v-model="form.expTime"
  451. type="date"
  452. value-format="yyyy-MM-dd"
  453. :placeholder="$t('请选择') + $t('到期时间')">
  454. </el-date-picker>
  455. </el-form-item>
  456. <!--<el-form-item :label="$t('MOC类型')" prop="mocType">-->
  457. <!--<el-select v-model="form.mocType" :placeholder="$t('请选择') + $t('MOC类型')">-->
  458. <!--<el-option-->
  459. <!--v-for="dict in mocTypeOptions"-->
  460. <!--:key="dict.dictValue"-->
  461. <!--:label="dict.dictLabel"-->
  462. <!--:value="dict.dictValue"-->
  463. <!--&gt;</el-option>-->
  464. <!--</el-select>-->
  465. <!--</el-form-item>-->
  466. <!--<el-form-item :label="$t('负责人')" prop="owner">-->
  467. <!--<el-input v-model="form.owner" :placeholder="$t('请输入') + $t('负责人')" />-->
  468. <!--</el-form-item>-->
  469. <!--<el-form-item :label="$t('申请时间')" prop="approveTime">-->
  470. <!--<el-date-picker clearable size="small" style="width: 200px"-->
  471. <!--v-model="form.approveTime"-->
  472. <!--type="date"-->
  473. <!--value-format="yyyy-MM-dd"-->
  474. <!--:placeholder="$t('请选择') + $t('申请时间')">-->
  475. <!--</el-date-picker>-->
  476. <!--</el-form-item>-->
  477. <!--<el-form-item :label="$t('MC时间')" prop="mcTime">-->
  478. <!--<el-date-picker clearable size="small" style="width: 200px"-->
  479. <!--v-model="form.mcTime"-->
  480. <!--type="date"-->
  481. <!--value-format="yyyy-MM-dd"-->
  482. <!--:placeholder="$t('请选择') + $t('MC时间')">-->
  483. <!--</el-date-picker>-->
  484. <!--</el-form-item>-->
  485. <!--<el-form-item :label="$t('MC情况')" prop="mcDetail">-->
  486. <!--<el-select v-model="form.mcDetail" :placeholder="$t('请选择') + $t('MC情况')">-->
  487. <!--<el-option-->
  488. <!--v-for="dict in mcDetailOptions"-->
  489. <!--:key="dict.dictValue"-->
  490. <!--:label="dict.dictLabel"-->
  491. <!--:value="dict.dictValue"-->
  492. <!--&gt;</el-option>-->
  493. <!--</el-select>-->
  494. <!--</el-form-item>-->
  495. <!--<el-form-item :label="$t('完成时间')" prop="endtime">-->
  496. <!--<el-date-picker clearable size="small" style="width: 200px"-->
  497. <!--v-model="form.endtime"-->
  498. <!--type="date"-->
  499. <!--value-format="yyyy-MM-dd"-->
  500. <!--:placeholder="$t('请选择') + $t('完成时间')">-->
  501. <!--</el-date-picker>-->
  502. <!--</el-form-item>-->
  503. <!--<el-form-item :label="$t('实施情况')" prop="trueState">-->
  504. <!--<el-select v-model="form.trueState" :placeholder="$t('请选择') + $t('实施情况')" @change="changeTrueState($event)">-->
  505. <!--<el-option-->
  506. <!--v-for="dict in trueStateOptions"-->
  507. <!--:key="dict.dictValue"-->
  508. <!--:label="dict.dictLabel"-->
  509. <!--:value="dict.dictValue"-->
  510. <!--&gt;</el-option>-->
  511. <!--</el-select>-->
  512. <!--</el-form-item>-->
  513. <!--<el-form-item :label="$t('变更性质')" prop="changeNature">-->
  514. <!--<el-select v-model="form.changeNature" :placeholder="$t('请选择') + $t('变更性质')" @change="changeChangeNature($event)">-->
  515. <!--<el-option-->
  516. <!--v-for="dict in changeNatureOptions"-->
  517. <!--:key="dict.dictValue"-->
  518. <!--:label="dict.dictLabel"-->
  519. <!--:value="dict.dictValue"-->
  520. <!--&gt;</el-option>-->
  521. <!--</el-select>-->
  522. <!--</el-form-item>-->
  523. <!--<el-form-item :label="$t('到期时间')" prop="overTime">-->
  524. <!--<el-date-picker clearable size="small" style="width: 200px"-->
  525. <!--v-model="form.overTime"-->
  526. <!--type="date"-->
  527. <!--value-format="yyyy-MM-dd"-->
  528. <!--:placeholder="$t('请选择') + $t('到期时间')">-->
  529. <!--</el-date-picker>-->
  530. <!--</el-form-item>-->
  531. <!--<el-form-item :label="$t('临时MOC状态')" prop="temporaryState">-->
  532. <!--<el-select v-model="form.temporaryState" :placeholder="$t('请选择') + $t('临时MOC状态')">-->
  533. <!--<el-option-->
  534. <!--v-for="dict in temporaryStateOptions"-->
  535. <!--:key="dict.dictValue"-->
  536. <!--:label="dict.dictLabel"-->
  537. <!--:value="dict.dictValue"-->
  538. <!--&gt;</el-option>-->
  539. <!--</el-select>-->
  540. <!--</el-form-item>-->
  541. <el-form-item :label="$t('备注')" prop="remarks">
  542. <el-input v-model="form.remarks" type="textarea" :placeholder="$t('请输入') + $t('备注')" />
  543. </el-form-item>
  544. <!--<el-form-item :label="$t('风险等级')" prop="riskLevel">-->
  545. <!--<el-select v-model="form.riskLevel" :placeholder="$t('请选择') + $t('风险等级')">-->
  546. <!--<el-option-->
  547. <!--v-for="dict in riskLevelOptions"-->
  548. <!--:key="dict.dictValue"-->
  549. <!--:label="dict.dictLabel"-->
  550. <!--:value="dict.dictValue"-->
  551. <!--&gt;</el-option>-->
  552. <!--</el-select>-->
  553. <!--</el-form-item>-->
  554. <!--<el-form-item :label="$t('EHS评估/审查')" prop="ehsCheck">-->
  555. <!--<el-date-picker clearable size="small" style="width: 200px"-->
  556. <!--v-model="form.ehsCheck"-->
  557. <!--type="date"-->
  558. <!--value-format="yyyy-MM-dd"-->
  559. <!--:placeholder="$t('请选择') + $t('EHS评估/审查')">-->
  560. <!--</el-date-picker>-->
  561. <!--</el-form-item>-->
  562. <!--<el-form-item :label="$t('培训')" prop="training">-->
  563. <!--<el-date-picker clearable size="small" style="width: 200px"-->
  564. <!--v-model="form.training"-->
  565. <!--type="date"-->
  566. <!--value-format="yyyy-MM-dd"-->
  567. <!--:placeholder="$t('请选择') + $t('培训')"-->
  568. <!--:picker-options="trainingDatePicker">-->
  569. <!--</el-date-picker>-->
  570. <!--</el-form-item>-->
  571. <!--<el-form-item :label="$t('PID更新')" prop="pidMaster">-->
  572. <!--<el-select v-model="form.pidMaster" :placeholder="$t('请选择') + $t('PID更新')">-->
  573. <!--<el-option-->
  574. <!--v-for="dict in pidMasterOptions"-->
  575. <!--:key="dict.dictValue"-->
  576. <!--:label="dict.dictLabel"-->
  577. <!--:value="dict.dictValue"-->
  578. <!--&gt;</el-option>-->
  579. <!--</el-select>-->
  580. <!--</el-form-item>-->
  581. <!--<el-form-item :label="$t('SOP更新')" prop="sopUpdate">-->
  582. <!--<el-select v-model="form.sopUpdate" :placeholder="$t('请选择') + $t('SOP更新')">-->
  583. <!--<el-option-->
  584. <!--v-for="dict in sopUpdateOptions"-->
  585. <!--:key="dict.dictValue"-->
  586. <!--:label="dict.dictLabel"-->
  587. <!--:value="dict.dictValue"-->
  588. <!--&gt;</el-option>-->
  589. <!--</el-select>-->
  590. <!--</el-form-item>-->
  591. <!--<el-form-item :label="$t('文档更新')" prop="docUpdate">-->
  592. <!--<el-select v-model="form.docUpdate" :placeholder="$t('请选择') + $t('文档更新')">-->
  593. <!--<el-option-->
  594. <!--v-for="dict in docUpdateOptions"-->
  595. <!--:key="dict.dictValue"-->
  596. <!--:label="dict.dictLabel"-->
  597. <!--:value="dict.dictValue"-->
  598. <!--&gt;</el-option>-->
  599. <!--</el-select>-->
  600. <!--</el-form-item>-->
  601. <!--<el-form-item label="PSSR" prop="pssr">-->
  602. <!--<el-date-picker clearable size="small" style="width: 200px"-->
  603. <!--v-model="form.pssr"-->
  604. <!--type="date"-->
  605. <!--value-format="yyyy-MM-dd"-->
  606. <!--:placeholder="$t('请选择') + 'PSSR'"-->
  607. <!--:picker-options="pssrDatePicker">-->
  608. <!--</el-date-picker>-->
  609. <!--</el-form-item>-->
  610. <!--<el-form-item :label="$t('PSSR编号')" prop="pssrNo">-->
  611. <!--<el-input v-model="form.pssrNo" :placeholder="$t('请输入') + $t('PSSR编号')" />-->
  612. <!--</el-form-item>-->
  613. <!--<el-form-item :label="$t('装置编号')" prop="plantNumber">
  614. <el-input v-model="form.plantNumber" :placeholder="$t('请输入') + $t('装置编号')" />
  615. </el-form-item>
  616. <el-form-item :label="$t('通知单')" prop="noticeLetter">
  617. <el-input v-model="form.noticeLetter" :placeholder="$t('请输入') + $t('通知单')" />
  618. </el-form-item>
  619. <el-form-item :label="$t('工作单')" prop="workLetter">
  620. <el-input v-model="form.workLetter" :placeholder="$t('请输入') + $t('工作单')" />
  621. </el-form-item>
  622. <el-form-item :label="$t('CTE工作号')" prop="cteNo">
  623. <el-input v-model="form.cteNo" :placeholder="$t('请输入') + $t('CTE工作号')" />
  624. </el-form-item>
  625. <el-form-item :label="$t('投资费用(RMB)')" prop="investCost">
  626. <el-input v-model="form.investCost" :placeholder="$t('请输入') + $t('投资费用(RMB)')" />
  627. </el-form-item>
  628. <el-form-item :label="$t('类别')" prop="category">
  629. <el-select v-model="form.category" :placeholder="$t('请选择') + $t('类别')">
  630. <el-option
  631. v-for="dict in categoryOptions"
  632. :key="dict.dictValue"
  633. :label="dict.dictLabel"
  634. :value="dict.dictValue"
  635. ></el-option>
  636. </el-select>
  637. </el-form-item>
  638. <el-form-item :label="$t('重要性')" prop="significance">
  639. <el-input v-model="form.significance" :placeholder="$t('请输入') + $t('重要性')" />
  640. </el-form-item>
  641. <el-form-item :label="$t('分类')" prop="classification">
  642. <el-input v-model="form.classification" :placeholder="$t('请输入') + $t('分类')" />
  643. </el-form-item>
  644. <el-form-item :label="$t('仪表控制')" prop="dashControl">
  645. <el-input v-model="form.dashControl" :placeholder="$t('请输入') + $t('仪表控制')" />
  646. </el-form-item>
  647. <el-form-item :label="$t('预计完成时间')" prop="estimateEndtime">
  648. <el-date-picker clearable size="small" style="width: 200px"
  649. v-model="form.estimateEndtime"
  650. type="date"
  651. value-format="yyyy-MM-dd"
  652. :placeholder="$t('请选择') + $t('预计完成时间')">
  653. </el-date-picker>
  654. </el-form-item>
  655. <el-form-item :label="$t('EHS审查数据库')" prop="ehsDb">
  656. <el-input v-model="form.ehsDb" :placeholder="$t('请输入') + $t('EHS审查数据库')" />
  657. </el-form-item>
  658. <el-form-item :label="$t('PSSR数据库')" prop="pssrDb">
  659. <el-input v-model="form.pssrDb" :placeholder="$t('请输入') + $t('PSSR数据库')" />
  660. </el-form-item>
  661. <el-form-item :label="$t('CAPEX计划')" prop="capex">
  662. <el-input v-model="form.capex" :placeholder="$t('请输入') + $t('CAPEX计划')" />
  663. </el-form-item>-->
  664. <el-form-item :label="$t('归属部门')" prop="deptId">
  665. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :placeholder="$t('请选择') + $t('归属部门')" />
  666. </el-form-item>
  667. </el-form>
  668. <div slot="footer" class="dialog-footer">
  669. <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
  670. <el-button @click="cancel">{{ $t('取 消') }}</el-button>
  671. </div>
  672. </el-dialog>
  673. <!-- 用户导入对话框 -->
  674. <el-dialog v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  675. <el-upload
  676. ref="upload"
  677. :limit="1"
  678. accept=".xlsx, .xls"
  679. :headers="upload.headers"
  680. :action="upload.url"
  681. :disabled="upload.isUploading"
  682. :on-progress="handleFileUploadProgress"
  683. :on-success="handleFileSuccess"
  684. :auto-upload="false"
  685. drag
  686. >
  687. <i class="el-icon-upload"></i>
  688. <div class="el-upload__text">
  689. {{ $t('将文件拖到此处,或') }}
  690. <em>{{ $t('点击上传') }}</em>
  691. </div>
  692. <div class="el-upload__tip" slot="tip">
  693. <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  694. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  695. </div>
  696. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  697. <input name="type" :value="upload.type" hidden />
  698. </form>
  699. <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  700. </el-upload>
  701. <div slot="footer" class="dialog-footer">
  702. <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
  703. <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
  704. </div>
  705. </el-dialog>
  706. <!-- 报告附件对话框 -->
  707. <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px" append-to-body >
  708. <el-upload v-hasPermi="['training:trainingrecords:file']"
  709. ref="doc"
  710. :limit="50"
  711. :headers="doc.headers"
  712. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  713. :disabled="doc.isUploading"
  714. :on-progress="handleFileDocProgress"
  715. :on-success="handleFileDocSuccess"
  716. :auto-upload="true"
  717. drag
  718. >
  719. <i class="el-icon-upload"></i>
  720. <div class="el-upload__text">
  721. {{ $t('将文件拖到此处,或') }}
  722. <em>{{ $t('点击上传') }}</em>
  723. </div>
  724. </el-upload>
  725. <el-table :data="doc.commonfileList" border>
  726. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  727. <template slot-scope="scope">
  728. <a class="link-type" @click="handleDownload(scope.row)">
  729. <span>{{ scope.row.fileName }}</span>
  730. </a>
  731. </template>
  732. </el-table-column>
  733. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  734. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  735. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  736. <template slot-scope="scope">
  737. <el-button
  738. v-if="scope.row.fileName.endsWith('pdf')"
  739. size="mini"
  740. type="text"
  741. icon="el-icon-view"
  742. @click="handleSee(scope.row)"
  743. >{{ $t('预览') }}</el-button>
  744. <el-button v-hasPermi="['training:trainingrecords:file']" type="text" size="small" v-if="scope.row.isEdit" @click="save(scope.row)">{{ $t('保存') }}</el-button>
  745. <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelFile(scope.row, scope.$index)">{{ $t('取消') }}</el-button>
  746. <!-- <el-button v-hasPermi="['training:trainingrecords:file']" v-if="!scope.row.isEdit" @click="edit(scope.row)" icon="el-icon-edit" type="text" size="mini">编辑</el-button>-->
  747. <el-button
  748. size="mini"
  749. type="text"
  750. icon="el-icon-download"
  751. @click="handleDownload(scope.row)"
  752. >{{ $t('下载') }}</el-button>
  753. <el-button
  754. size="mini"
  755. type="text"
  756. icon="el-icon-delete"
  757. @click="handleDeleteDoc(scope.row)"
  758. v-hasPermi="['training:trainingrecords:file']"
  759. >{{ $t('删除') }}</el-button>
  760. </template>
  761. </el-table-column>
  762. </el-table>
  763. <el-dialog v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" append-to-body>
  764. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  765. <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
  766. <div style="margin-top: -30px">
  767. <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
  768. </div>
  769. </el-dialog>
  770. <div slot="footer" class="dialog-footer">
  771. <!-- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
  772. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  773. </div>
  774. </el-dialog>
  775. <!-- MOC类型说明对话框 -->
  776. <el-dialog v-dialogDrag :title="mocTypeInfo.title" :visible.sync="mocTypeInfo.open" width="1000px" append-to-body>
  777. <el-image
  778. style="width: 947px; height: 394px"
  779. :src="require('@/assets/image/moc/mocTypeInfo.png')"
  780. fit="fill"></el-image>
  781. <div slot="footer" class="dialog-footer">
  782. <el-button type="primary" @click="mocTypeInfo.open = false">{{ $t('确 定') }}</el-button>
  783. </div>
  784. </el-dialog>
  785. <!-- 卡具状态对话框 -->
  786. <el-dialog v-dialogDrag :title="statusChart.title" :visible.sync="statusChart.open" width="500px" append-to-body>
  787. <status-chart :timeliness="2" :tempCategory="1"></status-chart>
  788. <div slot="footer" class="dialog-footer">
  789. <el-button type="primary" @click="statusChart.open = false">{{ $t('确 定') }}</el-button>
  790. </div>
  791. </el-dialog>
  792. <!-- 部门对话框 -->
  793. <el-dialog v-dialogDrag :title="departmentChart.title" :visible.sync="departmentChart.open" width="500px" append-to-body>
  794. <department-chart :timeliness="2" :tempCategory="1"></department-chart>
  795. <div slot="footer" class="dialog-footer">
  796. <el-button type="primary" @click="departmentChart.open = false">{{ $t('确 定') }}</el-button>
  797. </div>
  798. </el-dialog>
  799. <!-- 泄露位置对话框 -->
  800. <el-dialog v-dialogDrag :title="leakLocationChart.title" :visible.sync="leakLocationChart.open" width="500px" append-to-body>
  801. <leak-location-chart :timeliness="2" :tempCategory="1"></leak-location-chart>
  802. <div slot="footer" class="dialog-footer">
  803. <el-button type="primary" @click="leakLocationChart.open = false">{{ $t('确 定') }}</el-button>
  804. </div>
  805. </el-dialog>
  806. <!-- 介质类型对话框 -->
  807. <el-dialog v-dialogDrag :title="materialTypeChart.title" :visible.sync="materialTypeChart.open" width="500px" append-to-body>
  808. <material-type-chart :timeliness="2" :tempCategory="1"></material-type-chart>
  809. <material-type-chart2 :timeliness="2" :tempCategory="1"></material-type-chart2>
  810. <div slot="footer" class="dialog-footer">
  811. <el-button type="primary" @click="materialTypeChart.open = false">{{ $t('确 定') }}</el-button>
  812. </div>
  813. </el-dialog>
  814. <!-- 堵漏日期对话框 -->
  815. <el-dialog v-dialogDrag :title="sealDateChart.title" :visible.sync="sealDateChart.open" width="500px" append-to-body>
  816. <seal-date-chart :timeliness="2" :tempCategory="1"></seal-date-chart>
  817. <div slot="footer" class="dialog-footer">
  818. <el-button type="primary" @click="sealDateChart.open = false">{{ $t('确 定') }}</el-button>
  819. </div>
  820. </el-dialog>
  821. </div>
  822. </template>
  823. <script>
  824. import { delay, listPermanent, listTemporary, listAquifier, listFacility, listInterlock, getMoc, delMoc, addMoc, updateMoc, exportMoc } from "@/api/process/moc";
  825. import { treeselect } from "@/api/system/dept";
  826. import { getToken } from "@/utils/auth";
  827. import Treeselect from "@riophae/vue-treeselect";
  828. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  829. import {addCommonfile, allFileList, delCommonfile, updateCommonfile} from "@/api/common/commonfile";
  830. import statusChart from "../chart/statusChart";
  831. import departmentChart from "../chart/departmentChart";
  832. import leakLocationChart from "../chart/leakLocationChart";
  833. import materialTypeChart from "../chart/materialTypeChart";
  834. import materialTypeChart2 from "../chart/materialTypeChart2";
  835. import sealDateChart from "../chart/sealDateChart";
  836. export default {
  837. name: "Aquifier",
  838. components: { sealDateChart, materialTypeChart, materialTypeChart2, leakLocationChart, departmentChart, statusChart, Treeselect },
  839. data() {
  840. var validateDocUpdate = (rule, value, callback) => {
  841. if (value == 1) {
  842. if (this.form.pidMaster == 0 && this.form.sopUpdate == 0) {
  843. return callback(new Error('PID/SOP未更新'));
  844. } else {
  845. return callback();
  846. }
  847. } else {
  848. return callback();
  849. }
  850. };
  851. return {
  852. sealDateChart: {
  853. open: false,
  854. title: '堵漏日期数据统计'
  855. },
  856. materialTypeChart: {
  857. open: false,
  858. title: '介质类型数据统计'
  859. },
  860. leakLocationChart: {
  861. open: false,
  862. title: '泄露位置数据统计'
  863. },
  864. departmentChart: {
  865. open: false,
  866. title: '部门数据统计'
  867. },
  868. statusChart: {
  869. open: false,
  870. title: '卡具状态数据统计'
  871. },
  872. delayForm: {
  873. id: null,
  874. extention: null,
  875. },
  876. delayDialog: {
  877. open: false,
  878. title: null,
  879. },
  880. mocTypeInfo: {
  881. open: false,
  882. title: 'MOC类型说明'
  883. },
  884. drawer: false,
  885. direction: 'rtl',
  886. // 遮罩层
  887. loading: true,
  888. // 选中数组
  889. ids: [],
  890. // 非单个禁用
  891. single: true,
  892. // 非多个禁用
  893. multiple: true,
  894. // 显示搜索条件
  895. showSearch: false,
  896. // 总条数
  897. total: 0,
  898. // MOC管理表格数据
  899. mocList: [],
  900. // 弹出层标题
  901. title: "",
  902. // 部门树选项
  903. deptOptions: undefined,
  904. clientHeight:300,
  905. // 是否显示弹出层
  906. open: false,
  907. // 卡具状态字典
  908. mocStatusOptions: [],
  909. // 装置字典
  910. plantCodeOptions: [],
  911. // 类别字典
  912. categoryOptions: [],
  913. // 区域字典
  914. areaOptions: [],
  915. // PID MASTER更新字典
  916. pidMasterOptions: [],
  917. // 临时MOC状态字典
  918. temporaryStateOptions: [],
  919. // SOP更新字典
  920. sopUpdateOptions: [],
  921. // 文件更新字典
  922. docUpdateOptions:[],
  923. // 实施情况字典
  924. trueStateOptions: [],
  925. // 变更性质字典
  926. changeNatureOptions: [],
  927. // 风险等级字典
  928. riskLevelOptions: [],
  929. // MOC类型字典
  930. mocTypeOptions: [],
  931. // MC情况字典
  932. mcDetailOptions: [],
  933. //时间选择限制
  934. ehsCheckDate: '',
  935. trainingDatePicker: this.pickerOptionsTraining(),
  936. pssrDatePicker: this.pickerOptionsPssr(),
  937. // 用户导入参数
  938. upload: {
  939. //下载模板请求地址
  940. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  941. //下载模板类型
  942. type: 'moc',
  943. // 是否显示弹出层(用户导入)
  944. open: false,
  945. // 弹出层标题(用户导入)
  946. title: "",
  947. // 是否禁用上传
  948. isUploading: false,
  949. // 是否更新已经存在的用户数据
  950. updateSupport: 0,
  951. // 设置上传的请求头部
  952. headers: { Authorization: "Bearer " + getToken() },
  953. // 上传的地址
  954. url: process.env.VUE_APP_BASE_API + "/process/moc/importData"
  955. },
  956. // 报告附件参数
  957. doc: {
  958. file: "",
  959. // 是否显示弹出层(报告附件)
  960. open: false,
  961. // 弹出层标题(报告附件)
  962. title: "附件",
  963. // 是否禁用上传
  964. isUploading: false,
  965. // 是否更新已经存在的用户数据
  966. updateSupport: 0,
  967. // 报告附件上传位置编号
  968. ids: 0,
  969. // 设置上传的请求头部
  970. headers: { Authorization: "Bearer " + getToken() },
  971. // 上传的地址
  972. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  973. commonfileList: null,
  974. queryParams: {
  975. pId: null,
  976. pType: 'moc'
  977. },
  978. pType: 'moc',
  979. pId: null,
  980. form: {}
  981. },
  982. pdf : {
  983. title: '',
  984. pdfUrl: '',
  985. numPages: null,
  986. open: false,
  987. pageNum: 1,
  988. pageTotalNum: 1,
  989. loadedRatio: 0,
  990. },
  991. // 查询参数
  992. queryParams: {
  993. pageNum: 1,
  994. pageSize: 20,
  995. plantCode: null,
  996. mocNo: null,
  997. plantNumber: null,
  998. noticeLetter: null,
  999. workLetter: null,
  1000. cteNo: null,
  1001. investCost: null,
  1002. category: null,
  1003. significance: null,
  1004. classification: null,
  1005. area: null,
  1006. dashControl: null,
  1007. title: null,
  1008. owner: null,
  1009. approveTime: null,
  1010. estimateEndtime: null,
  1011. endtime: null,
  1012. trueState: null,
  1013. changeNature: null,
  1014. overTime: null,
  1015. riskLevel: null,
  1016. training: null,
  1017. pssr: null,
  1018. ehsCheck: null,
  1019. ehsDb: null,
  1020. pidMaster: null,
  1021. pssrDb: null,
  1022. capex: null,
  1023. remarks: null,
  1024. companyMocNo: null,
  1025. projectNo: null,
  1026. mocType: null,
  1027. mcTime: null,
  1028. mcDetail: null,
  1029. docUpdate: null,
  1030. pssrNo: null,
  1031. timeliness: null,
  1032. tempCategory: null,
  1033. expTime: null,
  1034. tempState: null,
  1035. location: null,
  1036. finishDate: null,
  1037. processUnit: null,
  1038. department: null,
  1039. leakLocation: null,
  1040. pressure: null,
  1041. temperature: null,
  1042. leakFluid: null,
  1043. materialType: null,
  1044. planDate: null,
  1045. sealDate: null,
  1046. extention1: null,
  1047. extention2: null,
  1048. extention3: null,
  1049. extention4: null,
  1050. extention5: null,
  1051. extention6: null,
  1052. extention7: null,
  1053. extention8: null,
  1054. extention9: null,
  1055. status: null,
  1056. },
  1057. chartParams: {
  1058. year : 2021
  1059. },
  1060. yearOption: [2020,2021],
  1061. // 表单参数
  1062. form: {},
  1063. // 表单校验
  1064. delayRules: {
  1065. extention: [
  1066. {required: true, message: this.$t('延期日期') + this.$t('不能为空'), trigger: "change"}
  1067. ],
  1068. },
  1069. rules: {
  1070. mocNo: [
  1071. { required: true, message: this.$t('MOC编号') + this.$t('不能为空'), trigger: "change" }
  1072. ],
  1073. docUpdate: [
  1074. // { required: true, message: this.$t('文档更新') + this.$t('不能为空'), trigger: "change" },
  1075. { validator: validateDocUpdate, trigger: 'change' }
  1076. ],
  1077. deptId: [
  1078. { required: true, message: this.$t('归属部门') + this.$t('不能为空'), trigger: "change" }
  1079. ],
  1080. },
  1081. };
  1082. },
  1083. watch: {
  1084. // 根据名称筛选部门树
  1085. deptName(val) {
  1086. this.$refs.tree.filter(val);
  1087. }
  1088. },
  1089. created() {
  1090. //设置表格高度对应屏幕高度
  1091. this.$nextTick(() => {
  1092. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  1093. })
  1094. this.getList();
  1095. this.getTreeselect();
  1096. this.getDicts("MOC_STATUS").then(response => {
  1097. this.mocStatusOptions = response.data;
  1098. });
  1099. this.getDicts("MC_DETAIL").then(response => {
  1100. this.mcDetailOptions = response.data;
  1101. });
  1102. this.getDicts("MOC_TYPE").then(response => {
  1103. this.mocTypeOptions = response.data;
  1104. });
  1105. this.getDicts("PLANT_DIVIDE").then(response => {
  1106. this.plantCodeOptions = response.data;
  1107. });
  1108. this.getDicts("MOC_CATEGORY").then(response => {
  1109. this.categoryOptions = response.data;
  1110. });
  1111. this.getDicts("MOC_AREA").then(response => {
  1112. this.areaOptions = response.data;
  1113. });
  1114. this.getDicts("YES_NO_EN").then(response => {
  1115. this.pidMasterOptions = response.data;
  1116. this.sopUpdateOptions = response.data;
  1117. this.docUpdateOptions = response.data;
  1118. });
  1119. this.getDicts("MOC_TEMPORARYSTATE").then(response => {
  1120. this.temporaryStateOptions = response.data;
  1121. });
  1122. this.getDicts("MOC_STATE").then(response => {
  1123. this.trueStateOptions = response.data;
  1124. });
  1125. this.getDicts("MOC_CHANGE").then(response => {
  1126. this.changeNatureOptions = response.data;
  1127. });
  1128. this.getDicts("MOC_RISKLEVEL").then(response => {
  1129. this.riskLevelOptions = response.data;
  1130. });
  1131. },
  1132. methods: {
  1133. /** 移除按钮操作 */
  1134. handleRemove(row) {
  1135. this.$confirm(this.$t('是否确认移除?'), this.$t('警告'), {
  1136. confirmButtonText: this.$t('确定'),
  1137. cancelButtonText: this.$t('取消'),
  1138. type: "warning"
  1139. }).then(function() {
  1140. updateMoc({id: row.id, status: 0});
  1141. }).then(() => {
  1142. this.getList();
  1143. this.msgSuccess(this.$t('移除成功'));
  1144. })
  1145. },
  1146. /** 查询MOC管理列表 */
  1147. getList() {
  1148. this.loading = true;
  1149. let _this = this
  1150. listAquifier(this.queryParams).then(response => {
  1151. this.mocList = response.rows;
  1152. this.mocList.forEach(function (value,key,arr) {
  1153. if (value.overTime == null) {
  1154. _this.mocList[key].overTime = "N.A."
  1155. }
  1156. });
  1157. this.total = response.total;
  1158. this.loading = false;
  1159. });
  1160. },
  1161. // 单元格样式
  1162. tableCellStyle( {row, column, rowIndex, columnIndex} ) {
  1163. let today = new Date(); // 当前时间
  1164. let expTime = new Date(row.expTime);
  1165. if (today.getTime() < expTime.getTime()) {
  1166. let difference = expTime.getTime() - today.getTime(); // 时间差
  1167. if (row.status == 0) { // 移除的数据
  1168. return "background-color: rgba(146, 208, 80, 1);";
  1169. } else if (row.expTime != null && row.expTime != '') {
  1170. if (difference <= 7 * 24 * 60 * 60 * 1000) { // 到期时间 - 当前时间 <= 7
  1171. return "background-color: rgba(250, 191, 143, 1);";
  1172. } else if (difference >= 7 * 24 * 60 * 60 * 1000
  1173. && difference <= 14 * 24 * 60 * 60 * 1000) { // 7 <= 到期时间 - 当前时间 <= 14
  1174. return "background-color: rgba(255, 255, 0, 1);";
  1175. }
  1176. }
  1177. }
  1178. },
  1179. //根据分数显示颜色提示
  1180. // tableCellStyle({ row, column, rowIndex, columnIndex }) {
  1181. // if (columnIndex == 3 && row.trueState == 10){
  1182. // return "color: rgba(45, 58, 79, 0.98) "
  1183. // }else if (columnIndex == 3 && row.trueState == 12){
  1184. // return "color: rgba(255, 26, 26, 0.98) "
  1185. // }else if (columnIndex == 3 && row.trueState == 14){
  1186. // return "color: rgba(95, 153, 248, 0.98) "
  1187. // }
  1188. // },
  1189. /** 查询部门下拉树结构 */
  1190. getTreeselect() {
  1191. treeselect().then(response => {
  1192. this.deptOptions = response.data;
  1193. });
  1194. },
  1195. // 卡具状态字典翻译
  1196. mocStatusFormat(row, column) {
  1197. return this.selectDictLabel(this.mocStatusOptions, row.status);
  1198. },
  1199. // 装置字典翻译
  1200. plantCodeFormat(row, column) {
  1201. return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
  1202. },
  1203. // 类别字典翻译
  1204. categoryFormat(row, column) {
  1205. return this.selectDictLabel(this.categoryOptions, row.category);
  1206. },
  1207. // 实施情况字典翻译
  1208. trueStateFormat(row, column) {
  1209. return this.selectDictLabel(this.trueStateOptions, row.trueState);
  1210. },
  1211. // 变更性质字典翻译
  1212. changeNatureFormat(row, column) {
  1213. return this.selectDictLabel(this.changeNatureOptions, row.changeNature);
  1214. },
  1215. // 风险等级字典翻译
  1216. riskLevelFormat(row, column) {
  1217. return this.selectDictLabel(this.riskLevelOptions, row.riskLevel);
  1218. },
  1219. // 区域字典翻译
  1220. areaFormat(row, column) {
  1221. return this.selectDictLabel(this.areaOptions, row.area);
  1222. },
  1223. // PID MASTER更新字典翻译
  1224. pidMasterFormat(row, column) {
  1225. return this.selectDictLabel(this.pidMasterOptions, row.pidMaster);
  1226. },
  1227. // 临时MOC状态字典翻译
  1228. temporaryStateFormat(row, column) {
  1229. return this.selectDictLabel(this.temporaryStateOptions, row.temporaryState);
  1230. },
  1231. // SOP更新字典翻译
  1232. sopUpdateFormat(row, column) {
  1233. return this.selectDictLabel(this.sopUpdateOptions, row.sopUpdate);
  1234. },
  1235. // MC情况字典翻译
  1236. mcDetailFormat(row, column) {
  1237. return this.selectDictLabel(this.mcDetailOptions, row.mcDetail);
  1238. },
  1239. // MOC类型字典翻译
  1240. mocTypeFormat(row, column) {
  1241. return this.selectDictLabel(this.mocTypeOptions, row.mocType);
  1242. },
  1243. // 文件更新字典翻译
  1244. docUpdateFormat(row, column) {
  1245. return this.selectDictLabel(this.docUpdateOptions, row.docUpdate);
  1246. },
  1247. // 取消按钮
  1248. cancelDelay() {
  1249. this.delayDialog.open = false;
  1250. },
  1251. cancel() {
  1252. this.open = false;
  1253. this.reset();
  1254. },
  1255. // 表单重置
  1256. reset() {
  1257. this.form = {
  1258. id: null,
  1259. plantCode: null,
  1260. mocNo: null,
  1261. plantNumber: null,
  1262. noticeLetter: null,
  1263. workLetter: null,
  1264. cteNo: null,
  1265. investCost: null,
  1266. category: null,
  1267. significance: null,
  1268. classification: null,
  1269. area: null,
  1270. dashControl: null,
  1271. title: null,
  1272. owner: null,
  1273. approveTime: null,
  1274. estimateEndtime: null,
  1275. endtime: null,
  1276. trueState: null,
  1277. changeNature: null,
  1278. overTime: null,
  1279. riskLevel: null,
  1280. training: null,
  1281. pssr: null,
  1282. ehsCheck: null,
  1283. ehsDb: null,
  1284. pidMaster: null,
  1285. pssrDb: null,
  1286. capex: null,
  1287. delFlag: null,
  1288. createrCode: null,
  1289. createdate: null,
  1290. updaterCode: null,
  1291. updatedate: null,
  1292. deptId: null,
  1293. remarks: null,
  1294. temporaryState: null,
  1295. sopUpdate: null
  1296. };
  1297. this.resetForm("form");
  1298. },
  1299. // 限制时间范围
  1300. pickerOptionsTraining() {
  1301. const self = this
  1302. return {
  1303. disabledDate(time){
  1304. return time.getTime() < new Date(self.form.ehsCheck).getTime()
  1305. }
  1306. }
  1307. },
  1308. pickerOptionsPssr() {
  1309. const self = this
  1310. return {
  1311. disabledDate(time){
  1312. if (self.form.training != null) {
  1313. return time.getTime() < new Date(self.form.training).getTime()
  1314. }else {
  1315. return time.getTime() < new Date(self.form.ehsCheck).getTime()
  1316. }
  1317. }
  1318. }
  1319. },
  1320. /** 搜索按钮操作 */
  1321. handleQuery() {
  1322. this.queryParams.pageNum = 1;
  1323. this.getList();
  1324. },
  1325. /** 重置按钮操作 */
  1326. resetQuery() {
  1327. this.resetForm("queryForm");
  1328. this.handleQuery();
  1329. },
  1330. // 多选框选中数据
  1331. handleSelectionChange(selection) {
  1332. this.ids = selection.map(item => item.id)
  1333. this.single = selection.length!==1
  1334. this.multiple = !selection.length
  1335. },
  1336. /** 新增按钮操作 */
  1337. handleAdd() {
  1338. this.reset();
  1339. this.open = true;
  1340. this.title = this.$t('新增') + " " + this.$t('MOC管理');
  1341. },
  1342. //实施情况Finished变更
  1343. changeTrueState(val) {
  1344. if (val == 10) {
  1345. }else {
  1346. this.$refs['form'].clearValidate();
  1347. }
  1348. },
  1349. changeChangeNature(val) {
  1350. if (val == 10) {
  1351. }else if (val = 12) {
  1352. this.$refs['form'].clearValidate();
  1353. this.form.temporaryState = "14";
  1354. this.form.overTime = "";
  1355. }
  1356. },
  1357. //根据分数显示颜色提示
  1358. tableCellClassName({ row, column, rowIndex, columnIndex }) {
  1359. if (columnIndex == 13){
  1360. return this.changeColor(row.isEhsCheck, row.ehsCheck)
  1361. }
  1362. if (columnIndex == 14){
  1363. return this.changeColor(row.isTraining, row.training)
  1364. }
  1365. if (columnIndex == 15){
  1366. return this.changeColor(row.isPssr, row.pssr)
  1367. }
  1368. },
  1369. changeColor (value, dateValue) {
  1370. if (value !== "1" && dateValue !== null){
  1371. return 'cellMoc'
  1372. }
  1373. },
  1374. /** 延期按钮操作 */
  1375. handleDelay(row, type) {
  1376. if (type == 1) { // 自动延期
  1377. if (row.sealDate == null) {
  1378. this.msgError(this.$t('未填写堵漏日期,不可执行延期操作。'));
  1379. } else {
  1380. this.$confirm(this.$t('是否确认延期?'), this.$t('警告'), {
  1381. confirmButtonText: this.$t('确定'),
  1382. cancelButtonText: this.$t('取消'),
  1383. type: "warning"
  1384. }).then(function() {
  1385. return delay({id: row.id, extention: null});
  1386. }).then(() => {
  1387. this.getList();
  1388. this.msgSuccess(this.$t('延期成功'));
  1389. })
  1390. }
  1391. } else if (type == 2) { // 手动延期
  1392. this.delayForm.id = row.id;
  1393. this.delayDialog.open = true;
  1394. this.delayDialog.title = row.mocNo.toString() + '延期操作';
  1395. }
  1396. },
  1397. /** 修改按钮操作 */
  1398. handleUpdate(row) {
  1399. this.reset();
  1400. const id = row.id || this.ids
  1401. getMoc(id).then(response => {
  1402. this.form = response.data;
  1403. this.open = true;
  1404. this.title = this.$t('修改') + this.$t('MOC管理');
  1405. });
  1406. },
  1407. /** 提交按钮 */
  1408. submitDelayForm() {
  1409. delay(this.delayForm).then(response => {
  1410. this.msgSuccess(this.$t('延期成功'));
  1411. this.delayDialog.open = false;
  1412. this.getList();
  1413. });
  1414. },
  1415. submitForm() {
  1416. this.$refs["form"].validate(valid => {
  1417. if (valid) {
  1418. if (this.form.trueState == "10") {
  1419. if (this.form.mocNo != null && this.form.plantNumber != null && this.form.category != null && this.form.significance != null && this.form.classification != null
  1420. && this.form.area != null && this.form.title != null && this.form.owner != null && this.form.approveTime != null && this.form.estimateEndtime != null
  1421. && this.form.endtime != null && this.form.changeNature != null && this.form.riskLevel != null && this.form.training != null && this.form.pssr != null) {
  1422. if (this.form.id != null) {
  1423. updateMoc(this.form).then(response => {
  1424. this.msgSuccess(this.$t('修改成功'));
  1425. this.open = false;
  1426. this.getList();
  1427. });
  1428. } else {
  1429. this.form.timeliness = 2;
  1430. this.form.tempCategory = 1;
  1431. addMoc(this.form).then(response => {
  1432. this.msgSuccess(this.$t('新增成功'));
  1433. this.open = false;
  1434. this.getList();
  1435. });
  1436. }
  1437. } else {
  1438. this.msgError(this.$t('存在必填项未填,实施情况修改Finished失败'));
  1439. }
  1440. }else {
  1441. if (this.form.id != null) {
  1442. updateMoc(this.form).then(response => {
  1443. this.msgSuccess(this.$t('修改成功'));
  1444. this.open = false;
  1445. this.getList();
  1446. });
  1447. } else {
  1448. this.form.timeliness = 2;
  1449. this.form.tempCategory = 1;
  1450. addMoc(this.form).then(response => {
  1451. this.msgSuccess(this.$t('新增成功'));
  1452. this.open = false;
  1453. this.getList();
  1454. });
  1455. }
  1456. }
  1457. }
  1458. });
  1459. },
  1460. /** 删除按钮操作 */
  1461. handleDelete(row) {
  1462. const ids = row.id || this.ids;
  1463. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1464. confirmButtonText: this.$t('确定'),
  1465. cancelButtonText: this.$t('取消'),
  1466. type: "warning"
  1467. }).then(function() {
  1468. return delMoc(ids);
  1469. }).then(() => {
  1470. this.getList();
  1471. this.msgSuccess(this.$t('删除成功'));
  1472. })
  1473. },
  1474. /** 导出按钮操作 */
  1475. handleExport() {
  1476. const queryParams = this.queryParams;
  1477. this.$confirm(this.$t('是否确认导出所有MOC管理数据项?'), this.$t('警告'), {
  1478. confirmButtonText: this.$t('确定'),
  1479. cancelButtonText: this.$t('取消'),
  1480. type: "warning"
  1481. }).then(function() {
  1482. return exportMoc(queryParams);
  1483. }).then(response => {
  1484. this.download(response.msg);
  1485. })
  1486. },
  1487. /** 导入按钮操作 */
  1488. handleImport() {
  1489. this.upload.title = this.$t('用户导入');
  1490. this.upload.open = true;
  1491. },
  1492. /** 下载模板操作 */
  1493. importTemplate() {
  1494. this.$refs['downloadFileForm'].submit()
  1495. },
  1496. // 文件上传中处理
  1497. handleFileUploadProgress(event, file, fileList) {
  1498. this.upload.isUploading = true;
  1499. },
  1500. // 文件上传成功处理
  1501. handleFileSuccess(response, file, fileList) {
  1502. this.upload.open = false;
  1503. this.upload.isUploading = false;
  1504. this.$refs.upload.clearFiles();
  1505. if (response.data[0] != null) {
  1506. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1507. }else {
  1508. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1509. }
  1510. this.getList();
  1511. },
  1512. // 提交上传文件
  1513. submitFileForm() {
  1514. this.$refs.upload.submit();
  1515. },
  1516. //数据分析
  1517. handleData(){
  1518. var now = new Date();
  1519. var year = now.getFullYear(); //得到年份
  1520. this.yearOption = [year-2 , year-1 ,year]
  1521. this.drawer = true
  1522. },
  1523. /** 报告附件按钮操作 */
  1524. handleDoc(row , fileType) {
  1525. this.doc.pType = fileType
  1526. this.doc.queryParams.pType = fileType
  1527. this.doc.id = row.id;
  1528. this.doc.title = row.title;
  1529. this.doc.open = true;
  1530. this.doc.queryParams.pId = row.id
  1531. this.doc.pId = row.id
  1532. this.getFileList()
  1533. this.$nextTick(() => {
  1534. this.$refs.doc.clearFiles()
  1535. })
  1536. },
  1537. getFileList (){
  1538. allFileList(this.doc.queryParams).then(response => {
  1539. response.forEach(element => {
  1540. element["isEdit"] = false
  1541. });
  1542. response.forEach(element => {
  1543. element["isAdd"] = false
  1544. });
  1545. this.doc.commonfileList = response;
  1546. });
  1547. },
  1548. //附件上传中处理
  1549. handleFileDocProgress(event, file, fileList) {
  1550. this.doc.file = file;
  1551. this.doc.isUploading = true;
  1552. },
  1553. //附件上传成功处理
  1554. handleFileDocSuccess(response, file, fileList) {
  1555. this.doc.isUploading = false;
  1556. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1557. this.getFileList()
  1558. },
  1559. // 文件下载处理
  1560. handleDownload(row) {
  1561. var name = row.fileName;
  1562. var url = row.fileUrl;
  1563. var suffix = url.substring(url.lastIndexOf("."), url.length);
  1564. const a = document.createElement('a')
  1565. a.setAttribute('download', name)
  1566. a.setAttribute('target', '_blank')
  1567. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  1568. a.click()
  1569. },
  1570. //pdf预览
  1571. openPdf(){
  1572. window.open(this.pdf.pdfUrl);//path是文件的全路径地址
  1573. },
  1574. handleSee (row){
  1575. this.pdf.open =true
  1576. this.pdf.title = row.fileName
  1577. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  1578. },
  1579. // 取消
  1580. cancelFile(row, index) {
  1581. // 如果是新增的数据
  1582. if (row.isAdd) {
  1583. this.doc.commonfileList.splice(index, 1)
  1584. } else {
  1585. // 不是新增的数据 还原数据
  1586. for (const i in row.oldRow) {
  1587. row[i] = row.oldRow[i]
  1588. }
  1589. row.isEdit = false
  1590. }
  1591. },
  1592. edit(row) {
  1593. // 备份原始数据
  1594. row['oldRow'] = JSON.parse(JSON.stringify(row));
  1595. this.$nextTick(() => {
  1596. row.isEdit = true;
  1597. })
  1598. },
  1599. save(row) {
  1600. row.isEdit = false;
  1601. var that = this;
  1602. that.loading = true;
  1603. this.form = row;
  1604. if (row.isAdd == true) {
  1605. addCommonfile(this.form).then(response => {
  1606. this.msgSuccess(this.$t('新增成功'));
  1607. this.open = false;
  1608. this.getList();
  1609. });
  1610. }else {
  1611. updateCommonfile(this.form).then(response => {
  1612. this.msgSuccess(this.$t('修改成功'));
  1613. this.open = false;
  1614. this.getList();
  1615. });
  1616. }
  1617. },
  1618. /** 删除按钮操作 */
  1619. handleDeleteDoc(row) {
  1620. const ids = row.id || this.ids;
  1621. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1622. confirmButtonText: this.$t('确定'),
  1623. cancelButtonText: this.$t('取消'),
  1624. type: "warning"
  1625. }).then(function() {
  1626. return delCommonfile(ids);
  1627. }).then(() => {
  1628. this.getFileList()
  1629. this.msgSuccess(this.$t('删除成功'));
  1630. })
  1631. },
  1632. }
  1633. };
  1634. </script>
  1635. <style>
  1636. .colorMark {
  1637. color: #6f6f6f;
  1638. text-align: right;
  1639. font-weight:bold;
  1640. font-size: 13px;
  1641. padding-bottom: 5px;
  1642. }
  1643. .rectangleLightgreen {
  1644. width: 40px !important;
  1645. height: 20px !important;
  1646. }
  1647. .rectangleFlesh {
  1648. width: 40px !important;
  1649. height: 20px !important;
  1650. }
  1651. .rectangleYellow {
  1652. width: 40px !important;
  1653. height: 20px !important;
  1654. }
  1655. #sealDate:hover{
  1656. cursor: pointer;
  1657. }
  1658. #materialType:hover{
  1659. cursor: pointer;
  1660. }
  1661. #leakLocation:hover{
  1662. cursor: pointer;
  1663. }
  1664. #department:hover{
  1665. cursor: pointer;
  1666. }
  1667. #status:hover{
  1668. cursor: pointer;
  1669. }
  1670. #moc-type:hover{
  1671. cursor: pointer;
  1672. }
  1673. .text {
  1674. font-size: 14px;
  1675. }
  1676. .item {
  1677. margin-bottom: 18px;
  1678. }
  1679. .clearfix {
  1680. color: #1e1e1e;
  1681. }
  1682. .clearfix:before,
  1683. .clearfix:after {
  1684. display: table;
  1685. content: "";
  1686. }
  1687. .clearfix:after {
  1688. clear: both
  1689. }
  1690. .box-card {
  1691. width: 100%;
  1692. }
  1693. .el-drawer__body {
  1694. overflow: auto;
  1695. }
  1696. .el-drawer__container ::-webkit-scrollbar {
  1697. display: none;
  1698. }
  1699. </style>