yangan
2 天以前 a28d0135ee42809b2c5863609da37155d3ecba5b
pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue
@@ -1,23 +1,25 @@
<template>
   <!-- 添加货代或司机 -->
   <!-- 添加承运商或司机 -->
   <view class="addTo-freightForwarder-drvier">
      <view class="addForm">
         <u--form labelPosition="top"
            ref="form1">
            <u-form-item labelWidth="20%"
               :label="role == 1 ?'承运商' : '姓名'" 
               ref="item1"><u--input v-model="name"
               ref="item1"
               v-if="role == 1"><u--input v-model="name"
                  :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item>
            <u-form-item labelWidth="25%"
               label="手机号"
               ref="item1"><u--input v-model="phone"
               ref="item1"
               v-if="role == 1"><u--input v-model="phone"
                  :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item>
            <u-form-item labelWidth="25%"
               label="汽车车牌号"
               ref="item1"
               v-if="role == 2">
               <u--input v-model="carNo"
                  :customStyle="{ border: '1px solid #dddddd' }"></u--input>
               <xm-cell special label="车牌号" :value="carNo" @show="showKeyboard('xmKeyboard')"></xm-cell>
               <xm-keyboard-v2 ref="xmKeyboard" @confirm="(v) => carNo = v"></xm-keyboard-v2>
            </u-form-item>
         </u--form>
      </view>
@@ -44,7 +46,7 @@
      },
      data() {
         return {
            role: null, // 决定添加货代司机,还是车队司机
            role: null, // 决定添加承运商司机,还是车队司机
            fleetId: null,
            name: '',
            phone: '',
@@ -54,6 +56,9 @@
         };
      },
      methods: {
         showKeyboard(ref){
            this.$refs[ref].toShow(this.carNo)
         },
         init() {},
         addToHuoDaiOrDriver() {
            switch (this.role) {
@@ -69,7 +74,7 @@
                  }
                  break;
               case '2':
                  if (this.name == '' || this.phone == '' || this.carNo == '') {
                  if (this.carNo == '') {
                     uni.showToast({
                        title: '请规范输入!',
                        icon: 'error',
@@ -82,7 +87,7 @@
                  break;
            }
         },
         // 邀请货代
         // 邀请承运商
         bindHuoDai() {
            this.loading = true
            this.$reqPost('bindHuoDai', { name: this.name, phone: this.phone }, 'params').then(res => {
@@ -108,8 +113,6 @@
            this.loading = true
            this.$reqPost('bindUserFleet', {
               fleetId: this.fleetId,
               name: this.name,
               phone: this.phone,
               carNo: this
                  .carNo
            }, 'params').then(res => {