cellDetail.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <view>
  3. <view>
  4. <view class="item ddflex">
  5. <view class="label">所属门店</view>
  6. <view class="item-input fflex ddflex">
  7. <view>{{info.storeName}}</view>
  8. <!-- <view class="state">在线</view> -->
  9. </view>
  10. </view>
  11. <view class="item ddflex">
  12. <!-- <view class="label">机柜名称</view> -->
  13. <view class="label">设备名称</view>
  14. <view class="item-input fflex">
  15. {{info.name}}
  16. </view>
  17. </view>
  18. <view class="item ddflex">
  19. <view class="label">电池编号</view>
  20. <view class="item-input fflex">
  21. {{info.batteryId}}
  22. </view>
  23. </view>
  24. <!-- <view class="item ddflex">
  25. <view class="label">租赁用户</view>
  26. <view class="item-input fflex">
  27. 王鸿 15700317367
  28. </view>
  29. </view> -->
  30. <!-- <view class="item ddflex">
  31. <view class="label">品牌</view>
  32. <view class="item-input fflex">
  33. 乐享换电
  34. </view>
  35. </view> -->
  36. <view class="item ddflex">
  37. <view class="label">型号</view>
  38. <view class="item-input fflex">
  39. {{info.model}}
  40. </view>
  41. </view>
  42. <view class="item ddflex">
  43. <view class="label">设备类型</view>
  44. <view class="item-input fflex">
  45. {{info.macName}}
  46. </view>
  47. </view>
  48. <view class="item ddflex">
  49. <view class="label">电芯</view>
  50. <view class="item-input fflex">
  51. {{info.type}}
  52. </view>
  53. </view>
  54. <!-- <view class="item ddflex">
  55. <view class="label">BMS保护板</view>
  56. <view class="item-input fflex">
  57. V1.2
  58. </view>
  59. </view> -->
  60. <!-- <view class="item ddflex">
  61. <view class="label">软件版本</view>
  62. <view class="item-input fflex">
  63. 百维
  64. </view>
  65. </view> -->
  66. <view class="item ddflex">
  67. <view class="label">押金</view>
  68. <view class="item-input fflex">
  69. {{info.deposit}}
  70. </view>
  71. </view>
  72. <view class="item ddflex">
  73. <view class="label">单价</view>
  74. <view class="item-input fflex">
  75. {{info.price}}
  76. </view>
  77. </view>
  78. <!-- <view class="item ddflex">
  79. <view class="label">起租时间</view>
  80. <view class="item-input fflex">
  81. 2022-07-0314:07:15
  82. </view>
  83. </view> -->
  84. <view class="item ddflex">
  85. <view class="label">到期时间</view>
  86. <view class="item-input fflex">
  87. {{info.blockDate}}
  88. </view>
  89. </view>
  90. <!-- <view class="item ddflex">
  91. <view class="label">备注</view>
  92. <view class="item-input fflex">
  93. 2.18更换新品头
  94. </view>
  95. </view> -->
  96. <view class="item ddflex">
  97. <view class="label">订单编号</view>
  98. <view class="item-input fflex">
  99. {{info.orderNo?info.orderNo:'-'}}
  100. </view>
  101. </view>
  102. <view class="item ddflex">
  103. <view class="label">门店名称</view>
  104. <view class="item-input fflex">
  105. {{info.orderStoreName?info.orderStoreName:'-'}}
  106. </view>
  107. </view>
  108. <view class="item ddflex">
  109. <view class="label">租借机柜</view>
  110. <view class="item-input fflex">
  111. {{info.devId?info.devId:'-'}}
  112. </view>
  113. </view>
  114. <view class="item ddflex" v-if="info.userName">
  115. <view class="label">租赁用户</view>
  116. <view class="item-input fflex">
  117. {{info.userName}} {{info.phone?info.phone:''}}
  118. </view>
  119. </view>
  120. </view>
  121. <!-- 保存按钮 -->
  122. <view style="height: 165rpx;" class="savepadding"></view>
  123. <view class="bottom-btns savepadding">
  124. <view class="ddflex" style="margin: 30rpx;justify-content: space-between;">
  125. <view class="btn1 fflex" @click="switchChange(!DHON)">{{DHON?'断电':'通电'}}</view>
  126. <!-- <view class="btn1" @click="jumpUrl('/machineAndCell/machineDetail/machineDetail')">通电</view>
  127. <view class="btn2">解绑</view>
  128. <view class="btn3">保存</view> -->
  129. </view>
  130. </view>
  131. </view>
  132. </template>
  133. <script>
  134. const app = getApp();
  135. const req = require("../../utils/request.js");
  136. export default {
  137. components: {
  138. },
  139. props: {},
  140. data() {
  141. return {
  142. id:null,
  143. info:{},
  144. DHON:false
  145. }
  146. },
  147. onLoad(options) {
  148. this.id = options.id
  149. this.getData()
  150. },
  151. onShow() {
  152. },
  153. methods: {
  154. jumpUrl(url) {
  155. if (req.isLogins(true)) {
  156. uni.navigateTo({
  157. url: url
  158. })
  159. }
  160. },
  161. getData(){
  162. uni.showLoading({
  163. title:'加载中'
  164. })
  165. req.getRequest('/admin/v2/battery/'+this.id,{},res=>{
  166. this.info = res
  167. uni.hideLoading()
  168. })
  169. req.getRequest('/admin/v2/battery/bmsData',{batteryId:this.id},res=>{
  170. this.DHON = JSON.parse(res[0].Seting).DHON==1?true:false
  171. })
  172. },
  173. switchChange(value){
  174. uni.showModal({
  175. title:'提示',
  176. content:value?'确定开启放电开关?':'确定关闭放电开关?',
  177. success: (r) => {
  178. if(r.confirm){
  179. uni.showLoading({
  180. title:value?'开启中':'关闭中',
  181. })
  182. req.postRequest('/admin/v2/battery/bmsSend',{batteryId:this.id,type:value},res=>{
  183. uni.hideLoading()
  184. if(res){
  185. // req.msg(event.detail.value?'开启成功':'关闭成功')
  186. uni.showModal({
  187. title:'提示',
  188. content:'操作成功,该操作会有延迟,请稍候查看最新状态',
  189. showCancel:false,
  190. success:() =>{
  191. this.DHON = value
  192. this.getData()
  193. }
  194. })
  195. }else {
  196. req.msg(value?'开启失败':'关闭失败')
  197. }
  198. })
  199. }else{
  200. }
  201. }
  202. })
  203. },
  204. },
  205. mounted() {
  206. },
  207. onPageScroll: function(e) {
  208. }
  209. }
  210. </script>
  211. <style>
  212. @import "./cellDetail.css";
  213. </style>