index.vue 67 KB

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