manual.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="main_manual">
  3. <SubTitle title="储充信息 8" titleEng="Storage and charging information"></SubTitle>
  4. <view class="header_title">
  5. <image class="header_title_img" src="../../../static/equipment/tip.png" mode=""></image>
  6. 仓位上方是电池,下方是充电机,点击仓位可查看充电详情信息
  7. </view>
  8. <view class="box_swiper">
  9. <scroll-view scroll-x="true" class="scroll_x">
  10. <view v-for="(item, index) in storeInfoLists" :key="index">
  11. <!-- @click="drawer(item,index)"-->
  12. <StorageInfo :store-code="item.storeCode" :com-state="item.comState" :sn="item.sn" :soc="item.soc"
  13. @drawer="drawer(item,index)" :chg-estimated-time="item.chargerInfoVo.chgEstimatedTime"
  14. :current="item.current" :voltage="item.voltage" :min-temperature="item.minTemperature"
  15. :max-temperature="item.maxTemperature" :max-cell-voltage="item.maxCellVoltage" index
  16. :min-cell-voltage="item.minCellVoltage" :soh="item.soh" :store-state="item.storeState"
  17. :charger-info-vo="item.chargerInfoVo" :class="box_num == index ? 'slect_box':''"
  18. :chgType='item.chgType' :batInfoOneVo="item.batInfoOneVo" :batInfoTwoVo='item.batInfoTwoVo'
  19. :chargerInfoOneVo="item.chargerInfoOneVo" :chargerInfoTwoVo="item.chargerInfoTwoVo"
  20. :showCodeNum='item.showCodeNum' @ExchangeMessage='ExchangeMessage' />
  21. </view>
  22. </scroll-view>
  23. <!--右侧抽屉 -->
  24. <uni-drawer ref="showRight" mode="right" :width="400" :mask-click="true" @change='changemask'>
  25. <scroll-view style="height: 100%;" scroll-y="true">
  26. <batteryDrawe :infodata="infodata" @closeDrawer="closeDrawer" @save='save'></batteryDrawe>
  27. </PublicDrawer>
  28. </scroll-view>
  29. </uni-drawer>
  30. <!-- 右侧抽屉结束 -->
  31. <!-- 顶部公共提示信息 -->
  32. <uni-popup ref="Exchangepopup" type="message">
  33. <uni-popup-message :type="popupType" :message="popupMessage" :duration="2000"></uni-popup-message>
  34. </uni-popup>
  35. <!-- 顶部提示信息结束-->
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import SubTitle from "../../../components/SubTitle/SubTitle.vue"
  41. import StorageInfo from "../components/StorageInfo.vue"
  42. import batteryDrawe from "../components/batteryDrawe.vue"
  43. import chargerDrawe from "../components/chargerDrawe.vue"
  44. name: 'manual'
  45. export default {
  46. components: {
  47. SubTitle,
  48. StorageInfo,
  49. batteryDrawe,
  50. chargerDrawe
  51. },
  52. props: ['storeInfoLists'],
  53. data() {
  54. return {
  55. popupMessage: '成功消息',
  56. popupType: 'success',
  57. isSlecte: true,
  58. box_num: -1, //记录选中了第几个
  59. name: 'batteryDrawe',
  60. props: ['infodata'],
  61. batteryInfoActive: 1, //0代表电池1代表充电机
  62. infodata: {}, //详情数据
  63. }
  64. },
  65. methods: {
  66. //抽屉
  67. drawer(item, index) {
  68. this.box_num = index;
  69. this.$refs.showRight.open();
  70. this.infodata = item;
  71. console.log(item, index, 'item')
  72. },
  73. //关闭抽屉
  74. closeDrawer() {
  75. this.batteryInfoActive = 1;
  76. this.box_num = -1;
  77. this.$refs.showRight.close();
  78. },
  79. //抽屉改变事件
  80. changemask(e) {
  81. if (!e) {
  82. this.closeDrawer()
  83. }
  84. },
  85. //顶部公共消息提示
  86. ExchangeMessage(type, message) {
  87. this.popupType = type
  88. this.popupMessage = message ? message : '后端接口404错误!'
  89. this.$refs.Exchangepopup.open()
  90. },
  91. //抽屉保存修改
  92. save(datas) {
  93. console.log(datas, 'e')
  94. let data = {
  95. chargerId: datas.cangnum,
  96. gunNo: datas.Guncall,
  97. powerNum: datas.powerNum,
  98. powerType: datas.setType
  99. }
  100. if (data.powerType == 0) {
  101. data.powerNum = undefined
  102. }
  103. if (data.gunNo == '' || data.powerType == '' || data.powerType && data.powerNum == "") {
  104. this.ExchangeMessage('warn', '请填写完整')
  105. } else {
  106. this.$http.getlimitPower(data).then(res => {
  107. this.ExchangeMessage(res.code === 0 ? 'success' : 'error',
  108. res.code === 0 ? '设置功率下发成功!' : '设置功率下发失败!')
  109. this.$refs.showRight.close();
  110. })
  111. }
  112. }
  113. }
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .main_manual {
  118. position: relative;
  119. .header_title {
  120. position: absolute;
  121. font-size: 12px;
  122. font-family: PingFang SC-Regular, PingFang SC;
  123. font-weight: 400;
  124. color: #414A63;
  125. right: 10px;
  126. top: 5px;
  127. .header_title_img {
  128. width: 14px;
  129. height: 14px;
  130. vertical-align: middle;
  131. margin-right: 5px;
  132. margin-top: -2px;
  133. }
  134. }
  135. .box_swiper {
  136. width: 1000px;
  137. height: 600px;
  138. background: #111827;
  139. padding: 20px;
  140. .scroll_x {
  141. width: 100%;
  142. height: 100%;
  143. // border: 1px solid red;
  144. /deep/ .uni-scroll-view-content {
  145. display: flex;
  146. view:last-child {
  147. .storage-item {
  148. margin-right: 0px;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. }
  155. .slect_box {
  156. border: 1px solid #338150 !important;
  157. }
  158. .header_drawer_btn {
  159. display: flex;
  160. font-size: 14px;
  161. font-family: PingFang SC-Regular, PingFang SC;
  162. font-weight: 400;
  163. color: #FFFFFF;
  164. .header_drawer_btn_left {
  165. width: 60px;
  166. height: 32px;
  167. background: #263042;
  168. border-radius: 2px 0px 0px 2px;
  169. line-height: 32px;
  170. text-align: center;
  171. }
  172. .header_drawer_btn_right {
  173. line-height: 32px;
  174. text-align: center;
  175. width: 74px;
  176. height: 32px;
  177. background: #263042;
  178. border-radius: 0px 2px 2px 0px;
  179. }
  180. .active {
  181. color: black;
  182. background: #91FDB9;
  183. }
  184. }
  185. .drawer_main {
  186. // border: 1px solid red;
  187. padding-top: 20px;
  188. }
  189. </style>