cz 1 year ago
parent
commit
bc249f6728

+ 303 - 0
src/components/PDF/purchasePDFOne.vue

@@ -0,0 +1,303 @@
+<template>
+  <div>
+    <div id="pdfDom" ref="pdfDom" style="width: 840px">
+      <div style="display: flex; align-items: center">
+        <div>
+          <img
+            :src="pdfData.companyPic"
+            alt=""
+            fit="scale-down"
+            style="height: 60px; width: 60px"
+          />
+        </div>
+        <div style="padding: 10px 30px" class="center-class">
+          <div
+            style="font-size: 16px; color: rgb(132, 151, 176); font-weight: 700"
+          >
+            {{ pdfData.buyCorporationName }}
+          </div>
+          <div>
+            Add:
+            {{ pdfData.buyAddress }} , {{ pdfData.buyCityName }} ,
+            {{ pdfData.buyProvinceName }} , {{ pdfData.buyCountryName }} ,
+            {{ pdfData.buyPostalCode }}
+          </div>
+          <div>
+            TEL: {{ pdfData.buyContactNumber }}
+            <span style="margin: 0 10px">FAX:0591-38165700</span>
+            WEB:https://www.bridgestylefurnishings.com/
+          </div>
+        </div>
+      </div>
+      <div
+        style="margin-top: 30px; font-size: 16px; font-weight: 700"
+        class="center-class"
+      >
+        采购合同
+      </div>
+      <div style="margin: 10px 0px 20px 0px" class="center-class">
+        {{ pdfData.code }}
+      </div>
+      <div style="display: flex; justify-content: space-between">
+        <div>
+          甲方: <br />
+          公司名称:{{ pdfData.buyCorporationName }}<br />
+          联系人:{{ pdfData.buyContactName }} <br />
+          电话:{{ pdfData.buyContactNumber }}
+        </div>
+        <div>
+          乙方: <br />
+          公司名称:{{ pdfData.sellCorporationName }} <br />
+          联系人:{{ pdfData.sellContactName }}<br />
+          电话:{{ pdfData.sellContactNumber }}
+        </div>
+      </div>
+      <table border="1" style="width: 100%" class="table">
+        <tr>
+          <td style="width: 15%" class="center-class">产品图片</td>
+          <td style="width: 20%" class="center-class">LOGO图</td>
+          <td style="width: 15%" class="center-class">产品名称</td>
+          <td style="width: 13%" class="center-class">尺寸cm</td>
+          <td style="width: 12%" class="center-class">数量</td>
+          <td style="width: 13%" class="center-class">单价</td>
+          <td style="width: 12%" class="center-class">总价</td>
+        </tr>
+        <template
+          v-if="
+            pdfData.ehsdPurchaseProductList &&
+            pdfData.ehsdPurchaseProductList.length > 0
+          "
+        >
+          <tr v-for="item in pdfData.ehsdPurchaseProductList" :key="item.id">
+            <td style="width: 15%" class="center-class">
+              <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%" class="center-class"></td>
+            <td style="width: 15%" class="center-class">
+              {{ item.productName }}
+            </td>
+            <td style="width: 13%" class="center-class">
+              {{ item.productModel }}
+            </td>
+            <td style="width: 12%" class="center-class">
+              {{ item.quantity }}
+            </td>
+            <td style="width: 13%" class="center-class">
+              {{ pdfData.currency }} {{ item.price }}
+            </td>
+            <td style="width: 12%" class="center-class">
+              {{ pdfData.currency }} {{ moneyFormat(item.amount, 2) }}
+            </td>
+          </tr>
+        </template>
+
+        <tr>
+          <td colspan="6">合计:</td>
+          <td class="center-class">
+            {{ pdfData.currency }} {{ moneyFormat(pdfData.amount, 2) }}
+          </td>
+        </tr>
+        <tr>
+          <td colspan="7">大写: {{ NumberToChinese(pdfData.amount) }}</td>
+        </tr>
+        <tr>
+          <td>乙方收款账户:</td>
+          <td colspan="6">
+            银行: {{ pdfData.openingBank }}<br />
+            账户名: {{ pdfData.openingName }}<br />
+            联系人: {{ pdfData.contactPerson }}<br />
+            账户: {{ pdfData.accountOpening }}
+          </td>
+        </tr>
+        <tr>
+          <td>收货地址:</td>
+          <td colspan="6">
+            {{ pdfData.buyProvinceName }} , {{ pdfData.buyCityName }} ,
+            {{ pdfData.buyAddress }} ,
+            {{ pdfData.buyPostalCode }}
+            <br />
+            {{ pdfData.buyContactName }} {{ pdfData.buyContactNumber }}
+          </td>
+        </tr>
+        <tr>
+          <td>交货时间:</td>
+          <td colspan="6">{{ pdfData.deliveryTime }}</td>
+        </tr>
+        <tr>
+          <td>付款方式:</td>
+          <td colspan="6">
+            {{ dictValueLabel(pdfData.paymentMethod, fundsPaymentMethod) }}
+          </td>
+        </tr>
+        <tr>
+          <td colspan="7">
+            <div v-html="getHtml(pdfData.remark)"></div>
+          </td>
+        </tr>
+        <tr>
+          <td colspan="3">
+            甲方:<br />
+            {{ pdfData.buyCorporationName }}
+          </td>
+          <td colspan="4">
+            乙方:<br />
+            {{ pdfData.sellCorporationName }}
+          </td>
+        </tr>
+      </table>
+      <div
+        v-if="
+          pdfData.ehsdPurchaseProductList &&
+          pdfData.ehsdPurchaseProductList.length > 0
+        "
+      >
+        <div
+          class="border-class"
+          v-for="item in pdfData.ehsdPurchaseProductList"
+          :key="item.id"
+        >
+          <div
+            style="border-bottom: 1px solid #000; padding: 2px 5px"
+            class="center-class"
+          >
+            {{ item.productName }}
+          </div>
+          <div style="padding: 2px 5px; min-height: 22px">
+            <div v-html="getHtml(item.remark)"></div>
+          </div>
+        </div>
+      </div>
+      <!-- 出货 -->
+      <div style="height: 20px"></div>
+      <table border="1" style="width: 100%" class="table">
+        <tr>
+          <td class="center-class">出货时间</td>
+          <td class="center-class">产品名称</td>
+          <td class="center-class">出货数量</td>
+        </tr>
+        <template
+          v-if="
+            pdfData.packDetailProductList &&
+            pdfData.packDetailProductList.length > 0
+          "
+        >
+          <tr v-for="item in pdfData.packDetailProductList" :key="item.id">
+            <td>{{ item.shipmentTime }}</td>
+            <td>{{ item.productName }}</td>
+            <td>{{ item.quantity }}</td>
+          </tr>
+        </template>
+      </table>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { NumberToChinese } from "@/utils/util.js";
+const { proxy } = getCurrentInstance();
+const pdfData = ref({});
+const props = defineProps({
+  rowData: Object,
+});
+const fundsPaymentMethod = ref([]);
+proxy.getDictOne(["unit", "funds_payment_method"]).then((res) => {
+  fundsPaymentMethod.value = res["funds_payment_method"].map((x) => ({
+    label: x.dictValue,
+    value: x.dictKey,
+  }));
+});
+
+const getHtml = (str) => {
+  if (str) {
+    let newStr = str.replace(/<p\b/gi, "<div"); // 使用正则表达式替换<p>为<div
+    return newStr.replace(/<\/p>/gi, "</div>"); // 使用正则表达式替换</p>为</div>
+  }
+};
+
+const handlePrintPdf = (row) => {
+  proxy.post("/ehsdPurchase/detail", { id: row.id }).then((res) => {
+    pdfData.value = res;
+    // 拿去多公司配置的logo图
+    if (pdfData.value.buyCorporationId) {
+      proxy
+        .post("/fileInfo/getList", {
+          businessIdList: [pdfData.value.buyCorporationId],
+          fileType: 1,
+        })
+        .then((fileObj) => {
+          pdfData.value.companyPic =
+            fileObj[pdfData.value.buyCorporationId][0].fileUrl;
+        });
+    }
+    // 拿取产品图
+    if (
+      pdfData.value.ehsdPurchaseProductList &&
+      pdfData.value.ehsdPurchaseProductList.length > 0
+    ) {
+      let arr = pdfData.value.ehsdPurchaseProductList.map((x) => x.productId);
+      proxy
+        .post("/fileInfo/getList", {
+          businessIdList: arr,
+        })
+        .then((fileObj) => {
+          for (
+            let i = 0;
+            i < pdfData.value.ehsdPurchaseProductList.length;
+            i++
+          ) {
+            const e = pdfData.value.ehsdPurchaseProductList[i];
+            for (const key in fileObj) {
+              if (e.productId === key) {
+                e.fileList = fileObj[key];
+              }
+            }
+          }
+        });
+    }
+  });
+};
+
+if (props.rowData && props.rowData.id) {
+  handlePrintPdf(props.rowData);
+}
+
+watch(
+  () => props.rowData.id,
+  (val) => {
+    if (props.rowData && props.rowData.id) {
+      handlePrintPdf(props.rowData);
+    }
+  }
+);
+</script>
+
+<style lang="scss" scoped>
+#pdfDom {
+  font-size: 13px;
+  padding: 30px 60px;
+}
+.center-class {
+  text-align: center;
+}
+.border-class {
+  margin-top: 20px;
+  border: 1px solid #000;
+}
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+  td {
+    padding: 2px 5px;
+    text-align: left;
+  }
+  .center-class {
+    text-align: center;
+  }
+}
+</style>

