|
@@ -51,6 +51,157 @@
|
|
|
</el-card>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+
|
|
|
+ <el-dialog title="生成PDF" v-if="openPdf" :visible.sync="openPdf" width="770px" append-to-body>
|
|
|
+ <div id="pdfContent" style="width: 726px">
|
|
|
+ <div class="con">
|
|
|
+ <div style="font-size: 24px; font-weight: 700; padding: 16px; text-align: center">福清市胜德体育用品有限公司</div>
|
|
|
+ <div style="font-size: 24px; padding: 8px 0 4px 0; text-align: center; border-bottom: 2px solid black">采购合同</div>
|
|
|
+ <div style="height: 8px"></div>
|
|
|
+ <table cellspacing="0" cellpadding="0" border="0" style="width: 100%; line-height: 24px">
|
|
|
+ <tr>
|
|
|
+ <td style="width: 50%">
|
|
|
+ <span>需方:{{ pdfDetail.company.nameChinese }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>订单号:{{ pdfDetail.purchaseContract.code }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td style="width: 50%">
|
|
|
+ <span>供方:{{ pdfDetail.purchaseContract.supplyName }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>日期:{{ pdfDetail.createTime }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <div style="height: 8px"></div>
|
|
|
+ <table cellspacing="0" cellpadding="0" border="0" class="tableOne">
|
|
|
+ <tr>
|
|
|
+ <th style="width: 30px">序号</th>
|
|
|
+ <th style="width: 120px">品号</th>
|
|
|
+ <th style="width: 260px">产品名称</th>
|
|
|
+ <th style="width: 45px">数量</th>
|
|
|
+ <th style="width: 45px">单位</th>
|
|
|
+ <th style="width: 45px">单价</th>
|
|
|
+ <th style="width: 60px">金额</th>
|
|
|
+ <th style="width: 100px">交货期</th>
|
|
|
+ </tr>
|
|
|
+ <template v-if="pdfDetail.products && pdfDetail.products.length > 0">
|
|
|
+ <tr v-for="(item, index) in pdfDetail.products" :key="index">
|
|
|
+ <td>
|
|
|
+ {{ index + 1 }}
|
|
|
+ </td>
|
|
|
+ <td style="text-align: left; word-break: break-all">
|
|
|
+ <span>{{ item.bomColorCode }}</span>
|
|
|
+ </td>
|
|
|
+ <td style="text-align: left; word-break: break-all">
|
|
|
+ <span>{{ item.bomColorName }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>{{ item.bomCompany }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>{{ item.quantity }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>{{ item.price }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>{{ item.sumPrice }}</span>
|
|
|
+ </td>
|
|
|
+ <td style="text-align: left; word-break: break-all">
|
|
|
+ <span>{{ pdfDetail.deliveryTime }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </template>
|
|
|
+ <tr>
|
|
|
+ <td>合计:</td>
|
|
|
+ <td colspan="5"></td>
|
|
|
+ <td>
|
|
|
+ <span>{{ pdfDetail.total }}</span>
|
|
|
+ </td>
|
|
|
+ <td style="border-right: 0"></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <div style="height: 8px"></div>
|
|
|
+ <table cellspacing="0" cellpadding="0" border="0" class="tableTwo">
|
|
|
+ <tr>
|
|
|
+ <td>
|
|
|
+ <div crossOrigin="anonymous" class="ql-snow" v-html="limitImg(pdfDetail.purchaseContract.remark)"></div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <div style="height: 32px"></div>
|
|
|
+ <table cellspacing="0" cellpadding="0" border="0" class="tableThree">
|
|
|
+ <tr>
|
|
|
+ <td style="width: 50%; position: relative">
|
|
|
+ <div>
|
|
|
+ <span>需方(签章):{{ pdfDetail.company.nameChinese }}</span>
|
|
|
+ </div>
|
|
|
+ <div style="position: absolute; top: -50px; left: 20px">
|
|
|
+ <img
|
|
|
+ v-if="pdfDetail.company.companySeal"
|
|
|
+ style="width: 160px; height: 160px"
|
|
|
+ :src="pathPrefix + pdfDetail.company.companySeal"
|
|
|
+ alt=""
|
|
|
+ srcset=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>供方(签章):{{ pdfDetail.supplier.name }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td style="width: 50%">
|
|
|
+ <span>税 号:{{ pdfDetail.company.taxpayerNumber }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>税 号:{{ pdfDetail.supplier.dutyParagraph }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td style="width: 50%">
|
|
|
+ <span>开 户:{{ pdfDetail.company.bankName }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>开 户:{{ pdfDetail.supplier.bank }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td style="width: 50%">
|
|
|
+ <span>账 号:{{ pdfDetail.company.bankAccount }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>账 号:{{ pdfDetail.supplier.accountNumber }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td style="width: 50%">
|
|
|
+ <span>地 址:{{ pdfDetail.company.bankAddress }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>地 址:{{ pdfDetail.supplier.province }} {{ pdfDetail.supplier.city }} {{ pdfDetail.supplier.address }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td style="width: 50%">
|
|
|
+ <span>电 话:{{ pdfDetail.company.telephone }}</span>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <span>电 话:{{ pdfDetail.supplier.phone }}</span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100%; text-align: center">
|
|
|
+ <el-button type="primary" @click="clickDownload()" size="small" v-db-click>下载PDF</el-button>
|
|
|
+ <el-button @click="openPdf = false" size="small" v-db-click>取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -63,7 +214,7 @@ import LabelTemplate from '@/components/LabelTemplate'
|
|
|
import NewHistory from '@/views/activiti/include/NewHistory'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import SubscriptionDetails from '@/views/shengde/group/subscription/management/details/index'
|
|
|
-import { generatePdf } from '@/api/shengde/productionSystem/purchase/contract'
|
|
|
+import { purchaseGeneratePdfV2 } from '@/api/shengde/productionSystem/purchase/contract'
|
|
|
import Utils from '@/util/transit'
|
|
|
|
|
|
export default {
|
|
@@ -82,6 +233,20 @@ export default {
|
|
|
pdfUrl: '',
|
|
|
activeTwo: 'one',
|
|
|
processInstanceId: '',
|
|
|
+ pdfDetail: {
|
|
|
+ sumCount: '',
|
|
|
+ purchaseCode: '',
|
|
|
+ baseUrl: '',
|
|
|
+ total: '',
|
|
|
+ deliveryTime: '',
|
|
|
+ createTime: '',
|
|
|
+ purchaseId: '',
|
|
|
+ purchaseContract: {},
|
|
|
+ supplier: {},
|
|
|
+ company: {},
|
|
|
+ products: [],
|
|
|
+ },
|
|
|
+ openPdf: false,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -107,13 +272,30 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
clickOpenPdf() {
|
|
|
- if (this.pdfUrl) {
|
|
|
- window.open(this.pathPrefix + this.pdfUrl)
|
|
|
- } else {
|
|
|
- generatePdf({ id: this.rowData.id }).then((res) => {
|
|
|
- window.open(this.pathPrefix + res.data.data)
|
|
|
+ if (!this.pdfDetail.purchaseId) {
|
|
|
+ purchaseGeneratePdfV2({ id: this.$route.query.id }).then((res) => {
|
|
|
+ this.pdfDetail = res.data.data
|
|
|
})
|
|
|
}
|
|
|
+ this.openPdf = true
|
|
|
+ },
|
|
|
+ clickDownload() {
|
|
|
+ const loading = this.$loading({})
|
|
|
+ setTimeout(() => {
|
|
|
+ let fileName = '采购合同PDF文件'
|
|
|
+ if (this.pdfDetail.purchaseCode) {
|
|
|
+ fileName = this.pdfDetail.purchaseCode
|
|
|
+ }
|
|
|
+ this.ExportSavePdf(fileName, '')
|
|
|
+ loading.close()
|
|
|
+ }, 500)
|
|
|
+ },
|
|
|
+ limitImg(text) {
|
|
|
+ if (text) {
|
|
|
+ return text.replace(/<img/g, '<img style="max-width: 98%;"')
|
|
|
+ } else {
|
|
|
+ return text
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -140,4 +322,45 @@ export default {
|
|
|
font-size: 12px !important;
|
|
|
}
|
|
|
}
|
|
|
+.con {
|
|
|
+ font-family: 'Times New Roman', 'SimSun' !important;
|
|
|
+ color: black !important;
|
|
|
+ font-size: 12px !important;
|
|
|
+ width: 705px;
|
|
|
+ text-align: left;
|
|
|
+ background-color: white;
|
|
|
+ padding: 16px;
|
|
|
+}
|
|
|
+.tableOne {
|
|
|
+ border: 1px solid black;
|
|
|
+ line-height: 18px;
|
|
|
+ overflow: auto;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+.tableOne th {
|
|
|
+ font-weight: 700;
|
|
|
+ border-right: 1px solid black;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.tableOne td {
|
|
|
+ border-right: 1px solid black;
|
|
|
+ border-top: 1px solid black;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.tableTwo {
|
|
|
+ width: 100%;
|
|
|
+ line-height: 18px;
|
|
|
+ word-break: break-all;
|
|
|
+}
|
|
|
+.tableTwo td {
|
|
|
+ vertical-align: top;
|
|
|
+}
|
|
|
+.tableThree {
|
|
|
+ width: 100%;
|
|
|
+ line-height: 24px;
|
|
|
+ word-break: break-all;
|
|
|
+}
|
|
|
+.tableThree td {
|
|
|
+ vertical-align: top;
|
|
|
+}
|
|
|
</style>
|