index.vue 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845
  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"
  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. >修改</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. >删除</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 applicantOptions"
  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 } 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. },
  1002. // 申请状态字典
  1003. applyStatusOptions: [],
  1004. // 登记人班组字典
  1005. applicantTeamOptions: [],
  1006. // 登记人部门列表
  1007. applicantDeptOptions: [],
  1008. // 登记人列表
  1009. applicantOptions: [],
  1010. // 不安全状态字典
  1011. unsafeStatusOptions: [],
  1012. // 不安全行为字典
  1013. unsafeActionOptions: [],
  1014. // 是否显示SAI开项申请详情对话框
  1015. saiApplyVisible: false,
  1016. // 是否显示流程图对话框
  1017. processImgVisible: null,
  1018. // 不安全状态/行为选项
  1019. unsafeChoice: '1',
  1020. // 是否禁用不安全状态下拉框
  1021. unsafeStatusDisabled: false,
  1022. // 是否禁用不安全行为下拉框
  1023. unsafeActionDisabled: true,
  1024. // 是否禁用班组下拉框
  1025. applicantTeamDisabled: false,
  1026. workAreaList: [],
  1027. countA: 0,
  1028. countB: 0,
  1029. countC: 0,
  1030. countD: 0,
  1031. };
  1032. },
  1033. watch: {
  1034. // 根据名称筛选部门树
  1035. deptName(val) {
  1036. this.$refs.tree.filter(val);
  1037. }
  1038. },
  1039. created() {
  1040. //设置表格高度对应屏幕高度
  1041. this.$nextTick(() => {
  1042. this.clientHeight = document.body.clientHeight -250
  1043. })
  1044. this.getList();
  1045. this.getTreeselect();
  1046. // 加载申请状态字典
  1047. this.getDicts("SAI_APPLY_STATUS").then(response => {
  1048. this.applyStatusOptions = response.data;
  1049. });
  1050. // 加载登记人班组字典
  1051. this.getDicts("TEAM_DIVIDE").then(response => {
  1052. this.applicantTeamOptions = response.data;
  1053. });
  1054. // 加载登记人部门列表
  1055. this.getApplicantDeptOptions();
  1056. // 加载登记人列表
  1057. this.listStaffmgrByDeptAndTeam('38', null);
  1058. // 加载不安全状态字典
  1059. this.getDicts("SAI_UNSAFE_STATUS").then(response => {
  1060. this.unsafeStatusOptions = response.data;
  1061. });
  1062. // 加载不安全行为字典
  1063. this.getDicts("SAI_UNSAFE_ACTION").then(response => {
  1064. this.unsafeActionOptions = response.data;
  1065. });
  1066. // 加载当前登录员工信息
  1067. this.getLoginStaffInfo();
  1068. this.getCategoryList();
  1069. this.getWorkAreaList();
  1070. this.getTeamTable();
  1071. },
  1072. methods: {
  1073. getTeamTable() {
  1074. getTeamAnalysis().then(response => {
  1075. let data = response.data;
  1076. for (let i = 0; i < data.length; i++) {
  1077. let applicantTeam = data[i].applicantTeam;
  1078. let teamCount = data[i].teamCount;
  1079. if (applicantTeam == 'A') {
  1080. if (teamCount != '') {
  1081. this.countA = teamCount;
  1082. }
  1083. } else if (applicantTeam == 'B') {
  1084. if (teamCount != '') {
  1085. this.countB = teamCount;
  1086. }
  1087. } else if (applicantTeam == 'C') {
  1088. if (teamCount != '') {
  1089. this.countC = teamCount;
  1090. }
  1091. } else if (applicantTeam == 'D') {
  1092. if (teamCount != '') {
  1093. this.countD = teamCount;
  1094. }
  1095. }
  1096. }
  1097. });
  1098. },
  1099. getWorkAreaList() {
  1100. selectDevice().then(response => {
  1101. let data = response.data;
  1102. for (let i = 0; i < data.length; i++) {
  1103. this.workAreaList.push(data[i]);
  1104. }
  1105. });
  1106. },
  1107. // 处理SAI级别下拉框选中事件
  1108. handleSaiLevelChange() {
  1109. this.saiCategoryOptions2 = [];
  1110. let saiLevel = this.form.saiLevel;
  1111. let saiCategoryOptionsTemp = [];
  1112. for (let i = 0; i < this.saiCategoryOptions.length; i++) {
  1113. if (saiLevel == 1 && this.saiCategoryOptions[i].dictLabel.indexOf("-1-") != -1) {
  1114. let saiCategoryOption = {
  1115. dictValue: this.saiCategoryOptions[i].dictValue,
  1116. dictLabel: this.saiCategoryOptions[i].dictLabel,
  1117. };
  1118. saiCategoryOptionsTemp.push(saiCategoryOption);
  1119. }
  1120. if (saiLevel == 2 && this.saiCategoryOptions[i].dictLabel.indexOf("-2-") != -1) {
  1121. let saiCategoryOption = {
  1122. dictValue: this.saiCategoryOptions[i].dictValue,
  1123. dictLabel: this.saiCategoryOptions[i].dictLabel,
  1124. };
  1125. saiCategoryOptionsTemp.push(saiCategoryOption);
  1126. }
  1127. if (saiLevel == 3 && this.saiCategoryOptions[i].dictLabel.indexOf("-3-") != -1) {
  1128. let saiCategoryOption = {
  1129. dictValue: this.saiCategoryOptions[i].dictValue,
  1130. dictLabel: this.saiCategoryOptions[i].dictLabel,
  1131. };
  1132. saiCategoryOptionsTemp.push(saiCategoryOption);
  1133. }
  1134. }
  1135. this.saiCategoryOptions2 = saiCategoryOptionsTemp;
  1136. },
  1137. // 处理SAI类别下拉框选中事件
  1138. handleSaiCategoryChange() {
  1139. for (let i = 0; i < this.saiCategoryOptions.length; i++) {
  1140. if (this.form.category == this.saiCategoryOptions[i].dictValue) {
  1141. if (this.saiCategoryOptions[i].dictLabel.indexOf("-1-") != -1) {
  1142. this.form.saiLevel = 1;
  1143. }
  1144. if (this.saiCategoryOptions[i].dictLabel.indexOf("-2-") != -1) {
  1145. this.form.saiLevel = 2;
  1146. }
  1147. if (this.saiCategoryOptions[i].dictLabel.indexOf("-3-") != -1) {
  1148. this.form.saiLevel = 3;
  1149. }
  1150. }
  1151. }
  1152. },
  1153. // SAI类别字典翻译
  1154. saiCategoryFormat(row, column) {
  1155. if (row.category == null || row.category == '') {
  1156. return "/";
  1157. } else {
  1158. return this.selectDictLabel(this.saiCategoryOptions, row.category);
  1159. }
  1160. },
  1161. /** 获取SAI类别列表数据 */
  1162. getCategoryList() {
  1163. categoryList().then(response => {
  1164. let data = response.data;
  1165. for (let i = 0; i < data.length; i++) {
  1166. if (data[i].saiCategoryName != null && data[i].saiCategoryName != "") {
  1167. this.saiCategoryOptions.push({
  1168. dictLabel: data[i].saiCategoryName + "(" + data[i].saiCategoryDescription + ")",
  1169. dictValue: data[i].saiCategoryId
  1170. });
  1171. this.saiCategoryOptions2.push({
  1172. dictLabel: data[i].saiCategoryName + "(" + data[i].saiCategoryDescription + ")",
  1173. dictValue: data[i].saiCategoryId
  1174. });
  1175. }
  1176. }
  1177. });
  1178. },
  1179. /** 是否录入开项系统单选按钮值改变事件 */
  1180. handleIsRecordedChange() {
  1181. if (this.delayForm.isRecorded == '1') {
  1182. this.recordNoDisabled = false;
  1183. } else if (this.delayForm.isRecorded == '0') {
  1184. this.recordNoDisabled = true;
  1185. this.delayForm.recordNo = null;
  1186. }
  1187. },
  1188. /** 文件下载处理 */
  1189. handleDownload(row) {
  1190. var name = row.fileName;
  1191. var url = row.fileUrl;
  1192. var suffix = url.substring(url.lastIndexOf("."), url.length);
  1193. const a = document.createElement('a')
  1194. a.setAttribute('download', name)
  1195. a.setAttribute('target', '_blank')
  1196. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  1197. a.click()
  1198. },
  1199. /** 报告附件按钮操作 */
  1200. handleDoc(row) {
  1201. this.doc.id = row.saiApplyId;
  1202. this.doc.title = "附件";
  1203. this.doc.open = true;
  1204. this.doc.queryParams.pId = row.saiApplyId
  1205. this.doc.pId = row.saiApplyId
  1206. this.getFileList()
  1207. this.$nextTick(() => {
  1208. this.$refs.doc.clearFiles()
  1209. })
  1210. },
  1211. getFileList() {
  1212. allFileList(this.doc.queryParams).then(response => {
  1213. this.doc.commonfileList = response;
  1214. });
  1215. },
  1216. /** 附件上传中处理 */
  1217. handleFileDocProgress(event, file, fileList) {
  1218. this.doc.file = file;
  1219. this.doc.isUploading = true;
  1220. },
  1221. // /** 附件上传成功处理 */
  1222. // handleFileDocSuccess(response, file, fileList) {
  1223. // this.doc.isUploading = false;
  1224. // this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1225. // this.getFileList()
  1226. // },
  1227. //附件上传成功处理
  1228. handleFileDocSuccess(response, file, fileList) {
  1229. this.doc.isUploading = false;
  1230. this.fileList = fileList
  1231. if (response.code == 200){
  1232. this.$alert(this.$t('导入成功'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1233. }else {
  1234. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1235. }
  1236. },
  1237. handleRemove (file, fileList) {
  1238. this.fileList = fileList
  1239. },
  1240. /** 删除按钮操作 */
  1241. handleDeleteDoc(row) {
  1242. const ids = row.id || this.ids;
  1243. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1244. confirmButtonText: this.$t('确定'),
  1245. cancelButtonText: this.$t('取消'),
  1246. type: "warning"
  1247. }).then(function() {
  1248. return delCommonfile(ids);
  1249. }).then(() => {
  1250. this.getFileList();
  1251. this.msgSuccess(this.$t('删除成功'));
  1252. })
  1253. },
  1254. //文件预览
  1255. openPdf(){
  1256. //ppt就跳路由预览,office就直接打开文件新页面
  1257. const didi={ imgs:this.imgs}
  1258. if( this.pptView==true&&this.ppt==false){
  1259. let routeUrl = this.$router.resolve({
  1260. path: "/cpms/index.html#/pptyulan",
  1261. query:didi
  1262. });
  1263. window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
  1264. console.log(this.imgs)
  1265. }else {
  1266. window.open(this.pdf.pdfUrl)
  1267. }
  1268. },
  1269. handleSeePPT (row){
  1270. //ppt预览
  1271. this.loadingFlash=true
  1272. this.pdf.open =true
  1273. this.pdf.title = row.fileName
  1274. this.pdf.pdfUrl = row.fileUrl
  1275. this.pptView=true
  1276. this.ppt=false
  1277. const formatDate =new FormData();
  1278. formatDate.append("filepath",row.fileUrl)
  1279. //调用文件预览api
  1280. let res= this.officeConvert.pptConvertCommon(formatDate)
  1281. //查看接受的全局方法的返回结果 console.log(res)
  1282. //利用.then方法接受Promise对象
  1283. res.then((result)=>{
  1284. //关闭加载中
  1285. this.loadingFlash=false
  1286. //成功时直接给地址
  1287. this.videoList = result.data.imagePathList
  1288. //将返回的地址集合遍历添加到绑定的数组中
  1289. this.imgs=[]
  1290. for (var key=0;key<this.videoList.length;key++) {
  1291. this.imgs.push( process.env.VUE_APP_BASE_API+ this.videoList[key] );
  1292. }
  1293. }).catch(result => {
  1294. //请求失败,关闭loading,pdf地址直接为为空,不显示
  1295. this.pdf.pdfUrl =""
  1296. this.loadingFlash = false;
  1297. })
  1298. },
  1299. handleSee (row){
  1300. //office预览
  1301. this.loadingFlash=true
  1302. this.pdf.open =true
  1303. this.pdf.title = row.fileName
  1304. this.pdf.pdfUrl =""
  1305. this.pptView=false
  1306. this.ppt=true
  1307. //如果是PDF等直接可以打开的就不调接口,否则调用接口
  1308. if(row.fileName.endsWith('pdf')){
  1309. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  1310. this.loadingFlash=false
  1311. }
  1312. else{
  1313. const formatDate =new FormData();
  1314. formatDate.append("filepath",row.fileUrl)
  1315. //调用文件预览api
  1316. let res= this.officeConvert.officeConvertCommon(formatDate)
  1317. //查看接受的全局方法的返回结果 console.log(res)
  1318. //利用.then方法接受Promise对象
  1319. res.then((result)=>{
  1320. //关闭加载中
  1321. this.loadingFlash=false
  1322. if(result.msg.includes("csv")){
  1323. this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
  1324. this.$alert(result.msg, this.$t('检查乱码'), { dangerouslyUseHTMLString: true });
  1325. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  1326. }else if(result.msg.includes("不存在")){
  1327. //文件不存在时提示
  1328. this.pdf.pdfUrl =""
  1329. this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
  1330. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  1331. this.pdf.open =false
  1332. }else if(result.msg.includes("不支持此格式")){
  1333. this.pdf.pdfUrl =""
  1334. this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
  1335. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  1336. this.pdf.open =false
  1337. } else{
  1338. //成功时直接给地址
  1339. this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
  1340. }
  1341. // this.$nextTick(() => {
  1342. // const iframe = window.frames['iFrame']
  1343. // const handleLoad = () => {
  1344. // setTimeout(() => {
  1345. // const Do = (iframe.contentWindow || iframe.contentDocument)
  1346. // console.log(Do.document.getElementsByTagName('table')[0])
  1347. // Do.document.getElementsByTagName('table')[0].style.width = "100%"
  1348. // Do.document.getElementsByTagName('table')[0].setAttribute("class","table")
  1349. // }, 500)
  1350. // }
  1351. // iframe.addEventListener('load', handleLoad, true)
  1352. // })
  1353. }).catch(result => {
  1354. //请求失败,关闭loading,pdf地址直接为为空,不显示
  1355. this.pdf.pdfUrl =""
  1356. this.loadingFlash = false;
  1357. })
  1358. }
  1359. },
  1360. /** 加载当前登录员工信息 */
  1361. getLoginStaffInfo() {
  1362. getLoginStaffInfo().then(response => {
  1363. let staff = response.data;
  1364. if (staff != null) {
  1365. this.loginStaffInfo = response.data;
  1366. this.form.applicantDept = staff.unit;
  1367. if (staff.unit == '38') {
  1368. this.form.applicantTeam = staff.team;
  1369. }
  1370. this.form.applicant = staff.userId;
  1371. }
  1372. });
  1373. },
  1374. /** 加载登记人部门列表 */
  1375. getApplicantDeptOptions() {
  1376. this.applicantDeptOptions.push({ dictLabel: "CEP/E", dictValue: '38' });
  1377. this.applicantDeptOptions.push({ dictLabel: "CTA/B", dictValue: '12' });
  1378. this.applicantDeptOptions.push({ dictLabel: "CTM/B", dictValue: '14' });
  1379. },
  1380. /** 部门/班组值改变事件 */
  1381. handleDeptOrTeamChange() {
  1382. this.applicantOptions = [];
  1383. this.form.applicant = null;
  1384. let applicantDept = this.form.applicantDept;
  1385. if (applicantDept != '38') {
  1386. this.applicantTeamDisabled = true;
  1387. this.form.applicantTeam = null;
  1388. } else {
  1389. this.applicantTeamDisabled = false;
  1390. }
  1391. let applicantTeam = this.form.applicantTeam;
  1392. // 加载登记人列表
  1393. this.listStaffmgrByDeptAndTeam(applicantDept, null);
  1394. },
  1395. /** 加载登记人列表 */
  1396. listStaffmgrByDeptAndTeam(applicantDept, applicantTeam) {
  1397. listStaffmgrByDeptAndTeam({
  1398. deptId: applicantDept,
  1399. team: applicantTeam
  1400. }).then(response => {
  1401. let staffList = response.rows;
  1402. this.applicantOptions = [];
  1403. for (let i = 0; i < staffList.length; i++) {
  1404. let staffOption = {
  1405. dictLabel: staffList[i].name,
  1406. dictValue: staffList[i].userId
  1407. }
  1408. this.applicantOptions.push(staffOption);
  1409. }
  1410. });
  1411. },
  1412. /** 不安全行为/状态单选按钮值改变事件 */
  1413. handleUnsafeChoiceChange() {
  1414. if (this.unsafeChoice == '1') {
  1415. this.form.unsafeAction = null;
  1416. this.unsafeStatusDisabled = false;
  1417. this.unsafeActionDisabled = true;
  1418. } else if (this.unsafeChoice == '2') {
  1419. this.form.unsafeStatus = null;
  1420. this.unsafeStatusDisabled = true;
  1421. this.unsafeActionDisabled = false;
  1422. }
  1423. },
  1424. /** 流程图 */
  1425. processImg (processId) {
  1426. this.processImgVisible = true;
  1427. this.$nextTick(() => {
  1428. this.$refs.processImg.init(processId);
  1429. })
  1430. },
  1431. /** 处理延期操作 */
  1432. handleDelay(row) {
  1433. this.reset();
  1434. const saiApplyId = row.saiApplyId || this.ids
  1435. getApply(saiApplyId).then(response => {
  1436. this.delayForm = response.data;
  1437. if (this.delayForm.isRecorded != null) {
  1438. this.delayForm.isRecorded = this.delayForm.isRecorded.toString();
  1439. }
  1440. this.delayOpen = true;
  1441. this.title = "SAI开项申请延期";
  1442. });
  1443. },
  1444. /** 处理/详情操作 */
  1445. handleDetail(row) {
  1446. this.saiApplyVisible = true;
  1447. this.$nextTick(() => {
  1448. this.$refs.saiApplyDetail.init(row.saiApplyId, row.taskId, row.processId, row.taskName);
  1449. });
  1450. },
  1451. /** 提交申请操作 */
  1452. handleSubmit(row) {
  1453. this.$confirm('是否确认提交申请?', "警告", {
  1454. confirmButtonText: "确定",
  1455. cancelButtonText: "取消",
  1456. type: "warning"
  1457. }).then(function() {
  1458. return submitApply(row.saiApplyId);
  1459. }).then(() => {
  1460. this.getList();
  1461. this.msgSuccess("提交申请成功");
  1462. })
  1463. },
  1464. // 申请状态字典翻译
  1465. applyStatusFormat(row, column) {
  1466. return this.selectDictLabel(this.applyStatusOptions, row.applyStatus);
  1467. },
  1468. // 班组字典翻译
  1469. teamFormat(row, column) {
  1470. return this.selectDictLabel(this.applicantTeamOptions, row.applicantTeam);
  1471. },
  1472. /** 查询SAI开项管理列表 */
  1473. getList() {
  1474. this.loading = true;
  1475. getLoginStaffInfo().then(response => {
  1476. let staff = response.data;
  1477. if (staff != null) {
  1478. this.loginStaffInfo = response.data;
  1479. }
  1480. this.queryParams.tab = 1;
  1481. if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
  1482. this.queryParams.workArea = this.queryParams.workArea.join();
  1483. } else {
  1484. this.queryParams.workArea = "";
  1485. }
  1486. listApply(this.queryParams).then(response => {
  1487. if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
  1488. this.queryParams.workArea = this.queryParams.workArea.split(",");
  1489. }
  1490. // let rows = response.rows;
  1491. // this.applyList = [];
  1492. // for (let i = 0; i < rows.length; i++) {
  1493. // // 当前用户为流程当前处理人(之一),申请流程未结束
  1494. // if (rows[i].handler.indexOf(this.loginStaffInfo.userId) != -1 && rows[i].applyStatus != 4 && rows[i].applyStatus != 5) {
  1495. // this.applyList.push(rows[i]);
  1496. // }
  1497. // }
  1498. this.applyList = response.rows;
  1499. this.total = response.total;
  1500. this.loading = false;
  1501. });
  1502. });
  1503. },
  1504. /** 查询部门下拉树结构 */
  1505. getTreeselect() {
  1506. treeselect().then(response => {
  1507. this.deptOptions = response.data;
  1508. });
  1509. },
  1510. // 取消按钮
  1511. cancel() {
  1512. this.delayOpen = false;
  1513. this.saiOpen = false;
  1514. this.open = false;
  1515. this.reset();
  1516. },
  1517. // 表单重置
  1518. reset() {
  1519. this.form = {
  1520. saiApplyId: null,
  1521. delFlag: null,
  1522. createBy: null,
  1523. createTime: null,
  1524. updateBy: null,
  1525. updateTime: null,
  1526. deptId: null,
  1527. applyStatus: null,
  1528. apNo: null,
  1529. processId: null,
  1530. applicant: null,
  1531. assessor: null,
  1532. executor: null,
  1533. inspectors: null,
  1534. applicantDept: null,
  1535. applicantTeam: null,
  1536. description: null,
  1537. unsafeStatus: null,
  1538. unsafeAction: null,
  1539. applyDate: new Date(),
  1540. taskId: null,
  1541. handler: null,
  1542. taskName: null,
  1543. estimateFinishDate: null,
  1544. actualFinishDate: null,
  1545. isRecorded: null,
  1546. recordNo: null,
  1547. reaction: null,
  1548. needVe: null,
  1549. veItems: null,
  1550. veResult: null,
  1551. veItemOther: null,
  1552. applyDateStart: null,
  1553. applyDateEnd: null,
  1554. estimateFinishDateStart: null,
  1555. estimateFinishDateEnd: null,
  1556. };
  1557. this.resetForm("form");
  1558. },
  1559. /** 搜索按钮操作 */
  1560. handleQuery() {
  1561. this.queryParams.pageNum = 1;
  1562. if (this.applyDateRange != null) {
  1563. this.queryParams.applyDateStart = this.applyDateRange[0];
  1564. this.queryParams.applyDateEnd = this.applyDateRange[1];
  1565. } else {
  1566. this.queryParams.applyDateStart = null;
  1567. this.queryParams.applyDateEnd = null;
  1568. }
  1569. if (this.estimateFinishDateRange != null) {
  1570. this.queryParams.estimateFinishDateStart = this.estimateFinishDateRange[0];
  1571. this.queryParams.estimateFinishDateEnd = this.estimateFinishDateRange[1];
  1572. } else {
  1573. this.queryParams.estimateFinishDateStart = null;
  1574. this.queryParams.estimateFinishDateEnd = null;
  1575. }
  1576. this.getList();
  1577. },
  1578. /** 重置按钮操作 */
  1579. resetQuery() {
  1580. this.resetForm("queryForm");
  1581. this.handleQuery();
  1582. },
  1583. // 多选框选中数据
  1584. handleSelectionChange(selection) {
  1585. this.ids = selection.map(item => item.saiApplyId)
  1586. this.single = selection.length!==1
  1587. this.multiple = !selection.length
  1588. },
  1589. /** 新增按钮操作 */
  1590. handleAdd() {
  1591. this.reset();
  1592. this.fileList = [];
  1593. this.open = true;
  1594. this.title = "新增 TPM / SAI";
  1595. // 加载当前登录员工信息
  1596. this.getLoginStaffInfo();
  1597. this.applicantTeamDisabled = false;
  1598. },
  1599. /** 修改按钮操作 */
  1600. handleUpdate(row) {
  1601. this.reset();
  1602. const saiApplyId = row.saiApplyId || this.ids
  1603. listFile({
  1604. approveId: saiApplyId
  1605. }).then(response => {
  1606. this.doc.commonfileListApply = response;
  1607. });
  1608. getApply(saiApplyId).then(response => {
  1609. this.form = response.data;
  1610. if (this.form.unsafeStatus != null && this.form.unsafeStatus != "") {
  1611. this.form.unsafeStatus = this.form.unsafeStatus.toString();
  1612. }
  1613. if (this.form.unsafeAction != null && this.form.unsafeAction != "") {
  1614. this.form.unsafeAction = this.form.unsafeAction.toString();
  1615. }
  1616. if (this.form.category != null && this.form.category != "") {
  1617. this.form.category = Number(this.form.category);
  1618. }
  1619. this.fileList = [];
  1620. if (this.form.files.length > 0) {
  1621. console.log(this.form.files);
  1622. for (let i = 0; i < this.form.files.length; i++) {
  1623. let obj = {}
  1624. obj.name = this.form.files[i].fileName
  1625. obj.response = {};
  1626. obj.response.msg = this.form.files[i].fileUrl
  1627. this.fileList.push(obj)
  1628. }
  1629. }
  1630. this.open = true;
  1631. this.title = "修改SAI开项申请";
  1632. });
  1633. },
  1634. /** 新增/修改保存按钮 */
  1635. submitForm() {
  1636. this.submitDisabled = true;
  1637. this.form.files = []
  1638. if (this.fileList.length > 0) {
  1639. for (let i = 0; i < this.fileList.length; i++) {
  1640. let obj = {}
  1641. obj.fileName = this.fileList[i].name
  1642. obj.fileUrl = this.fileList[i].response.msg
  1643. this.form.files.push(obj)
  1644. }
  1645. }
  1646. this.$refs["form"].validate(valid => {
  1647. if (valid) {
  1648. if (this.form.saiApplyId != null) {
  1649. updateApply(this.form).then(response => {
  1650. this.msgSuccess("修改成功");
  1651. this.open = false;
  1652. this.submitDisabled = false;
  1653. this.getList();
  1654. });
  1655. } else {
  1656. addApply(this.form).then(response => {
  1657. this.msgSuccess("新增成功");
  1658. this.open = false;
  1659. this.submitDisabled = false;
  1660. this.getList();
  1661. });
  1662. }
  1663. } else {
  1664. this.submitDisabled = false;
  1665. }
  1666. });
  1667. },
  1668. /** 新增/修改提交按钮 */
  1669. handleSaveAndSubmit() {
  1670. this.submitDisabled = true;
  1671. this.form.files = []
  1672. if (this.fileList.length > 0) {
  1673. for (let i = 0; i < this.fileList.length; i++) {
  1674. let obj = {}
  1675. obj.fileName = this.fileList[i].name
  1676. obj.fileUrl = this.fileList[i].response.msg
  1677. this.form.files.push(obj)
  1678. }
  1679. }
  1680. this.$refs["form"].validate(valid => {
  1681. if (valid) {
  1682. saveAndSubmitApply(this.form).then(response => {
  1683. this.msgSuccess("提交成功");
  1684. this.submitDisabled = false;
  1685. this.open = false;
  1686. this.getList();
  1687. });
  1688. } else {
  1689. this.submitDisabled = false;
  1690. }
  1691. });
  1692. },
  1693. /** 统计至SAI检查台账提交按钮 */
  1694. submitSaiForm() {
  1695. for (let i = 0; i < this.saiList.length; i++) {
  1696. this.saiList[i].plantId = 103;
  1697. this.saiList[i].userDept = 103;
  1698. addSai(this.saiList[i]);
  1699. }
  1700. this.msgSuccess("提交成功");
  1701. this.saiOpen = false;
  1702. },
  1703. /** 延期提交按钮 */
  1704. submitDelayForm() {
  1705. this.$refs["delayForm"].validate(valid => {
  1706. if (valid) {
  1707. updateApply(this.delayForm).then(response => {
  1708. this.msgSuccess("延期成功");
  1709. this.delayOpen = false;
  1710. this.getList();
  1711. });
  1712. }
  1713. });
  1714. },
  1715. /** 统计至SAI检查台账按钮操作 */
  1716. handleAddSai(row) {
  1717. const saiApplyIds = row.saiApplyId || this.ids;
  1718. if(saiApplyIds.length != 0) {
  1719. this.saiList = [];
  1720. for (let i = 0; i < saiApplyIds.length; i ++) {
  1721. getApply(saiApplyIds[i]).then(response => {
  1722. let apply = response.data;
  1723. let sai = {};
  1724. sai.saiApplyId = apply.saiApplyId;
  1725. sai.plantId = "CBP/C";
  1726. sai.userDeptId = "CBP/C";
  1727. sai.inspectionDate = apply.applyDate;
  1728. sai.dificiency = apply.description;
  1729. sai.actions = apply.reaction;
  1730. sai.source = "装置";
  1731. sai.deptId = 103;
  1732. sai.saiLevel = apply.saiLevel;
  1733. sai.category = Number(apply.category);
  1734. sai.applicant = apply.applicant;
  1735. sai.applicantName = apply.applicantName;
  1736. this.saiList.push(sai);
  1737. });
  1738. }
  1739. this.saiOpen = true;
  1740. }
  1741. },
  1742. /** 删除按钮操作 */
  1743. handleDelete(row) {
  1744. const saiApplyIds = row.saiApplyId || this.ids;
  1745. this.$confirm('是否确认删除?', "警告", {
  1746. confirmButtonText: "确定",
  1747. cancelButtonText: "取消",
  1748. type: "warning"
  1749. }).then(function() {
  1750. return delApply(saiApplyIds);
  1751. }).then(() => {
  1752. this.getList();
  1753. this.msgSuccess("删除成功");
  1754. })
  1755. },
  1756. /** 导出全部按钮操作 */
  1757. handleExport() {
  1758. this.queryParams.ids = null;
  1759. const queryParams = this.queryParams;
  1760. this.$confirm('是否确认导出所有SAI开项管理数据项?', "警告", {
  1761. confirmButtonText: "确定",
  1762. cancelButtonText: "取消",
  1763. type: "warning"
  1764. }).then(function() {
  1765. return exportApply(queryParams);
  1766. }).then(response => {
  1767. this.download(response.msg);
  1768. })
  1769. },
  1770. /** 导出选中数据按钮操作 */
  1771. handleExportSelected() {
  1772. if (this.ids.length==0){
  1773. return this.$alert('请选择要导出的数据项!', "警告", {
  1774. confirmButtonText: "确定",
  1775. type: "warning"
  1776. })
  1777. }
  1778. if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
  1779. this.queryParams.workArea = this.queryParams.workArea.join();
  1780. } else {
  1781. this.queryParams.workArea = "";
  1782. }
  1783. const queryParams = this.queryParams;
  1784. queryParams.ids=this.ids;
  1785. console.log(queryParams)
  1786. this.$confirm('是否确认导出选中的SAI开项管理数据项?', "警告", {
  1787. confirmButtonText: "确定",
  1788. cancelButtonText: "取消",
  1789. type: "warning"
  1790. }).then(function () {
  1791. return exportApply(queryParams);
  1792. }).then(response => {
  1793. this.download(response.msg);
  1794. })
  1795. },
  1796. /** 导入按钮操作 */
  1797. handleImport() {
  1798. this.upload.title = "用户导入";
  1799. this.upload.open = true;
  1800. },
  1801. /** 下载模板操作 */
  1802. importTemplate() {
  1803. this.$refs['downloadFileForm'].submit()
  1804. },
  1805. // 文件上传中处理
  1806. handleFileUploadProgress(event, file, fileList) {
  1807. this.upload.isUploading = true;
  1808. },
  1809. // 文件上传成功处理
  1810. handleFileSuccess(response, file, fileList) {
  1811. this.upload.open = false;
  1812. this.upload.isUploading = false;
  1813. this.$refs.upload.clearFiles();
  1814. if (response.data[0] != null) {
  1815. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1816. }else {
  1817. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1818. }
  1819. this.getList();
  1820. },
  1821. // 提交上传文件
  1822. submitFileForm() {
  1823. this.$refs.upload.submit();
  1824. }
  1825. }
  1826. };
  1827. </script>