index.vue 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514
  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('泄露位置')" prop="leakLocation">
  5. <el-select v-model="queryParams.leakLocation" :placeholder="$t('请选择') + $t('泄露位置')" filterable clearable>
  6. <el-option
  7. v-for="leakLocation in leakLocationList"
  8. :label="leakLocation"
  9. :value="leakLocation"
  10. ></el-option>
  11. </el-select>
  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-select v-model="queryParams.remarks" :placeholder="$t('请选择') + $t('备注')" filterable clearable>
  24. <el-option
  25. v-for="remarks in remarksList"
  26. :label="remarks"
  27. :value="remarks"
  28. ></el-option>
  29. </el-select>
  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 != 0 && scope.row.status != '' && scope.row.status != null"
  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('MOC编号')" prop="mocNo">
  298. <el-input v-model="form.mocNo" :placeholder="$t('请输入') + $t('MOC编号')" />
  299. </el-form-item>
  300. <el-form-item :label="$t('公司MOC编号')" prop="companyMocNo">
  301. <el-input v-model="form.companyMocNo" :placeholder="$t('请输入') + $t('公司MOC编号')" />
  302. </el-form-item>
  303. <el-form-item :label="$t('工艺单元')" prop="processUnit">
  304. <el-input v-model="form.processUnit" :placeholder="$t('请输入') + $t('工艺单元')" />
  305. </el-form-item>
  306. <el-form-item :label="$t('部门')" prop="department">
  307. <el-input v-model="form.department" :placeholder="$t('请输入') + $t('部门')" />
  308. </el-form-item>
  309. <el-form-item :label="$t('泄露位置')" prop="leakLocation">
  310. <el-input v-model="form.leakLocation" :placeholder="$t('请输入') + $t('泄露位置')" />
  311. </el-form-item>
  312. <el-form-item :label="$t('标题')" prop="title">
  313. <el-input v-model="form.title" :placeholder="$t('请输入') + $t('标题')" />
  314. </el-form-item>
  315. <el-form-item :label="$t('操作压力 (MPaG)')" prop="pressure">
  316. <el-input v-model="form.pressure" :placeholder="$t('请输入') + $t('操作压力')" />
  317. </el-form-item>
  318. <el-form-item :label="$t('操作温度 (℃)')" prop="temperature">
  319. <el-input v-model="form.temperature" :placeholder="$t('请输入') + $t('操作温度')" />
  320. </el-form-item>
  321. <el-form-item :label="$t('泄露介质')" prop="leakFluid">
  322. <el-input v-model="form.leakFluid" :placeholder="$t('请输入') + $t('泄露介质')" />
  323. </el-form-item>
  324. <el-form-item :label="$t('介质类型')" prop="materialType">
  325. <el-input v-model="form.materialType" :placeholder="$t('请输入') + $t('介质类型')" />
  326. </el-form-item>
  327. <el-form-item :label="$t('方案日期')" prop="planDate">
  328. <el-date-picker clearable size="small" style="width: 200px"
  329. v-model="form.planDate"
  330. type="date"
  331. value-format="yyyy-MM-dd"
  332. :placeholder="$t('请选择') + $t('方案日期')">
  333. </el-date-picker>
  334. </el-form-item>
  335. <el-form-item :label="$t('堵漏日期')" prop="sealDate">
  336. <el-date-picker clearable size="small" style="width: 200px"
  337. v-model="form.sealDate"
  338. type="date"
  339. value-format="yyyy-MM-dd"
  340. :placeholder="$t('请选择') + $t('堵漏日期')">
  341. </el-date-picker>
  342. </el-form-item>
  343. <el-form-item :label="$t('第一次延期')" prop="extention1">
  344. <el-date-picker clearable size="small" style="width: 200px"
  345. v-model="form.extention1"
  346. type="date"
  347. value-format="yyyy-MM-dd"
  348. :placeholder="$t('请选择') + $t('第一次延期')">
  349. </el-date-picker>
  350. </el-form-item>
  351. <el-form-item :label="$t('第二次延期')" prop="extention2">
  352. <el-date-picker clearable size="small" style="width: 200px"
  353. v-model="form.extention2"
  354. type="date"
  355. value-format="yyyy-MM-dd"
  356. :placeholder="$t('请选择') + $t('第二次延期')">
  357. </el-date-picker>
  358. </el-form-item>
  359. <el-form-item :label="$t('第三次延期')" prop="extention3">
  360. <el-date-picker clearable size="small" style="width: 200px"
  361. v-model="form.extention3"
  362. type="date"
  363. value-format="yyyy-MM-dd"
  364. :placeholder="$t('请选择') + $t('第三次延期')">
  365. </el-date-picker>
  366. </el-form-item>
  367. <el-form-item :label="$t('第四次延期')" prop="extention4">
  368. <el-date-picker clearable size="small" style="width: 200px"
  369. v-model="form.extention4"
  370. type="date"
  371. value-format="yyyy-MM-dd"
  372. :placeholder="$t('请选择') + $t('第四次延期')">
  373. </el-date-picker>
  374. </el-form-item>
  375. <el-form-item :label="$t('第五次延期')" prop="extention5">
  376. <el-date-picker clearable size="small" style="width: 200px"
  377. v-model="form.extention5"
  378. type="date"
  379. value-format="yyyy-MM-dd"
  380. :placeholder="$t('请选择') + $t('第五次延期')">
  381. </el-date-picker>
  382. </el-form-item>
  383. <el-form-item :label="$t('第六次延期')" prop="extention6">
  384. <el-date-picker clearable size="small" style="width: 200px"
  385. v-model="form.extention6"
  386. type="date"
  387. value-format="yyyy-MM-dd"
  388. :placeholder="$t('请选择') + $t('第六次延期')">
  389. </el-date-picker>
  390. </el-form-item>
  391. <el-form-item :label="$t('第七次延期')" prop="extention7">
  392. <el-date-picker clearable size="small" style="width: 200px"
  393. v-model="form.extention7"
  394. type="date"
  395. value-format="yyyy-MM-dd"
  396. :placeholder="$t('请选择') + $t('第七次延期')">
  397. </el-date-picker>
  398. </el-form-item>
  399. <el-form-item :label="$t('第八次延期')" prop="extention8">
  400. <el-date-picker clearable size="small" style="width: 200px"
  401. v-model="form.extention8"
  402. type="date"
  403. value-format="yyyy-MM-dd"
  404. :placeholder="$t('请选择') + $t('第八次延期')">
  405. </el-date-picker>
  406. </el-form-item>
  407. <el-form-item :label="$t('第九次延期')" prop="extention9">
  408. <el-date-picker clearable size="small" style="width: 200px"
  409. v-model="form.extention9"
  410. type="date"
  411. value-format="yyyy-MM-dd"
  412. :placeholder="$t('请选择') + $t('第九次延期')">
  413. </el-date-picker>
  414. </el-form-item>
  415. <el-form-item :label="$t('卡具状态')" prop="area">
  416. <el-select v-model="form.status" :placeholder="$t('请选择') + $t('卡具状态')">
  417. <el-option
  418. v-for="dict in mocStatusOptions"
  419. :key="dict.dictValue"
  420. :label="dict.dictLabel"
  421. :value="dict.dictValue"
  422. ></el-option>
  423. </el-select>
  424. </el-form-item>
  425. <el-form-item :label="$t('到期时间')" prop="extention9">
  426. <el-date-picker clearable size="small" style="width: 200px"
  427. v-model="form.expTime"
  428. type="date"
  429. value-format="yyyy-MM-dd"
  430. :placeholder="$t('请选择') + $t('到期时间')">
  431. </el-date-picker>
  432. </el-form-item>
  433. <el-form-item :label="$t('备注')" prop="remarks">
  434. <el-input v-model="form.remarks" type="textarea" :placeholder="$t('请输入') + $t('备注')" />
  435. </el-form-item>
  436. <el-form-item :label="$t('归属部门')" prop="deptId">
  437. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :placeholder="$t('请选择') + $t('归属部门')" />
  438. </el-form-item>
  439. </el-form>
  440. <div slot="footer" class="dialog-footer">
  441. <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
  442. <el-button @click="cancel">{{ $t('取 消') }}</el-button>
  443. </div>
  444. </el-dialog>
  445. <!-- 用户导入对话框 -->
  446. <el-dialog v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  447. <el-upload
  448. ref="upload"
  449. :limit="1"
  450. accept=".xlsx, .xls"
  451. :headers="upload.headers"
  452. :action="upload.url"
  453. :disabled="upload.isUploading"
  454. :on-progress="handleFileUploadProgress"
  455. :on-success="handleFileSuccess"
  456. :auto-upload="false"
  457. drag
  458. >
  459. <i class="el-icon-upload"></i>
  460. <div class="el-upload__text">
  461. {{ $t('将文件拖到此处,或') }}
  462. <em>{{ $t('点击上传') }}</em>
  463. </div>
  464. <div class="el-upload__tip" slot="tip">
  465. <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  466. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  467. </div>
  468. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  469. <input name="type" :value="upload.type" hidden />
  470. </form>
  471. <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  472. </el-upload>
  473. <div slot="footer" class="dialog-footer">
  474. <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
  475. <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
  476. </div>
  477. </el-dialog>
  478. <!-- 报告附件对话框 -->
  479. <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="1000px" append-to-body >
  480. <el-upload v-hasPermi="['training:trainingrecords:file']"
  481. ref="doc"
  482. :limit="50"
  483. :headers="doc.headers"
  484. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  485. :disabled="doc.isUploading"
  486. :on-progress="handleFileDocProgress"
  487. :on-success="handleFileDocSuccess"
  488. :auto-upload="true"
  489. drag
  490. >
  491. <i class="el-icon-upload"></i>
  492. <div class="el-upload__text">
  493. {{ $t('将文件拖到此处,或') }}
  494. <em>{{ $t('点击上传') }}</em>
  495. </div>
  496. </el-upload>
  497. <el-table :data="doc.commonfileList" border>
  498. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  499. <template slot-scope="scope">
  500. <a class="link-type" @click="handleDownload(scope.row)">
  501. <span>{{ scope.row.fileName }}</span>
  502. </a>
  503. </template>
  504. </el-table-column>
  505. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  506. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  507. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  508. <template slot-scope="scope">
  509. <el-button
  510. v-if="scope.row.fileName.endsWith('pdf')"
  511. size="mini"
  512. type="text"
  513. icon="el-icon-view"
  514. @click="handleSee(scope.row)"
  515. >{{ $t('预览') }}</el-button>
  516. <el-button v-hasPermi="['training:trainingrecords:file']" type="text" size="small" v-if="scope.row.isEdit" @click="save(scope.row)">{{ $t('保存') }}</el-button>
  517. <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelFile(scope.row, scope.$index)">{{ $t('取消') }}</el-button>
  518. <!-- <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>-->
  519. <el-button
  520. size="mini"
  521. type="text"
  522. icon="el-icon-download"
  523. @click="handleDownload(scope.row)"
  524. >{{ $t('下载') }}</el-button>
  525. <el-button
  526. size="mini"
  527. type="text"
  528. icon="el-icon-delete"
  529. @click="handleDeleteDoc(scope.row)"
  530. v-hasPermi="['training:trainingrecords:file']"
  531. >{{ $t('删除') }}</el-button>
  532. </template>
  533. </el-table-column>
  534. </el-table>
  535. <el-dialog v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" append-to-body>
  536. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  537. <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
  538. <div style="margin-top: -30px">
  539. <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
  540. </div>
  541. </el-dialog>
  542. <div slot="footer" class="dialog-footer">
  543. <!-- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
  544. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  545. </div>
  546. </el-dialog>
  547. <!-- MOC类型说明对话框 -->
  548. <el-dialog v-dialogDrag :title="mocTypeInfo.title" :visible.sync="mocTypeInfo.open" width="1000px" append-to-body>
  549. <el-image
  550. style="width: 947px; height: 394px"
  551. :src="require('@/assets/image/moc/mocTypeInfo.png')"
  552. fit="fill"></el-image>
  553. <div slot="footer" class="dialog-footer">
  554. <el-button type="primary" @click="mocTypeInfo.open = false">{{ $t('确 定') }}</el-button>
  555. </div>
  556. </el-dialog>
  557. <!-- 卡具状态对话框 -->
  558. <el-dialog v-dialogDrag :title="statusChart.title" :visible.sync="statusChart.open" width="500px" append-to-body>
  559. <status-chart :timeliness="2" :tempCategory="1"></status-chart>
  560. <div slot="footer" class="dialog-footer">
  561. <el-button type="primary" @click="statusChart.open = false">{{ $t('确 定') }}</el-button>
  562. </div>
  563. </el-dialog>
  564. <!-- 部门对话框 -->
  565. <el-dialog v-dialogDrag :title="departmentChart.title" :visible.sync="departmentChart.open" width="500px" append-to-body>
  566. <department-chart :timeliness="2" :tempCategory="1"></department-chart>
  567. <div slot="footer" class="dialog-footer">
  568. <el-button type="primary" @click="departmentChart.open = false">{{ $t('确 定') }}</el-button>
  569. </div>
  570. </el-dialog>
  571. <!-- 泄露位置对话框 -->
  572. <el-dialog v-dialogDrag :title="leakLocationChart.title" :visible.sync="leakLocationChart.open" width="500px" append-to-body>
  573. <leak-location-chart :timeliness="2" :tempCategory="1"></leak-location-chart>
  574. <div slot="footer" class="dialog-footer">
  575. <el-button type="primary" @click="leakLocationChart.open = false">{{ $t('确 定') }}</el-button>
  576. </div>
  577. </el-dialog>
  578. <!-- 介质类型对话框 -->
  579. <el-dialog v-dialogDrag :title="materialTypeChart.title" :visible.sync="materialTypeChart.open" width="500px" append-to-body>
  580. <material-type-chart :timeliness="2" :tempCategory="1"></material-type-chart>
  581. <material-type-chart2 :timeliness="2" :tempCategory="1"></material-type-chart2>
  582. <div slot="footer" class="dialog-footer">
  583. <el-button type="primary" @click="materialTypeChart.open = false">{{ $t('确 定') }}</el-button>
  584. </div>
  585. </el-dialog>
  586. <!-- 堵漏日期对话框 -->
  587. <el-dialog v-dialogDrag :title="sealDateChart.title" :visible.sync="sealDateChart.open" width="500px" append-to-body>
  588. <seal-date-chart :timeliness="2" :tempCategory="1"></seal-date-chart>
  589. <div slot="footer" class="dialog-footer">
  590. <el-button type="primary" @click="sealDateChart.open = false">{{ $t('确 定') }}</el-button>
  591. </div>
  592. </el-dialog>
  593. </div>
  594. </template>
  595. <script>
  596. import { delay, listPermanent, listTemporary, listAquifier, listFacility, listInterlock, getMoc, delMoc, addMoc, updateMoc, exportMoc } from "@/api/process/moc";
  597. import { treeselect } from "@/api/system/dept";
  598. import { getToken } from "@/utils/auth";
  599. import Treeselect from "@riophae/vue-treeselect";
  600. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  601. import {addCommonfile, allFileList, delCommonfile, updateCommonfile} from "@/api/common/commonfile";
  602. import statusChart from "../chart/statusChart";
  603. import departmentChart from "../chart/departmentChart";
  604. import leakLocationChart from "../chart/leakLocationChart";
  605. import materialTypeChart from "../chart/materialTypeChart";
  606. import materialTypeChart2 from "../chart/materialTypeChart2";
  607. import sealDateChart from "../chart/sealDateChart";
  608. export default {
  609. name: "Aquifier",
  610. components: { sealDateChart, materialTypeChart, materialTypeChart2, leakLocationChart, departmentChart, statusChart, Treeselect },
  611. data() {
  612. var validateDocUpdate = (rule, value, callback) => {
  613. if (value == 1) {
  614. if (this.form.pidMaster == 0 && this.form.sopUpdate == 0) {
  615. return callback(new Error('PID/SOP未更新'));
  616. } else {
  617. return callback();
  618. }
  619. } else {
  620. return callback();
  621. }
  622. };
  623. return {
  624. leakLocationList: [],
  625. remarksList: [],
  626. sealDateChart: {
  627. open: false,
  628. title: '堵漏日期数据统计'
  629. },
  630. materialTypeChart: {
  631. open: false,
  632. title: '介质类型数据统计'
  633. },
  634. leakLocationChart: {
  635. open: false,
  636. title: '泄露位置数据统计'
  637. },
  638. departmentChart: {
  639. open: false,
  640. title: '部门数据统计'
  641. },
  642. statusChart: {
  643. open: false,
  644. title: '卡具状态数据统计'
  645. },
  646. delayForm: {
  647. id: null,
  648. extention: null,
  649. },
  650. delayDialog: {
  651. open: false,
  652. title: null,
  653. },
  654. mocTypeInfo: {
  655. open: false,
  656. title: 'MOC类型说明'
  657. },
  658. drawer: false,
  659. direction: 'rtl',
  660. // 遮罩层
  661. loading: true,
  662. // 选中数组
  663. ids: [],
  664. // 非单个禁用
  665. single: true,
  666. // 非多个禁用
  667. multiple: true,
  668. // 显示搜索条件
  669. showSearch: false,
  670. // 总条数
  671. total: 0,
  672. // MOC管理表格数据
  673. mocList: [],
  674. // 弹出层标题
  675. title: "",
  676. // 部门树选项
  677. deptOptions: undefined,
  678. clientHeight:300,
  679. // 是否显示弹出层
  680. open: false,
  681. // 卡具状态字典
  682. mocStatusOptions: [],
  683. // 装置字典
  684. plantCodeOptions: [],
  685. // 类别字典
  686. categoryOptions: [],
  687. // 区域字典
  688. areaOptions: [],
  689. // PID MASTER更新字典
  690. pidMasterOptions: [],
  691. // 临时MOC状态字典
  692. temporaryStateOptions: [],
  693. // SOP更新字典
  694. sopUpdateOptions: [],
  695. // 文件更新字典
  696. docUpdateOptions:[],
  697. // 实施情况字典
  698. trueStateOptions: [],
  699. // 变更性质字典
  700. changeNatureOptions: [],
  701. // 风险等级字典
  702. riskLevelOptions: [],
  703. // MOC类型字典
  704. mocTypeOptions: [],
  705. // MC情况字典
  706. mcDetailOptions: [],
  707. //时间选择限制
  708. ehsCheckDate: '',
  709. trainingDatePicker: this.pickerOptionsTraining(),
  710. pssrDatePicker: this.pickerOptionsPssr(),
  711. // 用户导入参数
  712. upload: {
  713. //下载模板请求地址
  714. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  715. //下载模板类型
  716. type: 'moc',
  717. // 是否显示弹出层(用户导入)
  718. open: false,
  719. // 弹出层标题(用户导入)
  720. title: "",
  721. // 是否禁用上传
  722. isUploading: false,
  723. // 是否更新已经存在的用户数据
  724. updateSupport: 0,
  725. // 设置上传的请求头部
  726. headers: { Authorization: "Bearer " + getToken() },
  727. // 上传的地址
  728. url: process.env.VUE_APP_BASE_API + "/process/moc/importData"
  729. },
  730. // 报告附件参数
  731. doc: {
  732. file: "",
  733. // 是否显示弹出层(报告附件)
  734. open: false,
  735. // 弹出层标题(报告附件)
  736. title: "附件",
  737. // 是否禁用上传
  738. isUploading: false,
  739. // 是否更新已经存在的用户数据
  740. updateSupport: 0,
  741. // 报告附件上传位置编号
  742. ids: 0,
  743. // 设置上传的请求头部
  744. headers: { Authorization: "Bearer " + getToken() },
  745. // 上传的地址
  746. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  747. commonfileList: null,
  748. queryParams: {
  749. pId: null,
  750. pType: 'moc'
  751. },
  752. pType: 'moc',
  753. pId: null,
  754. form: {}
  755. },
  756. pdf : {
  757. title: '',
  758. pdfUrl: '',
  759. numPages: null,
  760. open: false,
  761. pageNum: 1,
  762. pageTotalNum: 1,
  763. loadedRatio: 0,
  764. },
  765. // 查询参数
  766. queryParams: {
  767. pageNum: 1,
  768. pageSize: 20,
  769. plantCode: null,
  770. mocNo: null,
  771. plantNumber: null,
  772. noticeLetter: null,
  773. workLetter: null,
  774. cteNo: null,
  775. investCost: null,
  776. category: null,
  777. significance: null,
  778. classification: null,
  779. area: null,
  780. dashControl: null,
  781. title: null,
  782. owner: null,
  783. approveTime: null,
  784. estimateEndtime: null,
  785. endtime: null,
  786. trueState: null,
  787. changeNature: null,
  788. overTime: null,
  789. riskLevel: null,
  790. training: null,
  791. pssr: null,
  792. ehsCheck: null,
  793. ehsDb: null,
  794. pidMaster: null,
  795. pssrDb: null,
  796. capex: null,
  797. remarks: null,
  798. companyMocNo: null,
  799. projectNo: null,
  800. mocType: null,
  801. mcTime: null,
  802. mcDetail: null,
  803. docUpdate: null,
  804. pssrNo: null,
  805. timeliness: null,
  806. tempCategory: null,
  807. expTime: null,
  808. tempState: null,
  809. location: null,
  810. finishDate: null,
  811. processUnit: null,
  812. department: null,
  813. leakLocation: null,
  814. pressure: null,
  815. temperature: null,
  816. leakFluid: null,
  817. materialType: null,
  818. planDate: null,
  819. sealDate: null,
  820. extention1: null,
  821. extention2: null,
  822. extention3: null,
  823. extention4: null,
  824. extention5: null,
  825. extention6: null,
  826. extention7: null,
  827. extention8: null,
  828. extention9: null,
  829. status: null,
  830. },
  831. chartParams: {
  832. year : 2021
  833. },
  834. yearOption: [2020,2021],
  835. // 表单参数
  836. form: {},
  837. // 表单校验
  838. delayRules: {
  839. extention: [
  840. {required: true, message: this.$t('延期日期') + this.$t('不能为空'), trigger: "change"}
  841. ],
  842. },
  843. rules: {
  844. mocNo: [
  845. { required: true, message: this.$t('MOC编号') + this.$t('不能为空'), trigger: "change" }
  846. ],
  847. docUpdate: [
  848. // { required: true, message: this.$t('文档更新') + this.$t('不能为空'), trigger: "change" },
  849. { validator: validateDocUpdate, trigger: 'change' }
  850. ],
  851. deptId: [
  852. { required: true, message: this.$t('归属部门') + this.$t('不能为空'), trigger: "change" }
  853. ],
  854. },
  855. };
  856. },
  857. watch: {
  858. // 根据名称筛选部门树
  859. deptName(val) {
  860. this.$refs.tree.filter(val);
  861. }
  862. },
  863. created() {
  864. //设置表格高度对应屏幕高度
  865. this.$nextTick(() => {
  866. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  867. })
  868. this.getList();
  869. this.getTreeselect();
  870. this.getDicts("MOC_STATUS").then(response => {
  871. this.mocStatusOptions = response.data;
  872. });
  873. this.getDicts("MC_DETAIL").then(response => {
  874. this.mcDetailOptions = response.data;
  875. });
  876. this.getDicts("MOC_TYPE").then(response => {
  877. this.mocTypeOptions = response.data;
  878. });
  879. this.getDicts("PLANT_DIVIDE").then(response => {
  880. this.plantCodeOptions = response.data;
  881. });
  882. this.getDicts("MOC_CATEGORY").then(response => {
  883. this.categoryOptions = response.data;
  884. });
  885. this.getDicts("MOC_AREA").then(response => {
  886. this.areaOptions = response.data;
  887. });
  888. this.getDicts("YES_NO_EN").then(response => {
  889. this.pidMasterOptions = response.data;
  890. this.sopUpdateOptions = response.data;
  891. this.docUpdateOptions = response.data;
  892. });
  893. this.getDicts("MOC_TEMPORARYSTATE").then(response => {
  894. this.temporaryStateOptions = response.data;
  895. });
  896. this.getDicts("MOC_STATE").then(response => {
  897. this.trueStateOptions = response.data;
  898. });
  899. this.getDicts("MOC_CHANGE").then(response => {
  900. this.changeNatureOptions = response.data;
  901. });
  902. this.getDicts("MOC_RISKLEVEL").then(response => {
  903. this.riskLevelOptions = response.data;
  904. });
  905. },
  906. methods: {
  907. /** 移除按钮操作 */
  908. handleRemove(row) {
  909. this.$confirm(this.$t('是否确认移除?'), this.$t('警告'), {
  910. confirmButtonText: this.$t('确定'),
  911. cancelButtonText: this.$t('取消'),
  912. type: "warning"
  913. }).then(function() {
  914. updateMoc({id: row.id, status: 0});
  915. }).then(() => {
  916. this.getList();
  917. this.msgSuccess(this.$t('移除成功'));
  918. })
  919. },
  920. /** 查询MOC管理列表 */
  921. getList() {
  922. this.loading = true;
  923. let _this = this
  924. listAquifier(this.queryParams).then(response => {
  925. this.mocList = response.rows;
  926. this.mocList.forEach(function (value,key,arr) {
  927. if (value.overTime == null) {
  928. _this.mocList[key].overTime = "N.A."
  929. }
  930. if (value.remarks != null && value.remarks != '') {
  931. _this.remarksList.push(value.remarks);
  932. }
  933. if (value.leakLocation != null && value.leakLocation != '') {
  934. _this.leakLocationList.push(value.leakLocation);
  935. }
  936. });
  937. // 下拉数据去重
  938. _this.remarksList = this.unique(_this.remarksList);
  939. _this.leakLocationList = this.unique(_this.leakLocationList);
  940. this.total = response.total;
  941. this.loading = false;
  942. });
  943. },
  944. // 数组去重
  945. unique(arr) {
  946. if (!Array.isArray(arr)) {
  947. console.log('type error!')
  948. return;
  949. }
  950. arr = arr.sort()
  951. var arrry= [arr[0]];
  952. for (var i = 1; i < arr.length; i++) {
  953. if (arr[i] !== arr[i-1]) {
  954. arrry.push(arr[i]);
  955. }
  956. }
  957. return arrry;
  958. },
  959. // 单元格样式
  960. tableCellStyle( {row, column, rowIndex, columnIndex} ) {
  961. let today = new Date(); // 当前时间
  962. let expTime = new Date(row.expTime);
  963. if (row.status == 0) { // 移除的数据
  964. return "background-color: rgba(146, 208, 80, 1);";
  965. }
  966. if (today.getTime() < expTime.getTime()) {
  967. let difference = expTime.getTime() - today.getTime(); // 时间差
  968. if (row.expTime != null && row.expTime != '') {
  969. if (difference <= 7 * 24 * 60 * 60 * 1000) { // 到期时间 - 当前时间 <= 7
  970. return "background-color: rgba(250, 191, 143, 1);";
  971. } else if (difference >= 7 * 24 * 60 * 60 * 1000
  972. && difference <= 14 * 24 * 60 * 60 * 1000) { // 7 <= 到期时间 - 当前时间 <= 14
  973. return "background-color: rgba(255, 255, 0, 1);";
  974. }
  975. }
  976. }
  977. },
  978. //根据分数显示颜色提示
  979. // tableCellStyle({ row, column, rowIndex, columnIndex }) {
  980. // if (columnIndex == 3 && row.trueState == 10){
  981. // return "color: rgba(45, 58, 79, 0.98) "
  982. // }else if (columnIndex == 3 && row.trueState == 12){
  983. // return "color: rgba(255, 26, 26, 0.98) "
  984. // }else if (columnIndex == 3 && row.trueState == 14){
  985. // return "color: rgba(95, 153, 248, 0.98) "
  986. // }
  987. // },
  988. /** 查询部门下拉树结构 */
  989. getTreeselect() {
  990. treeselect().then(response => {
  991. this.deptOptions = response.data;
  992. });
  993. },
  994. // 卡具状态字典翻译
  995. mocStatusFormat(row, column) {
  996. return this.selectDictLabel(this.mocStatusOptions, row.status);
  997. },
  998. // 装置字典翻译
  999. plantCodeFormat(row, column) {
  1000. return this.selectDictLabel(this.plantCodeOptions, row.plantCode);
  1001. },
  1002. // 类别字典翻译
  1003. categoryFormat(row, column) {
  1004. return this.selectDictLabel(this.categoryOptions, row.category);
  1005. },
  1006. // 实施情况字典翻译
  1007. trueStateFormat(row, column) {
  1008. return this.selectDictLabel(this.trueStateOptions, row.trueState);
  1009. },
  1010. // 变更性质字典翻译
  1011. changeNatureFormat(row, column) {
  1012. return this.selectDictLabel(this.changeNatureOptions, row.changeNature);
  1013. },
  1014. // 风险等级字典翻译
  1015. riskLevelFormat(row, column) {
  1016. return this.selectDictLabel(this.riskLevelOptions, row.riskLevel);
  1017. },
  1018. // 区域字典翻译
  1019. areaFormat(row, column) {
  1020. return this.selectDictLabel(this.areaOptions, row.area);
  1021. },
  1022. // PID MASTER更新字典翻译
  1023. pidMasterFormat(row, column) {
  1024. return this.selectDictLabel(this.pidMasterOptions, row.pidMaster);
  1025. },
  1026. // 临时MOC状态字典翻译
  1027. temporaryStateFormat(row, column) {
  1028. return this.selectDictLabel(this.temporaryStateOptions, row.temporaryState);
  1029. },
  1030. // SOP更新字典翻译
  1031. sopUpdateFormat(row, column) {
  1032. return this.selectDictLabel(this.sopUpdateOptions, row.sopUpdate);
  1033. },
  1034. // MC情况字典翻译
  1035. mcDetailFormat(row, column) {
  1036. return this.selectDictLabel(this.mcDetailOptions, row.mcDetail);
  1037. },
  1038. // MOC类型字典翻译
  1039. mocTypeFormat(row, column) {
  1040. return this.selectDictLabel(this.mocTypeOptions, row.mocType);
  1041. },
  1042. // 文件更新字典翻译
  1043. docUpdateFormat(row, column) {
  1044. return this.selectDictLabel(this.docUpdateOptions, row.docUpdate);
  1045. },
  1046. // 取消按钮
  1047. cancelDelay() {
  1048. this.delayDialog.open = false;
  1049. },
  1050. cancel() {
  1051. this.open = false;
  1052. this.reset();
  1053. },
  1054. // 表单重置
  1055. reset() {
  1056. this.form = {
  1057. id: null,
  1058. plantCode: null,
  1059. mocNo: null,
  1060. plantNumber: null,
  1061. noticeLetter: null,
  1062. workLetter: null,
  1063. cteNo: null,
  1064. investCost: null,
  1065. category: null,
  1066. significance: null,
  1067. classification: null,
  1068. area: null,
  1069. dashControl: null,
  1070. title: null,
  1071. owner: null,
  1072. approveTime: null,
  1073. estimateEndtime: null,
  1074. endtime: null,
  1075. trueState: null,
  1076. changeNature: null,
  1077. overTime: null,
  1078. riskLevel: null,
  1079. training: null,
  1080. pssr: null,
  1081. ehsCheck: null,
  1082. ehsDb: null,
  1083. pidMaster: null,
  1084. pssrDb: null,
  1085. capex: null,
  1086. delFlag: null,
  1087. createrCode: null,
  1088. createdate: null,
  1089. updaterCode: null,
  1090. updatedate: null,
  1091. deptId: null,
  1092. remarks: null,
  1093. temporaryState: null,
  1094. sopUpdate: null
  1095. };
  1096. this.resetForm("form");
  1097. },
  1098. // 限制时间范围
  1099. pickerOptionsTraining() {
  1100. const self = this
  1101. return {
  1102. disabledDate(time){
  1103. return time.getTime() < new Date(self.form.ehsCheck).getTime()
  1104. }
  1105. }
  1106. },
  1107. pickerOptionsPssr() {
  1108. const self = this
  1109. return {
  1110. disabledDate(time){
  1111. if (self.form.training != null) {
  1112. return time.getTime() < new Date(self.form.training).getTime()
  1113. }else {
  1114. return time.getTime() < new Date(self.form.ehsCheck).getTime()
  1115. }
  1116. }
  1117. }
  1118. },
  1119. /** 搜索按钮操作 */
  1120. handleQuery() {
  1121. this.queryParams.pageNum = 1;
  1122. this.getList();
  1123. },
  1124. /** 重置按钮操作 */
  1125. resetQuery() {
  1126. this.resetForm("queryForm");
  1127. this.handleQuery();
  1128. },
  1129. // 多选框选中数据
  1130. handleSelectionChange(selection) {
  1131. this.ids = selection.map(item => item.id)
  1132. this.single = selection.length!==1
  1133. this.multiple = !selection.length
  1134. },
  1135. /** 新增按钮操作 */
  1136. handleAdd() {
  1137. this.reset();
  1138. this.open = true;
  1139. this.title = this.$t('新增') + " " + this.$t('MOC管理');
  1140. },
  1141. //实施情况Finished变更
  1142. changeTrueState(val) {
  1143. if (val == 10) {
  1144. }else {
  1145. this.$refs['form'].clearValidate();
  1146. }
  1147. },
  1148. changeChangeNature(val) {
  1149. if (val == 10) {
  1150. }else if (val = 12) {
  1151. this.$refs['form'].clearValidate();
  1152. this.form.temporaryState = "14";
  1153. this.form.overTime = "";
  1154. }
  1155. },
  1156. //根据分数显示颜色提示
  1157. tableCellClassName({ row, column, rowIndex, columnIndex }) {
  1158. if (columnIndex == 13){
  1159. return this.changeColor(row.isEhsCheck, row.ehsCheck)
  1160. }
  1161. if (columnIndex == 14){
  1162. return this.changeColor(row.isTraining, row.training)
  1163. }
  1164. if (columnIndex == 15){
  1165. return this.changeColor(row.isPssr, row.pssr)
  1166. }
  1167. },
  1168. changeColor (value, dateValue) {
  1169. if (value !== "1" && dateValue !== null){
  1170. return 'cellMoc'
  1171. }
  1172. },
  1173. /** 延期按钮操作 */
  1174. handleDelay(row, type) {
  1175. if (type == 1) { // 自动延期
  1176. if (row.sealDate == null) {
  1177. this.msgError(this.$t('未填写堵漏日期,不可执行延期操作。'));
  1178. } else {
  1179. this.$confirm(this.$t('是否确认延期?'), this.$t('警告'), {
  1180. confirmButtonText: this.$t('确定'),
  1181. cancelButtonText: this.$t('取消'),
  1182. type: "warning"
  1183. }).then(function() {
  1184. return delay({id: row.id, extention: null});
  1185. }).then(() => {
  1186. this.getList();
  1187. this.msgSuccess(this.$t('延期成功'));
  1188. })
  1189. }
  1190. } else if (type == 2) { // 手动延期
  1191. this.delayForm.id = row.id;
  1192. this.delayDialog.open = true;
  1193. this.delayDialog.title = row.mocNo.toString() + '延期操作';
  1194. }
  1195. },
  1196. /** 修改按钮操作 */
  1197. handleUpdate(row) {
  1198. this.reset();
  1199. const id = row.id || this.ids
  1200. getMoc(id).then(response => {
  1201. this.form = response.data;
  1202. this.open = true;
  1203. this.title = this.$t('修改') + this.$t('MOC管理');
  1204. });
  1205. },
  1206. /** 提交按钮 */
  1207. submitDelayForm() {
  1208. delay(this.delayForm).then(response => {
  1209. this.msgSuccess(this.$t('延期成功'));
  1210. this.delayDialog.open = false;
  1211. this.getList();
  1212. });
  1213. },
  1214. submitForm() {
  1215. this.$refs["form"].validate(valid => {
  1216. if (valid) {
  1217. if (this.form.trueState == "10") {
  1218. if (this.form.mocNo != null && this.form.plantNumber != null && this.form.category != null && this.form.significance != null && this.form.classification != null
  1219. && this.form.area != null && this.form.title != null && this.form.owner != null && this.form.approveTime != null && this.form.estimateEndtime != null
  1220. && this.form.endtime != null && this.form.changeNature != null && this.form.riskLevel != null && this.form.training != null && this.form.pssr != null) {
  1221. if (this.form.id != null) {
  1222. updateMoc(this.form).then(response => {
  1223. this.msgSuccess(this.$t('修改成功'));
  1224. this.open = false;
  1225. this.getList();
  1226. });
  1227. } else {
  1228. this.form.timeliness = 2;
  1229. this.form.tempCategory = 1;
  1230. addMoc(this.form).then(response => {
  1231. this.msgSuccess(this.$t('新增成功'));
  1232. this.open = false;
  1233. this.getList();
  1234. });
  1235. }
  1236. } else {
  1237. this.msgError(this.$t('存在必填项未填,实施情况修改Finished失败'));
  1238. }
  1239. }else {
  1240. if (this.form.id != null) {
  1241. updateMoc(this.form).then(response => {
  1242. this.msgSuccess(this.$t('修改成功'));
  1243. this.open = false;
  1244. this.getList();
  1245. });
  1246. } else {
  1247. this.form.timeliness = 2;
  1248. this.form.tempCategory = 1;
  1249. addMoc(this.form).then(response => {
  1250. this.msgSuccess(this.$t('新增成功'));
  1251. this.open = false;
  1252. this.getList();
  1253. });
  1254. }
  1255. }
  1256. }
  1257. });
  1258. },
  1259. /** 删除按钮操作 */
  1260. handleDelete(row) {
  1261. const ids = row.id || this.ids;
  1262. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1263. confirmButtonText: this.$t('确定'),
  1264. cancelButtonText: this.$t('取消'),
  1265. type: "warning"
  1266. }).then(function() {
  1267. return delMoc(ids);
  1268. }).then(() => {
  1269. this.getList();
  1270. this.msgSuccess(this.$t('删除成功'));
  1271. })
  1272. },
  1273. /** 导出按钮操作 */
  1274. handleExport() {
  1275. const queryParams = this.queryParams;
  1276. this.$confirm(this.$t('是否确认导出所有MOC管理数据项?'), this.$t('警告'), {
  1277. confirmButtonText: this.$t('确定'),
  1278. cancelButtonText: this.$t('取消'),
  1279. type: "warning"
  1280. }).then(function() {
  1281. return exportMoc(queryParams);
  1282. }).then(response => {
  1283. this.download(response.msg);
  1284. })
  1285. },
  1286. /** 导入按钮操作 */
  1287. handleImport() {
  1288. this.upload.title = this.$t('用户导入');
  1289. this.upload.open = true;
  1290. },
  1291. /** 下载模板操作 */
  1292. importTemplate() {
  1293. this.$refs['downloadFileForm'].submit()
  1294. },
  1295. // 文件上传中处理
  1296. handleFileUploadProgress(event, file, fileList) {
  1297. this.upload.isUploading = true;
  1298. },
  1299. // 文件上传成功处理
  1300. handleFileSuccess(response, file, fileList) {
  1301. this.upload.open = false;
  1302. this.upload.isUploading = false;
  1303. this.$refs.upload.clearFiles();
  1304. if (response.data[0] != null) {
  1305. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1306. }else {
  1307. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1308. }
  1309. this.getList();
  1310. },
  1311. // 提交上传文件
  1312. submitFileForm() {
  1313. this.$refs.upload.submit();
  1314. },
  1315. //数据分析
  1316. handleData(){
  1317. var now = new Date();
  1318. var year = now.getFullYear(); //得到年份
  1319. this.yearOption = [year-2 , year-1 ,year]
  1320. this.drawer = true
  1321. },
  1322. /** 报告附件按钮操作 */
  1323. handleDoc(row , fileType) {
  1324. this.doc.pType = fileType
  1325. this.doc.queryParams.pType = fileType
  1326. this.doc.id = row.id;
  1327. this.doc.title = row.title;
  1328. this.doc.open = true;
  1329. this.doc.queryParams.pId = row.id
  1330. this.doc.pId = row.id
  1331. this.getFileList()
  1332. this.$nextTick(() => {
  1333. this.$refs.doc.clearFiles()
  1334. })
  1335. },
  1336. getFileList (){
  1337. allFileList(this.doc.queryParams).then(response => {
  1338. response.forEach(element => {
  1339. element["isEdit"] = false
  1340. });
  1341. response.forEach(element => {
  1342. element["isAdd"] = false
  1343. });
  1344. this.doc.commonfileList = response;
  1345. });
  1346. },
  1347. //附件上传中处理
  1348. handleFileDocProgress(event, file, fileList) {
  1349. this.doc.file = file;
  1350. this.doc.isUploading = true;
  1351. },
  1352. //附件上传成功处理
  1353. handleFileDocSuccess(response, file, fileList) {
  1354. this.doc.isUploading = false;
  1355. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1356. this.getFileList()
  1357. },
  1358. // 文件下载处理
  1359. handleDownload(row) {
  1360. var name = row.fileName;
  1361. var url = row.fileUrl;
  1362. var suffix = url.substring(url.lastIndexOf("."), url.length);
  1363. const a = document.createElement('a')
  1364. a.setAttribute('download', name)
  1365. a.setAttribute('target', '_blank')
  1366. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  1367. a.click()
  1368. },
  1369. //pdf预览
  1370. openPdf(){
  1371. window.open(this.pdf.pdfUrl);//path是文件的全路径地址
  1372. },
  1373. handleSee (row){
  1374. this.pdf.open =true
  1375. this.pdf.title = row.fileName
  1376. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  1377. },
  1378. // 取消
  1379. cancelFile(row, index) {
  1380. // 如果是新增的数据
  1381. if (row.isAdd) {
  1382. this.doc.commonfileList.splice(index, 1)
  1383. } else {
  1384. // 不是新增的数据 还原数据
  1385. for (const i in row.oldRow) {
  1386. row[i] = row.oldRow[i]
  1387. }
  1388. row.isEdit = false
  1389. }
  1390. },
  1391. edit(row) {
  1392. // 备份原始数据
  1393. row['oldRow'] = JSON.parse(JSON.stringify(row));
  1394. this.$nextTick(() => {
  1395. row.isEdit = true;
  1396. })
  1397. },
  1398. save(row) {
  1399. row.isEdit = false;
  1400. var that = this;
  1401. that.loading = true;
  1402. this.form = row;
  1403. if (row.isAdd == true) {
  1404. addCommonfile(this.form).then(response => {
  1405. this.msgSuccess(this.$t('新增成功'));
  1406. this.open = false;
  1407. this.getList();
  1408. });
  1409. }else {
  1410. updateCommonfile(this.form).then(response => {
  1411. this.msgSuccess(this.$t('修改成功'));
  1412. this.open = false;
  1413. this.getList();
  1414. });
  1415. }
  1416. },
  1417. /** 删除按钮操作 */
  1418. handleDeleteDoc(row) {
  1419. const ids = row.id || this.ids;
  1420. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1421. confirmButtonText: this.$t('确定'),
  1422. cancelButtonText: this.$t('取消'),
  1423. type: "warning"
  1424. }).then(function() {
  1425. return delCommonfile(ids);
  1426. }).then(() => {
  1427. this.getFileList()
  1428. this.msgSuccess(this.$t('删除成功'));
  1429. })
  1430. },
  1431. }
  1432. };
  1433. </script>
  1434. <style>
  1435. .colorMark {
  1436. color: #6f6f6f;
  1437. text-align: right;
  1438. font-weight:bold;
  1439. font-size: 13px;
  1440. padding-bottom: 5px;
  1441. }
  1442. .rectangleLightgreen {
  1443. width: 40px !important;
  1444. height: 20px !important;
  1445. }
  1446. .rectangleFlesh {
  1447. width: 40px !important;
  1448. height: 20px !important;
  1449. }
  1450. .rectangleYellow {
  1451. width: 40px !important;
  1452. height: 20px !important;
  1453. }
  1454. #sealDate:hover{
  1455. cursor: pointer;
  1456. }
  1457. #materialType:hover{
  1458. cursor: pointer;
  1459. }
  1460. #leakLocation:hover{
  1461. cursor: pointer;
  1462. }
  1463. #department:hover{
  1464. cursor: pointer;
  1465. }
  1466. #status:hover{
  1467. cursor: pointer;
  1468. }
  1469. #moc-type:hover{
  1470. cursor: pointer;
  1471. }
  1472. .text {
  1473. font-size: 14px;
  1474. }
  1475. .item {
  1476. margin-bottom: 18px;
  1477. }
  1478. .clearfix {
  1479. color: #1e1e1e;
  1480. }
  1481. .clearfix:before,
  1482. .clearfix:after {
  1483. display: table;
  1484. content: "";
  1485. }
  1486. .clearfix:after {
  1487. clear: both
  1488. }
  1489. .box-card {
  1490. width: 100%;
  1491. }
  1492. .el-drawer__body {
  1493. overflow: auto;
  1494. }
  1495. .el-drawer__container ::-webkit-scrollbar {
  1496. display: none;
  1497. }
  1498. </style>