Commit 70753e8d by liimin

Merge branch 'feature/rework' of http://192.168.3.233:8090/monorepo/venus into feature/rework

2 parents 37ee6da3 b3a5c504
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
import { getMerchantCarBrandList,getCarBrandsListApi } from '@/api/common-api.uts' import { getMerchantCarBrandList,getCarBrandsListApi } from '@/api/common-api.uts'
import { state, dispatch } from "@/store/index.uts" import { state, dispatch } from "@/store/index.uts"
import { ComponentPublicInstance } from 'vue' import { ComponentPublicInstance } from 'vue'
import { recordService } from '@/services/recorder/index.uts'
...@@ -166,7 +167,15 @@ ...@@ -166,7 +167,15 @@
stateCustomerInfo.carModel = (item as UTSJSONObject).name stateCustomerInfo.carModel = (item as UTSJSONObject).name
stateCustomerInfo.carModelId = (item as UTSJSONObject).id stateCustomerInfo.carModelId = (item as UTSJSONObject).id
if (props.linkage) { if (props.linkage) {
dispatch('setCustomerInfo', stateCustomerInfo) recordService.updateBusinessData({
carBrand: selectItemVal.carChildsBrandName,
carBrandId: selectItemVal.carChildsBrandId,
oneCarBrand: selectItemVal.carBrand,
oneCarBrandId: selectItemVal.carBrandId,
carModel: (item as UTSJSONObject).name,
carModelId: (item as UTSJSONObject).id
})
// dispatch('setCustomerInfo', stateCustomerInfo)
dispatch('updateViewKey') dispatch('updateViewKey')
dispatch('setCurrentCarInfo', selectItemVal) dispatch('setCurrentCarInfo', selectItemVal)
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
class="input" class="input"
:placeholder="i.placeholder" :placeholder="i.placeholder"
:disabled="customerType == 0" :disabled="customerType == 0"
@input="inputCustomer" @input="inputCustomer(i.key)"
placeholder-style="color:#c9c9c9;" placeholder-style="color:#c9c9c9;"
/> />
</template> </template>
...@@ -116,9 +116,10 @@ ...@@ -116,9 +116,10 @@
import { ref, computed, watch } from 'vue' import { ref, computed, watch } from 'vue'
import Employee from '@/components/Employee.uvue' import Employee from '@/components/Employee.uvue'
import CarBrands from '@/components/CarBrands.uvue' import CarBrands from '@/components/CarBrands.uvue'
import { state, dispatch } from '@/store/index.uts' import { state } from '@/store/index.uts'
import MessageBox from './MessageBox.uvue' import MessageBox from './MessageBox.uvue'
import { ComponentPublicInstance } from 'vue' import { ComponentPublicInstance } from 'vue'
import { recordService } from '@/services/recorder/index.uts'
type FormObjectItem = { type FormObjectItem = {
label: string label: string
...@@ -291,9 +292,6 @@ ...@@ -291,9 +292,6 @@
(formRef.value as ComponentPublicInstance).$callMethod('close') (formRef.value as ComponentPublicInstance).$callMethod('close')
} }
}, { immediate: true }) }, { immediate: true })
watch(errorTip, () => {
console.log('errorTip', errorTip.value)
})
function showError(key: string): boolean { function showError(key: string): boolean {
const value = formData.value const value = formData.value
let flag = (value as UTSJSONObject)[key] == '' let flag = (value as UTSJSONObject)[key] == ''
...@@ -387,17 +385,23 @@ ...@@ -387,17 +385,23 @@
} }
function inputCustomer(): void { function inputCustomer(key: string): void {
dispatch('setCustomerInfo', formData.value as any) const value = (formData.value as UTSJSONObject)[key] as string
recordService.updateBusinessData({
[key]: value
})
} }
function handleSelect(item: IUTSObject, popkey: string): void { function handleSelect(item: IUTSObject, popkey: string): void {
const customerInfo = dispatch('getCustomerInfo') as IUTSObject
const value = formData.value as UTSJSONObject const value = formData.value as UTSJSONObject
if (popkey == "employeeBoxVisible") { if (popkey == "employeeBoxVisible") {
(value as UTSJSONObject).salesUuid = item['uuid'] as string (value as UTSJSONObject).salesUuid = item['uuid'] as string
(value as UTSJSONObject).staffName = item['staffName'] as string (value as UTSJSONObject).staffName = item['staffName'] as string
dispatch("setCustomerInfo", { ...customerInfo, salesUuid: item['uuid'] as string, staffName: item['staffName'] as string }) recordService.updateBusinessData({
salesUuid: item['uuid'] as string,
staffName: item['staffName'] as string
})
} else { } else {
if (carBrandListVisible.value != null) { if (carBrandListVisible.value != null) {
(carBrandListVisible.value as ComponentPublicInstance).$callMethod('close') (carBrandListVisible.value as ComponentPublicInstance).$callMethod('close')
...@@ -410,10 +414,17 @@ ...@@ -410,10 +414,17 @@
} }
function open(): void { function open(): void {
const customerInfo = dispatch('getCustomerInfo') recordService.getBusinessData().then(data =>{
const customerInfo = data as UTSJSONObject
if (customerInfo != null) { if (customerInfo != null) {
formData.value = customerInfo as UTSJSONObject formData.value = {
customerName: customerInfo.customerName != null && customerInfo.customerName != 'null' ? customerInfo.customerName : '',
carModel: customerInfo.carModel != null && customerInfo.carModel != 'null' ? customerInfo.carModel : '',
carModelId: customerInfo.carModelId != null && customerInfo.carModelId != 'null' ? customerInfo.carModelId : '',
phoneNumber: customerInfo.phoneNumber != null && customerInfo.phoneNumber != 'null' ? customerInfo.phoneNumber : '',
staffName: customerInfo.staffName != null && customerInfo.staffName != 'null' ? customerInfo.staffName : '',
salesUuid: customerInfo.salesUuid != null && customerInfo.salesUuid != 'null' ? customerInfo.salesUuid : '',
}
let _sceneType = props.sceneType let _sceneType = props.sceneType
let _customerType = props.customerType let _customerType = props.customerType
let stepValue = 1 let stepValue = 1
...@@ -421,7 +432,7 @@ ...@@ -421,7 +432,7 @@
for (let i = 0; i < keys.length; i++) { for (let i = 0; i < keys.length; i++) {
const key = keys[i] const key = keys[i]
const value = customerInfo[key] as string | null const value = formData.value[key] as string | null
if (value == null || value == '') { if (value == null || value == '') {
stepValue = 1 stepValue = 1
break break
...@@ -452,30 +463,12 @@ ...@@ -452,30 +463,12 @@
} }
updateViewKey.value = Date.now() updateViewKey.value = Date.now()
} }
})
} }
function chooseResult(val: string): void { function chooseResult(val: string): void {
receptionStatus.value = val receptionStatus.value = val
dispatch('setReceptionStatus', val) recordService.updateBusinessData({ receptionStatus: val })
}
function updateStep(): void {
const customerInfo = dispatch('getCustomerInfo') as IUTSObject
let stepValue = 1
const keys = ['customerName', 'carModel', 'phoneNumber']
for (let i = 0; i < keys.length; i++) {
const key = keys[i]
const value = customerInfo[key]
if (value == null || value === '') {
stepValue = 1
break
}
stepValue = 2
}
step.value = stepValue
} }
defineExpose({ open, close }) defineExpose({ open, close })
......
...@@ -164,7 +164,8 @@ ...@@ -164,7 +164,8 @@
import { state , dispatch} from "@/store/index.uts" import { state , dispatch} from "@/store/index.uts"
import { getSoureData } from '@/api/system-api.uts' import { getSoureData } from '@/api/system-api.uts'
import { findPayInfo as findPayInfoApi } from '@/api/common-api.uts' import { findPayInfo as findPayInfoApi } from '@/api/common-api.uts'
import { recordService, BusinessDataType } from '@/services/recorder/index.uts' import { recordService } from '@/services/recorder/index.uts'
type BackPressEvent = { type BackPressEvent = {
from: string from: string
} }
...@@ -514,13 +515,6 @@ const currentCarInfo = computed(() => { ...@@ -514,13 +515,6 @@ const currentCarInfo = computed(() => {
(stepRef.value as ComponentPublicInstance).$callMethod('close') (stepRef.value as ComponentPublicInstance).$callMethod('close')
} }
const customerInfo = state.user.customerInfo as UTSJSONObject const customerInfo = state.user.customerInfo as UTSJSONObject
customerInfo.receptionStatus = val
console.log(JSON.stringify(customerInfo))
recordService.updateBusinessData(
'customer',
customerInfo
)
recordService.stopAudio() recordService.stopAudio()
uni.navigateBack() uni.navigateBack()
// receptionTrackLeave() // receptionTrackLeave()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!