新增用户时 缓存数据

main
yanzai 4 months ago
parent c468a1816f
commit 833366ceee

@ -576,6 +576,7 @@ class ReportController extends Controller
foreach ($info['收费项目列表'] as $item) {
$content_list = [];
foreach ($item['基础项目列表'] as $i) {
if(empty($i['结果值'])) continue;
$content_list[] = [
'title' => $i['基础项目名称'],
'content' => $i['结果值'] .' '. $i['结果值单位'],

@ -19,7 +19,7 @@
} from '@/api'
import $api from '@/api/api.js'
import {
onShow
onShow,onLoad
} from '@dcloudio/uni-app'
const $props = defineProps({
@ -33,6 +33,9 @@
UserPersonCount()
UserPersonInfo()
setTitle()
})
onLoad(()=>{
})
//
const SysGreyType = ref(0)
@ -137,8 +140,15 @@
const user_person_info = ref(JSON.parse(JSON.stringify(default_user_person_info)))
const UserPersonInfo = async () => {
if (Number($props.id) === 0) {
let info =uni.getStorageSync('edit_person_info')
if(info){
user_person_info.value=info
}else{
user_person_info.value = JSON.parse(JSON.stringify(default_user_person_info))
}
} else {
uni.removeStorageSync('edit_person_info');
const response = await UserPersonInfoAction({
id: Number($props.id)
})
@ -188,6 +198,16 @@
}
});
watch(
() => user_person_info.value,
(newVal, oldVal) => {
if(user_person_info.value.id===0){
uni.setStorageSync('edit_person_info', user_person_info.value);
}
},
{ deep: true } // 👈 deep: true
);
const birthday_ref = ref(null)
const birthdayRef = (e) => {
birthday_ref.value = e
@ -227,6 +247,7 @@
await UserPersonCreateAction(user_person_info.value) :
await UserPersonUpdateAction(user_person_info.value)
$response(response, () => {
uni.removeStorageSync('edit_person_info');
uni.navigateBack({
delta: 1
})
@ -266,6 +287,8 @@
user_person_info.value.id_number = filteredValue;
})
}
</script>
<template>
<view :class="SysGreyType==1? 'grey' :''">

Loading…
Cancel
Save