h118.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="巡检日期" prop="recordTime">
  5. <el-date-picker
  6. v-model="queryParams.recordTime"
  7. type="month"
  8. value-format="yyyy-MM"
  9. placeholder="选择巡检日期">
  10. </el-date-picker>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  14. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <el-row :gutter="10" class="mb8">
  18. <!--<el-col :span="1.5">-->
  19. <!--<el-button-->
  20. <!--type="primary"-->
  21. <!--icon="el-icon-plus"-->
  22. <!--size="mini"-->
  23. <!--@click="handleAdd"-->
  24. <!--v-hasPermi="['production:pressure:add']"-->
  25. <!--&gt;新增</el-button>-->
  26. <!--</el-col>-->
  27. <el-col :span="1.5">
  28. <el-button
  29. type="success"
  30. icon="el-icon-edit"
  31. size="mini"
  32. :disabled="single"
  33. @click="handleUpdate"
  34. v-hasPermi="['production:pressure:edit']"
  35. >修改</el-button>
  36. </el-col>
  37. <el-col :span="1.5">
  38. <el-button
  39. type="danger"
  40. icon="el-icon-delete"
  41. size="mini"
  42. :disabled="multiple"
  43. @click="handleDelete"
  44. v-hasPermi="['production:pressure:remove']"
  45. >删除</el-button>
  46. </el-col>
  47. <!--<el-col :span="1.5">-->
  48. <!--<el-button-->
  49. <!--type="info"-->
  50. <!--icon="el-icon-upload2"-->
  51. <!--size="mini"-->
  52. <!--@click="handleImport"-->
  53. <!--v-hasPermi="['production:pressure:edit']"-->
  54. <!--&gt;导入</el-button>-->
  55. <!--</el-col>-->
  56. <!--<el-col :span="1.5">-->
  57. <!--<el-button-->
  58. <!--type="warning"-->
  59. <!--icon="el-icon-download"-->
  60. <!--size="mini"-->
  61. <!--@click="handleExport"-->
  62. <!--v-hasPermi="['production:pressure:export']"-->
  63. <!--&gt;导出</el-button>-->
  64. <!--</el-col>-->
  65. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  66. </el-row>
  67. <el-table v-loading="loading" :data="pressureList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  68. <el-table-column type="selection" width="55" align="center" />
  69. <el-table-column label="裂解炉名称" align="center" prop="furnanceName" :show-overflow-tooltip="true" width="100"/>
  70. <el-table-column label="巡检日期" align="center" prop="recordTime" width="150">
  71. <template slot-scope="scope">
  72. <span>{{ parseTime(scope.row.recordTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="班组" align="center" prop="team" :show-overflow-tooltip="true" width="80" :formatter="teamFormat"/>
  76. <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" width="80" :formatter="statusFormat"/>
  77. <el-table-column label="PASS1出口" align="center" prop="pass1" :show-overflow-tooltip="true">
  78. <el-table-column label="入口" align="center" width="60">
  79. <template slot-scope="scope">
  80. <span>{{ scope.row.pass1[10] }}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column v-for="(item,index) in 10" :label="(index+1).toString()" align="center" width="60">
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.pass1[index] }}</span>
  86. </template>
  87. </el-table-column>
  88. </el-table-column>
  89. <el-table-column label="PASS2出口" align="center" prop="pass2" :show-overflow-tooltip="true">
  90. <el-table-column label="入口" align="center" width="60">
  91. <template slot-scope="scope">
  92. <span>{{ scope.row.pass2[10] }}</span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column v-for="(item,index) in 10" :label="(index+1).toString()" align="center" width="60">
  96. <template slot-scope="scope">
  97. <span>{{ scope.row.pass2[index] }}</span>
  98. </template>
  99. </el-table-column>
  100. </el-table-column>
  101. <el-table-column label="PASS3出口" align="center" prop="pass3" :show-overflow-tooltip="true">
  102. <el-table-column label="入口" align="center" width="60">
  103. <template slot-scope="scope">
  104. <span>{{ scope.row.pass3[10] }}</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column v-for="(item,index) in 10" :label="(index+1).toString()" align="center" width="60">
  108. <template slot-scope="scope">
  109. <span>{{ scope.row.pass3[index] }}</span>
  110. </template>
  111. </el-table-column>
  112. </el-table-column>
  113. <el-table-column label="PASS4出口" align="center" prop="pass4" :show-overflow-tooltip="true">
  114. <el-table-column label="入口" align="center" width="60">
  115. <template slot-scope="scope">
  116. <span>{{ scope.row.pass4[10] }}</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column v-for="(item,index) in 10" :label="(index+1).toString()" align="center" width="60">
  120. <template slot-scope="scope">
  121. <span>{{ scope.row.pass4[index] }}</span>
  122. </template>
  123. </el-table-column>
  124. </el-table-column>
  125. <el-table-column label="PASS5出口" align="center" prop="pass5" :show-overflow-tooltip="true">
  126. <el-table-column label="入口" align="center" width="60">
  127. <template slot-scope="scope">
  128. <span>{{ scope.row.pass5[10] }}</span>
  129. </template>
  130. </el-table-column>
  131. <el-table-column v-for="(item,index) in 10" :label="(index+1).toString()" align="center" width="60">
  132. <template slot-scope="scope">
  133. <span>{{ scope.row.pass5[index] }}</span>
  134. </template>
  135. </el-table-column>
  136. </el-table-column>
  137. <el-table-column label="PASS6出口" align="center" prop="pass6" :show-overflow-tooltip="true">
  138. <el-table-column label="入口" align="center" width="60">
  139. <template slot-scope="scope">
  140. <span>{{ scope.row.pass6[10] }}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column v-for="(item,index) in 10" :label="(index+1).toString()" align="center" width="60">
  144. <template slot-scope="scope">
  145. <span>{{ scope.row.pass6[index] }}</span>
  146. </template>
  147. </el-table-column>
  148. </el-table-column>
  149. <el-table-column label="PASS7出口" align="center" prop="pass7" :show-overflow-tooltip="true">
  150. <el-table-column label="入口" align="center" width="60">
  151. <template slot-scope="scope">
  152. <span>{{ scope.row.pass7[10] }}</span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column v-for="(item,index) in 10" :label="(index+1).toString()" align="center" width="60">
  156. <template slot-scope="scope">
  157. <span>{{ scope.row.pass7[index] }}</span>
  158. </template>
  159. </el-table-column>
  160. </el-table-column>
  161. <el-table-column label="PASS8出口" align="center" prop="pass8" :show-overflow-tooltip="true">
  162. <el-table-column label="入口" align="center" width="60">
  163. <template slot-scope="scope">
  164. <span>{{ scope.row.pass8[10] }}</span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column v-for="(item,index) in 10" :label="(index+1).toString()" align="center" width="60">
  168. <template slot-scope="scope">
  169. <span>{{ scope.row.pass8[index] }}</span>
  170. </template>
  171. </el-table-column>
  172. </el-table-column>
  173. <el-table-column label="操作" align="center" fixed="right" width="200" class-name="small-padding fixed-width">
  174. <template slot-scope="scope">
  175. <el-button
  176. size="mini"
  177. type="text"
  178. @click="handlePhoto(scope.row)"
  179. >现场照片</el-button>
  180. <el-button
  181. size="mini"
  182. type="text"
  183. icon="el-icon-edit"
  184. @click="handleUpdate(scope.row)"
  185. v-hasPermi="['production:pressure:edit']"
  186. >修改</el-button>
  187. <el-button
  188. size="mini"
  189. type="text"
  190. icon="el-icon-delete"
  191. @click="handleDelete(scope.row)"
  192. v-hasPermi="['production:pressure:remove']"
  193. >删除</el-button>
  194. </template>
  195. </el-table-column>
  196. </el-table>
  197. <pagination
  198. v-show="total>0"
  199. :total="total"
  200. :page.sync="queryParams.pageNum"
  201. :limit.sync="queryParams.pageSize"
  202. @pagination="getList"
  203. />
  204. <!-- 添加或修改裂解炉炉管测压对话框 -->
  205. <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
  206. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  207. <el-form-item label="裂解炉名称" prop="furnanceName">
  208. <el-input v-model="form.furnanceName" placeholder="请输入裂解炉名称" />
  209. </el-form-item>
  210. <el-form-item label="巡检日期" prop="recordTimeYmd">
  211. <el-date-picker clearable size="small" style="width: 200px"
  212. v-model="recordTimeYmd"
  213. type="date"
  214. value-format="yyyy-MM-dd"
  215. placeholder="选择巡检日期">
  216. </el-date-picker>
  217. </el-form-item>
  218. <el-form-item label="巡检时间" prop="recordTimeHms">
  219. <el-time-picker
  220. v-model="recordTimeHms"
  221. :picker-options="{selectableRange: '00:00:01 - 23:59:59'}"
  222. placeholder="请选择时间"
  223. value-format="HH:mm:ss"
  224. size="small"
  225. style="width: 200px">
  226. </el-time-picker>
  227. </el-form-item>
  228. <el-form-item label="班组">
  229. <el-select v-model="form.team" placeholder="请选择" size="small">
  230. <el-option
  231. v-for="item in teamOptions"
  232. :key="item.dictValue"
  233. :label="item.dictLabel"
  234. :value="item.dictValue">
  235. </el-option>
  236. </el-select>
  237. </el-form-item>
  238. <el-form-item label="记录人">
  239. <el-select v-model="form.recorder" placeholder="请选择" size="small">
  240. <el-option
  241. v-for="item in userList"
  242. :key="item.userId"
  243. :label="item.nickName"
  244. :value="item.userId">
  245. </el-option>
  246. </el-select>
  247. </el-form-item>
  248. <el-form-item label="状态">
  249. <el-select v-model="form.status" placeholder="请选择" size="small" @change="handleChange">
  250. <el-option
  251. v-for="item in statusOptions"
  252. :key="item.dictValue"
  253. :label="item.dictLabel"
  254. :value="item.dictValue">
  255. </el-option>
  256. </el-select>
  257. </el-form-item>
  258. <el-form-item label="归属部门" prop="deptId">
  259. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
  260. </el-form-item>
  261. </el-form>
  262. <el-descriptions title="PASS1出口" direction="vertical" :column="6" border>
  263. <el-descriptions-item label="入口">
  264. <el-input v-model="pass1[10]"/>
  265. </el-descriptions-item>
  266. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  267. <el-input v-model="pass1[index]"/>
  268. </el-descriptions-item>
  269. <el-descriptions-item label=""></el-descriptions-item>
  270. </el-descriptions><br/>
  271. <el-descriptions title="PASS2出口" direction="vertical" :column="6" border>
  272. <el-descriptions-item label="入口">
  273. <el-input v-model="pass2[10]"/>
  274. </el-descriptions-item>
  275. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  276. <el-input v-model="pass2[index]"/>
  277. </el-descriptions-item>
  278. <el-descriptions-item label=""></el-descriptions-item>
  279. </el-descriptions><br/>
  280. <el-descriptions title="PASS3出口" direction="vertical" :column="6" border>
  281. <el-descriptions-item label="入口">
  282. <el-input v-model="pass3[10]"/>
  283. </el-descriptions-item>
  284. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  285. <el-input v-model="pass3[index]"/>
  286. </el-descriptions-item>
  287. <el-descriptions-item label=""></el-descriptions-item>
  288. </el-descriptions><br/>
  289. <el-descriptions title="PASS4出口" direction="vertical" :column="6" border>
  290. <el-descriptions-item label="入口">
  291. <el-input v-model="pass4[10]"/>
  292. </el-descriptions-item>
  293. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  294. <el-input v-model="pass4[index]"/>
  295. </el-descriptions-item>
  296. <el-descriptions-item label=""></el-descriptions-item>
  297. </el-descriptions><br/>
  298. <el-descriptions title="PASS5出口" direction="vertical" :column="6" border>
  299. <el-descriptions-item label="入口">
  300. <el-input v-model="pass5[10]"/>
  301. </el-descriptions-item>
  302. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  303. <el-input v-model="pass5[index]"/>
  304. </el-descriptions-item>
  305. <el-descriptions-item label=""></el-descriptions-item>
  306. </el-descriptions><br/>
  307. <el-descriptions title="PASS6出口" direction="vertical" :column="6" border>
  308. <el-descriptions-item label="入口">
  309. <el-input v-model="pass6[10]"/>
  310. </el-descriptions-item>
  311. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  312. <el-input v-model="pass6[index]"/>
  313. </el-descriptions-item>
  314. <el-descriptions-item label=""></el-descriptions-item>
  315. </el-descriptions><br/>
  316. <el-descriptions title="PASS7出口" direction="vertical" :column="6" border>
  317. <el-descriptions-item label="入口">
  318. <el-input v-model="pass7[10]"/>
  319. </el-descriptions-item>
  320. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  321. <el-input v-model="pass7[index]"/>
  322. </el-descriptions-item>
  323. <el-descriptions-item label=""></el-descriptions-item>
  324. </el-descriptions><br/>
  325. <el-descriptions title="PASS8出口" direction="vertical" :column="6" border>
  326. <el-descriptions-item label="入口">
  327. <el-input v-model="pass8[10]"/>
  328. </el-descriptions-item>
  329. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  330. <el-input v-model="pass8[index]"/>
  331. </el-descriptions-item>
  332. <el-descriptions-item label=""></el-descriptions-item>
  333. </el-descriptions>
  334. <div slot="footer" class="dialog-footer">
  335. <el-button type="primary" @click="submitForm">确 定</el-button>
  336. <el-button @click="cancel">取 消</el-button>
  337. </div>
  338. </el-dialog>
  339. <!-- 用户导入对话框 -->
  340. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  341. <el-upload
  342. ref="upload"
  343. :limit="1"
  344. accept=".xlsx, .xls"
  345. :headers="upload.headers"
  346. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  347. :disabled="upload.isUploading"
  348. :on-progress="handleFileUploadProgress"
  349. :on-success="handleFileSuccess"
  350. :auto-upload="false"
  351. drag
  352. >
  353. <i class="el-icon-upload"></i>
  354. <div class="el-upload__text">
  355. 将文件拖到此处,或
  356. <em>点击上传</em>
  357. </div>
  358. <div class="el-upload__tip" slot="tip">
  359. <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
  360. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  361. </div>
  362. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  363. </el-upload>
  364. <div slot="footer" class="dialog-footer">
  365. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  366. <el-button @click="upload.open = false">取 消</el-button>
  367. </div>
  368. </el-dialog>
  369. <!-- 现场照片 -->
  370. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="800px" append-to-body >
  371. <el-tabs tab-position="left">
  372. <el-tab-pane label="PASS1">
  373. <el-upload ref="doc"
  374. :limit="1"
  375. :headers="doc.headers"
  376. :action="doc.url + '?pType=furnancePressurePass1&pId=' + doc.pId"
  377. :disabled="doc.isUploading"
  378. :on-progress="handleFileDocProgress"
  379. :on-success="handleFileDocSuccess"
  380. :auto-upload="true"
  381. drag
  382. >
  383. <i class="el-icon-upload"></i>
  384. <div class="el-upload__text">
  385. {{ $t('将文件拖到此处,或') }}
  386. <em>{{ $t('点击上传') }}</em>
  387. </div>
  388. </el-upload>
  389. <el-table :data="doc.commonfileList1" border>
  390. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  391. <template slot-scope="scope">
  392. <a class="link-type" @click="handleDownload(scope.row)">
  393. <span>{{ scope.row.fileName }}</span>
  394. </a>
  395. </template>
  396. </el-table-column>
  397. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  398. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  399. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  400. <template slot-scope="scope">
  401. <el-button
  402. size="mini"
  403. type="text"
  404. icon="el-icon-download"
  405. @click="handleDownload(scope.row)"
  406. >{{ $t('下载') }}</el-button>
  407. <el-button
  408. size="mini"
  409. type="text"
  410. icon="el-icon-delete"
  411. @click="handleDeleteDoc(scope.row)"
  412. >{{ $t('删除') }}</el-button>
  413. </template>
  414. </el-table-column>
  415. </el-table>
  416. </el-tab-pane>
  417. <el-tab-pane label="PASS2">
  418. <el-upload ref="doc"
  419. :limit="1"
  420. :headers="doc.headers"
  421. :action="doc.url + '?pType=furnancePressurePass2&pId=' + doc.pId"
  422. :disabled="doc.isUploading"
  423. :on-progress="handleFileDocProgress"
  424. :on-success="handleFileDocSuccess"
  425. :auto-upload="true"
  426. drag
  427. >
  428. <i class="el-icon-upload"></i>
  429. <div class="el-upload__text">
  430. {{ $t('将文件拖到此处,或') }}
  431. <em>{{ $t('点击上传') }}</em>
  432. </div>
  433. </el-upload>
  434. <el-table :data="doc.commonfileList2" border>
  435. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  436. <template slot-scope="scope">
  437. <a class="link-type" @click="handleDownload(scope.row)">
  438. <span>{{ scope.row.fileName }}</span>
  439. </a>
  440. </template>
  441. </el-table-column>
  442. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  443. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  444. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  445. <template slot-scope="scope">
  446. <el-button
  447. size="mini"
  448. type="text"
  449. icon="el-icon-download"
  450. @click="handleDownload(scope.row)"
  451. >{{ $t('下载') }}</el-button>
  452. <el-button
  453. size="mini"
  454. type="text"
  455. icon="el-icon-delete"
  456. @click="handleDeleteDoc(scope.row)"
  457. >{{ $t('删除') }}</el-button>
  458. </template>
  459. </el-table-column>
  460. </el-table>
  461. </el-tab-pane>
  462. <el-tab-pane label="PASS3">
  463. <el-upload ref="doc"
  464. :limit="1"
  465. :headers="doc.headers"
  466. :action="doc.url + '?pType=furnancePressurePass3&pId=' + doc.pId"
  467. :disabled="doc.isUploading"
  468. :on-progress="handleFileDocProgress"
  469. :on-success="handleFileDocSuccess"
  470. :auto-upload="true"
  471. drag
  472. >
  473. <i class="el-icon-upload"></i>
  474. <div class="el-upload__text">
  475. {{ $t('将文件拖到此处,或') }}
  476. <em>{{ $t('点击上传') }}</em>
  477. </div>
  478. </el-upload>
  479. <el-table :data="doc.commonfileList3" border>
  480. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  481. <template slot-scope="scope">
  482. <a class="link-type" @click="handleDownload(scope.row)">
  483. <span>{{ scope.row.fileName }}</span>
  484. </a>
  485. </template>
  486. </el-table-column>
  487. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  488. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  489. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  490. <template slot-scope="scope">
  491. <el-button
  492. size="mini"
  493. type="text"
  494. icon="el-icon-download"
  495. @click="handleDownload(scope.row)"
  496. >{{ $t('下载') }}</el-button>
  497. <el-button
  498. size="mini"
  499. type="text"
  500. icon="el-icon-delete"
  501. @click="handleDeleteDoc(scope.row)"
  502. >{{ $t('删除') }}</el-button>
  503. </template>
  504. </el-table-column>
  505. </el-table>
  506. </el-tab-pane>
  507. <el-tab-pane label="PASS4">
  508. <el-upload ref="doc"
  509. :limit="1"
  510. :headers="doc.headers"
  511. :action="doc.url + '?pType=furnancePressurePass4&pId=' + doc.pId"
  512. :disabled="doc.isUploading"
  513. :on-progress="handleFileDocProgress"
  514. :on-success="handleFileDocSuccess"
  515. :auto-upload="true"
  516. drag
  517. >
  518. <i class="el-icon-upload"></i>
  519. <div class="el-upload__text">
  520. {{ $t('将文件拖到此处,或') }}
  521. <em>{{ $t('点击上传') }}</em>
  522. </div>
  523. </el-upload>
  524. <el-table :data="doc.commonfileList4" border>
  525. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  526. <template slot-scope="scope">
  527. <a class="link-type" @click="handleDownload(scope.row)">
  528. <span>{{ scope.row.fileName }}</span>
  529. </a>
  530. </template>
  531. </el-table-column>
  532. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  533. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  534. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  535. <template slot-scope="scope">
  536. <el-button
  537. size="mini"
  538. type="text"
  539. icon="el-icon-download"
  540. @click="handleDownload(scope.row)"
  541. >{{ $t('下载') }}</el-button>
  542. <el-button
  543. size="mini"
  544. type="text"
  545. icon="el-icon-delete"
  546. @click="handleDeleteDoc(scope.row)"
  547. >{{ $t('删除') }}</el-button>
  548. </template>
  549. </el-table-column>
  550. </el-table>
  551. </el-tab-pane>
  552. <el-tab-pane label="PASS5">
  553. <el-upload ref="doc"
  554. :limit="1"
  555. :headers="doc.headers"
  556. :action="doc.url + '?pType=furnancePressurePass5&pId=' + doc.pId"
  557. :disabled="doc.isUploading"
  558. :on-progress="handleFileDocProgress"
  559. :on-success="handleFileDocSuccess"
  560. :auto-upload="true"
  561. drag
  562. >
  563. <i class="el-icon-upload"></i>
  564. <div class="el-upload__text">
  565. {{ $t('将文件拖到此处,或') }}
  566. <em>{{ $t('点击上传') }}</em>
  567. </div>
  568. </el-upload>
  569. <el-table :data="doc.commonfileList5" border>
  570. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  571. <template slot-scope="scope">
  572. <a class="link-type" @click="handleDownload(scope.row)">
  573. <span>{{ scope.row.fileName }}</span>
  574. </a>
  575. </template>
  576. </el-table-column>
  577. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  578. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  579. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  580. <template slot-scope="scope">
  581. <el-button
  582. size="mini"
  583. type="text"
  584. icon="el-icon-download"
  585. @click="handleDownload(scope.row)"
  586. >{{ $t('下载') }}</el-button>
  587. <el-button
  588. size="mini"
  589. type="text"
  590. icon="el-icon-delete"
  591. @click="handleDeleteDoc(scope.row)"
  592. >{{ $t('删除') }}</el-button>
  593. </template>
  594. </el-table-column>
  595. </el-table>
  596. </el-tab-pane>
  597. <el-tab-pane label="PASS6">
  598. <el-upload ref="doc"
  599. :limit="1"
  600. :headers="doc.headers"
  601. :action="doc.url + '?pType=furnancePressurePass6&pId=' + doc.pId"
  602. :disabled="doc.isUploading"
  603. :on-progress="handleFileDocProgress"
  604. :on-success="handleFileDocSuccess"
  605. :auto-upload="true"
  606. drag
  607. >
  608. <i class="el-icon-upload"></i>
  609. <div class="el-upload__text">
  610. {{ $t('将文件拖到此处,或') }}
  611. <em>{{ $t('点击上传') }}</em>
  612. </div>
  613. </el-upload>
  614. <el-table :data="doc.commonfileList6" border>
  615. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  616. <template slot-scope="scope">
  617. <a class="link-type" @click="handleDownload(scope.row)">
  618. <span>{{ scope.row.fileName }}</span>
  619. </a>
  620. </template>
  621. </el-table-column>
  622. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  623. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  624. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  625. <template slot-scope="scope">
  626. <el-button
  627. size="mini"
  628. type="text"
  629. icon="el-icon-download"
  630. @click="handleDownload(scope.row)"
  631. >{{ $t('下载') }}</el-button>
  632. <el-button
  633. size="mini"
  634. type="text"
  635. icon="el-icon-delete"
  636. @click="handleDeleteDoc(scope.row)"
  637. >{{ $t('删除') }}</el-button>
  638. </template>
  639. </el-table-column>
  640. </el-table>
  641. </el-tab-pane>
  642. <el-tab-pane label="PASS7">
  643. <el-upload ref="doc"
  644. :limit="1"
  645. :headers="doc.headers"
  646. :action="doc.url + '?pType=furnancePressurePass7&pId=' + doc.pId"
  647. :disabled="doc.isUploading"
  648. :on-progress="handleFileDocProgress"
  649. :on-success="handleFileDocSuccess"
  650. :auto-upload="true"
  651. drag
  652. >
  653. <i class="el-icon-upload"></i>
  654. <div class="el-upload__text">
  655. {{ $t('将文件拖到此处,或') }}
  656. <em>{{ $t('点击上传') }}</em>
  657. </div>
  658. </el-upload>
  659. <el-table :data="doc.commonfileList7" border>
  660. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  661. <template slot-scope="scope">
  662. <a class="link-type" @click="handleDownload(scope.row)">
  663. <span>{{ scope.row.fileName }}</span>
  664. </a>
  665. </template>
  666. </el-table-column>
  667. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  668. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  669. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  670. <template slot-scope="scope">
  671. <el-button
  672. size="mini"
  673. type="text"
  674. icon="el-icon-download"
  675. @click="handleDownload(scope.row)"
  676. >{{ $t('下载') }}</el-button>
  677. <el-button
  678. size="mini"
  679. type="text"
  680. icon="el-icon-delete"
  681. @click="handleDeleteDoc(scope.row)"
  682. >{{ $t('删除') }}</el-button>
  683. </template>
  684. </el-table-column>
  685. </el-table>
  686. </el-tab-pane>
  687. <el-tab-pane label="PASS8">
  688. <el-upload ref="doc"
  689. :limit="1"
  690. :headers="doc.headers"
  691. :action="doc.url + '?pType=furnancePressurePass8&pId=' + doc.pId"
  692. :disabled="doc.isUploading"
  693. :on-progress="handleFileDocProgress"
  694. :on-success="handleFileDocSuccess"
  695. :auto-upload="true"
  696. drag
  697. >
  698. <i class="el-icon-upload"></i>
  699. <div class="el-upload__text">
  700. {{ $t('将文件拖到此处,或') }}
  701. <em>{{ $t('点击上传') }}</em>
  702. </div>
  703. </el-upload>
  704. <el-table :data="doc.commonfileList8" border>
  705. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  706. <template slot-scope="scope">
  707. <a class="link-type" @click="handleDownload(scope.row)">
  708. <span>{{ scope.row.fileName }}</span>
  709. </a>
  710. </template>
  711. </el-table-column>
  712. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  713. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  714. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  715. <template slot-scope="scope">
  716. <el-button
  717. size="mini"
  718. type="text"
  719. icon="el-icon-download"
  720. @click="handleDownload(scope.row)"
  721. >{{ $t('下载') }}</el-button>
  722. <el-button
  723. size="mini"
  724. type="text"
  725. icon="el-icon-delete"
  726. @click="handleDeleteDoc(scope.row)"
  727. >{{ $t('删除') }}</el-button>
  728. </template>
  729. </el-table-column>
  730. </el-table>
  731. </el-tab-pane>
  732. </el-tabs>
  733. <div slot="footer" class="dialog-footer">
  734. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  735. </div>
  736. </el-dialog>
  737. </div>
  738. </template>
  739. <script>
  740. import { listPressure, getPressure, delPressure, addPressure, updatePressure, exportPressure, importTemplate} from "@/api/production/pressure";
  741. import { treeselect } from "@/api/system/dept";
  742. import { getToken } from "@/utils/auth";
  743. import Treeselect from "@riophae/vue-treeselect";
  744. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  745. import { listUserNoPage, getUserId } from "@/api/system/user";
  746. import {addCommonfile, allFileList, delCommonfile, updateCommonfile} from "@/api/common/commonfile";
  747. export default {
  748. name: "Pressure",
  749. components: { Treeselect },
  750. data() {
  751. return {
  752. // 遮罩层
  753. loading: true,
  754. // 选中数组
  755. ids: [],
  756. // 非单个禁用
  757. single: true,
  758. // 非多个禁用
  759. multiple: true,
  760. // 显示搜索条件
  761. showSearch: true,
  762. // 总条数
  763. total: 0,
  764. // 裂解炉炉管测压表格数据
  765. pressureList: [],
  766. // 弹出层标题
  767. title: "",
  768. // 部门树选项
  769. deptOptions: undefined,
  770. clientHeight:300,
  771. // 是否显示弹出层
  772. open: false,
  773. // 用户导入参数
  774. upload: {
  775. // 是否显示弹出层(用户导入)
  776. open: false,
  777. // 弹出层标题(用户导入)
  778. title: "",
  779. // 是否禁用上传
  780. isUploading: false,
  781. // 是否更新已经存在的用户数据
  782. updateSupport: 0,
  783. // 设置上传的请求头部
  784. headers: { Authorization: "Bearer " + getToken() },
  785. // 上传的地址
  786. url: process.env.VUE_APP_BASE_API + "/production/pressure/importData"
  787. },
  788. // 查询参数
  789. queryParams: {
  790. pageNum: 1,
  791. pageSize: 20,
  792. furnanceName: null,
  793. recordTime: null,
  794. pass1: null,
  795. pass2: null,
  796. pass3: null,
  797. pass4: null,
  798. pass5: null,
  799. pass6: null,
  800. pass7: null,
  801. pass8: null,
  802. pass9: null,
  803. pass10: null,
  804. pass11: null,
  805. pass12: null,
  806. pass13: null,
  807. pass14: null,
  808. pass15: null,
  809. pass16: null,
  810. deptId: null,
  811. },
  812. recordTime: null,
  813. // 表单参数
  814. form: {},
  815. pass1:[],
  816. pass2:[],
  817. pass3:[],
  818. pass4:[],
  819. pass5:[],
  820. pass6:[],
  821. pass7:[],
  822. pass8:[],
  823. pass9:[],
  824. pass10:[],
  825. pass11:[],
  826. pass12:[],
  827. pass13:[],
  828. pass14:[],
  829. pass15:[],
  830. pass16:[],
  831. // 表单校验
  832. rules: {
  833. id: [
  834. { required: true, message: "主键id不能为空", trigger: "blur" }
  835. ],
  836. },
  837. // 状态字典
  838. statusOptions: [],
  839. // 班组字典
  840. teamOptions: [],
  841. recordTimeYmd: null,
  842. recordTimeHms: null,
  843. // 用户列表
  844. userList: [],doc: {
  845. file: "",
  846. // 是否显示弹出层(报告附件)
  847. open: false,
  848. // 弹出层标题(报告附件)
  849. title: "附件",
  850. // 是否禁用上传
  851. isUploading: false,
  852. // 是否更新已经存在的用户数据
  853. updateSupport: 0,
  854. // 报告附件上传位置编号
  855. ids: 0,
  856. // 设置上传的请求头部
  857. headers: { Authorization: "Bearer " + getToken() },
  858. // 上传的地址
  859. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  860. commonfileList1: null,
  861. commonfileList2: null,
  862. commonfileList3: null,
  863. commonfileList4: null,
  864. commonfileList5: null,
  865. commonfileList6: null,
  866. commonfileList7: null,
  867. commonfileList8: null,
  868. queryParams: {
  869. pId: null
  870. },
  871. pId: null,
  872. form: {}
  873. },
  874. };
  875. },
  876. watch: {
  877. // 根据名称筛选部门树
  878. deptName(val) {
  879. this.$refs.tree.filter(val);
  880. }
  881. },
  882. created() {
  883. //设置表格高度对应屏幕高度
  884. this.$nextTick(() => {
  885. this.clientHeight = document.body.clientHeight -250
  886. })
  887. // this.getList();
  888. this.getTreeselect();
  889. this.getDicts("FURNANCE_STATUS").then(response => {
  890. this.statusOptions = response.data;
  891. });
  892. this.getDicts("TEAM_DIVIDE").then(response => {
  893. this.teamOptions = response.data;
  894. });
  895. this.listUser();
  896. },
  897. methods: {
  898. init() {
  899. this.getList();
  900. },
  901. // 现场照片
  902. handlePhoto(row) {
  903. this.doc.id = row.id;
  904. this.doc.title = row.furnanceName + " " + row.recordTime + " 现场照片";
  905. this.doc.open = true;
  906. this.doc.queryParams.pId = row.id
  907. this.doc.pId = row.id
  908. this.doc.commonfileList1 = null;
  909. this.doc.commonfileList2 = null;
  910. this.doc.commonfileList3 = null;
  911. this.doc.commonfileList4 = null;
  912. this.doc.commonfileList5 = null;
  913. this.doc.commonfileList6 = null;
  914. this.doc.commonfileList7 = null;
  915. this.doc.commonfileList8 = null;
  916. this.getFileList1();
  917. this.getFileList2();
  918. this.getFileList3();
  919. this.getFileList4();
  920. this.getFileList5();
  921. this.getFileList6();
  922. this.getFileList7();
  923. this.getFileList8();
  924. },
  925. getFileList1() {
  926. allFileList({
  927. "pId": this.doc.queryParams.pId,
  928. "pType": "furnancePressurePass1"
  929. }).then(response => {
  930. this.doc.commonfileList1 = response;
  931. });
  932. },
  933. getFileList2() {
  934. allFileList({
  935. "pId": this.doc.queryParams.pId,
  936. "pType": "furnancePressurePass2"
  937. }).then(response => {
  938. this.doc.commonfileList2 = response;
  939. });
  940. },
  941. getFileList3() {
  942. allFileList({
  943. "pId": this.doc.queryParams.pId,
  944. "pType": "furnancePressurePass3"
  945. }).then(response => {
  946. this.doc.commonfileList3 = response;
  947. });
  948. },
  949. getFileList4() {
  950. allFileList({
  951. "pId": this.doc.queryParams.pId,
  952. "pType": "furnancePressurePass4"
  953. }).then(response => {
  954. this.doc.commonfileList4 = response;
  955. });
  956. },
  957. getFileList5() {
  958. allFileList({
  959. "pId": this.doc.queryParams.pId,
  960. "pType": "furnancePressurePass5"
  961. }).then(response => {
  962. this.doc.commonfileList5 = response;
  963. });
  964. },
  965. getFileList6() {
  966. allFileList({
  967. "pId": this.doc.queryParams.pId,
  968. "pType": "furnancePressurePass6"
  969. }).then(response => {
  970. this.doc.commonfileList6 = response;
  971. });
  972. },
  973. getFileList7() {
  974. allFileList({
  975. "pId": this.doc.queryParams.pId,
  976. "pType": "furnancePressurePass7"
  977. }).then(response => {
  978. this.doc.commonfileList7 = response;
  979. });
  980. },
  981. getFileList8() {
  982. allFileList({
  983. "pId": this.doc.queryParams.pId,
  984. "pType": "furnancePressurePass8"
  985. }).then(response => {
  986. this.doc.commonfileList8 = response;
  987. });
  988. },
  989. //附件上传中处理
  990. handleFileDocProgress(event, file, fileList) {
  991. this.doc.file = file;
  992. this.doc.isUploading = true;
  993. },
  994. //附件上传成功处理
  995. handleFileDocSuccess(response, file, fileList) {
  996. this.doc.isUploading = false;
  997. this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  998. this.getFileList1()
  999. this.getFileList2()
  1000. this.getFileList3()
  1001. this.getFileList4()
  1002. this.getFileList5()
  1003. this.getFileList6()
  1004. this.getFileList7()
  1005. this.getFileList8()
  1006. },
  1007. // 文件下载处理
  1008. handleDownload(row) {
  1009. var name = row.fileName;
  1010. var url = row.fileUrl;
  1011. var suffix = url.substring(url.lastIndexOf("."), url.length);
  1012. const a = document.createElement('a')
  1013. a.setAttribute('download', name)
  1014. a.setAttribute('target', '_blank')
  1015. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  1016. a.click()
  1017. },
  1018. /** 删除按钮操作 */
  1019. handleDeleteDoc(row) {
  1020. const ids = row.id || this.ids;
  1021. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1022. confirmButtonText: this.$t('确定'),
  1023. cancelButtonText: this.$t('取消'),
  1024. type: "warning"
  1025. }).then(function () {
  1026. return delCommonfile(ids);
  1027. }).then(() => {
  1028. this.getFileList1();
  1029. this.getFileList2();
  1030. this.getFileList3();
  1031. this.getFileList4();
  1032. this.getFileList5();
  1033. this.getFileList6();
  1034. this.getFileList7();
  1035. this.getFileList8();
  1036. this.msgSuccess(this.$t('删除成功'));
  1037. })
  1038. },
  1039. listUser() {
  1040. listUserNoPage().then(response => {
  1041. this.userList = response.data;
  1042. });
  1043. },
  1044. // 班值字典翻译
  1045. teamFormat(row, column) {
  1046. return this.selectDictLabel(this.teamOptions, row.team);
  1047. },
  1048. // 字典翻译
  1049. statusFormat(row, column) {
  1050. return this.selectDictLabel(this.statusOptions, row.status);
  1051. },
  1052. handleChange() {
  1053. if (this.form.status === '1') {
  1054. this.pass1 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1055. this.pass2 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1056. this.pass3 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1057. this.pass4 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1058. this.pass5 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1059. this.pass6 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1060. this.pass7 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1061. this.pass8 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1062. this.pass9 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1063. this.pass10 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1064. this.pass11 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1065. this.pass12 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1066. this.pass13 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1067. this.pass14 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1068. this.pass15 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1069. this.pass16 = ["0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"];
  1070. } else {
  1071. this.pass1 = [];
  1072. this.pass2 = [];
  1073. this.pass3 = [];
  1074. this.pass4 = [];
  1075. this.pass5 = [];
  1076. this.pass6 = [];
  1077. this.pass7 = [];
  1078. this.pass8 = [];
  1079. this.pass9 = [];
  1080. this.pass10 = [];
  1081. this.pass11 = [];
  1082. this.pass12 = [];
  1083. this.pass13 = [];
  1084. this.pass14 = [];
  1085. this.pass15 = [];
  1086. this.pass16 = [];
  1087. }
  1088. },
  1089. /** 查询裂解炉炉管测压列表 */
  1090. getList() {
  1091. this.loading = true;
  1092. this.queryParams.furnanceName = "H118";
  1093. listPressure(this.queryParams).then(response => {
  1094. for (let i = 0; i< response.rows.length; i++) {
  1095. if (response.rows[i].pass1 == null) { response.rows[i].pass1 = []; } else { response.rows[i].pass1 = response.rows[i].pass1.split(','); }
  1096. if (response.rows[i].pass2 == null) { response.rows[i].pass2 = []; } else { response.rows[i].pass2 = response.rows[i].pass2.split(','); }
  1097. if (response.rows[i].pass3 == null) { response.rows[i].pass3 = []; } else { response.rows[i].pass3 = response.rows[i].pass3.split(','); }
  1098. if (response.rows[i].pass4 == null) { response.rows[i].pass4 = []; } else { response.rows[i].pass4 = response.rows[i].pass4.split(','); }
  1099. if (response.rows[i].pass5 == null) { response.rows[i].pass5 = []; } else { response.rows[i].pass5 = response.rows[i].pass5.split(','); }
  1100. if (response.rows[i].pass6 == null) { response.rows[i].pass6 = []; } else { response.rows[i].pass6 = response.rows[i].pass6.split(','); }
  1101. if (response.rows[i].pass7 == null) { response.rows[i].pass7 = []; } else { response.rows[i].pass7 = response.rows[i].pass7.split(','); }
  1102. if (response.rows[i].pass8 == null) { response.rows[i].pass8 = []; } else { response.rows[i].pass8 = response.rows[i].pass8.split(','); }
  1103. }
  1104. this.pressureList = response.rows;
  1105. this.total = response.total;
  1106. this.loading = false;
  1107. });
  1108. },
  1109. /** 查询部门下拉树结构 */
  1110. getTreeselect() {
  1111. treeselect().then(response => {
  1112. this.deptOptions = response.data;
  1113. });
  1114. },
  1115. // 取消按钮
  1116. cancel() {
  1117. this.open = false;
  1118. this.reset();
  1119. },
  1120. // 表单重置
  1121. reset() {
  1122. this.form = {
  1123. id: null,
  1124. furnanceName: null,
  1125. recordTime: null,
  1126. pass1: null,
  1127. pass2: null,
  1128. pass3: null,
  1129. pass4: null,
  1130. pass5: null,
  1131. pass6: null,
  1132. pass7: null,
  1133. pass8: null,
  1134. pass9: null,
  1135. pass10: null,
  1136. pass11: null,
  1137. pass12: null,
  1138. pass13: null,
  1139. pass14: null,
  1140. pass15: null,
  1141. pass16: null,
  1142. deptId: null,
  1143. delFlag: null,
  1144. createBy: null,
  1145. createTime: null,
  1146. updateBy: null,
  1147. updateTime: null,
  1148. };
  1149. this.pass1 = [];
  1150. this.pass2 = [];
  1151. this.pass3 = [];
  1152. this.pass4 = [];
  1153. this.pass5 = [];
  1154. this.pass6 = [];
  1155. this.pass7 = [];
  1156. this.pass8 = [];
  1157. this.pass9 = [];
  1158. this.pass10 = [];
  1159. this.pass11 = [];
  1160. this.pass12 = [];
  1161. this.pass13 = [];
  1162. this.pass14 = [];
  1163. this.pass15 = [];
  1164. this.pass16 = [];
  1165. this.resetForm("form");
  1166. },
  1167. /** 搜索按钮操作 */
  1168. handleQuery() {
  1169. this.queryParams.pageNum = 1;
  1170. this.getList();
  1171. },
  1172. /** 重置按钮操作 */
  1173. resetQuery() {
  1174. this.resetForm("queryForm");
  1175. this.handleQuery();
  1176. },
  1177. // 多选框选中数据
  1178. handleSelectionChange(selection) {
  1179. this.ids = selection.map(item => item.id)
  1180. this.single = selection.length!==1
  1181. this.multiple = !selection.length
  1182. },
  1183. /** 新增按钮操作 */
  1184. handleAdd() {
  1185. this.reset();
  1186. getUserId().then(response => {
  1187. this.form.recorder = response.data;
  1188. this.form.furnanceName = "H118";
  1189. this.open = true;
  1190. this.title = "添加裂解炉炉管测压";
  1191. });
  1192. },
  1193. /** 修改按钮操作 */
  1194. handleUpdate(row) {
  1195. this.reset();
  1196. const id = row.id || this.ids
  1197. getPressure(id).then(response => {
  1198. this.form = response.data;
  1199. let recordTime = new Date(this.form.recordTime);
  1200. this.recordTimeYmd = recordTime.getFullYear() + "-" + (recordTime.getMonth() + 1) + "-" + recordTime.getDate();
  1201. this.recordTimeHms = recordTime.getHours() + ":" + recordTime.getMinutes() + ":" + recordTime.getSeconds();
  1202. if (response.data.pass1 == null) { this.pass1 = []; } else { this.pass1 = response.data.pass1.split(','); }
  1203. if (response.data.pass2 == null) { this.pass2 = []; } else { this.pass2 = response.data.pass2.split(','); }
  1204. if (response.data.pass3 == null) { this.pass3 = []; } else { this.pass3 = response.data.pass3.split(','); }
  1205. if (response.data.pass4 == null) { this.pass4 = []; } else { this.pass4 = response.data.pass4.split(','); }
  1206. if (response.data.pass5 == null) { this.pass5 = []; } else { this.pass5 = response.data.pass5.split(','); }
  1207. if (response.data.pass6 == null) { this.pass6 = []; } else { this.pass6 = response.data.pass6.split(','); }
  1208. if (response.data.pass7 == null) { this.pass7 = []; } else { this.pass7 = response.data.pass7.split(','); }
  1209. if (response.data.pass8 == null) { this.pass8 = []; } else { this.pass8 = response.data.pass8.split(','); }
  1210. this.open = true;
  1211. this.title = "修改裂解炉炉管测压";
  1212. });
  1213. },
  1214. /** 提交按钮 */
  1215. submitForm() {
  1216. this.form.pass1 = this.pass1.join(",");
  1217. this.form.pass2 = this.pass2.join(",");
  1218. this.form.pass3 = this.pass3.join(",");
  1219. this.form.pass4 = this.pass4.join(",");
  1220. this.form.pass5 = this.pass5.join(",");
  1221. this.form.pass6 = this.pass6.join(",");
  1222. this.form.pass7 = this.pass7.join(",");
  1223. this.form.pass8 = this.pass8.join(",");
  1224. this.form.pass9 = this.pass9.join(",");
  1225. this.form.pass10 = this.pass10.join(",");
  1226. this.form.pass11 = this.pass11.join(",");
  1227. this.form.pass12 = this.pass12.join(",");
  1228. this.form.pass13 = this.pass13.join(",");
  1229. this.form.pass14 = this.pass14.join(",");
  1230. this.form.pass15 = this.pass15.join(",");
  1231. this.form.pass16 = this.pass16.join(",");
  1232. this.form.recordTime = this.recordTimeYmd + " " + this.recordTimeHms;
  1233. this.$refs["form"].validate(valid => {
  1234. if (valid) {
  1235. if (this.form.id != null) {
  1236. updatePressure(this.form).then(response => {
  1237. this.msgSuccess("修改成功");
  1238. this.open = false;
  1239. this.getList();
  1240. });
  1241. } else {
  1242. addPressure(this.form).then(response => {
  1243. this.msgSuccess("新增成功");
  1244. this.open = false;
  1245. this.getList();
  1246. });
  1247. }
  1248. }
  1249. });
  1250. },
  1251. /** 删除按钮操作 */
  1252. handleDelete(row) {
  1253. const ids = row.id || this.ids;
  1254. this.$confirm('是否确认删除?', "警告", {
  1255. confirmButtonText: "确定",
  1256. cancelButtonText: "取消",
  1257. type: "warning"
  1258. }).then(function() {
  1259. return delPressure(ids);
  1260. }).then(() => {
  1261. this.getList();
  1262. this.msgSuccess("删除成功");
  1263. })
  1264. },
  1265. /** 导出按钮操作 */
  1266. handleExport() {
  1267. const queryParams = this.queryParams;
  1268. this.$confirm('是否确认导出所有裂解炉炉管测压数据项?', "警告", {
  1269. confirmButtonText: "确定",
  1270. cancelButtonText: "取消",
  1271. type: "warning"
  1272. }).then(function() {
  1273. return exportPressure(queryParams);
  1274. }).then(response => {
  1275. this.download(response.msg);
  1276. })
  1277. },
  1278. /** 导入按钮操作 */
  1279. handleImport() {
  1280. this.upload.title = "用户导入";
  1281. this.upload.open = true;
  1282. },
  1283. /** 下载模板操作 */
  1284. importTemplate() {
  1285. importTemplate().then(response => {
  1286. this.download(response.msg);
  1287. });
  1288. },
  1289. // 文件上传中处理
  1290. handleFileUploadProgress(event, file, fileList) {
  1291. this.upload.isUploading = true;
  1292. },
  1293. // 文件上传成功处理
  1294. handleFileSuccess(response, file, fileList) {
  1295. this.upload.open = false;
  1296. this.upload.isUploading = false;
  1297. this.$refs.upload.clearFiles();
  1298. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  1299. this.getList();
  1300. },
  1301. // 提交上传文件
  1302. submitFileForm() {
  1303. this.$refs.upload.submit();
  1304. }
  1305. }
  1306. };
  1307. </script>