index.vue 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095
  1. <template>
  2. <div class="app-container">
  3. <!-- 搜索条件 -->
  4. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
  5. <el-form-item label="SAI类型" prop="saiType">
  6. <el-form-item prop="saiType">
  7. <el-select
  8. clearable
  9. v-model="queryParams.saiType"
  10. placeholder="请选择SAI类型">
  11. <el-option key="SAI" label="SAI" value="SAI"></el-option>
  12. <el-option key="TPM" label="TPM" value="TPM"></el-option>
  13. </el-select>
  14. </el-form-item>
  15. </el-form-item>
  16. <el-form-item label="TPM状态" prop="tpmStatus">
  17. <el-select
  18. v-model="queryParams.tpmStatus"
  19. placeholder="请选择TPM状态">
  20. <el-option key="未完成" label="未完成" value="未完成"></el-option>
  21. <el-option key="已完成" label="已完成" value="已完成"></el-option>
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="登记人部门" prop="applicantDept">
  25. <el-form-item prop="applicantDept">
  26. <el-select
  27. clearable
  28. v-model="queryParams.applicantDept"
  29. placeholder="请选择部门">
  30. <el-option
  31. v-for="dict in applicantDeptOptions"
  32. :key="dict.dictValue"
  33. :label="dict.dictLabel"
  34. :value="dict.dictValue"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. </el-form-item>
  39. <el-form-item label="登记人班组" prop="applicantTeam">
  40. <el-form-item prop="applicantTeam">
  41. <el-select
  42. clearable
  43. v-model="queryParams.applicantTeam"
  44. placeholder="请选择班组">
  45. <el-option
  46. v-for="dict in applicantTeamOptions"
  47. :key="dict.dictValue"
  48. :label="dict.dictLabel"
  49. :value="dict.dictValue"
  50. ></el-option>
  51. </el-select>
  52. </el-form-item>
  53. </el-form-item>
  54. <el-form-item label="不安全状态" prop="unsafeStatus">
  55. <el-select v-model="queryParams.unsafeStatus" placeholder="请选择不安全状态" clearable>
  56. <el-option
  57. v-for="dict in unsafeStatusOptions"
  58. :key="dict.dictValue"
  59. :label="dict.dictLabel"
  60. :value="dict.dictValue"
  61. ></el-option>
  62. </el-select>
  63. </el-form-item>
  64. <el-form-item label="不安全行为" prop="unsafeAction">
  65. <el-select v-model="queryParams.unsafeAction" placeholder="请选择不安全行为" clearable>
  66. <el-option
  67. v-for="dict in unsafeActionOptions"
  68. :key="dict.dictValue"
  69. :label="dict.dictLabel"
  70. :value="dict.dictValue"
  71. ></el-option>
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item label="申请状态" prop="applyStatus">
  75. <el-select v-model="applyStatusString" placeholder="请选择申请状态" multiple>
  76. <el-option
  77. v-for="dict in applyStatusOptions"
  78. :key="dict.dictValue"
  79. :label="dict.dictLabel"
  80. :value="dict.dictValue"
  81. ></el-option>
  82. </el-select>
  83. </el-form-item>
  84. <el-form-item label="问题描述" prop="description">
  85. <el-input
  86. v-model="queryParams.description"
  87. placeholder="请输入问题描述"
  88. clearable
  89. size="small"
  90. />
  91. </el-form-item>
  92. <el-form-item label="登记时间" prop="applyDate">
  93. <el-date-picker
  94. v-model="applyDateRange"
  95. type="daterange"
  96. align="right"
  97. unlink-panels
  98. :range-separator="$t('至')"
  99. :start-placeholder="$t('开始日期')"
  100. :end-placeholder="$t('结束日期')"
  101. value-format="yyyy-MM-dd">
  102. </el-date-picker>
  103. </el-form-item>
  104. <el-form-item label="预计完成时间" prop="estimateFinishDate">
  105. <el-date-picker
  106. v-model="estimateFinishDateRange"
  107. type="daterange"
  108. align="right"
  109. unlink-panels
  110. :range-separator="$t('至')"
  111. :start-placeholder="$t('开始日期')"
  112. :end-placeholder="$t('结束日期')"
  113. value-format="yyyy-MM-dd">
  114. </el-date-picker>
  115. </el-form-item>
  116. <el-form-item prop="workArea" label="片区">
  117. <el-select
  118. clearable
  119. multiple
  120. v-model="queryParams.workArea"
  121. placeholder="请选择片区">
  122. <el-option key="EOEG" label="EOEG" value="EOEG"></el-option>
  123. <el-option key="NIS" label="NIS" value="NIS"></el-option>
  124. </el-select>
  125. </el-form-item>
  126. <el-form-item>
  127. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  128. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  129. </el-form-item>
  130. </el-form>
  131. <!-- 操作按钮 -->
  132. <el-row :gutter="10" class="mb8" style="margin-bottom: 0px;">
  133. <el-col :span="1.5">
  134. <el-button
  135. type="primary"
  136. icon="el-icon-plus"
  137. size="mini"
  138. @click="handleAdd"
  139. v-hasPermi="['production:eoegapply:add']"
  140. >新增</el-button>
  141. </el-col>
  142. <el-col :span="1.5">
  143. <el-button
  144. type="warning"
  145. icon="el-icon-download"
  146. size="mini"
  147. @click="handleExport"
  148. v-hasPermi="['production:eoegapply:export']"
  149. >导出全部</el-button>
  150. </el-col>
  151. <el-col :span="1.5">
  152. <el-button
  153. type="warning"
  154. icon="el-icon-download"
  155. size="mini"
  156. @click="handleExportSelected"
  157. v-hasPermi="['production:eoegapply:export']"
  158. >导出选中数据</el-button>
  159. </el-col>
  160. <el-col :span="1.5">
  161. <el-button
  162. size="mini"
  163. @click="handleAddSai"
  164. v-hasPermi="['production:sai:add']"
  165. >统计至SAI检查台账</el-button>
  166. </el-col>
  167. <el-col :span="1.5">
  168. <el-button
  169. size="mini"
  170. @click="handleAnalysis"
  171. v-hasPermi="['production:sai:list']"
  172. >趋势分析</el-button>
  173. </el-col>
  174. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  175. </el-row>
  176. <!-- 各班组当年至今的提交数量 -->
  177. <el-descriptions title="" direction="vertical" :column="4" border style="margin-bottom: 20px;">
  178. <el-descriptions-item label="A班">
  179. <el-tag size="small">{{countA}}</el-tag>
  180. </el-descriptions-item>
  181. <el-descriptions-item label="B班">
  182. <el-tag size="small">{{countB}}</el-tag>
  183. </el-descriptions-item>
  184. <el-descriptions-item label="C班">
  185. <el-tag size="small">{{countC}}</el-tag>
  186. </el-descriptions-item>
  187. <el-descriptions-item label="D班">
  188. <el-tag size="small">{{countD}}</el-tag>
  189. </el-descriptions-item>
  190. </el-descriptions>
  191. <!-- 总表 -->
  192. <el-table v-loading="loading" :data="applyList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  193. <el-table-column type="selection" width="55" align="center" />
  194. <el-table-column label="SAI类型" align="center" prop="saiType" :show-overflow-tooltip="true" width="80"/>
  195. <el-table-column label="TPM状态" align="center" prop="tpmStatus" :show-overflow-tooltip="true" width="80">
  196. <template slot-scope="scope">
  197. <span v-if="scope.row.saiType=='TPM'">
  198. <span v-if="scope.row.tpmStatus == '已完成'"><el-tag type="success">已完成</el-tag></span>
  199. <span v-if="scope.row.tpmStatus == '未完成'"><el-tag type="info">未完成</el-tag></span>
  200. </span>
  201. <span v-if="scope.row.saiType=='SAI'">/</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="问题描述" align="center" prop="description" :show-overflow-tooltip="true" width="200"/>
  205. <el-table-column label="片区" align="center" prop="workArea" :show-overflow-tooltip="true">
  206. <template slot-scope="scope">
  207. <span v-if="scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成'">/</span>
  208. <span v-if="!(scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成')">{{scope.row.workArea}}</span>
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="申请状态" align="center" prop="applyStatus" :show-overflow-tooltip="true">
  212. <template slot-scope="scope">
  213. <span v-if="scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成'">/</span>
  214. <span v-if="!(scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成')">
  215. <span v-if="scope.row.applyStatus == 0"><el-tag type="info">未提交</el-tag></span>
  216. <span v-if="scope.row.applyStatus == 1"><el-tag type="warning">待评估</el-tag></span>
  217. <span v-if="scope.row.applyStatus == 2"><el-tag type="warning">进行中</el-tag></span>
  218. <span v-if="scope.row.applyStatus == 3"><el-tag type="warning">待验收</el-tag></span>
  219. <span v-if="scope.row.applyStatus == 4"><el-tag type="success">已完成</el-tag></span>
  220. <span v-if="scope.row.applyStatus == 5"><el-tag type="info">已取消</el-tag></span>
  221. </span>
  222. </template>
  223. </el-table-column>
  224. <el-table-column label="登记人部门" align="center" prop="applicantDeptName" :show-overflow-tooltip="true"/>
  225. <el-table-column label="登记人班组" align="center" prop="applicantTeam" :show-overflow-tooltip="true" :formatter="teamFormat"/>
  226. <el-table-column label="登记人" align="center" prop="applicantName" :show-overflow-tooltip="true"/>
  227. <el-table-column label="当前处理人" align="center" prop="handlerName" :show-overflow-tooltip="true"/>
  228. <el-table-column label="整改负责人" align="center" prop="executorName" :show-overflow-tooltip="true">
  229. <template slot-scope="scope">
  230. <span v-if="scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成'">/</span>
  231. <span v-if="!(scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成')">{{scope.row.executorName}}</span>
  232. </template>
  233. </el-table-column>
  234. <el-table-column label="登记时间" align="center" prop="applyDate" width="100" sortable>
  235. <template slot-scope="scope">
  236. <span>{{ parseTime(scope.row.applyDate, '{y}-{m}-{d}') }}</span>
  237. </template>
  238. </el-table-column>
  239. <el-table-column label="预计完成时间" align="center" prop="estimateFinishDate" width="100" sortable>
  240. <template slot-scope="scope">
  241. <span v-if="scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成'">/</span>
  242. <span v-if="!(scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成')">{{ parseTime(scope.row.estimateFinishDate, '{y}-{m}-{d}') }}</span>
  243. </template>
  244. </el-table-column>
  245. <el-table-column label="实际完成时间" align="center" prop="actualFinishDate" width="100">
  246. <template slot-scope="scope">
  247. <span v-if="scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成'">/</span>
  248. <span v-if="!(scope.row.saiType=='TPM' && scope.row.tpmStatus == '已完成')">{{ parseTime(scope.row.actualFinishDate, '{y}-{m}-{d}') }}</span>
  249. </template>
  250. </el-table-column>
  251. <el-table-column label="SAI级别" align="center" prop="saiLevel" :show-overflow-tooltip="true">
  252. <template slot-scope="scope">
  253. <span v-if="scope.row.saiType=='TPM'">/</span>
  254. <span v-if="scope.row.saiType=='SAI'">{{scope.row.saiLevel}}</span>
  255. </template>
  256. </el-table-column>
  257. <el-table-column label="SAI类别" align="center" prop="category" :show-overflow-tooltip="true" :formatter="saiCategoryFormat"/>
  258. <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  259. <template slot-scope="scope">
  260. <!-- 申请状态为待评估/进行中/待验收 -->
  261. <!-- 当前登录用户为处理人(之一) -->
  262. <el-button
  263. size="mini"
  264. type="text"
  265. @click="handleDetail(scope.row)"
  266. icon="el-icon-edit-outline"
  267. v-if="(scope.row.applyStatus == 1 || scope.row.applyStatus == 2 || scope.row.applyStatus == 3)
  268. && ((scope.row.handler.indexOf(loginStaffInfo.userId) != -1))"
  269. >处理</el-button>
  270. <!-- 申请状态为已完成/已中止-->
  271. <el-button
  272. size="mini"
  273. type="text"
  274. icon="el-icon-view"
  275. @click="handleDetail(scope.row)"
  276. v-if="scope.row.applyStatus == 4 || scope.row.applyStatus == 5"
  277. >详情</el-button>
  278. <el-button
  279. size="mini"
  280. type="text"
  281. @click="processImg(scope.row.processId)"
  282. v-if="scope.row.applyStatus != 0 && (scope.row.saiType=='SAI' || (scope.row.saiType=='TPM' && scope.row.tpmStatus == '未完成'))"
  283. >{{ $t('流程图') }}</el-button>
  284. <!--<el-button-->
  285. <!--size="mini"-->
  286. <!--type="text"-->
  287. <!--icon="el-icon-edit"-->
  288. <!--@click="handleUpdate(scope.row)"-->
  289. <!--v-hasPermi="['production:eoegapply:edit']"-->
  290. <!--&gt;修改</el-button>-->
  291. <!--<el-button-->
  292. <!--size="mini"-->
  293. <!--type="text"-->
  294. <!--icon="el-icon-delete"-->
  295. <!--@click="handleDelete(scope.row)"-->
  296. <!--v-hasPermi="['production:eoegapply:remove']"-->
  297. <!--&gt;删除</el-button>-->
  298. </template>
  299. </el-table-column>
  300. </el-table>
  301. <!-- 分页 -->
  302. <pagination
  303. v-show="total>0"
  304. :total="total"
  305. :page.sync="queryParams.pageNum"
  306. :limit.sync="queryParams.pageSize"
  307. @pagination="getList"
  308. />
  309. <!-- 添加或修改SAI开项管理对话框 -->
  310. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="60%" append-to-body>
  311. <el-form ref="form" :model="form" :rules="rules" label-width="0px">
  312. <el-descriptions title="" :column="3" border>
  313. <el-descriptions-item label="SAI类型" :span="1">
  314. <el-form-item prop="saiType">
  315. <el-select
  316. v-model="form.saiType"
  317. placeholder="请选择SAI类型">
  318. <el-option key="SAI" label="SAI" value="SAI"></el-option>
  319. <el-option key="TPM" label="TPM" value="TPM"></el-option>
  320. </el-select>
  321. </el-form-item>
  322. </el-descriptions-item>
  323. <el-descriptions-item label="TPM状态" :span="2" v-if="form.saiType == 'TPM'">
  324. <el-form-item prop="tpmStatus">
  325. <el-select
  326. v-model="form.tpmStatus"
  327. placeholder="请选择TPM状态">
  328. <el-option key="未完成" label="未完成" value="未完成"></el-option>
  329. <el-option key="已完成" label="已完成" value="已完成"></el-option>
  330. </el-select>
  331. </el-form-item>
  332. </el-descriptions-item>
  333. <el-descriptions-item label="登记人部门">
  334. <el-form-item prop="applicantDept">
  335. <el-select
  336. filterable
  337. clearable
  338. v-model="form.applicantDept"
  339. @change="handleDeptOrTeamChange"
  340. placeholder="请选择部门">
  341. <el-option
  342. v-for="dict in applicantDeptOptions"
  343. :key="dict.dictValue"
  344. :label="dict.dictLabel"
  345. :value="dict.dictValue"
  346. ></el-option>
  347. </el-select>
  348. </el-form-item>
  349. </el-descriptions-item>
  350. <el-descriptions-item label="登记人班组">
  351. <el-form-item prop="applicantTeam">
  352. <el-select
  353. filterable
  354. clearable
  355. v-model="form.applicantTeam"
  356. @change="handleDeptOrTeamChange"
  357. :disabled="applicantTeamDisabled"
  358. placeholder="请选择班组">
  359. <el-option
  360. v-for="dict in applicantTeamOptions"
  361. :key="dict.dictValue"
  362. :label="dict.dictLabel"
  363. :value="dict.dictValue"
  364. ></el-option>
  365. </el-select>
  366. </el-form-item>
  367. </el-descriptions-item>
  368. <el-descriptions-item label="登记人">
  369. <el-form-item prop="applicant">
  370. <el-select
  371. filterable
  372. clearable
  373. v-model="form.applicant"
  374. placeholder="请选择登记人">
  375. <el-option
  376. v-for="dict in applicantOptions"
  377. :key="dict.dictValue"
  378. :label="dict.dictLabel"
  379. :value="dict.dictValue"
  380. ></el-option>
  381. </el-select>
  382. </el-form-item>
  383. </el-descriptions-item>
  384. <el-descriptions-item label="问题描述" :span="3">
  385. <el-form-item prop="description">
  386. <el-input v-model="form.description" placeholder="请输入问题描述" type="textarea" :rows="3" />
  387. </el-form-item>
  388. </el-descriptions-item>
  389. <el-descriptions-item label="采取的措施" :span="3">
  390. <el-form-item prop="reaction">
  391. <el-input v-model="form.reaction" placeholder="请输入采取的措施" type="textarea" :rows="3"/>
  392. </el-form-item>
  393. </el-descriptions-item>
  394. <el-descriptions-item label="SAI级别" :span="1" v-if="form.saiType == 'SAI'">
  395. <el-form-item prop="saiLevel">
  396. <el-select v-model="form.saiLevel" placeholder="请选择SAI级别" @change="handleSaiLevelChange">
  397. <el-option key="1" label="1" value="1"></el-option>
  398. <el-option key="2" label="2" value="2"></el-option>
  399. <el-option key="3" label="3" value="3"></el-option>
  400. </el-select>
  401. <span @click="saiTypeInfo = true" style="padding-left: 5px; cursor: pointer;">
  402. <i class="el-icon-question"></i>
  403. </span>
  404. </el-form-item>
  405. </el-descriptions-item>
  406. <el-descriptions-item label="SAI类别" :span="2" v-if="form.saiType == 'SAI'">
  407. <el-form-item prop="category">
  408. <el-select
  409. @change="handleSaiCategoryChange"
  410. filterable
  411. clearable
  412. v-model="form.category"
  413. placeholder="请选择SAI类别">
  414. <el-option
  415. v-for="dict in saiCategoryOptions2"
  416. :key="dict.dictValue"
  417. :label="dict.dictLabel"
  418. :value="dict.dictValue"
  419. ></el-option>
  420. </el-select>
  421. </el-form-item>
  422. </el-descriptions-item>
  423. <el-descriptions-item label="片区" :span="1" v-if="form.saiType == 'SAI' || (form.saiType == 'TPM' && form.tpmStatus == '未完成')">
  424. <el-form-item prop="workArea">
  425. <el-select
  426. @change="handleSaiCategoryChange"
  427. filterable
  428. clearable
  429. v-model="form.workArea"
  430. placeholder="请选择片区">
  431. <el-option key="EOEG" label="EOEG" value="EOEG"></el-option>
  432. <el-option key="NIS" label="NIS" value="NIS"></el-option>
  433. </el-select>
  434. </el-form-item>
  435. </el-descriptions-item>
  436. <el-descriptions-item label="整改负责人" :span="2" v-if="form.saiType == 'SAI' || (form.saiType == 'TPM' && form.tpmStatus == '未完成')">
  437. <el-form-item prop="executor">
  438. <el-select
  439. filterable
  440. :disabled="assessDisabled"
  441. clearable
  442. v-model="form.executor"
  443. placeholder="请选择整改负责人">
  444. <el-option
  445. v-for="dict in applicantOptions"
  446. :key="dict.dictValue"
  447. :label="dict.dictLabel"
  448. :value="dict.dictValue"
  449. ></el-option>
  450. </el-select>
  451. </el-form-item>
  452. </el-descriptions-item>
  453. <el-descriptions-item label="隐患" :span="3" v-if="form.saiType == 'SAI'">
  454. <el-radio v-model="unsafeChoice" label="1" @change="handleUnsafeChoiceChange" style="margin-right: 10px;">不安全状态</el-radio>
  455. <el-form-item prop="unsafeStatus" style="display: inline-block;">
  456. <el-select v-model="form.unsafeStatus" filterable placeholder="请选择不安全状态" :disabled="unsafeStatusDisabled" style="margin-right: 20px;" clearable>
  457. <el-option
  458. v-for="dict in unsafeStatusOptions"
  459. :key="dict.dictValue"
  460. :label="dict.dictLabel"
  461. :value="dict.dictValue"
  462. ></el-option>
  463. </el-select>
  464. </el-form-item>
  465. <el-radio v-model="unsafeChoice" label="2" @change="handleUnsafeChoiceChange" style="margin-right: 10px;">不安全行为</el-radio>
  466. <el-form-item prop="unsafeAction" style="display: inline-block;">
  467. <el-select v-model="form.unsafeAction" filterable placeholder="请选择不安全行为" :disabled="unsafeActionDisabled" clearable>
  468. <el-option
  469. v-for="dict in unsafeActionOptions"
  470. :key="dict.dictValue"
  471. :label="dict.dictLabel"
  472. :value="dict.dictValue"
  473. ></el-option>
  474. </el-select>
  475. </el-form-item>
  476. </el-descriptions-item>
  477. <el-descriptions-item label="附件" :span="3">
  478. <el-form-item label="" prop="fileUrl">
  479. <el-upload
  480. ref="doc"
  481. :limit="5"
  482. :headers="doc.headers"
  483. :action="doc.url"
  484. :disabled="doc.isUploading"
  485. :on-progress="handleFileDocProgress"
  486. :on-success="handleFileDocSuccess"
  487. :on-remove="handleRemove"
  488. :auto-upload="true"
  489. :file-list="fileList"
  490. drag
  491. >
  492. <i class="el-icon-upload"></i>
  493. <div class="el-upload__text">
  494. {{ $t('将文件拖到此处,或') }}
  495. <em>{{ $t('点击上传') }}</em>
  496. </div>
  497. </el-upload>
  498. </el-form-item>
  499. <el-table :data="doc.commonfileListApply" border v-if="form.saiApplyId">
  500. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  501. <template slot-scope="scope">
  502. <a class="link-type" @click="handleDownload(scope.row)">
  503. <span>{{ scope.row.fileName }}</span>
  504. </a>
  505. </template>
  506. </el-table-column>
  507. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  508. <template slot-scope="scope">
  509. <el-button
  510. v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
  511. ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
  512. ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
  513. ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
  514. ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
  515. ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
  516. size="mini"
  517. type="text"
  518. icon="el-icon-view"
  519. @click="handleSee(scope.row)"
  520. > {{ $t('预览') }}</el-button>
  521. <el-button
  522. v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
  523. size="mini"
  524. type="text"
  525. icon="el-icon-view"
  526. @click="handleSeePPT(scope.row)"
  527. > {{ $t('ppt预览') }}</el-button>
  528. <el-button
  529. size="mini"
  530. type="text"
  531. icon="el-icon-download"
  532. @click="handleDownload(scope.row)"
  533. >{{ $t('下载') }}</el-button>
  534. </template>
  535. </el-table-column>
  536. </el-table>
  537. </el-descriptions-item>
  538. <el-descriptions-item label="登记时间">
  539. <el-form-item prop="applyDate">
  540. <el-date-picker
  541. size="small"
  542. style="width: 200px"
  543. v-model="form.applyDate"
  544. type="date"
  545. value-format="yyyy-MM-dd"
  546. placeholder="选择登记时间">
  547. </el-date-picker>
  548. </el-form-item>
  549. </el-descriptions-item>
  550. </el-descriptions>
  551. </el-form>
  552. <div slot="footer" class="dialog-footer">
  553. <el-button v-if="form.saiType == 'TPM' && form.tpmStatus == '已完成'" type="primary" @click="submitForm">保 存 TPM</el-button>
  554. <el-button v-if="form.saiType == 'TPM' && form.tpmStatus == '未完成'" type="primary" @click="handleSaveAndSubmit">提 交 TPM</el-button>
  555. <el-button v-if="form.saiType == 'SAI'" type="primary" @click="handleSaveAndSubmit" :disabled="submitDisabled">提 交 SAI</el-button>
  556. <el-button v-if="form.saiType == 'SAI'" @click="submitForm" :disabled="submitDisabled">保 存 SAI</el-button>
  557. <el-button @click="cancel">取 消</el-button>
  558. </div>
  559. </el-dialog>
  560. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open2" width="60%" append-to-body>
  561. <el-form ref="form" :model="form" :rules="rules" label-width="0px">
  562. <el-descriptions title="" :column="3" border>
  563. <el-descriptions-item label="SAI级别" :span="1">
  564. <el-form-item prop="saiLevel">
  565. <el-select v-model="form.saiLevel" placeholder="请选择SAI级别" @change="handleSaiLevelChange">
  566. <el-option key="1" label="1" value="1"></el-option>
  567. <el-option key="2" label="2" value="2"></el-option>
  568. <el-option key="3" label="3" value="3"></el-option>
  569. </el-select>
  570. </el-form-item>
  571. </el-descriptions-item>
  572. <el-descriptions-item label="SAI类别" :span="1">
  573. <el-form-item prop="category">
  574. <el-select
  575. @change="handleSaiCategoryChange"
  576. filterable
  577. clearable
  578. v-model="form.category"
  579. placeholder="请选择SAI类别">
  580. <el-option
  581. v-for="dict in saiCategoryOptions2"
  582. :key="dict.dictValue"
  583. :label="dict.dictLabel"
  584. :value="dict.dictValue"
  585. ></el-option>
  586. </el-select>
  587. </el-form-item>
  588. </el-descriptions-item>
  589. </el-descriptions>
  590. </el-form>
  591. <div slot="footer" class="dialog-footer">
  592. <el-button @click="submitForm">保 存</el-button>
  593. <el-button @click="cancel">取 消</el-button>
  594. </div>
  595. </el-dialog>
  596. <!-- 延期对话框 -->
  597. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="delayOpen" width="25%" append-to-body>
  598. <el-form ref="delayForm" :model="delayForm" :rules="delayRules" label-width="136px">
  599. <el-form-item prop="estimateFinishDate" label="预计完成时间">
  600. <el-date-picker
  601. clearable
  602. size="small"
  603. style="width: 200px"
  604. v-model="delayForm.estimateFinishDate"
  605. type="date"
  606. value-format="yyyy-MM-dd"
  607. placeholder="选择预计完成时间">
  608. </el-date-picker>
  609. </el-form-item>
  610. <el-form-item prop="isRecorded" label="是否录入开项系统">
  611. <el-radio v-model="delayForm.isRecorded" label="1" @change="handleIsRecordedChange">是</el-radio>
  612. <el-radio v-model="delayForm.isRecorded" label="0" @change="handleIsRecordedChange">否</el-radio>
  613. </el-form-item>
  614. <el-form-item prop="recordNo" label="开项编号">
  615. <el-input v-model="delayForm.recordNo" placeholder="请输入开项编号" :disabled="recordNoDisabled"/>
  616. </el-form-item>
  617. </el-form>
  618. <div slot="footer" class="dialog-footer">
  619. <el-button type="primary" @click="submitDelayForm">确 定</el-button>
  620. <el-button @click="cancel">取 消</el-button>
  621. </div>
  622. </el-dialog>
  623. <!-- 用户导入对话框 -->
  624. <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  625. <el-upload
  626. ref="upload"
  627. :limit="1"
  628. accept=".xlsx, .xls"
  629. :headers="upload.headers"
  630. :action="upload.url"
  631. :disabled="upload.isUploading"
  632. :on-progress="handleFileUploadProgress"
  633. :on-success="handleFileSuccess"
  634. :auto-upload="false"
  635. drag
  636. >
  637. <i class="el-icon-upload"></i>
  638. <div class="el-upload__text">
  639. 将文件拖到此处,或
  640. <em>点击上传</em>
  641. </div>
  642. <div class="el-upload__tip" slot="tip">
  643. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  644. </div>
  645. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  646. <input name="type" :value="upload.type" hidden />
  647. </form>
  648. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  649. </el-upload>
  650. <div slot="footer" class="dialog-footer">
  651. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  652. <el-button @click="upload.open = false">取 消</el-button>
  653. </div>
  654. </el-dialog>
  655. <!-- SAI开项管理流转详情对话框 -->
  656. <sai-apply-detail v-if="saiApplyVisible" ref="saiApplyDetail" @refreshDataList="getList"></sai-apply-detail>
  657. <!-- 流程图对话框 -->
  658. <process-img v-if="processImgVisible" ref="processImg" @refreshDataList="getList"></process-img>
  659. <!-- 附件对话框 -->
  660. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px" append-to-body>
  661. <el-upload
  662. ref="doc"
  663. :limit="50"
  664. :headers="doc.headers"
  665. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  666. :disabled="doc.isUploading"
  667. :on-progress="handleFileDocProgress"
  668. :on-success="handleFileDocSuccess"
  669. :auto-upload="true"
  670. drag
  671. >
  672. <i class="el-icon-upload"></i>
  673. <div class="el-upload__text">
  674. {{ $t('将文件拖到此处,或') }}
  675. <em>{{ $t('点击上传') }}</em>
  676. </div>
  677. </el-upload>
  678. <el-table :data="doc.commonfileList" border>
  679. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  680. <template slot-scope="scope">
  681. <a class="link-type" @click="handleDownload(scope.row)">
  682. <span>{{ scope.row.fileName }}</span>
  683. </a>
  684. </template>
  685. </el-table-column>
  686. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  687. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  688. <el-table-column :label="$t('上传时间')" align="center" prop="createdate" :show-overflow-tooltip="true" width="120"/>
  689. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  690. <template slot-scope="scope">
  691. <el-button
  692. v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
  693. ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
  694. ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
  695. ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
  696. ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
  697. ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
  698. size="mini"
  699. type="text"
  700. icon="el-icon-view"
  701. @click="handleSee(scope.row)"
  702. > {{ $t('预览') }}</el-button>
  703. <el-button
  704. v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
  705. size="mini"
  706. type="text"
  707. icon="el-icon-view"
  708. @click="handleSeePPT(scope.row)"
  709. > {{ $t('ppt预览') }}</el-button>
  710. <el-button
  711. size="mini"
  712. type="text"
  713. icon="el-icon-download"
  714. @click="handleDownload(scope.row)"
  715. >{{ $t('下载') }}</el-button>
  716. <el-button
  717. size="mini"
  718. type="text"
  719. icon="el-icon-delete"
  720. @click="handleDeleteDoc(scope.row)"
  721. >{{ $t('删除') }}</el-button>
  722. </template>
  723. </el-table-column>
  724. </el-table>
  725. <div slot="footer" class="dialog-footer">
  726. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  727. </div>
  728. </el-dialog>
  729. <!-- 统计至SAI检查台账对话框 -->
  730. <el-dialog :close-on-click-modal="false" title="统计至SAI检查台账" :visible.sync="saiOpen" width="80%" append-to-body>
  731. <el-table v-loading="loading" :data="saiList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  732. <el-table-column type="selection" width="55" align="center" />
  733. <el-table-column label="检查的装置/设施" align="center" prop="plantId" :show-overflow-tooltip="true"/>
  734. <el-table-column label="检查日期/时间" align="center" prop="inspectionDate">
  735. <template slot-scope="scope">
  736. <span>{{ parseTime(scope.row.inspectionDate, '{y}-{m}-{d}') }}</span>
  737. </template>
  738. </el-table-column>
  739. <el-table-column label="识别出的安全问题" align="center" prop="dificiency" :show-overflow-tooltip="true"/>
  740. <el-table-column label="SAI级别" align="center" prop="saiLevel" :show-overflow-tooltip="true" width="100">
  741. <template slot-scope="scope">
  742. <el-select v-model="scope.row.saiLevel" placeholder="请选择">
  743. <el-option key="1" label="1" value="1"></el-option>
  744. <el-option key="2" label="2" value="2"></el-option>
  745. <el-option key="3" label="3" value="3"></el-option>
  746. </el-select>
  747. </template>
  748. </el-table-column>
  749. <el-table-column label="SAI类别" align="center" prop="category" :show-overflow-tooltip="true">
  750. <template slot-scope="scope">
  751. <el-select
  752. filterable
  753. clearable
  754. v-model="scope.row.category"
  755. placeholder="请选择SAI类别">
  756. <el-option
  757. v-for="dict in saiCategoryOptions2"
  758. :key="dict.dictValue"
  759. :label="dict.dictLabel"
  760. :value="dict.dictValue"
  761. ></el-option>
  762. </el-select>
  763. </template>
  764. </el-table-column>
  765. <el-table-column label="采取或要采取的措施" align="center" prop="actions" :show-overflow-tooltip="true"/>
  766. <el-table-column label="用户" align="center" prop="userDeptId" :show-overflow-tooltip="true"/>
  767. <el-table-column label="数据来源" align="center" prop="source" :show-overflow-tooltip="true"/>
  768. <el-table-column label="检查人" align="center" prop="applicantName" :show-overflow-tooltip="true"/>
  769. </el-table>
  770. <div slot="footer" class="dialog-footer">
  771. <el-button type="primary" @click="submitSaiForm">确 定</el-button>
  772. <el-button @click="cancel">取 消</el-button>
  773. </div>
  774. </el-dialog>
  775. <!-- 预览对话框 -->
  776. <el-dialog :close-on-click-modal="false" v-loading="loadingFlash" element-loading-background="rgba(0,0,0,0.2)" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" :center="true" append-to-body>
  777. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  778. <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
  779. <div style="margin-top: -30px" >
  780. <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px" v-if="ppt"></iframe>
  781. </div>
  782. <div style="padding: 30px; width: 100%; height: 100%;" >
  783. <el-carousel class="" ref="carousel" arrow="always" v-if="pptView"
  784. height="700px" trigger="click" :autoplay="false" indicator-position="outside">
  785. <el-carousel-item class="lun_img" v-for="item in imgs" v-bind:key="item" >
  786. <img :src="item" width="100%" height="100%" object-fit="cover" />
  787. </el-carousel-item>
  788. </el-carousel>
  789. </div>
  790. </el-dialog>
  791. <!-- 趋势分析对话框 -->
  792. <el-dialog :close-on-click-modal="false" @close="disposeChart" title="趋势分析" :visible.sync="analysisOpen" width="80%" append-to-body>
  793. <el-row>
  794. <el-col :span="12">
  795. <h3 style="text-align: center; margin-bottom: 15px;">四个班组当年提交的SAI数量</h3>
  796. <div id="chart1" style="width:100%; height: 400px; display: inline-block;"></div>
  797. </el-col>
  798. <el-col :span="12">
  799. <h3 style="text-align: center; margin-bottom: 15px;">个人提交数量数据分析图</h3>
  800. <div id="chart2" style="width:100%; height: 400px; display: inline-block;"></div>
  801. </el-col>
  802. </el-row>
  803. <el-row>
  804. <el-col :span="12" style="padding-left: 20px; padding-right: 20px;">
  805. <h3 style="text-align: center; margin-bottom: 15px;">各班组当年至今的提交数量</h3>
  806. <el-table
  807. :data="tableList1"
  808. style="width: 100%"
  809. border>
  810. <el-table-column
  811. prop="name"
  812. label="班组">
  813. </el-table-column>
  814. <el-table-column
  815. prop="value"
  816. label="提交数量">
  817. </el-table-column>
  818. </el-table>
  819. </el-col>
  820. <el-col :span="12" style="padding-left: 20px; padding-right: 20px;">
  821. <h3 style="text-align: center; margin-bottom: 15px;">个人提交排名前六的人名和提交数</h3>
  822. <el-table
  823. :data="tableList2"
  824. style="width: 100%"
  825. border>
  826. <el-table-column
  827. prop="index"
  828. label="排名">
  829. </el-table-column>
  830. <el-table-column
  831. prop="name"
  832. label="人名">
  833. </el-table-column>
  834. <el-table-column
  835. prop="value"
  836. label="提交数">
  837. </el-table-column>
  838. </el-table>
  839. </el-col>
  840. </el-row>
  841. </el-dialog>
  842. <!-- SAI类型说明对话框 -->
  843. <el-dialog :close-on-click-modal="false" title="SAI类型说明" :visible.sync="saiTypeInfo" width="400px" append-to-body>
  844. SAI类型说明(图片)
  845. </el-dialog>
  846. </div>
  847. </template>
  848. <script>
  849. import { saveAndSubmitApply, submitApply, listApply, getApply, delApply, addApply, updateApply, exportApply, importTemplate, getTeamAnalysis} from "@/api/production/eoegApply";
  850. import { addSai } from "@/api/production/eoegSai";
  851. import { treeselect, listDept } from "@/api/system/dept";
  852. import { getToken } from "@/utils/auth";
  853. import Treeselect from "@riophae/vue-treeselect";
  854. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  855. import SaiApplyDetail from "@/views/approve/approveDetail/eoeg-sai-apply-detail";
  856. import ProcessImg from '@/views/approve/processImg/index';
  857. import { listStaffmgrByDeptAndTeam, getLoginStaffInfo, listEoegSaiInspectors, listEoegSaiExecutors, listEoegSaiAssessors } from "@/api/plant/staffmgr";
  858. import { allFileList, delCommonfile } from "@/api/common/commonfile";
  859. import { categoryList } from "@/api/production/eoegCategory";
  860. import { listFile } from "@/api/production/eoegSaiApproveFile";
  861. import { selectDevice } from "@/api/invoice/device";
  862. export default {
  863. name: "Apply",
  864. components: { Treeselect, SaiApplyDetail, ProcessImg },
  865. data() {
  866. var validateRecordNo = (rule, value, callback) => {
  867. if (this.delayForm.isRecorded == '1') {
  868. if (this.delayForm.recordNo == null) {
  869. return callback(new Error('开项编号不能为空'));
  870. } else {
  871. return callback();
  872. }
  873. } else {
  874. return callback();
  875. }
  876. };
  877. var validateApplicantTeam = (rule, value, callback) => {
  878. if (!this.applicantTeamDisabled) {
  879. if (this.form.applicantTeam == null) {
  880. return callback(new Error('登记人班组不能为空'));
  881. } else {
  882. return callback();
  883. }
  884. } else {
  885. return callback();
  886. }
  887. };
  888. var validateUnsafeStatus = (rule, value, callback) => {
  889. if (this.unsafeChoice == '1') {
  890. if (this.form.unsafeStatus == null) {
  891. return callback(new Error('不安全状态不能为空'));
  892. } else {
  893. return callback();
  894. }
  895. } else {
  896. return callback();
  897. }
  898. };
  899. var validateUnsafeAction = (rule, value, callback) => {
  900. if (this.unsafeChoice == '2') {
  901. if (this.form.unsafeAction == null) {
  902. return callback(new Error('不安全行为不能为空'));
  903. } else {
  904. return callback();
  905. }
  906. } else {
  907. return callback();
  908. }
  909. };
  910. return {
  911. // SAI类型说明
  912. saiTypeInfo: false,
  913. // 趋势图y轴数值
  914. valueList1: [],
  915. valueList2: [],
  916. // 趋势图x轴日期
  917. dateList1: [],
  918. dateList2: [],
  919. // 趋势图
  920. chart1: null,
  921. chart2: null,
  922. submitDisabled: false,
  923. applyDateRange: [],
  924. estimateFinishDateRange: [],
  925. // SAI类别列表
  926. saiCategoryOptions: [],
  927. saiCategoryOptions2: [],
  928. fileList: [],
  929. // 统计至SAI检查台账的数据
  930. saiList: [],
  931. // 是否显示用统计至SAI检查台账对话框
  932. saiOpen: false,
  933. // 是否显示趋势分析对话框
  934. analysisOpen: false,
  935. // 是否禁用开项编号输入框
  936. recordNoDisabled: true,
  937. // 当前登录员工
  938. loginStaffInfo: {
  939. userId: null,
  940. isMonitor: false
  941. },
  942. //图片集合 打开关闭按钮 等等
  943. imgs:[],
  944. jpgList:[],
  945. ppt:false,
  946. pptView:false,
  947. loadingFlash:false,
  948. doc: {
  949. file: "",
  950. // 是否显示弹出层(报告附件)
  951. open: false,
  952. // 弹出层标题(报告附件)
  953. title: "",
  954. // 是否禁用上传
  955. isUploading: false,
  956. // 是否更新已经存在的用户数据
  957. updateSupport: 0,
  958. // 报告附件上传位置编号
  959. ids: 0,
  960. // 设置上传的请求头部
  961. headers: { Authorization: "Bearer " + getToken() },
  962. // 上传的地址
  963. url: process.env.VUE_APP_BASE_API + "/production/eoegSaiFile/uploadFile",
  964. commonfileList: null,
  965. commonfileListApply: null,
  966. queryParams: {
  967. pId: null,
  968. pType: 'eoegSaiApply'
  969. },
  970. pType: 'eoegSaiApply',
  971. pId: null
  972. },
  973. // pdf文件参数
  974. pdf : {
  975. title: '',
  976. pdfUrl: '',
  977. numPages: null,
  978. open: false,
  979. pageNum: 1,
  980. pageTotalNum: 1,
  981. loadedRatio: 0,
  982. },
  983. // 遮罩层
  984. loading: true,
  985. // 选中数组
  986. ids: [],
  987. // 非单个禁用
  988. single: true,
  989. // 非多个禁用
  990. multiple: true,
  991. // 显示搜索条件
  992. showSearch: false,
  993. // 总条数
  994. total: 0,
  995. // SAI开项管理表格数据
  996. applyList: [],
  997. // 弹出层标题
  998. title: "",
  999. // 部门树选项
  1000. deptOptions: undefined,
  1001. clientHeight:300,
  1002. // 是否显示弹出层
  1003. open: false,
  1004. open2: false,
  1005. // 是否显示延期弹出层
  1006. delayOpen: false,
  1007. // 用户导入参数
  1008. upload: {
  1009. //下载模板请求地址
  1010. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  1011. //下载模板类型
  1012. type: 'saiApply',
  1013. // 是否显示弹出层(用户导入)
  1014. open: false,
  1015. // 弹出层标题(用户导入)
  1016. title: "",
  1017. // 是否禁用上传
  1018. isUploading: false,
  1019. // 是否更新已经存在的用户数据
  1020. updateSupport: 0,
  1021. // 设置上传的请求头部
  1022. headers: { Authorization: "Bearer " + getToken() },
  1023. // 上传的地址
  1024. url: process.env.VUE_APP_BASE_API + "/production/apply/importData"
  1025. },
  1026. // 查询参数
  1027. queryParams: {
  1028. pageNum: 1,
  1029. pageSize: 20,
  1030. saiApplyId: null,
  1031. deptId: null,
  1032. applyStatus: null,
  1033. apNo: null,
  1034. processId: null,
  1035. applicant: null,
  1036. assessor: null,
  1037. executor: null,
  1038. inspectors: null,
  1039. applicantDept: null,
  1040. applicantTeam: null,
  1041. description: null,
  1042. unsafeStatus: null,
  1043. unsafeAction: null,
  1044. applyDate: null,
  1045. taskId: null,
  1046. handler: null,
  1047. taskName: null,
  1048. estimateFinishDate: null,
  1049. actualFinishDate: null,
  1050. isRecorded: null,
  1051. recordNo: null,
  1052. reaction: null,
  1053. needVe: null,
  1054. veItems: null,
  1055. veResult: null,
  1056. veItemOther: null,
  1057. applyDateStart: null,
  1058. applyDateEnd: null,
  1059. estimateFinishDateStart: null,
  1060. estimateFinishDateEnd: null,
  1061. applyStatusString: [],
  1062. workArea: "",
  1063. },
  1064. // 表单参数
  1065. form: {},
  1066. // 延期表单参数
  1067. delayForm: {},
  1068. // 延期表单校验
  1069. delayRules: {
  1070. estimateFinishDate: [
  1071. { required: true, message: this.$t('预计完成时间') + this.$t('不能为空'), trigger: "change" }
  1072. ],
  1073. isRecorded: [
  1074. { required: true, message: this.$t('是否录入开项系统') + this.$t('不能为空'), trigger: "change" }
  1075. ],
  1076. recordNo: [
  1077. { validator: validateRecordNo, trigger: 'change' }
  1078. ],
  1079. },
  1080. // 新增/修改表单校验
  1081. rules: {
  1082. description: [
  1083. { required: true, message: this.$t('问题描述') + this.$t('不能为空'), trigger: "change" }
  1084. ],
  1085. applicantDept: [
  1086. { required: true, message: this.$t('登记人部门') + this.$t('不能为空'), trigger: "change" }
  1087. ],
  1088. applicantTeam: [
  1089. { validator: validateApplicantTeam, trigger: 'change' }
  1090. ],
  1091. applicant: [
  1092. { required: true, message: this.$t('登记人') + this.$t('不能为空'), trigger: "change" }
  1093. ],
  1094. applyDate: [
  1095. { required: true, message: this.$t('记录日期') + this.$t('不能为空'), trigger: "change" }
  1096. ],
  1097. workArea: [
  1098. { required: true, message: this.$t('片区') + this.$t('不能为空'), trigger: "change" }
  1099. ],
  1100. unsafeStatus: [
  1101. { validator: validateUnsafeStatus, trigger: 'change' }
  1102. ],
  1103. unsafeAction: [
  1104. { validator: validateUnsafeAction, trigger: 'change' }
  1105. ],
  1106. saiLevel: [
  1107. { required: true, message: this.$t('SAI级别') + this.$t('不能为空'), trigger: "change" }
  1108. ],
  1109. category: [
  1110. { required: true, message: this.$t('SAI类别') + this.$t('不能为空'), trigger: "change" }
  1111. ],
  1112. executor: [
  1113. { required: true, message: this.$t('整改负责人') + this.$t('不能为空'), trigger: "change" }
  1114. ],
  1115. saiType: [
  1116. { required: true, message: this.$t('TPM状态') + this.$t('不能为空'), trigger: "change" }
  1117. ],
  1118. },
  1119. // 申请状态字典
  1120. applyStatusOptions: [],
  1121. // 登记人班组字典
  1122. applicantTeamOptions: [],
  1123. // 登记人部门列表
  1124. applicantDeptOptions: [],
  1125. // 登记人列表
  1126. applicantOptions: [],
  1127. // 不安全状态字典
  1128. unsafeStatusOptions: [],
  1129. // 不安全行为字典
  1130. unsafeActionOptions: [],
  1131. // 是否显示SAI开项申请详情对话框
  1132. saiApplyVisible: false,
  1133. // 是否显示流程图对话框
  1134. processImgVisible: null,
  1135. // 不安全状态/行为选项
  1136. unsafeChoice: '1',
  1137. // 是否禁用不安全状态下拉框
  1138. unsafeStatusDisabled: false,
  1139. // 是否禁用不安全行为下拉框
  1140. unsafeActionDisabled: true,
  1141. // 是否禁用班组下拉框
  1142. applicantTeamDisabled: false,
  1143. workAreaList: [],
  1144. applyStatusString: [],
  1145. tableList1: [],
  1146. tableList2: [],
  1147. countA: 0,
  1148. countB: 0,
  1149. countC: 0,
  1150. countD: 0,
  1151. };
  1152. },
  1153. watch: {
  1154. // 根据名称筛选部门树
  1155. deptName(val) {
  1156. this.$refs.tree.filter(val);
  1157. }
  1158. },
  1159. created() {
  1160. //设置表格高度对应屏幕高度
  1161. this.$nextTick(() => {
  1162. this.clientHeight = document.body.clientHeight -250
  1163. })
  1164. this.getList();
  1165. this.getTreeselect();
  1166. // 加载申请状态字典
  1167. this.getDicts("SAI_APPLY_STATUS").then(response => {
  1168. this.applyStatusOptions = response.data;
  1169. });
  1170. // 加载登记人班组字典
  1171. this.getDicts("TEAM_DIVIDE").then(response => {
  1172. this.applicantTeamOptions = response.data;
  1173. });
  1174. // 加载登记人部门列表
  1175. this.getApplicantDeptOptions();
  1176. // 加载登记人列表
  1177. this.listStaffmgrByDeptAndTeam('38', null);
  1178. // 加载不安全状态字典
  1179. this.getDicts("SAI_UNSAFE_STATUS").then(response => {
  1180. this.unsafeStatusOptions = response.data;
  1181. });
  1182. // 加载不安全行为字典
  1183. this.getDicts("SAI_UNSAFE_ACTION").then(response => {
  1184. this.unsafeActionOptions = response.data;
  1185. });
  1186. // 加载当前登录员工信息
  1187. this.getLoginStaffInfo();
  1188. this.getCategoryList();
  1189. this.getWorkAreaList();
  1190. this.getTeamTable();
  1191. },
  1192. methods: {
  1193. getTeamTable() {
  1194. getTeamAnalysis().then(response => {
  1195. let data = response.data;
  1196. for (let i = 0; i < data.length; i++) {
  1197. let applicantTeam = data[i].applicantTeam;
  1198. let teamCount = data[i].teamCount;
  1199. if (applicantTeam == 'A') {
  1200. if (teamCount != '') {
  1201. this.countA = teamCount;
  1202. }
  1203. } else if (applicantTeam == 'B') {
  1204. if (teamCount != '') {
  1205. this.countB = teamCount;
  1206. }
  1207. } else if (applicantTeam == 'C') {
  1208. if (teamCount != '') {
  1209. this.countC = teamCount;
  1210. }
  1211. } else if (applicantTeam == 'D') {
  1212. if (teamCount != '') {
  1213. this.countD = teamCount;
  1214. }
  1215. }
  1216. }
  1217. });
  1218. },
  1219. /** 销毁趋势图 */
  1220. disposeChart() {
  1221. this.echarts.dispose(this.chart1);
  1222. this.echarts.dispose(this.chart2);
  1223. },
  1224. handleAnalysis() {
  1225. this.analysisOpen = true;
  1226. let teamPieList = [];
  1227. let personalPieList = [];
  1228. this.tableList1 = [];
  1229. this.tableList2 = [];
  1230. getTeamAnalysis().then(response => {
  1231. let data = response.data;
  1232. for (let i = 0; i < data.length; i++) {
  1233. let applicantTeam = data[i].applicantTeam;
  1234. let teamCount = data[i].teamCount;
  1235. teamPieList.push({ value: teamCount, name: applicantTeam + '班'});
  1236. this.tableList1.push({ value: teamCount, name: applicantTeam + '班'});
  1237. }
  1238. this.chart1 = this.echarts.init(document.getElementById("chart1"));
  1239. let option1 = {
  1240. // title: {
  1241. // text: '四个班组当年提交的SAI数量',
  1242. // left: 'center',
  1243. // top: '10%'
  1244. // },
  1245. tooltip: {
  1246. trigger: 'item'
  1247. },
  1248. legend: {
  1249. show: false
  1250. },
  1251. series: [
  1252. {
  1253. type: 'pie',
  1254. radius: ['80%'],
  1255. data: teamPieList,
  1256. emphasis: {
  1257. itemStyle: {
  1258. shadowBlur: 10,
  1259. shadowOffsetX: 0,
  1260. shadowColor: 'rgba(0, 0, 0, 0.5)'
  1261. }
  1262. },
  1263. label: {
  1264. show: false
  1265. }
  1266. }
  1267. ]
  1268. };
  1269. this.chart1.setOption(option1);
  1270. });
  1271. getPersonalAnalysis().then(response => {
  1272. let data = response.data;
  1273. for (let i = 0; i < data.length; i++) {
  1274. let applicantName = data[i].applicantName;
  1275. let applicantCount = data[i].applicantCount;
  1276. personalPieList.push({ value: applicantCount, name: applicantName });
  1277. if (i < 6) {
  1278. this.tableList2.push({ index: i + 1, value: applicantCount, name: applicantName });
  1279. }
  1280. }
  1281. this.chart2 = this.echarts.init(document.getElementById("chart2"));
  1282. let option2 = {
  1283. // title: {
  1284. // text: '个人提交数量数据分析图',
  1285. // left: 'center',
  1286. // top: '10%'
  1287. // },
  1288. tooltip: {
  1289. trigger: 'item'
  1290. },
  1291. legend: {
  1292. show: false
  1293. },
  1294. series: [
  1295. {
  1296. type: 'pie',
  1297. radius: '80%',
  1298. data: personalPieList,
  1299. emphasis: {
  1300. itemStyle: {
  1301. shadowBlur: 10,
  1302. shadowOffsetX: 0,
  1303. shadowColor: 'rgba(0, 0, 0, 0.5)'
  1304. }
  1305. },
  1306. label: {
  1307. show: false
  1308. }
  1309. }
  1310. ]
  1311. };
  1312. this.chart2.setOption(option2);
  1313. });
  1314. },
  1315. getWorkAreaList() {
  1316. selectDevice().then(response => {
  1317. let data = response.data;
  1318. for (let i = 0; i < data.length; i++) {
  1319. this.workAreaList.push(data[i]);
  1320. }
  1321. });
  1322. },
  1323. // 处理SAI级别下拉框选中事件
  1324. handleSaiLevelChange() {
  1325. this.saiCategoryOptions2 = [];
  1326. let saiLevel = this.form.saiLevel;
  1327. let saiCategoryOptionsTemp = [];
  1328. for (let i = 0; i < this.saiCategoryOptions.length; i++) {
  1329. if (saiLevel == 1 && this.saiCategoryOptions[i].dictLabel.indexOf("-1-") != -1) {
  1330. let saiCategoryOption = {
  1331. dictValue: this.saiCategoryOptions[i].dictValue,
  1332. dictLabel: this.saiCategoryOptions[i].dictLabel,
  1333. };
  1334. saiCategoryOptionsTemp.push(saiCategoryOption);
  1335. }
  1336. if (saiLevel == 2 && this.saiCategoryOptions[i].dictLabel.indexOf("-2-") != -1) {
  1337. let saiCategoryOption = {
  1338. dictValue: this.saiCategoryOptions[i].dictValue,
  1339. dictLabel: this.saiCategoryOptions[i].dictLabel,
  1340. };
  1341. saiCategoryOptionsTemp.push(saiCategoryOption);
  1342. }
  1343. if (saiLevel == 3 && this.saiCategoryOptions[i].dictLabel.indexOf("-3-") != -1) {
  1344. let saiCategoryOption = {
  1345. dictValue: this.saiCategoryOptions[i].dictValue,
  1346. dictLabel: this.saiCategoryOptions[i].dictLabel,
  1347. };
  1348. saiCategoryOptionsTemp.push(saiCategoryOption);
  1349. }
  1350. }
  1351. this.saiCategoryOptions2 = saiCategoryOptionsTemp;
  1352. },
  1353. // 处理SAI类别下拉框选中事件
  1354. handleSaiCategoryChange() {
  1355. for (let i = 0; i < this.saiCategoryOptions.length; i++) {
  1356. if (this.form.category == this.saiCategoryOptions[i].dictValue) {
  1357. if (this.saiCategoryOptions[i].dictLabel.indexOf("-1-") != -1) {
  1358. this.form.saiLevel = 1;
  1359. }
  1360. if (this.saiCategoryOptions[i].dictLabel.indexOf("-2-") != -1) {
  1361. this.form.saiLevel = 2;
  1362. }
  1363. if (this.saiCategoryOptions[i].dictLabel.indexOf("-3-") != -1) {
  1364. this.form.saiLevel = 3;
  1365. }
  1366. }
  1367. }
  1368. },
  1369. // SAI类别字典翻译
  1370. saiCategoryFormat(row, column) {
  1371. if (row.category == null || row.category == '') {
  1372. return "/";
  1373. } else {
  1374. return this.selectDictLabel(this.saiCategoryOptions, row.category);
  1375. }
  1376. },
  1377. /** 获取SAI类别列表数据 */
  1378. getCategoryList() {
  1379. categoryList().then(response => {
  1380. let data = response.data;
  1381. for (let i = 0; i < data.length; i++) {
  1382. if (data[i].saiCategoryName != null && data[i].saiCategoryName != "") {
  1383. this.saiCategoryOptions.push({
  1384. dictLabel: data[i].saiCategoryName + "(" + data[i].saiCategoryDescription + ")",
  1385. dictValue: data[i].saiCategoryId
  1386. });
  1387. this.saiCategoryOptions2.push({
  1388. dictLabel: data[i].saiCategoryName + "(" + data[i].saiCategoryDescription + ")",
  1389. dictValue: data[i].saiCategoryId
  1390. });
  1391. }
  1392. }
  1393. });
  1394. },
  1395. /** 是否录入开项系统单选按钮值改变事件 */
  1396. handleIsRecordedChange() {
  1397. if (this.delayForm.isRecorded == '1') {
  1398. this.recordNoDisabled = false;
  1399. } else if (this.delayForm.isRecorded == '0') {
  1400. this.recordNoDisabled = true;
  1401. this.delayForm.recordNo = null;
  1402. }
  1403. },
  1404. /** 文件下载处理 */
  1405. handleDownload(row) {
  1406. var name = row.fileName;
  1407. var url = row.fileUrl;
  1408. var suffix = url.substring(url.lastIndexOf("."), url.length);
  1409. const a = document.createElement('a')
  1410. a.setAttribute('download', name)
  1411. a.setAttribute('target', '_blank')
  1412. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  1413. a.click()
  1414. },
  1415. /** 报告附件按钮操作 */
  1416. handleDoc(row) {
  1417. this.doc.id = row.saiApplyId;
  1418. this.doc.title = "附件";
  1419. this.doc.open = true;
  1420. this.doc.queryParams.pId = row.saiApplyId
  1421. this.doc.pId = row.saiApplyId
  1422. this.getFileList()
  1423. this.$nextTick(() => {
  1424. this.$refs.doc.clearFiles()
  1425. })
  1426. },
  1427. getFileList() {
  1428. allFileList(this.doc.queryParams).then(response => {
  1429. this.doc.commonfileList = response;
  1430. });
  1431. },
  1432. /** 附件上传中处理 */
  1433. handleFileDocProgress(event, file, fileList) {
  1434. this.doc.file = file;
  1435. this.doc.isUploading = true;
  1436. },
  1437. // /** 附件上传成功处理 */
  1438. // handleFileDocSuccess(response, file, fileList) {
  1439. // this.doc.isUploading = false;
  1440. // this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1441. // this.getFileList()
  1442. // },
  1443. //附件上传成功处理
  1444. handleFileDocSuccess(response, file, fileList) {
  1445. this.doc.isUploading = false;
  1446. this.fileList = fileList
  1447. if (response.code == 200){
  1448. this.$alert(this.$t('导入成功'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1449. }else {
  1450. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1451. }
  1452. },
  1453. handleRemove (file, fileList) {
  1454. this.fileList = fileList
  1455. },
  1456. /** 删除按钮操作 */
  1457. handleDeleteDoc(row) {
  1458. const ids = row.id || this.ids;
  1459. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1460. confirmButtonText: this.$t('确定'),
  1461. cancelButtonText: this.$t('取消'),
  1462. type: "warning"
  1463. }).then(function() {
  1464. return delCommonfile(ids);
  1465. }).then(() => {
  1466. this.getFileList();
  1467. this.msgSuccess(this.$t('删除成功'));
  1468. })
  1469. },
  1470. //文件预览
  1471. openPdf(){
  1472. //ppt就跳路由预览,office就直接打开文件新页面
  1473. const didi={ imgs:this.imgs}
  1474. if( this.pptView==true&&this.ppt==false){
  1475. let routeUrl = this.$router.resolve({
  1476. path: "/cpms/index.html#/pptyulan",
  1477. query:didi
  1478. });
  1479. window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
  1480. console.log(this.imgs)
  1481. }else {
  1482. window.open(this.pdf.pdfUrl)
  1483. }
  1484. },
  1485. handleSeePPT (row){
  1486. //ppt预览
  1487. this.loadingFlash=true
  1488. this.pdf.open =true
  1489. this.pdf.title = row.fileName
  1490. this.pdf.pdfUrl = row.fileUrl
  1491. this.pptView=true
  1492. this.ppt=false
  1493. const formatDate =new FormData();
  1494. formatDate.append("filepath",row.fileUrl)
  1495. //调用文件预览api
  1496. let res= this.officeConvert.pptConvertCommon(formatDate)
  1497. //查看接受的全局方法的返回结果 console.log(res)
  1498. //利用.then方法接受Promise对象
  1499. res.then((result)=>{
  1500. //关闭加载中
  1501. this.loadingFlash=false
  1502. //成功时直接给地址
  1503. this.videoList = result.data.imagePathList
  1504. //将返回的地址集合遍历添加到绑定的数组中
  1505. this.imgs=[]
  1506. for (var key=0;key<this.videoList.length;key++) {
  1507. this.imgs.push( process.env.VUE_APP_BASE_API+ this.videoList[key] );
  1508. }
  1509. }).catch(result => {
  1510. //请求失败,关闭loading,pdf地址直接为为空,不显示
  1511. this.pdf.pdfUrl =""
  1512. this.loadingFlash = false;
  1513. })
  1514. },
  1515. handleSee (row){
  1516. //office预览
  1517. this.loadingFlash=true
  1518. this.pdf.open =true
  1519. this.pdf.title = row.fileName
  1520. this.pdf.pdfUrl =""
  1521. this.pptView=false
  1522. this.ppt=true
  1523. //如果是PDF等直接可以打开的就不调接口,否则调用接口
  1524. if(row.fileName.endsWith('pdf')){
  1525. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  1526. this.loadingFlash=false
  1527. }
  1528. else{
  1529. const formatDate =new FormData();
  1530. formatDate.append("filepath",row.fileUrl)
  1531. //调用文件预览api
  1532. let res= this.officeConvert.officeConvertCommon(formatDate)
  1533. //查看接受的全局方法的返回结果 console.log(res)
  1534. //利用.then方法接受Promise对象
  1535. res.then((result)=>{
  1536. //关闭加载中
  1537. this.loadingFlash=false
  1538. if(result.msg.includes("csv")){
  1539. this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
  1540. this.$alert(result.msg, this.$t('检查乱码'), { dangerouslyUseHTMLString: true });
  1541. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  1542. }else if(result.msg.includes("不存在")){
  1543. //文件不存在时提示
  1544. this.pdf.pdfUrl =""
  1545. this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
  1546. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  1547. this.pdf.open =false
  1548. }else if(result.msg.includes("不支持此格式")){
  1549. this.pdf.pdfUrl =""
  1550. this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
  1551. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  1552. this.pdf.open =false
  1553. } else{
  1554. //成功时直接给地址
  1555. this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
  1556. }
  1557. // this.$nextTick(() => {
  1558. // const iframe = window.frames['iFrame']
  1559. // const handleLoad = () => {
  1560. // setTimeout(() => {
  1561. // const Do = (iframe.contentWindow || iframe.contentDocument)
  1562. // console.log(Do.document.getElementsByTagName('table')[0])
  1563. // Do.document.getElementsByTagName('table')[0].style.width = "100%"
  1564. // Do.document.getElementsByTagName('table')[0].setAttribute("class","table")
  1565. // }, 500)
  1566. // }
  1567. // iframe.addEventListener('load', handleLoad, true)
  1568. // })
  1569. }).catch(result => {
  1570. //请求失败,关闭loading,pdf地址直接为为空,不显示
  1571. this.pdf.pdfUrl =""
  1572. this.loadingFlash = false;
  1573. })
  1574. }
  1575. },
  1576. /** 加载当前登录员工信息 */
  1577. getLoginStaffInfo() {
  1578. getLoginStaffInfo().then(response => {
  1579. let staff = response.data;
  1580. if (staff != null) {
  1581. this.loginStaffInfo = response.data;
  1582. if (this.loginStaffInfo.actualpost == '12' || this.loginStaffInfo.actualpost == '34') {
  1583. this.loginStaffInfo.isMonitor = true;
  1584. }
  1585. this.form.applicantDept = staff.unit;
  1586. if (staff.unit == '38') {
  1587. this.form.applicantTeam = staff.team;
  1588. }
  1589. this.form.applicant = staff.userId;
  1590. }
  1591. });
  1592. },
  1593. /** 加载登记人部门列表 */
  1594. getApplicantDeptOptions() {
  1595. this.applicantDeptOptions.push({ dictLabel: "CEP/E", dictValue: '38' });
  1596. this.applicantDeptOptions.push({ dictLabel: "CTA/B", dictValue: '12' });
  1597. this.applicantDeptOptions.push({ dictLabel: "CTM/B", dictValue: '14' });
  1598. },
  1599. /** 部门/班组值改变事件 */
  1600. handleDeptOrTeamChange() {
  1601. this.applicantOptions = [];
  1602. this.form.applicant = null;
  1603. let applicantDept = this.form.applicantDept;
  1604. if (applicantDept != '38') {
  1605. this.applicantTeamDisabled = true;
  1606. this.form.applicantTeam = null;
  1607. } else {
  1608. this.applicantTeamDisabled = false;
  1609. }
  1610. let applicantTeam = this.form.applicantTeam;
  1611. // 加载登记人列表
  1612. this.listStaffmgrByDeptAndTeam(applicantDept, null);
  1613. },
  1614. /** 加载登记人列表 */
  1615. listStaffmgrByDeptAndTeam(applicantDept, applicantTeam) {
  1616. listStaffmgrByDeptAndTeam({
  1617. deptId: applicantDept,
  1618. team: applicantTeam
  1619. }).then(response => {
  1620. let staffList = response.rows;
  1621. this.applicantOptions = [];
  1622. for (let i = 0; i < staffList.length; i++) {
  1623. let staffOption = {
  1624. dictLabel: staffList[i].name,
  1625. dictValue: staffList[i].userId
  1626. }
  1627. this.applicantOptions.push(staffOption);
  1628. }
  1629. });
  1630. },
  1631. /** 不安全行为/状态单选按钮值改变事件 */
  1632. handleUnsafeChoiceChange() {
  1633. if (this.unsafeChoice == '1') {
  1634. this.form.unsafeAction = null;
  1635. this.unsafeStatusDisabled = false;
  1636. this.unsafeActionDisabled = true;
  1637. } else if (this.unsafeChoice == '2') {
  1638. this.form.unsafeStatus = null;
  1639. this.unsafeStatusDisabled = true;
  1640. this.unsafeActionDisabled = false;
  1641. }
  1642. },
  1643. /** 流程图 */
  1644. processImg (processId) {
  1645. this.processImgVisible = true;
  1646. this.$nextTick(() => {
  1647. this.$refs.processImg.init(processId);
  1648. })
  1649. },
  1650. /** 处理延期操作 */
  1651. handleDelay(row) {
  1652. this.reset();
  1653. const saiApplyId = row.saiApplyId || this.ids
  1654. getApply(saiApplyId).then(response => {
  1655. this.delayForm = response.data;
  1656. if (this.delayForm.isRecorded != null) {
  1657. this.delayForm.isRecorded = this.delayForm.isRecorded.toString();
  1658. }
  1659. this.delayOpen = true;
  1660. this.title = "SAI开项申请延期";
  1661. });
  1662. },
  1663. /** 处理/详情操作 */
  1664. handleDetail(row) {
  1665. this.saiApplyVisible = true;
  1666. this.$nextTick(() => {
  1667. this.$refs.saiApplyDetail.init(row.saiApplyId, row.taskId, row.processId, row.taskName);
  1668. });
  1669. },
  1670. /** 提交申请操作 */
  1671. handleSubmit(row) {
  1672. this.$confirm('是否确认提交申请?', "警告", {
  1673. confirmButtonText: "确定",
  1674. cancelButtonText: "取消",
  1675. type: "warning"
  1676. }).then(function() {
  1677. return submitApply(row.saiApplyId);
  1678. }).then(() => {
  1679. this.getList();
  1680. this.msgSuccess("提交申请成功");
  1681. })
  1682. },
  1683. // 申请状态字典翻译
  1684. applyStatusFormat(row, column) {
  1685. return this.selectDictLabel(this.applyStatusOptions, row.applyStatus);
  1686. },
  1687. // 班组字典翻译
  1688. teamFormat(row, column) {
  1689. return this.selectDictLabel(this.applicantTeamOptions, row.applicantTeam);
  1690. },
  1691. /** 查询SAI开项管理列表 */
  1692. getList() {
  1693. this.loading = true;
  1694. this.queryParams.tab = 3;
  1695. this.queryParams.applyStatusString = this.applyStatusString.join()
  1696. if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
  1697. this.queryParams.workArea = this.queryParams.workArea.join();
  1698. } else {
  1699. this.queryParams.workArea = "";
  1700. }
  1701. listApply(this.queryParams).then(response => {
  1702. if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
  1703. this.queryParams.workArea = this.queryParams.workArea.split(",");
  1704. }
  1705. this.applyList = response.rows;
  1706. this.total = response.total;
  1707. this.loading = false;
  1708. });
  1709. },
  1710. /** 查询部门下拉树结构 */
  1711. getTreeselect() {
  1712. treeselect().then(response => {
  1713. this.deptOptions = response.data;
  1714. });
  1715. },
  1716. // 取消按钮
  1717. cancel() {
  1718. this.delayOpen = false;
  1719. this.saiOpen = false;
  1720. this.open = false;
  1721. this.open2 = false;
  1722. this.analysisOpen = false;
  1723. this.reset();
  1724. },
  1725. // 表单重置
  1726. reset() {
  1727. this.form = {
  1728. saiApplyId: null,
  1729. delFlag: null,
  1730. createBy: null,
  1731. createTime: null,
  1732. updateBy: null,
  1733. updateTime: null,
  1734. deptId: null,
  1735. applyStatus: null,
  1736. apNo: null,
  1737. processId: null,
  1738. applicant: null,
  1739. assessor: null,
  1740. executor: null,
  1741. inspectors: null,
  1742. applicantDept: null,
  1743. applicantTeam: null,
  1744. description: null,
  1745. unsafeStatus: null,
  1746. unsafeAction: null,
  1747. applyDate: new Date(),
  1748. taskId: null,
  1749. handler: null,
  1750. taskName: null,
  1751. estimateFinishDate: null,
  1752. actualFinishDate: null,
  1753. isRecorded: null,
  1754. recordNo: null,
  1755. reaction: null,
  1756. needVe: null,
  1757. veItems: null,
  1758. veResult: null,
  1759. veItemOther: null,
  1760. applyDateStart: null,
  1761. applyDateEnd: null,
  1762. estimateFinishDateStart: null,
  1763. estimateFinishDateEnd: null,
  1764. };
  1765. this.resetForm("form");
  1766. },
  1767. /** 搜索按钮操作 */
  1768. handleQuery() {
  1769. this.queryParams.pageNum = 1;
  1770. if (this.applyDateRange != null) {
  1771. this.queryParams.applyDateStart = this.applyDateRange[0];
  1772. this.queryParams.applyDateEnd = this.applyDateRange[1];
  1773. } else {
  1774. this.queryParams.applyDateStart = null;
  1775. this.queryParams.applyDateEnd = null;
  1776. }
  1777. if (this.estimateFinishDateRange != null) {
  1778. this.queryParams.estimateFinishDateStart = this.estimateFinishDateRange[0];
  1779. this.queryParams.estimateFinishDateEnd = this.estimateFinishDateRange[1];
  1780. } else {
  1781. this.queryParams.estimateFinishDateStart = null;
  1782. this.queryParams.estimateFinishDateEnd = null;
  1783. }
  1784. this.getList();
  1785. },
  1786. /** 重置按钮操作 */
  1787. resetQuery() {
  1788. this.resetForm("queryForm");
  1789. this.applyStatusString = [];
  1790. this.handleQuery();
  1791. },
  1792. // 多选框选中数据
  1793. handleSelectionChange(selection) {
  1794. this.ids = selection.map(item => item.saiApplyId)
  1795. this.single = selection.length!==1
  1796. this.multiple = !selection.length
  1797. },
  1798. /** 新增按钮操作 */
  1799. handleAdd() {
  1800. this.reset();
  1801. this.fileList = [];
  1802. this.open = true;
  1803. this.title = "新增 TPM / SAI";
  1804. // 加载当前登录员工信息
  1805. this.getLoginStaffInfo();
  1806. this.applicantTeamDisabled = false;
  1807. },
  1808. /** 修改按钮操作 */
  1809. handleUpdate(row) {
  1810. this.reset();
  1811. const saiApplyId = row.saiApplyId || this.ids
  1812. listFile({
  1813. approveId: saiApplyId
  1814. }).then(response => {
  1815. this.doc.commonfileListApply = response;
  1816. });
  1817. getApply(saiApplyId).then(response => {
  1818. this.form = response.data;
  1819. if (this.form.unsafeStatus != null && this.form.unsafeStatus != "") {
  1820. this.form.unsafeStatus = this.form.unsafeStatus.toString();
  1821. }
  1822. if (this.form.unsafeAction != null && this.form.unsafeAction != "") {
  1823. this.form.unsafeAction = this.form.unsafeAction.toString();
  1824. }
  1825. if (this.form.category != null && this.form.category != "") {
  1826. this.form.category = Number(this.form.category);
  1827. }
  1828. this.fileList = [];
  1829. if (this.form.files.length > 0) {
  1830. console.log(this.form.files);
  1831. for (let i = 0; i < this.form.files.length; i++) {
  1832. let obj = {}
  1833. obj.name = this.form.files[i].fileName
  1834. obj.response = {};
  1835. obj.response.msg = this.form.files[i].fileUrl
  1836. this.fileList.push(obj)
  1837. }
  1838. }
  1839. this.open = true;
  1840. this.title = "修改SAI开项申请";
  1841. });
  1842. },
  1843. handleUpdate2(row) {
  1844. this.reset();
  1845. const saiApplyId = row.saiApplyId || this.ids
  1846. listFile({
  1847. approveId: saiApplyId
  1848. }).then(response => {
  1849. this.doc.commonfileListApply = response;
  1850. });
  1851. getApply(saiApplyId).then(response => {
  1852. this.form = response.data;
  1853. if (this.form.unsafeStatus != null && this.form.unsafeStatus != "") {
  1854. this.form.unsafeStatus = this.form.unsafeStatus.toString();
  1855. }
  1856. if (this.form.unsafeAction != null && this.form.unsafeAction != "") {
  1857. this.form.unsafeAction = this.form.unsafeAction.toString();
  1858. }
  1859. if (this.form.category != null && this.form.category != "") {
  1860. this.form.category = Number(this.form.category);
  1861. }
  1862. this.fileList = [];
  1863. if (this.form.files.length > 0) {
  1864. console.log(this.form.files);
  1865. for (let i = 0; i < this.form.files.length; i++) {
  1866. let obj = {}
  1867. obj.name = this.form.files[i].fileName
  1868. obj.response = {};
  1869. obj.response.msg = this.form.files[i].fileUrl
  1870. this.fileList.push(obj)
  1871. }
  1872. }
  1873. this.open2 = true;
  1874. this.title = "修改SAI开项申请";
  1875. });
  1876. },
  1877. /** 新增/修改保存按钮 */
  1878. submitForm() {
  1879. this.submitDisabled = true;
  1880. this.form.files = []
  1881. if (this.fileList.length > 0) {
  1882. for (let i = 0; i < this.fileList.length; i++) {
  1883. let obj = {}
  1884. obj.fileName = this.fileList[i].name
  1885. obj.fileUrl = this.fileList[i].response.msg
  1886. this.form.files.push(obj)
  1887. }
  1888. }
  1889. this.$refs["form"].validate(valid => {
  1890. if (valid) {
  1891. if (this.form.saiApplyId != null) {
  1892. updateApply(this.form).then(response => {
  1893. this.msgSuccess("修改成功");
  1894. this.open = false;
  1895. this.open2 = false;
  1896. this.submitDisabled = false;
  1897. this.getList();
  1898. });
  1899. } else {
  1900. addApply(this.form).then(response => {
  1901. this.msgSuccess("新增成功");
  1902. this.open = false;
  1903. this.open2 = false;
  1904. this.submitDisabled = false;
  1905. this.getList();
  1906. });
  1907. }
  1908. } else {
  1909. this.submitDisabled = false;
  1910. }
  1911. });
  1912. },
  1913. /** 新增/修改提交按钮 */
  1914. handleSaveAndSubmit() {
  1915. this.submitDisabled = true;
  1916. this.form.files = []
  1917. if (this.fileList.length > 0) {
  1918. for (let i = 0; i < this.fileList.length; i++) {
  1919. let obj = {}
  1920. obj.fileName = this.fileList[i].name
  1921. obj.fileUrl = this.fileList[i].response.msg
  1922. this.form.files.push(obj)
  1923. }
  1924. }
  1925. this.$refs["form"].validate(valid => {
  1926. if (valid) {
  1927. saveAndSubmitApply(this.form).then(response => {
  1928. this.msgSuccess("提交成功");
  1929. this.submitDisabled = false;
  1930. this.open = false;
  1931. this.getList();
  1932. });
  1933. } else {
  1934. this.submitDisabled = false;
  1935. }
  1936. });
  1937. },
  1938. /** 统计至SAI检查台账提交按钮 */
  1939. submitSaiForm() {
  1940. for (let i = 0; i < this.saiList.length; i++) {
  1941. this.saiList[i].plantId = 103;
  1942. this.saiList[i].userDept = 103;
  1943. addSai(this.saiList[i]);
  1944. }
  1945. this.msgSuccess("提交成功");
  1946. this.saiOpen = false;
  1947. },
  1948. /** 延期提交按钮 */
  1949. submitDelayForm() {
  1950. this.$refs["delayForm"].validate(valid => {
  1951. if (valid) {
  1952. updateApply(this.delayForm).then(response => {
  1953. this.msgSuccess("延期成功");
  1954. this.delayOpen = false;
  1955. this.getList();
  1956. });
  1957. }
  1958. });
  1959. },
  1960. /** 统计至SAI检查台账按钮操作 */
  1961. handleAddSai(row) {
  1962. const saiApplyIds = row.saiApplyId || this.ids;
  1963. if(saiApplyIds.length != 0) {
  1964. this.saiList = [];
  1965. for (let i = 0; i < saiApplyIds.length; i ++) {
  1966. getApply(saiApplyIds[i]).then(response => {
  1967. let apply = response.data;
  1968. let sai = {};
  1969. sai.saiApplyId = apply.saiApplyId;
  1970. sai.plantId = "CBP/C";
  1971. sai.userDeptId = "CBP/C";
  1972. sai.inspectionDate = apply.applyDate;
  1973. sai.dificiency = apply.description;
  1974. sai.actions = apply.reaction;
  1975. sai.source = "装置";
  1976. sai.deptId = 103;
  1977. sai.saiLevel = apply.saiLevel;
  1978. sai.category = Number(apply.category);
  1979. sai.applicant = apply.applicant;
  1980. sai.applicantName = apply.applicantName;
  1981. this.saiList.push(sai);
  1982. });
  1983. }
  1984. this.saiOpen = true;
  1985. }
  1986. },
  1987. /** 删除按钮操作 */
  1988. handleDelete(row) {
  1989. const saiApplyIds = row.saiApplyId || this.ids;
  1990. this.$confirm('是否确认删除?', "警告", {
  1991. confirmButtonText: "确定",
  1992. cancelButtonText: "取消",
  1993. type: "warning"
  1994. }).then(function() {
  1995. return delApply(saiApplyIds);
  1996. }).then(() => {
  1997. this.getList();
  1998. this.msgSuccess("删除成功");
  1999. })
  2000. },
  2001. /** 导出全部按钮操作 */
  2002. handleExport() {
  2003. this.queryParams.ids = null;
  2004. if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
  2005. this.queryParams.workArea = this.queryParams.workArea.join();
  2006. } else {
  2007. this.queryParams.workArea = "";
  2008. }
  2009. const queryParams = this.queryParams;
  2010. this.$confirm('是否确认导出所有SAI开项管理数据项?', "警告", {
  2011. confirmButtonText: "确定",
  2012. cancelButtonText: "取消",
  2013. type: "warning"
  2014. }).then(function() {
  2015. return exportApply(queryParams);
  2016. }).then(response => {
  2017. this.download(response.msg);
  2018. })
  2019. },
  2020. /** 导出选中数据按钮操作 */
  2021. handleExportSelected() {
  2022. if (this.ids.length==0){
  2023. return this.$alert('请选择要导出的数据项!', "警告", {
  2024. confirmButtonText: "确定",
  2025. type: "warning"
  2026. })
  2027. }
  2028. if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
  2029. this.queryParams.workArea = this.queryParams.workArea.join();
  2030. } else {
  2031. this.queryParams.workArea = "";
  2032. }
  2033. const queryParams = this.queryParams;
  2034. queryParams.ids=this.ids;
  2035. console.log(queryParams)
  2036. this.$confirm('是否确认导出选中的SAI开项管理数据项?', "警告", {
  2037. confirmButtonText: "确定",
  2038. cancelButtonText: "取消",
  2039. type: "warning"
  2040. }).then(function () {
  2041. return exportApply(queryParams);
  2042. }).then(response => {
  2043. this.download(response.msg);
  2044. })
  2045. },
  2046. /** 导入按钮操作 */
  2047. handleImport() {
  2048. this.upload.title = "用户导入";
  2049. this.upload.open = true;
  2050. },
  2051. /** 下载模板操作 */
  2052. importTemplate() {
  2053. this.$refs['downloadFileForm'].submit()
  2054. },
  2055. // 文件上传中处理
  2056. handleFileUploadProgress(event, file, fileList) {
  2057. this.upload.isUploading = true;
  2058. },
  2059. // 文件上传成功处理
  2060. handleFileSuccess(response, file, fileList) {
  2061. this.upload.open = false;
  2062. this.upload.isUploading = false;
  2063. this.$refs.upload.clearFiles();
  2064. if (response.data[0] != null) {
  2065. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  2066. }else {
  2067. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  2068. }
  2069. this.getList();
  2070. },
  2071. // 提交上传文件
  2072. submitFileForm() {
  2073. this.$refs.upload.submit();
  2074. }
  2075. }
  2076. };
  2077. </script>