(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["bindGun"],{"12ba":function(e,t,n){"use strict";n.r(t);var c=function(){var e=this,t=e._self._c;return t("div",{staticClass:"detail-layout"},[t("van-nav-bar",{attrs:{title:"设备绑定","left-arrow":"",fixed:""},on:{"click-left":e.back}}),t("div",[t("van-form",{attrs:{readonly:""}},[t("van-field",{attrs:{name:"管理站点",label:"管理站点"},model:{value:e.selectItem.station_name,callback:function(t){e.$set(e.selectItem,"station_name",t)},expression:"selectItem.station_name"}}),t("van-field",{attrs:{name:"充电桩",label:"充电桩"},model:{value:e.selectItem.pile_no,callback:function(t){e.$set(e.selectItem,"pile_no",t)},expression:"selectItem.pile_no"}}),t("van-field",{attrs:{name:"充电枪",label:"充电枪"},model:{value:e.selectItem.gun_name,callback:function(t){e.$set(e.selectItem,"gun_name",t)},expression:"selectItem.gun_name"}})],1),t("van-form",[t("van-field",{attrs:{name:"设备编号",label:"设备编号",placeholder:"请扫码识别"},scopedSlots:e._u([{key:"button",fn:function(){return[t("van-icon",{attrs:{name:"scan",size:"24"},on:{click:e.handleOpenScanner}})]},proxy:!0}]),model:{value:e.selectItem.connector_code,callback:function(t){e.$set(e.selectItem,"connector_code",t)},expression:"selectItem.connector_code"}}),t("van-field",{attrs:{name:"互联互通码",label:"互联互通码"},model:{value:e.selectItem.connector_id,callback:function(t){e.$set(e.selectItem,"connector_id",t)},expression:"selectItem.connector_id"}}),t("van-field",{attrs:{name:"泊位号",label:"泊位号"},model:{value:e.selectItem.parking_space_no,callback:function(t){e.$set(e.selectItem,"parking_space_no",t)},expression:"selectItem.parking_space_no"}})],1)],1),t("div",{staticClass:"btn"},[t("van-button",{attrs:{type:"primary",round:""},on:{click:e.bindGun}},[e._v("绑定")])],1)],1)},o=[],a=n("d6c9"),s=n("9691"),r=n("7459"),i={data(){return{selectItem:{station_name:"",pile_no:"",gun_name:"",connector_code:"",connector_id:"",parking_space_no:""}}},mounted(){const e=this.$route.query;this.selectItem.station_name=e.station_name,this.selectItem.gun_name=e.gun_name,this.selectItem.connector_id=e.connector_id,this.selectItem.connector_code=e.connector_code||"",this.selectItem.pile_no=e.pile_no,this.selectItem.parking_space_no=e.parking_space_no},methods:{back(){this.$router.go(-1)},handleOpenScanner(){s["a"].openScanner().then(e=>{const t=/https:\/\/([^\/]+)\/e\/([^\/]+)/;if(t.test(e)){const n=t.exec(e);this.selectItem.connector_code=n[2]}else a["a"].fail("二维码不符合规范，请确认扫码内容是否准确！")})},bindGun(){this.selectItem.connector_code?Object(r["a"])({connector_code:this.selectItem.connector_code,connector_id:this.selectItem.connector_id,parking_space_no:this.selectItem.parking_space_no||null}).then(e=>{a["a"].success("绑定成功"),this.$router.go(-1)}):a["a"].fail("请填写设备编号！")}}},l=i,d=(n("f749"),n("8619")),m=Object(d["a"])(l,c,o,!1,null,"6f7e350a",null);t["default"]=m.exports},7459:function(e,t,n){"use strict";n.d(t,"d",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return r}));var c=n("f52e");function o(){return Object(c["b"])({url:"/rm/reformer-devices/software/scene",method:"get"})}function a(e){return Object(c["b"])({url:"/rm/reformer-devices/charging_device/station/list/by_scene_id?scene_id="+e,method:"GET"})}function s(e){return Object(c["b"])({url:"/rm/reformer-devices/charging_device/gun/list",method:"post",data:e})}function r(e){return Object(c["b"])({url:"/rm/reformer-devices/connector_code/connector/bind",method:"post",data:e})}},a58e:function(e,t,n){},f749:function(e,t,n){"use strict";n("a58e")}}]);