Commit 04848d8a by 李伟康

修复完成接待页面数据没更新

1 parent c641f592
<template> <template>
<view class="step"> <view class="step">
<MessageBox ref="formRef" @cancel="cancel" @confirm="submit" :cancelBtnText="`${step == 1 ? '取消' : '上一步'}`" :confirmBtnText="`${sceneType == 0 ? (step == 1 ? '下一步' : '完成接待') : '完成接待'}`" :title="`${step == 1 ? '客户信息完善' : '结果反馈'}`" :popupW="820" :maxHeight="820" :isAutoClose="false"> <MessageBox
<view name="content"> ref="formRef"
@cancel="cancel"
@confirm="submit"
:cancelBtnText="`${step == 1 ? '取消' : '上一步'}`"
:confirmBtnText="`${sceneType == 0 ? (step == 1 ? '下一步' : '完成接待') : '完成接待'}`"
:title="`${step == 1 ? '客户信息完善' : '结果反馈'}`"
:popupW="820"
:maxHeight="820"
:isAutoClose="false"
>
<view
name="content"
:key="updateViewKey"
>
<template v-if="step == 1"> <template v-if="step == 1">
<template v-if="!check(true)"> <template v-if="!check(true)">
<view class="error-tip" v-if="errorTip">以下信息不能为空,请完善信息后保存</view> <view
<view class="pop-tips" v-else>{{ tips }}</view> class="error-tip"
v-if="errorTip"
>以下信息不能为空,请完善信息后保存</view>
<view
class="pop-tips"
v-else
>{{ tips }}</view>
</template> </template>
<view class="form"> <view class="form">
<template v-for="(i, index) in formObject"> <template v-for="(i, index) in formObject">
<view class="form-item" :key="index"> <view
class="form-item"
:key="index"
>
<view :class="['label', { required: i.required }]">{{ i.label }}</view> <view :class="['label', { required: i.required }]">{{ i.label }}</view>
<view :class="['value', { error: showError(i.key) && i.required }, { disabled: customerType == 0 || i.disabled }]"> <view :class="['value', { error: showError(i.key) && i.required }, { disabled: customerType == 0 || i.disabled }]">
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
<input :type="i.inputType" :maxlength="i.maxlength" v-model="formData[i.key]" class="input" :placeholder="i.placeholder" :disabled="customerType == 0" @input="inputCustomer" placeholder-style="color:#c9c9c9;" /> <input
:type="i.inputType"
:maxlength="i.maxlength"
v-model="formData[i.key]"
class="input"
:placeholder="i.placeholder"
:disabled="customerType == 0"
@input="inputCustomer"
placeholder-style="color:#c9c9c9;"
/>
</template> </template>
<template v-else> <template v-else>
<view :class="['select', `${formData[i.key] ? '' : 'placeholder'}`]" @click="showPopup(i)"> <view
:class="['select', `${formData[i.key] ? '' : 'placeholder'}`]"
@click="showPopup(i)"
>
{{ formData[i.key] || i.placeholder }} {{ formData[i.key] || i.placeholder }}
<uni-icons class="arrow" type="down" :size="16"></uni-icons> <uni-icons
class="arrow"
type="down"
:size="16"
></uni-icons>
</view> </view>
</template> </template>
</view> </view>
...@@ -30,7 +68,11 @@ ...@@ -30,7 +68,11 @@
<view class="pop-tips">请完善本次接待结果</view> <view class="pop-tips">请完善本次接待结果</view>
<view class="choose-box"> <view class="choose-box">
<template v-for="(i, index) in resultList"> <template v-for="(i, index) in resultList">
<view :class="['choose-item', `${i.status == receptionStatus ? (i.status == 1 ? 'success' : 'error') : ''}`]" :key="index" @click="chooseResult(i.status)"> <view
:class="['choose-item', `${i.status == receptionStatus ? (i.status == 1 ? 'success' : 'error') : ''}`]"
:key="index"
@click="chooseResult(i.status)"
>
<view :class="['sprite-icon', `icon-face-${i.status == receptionStatus ? `${i.icon}-active` : i.icon}`]"></view> <view :class="['sprite-icon', `icon-face-${i.status == receptionStatus ? `${i.icon}-active` : i.icon}`]"></view>
{{ i.text }} {{ i.text }}
</view> </view>
...@@ -39,10 +81,23 @@ ...@@ -39,10 +81,23 @@
</template> </template>
</view> </view>
</MessageBox> </MessageBox>
<car-brands ref="carBrandListVisible" @select="handleSelect($event, 'carBrandListVisible')" /> <car-brands
<employee ref="employeeBoxVisible" @select="handleSelect($event, 'employeeBoxVisible')" /> ref="carBrandListVisible"
<uni-popup ref="successRef" type="message"> @select="handleSelect($event, 'carBrandListVisible')"
<uni-popup-message type="success" message="数据保存成功" :duration="1500"></uni-popup-message> />
<employee
ref="employeeBoxVisible"
@select="handleSelect($event, 'employeeBoxVisible')"
/>
<uni-popup
ref="successRef"
type="message"
>
<uni-popup-message
type="success"
message="数据保存成功"
:duration="1500"
></uni-popup-message>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
...@@ -161,6 +216,7 @@ export default { ...@@ -161,6 +216,7 @@ export default {
], ],
errorTip: false, errorTip: false,
receptionStatus: -1, receptionStatus: -1,
updateViewKey: Date.now()
} }
}, },
computed: { computed: {
...@@ -273,6 +329,7 @@ export default { ...@@ -273,6 +329,7 @@ export default {
open () { open () {
this.$store.dispatch('getCustomerInfo').then((customerInfo) => { this.$store.dispatch('getCustomerInfo').then((customerInfo) => {
this.formData = customerInfo this.formData = customerInfo
this.updateViewKey = Date.now()
let { sceneType, customerType } = this, let { sceneType, customerType } = this,
step = Object.values(customerInfo).every((value) => !!value) ? 2 : 1 step = Object.values(customerInfo).every((value) => !!value) ? 2 : 1
this.errorTip = false this.errorTip = false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!