index.vue 75 KB

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