|
@@ -32,7 +32,7 @@
|
|
|
</view>
|
|
|
<view class="basic-table">
|
|
|
<!-- <view class="search-btn marginZero" @click="OpenAddDrawer">新增</view> -->
|
|
|
- <baseDateTable @DelCarData="DelCarData" @EditCarData="EditCarData" :headerFixed="true"
|
|
|
+ <baseDateTable @DelCarData="DelCarData" @EditCarData="EditCarData" @bindHandle="bindHandle" :isBind="true" :headerFixed="true"
|
|
|
:showLoadMore="showLoadMore" :loadMore="loadMore" :columnFixed=1 :contents="datalist" :headers="carheaders"
|
|
|
@onPullup="pullup">
|
|
|
</baseDateTable>
|
|
@@ -93,7 +93,7 @@
|
|
|
@AddCarinfo="AddCarinfo" @EditCarInfo="EditCarInfo">
|
|
|
<view class="drawer_main">
|
|
|
<view>
|
|
|
- <BasicDrawer :basicFrom="basicFrom" :range="range"></BasicDrawer>
|
|
|
+ <BasicDrawer :basicFrom="basicFrom" :range="range" @redHandle="redHandle"></BasicDrawer>
|
|
|
</view>
|
|
|
</view>
|
|
|
</PublicDrawer>
|
|
@@ -119,6 +119,17 @@
|
|
|
</PublicDrawer>
|
|
|
</scroll-view>
|
|
|
</uni-drawer>
|
|
|
+ <uni-drawer ref="BindDrawer" mode="right" :width="400" :mask-click="true">
|
|
|
+ <scroll-view style="height: 100%;" scroll-y="true" v-if="isSelect===0">
|
|
|
+ <PublicDrawer :flag="false" :title="'绑定FRID'" @closeDrawer="closeDrawer" @BindFRIDHandle="BindFRIDHandle">
|
|
|
+ <view class="drawer_main">
|
|
|
+ <view>
|
|
|
+ <BindDrawer :basicFrom="basicFrom" :range="range" @redHandle="redHandle" @inputHandle="inputHandle"></BindDrawer>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </PublicDrawer>
|
|
|
+ </scroll-view>
|
|
|
+ </uni-drawer>
|
|
|
<!-- 右侧抽屉结束 -->
|
|
|
<!-- 顶部公共提示信息 -->
|
|
|
<uni-popup ref="Exchangepopup" type="message">
|
|
@@ -132,6 +143,7 @@
|
|
|
import baseDateTable from './baseData-table/baseDateTable'
|
|
|
import cangDateTable from './baseData-table/cangDateTable'
|
|
|
import BasicDrawer from './BasicDrawer'
|
|
|
+ import BindDrawer from './BindDrawer'
|
|
|
import ChargeDrawer from './ChargeDrawer'
|
|
|
import BatteryDrawer from './BatteryDrawer'
|
|
|
export default {
|
|
@@ -141,7 +153,8 @@
|
|
|
cangDateTable,
|
|
|
BasicDrawer,
|
|
|
ChargeDrawer,
|
|
|
- BatteryDrawer
|
|
|
+ BatteryDrawer,
|
|
|
+ BindDrawer
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -171,6 +184,9 @@
|
|
|
CarPlate: undefined,
|
|
|
CarVin: undefined,
|
|
|
state: undefined,
|
|
|
+ rfidEpc: undefined,
|
|
|
+ epcFour: undefined,
|
|
|
+ frid: undefined,
|
|
|
},
|
|
|
//充电机仓位抽屉
|
|
|
setForm:{
|
|
@@ -444,11 +460,15 @@
|
|
|
carheaders: [{
|
|
|
label: '车牌号',
|
|
|
key: 'vehiclePlate',
|
|
|
- widtd: 210
|
|
|
+ widtd: 130
|
|
|
}, {
|
|
|
label: '车辆识别码(VIN码)',
|
|
|
key: 'vehicleVin',
|
|
|
- widtd: 315
|
|
|
+ widtd: 225
|
|
|
+ }, {
|
|
|
+ label: 'FRID',
|
|
|
+ key: 'rfidEpc',
|
|
|
+ widtd: 255,
|
|
|
}, {
|
|
|
label: '前端电池距离(mm)',
|
|
|
key: 'modelDistance',
|
|
@@ -489,7 +509,6 @@
|
|
|
regTemp(e){
|
|
|
const reg=/^\d*$/
|
|
|
if(!reg.test(e.detail.value) || e.detail.value==0){
|
|
|
- console.log(121212)
|
|
|
this.queryParamsSet.temp=90
|
|
|
}
|
|
|
},
|
|
@@ -545,6 +564,23 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ //读取frid
|
|
|
+ redHandle() {
|
|
|
+ this.$http.getEpc().then((res) => {
|
|
|
+ if(res.code===0){
|
|
|
+ let frid = res.data
|
|
|
+ this.basicFrom.frid=frid.replace(/.{4}$/, '****')
|
|
|
+ this.basicFrom.rfidEpc=frid
|
|
|
+ } else {
|
|
|
+ return this.ExchangeMessage('warn', '未获取FRID卡号')
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ inputHandle(data) {
|
|
|
+ console.log(data.toUpperCase(), '000')
|
|
|
+ this.basicFrom.epcFour = data.toUpperCase()
|
|
|
+ console.log(this.basicFrom, '333')
|
|
|
+ },
|
|
|
//保存站控配置
|
|
|
handleSave(){
|
|
|
const reg=/^\d*$/
|
|
@@ -853,7 +889,6 @@
|
|
|
},
|
|
|
//打开编辑车辆抽屉
|
|
|
EditCarData(row) {
|
|
|
- console.log(row)
|
|
|
this.dialogType = 'edit'
|
|
|
this.$refs.BasicDrawer.open();
|
|
|
this.basicFrom.CarDistance = row.modelDistance
|
|
@@ -862,6 +897,62 @@
|
|
|
this.basicFrom.state = row.state
|
|
|
this.basicFrom.id = row.id
|
|
|
},
|
|
|
+ //打开绑定frid
|
|
|
+ bindHandle(row) {
|
|
|
+ let _that = this
|
|
|
+ if(row.rfidEpc) {
|
|
|
+ uni.showModal({
|
|
|
+ title:`该车已经绑定FRID,是否继续绑定?`,
|
|
|
+ content:'',
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ _that.$refs.BindDrawer.open();
|
|
|
+ _that.basicFrom.CarDistance = row.modelDistance
|
|
|
+ _that.basicFrom.CarPlate = row.vehiclePlate
|
|
|
+ _that.basicFrom.CarVin = row.vehicleVin
|
|
|
+ _that.basicFrom.state = row.state
|
|
|
+ _that.basicFrom.id = row.id
|
|
|
+ _that.basicFrom.rfidEpc = row.rfidEpc
|
|
|
+ _that.basicFrom.frid = row.rfidEpc.replace(/.{4}$/, '****')
|
|
|
+ } else if (res.cancel) {
|
|
|
+ return false
|
|
|
+ //用户点击取消按钮触发
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ _that.$refs.BindDrawer.open();
|
|
|
+ _that.basicFrom.CarDistance = row.modelDistance
|
|
|
+ _that.basicFrom.CarPlate = row.vehiclePlate
|
|
|
+ _that.basicFrom.CarVin = row.vehicleVin
|
|
|
+ _that.basicFrom.state = row.state
|
|
|
+ _that.basicFrom.id = row.id
|
|
|
+ _that.basicFrom.rfidEpc = row.rfidEpc
|
|
|
+ _that.basicFrom.frid = row.rfidEpc.replace(/.{4}$/, '****')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //绑定建权
|
|
|
+ BindFRIDHandle() {
|
|
|
+ if (!this.basicFrom.rfidEpc || !this.basicFrom.epcFour) {
|
|
|
+ this.ExchangeMessage('warn', '请填写完整!')
|
|
|
+ } else {
|
|
|
+ const params = {
|
|
|
+ id: this.basicFrom.id,
|
|
|
+ rfidEpc: this.basicFrom.rfidEpc,
|
|
|
+ epcFour: this.basicFrom.epcFour
|
|
|
+ }
|
|
|
+ this.$http.vehicleBind(params)
|
|
|
+ .then(res => {
|
|
|
+ this.closeDrawer()
|
|
|
+ this.ExchangeMessage(res.code === 0 ? 'success' : 'error', res.msg)
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.vehicleList()
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
//编辑车辆请求接口
|
|
|
EditCarInfo() {
|
|
|
if (!this.basicFrom.CarDistance || !this.basicFrom.CarPlate || !this.basicFrom.CarVin) {
|
|
@@ -982,6 +1073,7 @@
|
|
|
//关闭抽屉
|
|
|
closeDrawer() {
|
|
|
this.$refs.BasicDrawer.close();
|
|
|
+ this.$refs.BindDrawer.close();
|
|
|
},
|
|
|
//车辆触底加载数据
|
|
|
pullup() {
|