|
@@ -14,9 +14,6 @@
|
|
|
<a-form-model-item label="手机号" prop="custMobile">
|
|
|
<a-input v-model.trim="form.custMobile" @input="mobileInput" :maxLength="11" placeholder="支持新增和搜索" />
|
|
|
</a-form-model-item>
|
|
|
- <a-form-model-item label="车牌号" prop="vehicleNumber">
|
|
|
- <a-input v-model.trim="form.vehicleNumber" :maxLength="8" placeholder="请输入车牌号(最多8个字符)" />
|
|
|
- </a-form-model-item>
|
|
|
<a-form-model-item label="客户姓名" prop="custName"><a-input v-model.trim="form.custName" :maxLength="30" placeholder="请输入客户姓名(最多30个字符)" /></a-form-model-item>
|
|
|
<a-form-model-item label="应收金额" class="item-con">
|
|
|
<p class="item-main">
|
|
@@ -35,7 +32,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { isLicensePlate, isMobile } from '@/libs/tools'
|
|
|
+import { isMobile } from '@/libs/tools'
|
|
|
import { bundleFindByMobile, bundleBuy } from '@/api/customerBundle.js'
|
|
|
export default {
|
|
|
name: 'SetmealPayMoney',
|
|
@@ -66,29 +63,15 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 校验车牌号
|
|
|
- const isLicensePlateValid = (rule, value, callback) => {
|
|
|
- if (!value) {
|
|
|
- callback(new Error('请输入车牌号'))
|
|
|
- } else {
|
|
|
- if (!isLicensePlate(value)) {
|
|
|
- callback(new Error('请输入正确的车牌号'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
return {
|
|
|
isShow: this.openModal, // 弹框是否展示
|
|
|
form: {
|
|
|
custMobile: '',
|
|
|
- vehicleNumber: '',
|
|
|
custName: '',
|
|
|
custId: null
|
|
|
},
|
|
|
rules: {
|
|
|
- custMobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }, { validator: isMobileValid, trigger: 'blur' }],
|
|
|
- vehicleNumber: [{ required: true, message: '请输入车牌号', trigger: 'blur' }, { validator: isLicensePlateValid, trigger: 'blur' }]
|
|
|
+ custMobile: [{ required: true, message: '请输入手机号', trigger: 'blur' }, { validator: isMobileValid, trigger: 'blur' }]
|
|
|
},
|
|
|
setmealData: null // 套餐数据
|
|
|
}
|
|
@@ -104,18 +87,12 @@ export default {
|
|
|
if (res.status == 200) {
|
|
|
if (res.data) {
|
|
|
// 查到客户信息
|
|
|
- this.form.vehicleNumber = ''
|
|
|
- this.form.custName = res.data.name
|
|
|
this.form.custId = res.data.id
|
|
|
} else {
|
|
|
// 未查到客户信息
|
|
|
- this.form.vehicleNumber = ''
|
|
|
- this.form.custName = ''
|
|
|
this.form.custId = null
|
|
|
}
|
|
|
} else {
|
|
|
- this.form.vehicleNumber = ''
|
|
|
- this.form.custName = ''
|
|
|
this.form.custId = null
|
|
|
}
|
|
|
})
|
|
@@ -131,7 +108,6 @@ export default {
|
|
|
custId: this.form.custId,
|
|
|
custName: this.form.custName,
|
|
|
custMobile: this.form.custMobile,
|
|
|
- vehicleNumber: this.form.vehicleNumber,
|
|
|
totalAmount: this.setmealData.price,
|
|
|
paymentDetail: { payType: 10001 }
|
|
|
}
|
|
@@ -158,7 +134,6 @@ export default {
|
|
|
// 重置表单
|
|
|
resetForm () {
|
|
|
this.form.custMobile = ''
|
|
|
- this.form.vehicleNumber = ''
|
|
|
this.form.custName = ''
|
|
|
this.form.custId = null
|
|
|
}
|