index.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164
  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="$t('关键字')" prop="searchValue" label-width="50">
  5. <el-input
  6. v-model="queryParams.searchValue"
  7. :placeholder="$t('请输入') + $t('关键字')"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item :label="$t('装置')" prop="plantCode">
  14. <el-input
  15. v-model="queryParams.plantCode"
  16. :placeholder="$t('请输入') + $t('装置')"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item :label="$t('单元')" prop="unit" label-width="50">
  23. <el-input
  24. v-model="queryParams.unit"
  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="devname" label-width="50">
  32. <el-input
  33. v-model="queryParams.devname"
  34. :placeholder="$t('请输入') + $t('设备名称')"
  35. clearable
  36. size="small"
  37. @keyup.enter.native="handleQuery"
  38. />
  39. </el-form-item>
  40. <el-form-item :label="$t('设备位号')" prop="devno" label-width="50">
  41. <el-input
  42. v-model="queryParams.devno"
  43. :placeholder="$t('请输入') + $t('位号')"
  44. clearable
  45. size="small"
  46. @keyup.enter.native="handleQuery"
  47. />
  48. </el-form-item>
  49. <el-form-item :label="$t('预警等级')" prop="ALARM_LEVEL" label-width="50">
  50. <el-select v-model="queryParams.warnFlag" clearable placeholder="请选择">
  51. <el-option
  52. v-for="item in filterList"
  53. :key="item.value"
  54. :label="item.text"
  55. :value="item.value">
  56. <div>
  57. <span v-if="item.value==1" style="width:45px;height:30px; float: left;background-color:#ffff00"> </span>
  58. <span v-if="item.value==1" style=" float: right; color: #121010 ; font-size: 16px">{{ item.text }}</span>
  59. <span v-if="item.value==2" style="width:45px;height:30px; float: left;background-color:#ff9900 "></span>
  60. <span v-if="item.value==2" style=" float: right; color: #121010 ; font-size: 16px">{{ item.text }}</span>
  61. <span v-if="item.value==3" style="width:45px;height:30px; float: left;background-color:#FF4500;"> </span>
  62. <span v-if="item.value==3" style=" float: right; color: #121010 ; font-size: 16px">{{ item.text }}</span>
  63. </div>
  64. </el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item :label="$t('申请状态')" prop="approveStatus" label-width="50">
  68. <el-select v-model="queryParams.approveStatus" :placeholder="$t('请选择') + $t('申请状态')" clearable size="small">
  69. <el-option
  70. v-for="dict in approveStatusOptions"
  71. :key="dict.dictValue"
  72. :label="dict.dictLabel"
  73. :value="dict.dictValue"
  74. />
  75. </el-select>
  76. </el-form-item>
  77. <el-form-item :label="$t('重复数据')" prop="isRepeat" label-width="50">
  78. <el-radio v-model="queryParams.isRepeat" label="1">全部数据</el-radio>
  79. <el-radio v-model="queryParams.isRepeat" label="2">重复数据</el-radio>
  80. </el-form-item>
  81. <el-form-item>
  82. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
  83. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
  84. </el-form-item>
  85. </el-form>
  86. <el-row :gutter="10" class="mb8">
  87. <el-col :span="1.5">
  88. <el-button
  89. type="primary"
  90. icon="el-icon-plus"
  91. size="mini"
  92. @click="handleAdd"
  93. v-hasPermi="['sems:specDzsb:add']"
  94. >{{ $t('新增') }}
  95. </el-button>
  96. </el-col>
  97. <el-col :span="1.5">
  98. <el-button
  99. type="success"
  100. icon="el-icon-edit"
  101. size="mini"
  102. :disabled="single"
  103. @click="handleUpdate"
  104. v-hasPermi="['sems:specDzsb:edit']"
  105. >{{ $t('修改') }}
  106. </el-button>
  107. </el-col>
  108. <el-col :span="1.5">
  109. <el-button
  110. type="danger"
  111. icon="el-icon-delete"
  112. size="mini"
  113. :disabled="multiple"
  114. @click="handleDelete"
  115. v-hasPermi="['sems:specDzsb:remove']"
  116. >{{ $t('删除') }}
  117. </el-button>
  118. </el-col>
  119. <el-col :span="1.5">
  120. <el-button
  121. type="success"
  122. size="mini"
  123. :disabled="multiple"
  124. @click="addAprrove('',devType)"
  125. >{{ $t('提交申请') }}
  126. </el-button>
  127. </el-col>
  128. <el-col :span="1.5">
  129. <el-button
  130. type="info"
  131. icon="el-icon-upload2"
  132. size="mini"
  133. @click="handleImport"
  134. v-hasPermi="['sems:specDzsb:edit']"
  135. >{{ $t('导入') }}
  136. </el-button>
  137. </el-col>
  138. <el-col :span="1.5">
  139. <el-button
  140. type="warning"
  141. icon="el-icon-download"
  142. size="mini"
  143. @click="handleExport"
  144. v-hasPermi="['sems:specDzsb:export']"
  145. >{{ $t('导出') }}
  146. </el-button>
  147. </el-col>
  148. <el-col :span="1.5">
  149. <el-button
  150. type="primary"
  151. icon="el-icon-download"
  152. size="mini"
  153. @click="inspectionInformation = true"
  154. v-hasPermi="['sems:specDzsb:add']"
  155. >{{ $t('检验更新') }}
  156. </el-button>
  157. </el-col>
  158. <el-col :span="1.5">
  159. <el-button
  160. type="danger"
  161. icon="el-icon-delete"
  162. size="mini"
  163. @click="handleDup"
  164. v-hasPermi="['system:plant:remove']"
  165. >{{ $t('数据去重') }}
  166. </el-button>
  167. </el-col>
  168. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  169. </el-row>
  170. <el-table v-loading="loading" ref="deviceTable" :data="specDzsbList" @selection-change="handleSelectionChange"
  171. :height="clientHeight" :row-key="row => { return row.id }" border :cell-style="tableCellStyle"
  172. @sort-change="sortList">
  173. <el-table-column type="selection" :reserve-selection="true" width="55" align="center"/>
  174. <el-table-column :label="$t('装置')" align="center" fixed="left" prop="plantCode" :show-overflow-tooltip="true"/>
  175. <el-table-column :label="$t('单元')" align="center" fixed="left" prop="unit" :show-overflow-tooltip="true"/>
  176. <el-table-column :label="$t('装置维修组')" align="center" fixed="left" prop="plantMaint"
  177. :show-overflow-tooltip="true"/>
  178. <el-table-column :label="$t('装置维修工程师')" align="center" fixed="left" prop="engineer"
  179. :show-overflow-tooltip="true"/>
  180. <el-table-column :label="$t('状态')" align="center" fixed="left" prop="status" :formatter="statusFormat"/>
  181. <el-table-column :label="$t('申请状态')" align="center" fixed="left" prop="approveStatus"
  182. :formatter="approveStatusFormat"/>
  183. <el-table-column :label="$t('设备名称')" align="center" fixed="left" prop="devname" :show-overflow-tooltip="true"/>
  184. <el-table-column :label="$t('设备位号')" align="center" fixed="left" prop="devno" :show-overflow-tooltip="true"/>
  185. <el-table-column :label="$t('档案号')" align="center" prop="docno" :show-overflow-tooltip="true"/>
  186. <el-table-column :label="$t('产品出厂编号')" align="center" prop="factoryNo" :show-overflow-tooltip="true"/>
  187. <el-table-column :label="$t('设备型号')" align="center" prop="model" :show-overflow-tooltip="true"/>
  188. <el-table-column :label="$t('起吊重量')+'(Ton)'" align="center" prop="capacity" :show-overflow-tooltip="true"/>
  189. <el-table-column :label="$t('使用地点')" align="center" prop="location" :show-overflow-tooltip="true"/>
  190. <el-table-column :label="$t('设备注册编号')" align="center" prop="regno" :show-overflow-tooltip="true"/>
  191. <el-table-column :label="$t('设备代码')" align="center" prop="devCode" :show-overflow-tooltip="true"/>
  192. <el-table-column :label="$t('投用日期')" align="center" prop="submitdate" width="100">
  193. <template slot-scope="scope">
  194. <span>{{ parseTime(scope.row.submitdate, '{y}-{m}-{d}') }}</span>
  195. </template>
  196. </el-table-column>
  197. <el-table-column :label="$t('制造单位')" align="center" prop="createUnit" :show-overflow-tooltip="true"/>
  198. <el-table-column :label="$t('是否防爆')" align="center" prop="isEx" :show-overflow-tooltip="true"/>
  199. <el-table-column :label="$t('检验单位')" align="center" prop="checkUnit" :show-overflow-tooltip="true"/>
  200. <el-table-column :label="$t('检验策略')" align="center" prop="checkStrategy" :show-overflow-tooltip="true"/>
  201. <el-table-column :label="$t('检验日期')" align="center" prop="warnDate" width="100">
  202. <template slot-scope="scope">
  203. <span>{{ parseTime(scope.row.warnDate, '{y}-{m}-{d}') }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column :label="$t('下次检验日期')" align="center" prop="nextWarnDate" width="100" sortable="custom">
  207. <template slot-scope="scope">
  208. <span>{{ parseTime(scope.row.nextWarnDate, '{y}-{m}-{d}') }}</span>
  209. </template>
  210. </el-table-column>
  211. <el-table-column :label="$t('检验报告编号')" align="center" prop="reportNo" :show-overflow-tooltip="true"/>
  212. <el-table-column :label="$t('定期检验结论')" align="center" prop="perTestConclusion" :show-overflow-tooltip="true"/>
  213. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  214. <el-table-column :label="$t('备注2')" align="center" prop="remarks2" :render-header="remarksHeader" :show-overflow-tooltip="true"/>
  215. <el-table-column :label="$t('操作')" align="center" fixed="right" width="140"
  216. class-name="small-padding fixed-width">
  217. <template slot-scope="scope">
  218. <el-button
  219. type="text"
  220. size="mini"
  221. @click="addAprrove(scope.row,devType)"
  222. >{{ $t('提交申请') }}
  223. </el-button>
  224. <el-button v-if="scope.row.approveTime != null" type="text" size="small"
  225. @click="hisApprove(scope.row,devType)">
  226. {{ $t('申请记录') }}
  227. </el-button>
  228. <br>
  229. <el-button
  230. style="margin-left: 0px"
  231. type="text"
  232. size="mini"
  233. @click="checkList(scope.row,devType)"
  234. >{{ $t('检验记录') }}
  235. </el-button>
  236. <el-button
  237. v-if="scope.row.hiFlag!= 0"
  238. type="text"
  239. size="mini"
  240. @click="hisReform(scope.row)"
  241. >{{ $t('改造记录') }}
  242. </el-button>
  243. </template>
  244. </el-table-column>
  245. </el-table>
  246. <pagination
  247. v-show="total>0"
  248. :total="total"
  249. :page.sync="queryParams.pageNum"
  250. :page-sizes="[20,100,300,500]"
  251. :limit.sync="queryParams.pageSize"
  252. @pagination="getList"
  253. />
  254. <!-- 添加或修改特种设备起重机械台账对话框 -->
  255. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" width="75%" append-to-body>
  256. <el-form ref="form" :model="form" :rules="rules" label-width="130px">
  257. <el-row>
  258. <el-col :span="6">
  259. <el-form-item :label="$t('装置')" prop="plantCode">
  260. <el-select v-model="form.plantCode" :placeholder="$t('请选择')+ $t('装置')" filterable clearable size="small"
  261. v-bind:disabled="dataForm==1">
  262. <el-option
  263. v-for="dict in plantOptions"
  264. :key="dict.name"
  265. :label="dict.name"
  266. :value="dict.name"
  267. />
  268. </el-select>
  269. </el-form-item>
  270. </el-col>
  271. <el-col :span="6">
  272. <el-form-item :label="$t('单元')" prop="unit">
  273. <el-input v-model="form.unit" :placeholder="$t('请选择')+ $t('单元')"/>
  274. </el-form-item>
  275. </el-col>
  276. <el-col :span="12">
  277. <el-form-item :label="$t('装置维修组')" prop="plantMaint">
  278. <el-select v-model="form.plantMaint" :placeholder="$t('请选择')+ $t('装置维修组')" filterable clearable
  279. size="small">
  280. <el-option
  281. v-for="dict in plantMaintOptions"
  282. :key="dict.dictValue"
  283. :label="dict.dictValue"
  284. :value="dict.dictValue"
  285. />
  286. </el-select>
  287. </el-form-item>
  288. </el-col>
  289. </el-row>
  290. <el-row>
  291. <el-col :span="12">
  292. <el-form-item :label="$t('装置维修工程师')" prop="engineer">
  293. <el-input v-model="form.engineer" :placeholder="$t('请输入')+ $t('工程师')"/>
  294. </el-form-item>
  295. </el-col>
  296. <el-col :span="12">
  297. <el-form-item :label="$t('设备名称')" prop="devname">
  298. <el-input v-model="form.devname" :placeholder="$t('请输入')+ $t('设备名称')"/>
  299. </el-form-item>
  300. </el-col>
  301. </el-row>
  302. <el-row>
  303. <el-col :span="12">
  304. <el-form-item :label="$t('设备位号')" prop="devno">
  305. <el-input v-model="form.devno" :placeholder="$t('请输入')+ $t('设备位号')"/>
  306. </el-form-item>
  307. </el-col>
  308. <el-col :span="12">
  309. <el-form-item :label="$t('档案号')" prop="docno">
  310. <el-input v-model="form.docno" :placeholder="$t('请输入')+ $t('档案号')"/>
  311. </el-form-item>
  312. </el-col>
  313. </el-row>
  314. <el-row>
  315. <el-col :span="12">
  316. <el-form-item :label="$t('产品出厂编号')" prop="factoryNo">
  317. <el-input v-model="form.factoryNo" :placeholder="$t('请输入')+ $t('产品出厂编号')"/>
  318. </el-form-item>
  319. </el-col>
  320. <el-col :span="12">
  321. <el-form-item :label="$t('设备代码')" prop="devCode">
  322. <el-input v-model="form.devCode" :placeholder="$t('请输入')+ $t('设备代码')"/>
  323. </el-form-item>
  324. </el-col>
  325. </el-row>
  326. <el-row>
  327. <el-col :span="12">
  328. <el-form-item :label="$t('设备型号')" prop="model">
  329. <el-input v-model="form.model" :placeholder="$t('请输入')+ $t('设备型号')"/>
  330. </el-form-item>
  331. </el-col>
  332. <el-col :span="12">
  333. <el-form-item :label="$t('起吊重量')+'(Ton)'" prop="capacity">
  334. <el-input v-model="form.capacity" :placeholder="$t('请输入')+ $t('起吊重量')"/>
  335. </el-form-item>
  336. </el-col>
  337. </el-row>
  338. <el-row>
  339. <el-col :span="12">
  340. <el-form-item :label="$t('使用地点')" prop="location">
  341. <el-input v-model="form.location" :placeholder="$t('请输入')+ $t('设备使用地点')"/>
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="12">
  345. <el-form-item :label="$t('设备注册编号')" prop="regno">
  346. <el-input v-model="form.regno" v-bind:disabled="dataForm == 1" :placeholder="$t('请输入')+ $t('注册代码')"/>
  347. </el-form-item>
  348. </el-col>
  349. </el-row>
  350. <el-row>
  351. <el-col :span="12">
  352. <el-form-item :label="$t('制造单位')" prop="createUnit">
  353. <el-input v-model="form.createUnit" :placeholder="$t('请输入')+ $t('制造单位')"/>
  354. </el-form-item>
  355. </el-col>
  356. <el-col :span="12">
  357. <el-form-item :label="$t('是否防爆')" prop="isEx">
  358. <el-input v-model="form.isEx" :placeholder="$t('请输入')+ $t('是否防爆')"/>
  359. </el-form-item>
  360. </el-col>
  361. </el-row>
  362. <el-row>
  363. <el-col :span="12">
  364. <el-form-item :label="$t('投用日期')" prop="submitdate">
  365. <el-date-picker clearable size="small" style="width: 200px"
  366. v-model="form.submitdate"
  367. type="date"
  368. value-format="yyyy-MM-dd"
  369. :placeholder="$t('请选择')+ $t('提交日期')">
  370. </el-date-picker>
  371. </el-form-item>
  372. </el-col>
  373. <el-col :span="12">
  374. <el-form-item :label="$t('检验单位')" prop="checkUnit">
  375. <el-input v-model="form.checkUnit" :placeholder="$t('请输入')+ $t('检验单位')"/>
  376. </el-form-item>
  377. </el-col>
  378. </el-row>
  379. <el-row>
  380. <el-col :span="12">
  381. <el-form-item :label="$t('检验策略')" prop="checkStrategy">
  382. <el-input v-model="form.checkStrategy" :placeholder="$t('请输入')+ $t('检验策略')"/>
  383. </el-form-item>
  384. </el-col>
  385. <el-col :span="12">
  386. <el-form-item :label="$t('检验日期')" prop="warnDate">
  387. <el-date-picker clearable size="small" style="width: 200px"
  388. v-model="form.warnDate"
  389. type="date"
  390. value-format="yyyy-MM-dd"
  391. :placeholder="$t('请选择')+ $t('上次年检时间')">
  392. </el-date-picker>
  393. </el-form-item>
  394. </el-col>
  395. </el-row>
  396. <el-row>
  397. <el-col :span="12">
  398. <el-form-item :label="$t('下次检验日期')" prop="nextWarnDate">
  399. <el-date-picker clearable size="small" style="width: 200px"
  400. v-model="form.nextWarnDate"
  401. type="date"
  402. value-format="yyyy-MM-dd"
  403. :placeholder="$t('请选择')+ $t('下次检验日期')">
  404. </el-date-picker>
  405. </el-form-item>
  406. </el-col>
  407. <el-col :span="12">
  408. <el-form-item :label="$t('检验报告编号')" prop="reportNo">
  409. <el-input v-model="form.reportNo" :placeholder="$t('请输入')+ $t('报告编号')"/>
  410. </el-form-item>
  411. </el-col>
  412. </el-row>
  413. <el-row>
  414. <el-col :span="12">
  415. <el-form-item :label="$t('备注')" prop="remarks">
  416. <el-input v-model="form.remarks" :placeholder="$t('请输入')+ $t('备注')"/>
  417. </el-form-item>
  418. </el-col>
  419. <el-col :span="12">
  420. <el-form-item :label="$t('定期检验结论')" prop="perTestConclusion">
  421. <el-input v-model="form.perTestConclusion" type="textarea" :placeholder="$t('请输入')+ $t('定期检验结论')"/>
  422. </el-form-item>
  423. </el-col>
  424. <!-- <el-col :span="12">
  425. <el-form-item :label="$t('归属部门')" prop="deptId">
  426. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :placeholder="$t('请选择')+ $t('归属部门')" />
  427. </el-form-item>
  428. </el-col>-->
  429. </el-row>
  430. <el-row>
  431. <el-col :span="12">
  432. <el-form-item v-if="dataForm == 0" :label="$t('确认人')" prop="wxjl">
  433. <el-select v-model="form.wxjl" :placeholder="$t('请选择')+ $t('装置维修经理')" filterable clearable size="small">
  434. <el-option
  435. v-for="dict in wxjlList"
  436. :key="dict.userId"
  437. :label="dict.nickName"
  438. :value="dict.userId"
  439. />
  440. </el-select>
  441. </el-form-item>
  442. </el-col>
  443. <el-col :span="12">
  444. <el-form-item :label="$t('备注2')" prop="remarks2">
  445. <el-input v-model="form.remarks2" :placeholder="$t('请输入')+ $t('备注2')"/>
  446. </el-form-item>
  447. </el-col>
  448. </el-row>
  449. </el-form>
  450. <div slot="footer" class="dialog-footer">
  451. <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
  452. <el-button @click="cancel">{{ $t('取 消') }}</el-button>
  453. </div>
  454. </el-dialog>
  455. <!-- 用户导入对话框 -->
  456. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  457. <div style="margin-bottom: 20px;">
  458. {{ $t('确认人') }}
  459. <el-select v-model="upload.submitData.wxjl" :placeholder="$t('请选择')+ $t('装置维修经理')" filterable clearable
  460. size="small">
  461. <el-option
  462. v-for="dict in wxjlList"
  463. :key="dict.userId"
  464. :label="dict.nickName"
  465. :value="dict.userId"
  466. />
  467. </el-select>
  468. </div>
  469. <el-upload
  470. ref="upload"
  471. :limit="1"
  472. accept=".xlsx, .xls"
  473. :data="upload.submitData"
  474. :headers="upload.headers"
  475. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  476. :disabled="upload.isUploading"
  477. :on-progress="handleFileUploadProgress"
  478. :on-success="handleFileSuccess"
  479. :auto-upload="false"
  480. drag
  481. >
  482. <i class="el-icon-upload"></i>
  483. <div class="el-upload__text">
  484. {{ $t('将文件拖到此处,或') }}
  485. <em>{{ $t('点击上传') }}</em>
  486. </div>
  487. <div class="el-upload__tip" slot="tip">
  488. <!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  489. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  490. </div>
  491. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  492. <input name="type" :value="upload.type" hidden/>
  493. </form>
  494. <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  495. <div class="el-upload__tip" style="color:red" slot="tip"> Excel单元格式为文本格式 </div>
  496. </el-upload>
  497. <div slot="footer" class="dialog-footer">
  498. <a v-if="waitSubmit" style="margin-right: 300px">{{ $t('正在导入...') }}</a>
  499. <el-button type="primary" @click="submitFileForm"
  500. v-loading.fullscreen.lock="fullscreenLoading">{{ $t('确定') }}
  501. </el-button>
  502. <el-button @click="upload.open = false">{{ $t('取消') }}</el-button>
  503. </div>
  504. </el-dialog>
  505. <form ref="downloadDevForm" :action="downloadDevAction" target="FORMSUBMIT">
  506. <input name="devType" v-model="devType" hidden/>
  507. <input name="ids" v-model="ids" hidden/>
  508. <input name="downloadType" v-model="downloadType" hidden/>
  509. </form>
  510. <el-dialog :close-on-click-modal="false" :title="$t('检验更新')" width="30%" :visible.sync="inspectionInformation">
  511. <el-form ref="dateform" label-width="120px">
  512. <el-form-item>
  513. <span>{{ $t('已选择') }} {{ dataListSelections.length }}</span>
  514. </el-form-item>
  515. <el-form-item>
  516. <el-button type="primary" :disabled="dataListSelections.length <= 0" @click="downloadDev(2)">
  517. {{ $t('downloadSelect') }}
  518. </el-button>
  519. </el-form-item>
  520. <el-upload
  521. class="upload-demo"
  522. drag
  523. ref="upload"
  524. :limit="5"
  525. :show-file-list="false"
  526. :on-success="handleFileSuccess"
  527. :auto-upload="true"
  528. :headers="upload.headers"
  529. :action="uploadUrl(2)"
  530. multiple>
  531. <i class="el-icon-upload"></i>
  532. <div class="el-upload__text">{{ $t('文件') }}<em>{{ $t('点击上传') }}</em></div>
  533. <div class="el-upload__tip" slot="tip">{{ $t('仅支持excel格式') }}</div>
  534. </el-upload>
  535. </el-form>
  536. <div slot="footer" class="dialog-footer">
  537. <el-button @click="inspectionInformation = false">{{ $t('返回') }}</el-button>
  538. </div>
  539. </el-dialog>
  540. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="modifyTitle" :visible.sync="modifyVisible" width="550px" append-to-body>
  541. <el-form ref="modifyForm" :model="modifyForm" :rules="modifyRules">
  542. <el-form-item :label="$t('确认人')" prop="wxjl">
  543. <el-select v-model="modifyForm.wxjl" :placeholder="$t('请选择')+ $t('装置维修经理')" filterable clearable size="small">
  544. <el-option
  545. v-for="dict in wxjlList"
  546. :key="dict.userId"
  547. :label="dict.nickName"
  548. :value="dict.userId"
  549. />
  550. </el-select>
  551. </el-form-item>
  552. </el-form>
  553. <el-button type="primary" @click="submitModofyForm">{{ $t('提交') }}</el-button>
  554. </el-dialog>
  555. <add-approve v-if="addAprroveVisible" ref="addApprove" @refreshDataList="getList"></add-approve>
  556. <his-approve v-if="hisAprroveVisible" ref="hisApprove" @refreshDataList="getList"></his-approve>
  557. <his-check v-if="hisCheckVisible" ref="hisCheck" @refreshDataList="getList"></his-check>
  558. <HisReform v-if="hisReformVisible" ref="hisReformList"></HisReform>
  559. </div>
  560. </template>
  561. <script>
  562. import {
  563. addSpecDzsb,
  564. exportSpecList,
  565. exportSpecDzsb,
  566. getSpecDzsb,
  567. listSpecDzsb,
  568. updateSpecDzsb, duplicate
  569. } from "@/api/sems/specDzsb";
  570. import {treeselect} from "@/api/system/dept";
  571. import {getToken} from "@/utils/auth";
  572. import Treeselect from "@riophae/vue-treeselect";
  573. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  574. import AddApprove from "../approve/tapprove-add"
  575. import {mylistPlant} from "@/api/system/plant";
  576. import HisApprove from "../approve/tapprove-his";
  577. import HisCheck from "../check/check";
  578. import {addModify} from "@/api/sems/his/modify";
  579. import {listPostUser} from "@/api/system/user";
  580. import HisReform from "./specDzsb-hisReform";
  581. export default {
  582. name: "SpecDzsb",
  583. components: {Treeselect, AddApprove, HisApprove, HisCheck, HisReform},
  584. data() {
  585. return {
  586. filterList: [], //删选的list
  587. fullscreenLoading: false,
  588. waitSubmit: false,
  589. hisReformVisible: false,
  590. dataForm: 0,
  591. devType: 3,
  592. // 遮罩层
  593. loading: true,
  594. addAprroveVisible: false,
  595. hisAprroveVisible: false,
  596. hisCheckVisible: false,
  597. inspectionInformation: false,
  598. downloadType: '',
  599. downloadDevAction: process.env.VUE_APP_BASE_API + '/common/download/exportDevList',
  600. modifyTitle: this.$t('设备修改申请'),
  601. modifyVisible: false,
  602. // 选中数组
  603. ids: [],
  604. dataListSelections: [],
  605. // 非单个禁用
  606. single: true,
  607. // 非多个禁用
  608. multiple: true,
  609. // 显示搜索条件
  610. showSearch: false,
  611. // 总条数
  612. total: 0,
  613. // 特种设备起重机械台账表格数据
  614. specDzsbList: [],
  615. // 弹出层标题
  616. title: "",
  617. // 部门树选项
  618. deptOptions: undefined,
  619. clientHeight: 300,
  620. // 是否显示弹出层
  621. open: false,
  622. // 状态字典
  623. statusOptions: [],
  624. plantOptions: [],
  625. plantMaintOptions: [],
  626. // 申请状态字典
  627. approveStatusOptions: [],
  628. wxjlList: [],
  629. // 用户导入参数
  630. upload: {
  631. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  632. // 是否显示弹出层(用户导入)
  633. type: "specDzsb",
  634. // 是否显示弹出层(用户导入)
  635. open: false,
  636. // 弹出层标题(用户导入)
  637. title: "",
  638. // 是否禁用上传
  639. isUploading: false,
  640. // 是否更新已经存在的用户数据
  641. updateSupport: 0,
  642. // 设置上传的请求头部
  643. headers: {Authorization: "Bearer " + getToken()},
  644. // 上传的地址
  645. url: process.env.VUE_APP_BASE_API + "/sems/specDzsb/importData",
  646. submitData: {wxjl: null}
  647. },
  648. // 查询参数
  649. queryParams: {
  650. searchValue: null,
  651. pageNum: 1,
  652. pageSize: 20,
  653. orderByColumn: null,
  654. isAsc: null,
  655. plantCode: null,
  656. unit: null,
  657. devname: null,
  658. devno: null,
  659. submitdate: null,
  660. remarks: null,
  661. approveStatus: null,
  662. regno: null,
  663. useno: null,
  664. warnDate: null,
  665. warnCycle: null,
  666. nextWarnDate: null,
  667. warnFlag: null,
  668. plantMaint: null,
  669. docno: null,
  670. model: null,
  671. capacity: null,
  672. location: null,
  673. isEX: null,
  674. status: 1,
  675. },
  676. // 表单参数
  677. form: {},
  678. modifyForm: {},
  679. // 表单校验
  680. rules: {
  681. plantCode: [
  682. {required: true, message: this.$t('装置名称') + this.$t('不能为空'), trigger: "blur"}
  683. ],
  684. wxjl: [
  685. {required: true, message: this.$t('维修经理') + this.$t('不能为空'), trigger: "blur"}
  686. ],
  687. },
  688. modifyRules: {
  689. wxjl: [
  690. {required: true, message: this.$t('维修经理') + this.$t('不能为空'), trigger: "blur"}
  691. ],
  692. }
  693. };
  694. },
  695. watch: {
  696. // 根据名称筛选部门树
  697. deptName(val) {
  698. this.$refs.tree.filter(val);
  699. },
  700. },
  701. created() {
  702. //设置表格高度对应屏幕高度
  703. this.$nextTick(() => {
  704. this.clientHeight = document.body.clientHeight - 250
  705. })
  706. this.getList();
  707. this.getTreeselect();
  708. this.getDicts("spec_dev_status").then(response => {
  709. this.statusOptions = response.data;
  710. });
  711. //预警等级字典
  712. this.getDicts("WARNING_SELE").then(response => {
  713. for (let i = 0; i < response.data.length; i++) {
  714. let items = {
  715. text: '',
  716. value: ''
  717. };
  718. items.value = response.data[i].dictValue;
  719. items.text = response.data[i].dictLabel;
  720. this.filterList.push(items);
  721. }
  722. });
  723. this.getDicts("spec_approve_status").then(response => {
  724. for (let i = 0; i < response.data.length; i++) {
  725. if (!["5", "6", "7", "8", "16", "17"].includes(response.data[i].dictValue)) {
  726. this.approveStatusOptions.push(response.data[i])
  727. }
  728. }
  729. });
  730. this.getDicts("SPEC_PLANT_MAINT").then(response => {
  731. this.plantMaintOptions = response.data;
  732. });
  733. let plantParams = {
  734. pType: 1
  735. }
  736. mylistPlant(plantParams).then(response => {
  737. this.plantOptions = response.data;
  738. });
  739. this.queryParams.postCode = 'wxjl'
  740. listPostUser(this.queryParams).then(response => {
  741. this.wxjlList = response;
  742. });
  743. },
  744. methods: {
  745. /** 查询特种设备起重机械台账列表 */
  746. getList() {
  747. this.loading = true;
  748. listSpecDzsb(this.queryParams).then(response => {
  749. this.specDzsbList = response.rows;
  750. this.total = response.total;
  751. this.$nextTick(() => {
  752. this.$refs.deviceTable.doLayout(); // 解决表格错位
  753. });
  754. this.loading = false;
  755. });
  756. },
  757. /** 查询部门下拉树结构 */
  758. getTreeselect() {
  759. treeselect().then(response => {
  760. this.deptOptions = response.data;
  761. });
  762. },
  763. // 状态字典翻译
  764. statusFormat(row, column) {
  765. return this.selectDictLabel(this.statusOptions, row.status);
  766. },
  767. // 申请状态字典翻译
  768. approveStatusFormat(row, column) {
  769. return this.selectDictLabel(this.approveStatusOptions, row.approveStatus);
  770. },
  771. // 取消按钮
  772. cancel() {
  773. this.open = false;
  774. this.reset();
  775. },
  776. // 表单重置
  777. reset() {
  778. this.form = {
  779. id: null,
  780. plantCode: null,
  781. unit: null,
  782. devname: null,
  783. devno: null,
  784. submitdate: null,
  785. status: 1,
  786. delFlag: null,
  787. createrCode: null,
  788. createdate: null,
  789. updaterCode: null,
  790. updatedate: null,
  791. deptId: null,
  792. remarks: null,
  793. remarks2: null,
  794. perTestConclusion: null,
  795. approveStatus: 0,
  796. regno: null,
  797. useno: null,
  798. warnDate: null,
  799. warnCycle: null,
  800. nextWarnDate: null,
  801. warnFlag: null,
  802. plantMaint: null,
  803. docno: null,
  804. model: null,
  805. capacity: null,
  806. location: null,
  807. createUnit: null,
  808. checkStrategy: null,
  809. yearMaint: null,
  810. reportNo: null,
  811. approveTime: null,
  812. changeTime: null,
  813. checkUnit: null,
  814. engineer: null,
  815. factoryNo: null,
  816. devCode: null,
  817. wxjl: null
  818. };
  819. this.resetForm("form");
  820. this.dataForm = 0;
  821. },
  822. /** 搜索按钮操作 */
  823. handleQuery() {
  824. this.queryParams.pageNum = 1;
  825. this.getList();
  826. },
  827. /** 重置按钮操作 */
  828. resetQuery() {
  829. this.resetForm("queryForm");
  830. this.handleQuery();
  831. },
  832. // 多选框选中数据
  833. handleSelectionChange(selection) {
  834. this.ids = selection.map(item => item.id)
  835. this.single = selection.length !== 1
  836. this.multiple = !selection.length
  837. this.dataListSelections = selection
  838. },
  839. /** 新增按钮操作 */
  840. handleAdd() {
  841. this.reset();
  842. this.open = true;
  843. this.title = this.$t('添加') + this.$t('特种设备起重机械台账');
  844. },
  845. /** 修改按钮操作 */
  846. handleUpdate(row) {
  847. this.reset();
  848. const id = row.id || this.ids
  849. var rows = this.dataListSelections.map(item => {
  850. return item
  851. })
  852. for (let i = 0; i < rows.length; i++) {
  853. if (rows[i].approveStatus != 0) {
  854. this.$alert(this.$t('当前设备正在申请中,无法修改'), this.$t('提示'), {
  855. type: 'warning'
  856. })
  857. return
  858. }
  859. }
  860. this.dataForm = 1;
  861. getSpecDzsb(id).then(response => {
  862. this.form = response.data;
  863. this.open = true;
  864. this.title = this.$t('修改') + this.$t('特种设备起重机械台账');
  865. });
  866. },
  867. /** 提交按钮 */
  868. submitForm() {
  869. this.$refs["form"].validate(valid => {
  870. if (valid) {
  871. if (this.form.id != null) {
  872. updateSpecDzsb(this.form).then(response => {
  873. this.msgSuccess(this.$t('修改成功'));
  874. this.open = false;
  875. this.getList();
  876. });
  877. /* updateSpecDzsbPre(this.form).then(response => {
  878. this.open = false;
  879. this.getList();
  880. this.modifyForm.hisId = response.data
  881. this.modifyForm.devId = this.form.id
  882. this.modifyForm.devType = this.devType
  883. this.modifyForm.approveType = 1
  884. this.modifyVisible = true
  885. this.modifyTitle = this.$t('设备修改申请')
  886. this.queryParams.postCode = 'wxjl'
  887. listPostUser(this.queryParams).then(response => {
  888. this.wxjlList = response;
  889. });
  890. });*/
  891. } else {
  892. addSpecDzsb(this.form).then(response => {
  893. this.msgSuccess(this.$t('新增成功'));
  894. this.open = false;
  895. this.getList();
  896. });
  897. }
  898. }
  899. });
  900. },
  901. /** 删除按钮操作 */
  902. handleDelete(row) {
  903. const ids = row.id || this.ids;
  904. var rows = this.dataListSelections.map(item => {
  905. return item
  906. })
  907. for (let i = 0; i < rows.length; i++) {
  908. if (rows[i].approveStatus != 0) {
  909. this.$alert(this.$t('当前设备正在申请中,无法修改'), this.$t('提示'), {
  910. type: 'warning'
  911. })
  912. return
  913. }
  914. }
  915. for (let i = 0; i < rows.length; i++) {
  916. if (i == 0) {
  917. this.modifyForm.devId = rows[i].id
  918. } else {
  919. this.modifyForm.devId += ',' + rows[i].id
  920. }
  921. }
  922. this.open = false;
  923. this.getList();
  924. this.modifyForm.hisId = 2
  925. this.modifyForm.devType = this.devType
  926. this.modifyForm.approveType = 2
  927. this.modifyVisible = true
  928. this.modifyTitle = this.$t('设备删除申请')
  929. this.queryParams.postCode = 'wxjl'
  930. listPostUser(this.queryParams).then(response => {
  931. this.wxjlList = response;
  932. });
  933. // this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  934. // confirmButtonText: this.$t('确定'),
  935. // cancelButtonText: this.$t('取消'),
  936. // type: "warning"
  937. // }).then(function() {
  938. // return delSpecDzsb(ids);
  939. // }).then(() => {
  940. // this.getList();
  941. // this.msgSuccess(this.$t('删除成功'));
  942. // })
  943. },
  944. /** 去重按钮操作 */
  945. handleDup() {
  946. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  947. confirmButtonText: this.$t('确定'),
  948. cancelButtonText: this.$t('取消'),
  949. type: "warning"
  950. }).then(function () {
  951. return duplicate();
  952. }).then(() => {
  953. this.getList();
  954. this.msgSuccess(this.$t('删除成功'));
  955. })
  956. },
  957. /** 导出按钮操作 */
  958. handleExport() {
  959. const queryParams = this.queryParams;
  960. this.$confirm(this.$t('是否确认导出所有特种设备起重机械台账数据项?'), this.$t('警告'), {
  961. confirmButtonText: this.$t('确定'),
  962. cancelButtonText: this.$t('取消'),
  963. type: "warning"
  964. }).then(function () {
  965. return exportSpecDzsb(queryParams);
  966. }).then(response => {
  967. this.download(response.msg);
  968. })
  969. },
  970. /** 导入按钮操作 */
  971. handleImport() {
  972. this.upload.title = this.$t('用户导入');
  973. this.upload.open = true;
  974. },
  975. /** 下载模板操作 */
  976. importTemplate() {
  977. this.$refs['downloadFileForm'].submit()
  978. },
  979. // 文件上传中处理
  980. handleFileUploadProgress(event, file, fileList) {
  981. this.waitSubmit = true;
  982. this.upload.isUploading = true;
  983. },
  984. // 文件上传成功处理
  985. handleFileSuccess(response, file, fileList) {
  986. this.waitSubmit = false;
  987. this.upload.open = false;
  988. this.upload.isUploading = false;
  989. this.$refs.upload.clearFiles();
  990. this.fullscreenLoading = false;
  991. if (response.data.length > 0) {
  992. let failrow = ''
  993. for (let i = 0; i < response.data.length; i++) {
  994. failrow += response.data[i] + ','
  995. }
  996. this.$alert(this.$t('导入成功条数:') + response.msg + '<br>' + this.$t('失败行数:') + failrow, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  997. } else {
  998. this.$alert(this.$t('导入成功条数:') + response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  999. }
  1000. this.getList();
  1001. },
  1002. // 提交上传文件
  1003. submitFileForm() {
  1004. if (!this.upload.submitData.wxjl) {
  1005. this.$alert('请选择确认人', this.$t('提示'), {
  1006. type: 'warning'
  1007. })
  1008. return
  1009. }
  1010. this.$refs.upload.submit();
  1011. this.fullscreenLoading = true;
  1012. },
  1013. addAprrove(row, type) {
  1014. var rows = row ? [row] : this.dataListSelections.map(item => {
  1015. return item
  1016. })
  1017. for (let i = 0; i < rows.length; i++) {
  1018. if (rows[i].approveStatus != 0) {
  1019. this.$alert(this.$t('当前设备正在申请中,无法重复申请'), this.$t('提示'), {
  1020. type: 'warning'
  1021. })
  1022. return
  1023. }
  1024. }
  1025. this.addAprroveVisible = true
  1026. console.log(rows)
  1027. console.log(type)
  1028. this.$nextTick(() => {
  1029. this.$refs.addApprove.init(rows, type)
  1030. })
  1031. },
  1032. hisApprove(row, type) {
  1033. this.hisAprroveVisible = true
  1034. this.$nextTick(() => {
  1035. this.$refs.hisApprove.init(row, type)
  1036. })
  1037. },
  1038. checkList(row, type) {
  1039. this.hisCheckVisible = true
  1040. this.$nextTick(() => {
  1041. this.$refs.hisCheck.init(row, type)
  1042. })
  1043. },
  1044. hisReform(row) {
  1045. this.hisReformVisible = true
  1046. this.$nextTick(() => {
  1047. this.$refs.hisReformList.init(row)
  1048. })
  1049. },
  1050. //导出excel
  1051. downloadDev(type) {
  1052. var rows = this.dataListSelections.map(item => {
  1053. return item.id
  1054. })
  1055. const queryParams = {ids: null};
  1056. queryParams.ids = rows.join()
  1057. exportSpecList(queryParams).then(response => {
  1058. this.download(response.msg);
  1059. })
  1060. // var rows = this.dataListSelections.map(item => {
  1061. // return item.id
  1062. // })
  1063. // this.ids = rows
  1064. // if (type == 1){
  1065. // this.downloadType = 1
  1066. // }else if (type == 2){
  1067. // this.downloadType = 2
  1068. // }
  1069. // this.$nextTick(() => {
  1070. // this.$refs['downloadDevForm'].submit()
  1071. // })
  1072. },
  1073. uploadUrl(uploadType) {
  1074. return process.env.VUE_APP_BASE_API + "/sems/specDzsb/updateData"
  1075. },
  1076. submitModofyForm() {
  1077. this.$refs["modifyForm"].validate(valid => {
  1078. if (valid) {
  1079. addModify(this.modifyForm).then(response => {
  1080. this.msgSuccess(this.$t('提交成功'));
  1081. this.modifyVisible = false
  1082. this.getList();
  1083. });
  1084. }
  1085. })
  1086. },
  1087. //位号颜色变换
  1088. tableCellStyle({row, column, rowIndex, columnIndex}) {
  1089. if (columnIndex == 8 && row.isRepeat == 1) {
  1090. return "color:rgba(255, 26, 26, 0.98);"
  1091. }
  1092. if (row.warnFlag == 1) {
  1093. return "background-color:rgba(255, 255,153, 0.5);"
  1094. }
  1095. if (row.warnFlag == 2) {
  1096. return "background-color:rgba(255, 180, 68, 0.5);"
  1097. }
  1098. if (row.warnFlag == 3) {
  1099. return "background-color:rgba(255, 68,68, 0.5);"
  1100. }
  1101. },
  1102. //element表格排序
  1103. sortList(val) {
  1104. var sort = "asc";
  1105. let sortTip = val.order
  1106. this.queryParams.isAsc = sort;
  1107. this.queryParams.orderByColumn = val.prop;
  1108. if (sortTip === 'descending') {
  1109. sort = 'desc' // 降序
  1110. } else if (sortTip === 'ascending') {
  1111. sort = 'asc' // 升序
  1112. } else if (sortTip === null) {
  1113. this.queryParams.isAsc = null;
  1114. this.queryParams.orderByColumn = null;
  1115. }
  1116. this.loading = true;
  1117. listSpecDzsb(this.queryParams).then(response => {
  1118. this.specDzsbList = response.rows;
  1119. this.total = response.total;
  1120. this.$nextTick(() => {
  1121. this.$refs.deviceTable.doLayout(); // 解决表格错位
  1122. });
  1123. this.loading = false;
  1124. });
  1125. },
  1126. //备注
  1127. remarksHeader(h, {column, $index}) {
  1128. return [
  1129. column.label,
  1130. h(
  1131. "el-tooltip",
  1132. {
  1133. props: {
  1134. content: (function () {
  1135. return '如报告未到备注在此处'
  1136. })(),
  1137. placement: "top"
  1138. }
  1139. },
  1140. [
  1141. h("span", {
  1142. class: {
  1143. "el-icon-question": true,
  1144. "report-headerTips": true
  1145. }
  1146. })
  1147. ]
  1148. )
  1149. ]
  1150. },
  1151. }
  1152. };
  1153. </script>