Commit f0855a6f by 胡悦

提交

1 parent 1f07588e
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-04-07 14:54:28
* @LastEditors: huyue
* @LastEditTime: 2024-04-09 19:22:47
* @LastEditTime: 2024-04-09 20:18:12
-->
<template>
<view class="information-entry">
......@@ -53,20 +53,22 @@
:popupH="820"
>
<view name="content">
<view class="pop-tips"
<view class="error-tip" v-if="errorTip">以下信息不能为空,请完善信息后保存</view>
<view class="pop-tips" v-else
>检测到“交车通知书”中未填写客户档案,请填写后再完成接待。</view
>
<view class="form">
<view class="form" :key="f_key">
<template v-for="(i, index) in formObject">
<view class="form-item" :key="index">
<view class="label">{{ i.label }}</view>
<view :class="['value', {error:i.error}]">
<view :class="['value', {error: i.error}]">
<template v-if="i.type == 'input'">
<input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="formData[i.key]"
class="input"
@blur="blur(i.key)"
/>
</template>
<template v-else>
......@@ -198,6 +200,8 @@ export default {
employeeBoxVisible: false,
carlist: [],
employeeList: [],
f_key: Date.now(),
errorTip: false
};
},
onLoad(options) {
......@@ -206,6 +210,8 @@ export default {
title: text,
});
this.$store.dispatch("getCustomerInfo").then((customerInfo) => {
console.log(customerInfo,' =======')
this.formData = customerInfo
this.isPass = Object.values(customerInfo).every((value) => !!value);
});
......@@ -268,12 +274,17 @@ export default {
// this.messageBoxVisible = false;
try {
for(let i in this.formData) {
if (!this.formData[i]) throw i
if (!this.formData[i] && i != 'salesUuid') throw i
}
} catch (error) {
this.formData[i].error = true
console.log(error)
this.formObject.find(item => item.key == error).error = true
console.log(this.formObject)
this.f_key = Date.now()
this.errorTip = true
// this.formObject[error].error = true
}
this.stopAudio();
// this.stopAudio();
},
// 选择车型与销售
showPop(key) {
......@@ -298,10 +309,19 @@ export default {
} else this.formData.carModel = item.name;
this.$store.dispatch("setCustomerInfo", this.formData);
console.log(this.formData)
this.formObject.map(item => item.error = false)
this.f_key = Date.now()
this.errorTip = false
},
showPopup(e) {
this[e] = true;
},
blur(popkey) {
console.log(popkey)
this.formObject.find(item => item.key == popkey).error = false
this.f_key = Date.now()
this.errorTip = false
}
},
};
</script>
......@@ -401,6 +421,14 @@ export default {
margin-top: 30rpx;
text-align: center;
}
.error-tip {
font-size: 28rpx;
padding: 32rpx 60rpx 24rpx;
margin-top: 30rpx;
text-align: center;
background-color: rgb(254, 237, 234);
color: #f45c3d;
}
.form {
display: flex;
flex-wrap: wrap;
......@@ -435,6 +463,9 @@ export default {
margin-left: 32rpx;
box-sizing: border-box;
padding: 0 40rpx;
&.error {
border: 2rpx solid #F24724;
}
.input,
.select {
width: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!