Commit 922cec12 by yuzhenWang

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

修改预约流程5

See merge request !11
parents d0525a88 c763f338
......@@ -361,11 +361,12 @@ const appointmentInfo = [
{
label: '开户行名称',
key: 'bankName',
domType: 'Input',
inputType: 'text',
domType: 'SearchSelect',
required: false,
maxLength: 300,
allowCreate: true, //搜索下拉框是否允许创建自己的选项
maxLength: 50,
disabled: false,
dictType: 'md_bank',
placeholder: '请输入',
show: true,
labelPosition: 'top', //标签的位置
......@@ -378,7 +379,7 @@ const appointmentInfo = [
key: 'bankBranchName',
domType: 'Input',
inputType: 'text',
maxLength: 300,
maxLength: 50,
required: false,
disabled: false,
placeholder: '请输入',
......@@ -393,6 +394,7 @@ const appointmentInfo = [
label: '开户时间段(开始)',
key: 'openAccountStartTime',
domType: 'datetimePicker',
timeType:'date',
required: false,
disabled: true,
placeholder: '请选择',
......
......@@ -12,6 +12,7 @@
type="primary"
icon="EditPen"
@click="handleEditStatus"
style="margin-left: 10px"
>编辑</el-button
>
</div>
......@@ -835,7 +836,7 @@ watch(
.topBtn {
width: 100%;
display: flex;
justify-content: space-between;
justify-content: flex-start;
margin-bottom: 10px;
}
.formBox {
......
<template>
<div class="app-container">
<div>
<!-- <div>
<el-button type="primary" icon="Back" @click="handleBack" style="margin-bottom: 10px"
>返回</el-button
>
</div>
</div> -->
<el-card shadow="never">
<div class="cardHeader">
......@@ -268,7 +268,8 @@ const getDictsData = async () => {
'csf_ap_game',
'wj_question_first_category',
'wj_question_second_category',
'csf_ap_policy_transfer'
'csf_ap_policy_transfer',
'md_bank'
])
}
......@@ -525,7 +526,8 @@ getDictsData()
}
}
.tabPaneBox {
height: calc(100vh - 317px);
/* height: calc(100vh - 317px); */
height: calc(100vh - 275px);
overflow-y: auto;
padding-right: 10px;
}
......
......@@ -6,11 +6,11 @@
'embed-container': embed
}"
>
<div v-if="!embed">
<!-- <div v-if="!embed">
<el-button type="primary" icon="Back" @click="handleBack" style="margin-bottom: 10px"
>返回</el-button
>
</div>
</div> -->
<el-card shadow="never">
<div class="cardHeader" v-if="!embed">
......@@ -564,7 +564,8 @@ const getDictsData = async () => {
'csf_ap_policy_transfer',
'wj_question_first_category',
'wj_question_second_category',
'csf_ap_status'
'csf_ap_status',
'md_bank'
])
}
// Tab切换前的验证
......@@ -1004,10 +1005,10 @@ onUnmounted(() => {
}
}
.noEmbedTabPaneBox {
height: calc(100vh - 317px);
height: calc(100vh - 276px);
}
.yesEmbedTabPaneBox {
height: calc(100vh - 439px);
height: calc(100vh - 407px);
}
.appointmentTabPaneBox {
overflow-y: auto;
......
......@@ -60,7 +60,7 @@
v-model="form[child.key]"
style="width: 100%"
v-if="child.domType === 'datetimePicker'"
type="datetime"
:type="child.timeType || 'datetime'"
:placeholder="child.placeholder"
:disabled="child.disabled"
@change="handleDateChange(child)"
......@@ -85,6 +85,25 @@
@click="handleButtonClick(child)"
>{{ child.buttonTxt }}</el-button
>
<!-- 搜索下拉框 :remote-method="query => searchSelectList(query, child)" remote-->
<el-select
v-model="form[child.key]"
v-if="child.domType === 'SearchSelect'"
filterable
:allow-create="child.allowCreate"
:reserve-keyword="false"
placeholder="请输入关键词搜索"
:loading="searchLoadingStates[child.key]"
:disabled="child.disabled"
>
<el-option
v-for="item in searchOptions[child.key] || []"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<div v-if="child.domType === 'Div'" class="divClass">
<div v-if="child.key == 'information'" class="desBox">
......@@ -246,6 +265,8 @@ const deleteKeyList = ref([
'residenceAddress',
'companyAddress'
]) // 存储需要删除的key
const searchOptions = ref({}) // 存储不同key对应的选项
const searchLoadingStates = ref({}) // 存储不同key对应的加载状态
const data = reactive({
form: {},
processedAppointmentData: [], // 处理后的表单数据
......@@ -258,6 +279,23 @@ const data = reactive({
}
})
const { form, rules, processedAppointmentData, queryParams, oldAppointmentData } = toRefs(data)
// 搜索方法
const searchSelectList = async (query, field) => {
// 设置该字段的加载状态
searchLoadingStates.value[field.key] = true
try {
// 根据不同的字段key调用不同的API
if (field.key === 'bankName') {
console.log('searchOptions.value[field.key]', searchOptions.value[field.key])
}
} catch (error) {
console.error(`${field.label} 搜索失败`, error)
searchOptions.value[field.key] = []
} finally {
searchLoadingStates.value[field.key] = false
}
}
const disabledDate = (time, child) => {
// 获取“今天”的日期,并将其时间部分设置为 00:00:00
const today = dayjs().startOf('day') // :cite[7]
......@@ -265,16 +303,24 @@ const disabledDate = (time, child) => {
// 将传入的 timestamp 转换为 dayjs 对象
const inputDate = dayjs(time)
// 可以根据参数调整逻辑
if (child.key == 'intentionAppointmentTime') {
// 默认禁用今天及今天之前 (使用 isBefore 或 isSame)
return inputDate.isBefore(today, 'day') || inputDate.isSame(today, 'day') // :cite[3]
// 如果允许选择今天,只禁用今天之前的日期 (使用 isBefore)
// return inputDate.isBefore(today, 'day') // :cite[3]
} else {
// 如果允许选择今天,只禁用今天之前的日期 (使用 isBefore)
return inputDate.isBefore(today, 'day') // :cite[3]
// return time.getTime() > Date.now()
switch (child.key) {
case 'intentionAppointmentTime':
// 默认禁用今天及今天之前
return inputDate.isBefore(today, 'day') || inputDate.isSame(today, 'day')
break
case 'arrivalTime':
// 如果允许选择今天,只禁用今天之前的日期
return inputDate.isBefore(today, 'day')
break
case 'departureTime':
return inputDate.isBefore(today, 'day')
break
case 'confirmAppointmentTime':
return inputDate.isBefore(today, 'day')
break
default:
// return time.getTime() > Date.now()
break
}
}
const handleButtonClick = child => {
......@@ -296,7 +342,22 @@ const handleDateChange = child => {
resetShow({ type: 'child', key: 'newPolicyButton', status: true })
} else if (child.key === 'confirmAppointmentTime' && !form.value[child.key]) {
resetShow({ type: 'child', key: 'newPolicyButton', status: false })
} else if (child.key === 'arrivalTime') {
if (form.value['confirmAppointmentTime']) {
const appointmentTimestamp = dayjs(form.value['confirmAppointmentTime']).valueOf()
const arrivalTimestamp = dayjs(form.value['arrivalTime']).valueOf()
if (appointmentTimestamp < arrivalTimestamp) {
proxy.$modal.msgError('预约时间早于到港时间,请重新选择到港时间')
form.value['arrivalTime'] = ''
} else if (appointmentTimestamp > arrivalTimestamp) {
console.log('预约时间晚于到港时间')
} else {
proxy.$modal.msgError('到港时间应早于预约时间,请重新选择到港时间')
form.value['arrivalTime'] = ''
}
}
}
}
// 获取字典数据
const fetchDictData = dictType => {
......@@ -348,6 +409,9 @@ const processFormData = async () => {
// 获取字典数据
field.options = fetchDictData(field.dictType)
}
if (field.key == 'bankName') {
searchOptions.value[field.key] = fetchDictData(field.dictType)
}
if (field.required) {
if (field.key === 'firstNamePinyin') {
rules.value[field.key] = [
......@@ -559,6 +623,9 @@ const setFormValue = (obj, formData) => {
} else {
field.disabled = false
}
if (field.key == 'bankName') {
searchOptions.value[field.key] = fetchDictData(field.dictType)
}
//要判断drawerType,因为抽屉要回显数据
switch (field.drawerType) {
case 'phone':
......@@ -794,7 +861,6 @@ watch(
setTimeout(() => {
processFormData()
}, 500)
// processFormData()
}
}
)
......
......@@ -600,8 +600,6 @@ const processFormData = async obj => {
form.value.smokingAllowed = Number(form.value.smokingAllowed)
}
console.log('修改form', form.value)
editStatus.value = true
} else {
editStatus.value = false
......
......@@ -877,8 +877,6 @@ const setFormValue = (obj, formData) => {
const processedData = JSON.parse(JSON.stringify(formData))
for (const section of processedData) {
for (const key in newForm) {
console.log('key', key)
//回显的数据有的没填写就会是null,收集表单值得时候和dom对应不上,对于null值得项要根据section得keyType给form正确得数据类型
if (!newForm[key]) {
if (section.keyType == 'Array') {
......
......@@ -270,6 +270,11 @@ function getAppointmentInfo(appointmentBizId) {
span: 12 // 占12/24
},
{
label: '预约时间',
value: appointmentSummeryInfo.value.confirmAppointmentTime,
span: 12 // 占12/24
},
{
label: '集合地点',
value: appointmentSummeryInfo.value.meetingPoint,
span: 12 // 占12/24
......
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