Commit a4ffebc44304e4ec587a9e5469e358276d094331
1 parent
97424267
fix: 补充功能
Showing
6 changed files
with
135 additions
and
52 deletions
src/views/project/finance/financeProfit/ProductProfit/InnerData/tableData.tsx
@@ -73,6 +73,7 @@ export const EDIT_INFO = [ | @@ -73,6 +73,7 @@ export const EDIT_INFO = [ | ||
73 | rules: [{ required: true }], | 73 | rules: [{ required: true }], |
74 | }, | 74 | }, |
75 | ]; | 75 | ]; |
76 | +// 以下为明细表字段审核详情中的申请字段,用于回显 | ||
76 | export const APPLY_INFO = [ | 77 | export const APPLY_INFO = [ |
77 | { | 78 | { |
78 | field: 'packetActualRmbTotalPrice', | 79 | field: 'packetActualRmbTotalPrice', |
@@ -89,6 +90,20 @@ export const APPLY_INFO = [ | @@ -89,6 +90,20 @@ export const APPLY_INFO = [ | ||
89 | rules: [{ required: true }], | 90 | rules: [{ required: true }], |
90 | }, | 91 | }, |
91 | { | 92 | { |
93 | + field: 'paidRmbCommission', | ||
94 | + component: 'Select', | ||
95 | + labelWidth: 150, | ||
96 | + label: '中国团队已发提成', | ||
97 | + rules: [{ required: true }], | ||
98 | + }, | ||
99 | + { | ||
100 | + field: 'spainPaidRmbCommission', | ||
101 | + component: 'Select', | ||
102 | + labelWidth: 150, | ||
103 | + label: '西班牙团队已发提成', | ||
104 | + rules: [{ required: true }], | ||
105 | + }, | ||
106 | + { | ||
92 | field: 'issuedCommission', | 107 | field: 'issuedCommission', |
93 | component: 'Select', | 108 | component: 'Select', |
94 | labelWidth: 150, | 109 | labelWidth: 150, |
src/views/project/finance/financeProfit/ProductProfit/InnerProduce/FinanceEdit.vue
@@ -208,7 +208,7 @@ | @@ -208,7 +208,7 @@ | ||
208 | if (loading.value) return; | 208 | if (loading.value) return; |
209 | loading.value = true; | 209 | loading.value = true; |
210 | setDrawerProps({ confirmLoading: true }); | 210 | setDrawerProps({ confirmLoading: true }); |
211 | - if (!input1.value || !input2.value || !input3.value) { | 211 | + if (!input3.value || !input4.value) { |
212 | error('选项不能为空'); | 212 | error('选项不能为空'); |
213 | loading.value = false; | 213 | loading.value = false; |
214 | setDrawerProps({ confirmLoading: false }); | 214 | setDrawerProps({ confirmLoading: false }); |
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/data.tsx
@@ -92,24 +92,11 @@ export const searchFormSchema = [ | @@ -92,24 +92,11 @@ export const searchFormSchema = [ | ||
92 | label: '待审核', | 92 | label: '待审核', |
93 | value: 0, | 93 | value: 0, |
94 | }, { | 94 | }, { |
95 | - label: '已完成', | ||
96 | - value: 1, | ||
97 | - }], | ||
98 | - }, | ||
99 | - }, | ||
100 | - { | ||
101 | - field: 'orderCommissionStatus', | ||
102 | - label: '提成发放状态', | ||
103 | - component: 'Select', | ||
104 | - colProps: { span: 8 }, | ||
105 | - | ||
106 | - componentProps: { | ||
107 | - options: [ { | ||
108 | - label: '未发放', | ||
109 | - value: -1, | ||
110 | - },{ | ||
111 | label: '已发放', | 95 | label: '已发放', |
112 | - value: 0, | 96 | + value: 1, |
97 | + }, { | ||
98 | + label: '应发但不发', | ||
99 | + value: 2, | ||
113 | }], | 100 | }], |
114 | }, | 101 | }, |
115 | }, | 102 | }, |
@@ -252,18 +239,6 @@ export const COLUMNS = [ | @@ -252,18 +239,6 @@ export const COLUMNS = [ | ||
252 | }, | 239 | }, |
253 | }, | 240 | }, |
254 | { | 241 | { |
255 | - title: '提成发放状态', | ||
256 | - dataIndex: 'orderCommissionStatus', | ||
257 | - width: 120, | ||
258 | - customRender: (column) => { | ||
259 | - if (column.record?.orderCommissionStatus === null || column.record?.orderCommissionStatus === -1) { | ||
260 | - return '未发放'; | ||
261 | - } else if (column.record?.orderCommissionStatus === 0) { | ||
262 | - return '已发放'; | ||
263 | - } | ||
264 | - }, | ||
265 | - }, | ||
266 | - { | ||
267 | title: '备注', | 242 | title: '备注', |
268 | dataIndex: 'packNotes', | 243 | dataIndex: 'packNotes', |
269 | width: 200, | 244 | width: 200, |
@@ -278,7 +253,9 @@ export const COLUMNS = [ | @@ -278,7 +253,9 @@ export const COLUMNS = [ | ||
278 | } else if (column.record?.packStatus === 0) { | 253 | } else if (column.record?.packStatus === 0) { |
279 | return '待审核'; | 254 | return '待审核'; |
280 | } else if (column.record?.packStatus === 1) { | 255 | } else if (column.record?.packStatus === 1) { |
281 | - return '已审核'; | 256 | + return '已发放'; |
257 | + } else if (column.record?.packStatus === 2) { | ||
258 | + return '应发但不发'; | ||
282 | } | 259 | } |
283 | }, | 260 | }, |
284 | }, | 261 | }, |
src/views/project/finance/financeProfit/ServiceProfit/PackageProfit/index.vue
@@ -80,7 +80,8 @@ | @@ -80,7 +80,8 @@ | ||
80 | import { searchFormSchema, COLUMNS, allProjectNoOptions } from './data'; | 80 | import { searchFormSchema, COLUMNS, allProjectNoOptions } from './data'; |
81 | import { BasicModal, useModal } from '/@/components/Modal'; | 81 | import { BasicModal, useModal } from '/@/components/Modal'; |
82 | import { useMessage } from '/@/hooks/web/useMessage'; | 82 | import { useMessage } from '/@/hooks/web/useMessage'; |
83 | - import { onMounted, ref, computed } from 'vue'; | 83 | + import { onMounted, ref, computed, h } from 'vue'; |
84 | + import { Modal } from 'ant-design-vue'; | ||
84 | import { useDrawer } from '/@/components/Drawer'; | 85 | import { useDrawer } from '/@/components/Drawer'; |
85 | import FinanceEdit from './FinanceEdit.vue'; | 86 | import FinanceEdit from './FinanceEdit.vue'; |
86 | import CheckDetail from './CheckDetail.vue'; | 87 | import CheckDetail from './CheckDetail.vue'; |
@@ -223,14 +224,15 @@ | @@ -223,14 +224,15 @@ | ||
223 | ...(role.value === ROLE.ADMIN ? [ | 224 | ...(role.value === ROLE.ADMIN ? [ |
224 | { | 225 | { |
225 | label: '审核通过', | 226 | label: '审核通过', |
226 | - popConfirm: { | ||
227 | - title: '确认审核?', | ||
228 | - confirm: () => { | ||
229 | - if (record.packStatus === 0) { | ||
230 | - handleStatus(record, true); | ||
231 | - } | 227 | + onClick: () => { |
228 | + // 如果状态为未完成(-1),则不响应 | ||
229 | + if (record.packStatus === -1) { | ||
230 | + createMessage.warning('请先完成财务编辑'); | ||
232 | return; | 231 | return; |
233 | - }, | 232 | + } |
233 | + else{ | ||
234 | + showAuditOptions(record); | ||
235 | + } | ||
234 | }, | 236 | }, |
235 | }, | 237 | }, |
236 | ] : []), | 238 | ] : []), |
@@ -258,10 +260,6 @@ | @@ -258,10 +260,6 @@ | ||
258 | label: '历史记录', | 260 | label: '历史记录', |
259 | onClick: handleHistoryDetail.bind(null, record), | 261 | onClick: handleHistoryDetail.bind(null, record), |
260 | }, | 262 | }, |
261 | - { | ||
262 | - label: '设置为已发提成', | ||
263 | - onClick: () => handleSetCommissionStatusSingle(record), | ||
264 | - }, | ||
265 | ]; | 263 | ]; |
266 | return actions; | 264 | return actions; |
267 | } | 265 | } |
@@ -312,12 +310,94 @@ | @@ -312,12 +310,94 @@ | ||
312 | 310 | ||
313 | async function handleStatus(record, status) { | 311 | async function handleStatus(record, status) { |
314 | try { | 312 | try { |
315 | - await setPackStatus({ orderId: record.orderId }); | 313 | + // 检查必要参数是否存在 |
314 | + if (!record.orderId) { | ||
315 | + createMessage.error('缺少必要的参数:orderId'); | ||
316 | + return; | ||
317 | + } | ||
318 | + | ||
319 | + // 根据不同的状态调用不同的接口 | ||
320 | + if (status === 'approved') { | ||
321 | + await setPackStatus({ | ||
322 | + orderId: record.orderId, | ||
323 | + packStatus: 1 // 已发放状态 | ||
324 | + }); | ||
325 | + createMessage.success('设置为已发放成功!'); | ||
326 | + } else if (status === 'sentButNotPaid') { | ||
327 | + await setPackStatus({ | ||
328 | + orderId: record.orderId, | ||
329 | + packStatus: 2 // 应发但不发状态 | ||
330 | + }); | ||
331 | + createMessage.success('设置为应发但不发成功!'); | ||
332 | + } else { | ||
333 | + // 默认已发放 | ||
334 | + await setPackStatus({ | ||
335 | + orderId: record.orderId, | ||
336 | + packStatus: 1 // 默认已发放状态 | ||
337 | + }); | ||
338 | + createMessage.success('状态更新成功!'); | ||
339 | + } | ||
340 | + | ||
316 | reload(); | 341 | reload(); |
317 | } catch (error) { | 342 | } catch (error) { |
318 | - console.error(error); | 343 | + console.error('Error updating status:', error); |
344 | + createMessage.error('状态更新失败:' + (error.message || '未知错误')); | ||
319 | } | 345 | } |
320 | } | 346 | } |
347 | + | ||
348 | + // 显示审核选项 | ||
349 | + function showAuditOptions(record) { | ||
350 | + // 检查当前状态 | ||
351 | + const isReviewed = record.packStatus === 1; // 已发放状态 | ||
352 | + const isSentButNotPaid = record.packStatus === 2; // 应发但不发状态 | ||
353 | + const hasCommission = record.copyCommission; // 是否有提成配置 | ||
354 | + | ||
355 | + // 使用 Modal 显示选项 | ||
356 | + Modal.confirm({ | ||
357 | + title: '选择审核结果', | ||
358 | + content: h('div', [ | ||
359 | + h('div', { style: 'margin-top: 16px;' }, [ | ||
360 | + // 已发放按钮 | ||
361 | + h('button', { | ||
362 | + style: isReviewed | ||
363 | + ? 'margin-right: 8px; padding: 4px 8px; color: #666; background-color: #f5f5f5; border-radius: 2px; cursor: not-allowed; border: 1px solid #d9d9d9;' | ||
364 | + : 'margin-right: 8px; padding: 4px 8px; color: white; background-color: #40a9ff; border-radius: 2px; cursor: pointer;', | ||
365 | + disabled: isReviewed, // 如果已发放则禁用 | ||
366 | + onClick: () => { | ||
367 | + if (!isReviewed) { | ||
368 | + if (hasCommission) { | ||
369 | + Modal.destroyAll(); | ||
370 | + handleStatus(record, 'approved'); // 已发放 | ||
371 | + } else { | ||
372 | + createMessage.error('请先在系统中配置包装提成金额'); | ||
373 | + } | ||
374 | + } | ||
375 | + } | ||
376 | + }, isReviewed ? '已发放' : '已发放'), | ||
377 | + // 应发但不发按钮 | ||
378 | + h('button', { | ||
379 | + style: (isReviewed || isSentButNotPaid) | ||
380 | + ? 'margin-right: 8px; padding: 4px 8px; color: #666; background-color: #f5f5f5; border-radius: 2px; cursor: not-allowed; border: 1px solid #d9d9d9;' | ||
381 | + : 'margin-right: 8px; padding: 4px 8px; color: white; background-color: #40a9ff; border-radius: 2px; cursor: pointer;', | ||
382 | + disabled: isReviewed || isSentButNotPaid, // 如果已发放或应发但不发则禁用 | ||
383 | + onClick: () => { | ||
384 | + if (!isReviewed && !isSentButNotPaid) { | ||
385 | + if (hasCommission) { | ||
386 | + Modal.destroyAll(); | ||
387 | + handleStatus(record, 'sentButNotPaid'); // 应发但不发 | ||
388 | + } else { | ||
389 | + createMessage.error('请先在系统中配置包装提成金额'); | ||
390 | + } | ||
391 | + } | ||
392 | + } | ||
393 | + }, (isReviewed || isSentButNotPaid) ? '应发但不发' : '应发但不发'), | ||
394 | + ]) | ||
395 | + ]), | ||
396 | + onCancel: () => { | ||
397 | + Modal.destroyAll(); | ||
398 | + } | ||
399 | + }); | ||
400 | + } | ||
321 | 401 | ||
322 | function handleHistoryDetail(record) { | 402 | function handleHistoryDetail(record) { |
323 | openHistoryDetail(true, { | 403 | openHistoryDetail(true, { |
@@ -574,12 +654,16 @@ | @@ -574,12 +654,16 @@ | ||
574 | } | 654 | } |
575 | 655 | ||
576 | const handleSetCommissionStatusSingle = async (record) => { | 656 | const handleSetCommissionStatusSingle = async (record) => { |
577 | - try { | ||
578 | - await setCommissionStatus({ orderId: record.orderId }); | ||
579 | - createMessage.success('设置成功'); | ||
580 | - reload(); | ||
581 | - } catch (e) { | ||
582 | - createMessage.error('设置失败'); | 657 | + if(record.copyCommission){ |
658 | + try { | ||
659 | + await setCommissionStatus({ orderId: record.orderId }); | ||
660 | + createMessage.success('设置成功'); | ||
661 | + reload(); | ||
662 | + } catch (e) { | ||
663 | + createMessage.error('设置失败'); | ||
664 | + } | ||
665 | + }else{ | ||
666 | + error('请先在系统中配置包装提成金额'); | ||
583 | } | 667 | } |
584 | }; | 668 | }; |
585 | 669 |
src/views/project/finance/financeProfit/ServiceProfit/ServiceProfit/FinanceEdit.vue
@@ -231,7 +231,7 @@ | @@ -231,7 +231,7 @@ | ||
231 | // id: update.value.data.id, | 231 | // id: update.value.data.id, |
232 | // bgUrl: update.value.data.bgUrl, | 232 | // bgUrl: update.value.data.bgUrl, |
233 | // }; | 233 | // }; |
234 | - if (!input1.value || !input2.value || !input3.value || !input4.value) { | 234 | + if (!input1.value || !input2.value || !input3.value || !input4.value || !input5.value) { |
235 | error('选项不能为空'); | 235 | error('选项不能为空'); |
236 | loading.value = false; | 236 | loading.value = false; |
237 | setDrawerProps({ confirmLoading: false }); | 237 | setDrawerProps({ confirmLoading: false }); |
src/views/project/order/InvoiceCreate.vue
@@ -21,6 +21,7 @@ | @@ -21,6 +21,7 @@ | ||
21 | :max-count="1" | 21 | :max-count="1" |
22 | :action="uploadUrl" | 22 | :action="uploadUrl" |
23 | @change="handleChange" | 23 | @change="handleChange" |
24 | + @preview="openPic" | ||
24 | > | 25 | > |
25 | <a-button> 上传报关单 </a-button> | 26 | <a-button> 上传报关单 </a-button> |
26 | </a-upload> | 27 | </a-upload> |
@@ -85,6 +86,7 @@ | @@ -85,6 +86,7 @@ | ||
85 | } | 86 | } |
86 | function handleChange(info) { | 87 | function handleChange(info) { |
87 | if (info.file.status == 'done') { | 88 | if (info.file.status == 'done') { |
89 | + info.file.url = info.file.response.data.fileUrl; // 确保 onPreview 能拿到 url | ||
88 | bgUrl.value = info.file.response.data.fileUrl; | 90 | bgUrl.value = info.file.response.data.fileUrl; |
89 | } | 91 | } |
90 | } | 92 | } |
@@ -97,4 +99,9 @@ | @@ -97,4 +99,9 @@ | ||
97 | fileList.value = []; | 99 | fileList.value = []; |
98 | } | 100 | } |
99 | } | 101 | } |
102 | + function openPic(file) { | ||
103 | + const url = file.url || file.thumbUrl; | ||
104 | + if (!url) return; | ||
105 | + window.open(url, '_blank'); | ||
106 | +} | ||
100 | </script> | 107 | </script> |