Commit 5d49eaf0 by yuzhenWang

Merge branch 'feature-20250827wyz-写业务' into 'test'

修改新单跟进的健康信息传递的ID

See merge request !19
parents 4fa23a05 fdc91283
...@@ -63,9 +63,9 @@ export function getItineraryDetail(appointmentBizId) { ...@@ -63,9 +63,9 @@ export function getItineraryDetail(appointmentBizId) {
} }
// 获取预约健康信息数据 // 获取预约健康信息数据
export function getQuestionnaires(appointmentBizId) { export function getQuestionnaires(id) {
return request({ return request({
url: `/question/api/questionnaires/detail?questionnaireBizId=questionnaires_1001&objectBizId=${appointmentBizId}`, url: `/question/api/questionnaires/detail?questionnaireBizId=questionnaires_1001&objectBizId=${id}`,
method: 'get' method: 'get'
}) })
} }
......
...@@ -368,6 +368,11 @@ const fetchDictData = dictType => { ...@@ -368,6 +368,11 @@ const fetchDictData = dictType => {
let options = [] let options = []
try { try {
dictStore.dictTypeLists.forEach(item => { dictStore.dictTypeLists.forEach(item => {
if (item.dictType == 'sys_no_yes') {
item.dictItemList.forEach(item2 => {
item2.value = String(item2.itemValue)
})
}
if (item.dictType == dictType) { if (item.dictType == dictType) {
options = item.dictItemList options = item.dictItemList
} }
...@@ -605,6 +610,7 @@ const setFormValue = (obj, formData, exportValue) => { ...@@ -605,6 +610,7 @@ const setFormValue = (obj, formData, exportValue) => {
if (obj.smokeQuantity && field.key == 'smokeQuantity') { if (obj.smokeQuantity && field.key == 'smokeQuantity') {
field.show = true field.show = true
} }
//要判断drawerType,因为抽屉要回显数据 //要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) { switch (field.drawerType) {
case 'phone': case 'phone':
...@@ -702,6 +708,7 @@ const setFormValue = (obj, formData, exportValue) => { ...@@ -702,6 +708,7 @@ const setFormValue = (obj, formData, exportValue) => {
} else { } else {
form.value.age = null form.value.age = null
} }
phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString') phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString')
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString') addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
...@@ -710,6 +717,12 @@ const setFormValue = (obj, formData, exportValue) => { ...@@ -710,6 +717,12 @@ const setFormValue = (obj, formData, exportValue) => {
oldObjInfo.value = JSON.parse(JSON.stringify(form.value)) oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
} }
processedCustomerData.value = oldCustomerData.value = processedData processedCustomerData.value = oldCustomerData.value = processedData
console.log('====================================')
console.log('processedCustomerData.value', processedCustomerData.value)
console.log('====================================')
console.log('====================================')
console.log('form', form.value)
console.log('====================================')
} }
// 数组去重 // 数组去重
function removeDuplicates(arr, key) { function removeDuplicates(arr, key) {
...@@ -853,8 +866,6 @@ watch( ...@@ -853,8 +866,6 @@ watch(
() => props.activeName, () => props.activeName,
newVal => { newVal => {
if (newVal === 'customer') { if (newVal === 'customer') {
openList.value = false
processFormData() processFormData()
} }
} }
......
...@@ -537,6 +537,11 @@ const fetchDictData = dictType => { ...@@ -537,6 +537,11 @@ const fetchDictData = dictType => {
let options = [] let options = []
try { try {
dictStore.dictTypeLists.forEach(item => { dictStore.dictTypeLists.forEach(item => {
if (item.dictType == 'sys_no_yes') {
item.dictItemList.forEach(item2 => {
item2.value = String(item2.itemValue)
})
}
if (item.dictType == dictType) { if (item.dictType == dictType) {
options = item.dictItemList options = item.dictItemList
} }
......
...@@ -213,9 +213,12 @@ const props = defineProps({ ...@@ -213,9 +213,12 @@ const props = defineProps({
fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改 fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改
formStatus: { type: String, default: '' }, //父组件状态,新增、修改 formStatus: { type: String, default: '' }, //父组件状态,新增、修改
idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象 idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象
apiSecondHolderInfoDto: { type: Object, default: () => ({}) }, //父组件传递过来的预约信息的详情
appointmentStatus: { type: Number }, //父组件传递过来的预约的状态 appointmentStatus: { type: Number }, //父组件传递过来的预约的状态
customerInfo: { type: Object, default: () => ({}) } //客户详情回显表单用 customerInfo: { type: Object, default: () => ({}) },
//客户详情回显表单用
showSubmitBtn: { type: Boolean, default: false }, //父组件状态,新增、修改
pageSource: { type: String, default: '' } //页面来源
}) })
const emit = defineEmits(['handleSuccessEdit']) const emit = defineEmits(['handleSuccessEdit'])
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
...@@ -378,10 +381,19 @@ const handleFormValues = () => { ...@@ -378,10 +381,19 @@ const handleFormValues = () => {
} }
}) })
}) })
let objectBizId = ''
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
objectBizId = props.idsObj.appointmentBizId
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
objectBizId = props.idsObj.policyBizId
}
return { return {
questionnaireBizId: 'questionnaires_1001', questionnaireBizId: 'questionnaires_1001',
objectBizId: props.idsObj.appointmentBizId, objectBizId: objectBizId,
answerSessionsDtoList answerSessionsDtoList
} }
} }
...@@ -390,16 +402,24 @@ const submitForm = () => { ...@@ -390,16 +402,24 @@ const submitForm = () => {
proxy.$refs['heathFormRef'].validate((valid, fields) => { proxy.$refs['heathFormRef'].validate((valid, fields) => {
if (valid) { if (valid) {
let submitObj = handleFormValues() let submitObj = handleFormValues()
saveQuestionnaires(submitObj).then(res => {
if (props.idsObj.appointmentBizId) { if (res.code == 200) {
saveQuestionnaires(submitObj).then(res => { handleEditStatus(true)
if (res.code == 200) { proxy.$message.success('健康信息修改成功')
handleEditStatus(true) // emit('handleSuccessEdit')
proxy.$message.success('健康信息修改成功') getQuestionnairesInfo()
emit('handleSuccessEdit') }
} })
}) // if (props.idsObj.appointmentBizId || props.idsObj.policyBizId) {
} // saveQuestionnaires(submitObj).then(res => {
// if (res.code == 200) {
// handleEditStatus(true)
// proxy.$message.success('健康信息修改成功')
// emit('handleSuccessEdit')
// getQuestionnairesInfo()
// }
// })
// }
errorFields.value = [] // 清空错误信息 errorFields.value = [] // 清空错误信息
} else { } else {
...@@ -429,7 +449,16 @@ const resetForm = () => { ...@@ -429,7 +449,16 @@ const resetForm = () => {
} }
const getQuestionnairesInfo = () => { const getQuestionnairesInfo = () => {
loading.value = true loading.value = true
getQuestionnaires(props.idsObj.appointmentBizId).then(res => { let id = ''
if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
id = props.idsObj.appointmentBizId
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
id = props.idsObj.policyBizId
}
getQuestionnaires(id).then(res => {
if (res.code == 200) { if (res.code == 200) {
let result = res.data.firstAndSecondCategoryDtoList let result = res.data.firstAndSecondCategoryDtoList
let first_category = fetchDictData('wj_question_first_category') let first_category = fetchDictData('wj_question_first_category')
...@@ -526,7 +555,12 @@ watch( ...@@ -526,7 +555,12 @@ watch(
tempSecondHolderForm.value = { ...form.value } tempSecondHolderForm.value = { ...form.value }
if (newVal === 'questionnaires') { if (newVal === 'questionnaires') {
if (props.idsObj.appointmentBizId) { if (
props.idsObj.appointmentBizId &&
(props.pageSource == 'fnaList' || props.pageSource == 'appointmentList')
) {
editStatus.value = true
} else if (props.idsObj.policyBizId && props.pageSource == 'policyList') {
editStatus.value = true editStatus.value = true
} }
getQuestionnairesInfo() getQuestionnairesInfo()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment