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) {
}
// 获取预约健康信息数据
export function getQuestionnaires(appointmentBizId) {
export function getQuestionnaires(id) {
return request({
url: `/question/api/questionnaires/detail?questionnaireBizId=questionnaires_1001&objectBizId=${appointmentBizId}`,
url: `/question/api/questionnaires/detail?questionnaireBizId=questionnaires_1001&objectBizId=${id}`,
method: 'get'
})
}
......
......@@ -368,6 +368,11 @@ const fetchDictData = dictType => {
let options = []
try {
dictStore.dictTypeLists.forEach(item => {
if (item.dictType == 'sys_no_yes') {
item.dictItemList.forEach(item2 => {
item2.value = String(item2.itemValue)
})
}
if (item.dictType == dictType) {
options = item.dictItemList
}
......@@ -605,6 +610,7 @@ const setFormValue = (obj, formData, exportValue) => {
if (obj.smokeQuantity && field.key == 'smokeQuantity') {
field.show = true
}
//要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) {
case 'phone':
......@@ -702,6 +708,7 @@ const setFormValue = (obj, formData, exportValue) => {
} else {
form.value.age = null
}
phoneQuickList.value = removeDuplicates(tempPhoneList, 'phoneString')
addressQuickList.value = removeDuplicates(tempAddressList, 'addressString')
......@@ -710,6 +717,12 @@ const setFormValue = (obj, formData, exportValue) => {
oldObjInfo.value = JSON.parse(JSON.stringify(form.value))
}
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) {
......@@ -853,8 +866,6 @@ watch(
() => props.activeName,
newVal => {
if (newVal === 'customer') {
openList.value = false
processFormData()
}
}
......
......@@ -537,6 +537,11 @@ const fetchDictData = dictType => {
let options = []
try {
dictStore.dictTypeLists.forEach(item => {
if (item.dictType == 'sys_no_yes') {
item.dictItemList.forEach(item2 => {
item2.value = String(item2.itemValue)
})
}
if (item.dictType == dictType) {
options = item.dictItemList
}
......
......@@ -213,9 +213,12 @@ const props = defineProps({
fearthStatus: { type: String, default: '' }, //父组件状态,新增、修改
formStatus: { type: String, default: '' }, //父组件状态,新增、修改
idsObj: { type: Object, default: () => ({}) }, //父组件传递过来的id对象
apiSecondHolderInfoDto: { type: Object, default: () => ({}) }, //父组件传递过来的预约信息的详情
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 { proxy } = getCurrentInstance()
......@@ -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 {
questionnaireBizId: 'questionnaires_1001',
objectBizId: props.idsObj.appointmentBizId,
objectBizId: objectBizId,
answerSessionsDtoList
}
}
......@@ -390,16 +402,24 @@ const submitForm = () => {
proxy.$refs['heathFormRef'].validate((valid, fields) => {
if (valid) {
let submitObj = handleFormValues()
if (props.idsObj.appointmentBizId) {
saveQuestionnaires(submitObj).then(res => {
if (res.code == 200) {
handleEditStatus(true)
proxy.$message.success('健康信息修改成功')
emit('handleSuccessEdit')
// emit('handleSuccessEdit')
getQuestionnairesInfo()
}
})
}
// 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 = [] // 清空错误信息
} else {
......@@ -429,7 +449,16 @@ const resetForm = () => {
}
const getQuestionnairesInfo = () => {
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) {
let result = res.data.firstAndSecondCategoryDtoList
let first_category = fetchDictData('wj_question_first_category')
......@@ -526,7 +555,12 @@ watch(
tempSecondHolderForm.value = { ...form.value }
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
}
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