chunk-317c5273.13a35efb.js
5.28 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-317c5273"],{5839:function(t,e,r){"use strict";r("6eaa")},"6eaa":function(t,e,r){},b04b:function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"search-wrap"},[r("el-row",{attrs:{gutter:20}},[r("el-form",{ref:"form",attrs:{model:t.form,"label-width":"60px","label-position":"left"}},[r("el-col",{attrs:{xs:8,sm:6,md:7,lg:7,xl:7}},[r("el-form-item",{attrs:{label:"账户ID"}},[r("el-input",{attrs:{maxlength:"20",disabled:!0},model:{value:t.form.custId,callback:function(e){t.$set(t.form,"custId",e)},expression:"form.custId"}})],1)],1),t._v(" "),r("el-col",{attrs:{xs:8,sm:6,md:7,lg:7,xl:7}},[r("el-form-item",{attrs:{label:"手机号"}},[r("el-input",{attrs:{maxlength:"20",disabled:!0},model:{value:t.form.phone,callback:function(e){t.$set(t.form,"phone",e)},expression:"form.phone"}})],1)],1)],1)],1)],1),t._v(" "),r("el-row",{staticStyle:{"margin-top":"8px"},attrs:{gutter:20}},[r("el-col",{attrs:{span:12}},[r("el-card",{staticClass:"box-card",staticStyle:{height:"300px"}},[r("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[r("span",[t._v("车牌绑定")])]),t._v(" "),r("el-form",{ref:"bondform",attrs:{model:t.bondform,"label-width":"60px","label-position":"left",rules:t.rules}},[r("el-row",{attrs:{gutter:20}},[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"车牌号",prop:"carNum"}},[r("el-input",{attrs:{type:"text"},model:{value:t.bondform.carNum,callback:function(e){t.$set(t.bondform,"carNum",e)},expression:"bondform.carNum"}})],1)],1),t._v(" "),r("el-col",{attrs:{span:12}},[r("el-button",{attrs:{type:"primary",loading:t.bondformBtnVisible},on:{click:function(e){return t.checkCarNum("bondform")}}},[t._v("绑定车牌")])],1)],1)],1)],1)],1),t._v(" "),r("el-col",{attrs:{span:12}},[r("el-card",{staticClass:"box-card",staticStyle:{"min-height":"300px"}},[r("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[r("span",[t._v("解绑车牌")])]),t._v(" "),r("el-form",{ref:"form",attrs:{model:t.form,"label-width":"60px","label-position":"left"}},t._l(t.alredyBoundCar,(function(e){return r("el-row",{staticStyle:{"margin-top":"4px"},attrs:{gutter:20}},[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"已绑车牌"}},[r("el-input",{attrs:{value:e.carNumber}})],1)],1),t._v(" "),r("el-col",{attrs:{span:12}},[r("el-button",{attrs:{type:"primary"},on:{click:function(r){return t.alredyBoundCarBtn(e.carNumber)}}},[t._v("解绑车牌")])],1)],1)})),1)],1)],1)],1)],1)},s=[],o=(r("1bc7"),r("b775"));function n(){return Object(o["a"])({url:"/personCarNumPc/getPersonCarNumPC",method:"post"})}function l(t){return Object(o["a"])({url:"/personCarNumPc/boundCarNum",method:"post",data:t})}function u(t){return Object(o["a"])({url:"/personCarNumPc/unboundCarNum",method:"post",data:t})}function c(t){return Object(o["a"])({url:"/personCarNumPc/checkCarNumIsbind",method:"post",data:t})}var i={data:function(){var t=this,e=function(e,r,a){""===r&&a(new Error("请输入车牌号")),(!/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/.test(t.bondform.carNum)||t.bondform.carNum.length<7)&&a(new Error("请输入正确的车牌号")),a()};return{form:{custId:"",phone:""},bondform:{carNum:""},alredyBoundCar:[],bondformBtnVisible:!1,dialogFormVisible:!1,problemform:{carnum:""},rules:{carNum:[{validator:e,trigger:"blur"}]}}},methods:{checkCarNum:function(t){var e=this,r=this,a=this.form.custId,s=this.bondform.carNum;this.$refs[t].validate((function(t){if(!t)return!1;if(null!=r.alredyBoundCar&&r.alredyBoundCar.length>0){if(5==r.alredyBoundCar.length)return e.$message({type:"error",message:"最多只能绑定5个车牌!"}),!1;var o=!1;if(r.alredyBoundCar.forEach((function(t,e){t.carNumber==s&&(o=!0)})),o)return e.$message({type:"error",message:"请勿做重复绑定!"}),!1;var n={carNumber:s};c(n).then((function(t){if("8888"==t.code){if(null!=t.data&&null!=t.data.id)return e.$message({type:"error",message:"改车牌已被其他车主绑定!"}),!1;r.bondCarNum(a,s)}}))}else{var l={carNumber:s};c(l).then((function(t){if("8888"==t.code){if(null!=t.data&&null!=t.data.id)return e.$message({type:"error",message:"该车牌已被其他车主绑定!"}),!1;r.bondCarNum(a,s)}}))}}))},bondCarNum:function(t,e){var r=this,a=this,s={custId:t,carNumber:e,sysCode:"1001",carBindingStatus:1};l(s).then((function(t){(t.code="8888")&&(a.bondform.carNum="",r.$message({type:"success",message:"车牌绑定成功!"}),a.getPersonCarNumPC())}))},getPersonCarNumPC:function(){var t=this;n().then((function(e){(e.code="8888")&&(t.alredyBoundCar=e.data)}))},alredyBoundCarBtn:function(t){var e=this;""!=t&&null!=t&&void 0!=t||this.$message({type:"error",message:"解绑的车牌不能为空"});var r=this.form.custId,a={custId:r,carNumber:t,sysCode:"1001",carBindingStatus:2};u(a).then((function(t){(t.code="8888")?(e.$message({type:"success",message:"车牌解绑成功!"}),e.getPersonCarNumPC()):e.$message({type:"error",message:"车牌解绑失败!"})}))}},mounted:function(){var t=this.$store.state.user.userInfo;this.form={custId:t.custId,phone:t.userPhone},this.getPersonCarNumPC()}},m=i,d=(r("5839"),r("4ac2")),f=Object(d["a"])(m,a,s,!1,null,null,null);e["default"]=f.exports}}]);