+ 1 - 1
src/components/process/EHSD/PriceSheet.vue

@@ -643,7 +643,7 @@ const openProductCompany = ref(false);
 const openProductCustomer = ref(false);
 const openProductCustomer = ref(false);
 const formData = reactive({
 const formData = reactive({
   data: {
   data: {
-    currency: "¥",
+    currency: "",
     amount: undefined,
     amount: undefined,
     quotationProductList: [],
     quotationProductList: [],
     quotationPayList: [],
     quotationPayList: [],

+ 1 - 1
src/components/process/EHSD/Purchase.vue

@@ -917,7 +917,7 @@ const rules = ref({
     { required: true, message: "请选择付款方式", trigger: "change" },
     { required: true, message: "请选择付款方式", trigger: "change" },
   ],
   ],
   invoiceType: [
   invoiceType: [
-    { required: true, message: "请选择付款方式", trigger: "change" },
+    { required: true, message: "请选择发票类型", trigger: "change" },
   ],
   ],
   contractTemplateId: [
   contractTemplateId: [
     { required: true, message: "请选择合同模板", trigger: "change" },
     { required: true, message: "请选择合同模板", trigger: "change" },

+ 86 - 23
src/views/EHSD/procurement/purchasedEHSD/index.vue

@@ -7,7 +7,16 @@
       :loading="loading"
       :loading="loading"
       :selectConfig="selectConfig"
       :selectConfig="selectConfig"
       highlight-current-row
       highlight-current-row
-      @get-list="getList">
+      @get-list="getList"
+    >
+      <template #code="{ item }">
+        <div
+          style="cursor: pointer; color: #409eff"
+          @click="handleClickCode(item)"
+        >
+          {{ item.code }}
+        </div>
+      </template>
       <template #amount="{ item }">
       <template #amount="{ item }">
         <div>
         <div>
           <span style="padding-right: 4px">{{ item.currency }}</span>
           <span style="padding-right: 4px">{{ item.currency }}</span>
@@ -15,6 +24,18 @@
         </div>
         </div>
       </template>
       </template>
     </byTable>
     </byTable>
+    <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="900px">
+      <PurchasePDFOne :rowData="rowData"></PurchasePDFOne>
+      <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
+        >
+      </template>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -22,6 +43,7 @@
 import { computed, ref } from "vue";
 import { computed, ref } from "vue";
 import byTable from "@/components/byTable/index";
 import byTable from "@/components/byTable/index";
 import { ElMessage, ElMessageBox } from "element-plus";
 import { ElMessage, ElMessageBox } from "element-plus";
+import PurchasePDFOne from "@/components/PDF/purchasePDFOne.vue";
 
 
 const { proxy } = getCurrentInstance();
 const { proxy } = getCurrentInstance();
 const supplierList = ref([]);
 const supplierList = ref([]);
@@ -96,7 +118,7 @@ const config = computed(() => {
     {
     {
       attrs: {
       attrs: {
         label: "采购单号",
         label: "采购单号",
-        prop: "code",
+        slot: "code",
         width: 180,
         width: 180,
       },
       },
     },
     },
@@ -175,7 +197,7 @@ const config = computed(() => {
             },
             },
             el: "button",
             el: "button",
             click() {
             click() {
-              clickPrint(row);
+              handlePrintPdf(row);
             },
             },
           },
           },
           row.status == 30
           row.status == 30
@@ -187,11 +209,15 @@ const config = computed(() => {
                 },
                 },
                 el: "button",
                 el: "button",
                 click() {
                 click() {
-                  ElMessageBox.confirm("此操作将作废该数据, 是否继续?", "提示", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  }).then(() => {
+                  ElMessageBox.confirm(
+                    "此操作将作废该数据, 是否继续?",
+                    "提示",
+                    {
+                      confirmButtonText: "确定",
+                      cancelButtonText: "取消",
+                      type: "warning",
+                    }
+                  ).then(() => {
                     proxy
                     proxy
                       .post("/ehsdPurchase/edit", {
                       .post("/ehsdPurchase/edit", {
                         id: row.id,
                         id: row.id,
@@ -217,11 +243,15 @@ const config = computed(() => {
                 },
                 },
                 el: "button",
                 el: "button",
                 click() {
                 click() {
-                  ElMessageBox.confirm("此操作将终止该数据, 是否继续?", "提示", {
-                    confirmButtonText: "确定",
-                    cancelButtonText: "取消",
-                    type: "warning",
-                  }).then(() => {
+                  ElMessageBox.confirm(
+                    "此操作将终止该数据, 是否继续?",
+                    "提示",
+                    {
+                      confirmButtonText: "确定",
+                      cancelButtonText: "取消",
+                      type: "warning",
+                    }
+                  ).then(() => {
                     proxy
                     proxy
                       .post("/ehsdPurchase/edit", {
                       .post("/ehsdPurchase/edit", {
                         id: row.id,
                         id: row.id,
@@ -244,15 +274,17 @@ const config = computed(() => {
   ];
   ];
 });
 });
 const getDict = () => {
 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,
-      };
+  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) => {
 const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
@@ -268,8 +300,39 @@ const getList = async (req) => {
 };
 };
 getDict();
 getDict();
 getList();
 getList();
-const clickPrint = (row) => {
-  console.log(row, "打印");
+
+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) => {
+  proxy.$router.push({
+    path: "/platform_manage/process/processApproval",
+    query: {
+      flowKey: row.processInstanceId,
+      id: row.flowId,
+      processType: 20,
+    },
+  });
 };
 };
 </script>
 </script>
 
 

+ 1 - 1
src/views/process/processApproval/index.vue

@@ -583,7 +583,7 @@ const skipPage = () => {
     } else if (flowForm.flowKey == "sale_quotation_flow") {
     } else if (flowForm.flowKey == "sale_quotation_flow") {
       if (flowForm.tenantType === "EHSD") {
       if (flowForm.tenantType === "EHSD") {
         router.replace({
         router.replace({
-          path: "/EHSD/saleContract/priceSheetEHSD",
+          path: "/ehsd/saleContract/quotation",
         });
         });
       } else {
       } else {
         router.replace({
         router.replace({

+ 0 - 36
src/views/purchaseManage/purchaseManage/alreadyPurchase/index.vue

@@ -897,42 +897,6 @@ const handlePrintPdf = (row) => {
     code: row.code,
     code: row.code,
   };
   };
   openPdf.value = true;
   openPdf.value = true;
-  // proxy.post("/purchase/detail", { id: row.id }).then((res) => {
-  //   proxy
-  //     .post("/supplierInfo/detail", { id: res.supplyId })
-  //     .then((supplyData) => {
-  //       res.contactPerson = supplyData.contactPerson;
-  //       res.contactNumber = supplyData.contactNumber;
-  //       res.openingBank = supplyData.openingBank;
-  //       res.accountOpening = supplyData.accountOpening;
-  //       let countTotal = 0;
-  //       let productMoney = 0;
-  //       for (let i = 0; i < res.purchaseDetailList.length; i++) {
-  //         const e = res.purchaseDetailList[i];
-  //         e.productUnitName = proxy.dictValueLabel(
-  //           e.productUnit,
-  //           productUnit.value
-  //         );
-  //         countTotal += Number(e.count);
-  //         productMoney += Number(e.amount);
-  //       }
-  //       res.countTotal = countTotal;
-  //       res.productMoney = productMoney;
-  //       res.otherMoney = res.amount - res.productMoney;
-  //       res.moneyChinese = NumberToChinese(res.amount);
-  //       res.supplyAddress = {
-  //         countryName: supplyData.countryName,
-  //         provinceName: supplyData.provinceName,
-  //         cityName: supplyData.cityName,
-  //         areaDetail: supplyData.areaDetail,
-  //       };
-  //       if (res.approvedDate) {
-  //         res.approvedDate = res.approvedDate.slice(0, 10);
-  //       }
-  //       pdfData.value = res;
-  //       openPdf.value = true;
-  //     });
-  // });
 };
 };
 const clickDownload = () => {
 const clickDownload = () => {
   proxy.getPdf("购销合同" + rowData.value.code);
   proxy.getPdf("购销合同" + rowData.value.code);

File diff suppressed because it is too large
+ 652 - 177
src/views/salesMange/shipmentMange/document/index.vue


Some files were not shown because too many files changed in this diff