123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280 |
- <template>
- <div>
- <div
- id="pdfDom"
- ref="pdfDom"
- style="padding: 30px 60px"
- v-loading="loading"
- >
- <table border="1" style="width: 100%" class="table">
- <tr>
- <td style="width: 120px">
- <img
- :src="pdfData.companyPic"
- alt=""
- fit="scale-down"
- style="height: 60px; width: 60px"
- />
- </td>
- <td style="padding: 10px">
- <div style="font-size: 18px" class="color-class">
- {{ pdfData.sellCorporationNameEn }}
- </div>
- <div style="font-size: 18px" class="color-class">
- {{ pdfData.sellCorporationName }}
- </div>
- <div style="font-size: 14px; color: #000">
- Address: {{ pdfData.sellDetailedAddressEn }}
- </div>
- <div style="font-size: 14px; color: #000; margin-top: 5px">
- {{ pdfData.sellCityNameEn }} , {{ pdfData.sellProvinceNameEn }} ,
- {{ pdfData.sellCountryNameEn }}
- </div>
- <div style="font-size: 14px; color: #000; margin-top: 10px">
- 地址: {{ pdfData.sellCountryName }} ,
- {{ pdfData.sellProvinceName }} , {{ pdfData.sellCityName }}
- </div>
- <div style="font-size: 14px; color: #000; margin-top: 5px">
- {{ pdfData.sellDetailedAddress }}
- </div>
- <div style="margin: 8px 0; color: black">
- Tel: <span>{{ pdfData.sellContactNumber }}</span>
- <!-- Fax:
- <span>{{ pdfData.fax }}</span>
- Website:
- <span>{{ pdfData.Website }}</span> -->
- </div>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <div
- class="color-class"
- style="text-align: center; font-size: 18px"
- >
- Sample Proforma Invoice
- </div>
- </td>
- </tr>
- </table>
- <div style="height: 15px; background: #7f197f"></div>
- <table border="1" style="width: 100%" class="table">
- <tr>
- <td style="width: 50%; text-align: left">
- Buyer: {{ pdfData.buyCorporationName }}
- </td>
- <td style="width: 50%; text-align: left">
- Seller: {{ pdfData.sellCorporationNameEn }}
- </td>
- </tr>
- </table>
- <table border="1" style="width: 100%; border-top: none" class="table">
- <tr>
- <td style="width: 15%">Sample PI No</td>
- <td style="width: 35%">{{ pdfData.contractCode }}</td>
- <td style="width: 15%">Date:</td>
- <td style="width: 35%">{{ pdfData.createTimeEn }}</td>
- </tr>
- <tr>
- <td style="width: 15%">Contact Person:</td>
- <td style="width: 35%">{{ pdfData.createUserNameEn }}</td>
- <td style="width: 15%">Email:</td>
- <td style="width: 35%">
- {{ pdfData.createUserEmail }}
- </td>
- </tr>
- <tr>
- <td style="width: 15%">Payment Teams:</td>
- <td style="width: 35%">{{ pdfData.remark }}</td>
- <td style="width: 15%">Lead Time:</td>
- <td style="width: 35%">{{ pdfData.deliveryTime }}</td>
- </tr>
- </table>
- <div style="height: 15px; background: #7f197f"></div>
- <table border="1" style="width: 100%" class="table">
- <tr>
- <td style="width: 15%">Image</td>
- <td style="width: 20%">Description</td>
- <td style="width: 15%">Size</td>
- <td style="width: 15%">Quantity</td>
- <td style="width: 17%">Sample <br />Fee</td>
- <td style="width: 18%">Total <br />Amount</td>
- </tr>
- <tr
- v-if="pdfData.productInfoList && pdfData.productInfoList.length > 0"
- v-for="(item, index) in pdfData.productInfoList"
- :key="item.productId"
- >
- <td style="width: 15%">
- <img
- :src="item.fileList[0].fileUrl"
- alt=""
- fit="scale-down"
- style="height: 60px; width: 60px"
- v-if="item.fileList && item.fileList.length > 0"
- />
- </td>
- <td style="width: 20%">{{ item.productName }}</td>
- <td style="width: 15%">
- <span v-if="item.productModel">{{ item.productModel }} cm</span>
- </td>
- <td style="width: 15%">
- {{ item.productQuantity }}
- </td>
- <td style="width: 17%">
- {{ pdfData.currency }} {{ moneyFormat(item.productPrice, 2) }}
- </td>
- <td style="width: 18%">
- {{ pdfData.currency }} {{ moneyFormat(item.amount, 2) }}
- </td>
- </tr>
- <template
- v-if="
- pdfData.sampleProjectList && pdfData.sampleProjectList.length > 0
- "
- >
- <tr>
- <td colspan="5" style="text-align: right">
- <div
- v-for="(item, index) in pdfData.sampleProjectList"
- :key="item.id"
- >
- {{ item.payName }}:
- </div>
- </td>
- <td class="center-class">
- <div
- v-for="(item, index) in pdfData.sampleProjectList"
- :key="item.id"
- >
- {{ pdfData.currency }}
- {{ moneyFormat(item.amount, 2) }}
- </div>
- </td>
- </tr>
- </template>
- <tr>
- <td colspan="5" style="text-align: right">Total Amount:</td>
- <td style="width: 10%">
- {{ pdfData.currency }}
- {{ moneyFormat(pdfData.totalAmount, 2) }}
- </td>
- </tr>
- </table>
- <div style="height: 15px; background: #7f197f"></div>
- <table border="1" style="width: 100%" class="table">
- <tr>
- <td class="width-one" style="text-align: left">5.Banking Info</td>
- <td style="text-align: left">
- <div>Beneficiary Name: {{ pdfData.beneficiaryName }}</div>
- <div>Beneficiary Bank: {{ pdfData.beneficiaryBank }}</div>
- <div>
- Beneficiary Bank Address:
- {{ pdfData.beneficiaryBankAddress }}
- </div>
- <div>
- Beneficiary Account Number:
- {{ pdfData.beneficiaryAccountNumber }}
- </div>
- <div>Swift Code: {{ pdfData.swiftCode }}</div>
- <div>Beneficiary Address: {{ pdfData.beneficiaryAddress }}</div>
- </td>
- </tr>
- </table>
- </div>
- </div>
- </template>
- <script setup>
- import { NumberToChinese } from "@/utils/util.js";
- import { watch } from "vue";
- const { proxy } = getCurrentInstance();
- const pdfData = ref({});
- const props = defineProps({
- rowData: Object,
- });
- const loading = ref(false);
- const getPdfData = (query) => {
- loading.value = true;
- proxy.post("/sample/getSamplePdfInfo", query).then((res) => {
- pdfData.value = res;
- if (pdfData.value.sellCorporationId) {
- proxy
- .post("/fileInfo/getList", {
- businessIdList: [pdfData.value.sellCorporationId],
- fileType: 1,
- })
- .then((fileObj) => {
- proxy
- .getImgBase64(fileObj[pdfData.value.sellCorporationId][0].fileUrl)
- .then((res) => {
- pdfData.value.companyPic = res;
- });
- });
- }
- loading.value = false;
- // 拿取产品图
- if (
- pdfData.value.productInfoList &&
- pdfData.value.productInfoList.length > 0
- ) {
- let arr = pdfData.value.productInfoList.map((x) => x.productId);
- proxy
- .post("/fileInfo/getList", {
- businessIdList: arr,
- })
- .then(async (fileObj) => {
- for (let i = 0; i < pdfData.value.productInfoList.length; i++) {
- const e = pdfData.value.productInfoList[i];
- for (const key in fileObj) {
- if (e.productId === key) {
- if (fileObj[key] && fileObj[key].length > 0) {
- const res = await proxy.getImgBase64(fileObj[key][0].fileUrl);
- fileObj[key][0].fileUrl = res;
- e.fileList = fileObj[key];
- }
- }
- }
- }
- });
- }
- });
- };
- watch(
- () => props.rowData,
- () => {
- if (props.rowData.id) {
- getPdfData({ id: props.rowData.id });
- }
- },
- {
- immediate: true,
- deep: true,
- }
- );
- </script>
- <style lang="scss" scoped>
- .color-class {
- color: #7f197f;
- }
- .bck {
- background: #7f197f;
- }
- .width-one {
- width: 140px;
- }
- .table {
- border-collapse: collapse;
- border-spacing: 0;
- td {
- text-align: center;
- padding: 2px 4px;
- // padding: 5px 10px;
- }
- }
- </style>
|