Commit 782e2fcb0174350cd8599e2497cb8935b12ad54d

Authored by
1 parent 13928607

fix: 修复了客户公司table首次编辑不更新问题,新增公司名称;注释全局无用打印,优化资源

src/components/FieldUpload/src/FieldUpload.vue
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 reader.readAsDataURL(img); 44 reader.readAsDataURL(img);
45 } 45 }
46 const handleData = (data) => { 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 return { name: data.name }; 48 return { name: data.name };
49 }; 49 };
50 50
src/components/Table/src/hooks/useDataSource.ts
@@ -307,7 +307,6 @@ export function useDataSource( @@ -307,7 +307,6 @@ export function useDataSource(
307 const isArrayResult = Array.isArray(res); 307 const isArrayResult = Array.isArray(res);
308 308
309 let resultItems: Recordable[] = isArrayResult ? res : get(res, listField); 309 let resultItems: Recordable[] = isArrayResult ? res : get(res, listField);
310 - console.log('%c [ res ]-311', 'font-size:13px; background:pink; color:#bf2c9f;', res);  
311 const resultTotal: number = isArrayResult ? res.length : get(res, totalField); 310 const resultTotal: number = isArrayResult ? res.length : get(res, totalField);
312 311
313 // 假如数据变少,导致总页数变少并小于当前选中页码,通过getPaginationRef获取到的页码是不正确的,需获取正确的页码再次执行 312 // 假如数据变少,导致总页数变少并小于当前选中页码,通过getPaginationRef获取到的页码是不正确的,需获取正确的页码再次执行
src/utils/http/axios/Axios.ts
@@ -253,7 +253,7 @@ export class VAxios { @@ -253,7 +253,7 @@ export class VAxios {
253 resolve(res as unknown as Promise<T>); 253 resolve(res as unknown as Promise<T>);
254 }) 254 })
255 .catch((e: Error | AxiosError) => { 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 if (requestCatchHook && isFunction(requestCatchHook)) { 257 if (requestCatchHook && isFunction(requestCatchHook)) {
258 reject(requestCatchHook(e, opt)); 258 reject(requestCatchHook(e, opt));
259 return; 259 return;
src/views/dashboard/analysis/components/GrowCard.vue
@@ -63,8 +63,8 @@ @@ -63,8 +63,8 @@
63 watch( 63 watch(
64 [dateTime, period], 64 [dateTime, period],
65 async ([newDateTime, newPeriod], [oldBusinessPersonIn, oldCustomerCodeIn]) => { 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 data1.value = await getApiData({ 70 data1.value = await getApiData({
@@ -138,8 +138,8 @@ @@ -138,8 +138,8 @@
138 watch( 138 watch(
139 [businessPersonIn, customerCodeIn], 139 [businessPersonIn, customerCodeIn],
140 async ([newDateTime, newPeriod], [oldBusinessPersonIn, oldCustomerCodeIn]) => { 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 const customerCodeParams = newPeriod 145 const customerCodeParams = newPeriod
src/views/dashboard/analysis/components/VisitAnalysis.vue
@@ -330,7 +330,6 @@ @@ -330,7 +330,6 @@
330 330
331 // 遍历 res,提取 date 和 totalPrice 331 // 遍历 res,提取 date 和 totalPrice
332 for (const item of res) { 332 for (const item of res) {
333 - console.log(item, 'Processing item');  
334 x.push(item.date); // 提取日期 333 x.push(item.date); // 提取日期
335 y.push(item.totalPrice); // 提取总价 334 y.push(item.totalPrice); // 提取总价
336 } 335 }
src/views/demo/form/index.vue
@@ -503,7 +503,6 @@ @@ -503,7 +503,6 @@
503 valueField: 'id', 503 valueField: 'id',
504 isBtn: true, 504 isBtn: true,
505 onChange: (e, v) => { 505 onChange: (e, v) => {
506 - console.log('ApiRadioGroup====>:', e, v);  
507 }, 506 },
508 }, 507 },
509 colProps: { 508 colProps: {
src/views/project/config/CreateModal.vue
@@ -108,6 +108,15 @@ @@ -108,6 +108,15 @@
108 span: 24, 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 showActionButtonGroup: false, 121 showActionButtonGroup: false,
113 actionColOptions: { 122 actionColOptions: {
@@ -152,7 +161,7 @@ @@ -152,7 +161,7 @@
152 : props.column === 10 161 : props.column === 10
153 ? 'companyConfiguration' 162 ? 'companyConfiguration'
154 : 'produHodTime', 163 : 'produHodTime',
155 - relationName: '包装费用', 164 + relationName: values.relationName,
156 relationValue: values.relationValue, 165 relationValue: values.relationValue,
157 }; 166 };
158 await addConfig(params); 167 await addConfig(params);
src/views/project/config/TablePanel.vue
@@ -53,6 +53,7 @@ @@ -53,6 +53,7 @@
53 import ProduCostEdit from './ProduCostEdit.vue'; 53 import ProduCostEdit from './ProduCostEdit.vue';
54 import CostCreate from './costCreate.vue'; 54 import CostCreate from './costCreate.vue';
55 import ProduCostCreate from './ProduCostCreate.vue'; 55 import ProduCostCreate from './ProduCostCreate.vue';
  56 + import { nextTick } from 'vue';
56 57
57 const props = defineProps({ 58 const props = defineProps({
58 searchInfo: { 59 searchInfo: {
@@ -68,9 +69,9 @@ @@ -68,9 +69,9 @@
68 const [registerProduEdit, { openDrawer: openDrawerProduEdit }] = useDrawer(); 69 const [registerProduEdit, { openDrawer: openDrawerProduEdit }] = useDrawer();
69 const [registerProduCostCreate, { openModal: openProduCreateModal }] = useModal(); 70 const [registerProduCostCreate, { openModal: openProduCreateModal }] = useModal();
70 71
71 - const [registerTable, { reload }] = useTable({ 72 + const [registerTable, { reload, getDataSource, setTableData }] = useTable({
72 api: getList, 73 api: getList,
73 - searchInfo: { ...props.searchInfo, pageSize: 1000 }, 74 + searchInfo: { ...props.searchInfo, pageSize: 1000, _t: Date.now() },
74 pagination: false, 75 pagination: false,
75 columns: COLUMNS[props.column!], 76 columns: COLUMNS[props.column!],
76 rowKey: 'id', 77 rowKey: 'id',
@@ -148,13 +149,24 @@ @@ -148,13 +149,24 @@
148 } 149 }
149 150
150 async function handleSave(record) { 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 function handleCostEdit(record: any) { 171 function handleCostEdit(record: any) {
160 openDrawerEdit(true, { 172 openDrawerEdit(true, {
src/views/project/config/data.tsx
@@ -173,6 +173,13 @@ export const COLUMNS = { @@ -173,6 +173,13 @@ export const COLUMNS = {
173 width: 150, 173 width: 150,
174 }, 174 },
175 { 175 {
  176 + title: '客户名称',
  177 + dataIndex: 'relationName',
  178 + width: 150,
  179 + editComponent: 'Input',
  180 + editRow: true,
  181 + },
  182 + {
176 title: '公司名称', 183 title: '公司名称',
177 dataIndex: 'relationValue', 184 dataIndex: 'relationValue',
178 width: 150, 185 width: 150,
src/views/project/finance/financeProfit/ProductProfit/InnerData/HistoryDetail.vue
@@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
132 const activeKey = ref(1); 132 const activeKey = ref(1);
133 133
134 const getOrderOptLogFunc = async (data, index, page) => { 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 if (index === 1) { 136 if (index === 1) {
137 const res = await getOrderCostDetailedOptLog({ 137 const res = await getOrderCostDetailedOptLog({
138 orderId: data, 138 orderId: data,
src/views/project/finance/financeProfit/ProductProfit/InnerProduce/HistoryDetail.vue
@@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
132 const activeKey = ref(1); 132 const activeKey = ref(1);
133 133
134 const getOrderOptLogFunc = async (data, index, page) => { 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 if (index === 1) { 136 if (index === 1) {
137 const res = await getProjectOptLog({ 137 const res = await getProjectOptLog({
138 projectNoPrefix: data, 138 projectNoPrefix: data,
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/HistoryDetail.vue
@@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
132 const activeKey = ref(1); 132 const activeKey = ref(1);
133 133
134 const getOrderOptLogFunc = async (data, index, page) => { 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 if (index === 1) { 136 if (index === 1) {
137 const res = await getOrderCostDetailedOptLog({ 137 const res = await getOrderCostDetailedOptLog({
138 orderId: data, 138 orderId: data,
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/HistoryDetail.vue
@@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
132 const activeKey = ref(1); 132 const activeKey = ref(1);
133 133
134 const getOrderOptLogFunc = async (data, index, page) => { 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 if (index === 1) { 136 if (index === 1) {
137 const res = await getProjectOptLog({ 137 const res = await getProjectOptLog({
138 projectNoPrefix: data, 138 projectNoPrefix: data,
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/index.vue
@@ -99,14 +99,11 @@ @@ -99,14 +99,11 @@
99 }, 99 },
100 }, 100 },
101 handleSearchInfoFn: (searchInfo) => { 101 handleSearchInfoFn: (searchInfo) => {
102 - console.log('=== handleSearchInfoFn 开始 ===');  
103 - console.log('原始 searchInfo:', searchInfo);  
104 102
105 // 获取表单实例 103 // 获取表单实例
106 const formInstance = getForm(); 104 const formInstance = getForm();
107 if (formInstance) { 105 if (formInstance) {
108 const formValues = formInstance.getFieldsValue(); 106 const formValues = formInstance.getFieldsValue();
109 - console.log('表单值:', formValues);  
110 107
111 // 强制覆盖searchInfo,确保使用表单中的值 108 // 强制覆盖searchInfo,确保使用表单中的值
112 if (formValues.projectNo && formValues.projectNo.length > 0) { 109 if (formValues.projectNo && formValues.projectNo.length > 0) {
@@ -117,19 +114,15 @@ @@ -117,19 +114,15 @@
117 ...searchInfo, 114 ...searchInfo,
118 projectNo: projectNoArray 115 projectNo: projectNoArray
119 }; 116 };
120 - console.log('强制使用表单中的项目号:', projectNoArray);  
121 } else { 117 } else {
122 // 如果表单中没有项目号,清空查询条件 118 // 如果表单中没有项目号,清空查询条件
123 searchInfo = { 119 searchInfo = {
124 ...searchInfo, 120 ...searchInfo,
125 projectNo: [] 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 return searchInfo; 127 return searchInfo;
135 }, 128 },
src/views/project/order/HistoryDetail.vue
@@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
132 const activeKey = ref(1); 132 const activeKey = ref(1);
133 133
134 const getOrderOptLogFunc = async (data, index, page) => { 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 if (index === 1) { 136 if (index === 1) {
137 const res = await getOrderOptLog({ orderId: data, page: page, pageSize: 20 }); 137 const res = await getOrderOptLog({ orderId: data, page: page, pageSize: 20 });
138 list1.value = res.records; 138 list1.value = res.records;
src/views/project/order/TrackHistory.vue
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 } 60 }
61 61
62 const getOrderOptLogFunc = async (data, page) => { 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 const res = await trackHistory({ orderId: data, page: page, pageSize: 20 }); 64 const res = await trackHistory({ orderId: data, page: page, pageSize: 20 });
65 list1.value = res; 65 list1.value = res;
66 for (const item of list1.value) { 66 for (const item of list1.value) {