Commit e91e3b37eb9f8156765847d41d1d49c1f3b6c339
1 parent
47b3c41c
修改打开图片bug
Showing
16 changed files
with
208 additions
and
31 deletions
src/api/project/invoice.ts
... | ... | @@ -25,6 +25,7 @@ enum Api { |
25 | 25 | CHECK_ANALYSIS = '/order/erp/check_bill/list_analysis_by', //分析列表 |
26 | 26 | EXPORT_CHECK_ANALYSIS = '/order/erp/check_bill/export', //导出分析列表 |
27 | 27 | GETDEDUCTURL_BY_ID = '/order/erp/check_bill/getDeductUrl_by_id', //获取扣款信息 |
28 | + GETINVOICEURL_BY_ID = '/order/erp/check_bill/getInvoiceUrl_by_id', //获取扣款信息 | |
28 | 29 | } |
29 | 30 | |
30 | 31 | export const getRefundDate = async (params: any, data?: any) => { |
... | ... | @@ -177,3 +178,10 @@ export const getDeductUrlById = async (params: any) => { |
177 | 178 | params, |
178 | 179 | }); |
179 | 180 | }; |
181 | + | |
182 | +export const getInvoiceUrlById = async (params: any) => { | |
183 | + return await defHttp.post<any>({ | |
184 | + url: Api.GETDEDUCTURL_BY_ID, | |
185 | + params, | |
186 | + }); | |
187 | +}; | ... | ... |
src/views/project/approve/PayPanel.vue
... | ... | @@ -54,13 +54,20 @@ |
54 | 54 | :data="mockData" |
55 | 55 | :schema="schema" |
56 | 56 | /> |
57 | - <a | |
58 | - v-if="mockData.invoiceName" | |
59 | - :href="mockData.invoiceUrl" | |
60 | - target="_blank" | |
61 | - rel="noopener noreferrer" | |
62 | - >{{ mockData.invoiceName }}</a | |
63 | - > | |
57 | + <a v-if="mockData.invoiceName" @click="openPic(mockData.deductUrl)" rel="noopener noreferrer">{{ | |
58 | + mockData.invoiceName | |
59 | + }}</a> | |
60 | + <!-- <a-list item-layout="horizontal" :data-source="itemArray"> | |
61 | + <template #renderItem="{ item }"> | |
62 | + <a-list-item> | |
63 | + <a-list-item-meta> | |
64 | + <template #title> | |
65 | + <a :href="item.url" target="_blank" rel="noopener noreferrer">{{ item.name }}</a> | |
66 | + </template> | |
67 | + </a-list-item-meta> | |
68 | + </a-list-item> | |
69 | + </template> | |
70 | + </a-list> --> | |
64 | 71 | <template #appendFooter> |
65 | 72 | <a-button v-if="!isApproved && role === ROLE.ADMIN" @click="handleFalse"> 不通过</a-button> |
66 | 73 | </template> |
... | ... | @@ -108,6 +115,11 @@ |
108 | 115 | const showInvoice = ref(false); |
109 | 116 | |
110 | 117 | const mockData = ref(); |
118 | + interface Item { | |
119 | + name: string; | |
120 | + url: string; | |
121 | + } | |
122 | + const itemArray = ref<Item[]>([]); | |
111 | 123 | const actualPayCalculate = ref(0); |
112 | 124 | const schema = [ |
113 | 125 | { |
... | ... | @@ -123,8 +135,8 @@ |
123 | 135 | label: '实际付款日期', |
124 | 136 | }, |
125 | 137 | { |
126 | - field: 'totalProductionAmount', | |
127 | - label: '生产科总金额汇总', | |
138 | + field: 'unPayedAmount', | |
139 | + label: '未付金额', | |
128 | 140 | }, |
129 | 141 | { |
130 | 142 | field: 'totalActualPayedAmount', |
... | ... | @@ -163,7 +175,7 @@ |
163 | 175 | customRender: (column) => { |
164 | 176 | const { record } = column || {}; |
165 | 177 | if (record?.type === 40) { |
166 | - return '应付帐单申请'; | |
178 | + return '应付账单申请'; | |
167 | 179 | } else if (record?.type == 50) { |
168 | 180 | return '生产科发票申请'; |
169 | 181 | } |
... | ... | @@ -247,13 +259,14 @@ |
247 | 259 | showInvoice.value = true; |
248 | 260 | } |
249 | 261 | openModal(true, { data }); |
262 | + itemArray.value = []; | |
250 | 263 | mockData.value = data.fieldInfos.checkBillOrderDO; |
251 | - const match = mockData.value.invoiceUrl.match(/aliyuncs\.com\/(.*?)\?/); | |
264 | + const match = mockData.value.deductUrl.match(/aliyuncs\.com\/(.*?)\?/); | |
252 | 265 | if (match && match[1]) { |
253 | 266 | // 对提取的部分进行解码 |
254 | 267 | mockData.value.invoiceName = decodeURIComponent(match[1]); |
255 | 268 | } else { |
256 | - mockData.value.invoiceName = mockData.value.invoiceUrl; | |
269 | + mockData.value.invoiceName = mockData.value.deductUrl; | |
257 | 270 | } |
258 | 271 | id.value = data.id; |
259 | 272 | } |
... | ... | @@ -290,6 +303,18 @@ |
290 | 303 | return false; |
291 | 304 | }; |
292 | 305 | |
306 | + function openPic(url) { | |
307 | + window.open('', '', '').document.write(`<!DOCTYPE html> | |
308 | + <html> | |
309 | + <body | |
310 | + style="display: flex; | |
311 | + justify-content: center; | |
312 | + align-items: center;"> | |
313 | + <img src='${url}' width="500px" height="500px"/> | |
314 | + </body> | |
315 | + </html>`); | |
316 | + } | |
317 | + | |
293 | 318 | return { |
294 | 319 | handleProfitModal, |
295 | 320 | registerTable, |
... | ... | @@ -312,6 +337,7 @@ |
312 | 337 | mockData, |
313 | 338 | schema, |
314 | 339 | showInvoice, |
340 | + openPic, | |
315 | 341 | }; |
316 | 342 | }, |
317 | 343 | }); | ... | ... |
src/views/project/approve/ReceivePanel.vue
src/views/project/config/CreateModal.vue
... | ... | @@ -39,17 +39,50 @@ |
39 | 39 | info.value = ''; |
40 | 40 | }); |
41 | 41 | |
42 | - const { customerCode: customerCodeOptions } = useOrderInfo(orderStore); | |
42 | + const { customerCode: customerCodeOptions, productionDepartment: productDepartmentOptions } = | |
43 | + useOrderInfo(orderStore); | |
43 | 44 | var [registerForm, { getFieldsValue, validate }] = useForm({ |
44 | 45 | labelWidth: 100, |
46 | + // schemas: [ | |
47 | + // { | |
48 | + // field: 'settingValue', | |
49 | + // component: 'Select', | |
50 | + // label: '客户编码', | |
51 | + // rules: [{ required: true }], | |
52 | + // componentProps: { | |
53 | + // options: customerCodeOptions, | |
54 | + // }, | |
55 | + // colProps: { | |
56 | + // span: 24, | |
57 | + // }, | |
58 | + // }, | |
59 | + // { | |
60 | + // field: 'relationValue', | |
61 | + // component: 'InputNumber', | |
62 | + // label: | |
63 | + // props.column === 1 | |
64 | + // ? '利润率' | |
65 | + // : props.column === 2 | |
66 | + // ? '包装费用' | |
67 | + // : props.column === 5 | |
68 | + // ? '最后回款日期' | |
69 | + // : props.column === 7 | |
70 | + // ? '销售额' | |
71 | + // : '生产科回款日期', | |
72 | + // rules: [{ required: true }], | |
73 | + // colProps: { | |
74 | + // span: 24, | |
75 | + // }, | |
76 | + // }, | |
77 | + // ], | |
45 | 78 | schemas: [ |
46 | 79 | { |
47 | 80 | field: 'settingValue', |
48 | 81 | component: 'Select', |
49 | - label: '客户编码', | |
82 | + label: props.column === 8 ? '生产科' : '客户编码', | |
50 | 83 | rules: [{ required: true }], |
51 | 84 | componentProps: { |
52 | - options: customerCodeOptions, | |
85 | + options: props.column === 8 ? productDepartmentOptions : customerCodeOptions, | |
53 | 86 | }, |
54 | 87 | colProps: { |
55 | 88 | span: 24, | ... | ... |
src/views/project/config/data.tsx
src/views/project/finance/pay/DeductShow.vue
... | ... | @@ -12,7 +12,8 @@ |
12 | 12 | <a-list-item> |
13 | 13 | <a-list-item-meta> |
14 | 14 | <template #title> |
15 | - <a :href="item.url" target="_blank" rel="noopener noreferrer">{{ item.name }}</a> | |
15 | + <!-- <a :href="item.url" target="_blank" rel="noopener noreferrer">{{ item.name }}</a> --> | |
16 | + <a @click="openPic(item.url)">{{ item.name }}</a> | |
16 | 17 | </template> |
17 | 18 | </a-list-item-meta> |
18 | 19 | </a-list-item> |
... | ... | @@ -52,4 +53,15 @@ |
52 | 53 | itemArray.value = []; |
53 | 54 | closeModal(); |
54 | 55 | } |
56 | + function openPic(url) { | |
57 | + window.open('', '', '').document.write(`<!DOCTYPE html> | |
58 | + <html> | |
59 | + <body | |
60 | + style="display: flex; | |
61 | + justify-content: center; | |
62 | + align-items: center;"> | |
63 | + <img src='${url}' width="500px" height="500px"/> | |
64 | + </body> | |
65 | + </html>`); | |
66 | + } | |
55 | 67 | </script> | ... | ... |
src/views/project/finance/pay/InvoiceShow.vue
0 → 100644
1 | +<template> | |
2 | + <BasicModal | |
3 | + v-bind="$attrs" | |
4 | + @register="register" | |
5 | + title="生产科发票" | |
6 | + width="700px" | |
7 | + :bodyStyle="{ height: '240px' }" | |
8 | + @ok="handleOk" | |
9 | + > | |
10 | + <a-list item-layout="horizontal" :data-source="itemArray"> | |
11 | + <template #renderItem="{ item }"> | |
12 | + <a-list-item> | |
13 | + <a-list-item-meta> | |
14 | + <template #title> | |
15 | + <!-- <a :href="item.url" target="_blank" rel="noopener noreferrer">{{ item.name }}</a> --> | |
16 | + <a @click="openPic(item.url)">{{ item.name }}</a> | |
17 | + </template> | |
18 | + </a-list-item-meta> | |
19 | + </a-list-item> | |
20 | + </template> | |
21 | + </a-list> | |
22 | + </BasicModal> | |
23 | +</template> | |
24 | +<script lang="ts" setup> | |
25 | + import { BasicModal, useModalInner } from '@/components/Modal'; | |
26 | + import { computed, ref } from 'vue'; | |
27 | + import type { UploadProps, UploadChangeParam } from 'ant-design-vue'; | |
28 | + import { InboxOutlined } from '@ant-design/icons-vue'; | |
29 | + import { message } from 'ant-design-vue'; | |
30 | + import { getDeductUrlById, getInvoiceUrlById } from '@/api/project/invoice'; | |
31 | + | |
32 | + interface Item { | |
33 | + name: string; | |
34 | + url: string; | |
35 | + } | |
36 | + | |
37 | + const list = ref(); | |
38 | + const id = ref(); | |
39 | + const itemArray = ref<Item[]>([]); | |
40 | + | |
41 | + const [register, { closeModal }] = useModalInner(async (data) => { | |
42 | + itemArray.value = []; | |
43 | + const res = await getInvoiceUrlById({ id: data.data.id }); | |
44 | + for (let item in res) { | |
45 | + const url = res[item]; | |
46 | + const name = item; | |
47 | + // 将 name 和 url 放入对象并添加到数组中 | |
48 | + itemArray.value.push({ name, url }); | |
49 | + } | |
50 | + }); | |
51 | + | |
52 | + async function handleOk() { | |
53 | + itemArray.value = []; | |
54 | + closeModal(); | |
55 | + } | |
56 | + function openPic(url) { | |
57 | + window.open('', '', '').document.write(`<!DOCTYPE html> | |
58 | + <html> | |
59 | + <body | |
60 | + style="display: flex; | |
61 | + justify-content: center; | |
62 | + align-items: center;"> | |
63 | + <img src='${url}' width="500px" height="500px"/> | |
64 | + </body> | |
65 | + </html>`); | |
66 | + } | |
67 | +</script> | ... | ... |
src/views/project/finance/pay/index.vue
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | <InvoiceUpload @register="registerInvoiceUpload" @success="handleSuccess" /> |
15 | 15 | <CheckDetail @register="registerInvoiceDetail" /> |
16 | 16 | <DeductShow @register="registerDeductShow" /> |
17 | + <InvoiceShow @register="registerInvoiceShow" /> | |
17 | 18 | </template> |
18 | 19 | <template #bodyCell="{ column, record }"> |
19 | 20 | <template v-if="column.key === 'action'"> |
... | ... | @@ -70,6 +71,7 @@ |
70 | 71 | import CheckDetail from './CheckDetail.vue'; |
71 | 72 | import CheckSum from './CheckSum.vue'; |
72 | 73 | import DeductShow from './DeductShow.vue'; |
74 | + import InvoiceShow from './InvoiceShow.vue'; | |
73 | 75 | import { useDrawer } from '/@/components/Drawer'; |
74 | 76 | import { useModal } from '/@/components/Modal'; |
75 | 77 | import { getCheck, checkDelete, checkCommit, checkDetail } from '@/api/project/invoice'; |
... | ... | @@ -80,6 +82,7 @@ |
80 | 82 | const [registerTrackEdit, { openDrawer: openTrackEdit }] = useDrawer(); |
81 | 83 | const [registerInvoiceUpload, { openModal: openInvoiceUpload }] = useModal(); |
82 | 84 | const [registerDeductShow, { openModal: openDeductShow }] = useModal(); |
85 | + const [registerInvoiceShow, { openModal: openInvoiceShow }] = useModal(); | |
83 | 86 | const [registerInvoiceDetail, { openDrawer: openCheckDetail }] = useDrawer(); |
84 | 87 | const checkedKeys = ref<Array<string | number>>([]); |
85 | 88 | |
... | ... | @@ -393,7 +396,9 @@ |
393 | 396 | }, 50); |
394 | 397 | } |
395 | 398 | function handleInvoiceShow(record) { |
396 | - window.open(record.invoiceUrl); | |
399 | + openInvoiceShow(true, { | |
400 | + data: record, | |
401 | + }); | |
397 | 402 | } |
398 | 403 | function handleDeductShow(record) { |
399 | 404 | openDeductShow(true, { |
... | ... | @@ -406,7 +411,14 @@ |
406 | 411 | }); |
407 | 412 | } |
408 | 413 | function handleCommit(record) { |
409 | - checkCommit({ id: record.id }); | |
414 | + const currentDate: string = (() => { | |
415 | + const date = new Date(); | |
416 | + const year = date.getFullYear(); | |
417 | + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始 | |
418 | + const day = String(date.getDate()).padStart(2, '0'); | |
419 | + return `${year}-${month}-${day}`; | |
420 | + })(); | |
421 | + checkCommit({ id: record.id, actualPayedDate: currentDate }); | |
410 | 422 | setTimeout(() => { |
411 | 423 | reload(); |
412 | 424 | }, 50); | ... | ... |
src/views/project/finance/receive/DeductShow.vue
... | ... | @@ -12,7 +12,8 @@ |
12 | 12 | <a-list-item> |
13 | 13 | <a-list-item-meta> |
14 | 14 | <template #title> |
15 | - <a :href="item.url" target="_blank" rel="noopener noreferrer">{{ item.name }}</a> | |
15 | + <!-- <a :href="item.url" target="_blank" rel="noopener noreferrer">{{ item.name }}</a> --> | |
16 | + <a @click="openPic(item.url)">{{ item.name }}</a> | |
16 | 17 | </template> |
17 | 18 | </a-list-item-meta> |
18 | 19 | </a-list-item> |
... | ... | @@ -53,4 +54,15 @@ |
53 | 54 | itemArray.value = []; |
54 | 55 | closeModal(); |
55 | 56 | } |
57 | + function openPic(url) { | |
58 | + window.open('', '', '').document.write(`<!DOCTYPE html> | |
59 | + <html> | |
60 | + <body | |
61 | + style="display: flex; | |
62 | + justify-content: center; | |
63 | + align-items: center;"> | |
64 | + <img src='${url}' width="500px" height="500px"/> | |
65 | + </body> | |
66 | + </html>`); | |
67 | + } | |
56 | 68 | </script> | ... | ... |
src/views/project/finance/receive/FinanceEdit.vue
src/views/project/finance/receive/InvoiceAnalysis.vue
src/views/project/finance/receive/InvoiceDetail.vue
... | ... | @@ -74,12 +74,12 @@ |
74 | 74 | { |
75 | 75 | title: '客户单价$', |
76 | 76 | width: 150, |
77 | - dataIndex: 'orderCount', | |
77 | + dataIndex: 'customerPrice', | |
78 | 78 | }, |
79 | 79 | { |
80 | 80 | title: '客户总价$', |
81 | 81 | width: 150, |
82 | - dataIndex: 'orderCount', | |
82 | + dataIndex: 'customerTotalPrice', | |
83 | 83 | }, |
84 | 84 | ]; |
85 | 85 | const invoiceNo = ref(); | ... | ... |
src/views/project/finance/receive/index.vue
... | ... | @@ -227,7 +227,14 @@ |
227 | 227 | }); |
228 | 228 | } |
229 | 229 | function handleCommit(record) { |
230 | - commit({ id: record.id }); | |
230 | + const currentDate: string = (() => { | |
231 | + const date = new Date(); | |
232 | + const year = date.getFullYear(); | |
233 | + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始 | |
234 | + const day = String(date.getDate()).padStart(2, '0'); | |
235 | + return `${year}-${month}-${day}`; | |
236 | + })(); | |
237 | + commit({ id: record.id, actualRefundDate: currentDate }); | |
231 | 238 | setTimeout(() => { |
232 | 239 | reload(); |
233 | 240 | }, 50); | ... | ... |
src/views/project/finance/receive/receive.data.tsx
... | ... | @@ -77,7 +77,7 @@ export const columns: BasicColumn[] = [ |
77 | 77 | }, |
78 | 78 | { |
79 | 79 | title: '实际应收金额$', |
80 | - dataIndex: 'actualReceivableAmount', | |
80 | + dataIndex: 'totalPayAmount', | |
81 | 81 | width: 120, |
82 | 82 | }, |
83 | 83 | { |
... | ... | @@ -130,7 +130,7 @@ export const columnsAnalysis: BasicColumn[] = [ |
130 | 130 | }, |
131 | 131 | { |
132 | 132 | title: '实际应收金额总计$', |
133 | - dataIndex: 'actualReceivableAmount', | |
133 | + dataIndex: 'totalPayAmount', | |
134 | 134 | width: 50, |
135 | 135 | }, |
136 | 136 | { |
... | ... | @@ -145,7 +145,7 @@ export const columnsAnalysis: BasicColumn[] = [ |
145 | 145 | }, |
146 | 146 | { |
147 | 147 | title: '实际应收金额总计$', |
148 | - dataIndex: 'actualReceivableAmount', | |
148 | + dataIndex: 'totalPayAmount', | |
149 | 149 | width: 50, |
150 | 150 | }, |
151 | 151 | { | ... | ... |
src/views/project/order/ProductText.vue
src/views/project/order/ServiceProfit.vue
... | ... | @@ -390,7 +390,7 @@ |
390 | 390 | allList.forEach((item) => { |
391 | 391 | console.log(item, '5656orderList'); |
392 | 392 | console.log(item.profitAnalysisInfo.packetPrice, '5656orderList'); |
393 | - packetCalculatePrice.value += item.profitAnalysisInfo.packetPrice; | |
393 | + packetCalculatePrice.value += item?.profitAnalysisInfo?.packetPrice; | |
394 | 394 | orderCalculateCount.value += item.orderCount; |
395 | 395 | actualRmbPrice.value += packetCalculatePrice.value / orderCalculateCount.value; |
396 | 396 | }); | ... | ... |