|
@@ -12,12 +12,16 @@
|
|
|
<image :src="cmico" class="addimg"></image>
|
|
|
<view>扫描行驶证自动填写</view>
|
|
|
</view>
|
|
|
+ <view class="tips mb22 mt5 cof4">请上传行驶证正面</view>
|
|
|
<view class="carcode">
|
|
|
<view class="tit mb16 lh18"><text class="cof4">*</text>车牌号码</view>
|
|
|
- <!-- <view>需车牌插件</view> -->
|
|
|
<view class="carinput-input">
|
|
|
- <view class="carinput-input-i" :class="{'input-active':carIndex == i}" @tap.stop="inputKey" :data-index="i" v-for="(v,i) in carInput" :key="i" v-show="i < 7">
|
|
|
- <!-- 塞个点 -->
|
|
|
+ <view class="carinput-input-i" :class="{'input-active':carIndex == i}" @tap.stop="inputKey" :data-index="i" v-for="(v,i) in carInput" :key="i" v-if="i < 2">
|
|
|
+ {{carInput[i].val}}
|
|
|
+ </view>
|
|
|
+ <!-- 塞个点 -->
|
|
|
+ <view class="cir"></view>
|
|
|
+ <view class="carinput-input-i" :class="{'input-active':carIndex == i}" @tap.stop="inputKey" :data-index="i" v-for="(v,i) in carInput" :key="i" v-if="i < 7&&i>1">
|
|
|
{{carInput[i].val}}
|
|
|
</view>
|
|
|
<view class="carinput-input-i " :class="{'input-active':carIndex == 7}" @tap.stop="inputKey" data-index="7">
|
|
@@ -30,11 +34,17 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <uni-forms-item label="车牌号" name="plateNumber">
|
|
|
- <view class="flexc" @click="">
|
|
|
+ <!-- <uni-forms-item label="车牌号" name="plateNumber">
|
|
|
+ <view class="flexc">
|
|
|
<uni-easyinput :disabled="isdisabled" v-model="datainfo.plateNumber" :inputBorder='false' placeholder="请输入车牌号" />
|
|
|
<view class="rimg"><image :src="rimg"></image></view>
|
|
|
</view>
|
|
|
+ </uni-forms-item> -->
|
|
|
+ <uni-forms-item label="手机号码" required name="residentPhone">
|
|
|
+ <view class="flexc" >
|
|
|
+ <uni-easyinput :disabled="isdisabled" v-model="datainfo.residentPhone" :inputBorder='false' placeholder="请输入手机号" />
|
|
|
+ <view class="rimg"><image :src="rimg"></image></view>
|
|
|
+ </view>
|
|
|
</uni-forms-item>
|
|
|
<block v-if="zhanfalg">
|
|
|
<uni-forms-item label="居住门户" name="houseId">
|
|
@@ -50,35 +60,32 @@
|
|
|
>
|
|
|
</w-select>
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="品牌车型" name="vehicleBrand">
|
|
|
- <picker range-key='dictLabel' :disabled="isdisabled" :value="cllxidx" :range="cllxList" @change='bindDateChange'>
|
|
|
- <view class="flexc mh35">
|
|
|
- <view class="flex1 txr f13 co27" v-if="datainfo.vehicleBrand&&!cllx">{{statusFormats(datainfo.vehicleBrand,cllxList,'cllx')}}</view>
|
|
|
- <view class="flex1 txr f13" v-else :class="cllx?'co27':'coa'">{{cllx||"请选择品牌车型"}}</view>
|
|
|
+ <uni-forms-item label="品牌车型" name="vehicleBrand">
|
|
|
+ <view class="flexc">
|
|
|
+ <uni-easyinput :disabled="isdisabled" v-model="datainfo.vehicleBrand" :inputBorder='false' placeholder="请输入品牌车型" />
|
|
|
<view class="rimg"><image :src="rimg"></image></view>
|
|
|
</view>
|
|
|
- </picker>
|
|
|
- </uni-forms-item>
|
|
|
- <!-- <uni-forms-item label="车辆类型" name="vehicleType">
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="车辆类型" name="vehicleType">
|
|
|
<view class="flexc" @click.stop="">
|
|
|
<uni-easyinput :disabled="isdisabled" v-model="datainfo.vehicleType" :inputBorder='false' placeholder="请输入车辆类型" />
|
|
|
<view class="rimg"><image :src="rimg"></image></view>
|
|
|
</view>
|
|
|
- </uni-forms-item> -->
|
|
|
+ </uni-forms-item>
|
|
|
<uni-forms-item label="车辆颜色" name="vehicleColour">
|
|
|
- <view class="flexc" @click="">
|
|
|
+ <view class="flexc">
|
|
|
<uni-easyinput :disabled="isdisabled" v-model="datainfo.vehicleColour" :inputBorder='false' placeholder="请输入车辆颜色" />
|
|
|
<view class="rimg"><image :src="rimg"></image></view>
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="发动机编号" name="engineNumber">
|
|
|
- <view class="flexc" @click="">
|
|
|
+ <view class="flexc">
|
|
|
<uni-easyinput :disabled="isdisabled" v-model="datainfo.engineNumber" :inputBorder='false' placeholder="请输入发动机编号" />
|
|
|
<view class="rimg"><image :src="rimg"></image></view>
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
<uni-forms-item label="车辆识别代号" name="identificationNumber">
|
|
|
- <view class="flexc" @click="">
|
|
|
+ <view class="flexc">
|
|
|
<uni-easyinput :disabled="isdisabled" v-model="datainfo.identificationNumber" :inputBorder='false' placeholder="请输入车辆识别代号" />
|
|
|
<view class="rimg"><image :src="rimg"></image></view>
|
|
|
</view>
|
|
@@ -118,6 +125,7 @@
|
|
|
import {houseInfolistNoPage} from "@/api/work/work.js"
|
|
|
import {carPut,carAdd,carDet} from "@/api/work/car.js"
|
|
|
import {getDictionaryFn} from "@/api/system/user.js"
|
|
|
+ import {getvehicleLicense} from "@/api/system/card.js"
|
|
|
import tkiFloatKeyboard from "@/mine/components/tki-float-keyboard/tki-float-keyboard.vue";
|
|
|
export default{
|
|
|
components:{wSelect,tkiFloatKeyboard},
|
|
@@ -145,14 +153,19 @@
|
|
|
// "carId":"",//业主车辆主键
|
|
|
"houseId":"",//房屋信息id
|
|
|
"detailedAddress":"",//房屋的详细门牌号
|
|
|
- "userId":"",//用户id
|
|
|
+ // "userId":"",//用户id
|
|
|
"residentId":"",//居住人员表id
|
|
|
- "userName":"",//业主姓名
|
|
|
+ // "userName":"",//业主姓名
|
|
|
"residentPhone":"",//业主手机号
|
|
|
"plateNumber":"",//车牌号码
|
|
|
"vehicleBrand":"",//车辆车型
|
|
|
- // "vehicleType":"",//车辆类型
|
|
|
+ "vehicleType":"",//车辆类型
|
|
|
+ "engineNumber":"",//发动机编号
|
|
|
+ "identificationNumber":"",//车辆识别代号
|
|
|
+ "registrationDate":"",//注册日期
|
|
|
+ "issueDate":"",//发证日期
|
|
|
},
|
|
|
+ // vehicleEnergy 车辆能源类型 燃油 新能源
|
|
|
zhanfalg:true,
|
|
|
syqxidx:'',
|
|
|
filterable:true,
|
|
@@ -162,9 +175,7 @@
|
|
|
rules:{
|
|
|
houseId: {rules: [{required: true,errorMessage: '请选择居住门户' }]},
|
|
|
detailedAddress: {rules: [{required: true,errorMessage: '请输入居住地址' }]},
|
|
|
- // name: {rules: [{required: true,errorMessage: '请输入访客姓名' }]},
|
|
|
- // portalId: {rules: [{required: true,errorMessage: '请选择来访门户' }]},
|
|
|
- // mobileNumber: {rules: [{required: true,errorMessage: '请输入手机号'}, {pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,errorMessage:'请输入正确的手机号码'}]},
|
|
|
+ residentPhone: {rules: [{required: true,errorMessage: '请输入手机号'}, {pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,errorMessage:'请输入正确的手机号码'}]},
|
|
|
},
|
|
|
cllx:"",
|
|
|
cllxidx:0,
|
|
@@ -172,6 +183,8 @@
|
|
|
id:'',
|
|
|
isdisabled:false,
|
|
|
ptype:'add',
|
|
|
+ userId:this.$store.state.user.userId,
|
|
|
+ phonenumber:this.$store.state.user.phonenumber,
|
|
|
}
|
|
|
},
|
|
|
onLoad: function(e) {
|
|
@@ -180,8 +193,11 @@
|
|
|
this.ptype="edit";
|
|
|
this.isdisabled=true;
|
|
|
this.getDetail()
|
|
|
+ }else{
|
|
|
+ this.datainfo.residentPhone=this.phonenumber
|
|
|
}
|
|
|
this.init()
|
|
|
+
|
|
|
},
|
|
|
methods:{
|
|
|
checkPermi, checkRole,
|
|
@@ -201,7 +217,10 @@
|
|
|
},
|
|
|
init(){
|
|
|
// 自己的房屋
|
|
|
- houseInfolistNoPage().then(res=>{
|
|
|
+ var params={
|
|
|
+ userId:this.userId
|
|
|
+ }
|
|
|
+ houseInfolistNoPage(params).then(res=>{
|
|
|
if(res.code==200){
|
|
|
this.fwlist= res.rows.map(v => {
|
|
|
return {
|
|
@@ -212,17 +231,17 @@
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- // 车辆类型
|
|
|
- getDictionaryFn('cartype').then(res=>{
|
|
|
- if(res.code==200){
|
|
|
- this.cllxList = res.data.map(v => {
|
|
|
- return {
|
|
|
- dictLabel: v.dictLabel,
|
|
|
- dictValue: v.dictValue
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ // // 车辆类型
|
|
|
+ // getDictionaryFn('cartype').then(res=>{
|
|
|
+ // if(res.code==200){
|
|
|
+ // this.cllxList = res.data.map(v => {
|
|
|
+ // return {
|
|
|
+ // dictLabel: v.dictLabel,
|
|
|
+ // dictValue: v.dictValue
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
bindDateChange(e){
|
|
|
var val=e.detail.value;
|
|
@@ -232,25 +251,24 @@
|
|
|
getDetail(){
|
|
|
carDet(this.id).then(res=>{
|
|
|
if(res.code==200){
|
|
|
- this.datainfo=res.data
|
|
|
+ this.datainfo=res.data;
|
|
|
+ if(res.data.plateNumber){
|
|
|
+ this.toCarCode(res.data.plateNumber)
|
|
|
+ if(res.data.vehicleEnergy=='新能源'){
|
|
|
+ this.isPower=true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
getSubmit(){
|
|
|
+ var num=this.toBind()
|
|
|
+ if(num=='-1'){
|
|
|
+ this.$toast('请输入完整的车牌号')
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$refs.form.validate().then(res => {
|
|
|
var params=JSON.parse(JSON.stringify(this.datainfo))
|
|
|
- // if(!params.portalId){
|
|
|
- // this.$toast("请选择来访门户")
|
|
|
- // return
|
|
|
- // }
|
|
|
- // if(params.isCar=='Y'&&!params.plateNumber){
|
|
|
- // this.$toast("请输入车牌号")
|
|
|
- // return
|
|
|
- // }
|
|
|
- // if(!params.visitorTime){
|
|
|
- // this.$toast("请选择来访时间")
|
|
|
- // return
|
|
|
- // }
|
|
|
if(this.ptype=='add'){
|
|
|
carAdd(params).then(res=>{
|
|
|
if(res.code==200){
|
|
@@ -280,16 +298,6 @@
|
|
|
},
|
|
|
getaddImage(e){
|
|
|
let that = this;
|
|
|
- // var rs=['D:\\idcard.png']
|
|
|
- // if(rs&&rs.length>0){
|
|
|
- // var obj={
|
|
|
- // type:e,
|
|
|
- // // url:baseUrl+rs.join(',')
|
|
|
- // url:rs.join(',')
|
|
|
- // }
|
|
|
- // that.getOcrIdCard(obj)
|
|
|
- // }
|
|
|
- // return
|
|
|
let file =[],count=9
|
|
|
uni.chooseImage({
|
|
|
count: 1,
|
|
@@ -306,14 +314,13 @@
|
|
|
var fuwufile = [];
|
|
|
uploadIdentify('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
|
|
|
var resurl=rs[0];
|
|
|
- if(e=='front'){
|
|
|
- that.datainfo.front=resurl.fileName;
|
|
|
- }else{
|
|
|
- that.datainfo.back=resurl.fileName;
|
|
|
- }
|
|
|
+ // if(e=='front'){
|
|
|
+ // that.datainfo.front=resurl.fileName;
|
|
|
+ // }else{
|
|
|
+ // that.datainfo.back=resurl.fileName;
|
|
|
+ // }
|
|
|
if(rs&&rs.length>0){
|
|
|
var obj={
|
|
|
- type:e,
|
|
|
url:resurl.urlOnline
|
|
|
}
|
|
|
that.getOcrIdCard(obj)
|
|
@@ -326,18 +333,20 @@
|
|
|
getOcrIdCard(obj){
|
|
|
var params={
|
|
|
image:obj.url,
|
|
|
- idCardSide:obj.type
|
|
|
}
|
|
|
- getOcrIdCard(params).then(res=>{
|
|
|
+ getvehicleLicense(params).then(res=>{
|
|
|
if(res.code==200){
|
|
|
var datainfo=res.data;
|
|
|
- if(obj.type=='front'){
|
|
|
- this.datainfo.realName=datainfo.realName;
|
|
|
- this.datainfo.idCard=datainfo.idCard;
|
|
|
- this.datainfo.address=datainfo.address;
|
|
|
- }else{
|
|
|
- this.datainfo.expirationDate=datainfo.expirationDate
|
|
|
- }
|
|
|
+ this.datainfo.vehicleBrand=datainfo.vehicleBrand;
|
|
|
+ this.datainfo.vehicleType=datainfo.vehicleType;
|
|
|
+ this.datainfo.engineNumber=datainfo.engineNumber;
|
|
|
+ this.datainfo.identificationNumber=datainfo.identificationNumber;
|
|
|
+ var zcrq=datainfo.registrationDate;
|
|
|
+ var fzrq=datainfo.issueDate;
|
|
|
+ this.datainfo.registrationDate=`${zcrq.slice(0, 4)}-${zcrq.slice(4, 6)}-${zcrq.slice(6, 8)}`;
|
|
|
+ this.datainfo.issueDate=`${fzrq.slice(0, 4)}-${fzrq.slice(4, 6)}-${fzrq.slice(6, 8)}`;
|
|
|
+ this.datainfo.plateNumber=datainfo.plateNumber;
|
|
|
+ this.toCarCode(datainfo.plateNumber)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -363,15 +372,17 @@
|
|
|
let that = this;
|
|
|
let data = e.currentTarget.dataset;
|
|
|
that.carIndex = data.index;
|
|
|
- // if (data.index >= 7) {
|
|
|
- // if (!that.isPower) {
|
|
|
- // return false;
|
|
|
- // } else {
|
|
|
- // that.carIndex = 7;
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // that.carIndex = data.index;
|
|
|
- // }
|
|
|
+ if (data.index >= 7) {
|
|
|
+ that.isPower=true;
|
|
|
+ that.carIndex = 7;
|
|
|
+ // if (!that.isPower) {
|
|
|
+ // return false;
|
|
|
+ // } else {
|
|
|
+ // that.carIndex = 7;
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ that.carIndex = data.index;
|
|
|
+ }
|
|
|
that.upKeyType();
|
|
|
that.keyShow();
|
|
|
},
|
|
@@ -403,6 +414,7 @@
|
|
|
},
|
|
|
keyCbDel(e) {
|
|
|
let index = this.carIndex;
|
|
|
+ console.log(index,1)
|
|
|
if (index > 0) {
|
|
|
if (!this.empty(this.carInput[index].val)) {
|
|
|
this.carInput[index].val = "";
|
|
@@ -411,6 +423,12 @@
|
|
|
this.carInput[index - 1].val = "";
|
|
|
this.carIndex = index - 1;
|
|
|
}
|
|
|
+ if(index==7){
|
|
|
+ var obj={ type: 1, val: "" }
|
|
|
+ this.carInput.splice(index,1,obj)
|
|
|
+ this.isPower=false;
|
|
|
+ }
|
|
|
+ console.log(this.carInput)
|
|
|
}
|
|
|
this.upKeyType();
|
|
|
},
|
|
@@ -475,13 +493,35 @@
|
|
|
let that = this
|
|
|
let ck = that.checkCar();
|
|
|
if (ck.i == -1 && !ck.isempty) {
|
|
|
- console.log('可以绑定车牌了')
|
|
|
+ this.datainfo.plateNumber=ck.val;
|
|
|
+ if(this.isPower){
|
|
|
+ this.datainfo.vehicleEnergy='新能源'
|
|
|
+ }else{
|
|
|
+ this.datainfo.vehicleEnergy='燃油车'
|
|
|
+ }
|
|
|
+ return ck.val
|
|
|
} else {
|
|
|
// 显示键盘输入
|
|
|
- that.keyShow();
|
|
|
- that.carIndex = ck.i;
|
|
|
- that.keyType = that.carInput[ck.i].type
|
|
|
+ // that.keyShow();
|
|
|
+ // that.carIndex = ck.i;
|
|
|
+ // that.keyType = that.carInput[ck.i].type;
|
|
|
+ return '-1'
|
|
|
}
|
|
|
+ },
|
|
|
+ //分解车牌
|
|
|
+ toCarCode(code){
|
|
|
+ var list=JSON.parse(JSON.stringify(this.carInput))
|
|
|
+ var newArr=[]
|
|
|
+ if(code){
|
|
|
+ newArr=code.split('')
|
|
|
+ }
|
|
|
+ list.forEach((ite,idx)=>{
|
|
|
+ ite.val=newArr[idx]
|
|
|
+ })
|
|
|
+ if(newArr.length==8){
|
|
|
+ this.isPower=true;
|
|
|
+ }
|
|
|
+ this.carInput=JSON.parse(JSON.stringify(list))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -492,8 +532,9 @@
|
|
|
<style lang="scss" scoped>
|
|
|
// 车牌
|
|
|
.carinput {margin-top: 74rpx;display: flex;flex-direction: column;padding-left: 40rpx;padding-right: 40rpx}
|
|
|
-.carinput-input{display: flex;justify-content: center;padding-bottom: 40rpx;border-bottom: 2rpx solid #CDCDCD;
|
|
|
+.carinput-input{display: flex;justify-content: center;padding-bottom: 40rpx;border-bottom: 2rpx solid #CDCDCD;align-items: center;
|
|
|
.input-active {color: #0256FD;border: 2rpx solid #0256FD;}
|
|
|
+ .cir{width: 14rpx;height: 14rpx;background: #8D8D8D;border-radius: 50%;margin-right: 18rpx;}
|
|
|
}
|
|
|
|
|
|
.carinput-input-i{width: 62rpx;height: 88rpx;background: #F5F4F7;border-radius: 10rpx;font-weight: bold;font-size: 30rpx;color: #272727;margin-right: 18rpx;text-align: center;box-sizing: border-box;display: flex;flex-direction: column;align-items: center;justify-content: center;
|
|
@@ -502,8 +543,9 @@
|
|
|
image{width: 28rpx;height: 28rpx;margin-bottom: 4rpx;}
|
|
|
}
|
|
|
}
|
|
|
+.check /deep/ .uni-date-editor--x__disabled{opacity: 1;}
|
|
|
.carinput-input-i:nth-last-child(1) {margin-right: 0}
|
|
|
-
|
|
|
+.check /deep/ .uni-forms-item__label .is-required{width: auto;}
|
|
|
.coa /deep/ .uni-date__x-input{text-align: right;color: #AAAAAA;}
|
|
|
.check /deep/ .select-wrap{border: none;width: 100%;}
|
|
|
.check /deep/ .uni-forms-item{min-height: 106rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:10rpx 0;}
|
|
@@ -523,7 +565,7 @@
|
|
|
}
|
|
|
.chmain{
|
|
|
padding: 0 24rpx;
|
|
|
- .upbox{height: 224rpx;background: #EFF4FF;border-radius: 20rpx;display: flex;align-items: center;justify-content: center;flex-direction: column;margin-bottom: 44rpx;overflow: auto;
|
|
|
+ .upbox{height: 224rpx;background: #EFF4FF;border-radius: 20rpx;display: flex;align-items: center;justify-content: center;flex-direction: column;overflow: auto;
|
|
|
.img{width: 100%;height: 100%;}
|
|
|
.addimg{width: 90rpx;height: 90rpx;margin-bottom: 8rpx;}
|
|
|
view{font-weight: bold;font-size: 26rpx;color: #4C6686;}
|