|
@@ -0,0 +1,372 @@
|
|
|
+<template>
|
|
|
+ <div class="tenant">
|
|
|
+ <byTable
|
|
|
+ :source="sourceList.data"
|
|
|
+ :pagination="sourceList.pagination"
|
|
|
+ :config="config"
|
|
|
+ :loading="loading"
|
|
|
+ :selectConfig="selectConfig"
|
|
|
+ :row-class-name="getRowClass"
|
|
|
+ highlight-current-row
|
|
|
+ @get-list="getList"
|
|
|
+ >
|
|
|
+ <template #code="{ item }">
|
|
|
+ <div
|
|
|
+ v-if="Number(item.sumPayMoney) > Number(item.amount)"
|
|
|
+ style="cursor: pointer; color: #f54a45"
|
|
|
+ @click="handleClickCode(item)"
|
|
|
+ >
|
|
|
+ {{ item.code }}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-else
|
|
|
+ style="cursor: pointer; color: #409eff"
|
|
|
+ @click="handleClickCode(item)"
|
|
|
+ >
|
|
|
+ {{ item.code }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #amount="{ item }">
|
|
|
+ <div>
|
|
|
+ <span style="padding-right: 4px">{{ item.currency }}</span>
|
|
|
+ <span>{{ moneyFormat(item.amount, 2) }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #sumPayMoney="{ item }">
|
|
|
+ <div>
|
|
|
+ <span style="padding-right: 4px">{{ item.currency }}</span>
|
|
|
+ <span>{{ moneyFormat(item.sumPayMoney, 2) }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </byTable>
|
|
|
+ <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="900px">
|
|
|
+ <!-- <PurchasePDFOne :rowData="rowData"></PurchasePDFOne> -->
|
|
|
+ <PurchasePDFOneNew :rowData="rowData" ref="PdfDom"></PurchasePDFOneNew>
|
|
|
+ <template #footer ref="printBtn">
|
|
|
+ <el-button @click="openPdf = false" size="large">关闭</el-button>
|
|
|
+ <el-button type="primary" v-print="printObj" size="large"
|
|
|
+ >打印</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="clickDownload()" size="large"
|
|
|
+ >下载PDF</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="exportExcel()" size="large"
|
|
|
+ >导出Excel</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { computed, ref } from "vue";
|
|
|
+import byTable from "@/components/byTable/index";
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
+import PurchasePDFOne from "@/components/PDF/purchasePDFOne.vue";
|
|
|
+import PurchasePDFOneNew from "@/components/PDF/purchasePDFOneNew.vue";
|
|
|
+
|
|
|
+const route = useRoute();
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
+const supplierList = ref([]);
|
|
|
+const status = ref([
|
|
|
+ {
|
|
|
+ label: "草稿",
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审批中",
|
|
|
+ value: 10,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "驳回",
|
|
|
+ value: 20,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已采购",
|
|
|
+ value: 30,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "变更中",
|
|
|
+ value: 60,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已变更",
|
|
|
+ value: 70,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "作废",
|
|
|
+ value: 88,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "终止",
|
|
|
+ value: 99,
|
|
|
+ },
|
|
|
+]);
|
|
|
+const payStatus = ref([
|
|
|
+ {
|
|
|
+ label: "未付款",
|
|
|
+ value: 0,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "部分付款",
|
|
|
+ value: 10,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "已付款",
|
|
|
+ value: 20,
|
|
|
+ },
|
|
|
+]);
|
|
|
+const sourceList = ref({
|
|
|
+ data: [],
|
|
|
+ pagination: {
|
|
|
+ total: 0,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ keyword: "",
|
|
|
+ status: "",
|
|
|
+ payStatus: "",
|
|
|
+ },
|
|
|
+});
|
|
|
+const loading = ref(false);
|
|
|
+const selectConfig = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ label: "采购状态",
|
|
|
+ prop: "status",
|
|
|
+ data: status.value,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "付款状态",
|
|
|
+ prop: "payStatus",
|
|
|
+ data: payStatus.value,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const config = computed(() => {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "采购单号",
|
|
|
+ slot: "code",
|
|
|
+ width: 180,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "供应商",
|
|
|
+ prop: "sellCorporationId",
|
|
|
+ "min-width": 220,
|
|
|
+ },
|
|
|
+ render(type) {
|
|
|
+ return proxy.dictValueLabel(type, supplierList.value);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "采购金额",
|
|
|
+ slot: "amount",
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "已付款金额",
|
|
|
+ slot: "sumPayMoney",
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "版本号",
|
|
|
+ prop: "version",
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "采购人",
|
|
|
+ prop: "userName",
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "采购时间",
|
|
|
+ prop: "createTime",
|
|
|
+ width: 160,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "采购状态",
|
|
|
+ prop: "status",
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
+ render(type) {
|
|
|
+ return proxy.dictValueLabel(type, status.value);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "付款状态",
|
|
|
+ prop: "payStatus",
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
+ render(type) {
|
|
|
+ return proxy.dictValueLabel(type, payStatus.value);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "操作",
|
|
|
+ width: 80,
|
|
|
+ align: "center",
|
|
|
+ fixed: "right",
|
|
|
+ },
|
|
|
+ renderHTML(row) {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "选择",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ clickSelect(row);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+});
|
|
|
+const getDict = () => {
|
|
|
+ proxy
|
|
|
+ .post("/supplierInfo/page", { pageNum: 1, pageSize: 999 })
|
|
|
+ .then((res) => {
|
|
|
+ supplierList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+const getList = async (req) => {
|
|
|
+ sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
|
+ loading.value = true;
|
|
|
+ proxy.post("/ehsdPurchase/page", sourceList.value.pagination).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ sourceList.value.data = res.rows;
|
|
|
+ sourceList.value.pagination.total = res.total;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.value = false;
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
+};
|
|
|
+getDict();
|
|
|
+if (route.query.code) {
|
|
|
+ sourceList.value.pagination.keyword = route.query.code;
|
|
|
+}
|
|
|
+getList();
|
|
|
+
|
|
|
+const openPdf = ref(false);
|
|
|
+const pdfData = ref({});
|
|
|
+const rowData = ref({});
|
|
|
+const handlePrintPdf = (row) => {
|
|
|
+ rowData.value = {
|
|
|
+ id: row.id,
|
|
|
+ code: row.code,
|
|
|
+ };
|
|
|
+ rowData.value = row;
|
|
|
+ openPdf.value = true;
|
|
|
+};
|
|
|
+const clickDownload = () => {
|
|
|
+ proxy.getPdf("购销合同" + rowData.value.code);
|
|
|
+};
|
|
|
+const pdfDom = ref(null);
|
|
|
+const printObj = ref({
|
|
|
+ id: "pdfDom",
|
|
|
+ popTitle: "",
|
|
|
+ extraCss:
|
|
|
+ "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
|
|
|
+ extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
|
|
|
+});
|
|
|
+
|
|
|
+const handleClickCode = (row) => {
|
|
|
+ let submitType = row.dataResource > 0 ? "10" : "20";
|
|
|
+ proxy.$router.push({
|
|
|
+ path: "/platform_manage/process/processApproval",
|
|
|
+ query: {
|
|
|
+ flowKey: row.processInstanceId,
|
|
|
+ id: row.flowId,
|
|
|
+ processType: 20,
|
|
|
+ businessId: row.id,
|
|
|
+ submitType,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const getRowClass = ({ row }) => {
|
|
|
+ if (Number(row.sumPayMoney) > Number(row.amount)) {
|
|
|
+ return "redClass";
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+};
|
|
|
+
|
|
|
+const handleChange = (row) => {
|
|
|
+ let submitType = row.dataResource > 0 ? "10" : "20";
|
|
|
+ let type = "";
|
|
|
+ if (row.dataResource == 1) {
|
|
|
+ type = 1;
|
|
|
+ } else if (row.dataResource == 2) {
|
|
|
+ type = 2;
|
|
|
+ }
|
|
|
+ proxy.$router.push({
|
|
|
+ path: "/platform_manage/process/processApproval",
|
|
|
+ query: {
|
|
|
+ flowKey: "ehsd_purchase_update_flow",
|
|
|
+ flowName: "采购合同变更",
|
|
|
+ random: proxy.random(),
|
|
|
+ businessId: row.id,
|
|
|
+ submitType,
|
|
|
+ type,
|
|
|
+ },
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const PdfDom = ref(null);
|
|
|
+const exportExcel = () => {
|
|
|
+ PdfDom.value.exportExcel();
|
|
|
+};
|
|
|
+
|
|
|
+const clickSelect = (row) => {
|
|
|
+ proxy.$emit("select", row.id);
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.tenant {
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
+::v-deep(.el-input-number .el-input__inner) {
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+.baseRow {
|
|
|
+ min-height: 24px;
|
|
|
+ border-top: 1px solid black;
|
|
|
+ border-left: 1px solid black;
|
|
|
+}
|
|
|
+.contentRow {
|
|
|
+ border-right: 1px solid black;
|
|
|
+ line-height: 24px;
|
|
|
+ padding-left: 4px;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style>
|
|
|
+.redClass {
|
|
|
+ color: #f54a45 !important;
|
|
|
+}
|
|
|
+</style>
|