confirmBindingStep2.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. stationId:"",
  109. obj1:{},obj2:{},
  110. stationName:"",
  111. deviceName:"",
  112. objlist:[],
  113. isswitchshow:false,
  114. columnsindex:[0],
  115. }
  116. },
  117. onLoad(op) {
  118. if(op.id){
  119. this.stationId=op.stationId;
  120. this.id=op.id
  121. this.getInfo()
  122. }
  123. },
  124. onReady() {
  125. },
  126. methods: {
  127. focus(k){
  128. if(k==0){
  129. if(!this.stationName){
  130. this.stationName=this.obj2.name;
  131. }
  132. }
  133. if(k==1){
  134. if(!this.deviceName){
  135. this.deviceName=this.obj1.name;
  136. }
  137. }
  138. },
  139. switchBtn(e){
  140. this.columnsindex=e;
  141. this.obj2=this.objlist[e[0]]
  142. //
  143. },
  144. submit(){
  145. if(!this.stationName){
  146. this.stationName=this.obj2.name;
  147. }
  148. if(!this.deviceName){
  149. this.deviceName=this.obj1.name;
  150. }
  151. uni.showLoading({
  152. title: "加载中",
  153. mask: true,
  154. })
  155. API.bindCategoryDevice({
  156. deviceNo:this.id,
  157. stationName:this.stationName,
  158. deviceName:this.deviceName,
  159. stationId:this.obj2.id
  160. }).then((res) => {
  161. //this.obj = res.data
  162. uni.hideLoading()
  163. uni.redirectTo({
  164. url:"/pagesFinance/user/activateResults"
  165. })
  166. }).catch(error => {
  167. uni.showToast({
  168. title: error
  169. })
  170. })
  171. },
  172. getInfo(){
  173. uni.showLoading({
  174. title: "加载中",
  175. mask: true,
  176. })
  177. var obj={
  178. deviceNo:this.id
  179. }
  180. if(this.stationId){
  181. obj.stationId=this.stationId
  182. }
  183. API.findByDeviceNo(obj).then((res) => {
  184. this.obj1 = res.data.chargingDevice
  185. this.objlist= res.data.chargingStationList;
  186. this.obj2 = res.data.chargingStationList[0]
  187. uni.hideLoading()
  188. }).catch(error => {
  189. uni.showToast({
  190. title: error
  191. })
  192. })
  193. }
  194. }
  195. }
  196. </script>
  197. <style lang="scss" scoped>
  198. page{
  199. background-color: #f3f4f7;
  200. }
  201. .equipment-infos{
  202. margin-bottom: 12px;
  203. background-color: #fff;
  204. .item:last-of-type{
  205. border-bottom: none;
  206. }
  207. .item{
  208. padding: 11px 0;
  209. line-height: 22px;
  210. display: flex;
  211. margin-left: 32rpx;
  212. border-bottom: solid 1px #C2C2C2;
  213. font-size: 16px;
  214. .title{
  215. width: 80px;
  216. color: #777777;
  217. text{
  218. color: #ee3138;
  219. }
  220. }
  221. .content{
  222. flex: 1;
  223. color: rgba(16, 16, 16, 1);
  224. }
  225. }
  226. }
  227. .btn{
  228. width: 91.4%;
  229. line-height: 44px;
  230. border-radius: 8px;
  231. background-color: rgba(24, 90, 198, 1);
  232. color: rgba(255, 255, 255, 1);
  233. font-size: 16px;
  234. }
  235. </style>