add-or-update.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. <template>
  2. <!-- 添加或修改参数配置对话框 -->
  3. <el-dialog
  4. title="明细"
  5. :visible.sync="open"
  6. append-to-body
  7. width="700px"
  8. destroy-on-close
  9. >
  10. <el-descriptions labelStyle="width: 160px;" title="" column="2" border>
  11. <el-descriptions-item label="变电站名称">{{
  12. ruleForm.subNm
  13. }}</el-descriptions-item>
  14. <el-descriptions-item label="归属县旗">{{
  15. ruleForm.compNm
  16. }}</el-descriptions-item>
  17. <el-descriptions-item label="电压等级">{{
  18. ruleForm.voltageLevel
  19. }}</el-descriptions-item>
  20. <el-descriptions-item label="主变台数">{{
  21. ruleForm.mainNum
  22. }}</el-descriptions-item>
  23. <el-descriptions-item label="主变容量(MVA)">{{
  24. ruleForm.mainCapacity
  25. }}</el-descriptions-item>
  26. <el-descriptions-item label="采集日期">{{
  27. ruleForm.dataDate
  28. }}</el-descriptions-item>
  29. <el-descriptions-item label="当日温度(℃)">{{
  30. ruleForm.temperature
  31. }}</el-descriptions-item>
  32. <el-descriptions-item label="最大负荷(MW)">{{
  33. ruleForm.peakLoad
  34. }}</el-descriptions-item>
  35. <el-descriptions-item label="基础负荷(MW)">{{
  36. ruleForm.baseLoad
  37. }}</el-descriptions-item>
  38. <el-descriptions-item label="电采暖负荷(MW)">{{
  39. ruleForm.electricHeatingLoad
  40. }}</el-descriptions-item>
  41. <el-descriptions-item label="用户数">{{
  42. ruleForm.usersNum
  43. }}</el-descriptions-item>
  44. <el-descriptions-item label="平房区用户数">{{
  45. ruleForm.pingfangUsers
  46. }}</el-descriptions-item>
  47. <el-descriptions-item span="2" label="平房区已接入电采暖容量(MWA)">{{
  48. ruleForm.pingfangElectricHeatingCapacity
  49. }}</el-descriptions-item>
  50. </el-descriptions>
  51. <el-form ref="ruleForm" :model="ruleForm" label-width="120px" v-if="false">
  52. <el-row>
  53. <el-col :span="12">
  54. <el-form-item label="变电站名称" prop="subNm">
  55. <el-input
  56. v-model="ruleForm.subNm"
  57. placeholder="请输入变电站名称"
  58. :disabled="type == 'view'"
  59. ></el-input>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :span="12">
  63. <el-form-item label="归属县旗" prop="compNm">
  64. <el-input
  65. v-model="ruleForm.compNm"
  66. placeholder="请输入归属县旗名称"
  67. :disabled="type == 'view'"
  68. ></el-input>
  69. </el-form-item>
  70. </el-col>
  71. <el-col :span="12">
  72. <el-form-item label="电压等级" prop="voltageLevel">
  73. <el-input
  74. type="number"
  75. v-model="ruleForm.voltageLevel"
  76. placeholder="请输入电压等级"
  77. :disabled="type == 'view'"
  78. />
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="12">
  82. <el-form-item label="主变台数" prop="mainNum">
  83. <el-input
  84. type="number"
  85. style="width: 100%"
  86. v-model="ruleForm.mainNum"
  87. placeholder="请输入主变台数"
  88. :disabled="type == 'view'"
  89. />
  90. </el-form-item>
  91. </el-col>
  92. <el-col :span="12">
  93. <el-form-item label="主变容量(MVA)" prop="mainCapacity">
  94. <el-input
  95. type="number"
  96. style="width: 100%"
  97. v-model="ruleForm.mainCapacity"
  98. placeholder="请输入主变容量"
  99. :disabled="type == 'view'"
  100. />
  101. </el-form-item>
  102. </el-col>
  103. <el-col :span="12">
  104. <el-form-item label="采集日期" prop="dataDate">
  105. <el-input v-model="ruleForm.dataDate" :disabled="type == 'view'" />
  106. </el-form-item>
  107. </el-col>
  108. <el-col :span="12">
  109. <el-form-item label="当日温度(℃)" prop="temperature">
  110. <el-input
  111. v-model="ruleForm.temperature"
  112. :disabled="type == 'view'"
  113. />
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="12">
  117. <el-form-item label="最大负荷(MW)" prop="peakLoad">
  118. <el-input v-model="ruleForm.peakLoad" :disabled="type == 'view'" />
  119. </el-form-item>
  120. </el-col>
  121. <el-col :span="12">
  122. <el-form-item label="基础负荷(MW)" prop="baseLoad">
  123. <el-input v-model="ruleForm.baseLoad" :disabled="type == 'view'" />
  124. </el-form-item>
  125. </el-col>
  126. <el-col :span="12">
  127. <el-form-item label="电采暖负荷(MW)" prop="electricHeatingLoad">
  128. <el-input
  129. v-model="ruleForm.electricHeatingLoad"
  130. :disabled="type == 'view'"
  131. />
  132. </el-form-item>
  133. </el-col>
  134. <el-col :span="12">
  135. <el-form-item label="电采暖负荷(MW)" prop="electricHeatingLoad">
  136. <el-input
  137. v-model="ruleForm.electricHeatingLoad"
  138. :disabled="type == 'view'"
  139. />
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="12">
  143. <el-form-item label="用户数" prop="usersNum">
  144. <el-input v-model="ruleForm.usersNum" :disabled="type == 'view'" />
  145. </el-form-item>
  146. </el-col>
  147. <el-col :span="12">
  148. <el-form-item label="平房区用户数" prop="pingfangUsers">
  149. <el-input
  150. v-model="ruleForm.pingfangUsers"
  151. :disabled="type == 'view'"
  152. />
  153. </el-form-item>
  154. </el-col>
  155. <el-col :span="12">
  156. <el-form-item
  157. label="平房区接入电暖用户数"
  158. prop="electricHeatingUsers"
  159. >
  160. <el-input
  161. v-model="ruleForm.electricHeatingUsers"
  162. :disabled="type == 'view'"
  163. />
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="12">
  167. <el-form-item
  168. label="平房区已接入电采暖容量(MWA)"
  169. prop="pingfangElectricHeatingCapacity"
  170. >
  171. <el-input
  172. v-model="ruleForm.pingfangElectricHeatingCapacity"
  173. :disabled="type == 'view'"
  174. />
  175. </el-form-item>
  176. </el-col>
  177. </el-row>
  178. </el-form>
  179. <template #footer>
  180. <div class="dialog-footer">
  181. <el-button @click="cancel">关 闭</el-button>
  182. </div>
  183. </template>
  184. </el-dialog>
  185. </template>
  186. <script>
  187. export default {
  188. data() {
  189. return {
  190. type: "view", // add, edit, view
  191. open: false,
  192. ruleForm: {},
  193. };
  194. },
  195. props: ["parent"],
  196. methods: {
  197. openDialog(id, type) {
  198. this.type = type;
  199. this.open = true;
  200. this.resetForm();
  201. if (id) this.info(id);
  202. },
  203. info(id) {
  204. this.$http({
  205. url: `subLoad/detail/${id}`,
  206. method: "get",
  207. }).then(({ data }) => {
  208. if (data && data.code === 0) {
  209. this.ruleForm = data.data;
  210. } else {
  211. this.$message.error(data.msg);
  212. }
  213. });
  214. },
  215. resetForm() {
  216. this.ruleForm = {};
  217. },
  218. // 返回
  219. cancel() {
  220. this.open = false;
  221. this.resetForm();
  222. },
  223. },
  224. };
  225. </script>
  226. <style lang="scss" scoped>
  227. .addEdit-block {
  228. padding: 30px;
  229. background: none;
  230. width: 100%;
  231. }
  232. .add-update-preview {
  233. border-radius: 10px;
  234. padding: 40px 25% 40px 18%;
  235. background: #ffffff;
  236. border-color: #eee;
  237. border-width: 1px;
  238. border-style: solid;
  239. }
  240. .amap-wrapper {
  241. width: 100%;
  242. height: 500px;
  243. }
  244. .search-box {
  245. position: absolute;
  246. }
  247. .el-date-editor.el-input {
  248. width: auto;
  249. }
  250. .add-update-preview ::v-deep .el-form-item {
  251. border: 0px solid #eee;
  252. padding: 0;
  253. margin: 0 0 22px 0;
  254. display: inline-block;
  255. width: 100%;
  256. }
  257. .add-update-preview .el-form-item ::v-deep .el-form-item__label {
  258. padding: 0 10px 0 0;
  259. color: #6e6e6e;
  260. font-weight: 500;
  261. width: 180px;
  262. font-size: 15px;
  263. line-height: 40px;
  264. text-align: right;
  265. }
  266. .add-update-preview .el-form-item ::v-deep .el-form-item__content {
  267. margin-left: 180px;
  268. }
  269. .add-update-preview .el-form-item span.text {
  270. padding: 0 10px;
  271. color: #333;
  272. background: none;
  273. font-weight: 500;
  274. display: inline-block;
  275. font-size: 15px;
  276. line-height: 40px;
  277. min-width: 50%;
  278. }
  279. .add-update-preview .el-input {
  280. width: 100%;
  281. }
  282. .add-update-preview .el-input ::v-deep .el-input__inner {
  283. border: 1px solid #e8e8e8;
  284. border-radius: 0px;
  285. padding: 0 12px;
  286. color: #666;
  287. background: #fff;
  288. width: 100%;
  289. font-size: 15px;
  290. min-width: 50%;
  291. height: 40px;
  292. }
  293. .add-update-preview .el-input ::v-deep .el-input__inner[readonly="readonly"] {
  294. border: 0px solid #ccc;
  295. cursor: not-allowed;
  296. border-radius: 0px;
  297. padding: 0 12px;
  298. color: #666;
  299. background: none;
  300. width: auto;
  301. font-size: 15px;
  302. height: 40px;
  303. }
  304. .add-update-preview .el-input-number {
  305. text-align: left;
  306. width: 100%;
  307. }
  308. .add-update-preview .el-input-number ::v-deep .el-input__inner {
  309. text-align: left;
  310. border: 1px solid #e8e8e8;
  311. border-radius: 0px;
  312. padding: 0 12px;
  313. color: #666;
  314. background: #fff;
  315. width: 100%;
  316. font-size: 15px;
  317. min-width: 50%;
  318. height: 40px;
  319. }
  320. .add-update-preview .el-input-number ::v-deep .is-disabled .el-input__inner {
  321. text-align: left;
  322. border: 0px solid #ccc;
  323. cursor: not-allowed;
  324. border-radius: 0px;
  325. padding: 0 12px;
  326. color: #666;
  327. background: none;
  328. width: auto;
  329. font-size: 15px;
  330. height: 40px;
  331. }
  332. .add-update-preview .el-input-number ::v-deep .el-input-number__decrease {
  333. display: none;
  334. }
  335. .add-update-preview .el-input-number ::v-deep .el-input-number__increase {
  336. display: none;
  337. }
  338. .add-update-preview .el-select {
  339. width: 100%;
  340. }
  341. .add-update-preview .el-select ::v-deep .el-input__inner {
  342. border: 1px solid #e8e8e8;
  343. border-radius: 0px;
  344. padding: 0 10px;
  345. color: #666;
  346. background: #fff;
  347. width: 100%;
  348. font-size: 15px;
  349. height: 40px;
  350. }
  351. .add-update-preview .el-select ::v-deep .is-disabled .el-input__inner {
  352. border: 0;
  353. cursor: not-allowed;
  354. border-radius: 4px;
  355. padding: 0 10px;
  356. color: #666;
  357. background: none;
  358. width: auto;
  359. font-size: 15px;
  360. height: 34px;
  361. }
  362. .add-update-preview .el-date-editor {
  363. width: 100%;
  364. }
  365. .add-update-preview .el-date-editor ::v-deep .el-input__inner {
  366. border: 1px solid #e8e8e8;
  367. border-radius: 0px;
  368. padding: 0 10px 0 30px;
  369. color: #666;
  370. background: #fff;
  371. width: 100%;
  372. font-size: 15px;
  373. height: 40px;
  374. }
  375. .add-update-preview
  376. .el-date-editor
  377. ::v-deep
  378. .el-input__inner[readonly="readonly"] {
  379. border: 0;
  380. cursor: not-allowed;
  381. border-radius: 0px;
  382. padding: 0 10px 0 30px;
  383. color: #666;
  384. background: none;
  385. width: auto;
  386. font-size: 15px;
  387. height: 40px;
  388. }
  389. .add-update-preview .viewBtn {
  390. border: 1px solid #e8e8e8;
  391. cursor: pointer;
  392. border-radius: 0px;
  393. padding: 0 15px;
  394. margin: 0 20px 0 0;
  395. color: #666;
  396. background: #fff;
  397. width: auto;
  398. font-size: 15px;
  399. line-height: 34px;
  400. height: 34px;
  401. .iconfont {
  402. margin: 0 2px;
  403. color: #666;
  404. font-size: 16px;
  405. height: 34px;
  406. }
  407. }
  408. .add-update-preview .viewBtn:hover {
  409. opacity: 0.8;
  410. }
  411. .add-update-preview .downBtn {
  412. border: 1px solid #e8e8e8;
  413. cursor: pointer;
  414. border-radius: 0px;
  415. padding: 0 15px;
  416. margin: 0 20px 0 0;
  417. color: #666;
  418. background: #fff;
  419. width: auto;
  420. font-size: 15px;
  421. line-height: 34px;
  422. height: 34px;
  423. .iconfont {
  424. margin: 0 2px;
  425. color: #666;
  426. font-size: 16px;
  427. height: 34px;
  428. }
  429. }
  430. .add-update-preview .downBtn:hover {
  431. opacity: 0.8;
  432. }
  433. .add-update-preview .unBtn {
  434. border: 0;
  435. cursor: not-allowed;
  436. border-radius: 4px;
  437. padding: 0 0px;
  438. margin: 0 20px 0 0;
  439. outline: none;
  440. color: #999;
  441. background: none;
  442. width: auto;
  443. font-size: 15px;
  444. line-height: 40px;
  445. height: 40px;
  446. .iconfont {
  447. margin: 0 2px;
  448. color: #fff;
  449. display: none;
  450. font-size: 14px;
  451. height: 34px;
  452. }
  453. }
  454. .add-update-preview .unBtn:hover {
  455. opacity: 0.8;
  456. }
  457. .add-update-preview ::v-deep .el-upload--picture-card {
  458. background: transparent;
  459. border: 0;
  460. border-radius: 0;
  461. width: auto;
  462. height: auto;
  463. line-height: initial;
  464. vertical-align: middle;
  465. }
  466. .add-update-preview ::v-deep .upload .upload-img {
  467. border: 1px solid #e8e8e8;
  468. cursor: pointer;
  469. border-radius: 0px;
  470. color: #666;
  471. background: #fff;
  472. width: 90px;
  473. font-size: 24px;
  474. line-height: 60px;
  475. text-align: center;
  476. height: 60px;
  477. }
  478. .add-update-preview ::v-deep .el-upload-list .el-upload-list__item {
  479. border: 1px solid #e8e8e8;
  480. cursor: pointer;
  481. border-radius: 0px;
  482. color: #666;
  483. background: #fff;
  484. width: 90px;
  485. font-size: 24px;
  486. line-height: 60px;
  487. text-align: center;
  488. height: 60px;
  489. }
  490. .add-update-preview ::v-deep .el-upload .el-icon-plus {
  491. border: 1px solid #e8e8e8;
  492. cursor: pointer;
  493. border-radius: 0px;
  494. color: #666;
  495. background: #fff;
  496. width: 90px;
  497. font-size: 24px;
  498. line-height: 60px;
  499. text-align: center;
  500. height: 60px;
  501. }
  502. .add-update-preview ::v-deep .el-upload__tip {
  503. color: #666;
  504. font-size: 15px;
  505. }
  506. .add-update-preview .el-textarea ::v-deep .el-textarea__inner {
  507. border: 1px solid #e8e8e8;
  508. border-radius: 0px;
  509. padding: 12px;
  510. color: #666;
  511. background: #fff;
  512. width: 100%;
  513. font-size: 15px;
  514. min-height: 150px;
  515. height: auto;
  516. }
  517. .add-update-preview
  518. .el-textarea
  519. ::v-deep
  520. .el-textarea__inner[readonly="readonly"] {
  521. border: 0;
  522. cursor: not-allowed;
  523. border-radius: 0px;
  524. padding: 12px;
  525. color: #666;
  526. background: none;
  527. width: auto;
  528. font-size: 15px;
  529. min-width: 400px;
  530. height: auto;
  531. }
  532. .add-update-preview .el-form-item.btn {
  533. padding: 0;
  534. margin: 20px 0 0;
  535. .btn1 {
  536. border: 0px solid #ccc;
  537. cursor: pointer;
  538. border-radius: 6px;
  539. padding: 0 10px;
  540. margin: 0 10px 0 0;
  541. color: #fff;
  542. background: #0356bb;
  543. width: auto;
  544. font-size: 16px;
  545. min-width: 110px;
  546. height: 40px;
  547. .iconfont {
  548. margin: 0 2px;
  549. color: #fff;
  550. display: none;
  551. font-size: 14px;
  552. height: 40px;
  553. }
  554. }
  555. .btn1:hover {
  556. opacity: 0.8;
  557. }
  558. .btn2 {
  559. border: 0px solid #ccc;
  560. cursor: pointer;
  561. border-radius: 6px;
  562. padding: 0 10px;
  563. margin: 0 10px 0 0;
  564. color: #fff;
  565. background: #39c9ee;
  566. width: auto;
  567. font-size: 16px;
  568. min-width: 110px;
  569. height: 40px;
  570. .iconfont {
  571. margin: 0 2px;
  572. color: #fff;
  573. display: none;
  574. font-size: 14px;
  575. height: 34px;
  576. }
  577. }
  578. .btn2:hover {
  579. opacity: 0.8;
  580. }
  581. .btn3 {
  582. border: 0px solid #ccc;
  583. cursor: pointer;
  584. border-radius: 6px;
  585. padding: 0 10px;
  586. margin: 0 10px 0 0;
  587. color: #fff;
  588. background: #6ea0dc;
  589. width: auto;
  590. font-size: 16px;
  591. min-width: 110px;
  592. height: 40px;
  593. .iconfont {
  594. margin: 0 2px;
  595. color: #fff;
  596. display: none;
  597. font-size: 14px;
  598. height: 40px;
  599. }
  600. }
  601. .btn3:hover {
  602. opacity: 0.8;
  603. }
  604. .btn4 {
  605. border: 0px solid #ccc;
  606. cursor: pointer;
  607. border-radius: 6px;
  608. padding: 0 10px;
  609. margin: 0 10px 0 0;
  610. color: #fff;
  611. background: #4abcff;
  612. width: auto;
  613. font-size: 16px;
  614. min-width: 110px;
  615. height: 40px;
  616. .iconfont {
  617. margin: 0 2px;
  618. color: #fff;
  619. display: none;
  620. font-size: 14px;
  621. height: 40px;
  622. }
  623. }
  624. .btn4:hover {
  625. opacity: 0.8;
  626. }
  627. .btn5 {
  628. border: 0px solid #ccc;
  629. cursor: pointer;
  630. border-radius: 6px;
  631. padding: 0 10px;
  632. margin: 0 10px 0 0;
  633. color: #fff;
  634. background: #0977fd;
  635. width: auto;
  636. font-size: 16px;
  637. min-width: 110px;
  638. height: 40px;
  639. .iconfont {
  640. margin: 0 2px;
  641. color: #fff;
  642. display: none;
  643. font-size: 14px;
  644. height: 40px;
  645. }
  646. }
  647. .btn5:hover {
  648. opacity: 0.8;
  649. }
  650. }
  651. </style>