confirmBinding.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view>
  3. <ujp-navbar title="确认绑定"></ujp-navbar>
  4. <view class="equipment-infos">
  5. <view class="item">
  6. <view class="title">
  7. 设备编号
  8. </view>
  9. <view class="content">
  10. {{obj1.deviceNo}}
  11. </view>
  12. </view>
  13. <view class="item">
  14. <view class="title">
  15. 设备类型
  16. </view>
  17. <view class="content">
  18. {{obj1.interfaceType}}{{obj1.chargingType}}
  19. </view>
  20. </view>
  21. <view class="item" v-if="obj1.chargingPower">
  22. <view class="title">
  23. 设备功率
  24. </view>
  25. <view class="content">
  26. {{obj1.chargingPower}}kW
  27. </view>
  28. </view>
  29. </view>
  30. <view class="equipment-infos">
  31. <view class="item">
  32. <view class="title">
  33. 桩主姓名
  34. </view>
  35. <view class="content">
  36. {{obj2.contacts}}
  37. </view>
  38. </view>
  39. <view class="item">
  40. <view class="title">
  41. 联系电话
  42. </view>
  43. <view class="content">
  44. {{obj2.contactPhone}}
  45. </view>
  46. </view>
  47. <view class="item">
  48. <view class="title">
  49. 安装地址
  50. </view>
  51. <view class="content">
  52. {{obj2.address}}
  53. </view>
  54. </view>
  55. <view class="item" v-if="objlist.length>1">
  56. <view class="title">
  57. 绑定站点
  58. </view>
  59. <view class="content" style="color: #275cbf;" @click="isswitchshow=true" >
  60. {{obj2.name}}
  61. </view>
  62. </view>
  63. </view>
  64. <u-picker mode="selector" v-model="isswitchshow" :range="objlist" range-key="name" :default-selector="columnsindex" @confirm="switchBtn" ></u-picker>
  65. <!-- <view class="item">
  66. <view class="title">
  67. 设备名称
  68. </view>
  69. <view class="content">
  70. {{obj1.name}}
  71. </view>
  72. </view> -->
  73. <view class="equipment-infos">
  74. <view class="item">
  75. <view class="title">
  76. <text>*</text>站点名称
  77. </view>
  78. <view class="content" style="color: #acacac;">
  79. <u-input v-model="stationName"
  80. :placeholder="obj2.name"
  81. @focus="focus(0)"
  82. type="text" :border="false" />
  83. </view>
  84. </view>
  85. <view class="item">
  86. <view class="title">
  87. <text>*</text>车位号
  88. </view>
  89. <view class="content" style="color: #acacac;">
  90. <u-input v-model="deviceName"
  91. @focus="focus(1)"
  92. :placeholder="obj1.name"
  93. type="text" :border="false" />
  94. </view>
  95. </view>
  96. </view>
  97. <button class="btn" @click="submit">确认绑定并激活</button>
  98. <view style="text-align: center; margin-top: 10px;color: #275cbf;"
  99. @click="gotoUrl('pagesFinance/news/index?code=AZSM')" >查看安装说明文档</view>
  100. </view>
  101. </template>
  102. <script>
  103. import * as API from '@/apis/finance.js'
  104. export default {
  105. data() {
  106. return {
  107. id:"",
  108. obj1:{},obj2:{},
  109. stationName:"",
  110. deviceName:"",
  111. objlist:[],
  112. isswitchshow:false,
  113. columnsindex:[0],
  114. }
  115. },
  116. onLoad(op) {
  117. if(op.id){
  118. this.id=op.id
  119. this.getInfo()
  120. }
  121. },
  122. onReady() {
  123. },
  124. methods: {
  125. focus(k){
  126. if(k==0){
  127. if(!this.stationName){
  128. this.stationName=this.obj2.name;
  129. }
  130. }
  131. if(k==1){
  132. if(!this.deviceName){
  133. this.deviceName=this.obj1.name;
  134. }
  135. }
  136. },
  137. switchBtn(e){
  138. this.columnsindex=e;
  139. this.obj2=this.objlist[e[0]]
  140. //
  141. },
  142. submit(){
  143. if(!this.stationName){
  144. this.stationName=this.obj2.name;
  145. }
  146. if(!this.deviceName){
  147. this.deviceName=this.obj1.name;
  148. }
  149. uni.showLoading({
  150. title: "加载中",
  151. mask: true,
  152. })
  153. API.bindCategoryDevice({
  154. deviceNo:this.id,
  155. stationName:this.stationName,
  156. deviceName:this.deviceName,
  157. stationId:this.obj2.id
  158. }).then((res) => {
  159. //this.obj = res.data
  160. uni.hideLoading()
  161. uni.redirectTo({
  162. url:"/pagesFinance/user/activateResults"
  163. })
  164. }).catch(error => {
  165. uni.showToast({
  166. title: error
  167. })
  168. })
  169. },
  170. getInfo(){
  171. uni.showLoading({
  172. title: "加载中",
  173. mask: true,
  174. })
  175. API.findByDeviceNo({
  176. deviceNo:this.id
  177. }).then((res) => {
  178. this.obj1 = res.data.chargingDevice
  179. this.objlist= res.data.chargingStationList;
  180. this.obj2 = res.data.chargingStationList[0]
  181. uni.hideLoading()
  182. }).catch(error => {
  183. uni.showToast({
  184. title: error
  185. })
  186. })
  187. }
  188. }
  189. }
  190. </script>
  191. <style lang="scss" scoped>
  192. page{
  193. background-color: #f3f4f7;
  194. }
  195. .equipment-infos{
  196. margin-bottom: 12px;
  197. background-color: #fff;
  198. .item:last-of-type{
  199. border-bottom: none;
  200. }
  201. .item{
  202. padding: 11px 0;
  203. line-height: 22px;
  204. display: flex;
  205. margin-left: 32rpx;
  206. border-bottom: solid 1px #C2C2C2;
  207. font-size: 16px;
  208. .title{
  209. width: 80px;
  210. color: #777777;
  211. text{
  212. color: #ee3138;
  213. }
  214. }
  215. .content{
  216. flex: 1;
  217. color: rgba(16, 16, 16, 1);
  218. }
  219. }
  220. }
  221. .btn{
  222. width: 91.4%;
  223. line-height: 44px;
  224. border-radius: 8px;
  225. background-color: rgba(24, 90, 198, 1);
  226. color: rgba(255, 255, 255, 1);
  227. font-size: 16px;
  228. }
  229. </style>