|
@@ -20,7 +20,7 @@ import {
|
|
|
getSalesOrdersCounts,
|
|
|
saveDesignerFamilyInfo,
|
|
|
getUserInfoById,
|
|
|
- getEditRecords,
|
|
|
+ getEditRecords, updateDesignerFamilyInfo,
|
|
|
} from '../../../../core/libs/agent-requests'
|
|
|
import { messages } from '../../../../core/libs/messages'
|
|
|
import { omit } from 'radash'
|
|
@@ -66,7 +66,7 @@ const formDataFoucs = ref<{
|
|
|
}>({
|
|
|
focus: '',
|
|
|
})
|
|
|
-const submitType = ref<'family' | 'award'>()
|
|
|
+const submitType = ref<'family' | 'award' | 'updateFamily'>()
|
|
|
const familyPageRef = ref<ComponentExposed<typeof PageHelperEvo>>()
|
|
|
const awardsListRef = ref<ComponentExposed<typeof ListHelperEvo>>()
|
|
|
const saleListRef = ref<ComponentExposed<typeof ListHelperEvo>>()
|
|
@@ -76,7 +76,7 @@ const getFormDataFoucs = computed(() => familyData.value?.focus)
|
|
|
const handleEditBasicInfo = async () => {
|
|
|
await uni.navigateTo({ url: `/pages/agent/designer/archives/basic-info/index?id=${id.value}` })
|
|
|
}
|
|
|
-const handleAddFamilyInfo = async () => {
|
|
|
+const handleAddFamilyInfo = async (item:DesignerFamilyInfo) => {
|
|
|
submitType.value = 'family'
|
|
|
const familySchema: DataFormSchema<Omit<DesignerFamilyInfo, 'userId' | 'createTime' | 'id'>> = {
|
|
|
familyRelation: {
|
|
@@ -128,9 +128,7 @@ const handleAddFamilyInfo = async () => {
|
|
|
},
|
|
|
},
|
|
|
}
|
|
|
- formData.value = {
|
|
|
- familyBirthday: '',
|
|
|
- }
|
|
|
+
|
|
|
schema.value = familySchema
|
|
|
actionSheetStatus.value = true
|
|
|
}
|
|
@@ -183,6 +181,20 @@ const handleSubmit = async () => {
|
|
|
}
|
|
|
break
|
|
|
}
|
|
|
+ case 'updateFamily': {
|
|
|
+ const { code } = await requestToast(
|
|
|
+ () => updateDesignerFamilyInfo({ ...formData.value, userId: id.value }),
|
|
|
+ {
|
|
|
+ success: true,
|
|
|
+ successTitle: '修改成功',
|
|
|
+ },
|
|
|
+ )
|
|
|
+ if (code === 0) {
|
|
|
+ actionSheetStatus.value = false
|
|
|
+ familyPageRef.value?.reload()
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
case 'award':
|
|
|
{
|
|
|
const { code } = await requestToast(
|
|
@@ -217,6 +229,63 @@ const handleDeleteFamilyInfo = async (item: DesignerFamilyInfo) => {
|
|
|
})
|
|
|
familyPageRef.value?.reload()
|
|
|
}
|
|
|
+const handleUpdateFamily = (item) =>{
|
|
|
+ submitType.value = 'updateFamily'
|
|
|
+ const familySchema: DataFormSchema<Omit<DesignerFamilyInfo, 'userId' | 'createTime' | 'id'>> = {
|
|
|
+ familyRelation: {
|
|
|
+ type: 'TextField',
|
|
|
+ label: messages.objects.designerFamilyInfo.familyRelation,
|
|
|
+ props: {
|
|
|
+ placeholder: `请输入${messages.objects.designerFamilyInfo.familyRelation}`,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ familyName: {
|
|
|
+ type: 'TextField',
|
|
|
+ label: messages.objects.designerFamilyInfo.familyName,
|
|
|
+ props: {
|
|
|
+ placeholder: `请输入${messages.objects.designerFamilyInfo.familyName}`,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ familySex: {
|
|
|
+ type: 'Radio',
|
|
|
+ label: messages.objects.designerFamilyInfo.familySex,
|
|
|
+ props: {
|
|
|
+ columns: [
|
|
|
+ { label: '男', value: '1' },
|
|
|
+ { label: '女', value: '2' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ familyBirthday: {
|
|
|
+ type: 'TimePick',
|
|
|
+ label: messages.objects.designerFamilyInfo.familyBirthday,
|
|
|
+ props: {
|
|
|
+ type: 'date',
|
|
|
+ placeholder: `请选择${messages.objects.designerFamilyInfo.familyBirthday}`,
|
|
|
+ minDate: new Date('1925-01-01').getTime(),
|
|
|
+ // defaultVale: new Date('1990-01-01').getTime(),
|
|
|
+ },
|
|
|
+ },
|
|
|
+ familyInterset: {
|
|
|
+ type: 'TextField',
|
|
|
+ label: messages.objects.designerFamilyInfo.familyInterset,
|
|
|
+ props: {
|
|
|
+ placeholder: `请输入${messages.objects.designerFamilyInfo.familyInterset}`,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ familyOccupation: {
|
|
|
+ type: 'TextField',
|
|
|
+ label: messages.objects.designerFamilyInfo.familyOccupation,
|
|
|
+ props: {
|
|
|
+ placeholder: `请输入${messages.objects.designerFamilyInfo.familyOccupation}`,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+ formData.value = item
|
|
|
+ schema.value = familySchema
|
|
|
+ actionSheetStatus.value = true
|
|
|
+
|
|
|
+}
|
|
|
const handleSubmitFocus = async () => {
|
|
|
await requestToast(() => createFocus({ ...formDataFoucs.value, userId: id.value }), {
|
|
|
success: true,
|
|
@@ -354,6 +423,7 @@ onShow(async () => {
|
|
|
</template>
|
|
|
<template v-else-if="key === 'imageUrl'">
|
|
|
<SectionHeading
|
|
|
+ :end-text="`${basicData.imageNumber}张`"
|
|
|
end-arrow
|
|
|
:path="`/pages/agent/designer/archives/award/imgs?urls=${basicData['imageUrl'] ?? ''}`"
|
|
|
></SectionHeading>
|
|
@@ -418,7 +488,10 @@ onShow(async () => {
|
|
|
size="base"
|
|
|
:end-text="item.familyOccupation"
|
|
|
></SectionHeading>
|
|
|
- <wd-button type="text" @click="handleDeleteFamilyInfo(item)">删除</wd-button>
|
|
|
+ <div style="display: flex;">
|
|
|
+ <wd-button type="text" @click="handleUpdateFamily(item)">编辑</wd-button>
|
|
|
+ <wd-button type="text" @click="handleDeleteFamilyInfo(item)">删除</wd-button>
|
|
|
+ </div>
|
|
|
<div v-if="!(index === list.length - 1)" class="w-full h-1 bg-[#dadada]"></div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -511,7 +584,7 @@ onShow(async () => {
|
|
|
end-arrow
|
|
|
:path="
|
|
|
!(index === list.length - 1)
|
|
|
- ? `/pages/agent/designer/archives/sale-info/index?id=${id}`
|
|
|
+ ? `/pages/agent/designer/archives/sale-info/index?id=${id}&type=${item.type}`
|
|
|
: `/pages/agent/designer/archives/sale-info/others/index?id=${id}`
|
|
|
"
|
|
|
></SectionHeading>
|
|
@@ -583,7 +656,7 @@ onShow(async () => {
|
|
|
<div class="record">
|
|
|
<div class="record-time">
|
|
|
<div class="time">{{dayjs(it.createTime).format('YYYY-MM-DD')}}</div>
|
|
|
- <div class="createBy">经纪人:杨温</div>
|
|
|
+ <div class="createBy">经纪人:{{it.createName}}</div>
|
|
|
</div>
|
|
|
<div class="record-title">修改信息:</div>
|
|
|
<div class="record-content">{{it.content}}</div>
|