Commit ce0771ea by 前端

状态

1 parent 3f726ab8
...@@ -55,7 +55,8 @@ ...@@ -55,7 +55,8 @@
<template v-for="i in list"> <template v-for="i in list">
<template v-for="item in i"> <template v-for="item in i">
<view class="item" :key="item.id" @click="jumpDetail(item)"> <view class="item" :key="item.id" @click="jumpDetail(item)">
<view :class="['status flex', { deal: item.receptionStatus == 1 }]"> <view class="status flex disabled" v-if="item.receptionStatus === '' || item.receptionStatus === undefined">未知</view>
<view :class="['status flex', { deal: item.receptionStatus == 1 }]" v-else>
{{ {{
{ {
1: '成交', 1: '成交',
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<save-record v-else @cancel="handleCancel" @submit="handleSubmit" :customerInfo="customerInfo"></save-record> <save-record v-else @cancel="handleCancel" @submit="handleSubmit" :customerInfoVal="customerInfo"></save-record>
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
...@@ -535,6 +536,10 @@ export default { ...@@ -535,6 +536,10 @@ export default {
font-weight: 500; font-weight: 500;
font-size: 24rpx; font-size: 24rpx;
justify-content: center; justify-content: center;
&.disabled {
background: #f2f2f2;
color: #999999;
}
} }
.deal { .deal {
background: #eaf9f1; background: #eaf9f1;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
</view> </view>
<view class="title">接待记录</view> <view class="title">接待记录</view>
</view> </view>
<view class="error-tip" v-if="errorTip">以下信息不能为空,请完善信息后保存</view>
<view class="form"> <view class="form">
<template v-for="(i, index) in formObject"> <template v-for="(i, index) in formObject">
<view :class="['form-item', { active: focusIndex == index }]" :key="index"> <view :class="['form-item', { active: focusIndex == index }]" :key="index">
...@@ -45,6 +46,7 @@ import CarBrands from '@/components/CarBrands.vue' ...@@ -45,6 +46,7 @@ import CarBrands from '@/components/CarBrands.vue'
import Employee from '@/components/Employee.vue' import Employee from '@/components/Employee.vue'
import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue' import CustomerAutocomplete from '@/components/CustomerAutocomplete.vue'
const phoneRex = /^[1]([3-9])[0-9]{9}$/; const phoneRex = /^[1]([3-9])[0-9]{9}$/;
import utils from "@/utils/utils";
export default { export default {
components: { components: {
CarBrands, CarBrands,
...@@ -52,13 +54,14 @@ export default { ...@@ -52,13 +54,14 @@ export default {
CustomerAutocomplete CustomerAutocomplete
}, },
props: { props: {
customerInfo: { customerInfoVal: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
} }
}, },
data() { data() {
return { return {
errorTip:false,
receptionList: [{ receptionList: [{
label: '成交', label: '成交',
value: 1 value: 1
...@@ -107,12 +110,13 @@ export default { ...@@ -107,12 +110,13 @@ export default {
}, },
], ],
focusIndex: -1, focusIndex: -1,
customerInfo:{}
} }
}, },
mounted() { mounted() {
console.log(this.customerInfo) this.customerInfo = utils.deepClone(this.customerInfoVal)
const i = this.receptionList.findIndex(e => e.value == this.customerInfo.receptionStatus) const i = this.receptionList.findIndex(e => e.value == this.customerInfo.receptionStatus)
this.customerInfo.receptionStatus = this.receptionList[i].label this.$set(this.customerInfo, 'receptionStatus', i == -1?'':this.receptionList[i].label)
}, },
methods: { methods: {
selectReception(value) { selectReception(value) {
...@@ -127,7 +131,7 @@ export default { ...@@ -127,7 +131,7 @@ export default {
}, },
handleSave() { handleSave() {
const result = this.check(true) const result = this.check(true)
if (!result) return if (!result) return this.errorTip = true
const i = this.receptionList.findIndex(e => e.label == this.customerInfo.receptionStatus) const i = this.receptionList.findIndex(e => e.label == this.customerInfo.receptionStatus)
this.customerInfo.receptionStatus = this.receptionList[i].value this.customerInfo.receptionStatus = this.receptionList[i].value
this.$emit('submit',this.customerInfo) this.$emit('submit',this.customerInfo)
...@@ -161,6 +165,7 @@ export default { ...@@ -161,6 +165,7 @@ export default {
this.customerInfo.carModel = item.name this.customerInfo.carModel = item.name
} }
this.resetFocusIndex() this.resetFocusIndex()
this.errorTip = false
}, },
showPopup(e, index) { showPopup(e, index) {
this.focusIndex = index this.focusIndex = index
...@@ -168,12 +173,22 @@ export default { ...@@ -168,12 +173,22 @@ export default {
}, },
resetFocusIndex() { resetFocusIndex() {
this.focusIndex = -1 this.focusIndex = -1
this.errorTip = false
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.error-tip {
font-size: 28rpx;
padding: 32rpx 60rpx 24rpx;
margin-top: 100rpx;
margin-bottom: -80rpx;
text-align: center;
background-color: rgb(254, 237, 234);
color: #f45c3d;
}
.data-container { .data-container {
background: #ffffff59; background: #ffffff59;
border-radius: 48rpx; border-radius: 48rpx;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-08 11:28:48 * @Date: 2024-04-08 11:28:48
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-10-18 16:33:57 * @LastEditTime: 2024-10-18 16:49:15
* @FilePath: \gl_tape\mixin\click.js * @FilePath: \gl_tape\mixin\click.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
...mapState('audio', ['receptionStatus', 'booksList', 'audioInfo']), ...mapState('audio', ['receptionStatus', 'booksList', 'audioInfo']),
...mapState(['user.customerInfo']), ...mapState(['user.customerInfo']),
changeData() { changeData() {
const customerInfo = this.$store.state.user?.customerInfo || {} const customerInfo = this.$store?.state?.user?.customerInfo || {}
const booksList = this.booksList || [] const booksList = this.booksList || []
const receptionStatus = this.receptionStatus const receptionStatus = this.receptionStatus
return { customerInfo, booksList, receptionStatus } return { customerInfo, booksList, receptionStatus }
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
if (this.audioInfo.audioStatus == 'start') return if (this.audioInfo.audioStatus == 'start') return
this.setBooks([]) this.setBooks([])
this.$store.dispatch('clearCustomerInfo') this.$store.dispatch('clearCustomerInfo')
this.setReceptionStatus(1) this.setReceptionStatus('')
this.initTime() this.initTime()
this.setAudioInfo({ audioList: [], audioStatus: 'start' }) this.setAudioInfo({ audioList: [], audioStatus: 'start' })
recorderManager.onStart(() => { recorderManager.onStart(() => {
......
...@@ -16,7 +16,7 @@ export default { ...@@ -16,7 +16,7 @@ export default {
return { return {
booksList: [], booksList: [],
audioList: [], audioList: [],
receptionStatus: 1, receptionStatus: '',
endReasonType: 0, endReasonType: 0,
perRecordNumber: 0, perRecordNumber: 0,
audioInfo: { audioInfo: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!