Commit 782e2fcb0174350cd8599e2497cb8935b12ad54d
1 parent
13928607
fix: 修复了客户公司table首次编辑不更新问题,新增公司名称;注释全局无用打印,优化资源
Showing
16 changed files
with
49 additions
and
31 deletions
src/components/FieldUpload/src/FieldUpload.vue
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 | reader.readAsDataURL(img); |
45 | 45 | } |
46 | 46 | const handleData = (data) => { |
47 | - console.log('%c [ data ]-32', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
47 | + // console.log('%c [ data ]-32', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
48 | 48 | return { name: data.name }; |
49 | 49 | }; |
50 | 50 | ... | ... |
src/components/Table/src/hooks/useDataSource.ts
... | ... | @@ -307,7 +307,6 @@ export function useDataSource( |
307 | 307 | const isArrayResult = Array.isArray(res); |
308 | 308 | |
309 | 309 | let resultItems: Recordable[] = isArrayResult ? res : get(res, listField); |
310 | - console.log('%c [ res ]-311', 'font-size:13px; background:pink; color:#bf2c9f;', res); | |
311 | 310 | const resultTotal: number = isArrayResult ? res.length : get(res, totalField); |
312 | 311 | |
313 | 312 | // 假如数据变少,导致总页数变少并小于当前选中页码,通过getPaginationRef获取到的页码是不正确的,需获取正确的页码再次执行 | ... | ... |
src/utils/http/axios/Axios.ts
... | ... | @@ -253,7 +253,7 @@ export class VAxios { |
253 | 253 | resolve(res as unknown as Promise<T>); |
254 | 254 | }) |
255 | 255 | .catch((e: Error | AxiosError) => { |
256 | - console.log('%c [ e ]-257', 'font-size:13px; background:pink; color:#bf2c9f;', e); | |
256 | + // console.log('%c [ e ]-257', 'font-size:13px; background:pink; color:#bf2c9f;', e); | |
257 | 257 | if (requestCatchHook && isFunction(requestCatchHook)) { |
258 | 258 | reject(requestCatchHook(e, opt)); |
259 | 259 | return; | ... | ... |
src/views/dashboard/analysis/components/GrowCard.vue
... | ... | @@ -63,8 +63,8 @@ |
63 | 63 | watch( |
64 | 64 | [dateTime, period], |
65 | 65 | async ([newDateTime, newPeriod], [oldBusinessPersonIn, oldCustomerCodeIn]) => { |
66 | - console.log('businessPersonIn changed from', oldBusinessPersonIn, 'to', newDateTime); | |
67 | - console.log('customerCodeIn changed from', oldCustomerCodeIn, 'to', newPeriod); | |
66 | + // console.log('businessPersonIn changed from', oldBusinessPersonIn, 'to', newDateTime); | |
67 | + // console.log('customerCodeIn changed from', oldCustomerCodeIn, 'to', newPeriod); | |
68 | 68 | |
69 | 69 | // 在这里添加你希望在这两个值改变时执行的逻辑 |
70 | 70 | data1.value = await getApiData({ |
... | ... | @@ -138,8 +138,8 @@ |
138 | 138 | watch( |
139 | 139 | [businessPersonIn, customerCodeIn], |
140 | 140 | async ([newDateTime, newPeriod], [oldBusinessPersonIn, oldCustomerCodeIn]) => { |
141 | - console.log('businessPersonIn changed from', oldBusinessPersonIn, 'to', newDateTime); | |
142 | - console.log('customerCodeIn changed from', oldCustomerCodeIn, 'to', newPeriod); | |
141 | + // console.log('businessPersonIn changed from', oldBusinessPersonIn, 'to', newDateTime); | |
142 | + // console.log('customerCodeIn changed from', oldCustomerCodeIn, 'to', newPeriod); | |
143 | 143 | |
144 | 144 | // 在这里添加你希望在这两个值改变时执行的逻辑 |
145 | 145 | const customerCodeParams = newPeriod | ... | ... |
src/views/dashboard/analysis/components/VisitAnalysis.vue
src/views/demo/form/index.vue
src/views/project/config/CreateModal.vue
... | ... | @@ -108,6 +108,15 @@ |
108 | 108 | span: 24, |
109 | 109 | }, |
110 | 110 | }, |
111 | + { | |
112 | + field: 'relationName', | |
113 | + component: 'Input', | |
114 | + label: '客户名称', | |
115 | + rules: [{ required: true }], | |
116 | + colProps: { | |
117 | + span: 24, | |
118 | + }, | |
119 | + }, | |
111 | 120 | ], |
112 | 121 | showActionButtonGroup: false, |
113 | 122 | actionColOptions: { |
... | ... | @@ -152,7 +161,7 @@ |
152 | 161 | : props.column === 10 |
153 | 162 | ? 'companyConfiguration' |
154 | 163 | : 'produHodTime', |
155 | - relationName: '包装费用', | |
164 | + relationName: values.relationName, | |
156 | 165 | relationValue: values.relationValue, |
157 | 166 | }; |
158 | 167 | await addConfig(params); | ... | ... |
src/views/project/config/TablePanel.vue
... | ... | @@ -53,6 +53,7 @@ |
53 | 53 | import ProduCostEdit from './ProduCostEdit.vue'; |
54 | 54 | import CostCreate from './costCreate.vue'; |
55 | 55 | import ProduCostCreate from './ProduCostCreate.vue'; |
56 | + import { nextTick } from 'vue'; | |
56 | 57 | |
57 | 58 | const props = defineProps({ |
58 | 59 | searchInfo: { |
... | ... | @@ -68,9 +69,9 @@ |
68 | 69 | const [registerProduEdit, { openDrawer: openDrawerProduEdit }] = useDrawer(); |
69 | 70 | const [registerProduCostCreate, { openModal: openProduCreateModal }] = useModal(); |
70 | 71 | |
71 | - const [registerTable, { reload }] = useTable({ | |
72 | + const [registerTable, { reload, getDataSource, setTableData }] = useTable({ | |
72 | 73 | api: getList, |
73 | - searchInfo: { ...props.searchInfo, pageSize: 1000 }, | |
74 | + searchInfo: { ...props.searchInfo, pageSize: 1000, _t: Date.now() }, | |
74 | 75 | pagination: false, |
75 | 76 | columns: COLUMNS[props.column!], |
76 | 77 | rowKey: 'id', |
... | ... | @@ -148,13 +149,24 @@ |
148 | 149 | } |
149 | 150 | |
150 | 151 | async function handleSave(record) { |
151 | - if (props.column === 3) { | |
152 | - await saveConfig({ id: record.id, settingValue: record.settingValue }); | |
153 | - } else { | |
154 | - await saveConfig({ id: record.id, relationValue: record.relationValue }); | |
152 | + try { | |
153 | + if (props.column === 3) { | |
154 | + await saveConfig({ id: record.id, settingValue: record.settingValue }); | |
155 | + } else { | |
156 | + await saveConfig({ id: record.id, relationValue: record.relationValue, relationName: record.relationName }); | |
157 | + } | |
158 | + handleCancel(record); | |
159 | + | |
160 | + // 强制刷新数据,解决首次编辑不更新的问题 | |
161 | + const currentData = getDataSource(); | |
162 | + setTableData([]); | |
163 | + await nextTick(); | |
164 | + setTableData(currentData); | |
165 | + await nextTick(); | |
166 | + reload(); | |
167 | + } catch (error) { | |
168 | + console.error('保存失败:', error); | |
155 | 169 | } |
156 | - handleCancel(record); | |
157 | - reload(); | |
158 | 170 | } |
159 | 171 | function handleCostEdit(record: any) { |
160 | 172 | openDrawerEdit(true, { | ... | ... |
src/views/project/config/data.tsx
... | ... | @@ -173,6 +173,13 @@ export const COLUMNS = { |
173 | 173 | width: 150, |
174 | 174 | }, |
175 | 175 | { |
176 | + title: '客户名称', | |
177 | + dataIndex: 'relationName', | |
178 | + width: 150, | |
179 | + editComponent: 'Input', | |
180 | + editRow: true, | |
181 | + }, | |
182 | + { | |
176 | 183 | title: '公司名称', |
177 | 184 | dataIndex: 'relationValue', |
178 | 185 | width: 150, | ... | ... |
src/views/project/finance/financeProfit/ProductProfit/InnerData/HistoryDetail.vue
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | const activeKey = ref(1); |
133 | 133 | |
134 | 134 | const getOrderOptLogFunc = async (data, index, page) => { |
135 | - console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
135 | + // console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
136 | 136 | if (index === 1) { |
137 | 137 | const res = await getOrderCostDetailedOptLog({ |
138 | 138 | orderId: data, | ... | ... |
src/views/project/finance/financeProfit/ProductProfit/InnerProduce/HistoryDetail.vue
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | const activeKey = ref(1); |
133 | 133 | |
134 | 134 | const getOrderOptLogFunc = async (data, index, page) => { |
135 | - console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
135 | + // console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
136 | 136 | if (index === 1) { |
137 | 137 | const res = await getProjectOptLog({ |
138 | 138 | projectNoPrefix: data, | ... | ... |
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/HistoryDetail.vue
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | const activeKey = ref(1); |
133 | 133 | |
134 | 134 | const getOrderOptLogFunc = async (data, index, page) => { |
135 | - console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
135 | + // console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
136 | 136 | if (index === 1) { |
137 | 137 | const res = await getOrderCostDetailedOptLog({ |
138 | 138 | orderId: data, | ... | ... |
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/HistoryDetail.vue
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | const activeKey = ref(1); |
133 | 133 | |
134 | 134 | const getOrderOptLogFunc = async (data, index, page) => { |
135 | - console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
135 | + // console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
136 | 136 | if (index === 1) { |
137 | 137 | const res = await getProjectOptLog({ |
138 | 138 | projectNoPrefix: data, | ... | ... |
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/index.vue
... | ... | @@ -99,14 +99,11 @@ |
99 | 99 | }, |
100 | 100 | }, |
101 | 101 | handleSearchInfoFn: (searchInfo) => { |
102 | - console.log('=== handleSearchInfoFn 开始 ==='); | |
103 | - console.log('原始 searchInfo:', searchInfo); | |
104 | 102 | |
105 | 103 | // 获取表单实例 |
106 | 104 | const formInstance = getForm(); |
107 | 105 | if (formInstance) { |
108 | 106 | const formValues = formInstance.getFieldsValue(); |
109 | - console.log('表单值:', formValues); | |
110 | 107 | |
111 | 108 | // 强制覆盖searchInfo,确保使用表单中的值 |
112 | 109 | if (formValues.projectNo && formValues.projectNo.length > 0) { |
... | ... | @@ -117,19 +114,15 @@ |
117 | 114 | ...searchInfo, |
118 | 115 | projectNo: projectNoArray |
119 | 116 | }; |
120 | - console.log('强制使用表单中的项目号:', projectNoArray); | |
121 | 117 | } else { |
122 | 118 | // 如果表单中没有项目号,清空查询条件 |
123 | 119 | searchInfo = { |
124 | 120 | ...searchInfo, |
125 | 121 | projectNo: [] |
126 | 122 | }; |
127 | - console.log('清空项目号查询条件'); | |
128 | 123 | } |
129 | 124 | } |
130 | 125 | |
131 | - console.log('处理后的 searchInfo:', searchInfo); | |
132 | - console.log('=== handleSearchInfoFn 结束 ==='); | |
133 | 126 | |
134 | 127 | return searchInfo; |
135 | 128 | }, | ... | ... |
src/views/project/order/HistoryDetail.vue
... | ... | @@ -132,7 +132,7 @@ |
132 | 132 | const activeKey = ref(1); |
133 | 133 | |
134 | 134 | const getOrderOptLogFunc = async (data, index, page) => { |
135 | - console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
135 | + // console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
136 | 136 | if (index === 1) { |
137 | 137 | const res = await getOrderOptLog({ orderId: data, page: page, pageSize: 20 }); |
138 | 138 | list1.value = res.records; | ... | ... |
src/views/project/order/TrackHistory.vue
... | ... | @@ -60,7 +60,7 @@ |
60 | 60 | } |
61 | 61 | |
62 | 62 | const getOrderOptLogFunc = async (data, page) => { |
63 | - console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
63 | + // console.log('%c [ data ]-135', 'font-size:13px; background:pink; color:#bf2c9f;', data); | |
64 | 64 | const res = await trackHistory({ orderId: data, page: page, pageSize: 20 }); |
65 | 65 | list1.value = res; |
66 | 66 | for (const item of list1.value) { | ... | ... |