Commit de16072c by Sweet Zhang

问题修改

parent 902799a5
...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
<el-button type="primary" size="default" style="margin: 12px 0" @click="addRow" :disabled="disabled"> <el-button type="primary" size="default" style="margin: 12px 0" @click="addRow" :disabled="disabled">
添加一行 添加一行
</el-button> </el-button>
<el-table :data="internalData" border style="width: 100%" :row-style="{ height: '48px' }" <el-table :data="internalData" border style="width: 100%" :row-style="{ height: '48px' }"
:cell-style="{ padding: '6px 0' }"> :cell-style="{ padding: '6px 0' }">
<el-table-column v-for="field in rowConfig" :key="field.prop" :label="field.label" :width="field.width" <el-table-column v-for="field in rowConfig" :key="field.prop" :label="field.label" :width="field.width"
:min-width="field.minWidth"> :min-width="field.minWidth">
<template #default="{ row }"> <template #default="{ row }">
<component :is="getFieldComponent(field.type)" v-bind="getFieldProps(field, row.data)" <component :is="getFieldComponent(field.type)"
v-bind="getFieldProps(field, row.data)"
@update:model-value="val => handleFieldChange(val, field, row)" @update:model-value="val => handleFieldChange(val, field, row)"
@option-change="option => handleOptionChange(option, field, row)" @option-change="option => handleOptionChange(option, field, row)"
@focus="() => loadRemoteOptions(field)" @focus="() => loadRemoteOptions(field)"
...@@ -19,8 +21,8 @@ ...@@ -19,8 +21,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="100" fixed="right"> <el-table-column label="操作" width="100" fixed="right">
<template #default="{ $index }"> <template #default="{ row }">
<el-button type="danger" size="small" link @click="removeRow($index)" :disabled="disabled"> <el-button type="danger" size="small" link @click="removeRow(row)" :disabled="disabled">
删除 删除
</el-button> </el-button>
</template> </template>
...@@ -72,27 +74,22 @@ const internalData = ref([]) ...@@ -72,27 +74,22 @@ const internalData = ref([])
const remoteLoading = ref({}) const remoteLoading = ref({})
const optionsCache = ref(new Map()) // prop -> options const optionsCache = ref(new Map()) // prop -> options
// 初始化 internalData // 初始化 internalData
watch( watch(
() => props.modelValue, () => props.modelValue,
(newVal) => { async (newVal) => {
if (!Array.isArray(newVal)) { if (!Array.isArray(newVal)) {
console.warn('[EditableTable] modelValue is not an array, reset to empty array')
internalData.value = [] internalData.value = []
return return
} }
const currentPlain = internalData.value.map(row => { // 构建 internalData
const { id, ...rest } = row.data internalData.value = newVal.map((item, index) => ({
return { ...rest, id: row.id } id: item.id || Symbol(`row- $ {index}`),
}) data: { ...item, edit: false },
}))
if (!deepEqual(newVal, currentPlain)) {
internalData.value = newVal.map((item, index) => ({
id: item.id || Symbol(`row-${index}`),
data: { ...(item || {}) }
}))
}
}, },
{ immediate: true } { immediate: true }
) )
...@@ -237,8 +234,11 @@ function addRow() { ...@@ -237,8 +234,11 @@ function addRow() {
}) })
} }
function removeRow(index) { function removeRow(row) {
internalData.value.splice(index, 1) const index = internalData.value.indexOf(row)
if (index !== -1) {
internalData.value.splice(index, 1)
}
} }
function batchSave() { function batchSave() {
......
...@@ -54,7 +54,7 @@ const productPlan = [ ...@@ -54,7 +54,7 @@ const productPlan = [
{ {
label: '供款期数', label: '供款期数',
key: 'issueNumber', key: 'issueNumber',
domType: 'Select', domType: 'Input',
required: true, required: true,
placeholder: '请选择', placeholder: '请选择',
dictType: 'issueNumber', dictType: 'issueNumber',
......
...@@ -68,6 +68,7 @@ export function addDateRange(params, dateRange, propName) { ...@@ -68,6 +68,7 @@ export function addDateRange(params, dateRange, propName) {
// 回显数据字典 // 回显数据字典
export function selectDictLabel(datas, value) { export function selectDictLabel(datas, value) {
console.log(datas,value)
if (value === undefined) { if (value === undefined) {
return "" return ""
} }
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
</div> </div>
<el-table :data="receivableReportTableData" border style="width: 100%;margin-bottom: 10px;min-height: 300px;"> <el-table :data="receivableReportTableData" border style="width: 100%;margin-bottom: 10px;min-height: 300px;">
<el-table-column v-for="item in receivableReportItemTableColumns" :key="item.property" :prop="item.prop" <el-table-column v-for="item in receivableReportItemTableColumns" :key="item.property" :prop="item.prop"
:label="item.label" :width="item.width" /> :label="item.label" :width="item.width" :formatter="item.formatter" />
<el-table-column fixed="right" label="操作" min-width="120"> <el-table-column fixed="right" label="操作" min-width="120">
<template #default="{ row }"> <template #default="{ row }">
<el-popover placement="right" :width="200" trigger="click"> <el-popover placement="right" :width="200" trigger="click">
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
:showAction="false" :showClose="true" @close="entryRecordDialogTableVisible = false"> :showAction="false" :showClose="true" @close="entryRecordDialogTableVisible = false">
<el-table :data="entryRecordDialogTableData" border style="width: 100%"> <el-table :data="entryRecordDialogTableData" border style="width: 100%">
<el-table-column v-for="item in entryRecordDialogTableColumns" :key="item.property" <el-table-column v-for="item in entryRecordDialogTableColumns" :key="item.property"
:prop="item.property" :label="item.label" :width="item.width" /> :prop="item.property" :label="item.label" :width="item.width" :formatter="item.formatter" />
<el-table-column fixed="right" label="操作" min-width="120"> <el-table-column fixed="right" label="操作" min-width="120">
<template #default> <template #default>
<el-button link type="primary" size="small" @click="handleClick"> <el-button link type="primary" size="small" @click="handleClick">
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
:showClose="true" @close="actionRecordsDialogVisible = false"> :showClose="true" @close="actionRecordsDialogVisible = false">
<el-table :data="actionRecordsDialogTableData" border style="width: 100%"> <el-table :data="actionRecordsDialogTableData" border style="width: 100%">
<el-table-column v-for="item in actionRecordsDialogTableColumns" :key="item.property" <el-table-column v-for="item in actionRecordsDialogTableColumns" :key="item.property"
:prop="item.property" :label="item.label" :width="item.width" /> :prop="item.property" :label="item.label" :width="item.width" :formatter="item.formatter" />
</el-table> </el-table>
</CommonDialog> </CommonDialog>
...@@ -180,6 +180,7 @@ import { ...@@ -180,6 +180,7 @@ import {
import { numberWithCommas } from '@/utils/index' import { numberWithCommas } from '@/utils/index'
import SearchForm from '@/components/SearchForm/SearchForm.vue' import SearchForm from '@/components/SearchForm/SearchForm.vue'
import { loadDicts, getDictLabel } from '@/utils/useDict' import { loadDicts, getDictLabel } from '@/utils/useDict'
import {selectDictLabel,selectDictLabels} from '@/utils/ruoyi'
import { safeDownload } from '@/utils/safeDownload' import { safeDownload } from '@/utils/safeDownload'
import useUserStore from '@/store/modules/user' import useUserStore from '@/store/modules/user'
import { formatCurrency } from '@/utils/number' import { formatCurrency } from '@/utils/number'
...@@ -645,7 +646,7 @@ const handleSelect = async (e, row) => { ...@@ -645,7 +646,7 @@ const handleSelect = async (e, row) => {
{ property: 'amount', label: '入账金额', width: '150' }, { property: 'amount', label: '入账金额', width: '150' },
{ property: 'currentCommissionRatio', label: '入账比例', width: '150' }, { property: 'currentCommissionRatio', label: '入账比例', width: '150' },
{ property: 'commissionDate', label: '入账日', width: '150' }, { property: 'commissionDate', label: '入账日', width: '150' },
{ property: 'commissionStatus', label: '入账状态', width: '150' } { property: 'commissionStatus', label: '入账状态', width: '150' ,formatter: (row) => selectDictLabel('csf_expected_commission_status', row.commissionStatus)}
] ]
// 加载真实数据 // 加载真实数据
const records = await loadEntryRecordData(row.commissionExpectedBizId) const records = await loadEntryRecordData(row.commissionExpectedBizId)
...@@ -772,7 +773,7 @@ const receivableReportItemTableColumns = ref([ ...@@ -772,7 +773,7 @@ const receivableReportItemTableColumns = ref([
{ prop: 'receivableNo', label: '应收款编号', sortable: true, width: '150', formatter: (row) => row.receivableNo || '-' }, { prop: 'receivableNo', label: '应收款编号', sortable: true, width: '150', formatter: (row) => row.receivableNo || '-' },
{ prop: 'policyNo', label: '保单号', sortable: true, width: '150', formatter: (row) => row.policyNo || '-' }, { prop: 'policyNo', label: '保单号', sortable: true, width: '150', formatter: (row) => row.policyNo || '-' },
{ prop: 'reconciliationCompany', label: '对账公司', sortable: true, width: '150', formatter: (row) => row.reconciliationCompany || '-' }, { prop: 'reconciliationCompany', label: '对账公司', sortable: true, width: '150', formatter: (row) => row.reconciliationCompany || '-' },
{ prop: 'status', label: '入账状态', sortable: true, width: '120', formatter: (row) => formatStatus(row.status) || '-' }, { prop: 'status', label: '入账状态', sortable: true, width: '120', formatter: (row) => getDictLabel('csf_expected_commission_status', row.status) || '-' },
{ prop: 'commissionPeriod', label: '入账期数', sortable: true, width: '120', formatter: (row) => row.commissionPeriod || '-' }, { prop: 'commissionPeriod', label: '入账期数', sortable: true, width: '120', formatter: (row) => row.commissionPeriod || '-' },
{ prop: 'totalPeriod', label: '入账总期数', sortable: true, width: '120', formatter: (row) => row.totalPeriod || '-' }, { prop: 'totalPeriod', label: '入账总期数', sortable: true, width: '120', formatter: (row) => row.totalPeriod || '-' },
{ prop: 'commissionName', label: '入账项目', sortable: true, width: '130', formatter: (row) => row.commissionName || '-' }, { prop: 'commissionName', label: '入账项目', sortable: true, width: '130', formatter: (row) => row.commissionName || '-' },
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</div> </div>
<div class="tabsBox"> <div class="tabsBox">
<el-tabs v-model="activeName" class="demo-tabs" :before-leave="beforeTabLeave" ref="tabPaneRef"> <el-tabs v-model="activeName" class="demo-tabs" :before-leave="beforeTabLeave" ref="tabPaneRef">
<el-tab-pane v-for="(tab, tIndex) in tabsList" :key="tab.name" :label="tab.label" :name="tab.name"> <el-tab-pane v-for="(tab) in tabsList" :key="tab.name" :label="tab.label" :name="tab.name">
<!-- 注意tabPaneBox这个类名与子组件的锚点定位相关,不能轻易改动 --> <!-- 注意tabPaneBox这个类名与子组件的锚点定位相关,不能轻易改动 -->
<div :class="{ tabPaneBox: activeName !== 'appointment' }"> <div :class="{ tabPaneBox: activeName !== 'appointment' }">
<div v-if="tab.name === 'overview'" class="overviewBox"> <div v-if="tab.name === 'overview'" class="overviewBox">
...@@ -106,6 +106,7 @@ import { ref } from 'vue' ...@@ -106,6 +106,7 @@ import { ref } from 'vue'
const userStore = useUserStore() const userStore = useUserStore()
const dictStore = useDictStore() const dictStore = useDictStore()
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
proxy.useDictLists(['csf_fna_status','csf_expected_commission_status'])
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const activeName = ref('overview') const activeName = ref('overview')
......
...@@ -433,7 +433,9 @@ const handleSelect = async (e, row) => { ...@@ -433,7 +433,9 @@ const handleSelect = async (e, row) => {
} }
editStatusDialogFlag.value = true editStatusDialogFlag.value = true
editStatusFormData.value = { editStatusFormData.value = {
status: row.status status: selectedRow.value.status,
underwritingDate: selectedRow.value.underwritingDate,
effectiveDate: selectedRow.value.effectiveDate
} }
break break
case 'viewRelated': case 'viewRelated':
......
...@@ -207,18 +207,18 @@ const introducerConfig = [ ...@@ -207,18 +207,18 @@ const introducerConfig = [
type: 'select', type: 'select',
prop: 'brokerBizId', prop: 'brokerBizId',
label: '转介人', label: '转介人',
api: '/insurance/base/api/userSaleExpand/page',
keywordField: 'realName',
requestParams: { pageNo: 1, pageSize: 20 },
placeholder: '输入转介人名称搜索',
debounceWait: 500, // 自定义防抖时间
onChangeExtraFields: { onChangeExtraFields: {
broker: 'realName',// 选中后自动填 broker = raw.realName
brokerName: 'realName', brokerName: 'realName',
internalCode: 'code', internalCode: 'code',
team: 'teamName', team: 'teamName',
phone: 'phone', phone: 'phone',
}, },
displayProp: 'brokerName',
api: '/insurance/base/api/userSaleExpand/page',
keywordField: 'realName',
requestParams: { pageNo: 1, pageSize: 20 },
placeholder: '输入转介人名称搜索',
debounceWait: 500, // 自定义防抖时间
transform: (res) => { transform: (res) => {
return (res?.data.records || []).map(item => ({ return (res?.data.records || []).map(item => ({
value: item.clientUserBizId, value: item.clientUserBizId,
...@@ -545,7 +545,7 @@ const basicPlanFormConfig = ref([ ...@@ -545,7 +545,7 @@ const basicPlanFormConfig = ref([
prop: 'sumInsured', prop: 'sumInsured',
label: '保额(重疾险)', label: '保额(重疾险)',
}, { }, {
type: 'select', type: 'input',
prop: 'issueNumber', prop: 'issueNumber',
label: '供款期数', label: '供款期数',
}, { }, {
...@@ -870,16 +870,22 @@ const handleSubmit = () => { ...@@ -870,16 +870,22 @@ const handleSubmit = () => {
console.log('提交数据', introducerTableData.value) console.log('提交数据', introducerTableData.value)
if (activeTab.value === 'postal') { if (activeTab.value === 'postal') {
emit('submit', { ...postalFormData.value, activeTab: activeTab.value }) emit('submit', { ...postalFormData.value, activeTab: activeTab.value })
tabDirty.value.postal = false
} else if (activeTab.value === 'firstPayment') { } else if (activeTab.value === 'firstPayment') {
emit('submit', { ...firstPremiumFormData.value, activeTab: activeTab.value }) emit('submit', { ...firstPremiumFormData.value, activeTab: activeTab.value })
tabDirty.value.firstPayment = false
} else if (activeTab.value === 'attachment') { } else if (activeTab.value === 'attachment') {
emit('submit', { activeTab: activeTab.value }) emit('submit', { activeTab: activeTab.value })
tabDirty.value.attachment = false
} else if (activeTab.value === 'introducer') { } else if (activeTab.value === 'introducer') {
emit('submit', { ...introducerTableData.value, activeTab: activeTab.value }) emit('submit', { ...introducerTableData.value, activeTab: activeTab.value })
tabDirty.value.introducer = false
} else if (activeTab.value === 'basic') { } else if (activeTab.value === 'basic') {
emit('submit', { ...basicInfoFormData.value, activeTab: activeTab.value, ...policyInfoFormData.value }) emit('submit', { ...basicInfoFormData.value, activeTab: activeTab.value, ...policyInfoFormData.value })
tabDirty.value.basic = false
} else if (activeTab.value === 'productPlan') { } else if (activeTab.value === 'productPlan') {
emit('submit', { ...basicPlanFormData.value, activeTab: activeTab.value, ...localData.additionalPlans }) emit('submit', { ...basicPlanFormData.value, activeTab: activeTab.value, ...localData.additionalPlans })
tabDirty.value.productPlan = false
} }
} }
...@@ -919,7 +925,7 @@ const getPolicyfollowDetail = () => { ...@@ -919,7 +925,7 @@ const getPolicyfollowDetail = () => {
basicInfoFormData.value = { ...transformToFormData(res.data, basicInfoFormConfig.value) }; basicInfoFormData.value = { ...transformToFormData(res.data, basicInfoFormConfig.value) };
firstPremiumFormData.value = { ...transformToFormData(res.data, firstPremiumFormConfig.value) }; firstPremiumFormData.value = { ...transformToFormData(res.data, firstPremiumFormConfig.value) };
introducerTableData.value = res.data.brokerList || [] introducerTableData.value = res.data.brokerList || []
console.log('====父组件在赋值basicPlanFormData后', basicPlanFormData.value) // console.log('====父组件在赋值introducerTableData后=====', introducerTableData.value)
} }
}) })
......
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