cz 1 год назад
Родитель
Сommit
3fce1e61ba

+ 10 - 3
src/components/PDF/contractPDF.vue

@@ -165,7 +165,8 @@
               Beneficiary Account Number:
               {{ printDetails.beneficiaryAccountNumber }}
             </div>
-            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{ printDetails.swiftCode }}</div>
+            <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">Swift Code: {{ printDetails.swiftCode }}
+            </div>
             <div style="line-height: 24px; padding-left: 4px; word-break: break-all; word-wrap: break-word">
               Beneficiary Address: {{ printDetails.beneficiaryAddress }}
             </div>
@@ -202,7 +203,10 @@ const getPdfData = (query) => {
 };
 const statistics = (label, index) => {
   let num = 0;
-  if (printDetails.value.productInfoList && printDetails.value.productInfoList.length > 0) {
+  if (
+    printDetails.value.productInfoList &&
+    printDetails.value.productInfoList.length > 0
+  ) {
     printDetails.value.productInfoList.map((item) => {
       if (item[label]) {
         num = parseFloat(Number(num) + Number(item[label])).toFixed(index);
@@ -213,7 +217,10 @@ const statistics = (label, index) => {
 };
 const statisticsTwo = (label, index) => {
   let num = 0;
-  if (printDetails.value.contractProjectList && printDetails.value.contractProjectList.length > 0) {
+  if (
+    printDetails.value.contractProjectList &&
+    printDetails.value.contractProjectList.length > 0
+  ) {
     printDetails.value.contractProjectList.map((item) => {
       if (item[label]) {
         num = parseFloat(Number(num) + Number(item[label])).toFixed(index);

+ 214 - 123
src/components/PDF/contractPDFOne.vue

@@ -1,7 +1,6 @@
 <template>
   <div>
-    <div id="pdfDom" ref="pdfDom" style="padding: 30px 60px;color:#000; text-align: center;" v-loading="loading">
-
+    <div id="pdfDom" ref="pdfDom" style="padding: 0px 20px; text-align: center;font-size:12px;color:#333333" v-loading="loading">
       <div class="title">
         福建三梵体育用品实业有限公司
       </div>
@@ -9,46 +8,46 @@
         <div class="vertical-bar"></div>
         <div class="content">销售订单</div>
       </div>
-      <div style="display:flex;">
-        <div style="width:50%">
+      <div style="display:flex;margin-bottom:0px; font-weight: 600;">
+        <div style="width:50%;padding-right:20px">
           <div class="row">
             <div class="left">
               需方:
             </div>
-            <div>
-
+            <div class="right">
+              {{pdfData.buyCorporationName}}
             </div>
           </div>
           <div class="row">
             <div class="left">
               需方名称:
             </div>
-            <div>
-
+            <div class="right">
+              {{pdfData.buyCorporationName}}
             </div>
           </div>
           <div class="row">
             <div class="left">
               联系人:
             </div>
-            <div>
-
+            <div class="right">
+              {{pdfData.buyContactName}}
             </div>
           </div>
           <div class="row">
             <div class="left">
               联系电话:
             </div>
-            <div>
-
+            <div class="right">
+              {{pdfData.buyContactNumber}}
             </div>
           </div>
           <div class="row">
             <div class="left">
               传真:
             </div>
-            <div>
-
+            <div class="right">
+              {{pdfData.buyCorporationFax}}
             </div>
           </div>
         </div>
@@ -57,40 +56,43 @@
             <div class="left">
               订单编号:
             </div>
-            <div>
-
+            <div class="right">
+              {{pdfData.contractCode}}
             </div>
           </div>
           <div class="row">
             <div class="left">
               下单日期:
             </div>
-            <div>
-
+            <div v-if="pdfData.createTime" class="right">
+              {{pdfData.createTime.substr(0,10)}} &nbsp;&nbsp;{{calculationWeek(pdfData.createTime)}}
             </div>
           </div>
           <div class="row">
             <div class="left">
               结算方式:
             </div>
-            <div>
-
+            <div class="right">
+              {{dictKeyValue(pdfData.paymentMethod,fundsPaymentMethod)}}
             </div>
           </div>
           <div class="row">
             <div class="left">
               业务员/联系电话:
             </div>
-            <div>
-
+            <div class="right">
+              {{pdfData.createUserName}} / {{pdfData.createUserPhone}}
             </div>
           </div>
           <div class="row">
             <div class="left">
               送货地址:
             </div>
-            <div>
-
+            <div class="right">
+              <span v-if="pdfData.buyCountryName">{{pdfData.buyCountryName}},</span>
+              <span v-if="pdfData.buyProvinceName">{{pdfData.buyProvinceName}},</span>
+              <span v-if="pdfData.buyCityName">{{pdfData.buyCityName}},</span>
+              <span v-if="pdfData.buyDetailedAddress">{{pdfData.buyDetailedAddress}}</span>
             </div>
           </div>
 
@@ -111,130 +113,152 @@
           <td>备注</td>
         </tr>
 
-        <tr v-if="pdfData.productInfoList && pdfData.productInfoList.length > 0" v-for="(item, index) in pdfData.productInfoList"
-            :key="item.productId">
-
+        <tr v-if="pdfData.productInfoList && pdfData.productInfoList.length > 0" v-for="(item, index) in pdfData.productInfoList" :key="item.id">
+          <td>{{index+1}}</td>
+          <td>{{item.productName}}</td>
+          <td>{{item.productLength }}*{{item.productWidth}}*{{item.productHeight}}</td>
+          <td>{{dictKeyValue(item.frontalTexture,frontLinesData)}}</td>
+          <td>{{item.productColor}}</td>
+          <td>{{dictKeyValue(item.productUnit,materialUnitData)}}</td>
+          <td>{{moneyFormat(item.productQuantity)}}</td>
+          <td>{{moneyFormat(item.productPrice)}}</td>
+          <td>{{moneyFormat(item.amount)}}</td>
+          <td>{{item.productRemark}}</td>
         </tr>
         <template v-if="
             pdfData.contractProjectList &&
             pdfData.contractProjectList.length > 0
           ">
-          <tr>
-            <td colspan="6" style="text-align: right">
-              <div v-for="(item, index) in pdfData.contractProjectList" :key="item.id">
-                {{ item.payName }}:
-              </div>
+          <tr v-for="(item, index) in pdfData.contractProjectList" :key="item.id">
+            <td colspan="8" style="text-align: right">
+              {{ item.payName }}:
             </td>
-            <td>
-              <div v-for="(item, index) in pdfData.contractProjectList" :key="item.id">
-                {{ pdfData.currency }}
-                {{ moneyFormat(item.amount, 2) }}
-              </div>
+            <td colspan="2">
+              {{ moneyFormat(item.amount, 2) }}
             </td>
           </tr>
         </template>
-
+        <tr>
+          <td colspan="8" style="text-align: right">
+            合同总金额:
+          </td>
+          <td colspan="2">
+            {{ moneyFormat(pdfData.totalAmount, 2) }}
+          </td>
+        </tr>
       </table>
+      <div style="margin-top:20px;text-align:left">
+        <!-- <div v-html="getHtmlVal(pdfData.templateContent)">
+        </div> -->
+        <div v-html="pdfData.templateContent"></div>
+      </div>
+      <div style="display:flex;margin-top:40px">
+        <div style="width:50%">
+          <div class="rowOne">
+            <div class="left">
+              需方签字并盖章:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              经办人:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              主管:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              日期:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+        </div>
+        <div style="width:50%">
+          <div class="rowOne">
+            <div class="left">
+              供方签字并盖章:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              经办人:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              主管:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              日期:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div style="text-align: center;margin-top:20px">
+      <el-button type="primary" v-print="printObj" size="default" v-debounce>打印</el-button>
+      <el-button type="primary" @click="clickDownload()" size="default" v-debounce>下载PDF</el-button>
+      <!-- <el-button type="primary" @click="exportExcel()" size="default" v-debounce>导出Excel</el-button> -->
     </div>
   </div>
 </template>
 
 <script setup>
 import { NumberToChinese } from "@/utils/util.js";
-import { async } from "@antv/x6/lib/registry/marker/main";
-import { watch } from "vue";
+import { calculationWeek } from "@/utils/util.js";
+import $ from "jquery";
 const { proxy } = getCurrentInstance();
 const pdfData = ref({});
 const props = defineProps({
   rowData: Object,
 });
+const materialUnitData = computed(
+  () => proxy.useUserStore().allDict["material_unit"]
+);
+const frontLinesData = computed(
+  () => proxy.useUserStore().allDict["front_lines"]
+);
+const fundsPaymentMethod = computed(
+  () => proxy.useUserStore().allDict["funds_payment_method"]
+);
 const loading = ref(false);
 const getPdfData = (query) => {
   loading.value = true;
   proxy.post("/contract/getContractPdfInfo", query).then((res) => {
     pdfData.value = res;
-    if (pdfData.value.advanceRatio) {
-      pdfData.value.advanceRatio = parseFloat(
-        pdfData.value.advanceRatio
-      ).toFixed(2);
-      pdfData.value.advanceRatioOne = (
-        100 - Number(pdfData.value.advanceRatio)
-      ).toFixed(2);
-    }
-    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;
-            });
-        });
-      proxy
-        .post("/fileInfo/getList", {
-          businessIdList: [pdfData.value.sellCorporationId],
-          fileType: 4,
-        })
-        .then((fileObj) => {
-          proxy
-            .getImgBase64(fileObj[pdfData.value.sellCorporationId][0].fileUrl)
-            .then((res) => {
-              pdfData.value.companySeal = 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];
-                }
-              }
-            }
-          }
-        });
-    }
   });
 };
 const productUnit = ref([]);
 const tradeMethods = ref([]);
-const shippingMethod = ref([]);
-const getDict = () => {
-  proxy.getDictOne(["trade_mode", "shipping_method", "unit"]).then((res) => {
-    tradeMethods.value = res["trade_mode"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-    shippingMethod.value = res["shipping_method"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-    productUnit.value = res["unit"].map((x) => ({
-      label: x.dictValue,
-      value: x.dictKey,
-    }));
-  });
-};
-getDict();
 const getBalance = (val) => {
   if (val) {
     return proxy.moneyFormat(
@@ -243,13 +267,18 @@ const getBalance = (val) => {
     );
   }
 };
+const getHtmlVal = (val) => {
+  if (val) {
+    return val.replace(/<p>/g, "<div>").replace(/<\/p>/g, "</div>");
+  }
+  return "";
+};
+
 watch(
   () => props.rowData,
   (val) => {
     if (props.rowData.id) {
       getPdfData({ id: props.rowData.id });
-    } else if (props.rowData.code) {
-      getPdfData({ code: props.rowData.code });
     }
   },
   {
@@ -257,37 +286,99 @@ watch(
     deep: true,
   }
 );
+
+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 clickDownload = () => {
+  proxy.getPdf("销售订单PDF文件");
+};
+
+const pdfDom = ref(null);
+const exportExcel = () => {
+  // pdfDom.value.exportExcel();
+  // isShowImg.value = false;
+  loading.value = true;
+  setTimeout(() => {
+    $("#pdfDom").table2excel({
+      exclude: ".noExl",
+      sheetName: `销售订单${pdfData.value.code}`,
+      filename: `销售订单${pdfData.value.code}`,
+      exclude_img: false,
+      exclude_links: false,
+      exclude_inputs: true,
+    });
+    // isShowImg.value = true;
+    loading.value = false;
+  }, 500);
+};
 </script>
 
 <style lang="scss" scoped>
 .title {
-  font-size: 32px;
+  font-size: 28px;
   // font-weight: 700;
   text-align: center;
 }
 .title-info {
   text-align: center;
   width: 100%;
-  margin: 30px 0;
+  margin: 20px 0 50px 0;
   .vertical-bar {
     width: 6px;
     height: 18px;
     background-color: #0084ff;
+    // background-color: #000;
     margin-right: 9px;
     display: inline-block;
   }
   .content {
     // font-weight: 600;
-    font-size: 26px;
+    font-size: 32px;
     color: #333333;
     display: inline-block;
   }
 }
 .row {
   display: flex;
-  line-height: 28px;
+  // line-height: 28px;
   .left {
     width: 120px;
+    text-align: justify;
+    display: inline-block;
+    &::after {
+      content: "";
+      display: inline-block;
+      width: 100%;
+    }
+  }
+  .right {
+    width: calc(100% - 120px);
+    text-align: left;
+    line-height: 18px;
+  }
+}
+.rowOne {
+  display: flex;
+  line-height: 32px;
+  .left {
+    width: 120px;
+    text-align: left;
+    // text-align: justify;
+    // display: inline-block;
+    // &::after {
+    //   content: "";
+    //   display: inline-block;
+    //   width: 100%;
+    // }
+  }
+  .right {
+    width: calc(100% - 120px);
     text-align: left;
   }
 }

+ 348 - 239
src/components/PDF/purchasePDF.vue

@@ -1,289 +1,398 @@
 <template>
   <div>
-    <div id="pdfDom" ref="pdfDom" style="width: 776px">
-      <div style="border: 1px solid #000; border-collapse: collapse">
-        <div style="text-align: right; padding: 10px 10px 0 0">
-          合同号:{{ pdfData.code }}
-        </div>
-        <div class="title">购销合同</div>
-        <div style="display: flex">
-          <div style="display: flex; width: 50%" class="padding-10px">
-            <div style="width: 60px">买方:</div>
-            <div style="width: calc(100% - 60px)">
-              <div>福建宏星电子科技有限公司</div>
-              <div class="margin-top-5px">
-                福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
-              </div>
+    <div id="pdfDom" ref="pdfDom" style="padding: 0px 20px; text-align: center;font-size:12px;color:#333333" v-loading="loading">
+      <div class="title">
+        福建三梵体育用品实业有限公司
+      </div>
+      <div class="title-info">
+        <div class="vertical-bar"></div>
+        <div class="content">采购订单</div>
+      </div>
+      <div style="display:flex;margin-bottom:0px; font-weight: 600;">
+        <div style="width:50%;padding-right:20px">
+          <div class="row">
+            <div class="left">
+              供应商:
+            </div>
+            <div class="right">
+              {{pdfData.sellCorporationName}}
             </div>
           </div>
-          <div style="display: flex; width: 50%" class="padding-10px">
-            <div style="width: 60px">卖方:</div>
-            <div style="width: calc(100% - 60px)">
-              {{ pdfData.supplyName }}
+          <div class="row">
+            <div class="left">
+              供应商名称:
+            </div>
+            <div class="right">
+              {{pdfData.sellCorporationName}}
             </div>
           </div>
-        </div>
-        <div style="display: flex" class="margin-top-5px">
-          <div style="display: flex; width: 50%" class="padding-10px">
-            <div style="width: 60px">经手人:</div>
-            <div style="width: calc(100% - 60px)">
-              {{ pdfData.purchaseName }}
+          <div class="row">
+            <div class="left">
+              联系人:
+            </div>
+            <div class="right">
+              {{pdfData.sellContactName}}
             </div>
           </div>
-          <div style="display: flex; width: 50%" class="padding-10px">
-            <div style="width: 60px">经手人:</div>
-            <div style="width: calc(100% - 60px)">
-              {{ pdfData.contactPerson }}
+          <div class="row">
+            <div class="left">
+              联系电话:
+            </div>
+            <div class="right">
+              {{pdfData.sellContactNumber}}
+            </div>
+          </div>
+          <div class="row">
+            <div class="left">
+              传真:
+            </div>
+            <div class="right">
+              {{pdfData.sellCorporationFax}}
             </div>
           </div>
         </div>
-        <div class="padding-10px margin-top-5px">
-          买卖双方经协商,一致同意签订以下合同
-        </div>
-        <div class="padding-10px margin-top-5px" style="padding-bottom: 10px">
-          货物名称、规格型号、单位、数量、单价及金额:
+        <div style="width:50%">
+          <div class="row">
+            <div class="left">
+              订单编号:
+            </div>
+            <div class="right">
+              {{pdfData.code}}
+            </div>
+          </div>
+          <div class="row">
+            <div class="left">
+              下单日期:
+            </div>
+            <div v-if="pdfData.createTime" class="right">
+              {{pdfData.createTime.substr(0,10)}} &nbsp;&nbsp;{{calculationWeek(pdfData.createTime)}}
+            </div>
+          </div>
+          <div class="row">
+            <div class="left">
+              付款方式:
+            </div>
+            <div class="right">
+              {{dictKeyValue(pdfData.paymentMethod,fundsPaymentMethod)}}
+            </div>
+          </div>
+          <div class="row">
+            <div class="left">
+              采购员/联系电话:
+            </div>
+            <div class="right">
+              {{pdfData.createUserName}} / {{pdfData.createUserPhone}}
+            </div>
+          </div>
+          <div class="row">
+            <div class="left">
+              送货地址:
+            </div>
+            <div class="right">
+              <span v-if="pdfData.sellCountryName">{{pdfData.sellCountryName}},</span>
+              <span v-if="pdfData.sellProvinceName">{{pdfData.sellProvinceName}},</span>
+              <span v-if="pdfData.sellCityName">{{pdfData.sellCityName}},</span>
+              <span v-if="pdfData.buyDetailedAddress">{{pdfData.buyDetailedAddress}}</span>
+            </div>
+          </div>
+
         </div>
-        <table border="1" style="width: 100%" class="table">
-          <tr>
-            <td style="width: 70px">序号</td>
-            <td>品名</td>
-            <td>规格型号</td>
-            <td style="width: 60px">单位</td>
-            <td style="width: 60px">数量</td>
-            <td style="width: 100px">单价</td>
-            <td style="width: 100px">金额</td>
-          </tr>
-          <tr v-for="(row, index) in pdfData.purchaseDetailList" :key="row.id">
-            <td style="width: 70px">{{ index + 1 }}</td>
-            <td>{{ row.productName }}</td>
-            <td>{{ row.productSpec }}</td>
-            <td style="width: 60px">{{ row.productUnitName }}</td>
-            <td style="width: 60px">{{ row.count }}</td>
-            <td style="width: 100px">
-              <span v-if="pdfData.currency">{{ pdfData.currency }}</span
-              >{{ row.price }}
-            </td>
-            <td style="width: 100px">
-              <span v-if="pdfData.currency">{{ pdfData.currency }}</span
-              >{{ row.amount }}
-            </td>
-          </tr>
-          <tr>
-            <td colspan="4" style="text-align: right">其他收费项目</td>
-            <td></td>
-            <td></td>
-            <td>
-              <span v-if="pdfData.currency">{{ pdfData.currency }}</span
-              >{{ pdfData.otherMoney }}
-            </td>
-          </tr>
-          <tr>
-            <td colspan="4" style="text-align: right">合计</td>
-            <td>{{ pdfData.countTotal }}</td>
-            <td></td>
-            <td>
-              <span v-if="pdfData.currency">{{ pdfData.currency }}</span
-              >{{ pdfData.amount }}
-            </td>
-          </tr>
-          <tr>
-            <td colspan="7" style="text-align: left">
-              合计人民币金额(大写):{{ pdfData.moneyChinese }}
-            </td>
-          </tr>
-          <tr>
-            <td>交货地点</td>
-            <td colspan="6" style="text-align: left">
-              福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
+      </div>
+
+      <table border="1" style="width: 100%" class="table">
+        <tr>
+          <td style="width:7%">序号</td>
+          <!-- <td style="width:12%">销售订单号</td> -->
+          <td style="width:10%">物料编码</td>
+          <td style="width:28%">物料名称</td>
+          <td style="width:10%">规格型号</td>
+          <td style="width:7%"> 颜色</td>
+          <td style="width:7%">单位</td>
+          <td style="width:7%">数量</td>
+          <td style="width:7%">单价</td>
+          <td style="width:7%">金额</td>
+          <td style="width:10%">备注</td>
+        </tr>
+        <tr v-if="pdfData.purchaseProductList && pdfData.purchaseProductList.length > 0" v-for="(item, index) in pdfData.purchaseProductList"
+            :key="item.id">
+          <td>{{index+1}}</td>
+          <!-- <td>{{pdfData.code}}</td> -->
+          <td>{{item.productCode}}</td>
+          <td>{{item.productName}}</td>
+          <td>{{item.productLength }}*{{item.productWidth}}*{{item.productHeight}}</td>
+          <!-- <td>{{dictKeyValue(item.frontalTexture,frontLinesData)}}</td> -->
+          <td>{{item.productColor}}</td>
+          <td>{{dictKeyValue(item.productUnit,materialUnitData)}}</td>
+          <td>{{moneyFormat(item.quantity)}}</td>
+          <td>{{moneyFormat(item.price)}}</td>
+          <td>{{moneyFormat(item.amount)}}</td>
+          <td>{{item.remark}}</td>
+        </tr>
+        <template v-if="
+            pdfData.purchaseProjectList &&
+            pdfData.purchaseProjectList.length > 0
+          ">
+          <tr v-for="(item, index) in pdfData.purchaseProjectList" :key="item.id">
+            <td colspan="8" style="text-align: right">
+              {{ item.payName }}:
             </td>
-          </tr>
-          <!-- <tr>
-              <td>交货时间:</td>
-              <td colspan="6" style="text-align: left"></td>
-            </tr> -->
-          <tr>
-            <td>保修期</td>
-            <td colspan="6" style="text-align: left">一年</td>
-          </tr>
-          <tr>
-            <td colspan="7" style="text-align: left; padding: 10px">
-              <div>一、交货地点:福州软件园A区28座5层。</div>
-              <div class="margin-top-5px">二、运输方式及运费:买方承担。</div>
-              <div class="margin-top-5px">
-                三、质量要求:样品品质、型号、规格、数量如同买方确认上表规格所示,不符合则由卖方承担责任。
-              </div>
-              <div class="margin-top-5px">四、交货时间:2023年4月13日。</div>
-              <div class="margin-top-5px">五、付款方式:银行转账。</div>
-              <div class="margin-top-5px">六、保修期:一年。</div>
-              <div class="margin-top-5px">
-                七、本合同经买卖双方签字盖章后生效,传真件有效。
-              </div>
-              <div class="margin-top-5px">
-                八、解决合同纠纷:原双方另有约定外,均按《中华人民共和国合同法》有关规定处理。
-              </div>
-              <div class="margin-top-5px">九、其他约定事项:友好解决。</div>
+            <td colspan="3">
+              {{ moneyFormat(item.amount, 2) }}
             </td>
           </tr>
-        </table>
-        <div style="display: flex">
-          <div style="width: 50%; padding: 10px">
-            <div>买方:</div>
-            <div class="margin-top-5px">单位名称:福建宏星电子科技有限公司</div>
-            <div class="margin-top-5px">
-              地址:福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
-            </div>
-            <div class="margin-top-5px">电话:</div>
-            <div class="margin-top-5px">传真:</div>
-            <!-- <div style="opacity: 0.1" class="margin-top-5px">|</div> -->
-            <div class="margin-top-5px">代表人签字:</div>
+        </template>
+        <tr>
+          <td colspan="8" style="text-align: right">
+            合同总金额:
+          </td>
+          <td colspan="3">
+            {{ moneyFormat(pdfData.amount, 2) }}
+          </td>
+        </tr>
+      </table>
+      <div style="margin-top:20px;text-align:left">
+        <!-- <div v-html="getHtmlVal(pdfData.remark)">
+        </div> -->
+        <div v-html="pdfData.remark"></div>
+      </div>
+      <div style="display:flex;margin-top:40px">
+        <div style="width:50%">
+          <div class="rowOne">
+            <div class="left">
+              供应商签字并盖章:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              经办人:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              主管:
+            </div>
+            <div class="right">
+
+            </div>
           </div>
-          <div style="width: 50%; padding: 10px">
-            <div>卖方:</div>
-            <div class="margin-top-5px">单位名称:{{ pdfData.supplyName }}</div>
-            <div class="margin-top-5px">统一社会信用代码:</div>
-            <div class="margin-top-5px">
-              开户银行:{{ pdfData.openingBank }}
-            </div>
-            <div class="margin-top-5px">帐号:{{ pdfData.accountOpening }}</div>
-            <div class="margin-top-5px">
-              地址:<span
-                v-if="
-                  pdfData.supplyAddress && pdfData.supplyAddress.countryName
-                "
-                >{{ pdfData.supplyAddress.countryName }}</span
-              >
-              <span
-                v-if="
-                  pdfData.supplyAddress && pdfData.supplyAddress.provinceName
-                "
-                >,{{ pdfData.supplyAddress.provinceName }}</span
-              >
-              <span
-                v-if="pdfData.supplyAddress && pdfData.supplyAddress.cityName"
-                >,{{ pdfData.supplyAddress.cityName }}</span
-              >
-              <span
-                v-if="pdfData.supplyAddress && pdfData.supplyAddress.areaDetail"
-                >,{{ pdfData.supplyAddress.areaDetail }}</span
-              >
-            </div>
-            <div class="margin-top-5px">电话:{{ pdfData.contactNumber }}</div>
-            <div class="margin-top-5px">代表人签字:</div>
+          <div class="rowOne">
+            <div class="left">
+              日期:
+            </div>
+            <div class="right">
+
+            </div>
           </div>
         </div>
-        <div
-          style="padding: 10px; text-align: right; border-top: 1px solid #000"
-        >
-          签订日期:{{ pdfData.approvedDate }}
+        <div style="width:50%">
+          <div class="rowOne">
+            <div class="left">
+              采购签字并盖章:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              经办人:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              主管:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
+          <div class="rowOne">
+            <div class="left">
+              日期:
+            </div>
+            <div class="right">
+
+            </div>
+          </div>
         </div>
       </div>
     </div>
+    <div style="text-align: center;margin-top:20px">
+      <el-button type="primary" v-print="printObj" size="default" v-debounce>打印</el-button>
+      <el-button type="primary" @click="clickDownload()" size="default" v-debounce>下载PDF</el-button>
+      <!-- <el-button type="primary" @click="exportExcel()" size="default" v-debounce>导出Excel</el-button> -->
+    </div>
   </div>
 </template>
 
 <script setup>
 import { NumberToChinese } from "@/utils/util.js";
+import { calculationWeek } from "@/utils/util.js";
+import $ from "jquery";
 const { proxy } = getCurrentInstance();
 const pdfData = ref({});
 const props = defineProps({
   rowData: Object,
 });
-const productUnit = ref([]);
-proxy.getDictOne(["unit"]).then((res) => {
-  productUnit.value = res["unit"].map((x) => ({
-    label: x.dictValue,
-    value: x.dictKey,
-  }));
-});
-const handlePrintPdf = (row) => {
-  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.toFixed(2);
-        res.productMoney = productMoney.toFixed(2);
-        res.otherMoney = (res.amount - res.productMoney).toFixed(2);
-        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;
-      });
+const materialUnitData = computed(
+  () => proxy.useUserStore().allDict["material_unit"]
+);
+const frontLinesData = computed(
+  () => proxy.useUserStore().allDict["front_lines"]
+);
+const fundsPaymentMethod = computed(
+  () => proxy.useUserStore().allDict["funds_payment_method"]
+);
+const loading = ref(false);
+const getPdfData = (query) => {
+  loading.value = true;
+  proxy.post("/ehsdPurchase/detail", query).then((res) => {
+    pdfData.value = res;
+    loading.value = false;
   });
 };
-
-if (props.rowData && props.rowData.id) {
-  handlePrintPdf(props.rowData);
-}
+const productUnit = ref([]);
+const tradeMethods = ref([]);
+const getBalance = (val) => {
+  if (val) {
+    return proxy.moneyFormat(
+      parseFloat(pdfData.value.totalAmount * (val / 100)).toFixed(2),
+      2
+    );
+  }
+};
+const getHtmlVal = (val) => {
+  if (val) {
+    return val.replace(/<p>/g, "<div>").replace(/<\/p>/g, "</div>");
+  }
+  return "";
+};
 
 watch(
-  () => props.rowData.id,
+  () => props.rowData,
   (val) => {
-    if (props.rowData && props.rowData.id) {
-      handlePrintPdf(props.rowData);
+    if (props.rowData.id) {
+      getPdfData({ id: props.rowData.id });
     }
+  },
+  {
+    immediate: true,
+    deep: true,
   }
 );
+
+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 clickDownload = () => {
+  proxy.getPdf("采购订单PDF文件");
+};
+
+const pdfDom = ref(null);
+const exportExcel = () => {
+  // pdfDom.value.exportExcel();
+  // isShowImg.value = false;
+  loading.value = true;
+  setTimeout(() => {
+    $("#pdfDom").table2excel({
+      exclude: ".noExl",
+      sheetName: `销售订单${pdfData.value.code}`,
+      filename: `销售订单${pdfData.value.code}`,
+      exclude_img: false,
+      exclude_links: false,
+      exclude_inputs: true,
+    });
+    // isShowImg.value = true;
+    loading.value = false;
+  }, 500);
+};
 </script>
 
 <style lang="scss" scoped>
-#pdfDom {
-  font-size: 12px;
-  color: #000000;
-  padding: 60px 30px;
-  .title {
-    font-size: 16px;
-    font-weight: 700;
-    margin-top: 10px;
-    margin-bottom: 20px;
-    text-align: center;
+.title {
+  font-size: 28px;
+  // font-weight: 700;
+  text-align: center;
+}
+.title-info {
+  text-align: center;
+  width: 100%;
+  margin: 20px 0 50px 0;
+  .vertical-bar {
+    width: 6px;
+    height: 18px;
+    background-color: #f0ab00;
+    // background-color: #000;
+    margin-right: 9px;
+    display: inline-block;
   }
-  .table {
-    // width: calc(100% + 2px) !important;
-    border-collapse: collapse;
-    border-spacing: 0;
-    // margin-left: -1px;
-    // margin-right: -1px;
-
-    td {
-      // text-align: center;
-      padding: 5px 10px;
+  .content {
+    // font-weight: 600;
+    font-size: 32px;
+    color: #333333;
+    display: inline-block;
+  }
+}
+.row {
+  display: flex;
+  // line-height: 28px;
+  .left {
+    width: 120px;
+    text-align: justify;
+    display: inline-block;
+    &::after {
+      content: "";
+      display: inline-block;
+      width: 100%;
     }
-    // tr td:last-child {
-    //   border-right: 0 !important;
-    // }
   }
-  .flex-top-bottom {
-    display: flex;
-    justify-content: space-between;
-    margin: 5px 0px;
+  .right {
+    width: calc(100% - 120px);
+    text-align: left;
+    line-height: 18px;
   }
-  .padding-10px {
-    padding: 0px 10px;
+}
+.rowOne {
+  display: flex;
+  line-height: 32px;
+  .left {
+    width: 120px;
+    text-align: left;
+    // text-align: justify;
+    // display: inline-block;
+    // &::after {
+    //   content: "";
+    //   display: inline-block;
+    //   width: 100%;
+    // }
+  }
+  .right {
+    width: calc(100% - 120px);
+    text-align: left;
   }
-  .margin-top-5px {
-    margin-top: 5px;
+}
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+
+  td {
+    text-align: center;
+    padding: 2px 4px;
+    // padding: 5px 10px;
   }
 }
 </style>

+ 22 - 7
src/components/byTable/index.vue

@@ -205,10 +205,10 @@ export default defineComponent({
         return [];
       },
     },
-    tableHeight: {
-      type: Number,
-      required: false,
-    },
+    // tableHeight: {
+    //   type: Number,
+    //   required: false,
+    // },
     searchConfig: {
       type: Object,
       default() {
@@ -278,6 +278,20 @@ export default defineComponent({
   },
 
   setup(props) {
+    const tableHeight = ref(0);
+    const getTableHeight = () => {
+      // if (window.innerHeight >= 920) {
+      //   tableHeight.value = 650;
+      // } else {
+      //   tableHeight.value = 550;
+      // }
+      tableHeight.value = window.innerHeight - 225;
+    };
+    getTableHeight();
+    window.addEventListener("resize", () => {
+      getTableHeight();
+    });
+
     const { proxy } = getCurrentInstance();
     // 过滤出有属性的
     // const configData = ref([]);
@@ -409,9 +423,9 @@ export default defineComponent({
       proxy.$emit(
         "getList",
         Object.assign(props.filterParams, {
-          ...paginationCopy.value,
           type: "",
           status: "",
+          ...paginationCopy.value,
         })
       );
     };
@@ -528,6 +542,7 @@ export default defineComponent({
     const hocElTable = ref();
 
     return {
+      tableHeight,
       configData,
       getParent,
       getPagination,
@@ -822,9 +837,9 @@ export default defineComponent({
 }
 .table-list-container {
   background: #fff;
-  padding: 15px;
+  padding: 15px 15px 10px 15px;
   .table-pagination {
-    padding-top: 20px;
+    padding-top: 5px;
   }
   .header {
     display: flex;

+ 163 - 2
src/components/headerBar/header-bar.vue

@@ -11,7 +11,12 @@
           <div @click.stop="openMenuBox" class="menu-modal">
             <i class="iconfont icon-icomx_gongndh" style="margin: 0 5px 0 0"></i>
             {{ $t("header.functionGuide") }}
-            <i class="iconfont icon-iconm_xialan1" style="margin: 0 0 0 3px"></i>
+            <!-- <i class="iconfont icon-iconm_xialan1" style="margin: 0 0 0 3px"></i> -->
+            <span style="position:relative;top:2px">
+              <el-icon :size="16">
+                <CaretRight />
+              </el-icon>
+            </span>
           </div>
         </li>
         <div class="auto-list">
@@ -29,7 +34,7 @@
             </ul>
           </li>
         </div>
-        <div class="header-bar-warp" v-if="isChildMenu" @click.stop="isChildMenu = false">
+        <div class="header-bar-warp" v-if="false" @click.stop="isChildMenu = false">
           <div class="header-bar-hover" @click.stop>
             <div class="header-bar-hover-content">
               <!-- 左边 -->
@@ -150,7 +155,52 @@
         </el-dropdown>
       </div>
     </header>
+    <el-drawer v-model="isChildMenu" direction="ltr" :show-close="false" close-on-click-modal custom-class="menuDrawerClass" modal-class="modelClass">
+      <template #default>
+        <div class="menu-bar">
+          <div class="menu-warp" @click.stop>
+            <div v-for="(item, index) in sidebarRoutersCopy" :key="item.name" v-show="item.type == 1 && item.status == '0'"
+                 style="border-bottom:2px dashed #edeaea;padding-bottom:20px;margin-bottom:20px;">
+              <div class="first-order-title">
+                <TitleInfo :content="item.menuName" :size="14"></TitleInfo>
+              </div>
+              <div class="layout-box">
+                <ul class="son-box" v-for="i in item.children" :key="i.menuId">
+                  <li class="menu-title">
+                    {{ i.menuName }}
+                  </li>
+                  <div v-for="(j, index) in i.children" :key="index">
+                    <li v-if="i.isNone" class="menu-ul" style="cursor: auto"></li>
+                    <li class="menu-ul">
+                      <i style="cursor: pointer;position:relative;top:0px" @click.stop="editMenu(j)">
+                        <svg-icon :icon-class="isHaveCollect(j) ? 'shoucang1' :'shoucang'" />
+                      </i>
+                      <span style="margin-left:6px;cursor: pointer" @click="commonsBannerToRouter(j)">{{ j.menuName }}</span>
+                    </li>
+                  </div>
+                </ul>
+              </div>
+            </div>
+          </div>
+          <div class="right-banner">
+            <div class="first-order-title">
+              <TitleInfo :content="'常用功能'" :size="14"></TitleInfo>
+            </div>
 
+            <div class="collect" id="collect">
+              <div v-for="(menu, index) in commonsRouterList" :key="menu.menuId" class="item">
+                <span>{{menu.menuName}}</span>
+                <span style="cursor:pointer;position:relative;top:2px;" @click="editMenu(menu)">
+                  <el-icon color="#46A6FF" :size="16">
+                    <CircleClose />
+                  </el-icon>
+                </span>
+              </div>
+            </div>
+          </div>
+        </div>
+      </template>
+    </el-drawer>
     <el-drawer v-model="openDrawer" direction="rtl" :show-close="false" close-on-click-modal custom-class="drawerClass" modal-class="modelClass">
       <!-- <template #header>
         <h4>set title by slot</h4>
@@ -565,6 +615,7 @@ onMounted(() => {
     if (sidebarRoutersCopy.value && sidebarRoutersCopy.value.length > 0) {
       openLeftBaner(sidebarRoutersCopy.value[0], 0);
     }
+    console.log(sidebarRoutersCopy.value, "resaa");
 
     //循环删除 i.status != 0 || i.visible != 0 的元素
     sidebarRoutersCopy.value.map((item) => {
@@ -679,6 +730,19 @@ const plugDowload = () => {
 </script>
 
 <style lang="scss">
+.menuDrawerClass {
+  width: calc(100vw - 500px) !important;
+  background: #fff;
+  // position: relative !important;
+  top: 50px !important;
+  height: calc(100vh - 50px) !important;
+  .el-drawer__header {
+    display: none !important;
+  }
+  .el-drawer__body {
+    padding: 0px !important;
+  }
+}
 .drawerClass {
   width: 360px !important;
   background: rgba(62, 62, 62, 0.99);
@@ -755,4 +819,101 @@ const plugDowload = () => {
     }
   }
 }
+.menu-bar {
+  display: flex;
+  width: 100%;
+  height: 100%;
+  box-sizing: border-box;
+  overflow: hidden;
+  .first-order-title {
+    height: 40px;
+    line-height: 40px;
+  }
+  .menu-warp {
+    width: calc(100% - 300px);
+    height: 100%;
+    padding: 0 15px;
+    overflow: auto;
+    box-shadow: 2px 0px 0px #eee;
+    &::-webkit-scrollbar {
+      width: 5px !important;
+      height: 5px !important;
+    }
+    .layout-box {
+      // 瀑布流布局 分四列
+      -moz-column-count: 4;
+      /* Firefox */
+      -webkit-column-count: 4;
+      /* Safari 和 Chrome */
+      column-count: 4;
+      -moz-column-gap: 50px;
+      -webkit-column-gap: 50px;
+      column-gap: 50px;
+      padding: 0 20px;
+      .son-box {
+        // 子元素不跨列
+        -moz-page-break-inside: avoid;
+        -webkit-column-break-inside: avoid;
+        break-inside: avoid;
+        list-style: none; /*将默认的样式去掉*/
+        padding: 0; /*去掉默认的内边距*/
+        margin: 0; /*去掉默认的外边距*/
+        .menu-title {
+          font-weight: 700;
+          color: #1b374c;
+          height: 40px;
+          line-height: 40px;
+          // border-bottom: 1px solid #efebeb;
+          font-size: 12px;
+          width: 140px;
+          margin: 0 5vw 0 0;
+
+          i {
+            position: relative;
+            top: 3px;
+            margin-right: 5px;
+          }
+        }
+        .menu-ul {
+          // padding-left: 10px;
+          height: 30px;
+          line-height: 30px;
+          font-size: 12px;
+          font-weight: 400;
+        }
+
+        .menu-ul span:hover {
+          color: #0084ff;
+        }
+      }
+    }
+  }
+  .right-banner {
+    width: 300px;
+    height: 100%;
+    overflow-y: auto;
+    padding: 0 15px;
+    // background: #f1f1f1;
+
+    &::-webkit-scrollbar {
+      width: 2px !important;
+      height: 2px !important;
+    }
+    .collect {
+      // margin-top: 5px;
+
+      .item {
+        // margin-bottom: 4px;
+        font-size: 12px;
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        height: 30px;
+        line-height: 30px;
+        // padding: 2px 5px;
+        // border: 1px solid #eee;
+      }
+    }
+  }
+}
 </style>

+ 18 - 2
src/components/process/SF/Contract.vue

@@ -233,6 +233,16 @@
                 </div>
               </template>
             </el-table-column>
+            <el-table-column label="备注" min-width="200">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'contractProductList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column prop="amount" label="小计" width="120" />
             <el-table-column label="操作" width="120" align="center" fixed="right" v-if="!judgeStatus()">
               <template #default="{ $index }">
@@ -290,7 +300,7 @@
 
       <template #templateContent>
         <div style="width: 100%">
-          <Editor :value="formData.data.templateContent" @updateValue="updateContent" />
+          <Editor :value="formData.data.templateContent" @updateValue="updateContent" :readOnly="judgeStatus()" ref="remarkEditor" />
         </div>
       </template>
     </byForm>
@@ -354,10 +364,12 @@ const formData = reactive({
     rate: 1,
     contractProductList: [],
     companyId: companyId.value,
+    templateContent: "",
   },
 });
 const uploadData = ref({});
 const formDom = ref(null);
+const remarkEditor = ref(null);
 const judgeStatus = () => {
   if (
     route.query.processType == 20 ||
@@ -658,13 +670,14 @@ const formConfig = computed(() => {
       fn: (val) => {
         proxy.post("/contractTemplate/detail", { id: val }).then((res) => {
           formData.data.templateContent = res.templateContent;
+          remarkEditor.value.changeHtml(formData.data.templateContent);
         });
       },
     },
     {
       type: "slot",
       slotName: "templateContent",
-      prop: "amount",
+      prop: "templateContent",
       label: "模板内容",
       itemWidth: 100,
       disabled: false,
@@ -915,6 +928,7 @@ const selectProduct = (goods) => {
       quantity: null,
       price: null,
       amount: "",
+      remark: "",
       fileList: [],
     });
     proxy.msgTip("添加成功", 1);
@@ -1193,6 +1207,7 @@ const getAllData = (businessId) => {
     for (const key in res) {
       formData.data[key] = res[key];
     }
+    remarkEditor.value.changeHtml(formData.data.templateContent);
     if (
       formData.data.contractProductList &&
       formData.data.contractProductList.length > 0
@@ -1231,6 +1246,7 @@ const getPriceSheetData = (id) => {
   proxy.post("/extQuotation/detail", { id }).then((res) => {
     formData.data = res;
     formData.data = {
+      templateContent: "",
       quotationId: res.id,
       companyId: res.companyId,
       buyCorporationId: res.buyCorporationId,

+ 39 - 23
src/components/process/SF/Purchase.vue

@@ -144,7 +144,7 @@
             </el-table-column>
             <el-table-column label="数量" prop="subscribeCount" width="100" v-if="route.query.ids" />
             <el-table-column label="已采购数量" prop="purchaseCount" width="100" v-if="route.query.ids" />
-            <el-table-column label="采购数量" width="150">
+            <el-table-column label="采购数量" width="130">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
                   <el-form-item :prop="'purchaseProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true"
@@ -216,7 +216,17 @@
               </template>
             </el-table-column>
             <el-table-column prop="amount" label="小计" width="120" />
-            <el-table-column label="操作" width="120" align="center" fixed="right" v-if="!judgeStatus()">
+            <el-table-column label="备注" width="200">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  <el-form-item :prop="'purchaseProductList.' + $index + '.remark'" :rules="rules.remark" :inline-message="true"
+                                class="margin-b-0 wid100">
+                    <el-input v-model="row.remark" placeholder="请输入" style="width: 100%" />
+                  </el-form-item>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="60" align="center" fixed="right" v-if="!judgeStatus()">
               <template #default="{ $index }">
                 <el-button type="primary" link @click="handleRemove($index)">删除</el-button>
               </template>
@@ -269,22 +279,9 @@
         </div>
       </template>
 
-      <template #contractClause>
-        <div style="width: 100%;height:auto">
-          <el-row style=" width: 100%">
-            <el-col :span="8">
-              <el-form-item label="合同模板" prop="contractTemplateId" class="wid100">
-                <el-select v-model="formData.data.contractTemplateId" style="width: 100%" @change="changeContractTemplate">
-                  <el-option v-for="item in templateList" :key="item.value" :label="item.label" :value="item.value" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <div style=" width: 100%">
-            <el-form-item label="条款内容" prop="remark" class="margin-b-0 wid100">
-              <Editor :value="formData.data.remark" @updateValue="updateContent" :readOnly="judgeStatus()" ref="remarkEditor" />
-            </el-form-item>
-          </div>
+      <template #templateContent>
+        <div style="width: 100%">
+          <Editor :value="formData.data.remark" @updateValue="updateContent" :readOnly="judgeStatus()" ref="remarkEditor" />
         </div>
       </template>
 
@@ -507,13 +504,29 @@ const formConfig = computed(() => {
     },
     {
       type: "title",
-      title: "合同条款",
+      title: "合同模板",
       haveLine: true,
     },
     {
+      type: "select",
+      prop: "contractTemplateId",
+      label: "合同模板",
+      data: templateList.value,
+      itemWidth: 50,
+      fn: (val) => {
+        proxy.post("/contractTemplate/detail", { id: val }).then((res) => {
+          formData.data.remark = res.templateContent;
+          remarkEditor.value.changeHtml(formData.data.remark);
+        });
+      },
+    },
+    {
       type: "slot",
-      slotName: "contractClause",
-      label: "",
+      slotName: "templateContent",
+      prop: "remark",
+      label: "模板内容",
+      itemWidth: 100,
+      disabled: false,
     },
   ];
 });
@@ -583,11 +596,14 @@ const getDict = () => {
     });
   });
   proxy
-    .post("/contractTemplate/page", { pageNum: 1, pageSize: 999 })
+    .post("/contractTemplate/page", {
+      pageNum: 1,
+      pageSize: 999,
+      templateType: "2",
+    })
     .then((res) => {
       templateList.value = res.rows.map((item) => {
         return {
-          ...item,
           label: item.templateName,
           value: item.id,
         };

+ 8 - 6
src/views/EHSD/procurement/purchasedEHSD/index.vue

@@ -23,15 +23,16 @@
         </div>
       </template>
     </byTable>
-    <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="900px">
+    <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="920px">
+      <PurchasePDF :rowData="rowData"></PurchasePDF>
       <!-- <PurchasePDFOne :rowData="rowData"></PurchasePDFOne> -->
-      <PurchasePDFOneNew :rowData="rowData" ref="PdfDom"></PurchasePDFOneNew>
-      <template #footer ref="printBtn">
+      <!-- <PurchasePDFOneNew :rowData="rowData" ref="PdfDom"></PurchasePDFOneNew> -->
+      <!-- <template #footer ref="printBtn">
         <el-button @click="openPdf = false" size="default">关闭</el-button>
         <el-button type="primary" v-print="printObj" size="default">打印</el-button>
         <el-button type="primary" @click="clickDownload()" size="default">下载PDF</el-button>
         <el-button type="primary" @click="exportExcel()" size="default">导出Excel</el-button>
-      </template>
+      </template> -->
     </el-dialog>
   </div>
 </template>
@@ -40,8 +41,9 @@
 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";
+import PurchasePDF from "@/components/PDF/purchasePDF.vue";
+// import PurchasePDFOne from "@/components/PDF/purchasePDFOne.vue";
+// import PurchasePDFOneNew from "@/components/PDF/purchasePDFOneNew.vue";
 
 const route = useRoute();
 const { proxy } = getCurrentInstance();

+ 40 - 7
src/views/EHSD/saleContract/PriceSheetDetail.vue

@@ -90,8 +90,20 @@
                         </div>
                       </template> -->
                     <el-table-column prop="allQuantity" label="总量" width="80" />
-                    <el-table-column prop="price" label="单价" width="110" />
-                    <el-table-column prop="amount" label="小计" width="110" />
+                    <el-table-column prop="price" label="单价" width="110">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          ¥ {{row.price}}
+                        </div>
+                      </template>
+                    </el-table-column>
+                    <el-table-column prop="amount" label="小计" width="110">
+                      <template #default="{ row, $index }">
+                        <div style="width: 100%">
+                          ¥ {{row.amount}}
+                        </div>
+                      </template>
+                    </el-table-column>
                     <el-table-column prop="remark" label="备注" width="180" />
                     <!-- <template #default="{ row, $index }">
                         <div style="width: 100%">
@@ -134,8 +146,20 @@
                   </el-form-item>
                 </div>
               </template> -->
-            <el-table-column prop="price" label="单价" width="110" />
-            <el-table-column prop="amount" label="小计" width="110" />
+            <el-table-column prop="price" label="单价" width="110">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  ¥ {{row.price}}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column prop="amount" label="小计" width="110">
+              <template #default="{ row, $index }">
+                <div style="width: 100%">
+                  ¥ {{row.amount}}
+                </div>
+              </template>
+            </el-table-column>
           </el-table>
         </div>
       </template>
@@ -158,11 +182,11 @@ const props = defineProps({
 const typeData = ref([
   {
     label: "内销",
-    value: "1",
+    value: 1,
   },
   {
     label: "外销",
-    value: "2",
+    value: 2,
   },
 ]);
 const treeData = ref([]);
@@ -433,13 +457,22 @@ const chartOption = reactive({
     ],
   },
 });
-
+const customerList = ref([]);
 const getData = (query) => {
   let url =
     props.dataType == "1" ? "/saleQuotation/detail" : "/extQuotation/detail";
   loading.value = true;
   proxy.post(url, query).then((res) => {
     formData.data = res;
+    proxy
+      .post("/customer/selPage", { keyword: formData.data.buyCorporationName })
+      .then((res) => {
+        customerList.value = res.rows.map((x) => ({
+          ...x,
+          label: x.name,
+          value: x.id,
+        }));
+      });
     // 城市数据回显
     if (formData.data.buyCountryId) {
       getCityData(formData.data.buyCountryId, "20");

+ 2 - 0
src/views/EHSD/saleContract/PriceSheetDetailList.vue

@@ -85,6 +85,7 @@ const chartOption = reactive({
       {
         name: "报价金额",
         type: "line",
+        symbolSize: 10,
         data: [],
       },
     ],
@@ -126,6 +127,7 @@ const initChart = () => {
 };
 const handleItemClick = (i) => {
   rowData.value = i;
+  proxy.$emit("changeLeftData", i);
   if (
     rowData.value.quotationTrendList &&
     rowData.value.quotationTrendList.length >= 2

+ 117 - 30
src/views/EHSD/saleContract/priceSheetEHSD/index.vue

@@ -63,7 +63,7 @@
               <el-button type="primary" text v-debounce @click="getDtl(item, false)">修改</el-button>
               <el-button type="danger" text v-debounce @click="handleRepeal(item,'/saleQuotation/delete')">删除</el-button>
             </span>
-            <span>
+            <span v-if="item.status !=88">
               <el-button type="primary" text v-debounce v-if="item.quotationStatus==2 && !item.extQuotationId"
                          @click="handleBack(item)">退回</el-button>
               <el-button type="primary" text v-debounce v-if="item.status == 30 && item.quotationStatus==2"
@@ -182,7 +182,8 @@
                             <el-form-item :prop="'quotationProductList.' + scope.$index + '.quotationProductBomList.' + $index + '.quantity'"
                                           :rules="rules.quantity" :inline-message="true" class="margin-b-0 wid100">
                               <el-input-number onmousewheel="return false;" v-model="row.quantity" placeholder="请输入" style="width: 100%"
-                                               :precision="0" :controls="false" :min="1" :disabled="row.type==1" @change="changeQuantity()" />
+                                               :precision="0" :controls="false" :min="1" v-if="row.type==2" @change="changeQuantity()" />
+                              <span v-else>{{row.quantity}}</span>
                             </el-form-item>
                           </div>
                         </template>
@@ -191,7 +192,7 @@
                       <el-table-column label="单价" width="110">
                         <template #default="{ row, $index }">
                           <div style="width: 100%">
-                            <span v-if="row.price">{{row.price}}</span>
+                            <span v-if="row.price">{{row.price}}</span>
                             <span v-else>待报价</span>
                           </div>
                         </template>
@@ -199,7 +200,7 @@
                       <el-table-column prop="amount" label="小计" width="110">
                         <template #default="{ row, $index }">
                           <div style="width: 100%">
-                            <span v-if="row.amount">{{row.amount}}</span>
+                            <span v-if="row.amount">{{row.amount}}</span>
                             <span v-else>一</span>
                           </div>
                         </template>
@@ -256,7 +257,7 @@
               <el-table-column label="单价" width="110">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <span v-if="row.price">{{row.price}}</span>
+                    <span v-if="row.price">{{row.price}}</span>
                     <span v-else>待报价</span>
                   </div>
                 </template>
@@ -264,7 +265,7 @@
               <el-table-column prop="amount" label="小计" width="110">
                 <template #default="{ row, $index }">
                   <div style="width: 100%">
-                    <span v-if="row.amount">{{row.amount}}</span>
+                    <span v-if="row.amount">{{row.amount}}</span>
                     <span v-else>一</span>
                   </div>
                 </template>
@@ -321,8 +322,18 @@
                       <el-table-column label="总数量" width="80" prop="allQuantity">
                       </el-table-column>
                       <el-table-column label="原本单价" width="110" prop="priceCopy">
+                        <template #default="{ row, $index }">
+                          <div style="width: 100%">
+                            ¥ {{row.priceCopy}}
+                          </div>
+                        </template>
                       </el-table-column>
                       <el-table-column label="单价" width="110" prop="price">
+                        <template #default="{ row, $index }">
+                          <div style="width: 100%">
+                            ¥ {{row.price}}
+                          </div>
+                        </template>
                       </el-table-column>
                       <el-table-column label="利润点数" width="110">
                         <template #default="{ row, $index }">
@@ -336,6 +347,11 @@
                         </template>
                       </el-table-column>
                       <el-table-column prop="amount" label="小计" width="110">
+                        <template #default="{ row, $index }">
+                          <div style="width: 100%">
+                            ¥ {{row.amount}}
+                          </div>
+                        </template>
                       </el-table-column>
                       <el-table-column label="备注" width="180" prop="remark">
                       </el-table-column>
@@ -362,15 +378,21 @@
                 </template>
               </el-table-column>
               <el-table-column label="数量" width="110" prop="quantity">
-
               </el-table-column>
               <el-table-column label="单价" width="110" prop="price">
-
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    ¥ {{row.price}}
+                  </div>
+                </template>
               </el-table-column>
               <el-table-column prop="amount" label="小计" width="110">
-
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    ¥ {{row.amount}}
+                  </div>
+                </template>
               </el-table-column>
-
             </el-table>
           </div>
         </template>
@@ -396,7 +418,29 @@
     </el-dialog>
 
     <el-dialog v-if="detailDialog" v-model="detailDialog" title="报价详情" width="90%" append-to-body>
-      <PriceSheetDetailList :rowData="detailRowData" dataType="1"></PriceSheetDetailList>
+      <PriceSheetDetailList :rowData="detailRowData" dataType="1" @changeLeftData="changeLeftData"></PriceSheetDetailList>
+      <template #footer>
+        <el-button @click="detailDialog = false" size="defualt" v-debounce>关 闭</el-button>
+        <el-button type="primary" v-debounce v-if="leftRowData.quotationStatus==2 && !leftRowData.extQuotationId &&leftRowData.status !=88"
+                   @click="handleBack(leftRowData)">退回</el-button>
+        <el-button type="primary" v-debounce v-if="leftRowData.status == 30 && leftRowData.quotationStatus==2 && leftRowData.status !=88"
+                   @click="getDtl(leftRowData, false,true)">变更</el-button>
+        <el-button type="primary" v-debounce v-if="leftRowData.quotationStatus==2 && !leftRowData.extQuotationId &&leftRowData.status !=88"
+                   @click="handleForeign(leftRowData)">转对外</el-button>
+        <el-button type="danger" v-debounce v-if="leftRowData.status !=0 && leftRowData.status !=88"
+                   @click="handleRepeal(leftRowData,'/saleQuotation/cancellation')">作废</el-button>
+      </template>
+    </el-dialog>
+
+    <el-dialog v-if="backDialog" v-model="backDialog" title="退回" width="50%" append-to-body>
+      <byForm :formConfig="backFormConfig" :formOption="backFormOption" v-model="formData.backData" :rules="backRules" ref="backFormDom"
+              v-loading="submitLoading">
+
+      </byForm>
+      <template #footer>
+        <el-button @click="backDialog = false" size="default" v-debounce>关 闭</el-button>
+        <el-button type="primary" @click="handleSubmitBack()" size="default" v-debounce>提 交</el-button>
+      </template>
     </el-dialog>
   </div>
 </template>
@@ -449,11 +493,11 @@ const quotationStatusData = ref([
 const typeData = ref([
   {
     label: "内销",
-    value: "1",
+    value: 1,
   },
   {
     label: "外贸",
-    value: "2",
+    value: 2,
   },
 ]);
 const sourceList = ref({
@@ -593,7 +637,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "创建人",
-        prop: "createUserName",
+        prop: "userName",
         width: 80,
       },
     },
@@ -830,6 +874,7 @@ const formData = reactive({
     type: "1",
     quotationProductList: [],
   },
+  backData: {},
 });
 const formDom = ref(null);
 const formOption = reactive({
@@ -1283,22 +1328,6 @@ const chartOption = reactive({
   },
 });
 
-const handleBack = (row) => {
-  proxy
-    .msgConfirm()
-    .then((res) => {
-      proxy
-        .post("/saleQuotation/edit", {
-          id: row.id,
-          quotationStatus: 1,
-        })
-        .then((res) => {
-          proxy.msgTip("操作成功", 1);
-          getList();
-        });
-    })
-    .catch((err) => {});
-};
 const handleRepeal = (row, url) => {
   proxy
     .msgConfirm()
@@ -1507,6 +1536,64 @@ const handleOpenDetail = (item) => {
   detailRowData.value = item;
   detailDialog.value = true;
 };
+
+const leftRowData = ref({});
+const changeLeftData = (i) => {
+  leftRowData.value = i;
+};
+
+const backFormDom = ref(null);
+const backDialog = ref(false);
+const backFormConfig = computed(() => {
+  return [
+    {
+      type: "input",
+      itemType: "textarea",
+      rows: 10,
+      prop: "backRemark",
+      label: "退回原因",
+      itemWidth: 100,
+      disabled: false,
+    },
+  ];
+});
+
+const backFormOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  disabled: false,
+});
+
+const backRules = ref({
+  backRemark: [{ required: true, message: "请输入退回原因", trigger: "blur" }],
+});
+
+const handleBack = (row) => {
+  formData.backData = {
+    id: row.id,
+    quotationStatus: 1,
+    backRemark: "",
+  };
+  backDialog.value = true;
+};
+
+const handleSubmitBack = () => {
+  backFormDom.value.handleSubmit(() => {
+    submitLoading.value = true;
+    proxy
+      .msgConfirm()
+      .then((res) => {
+        proxy.post("/saleQuotation/edit", formData.backData).then((res) => {
+          proxy.msgTip("操作成功", 1);
+          submitLoading.value = false;
+          backDialog.value = false;
+          getList();
+        });
+      })
+      .catch((err) => {});
+  });
+};
 </script>
 
 <style lang="scss" scoped>

+ 37 - 2
src/views/EHSD/saleContract/priceSheetEstimate/index.vue

@@ -107,6 +107,11 @@
                         </template>
                       </el-table-column>
                       <el-table-column prop="amount" label="小计" width="110">
+                        <template #default="{ row, $index }">
+                          <div style="width: 100%">
+                            ¥ {{row.amount}}
+                          </div>
+                        </template>
                       </el-table-column>
                       <el-table-column label="备注" width="180" prop="remark">
                       </el-table-column>
@@ -134,8 +139,18 @@
               <el-table-column label="数量" width="120" prop="quantity">
               </el-table-column>
               <el-table-column label="单价" width="120" prop="price">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    ¥ {{row.price}}
+                  </div>
+                </template>
               </el-table-column>
               <el-table-column prop="amount" label="小计" width="120">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    ¥ {{row.amount}}
+                  </div>
+                </template>
               </el-table-column>
             </el-table>
           </div>
@@ -335,12 +350,27 @@ const formOption = reactive({
   itemWidth: 100,
   disabled: false,
 });
+const isShowBackRemark = ref(false);
 const formConfig = computed(() => {
   return [
     {
       type: "title1",
+      title: "退回原因",
+      isShow: isShowBackRemark.value,
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      rows: 10,
+      prop: "backRemark",
+      label: "退回原因",
+      itemWidth: 100,
+      disabled: true,
+      isShow: isShowBackRemark.value,
+    },
+    {
+      type: "title1",
       title: "商品信息",
-      haveLine: true,
     },
     {
       type: "slot",
@@ -350,7 +380,6 @@ const formConfig = computed(() => {
     {
       type: "title1",
       title: "报价总金额",
-      haveLine: true,
     },
     {
       type: "input",
@@ -371,6 +400,12 @@ const getDtl = (row, flag = false) => {
   openAddDialog.value = true;
   proxy.post("/saleQuotation/detail", { id: row.id }).then((res) => {
     formData.data = res;
+    // 是否显示退回原因
+    if (res.backRemark) {
+      isShowBackRemark.value = true;
+    } else {
+      isShowBackRemark.value = false;
+    }
     // 城市数据回显
     // if (formData.data.buyCountryId) {
     //   getCityData(formData.data.buyCountryId, "20");

+ 34 - 6
src/views/EHSD/saleContract/priceSheetForeign/index.vue

@@ -94,8 +94,8 @@
       <template #btn="{item}">
         <div style="width: 100%">
           <!-- <el-button type="primary" text v-debounce @click="handleFollow(item)">跟进</el-button> -->
-          <el-button type="primary" text v-debounce @click="handleGenerate(item)">生成订单</el-button>
-          <el-button type="primary" text v-debounce @click="getDtl(item)">变更</el-button>
+          <el-button type="primary" text v-debounce v-if="item.status !=88" @click="handleGenerate(item)">生成订单</el-button>
+          <el-button type="primary" text v-debounce v-if="item.status !=88" @click="getDtl(item)">变更</el-button>
           <el-button type="danger" text v-debounce v-if="item.status !=0 && item.status !=88" @click="handleRepeal(item)">作废</el-button>
         </div>
       </template>
@@ -172,6 +172,11 @@
                         </template>
                       </el-table-column>
                       <el-table-column prop="amount" label="小计" width="110">
+                        <template #default="{ row, $index }">
+                          <div style="width: 100%">
+                            ¥ {{row.amount}}
+                          </div>
+                        </template>
                       </el-table-column>
                       <el-table-column label="备注" width="180" prop="remark">
                       </el-table-column>
@@ -199,8 +204,18 @@
               <el-table-column label="数量" width="120" prop="quantity">
               </el-table-column>
               <el-table-column label="单价" width="120" prop="price">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    ¥ {{row.price}}
+                  </div>
+                </template>
               </el-table-column>
               <el-table-column prop="amount" label="小计" width="120">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    ¥ {{row.amount}}
+                  </div>
+                </template>
               </el-table-column>
             </el-table>
           </div>
@@ -213,7 +228,13 @@
     </el-dialog>
 
     <el-dialog v-if="detailDialog" v-model="detailDialog" title="报价详情" width="90%" append-to-body>
-      <PriceSheetDetailList :rowData="detailRowData" dataType="2"></PriceSheetDetailList>
+      <PriceSheetDetailList :rowData="detailRowData" dataType="2" @changeLeftData="changeLeftData"></PriceSheetDetailList>
+      <template #footer>
+        <el-button @click="detailDialog = false" size="defualt" v-debounce>关 闭</el-button>
+        <el-button type="primary" v-debounce v-if="leftRowData.status !=88" @click="handleGenerate(leftRowData)">生成订单</el-button>
+        <el-button type="primary" v-debounce v-if="leftRowData.status !=88" @click="getDtl(leftRowData)">变更</el-button>
+        <el-button type="danger" v-debounce v-if="leftRowData.status !=0 && leftRowData.status !=88" @click="handleRepeal(leftRowData)">作废</el-button>
+      </template>
     </el-dialog>
 
   </div>
@@ -262,11 +283,11 @@ const quotationStatusData = ref([
 const typeData = ref([
   {
     label: "内销",
-    value: "1",
+    value: 1,
   },
   {
     label: "外销",
-    value: "2",
+    value: 2,
   },
 ]);
 const sourceList = ref({
@@ -368,7 +389,7 @@ const config = computed(() => {
       attrs: {
         label: "跟进",
         slot: "follow",
-        "min-width": 420,
+        "min-width": 480,
       },
     },
     {
@@ -472,6 +493,7 @@ const rules = ref({
 });
 
 const handleFollow = (row) => {
+  openRecordMore.value = false;
   formData.data = {
     quotationId: row.id,
     followTime: moment().format("yyyy-MM-DD HH:mm:ss"),
@@ -532,6 +554,7 @@ const handleGenerate = (row) => {
       random: proxy.random(),
     },
   });
+  detailDialog.value = false;
 };
 
 const handleRepeal = (row) => {
@@ -714,6 +737,11 @@ const handleOpenDetail = (item) => {
   detailRowData.value = item;
   detailDialog.value = true;
 };
+
+const leftRowData = ref({});
+const changeLeftData = (i) => {
+  leftRowData.value = i;
+};
 </script>
 
 <style lang="scss" scoped>

+ 9 - 1
src/views/customer/addCustomer.vue

@@ -317,12 +317,20 @@ const formConfig = computed(() => {
       type: "select",
       label: "业务员",
       prop: "userId",
-      itemWidth: 100,
+      itemWidth: 50,
       data: userList.value,
       clearable: true,
       disabled: isHighseas.value,
     },
     {
+      type: "input",
+      prop: "fax",
+      label: "传真",
+      required: true,
+      itemWidth: 50,
+      itemType: "text",
+    },
+    {
       type: "select",
       label: "客户标签",
       prop: "tags",

+ 2 - 183
src/views/purchaseManage/purchaseManage/alreadyPurchase/index.vue

@@ -75,193 +75,12 @@
     </el-dialog>
 
     <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="840px">
-      <!-- <div id="pdfDom" ref="pdfDom" style="width: 776px">
-        <div style="border: 1px solid #000; border-collapse: collapse">
-          <div style="text-align: right; padding: 2px 4px 0 0">
-            合同号:{{ pdfData.code }}
-          </div>
-          <div class="title">购销合同</div>
-          <div style="display: flex">
-            <div style="display: flex; width: 50%; padding-right: 20px">
-              <div style="width: 60px">买方:</div>
-              <div style="width: calc(100% - 60px)">
-                <div>福建宏星电子科技有限公司</div>
-                <div>福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层</div>
-              </div>
-            </div>
-            <div style="display: flex; width: 50%; padding-left: 20px">
-              <div style="width: 60px">卖方:</div>
-              <div style="width: calc(100% - 60px)">
-                {{ pdfData.supplyName }}
-              </div>
-            </div>
-          </div>
-          <div style="display: flex">
-            <div style="display: flex; width: 50%; padding-right: 20px">
-              <div style="width: 60px">经手人:</div>
-              <div style="width: calc(100% - 60px)">
-                {{ pdfData.purchaseName }}
-              </div>
-            </div>
-            <div style="display: flex; width: 50%; padding-left: 20px">
-              <div style="width: 60px">经手人:</div>
-              <div style="width: calc(100% - 60px)">
-                {{ pdfData.contactPerson }}
-              </div>
-            </div>
-          </div>
-          <div>买卖双方经协商,一致同意签订以下合同</div>
-          <div>货物名称、规格型号、单位、数量、单价及金额:</div>
-          <table border="1" style="width: 100%" class="table">
-            <tr>
-              <td style="width: 70px">序号</td>
-              <td>品名</td>
-              <td>规格型号</td>
-              <td style="width: 60px">单位</td>
-              <td style="width: 60px">数量</td>
-              <td style="width: 100px">单价</td>
-              <td style="width: 100px">金额</td>
-            </tr>
-            <tr
-              v-for="(row, index) in pdfData.purchaseDetailList"
-              :key="row.id"
-            >
-              <td style="width: 70px">{{ index + 1 }}</td>
-              <td>{{ row.productName }}</td>
-              <td>{{ row.productSpec }}</td>
-              <td style="width: 60px">{{ row.productUnitName }}</td>
-              <td style="width: 60px">{{ row.count }}</td>
-              <td style="width: 100px">
-                <span v-if="pdfData.currency">{{ pdfData.currency }}</span
-                >{{ row.price }}
-              </td>
-              <td style="width: 100px">
-                <span v-if="pdfData.currency">{{ pdfData.currency }}</span
-                >{{ row.amount }}
-              </td>
-            </tr>
-            <tr>
-              <td colspan="4" style="text-align: right">其他收费项目:</td>
-              <td></td>
-              <td></td>
-              <td>
-                <span v-if="pdfData.currency">{{ pdfData.currency }}</span
-                >{{ pdfData.otherMoney }}
-              </td>
-            </tr>
-            <tr>
-              <td colspan="4" style="text-align: right">合计:</td>
-              <td>{{ pdfData.countTotal }}</td>
-              <td></td>
-              <td>
-                <span v-if="pdfData.currency">{{ pdfData.currency }}</span
-                >{{ pdfData.amount }}
-              </td>
-            </tr>
-            <tr>
-              <td colspan="7" style="text-align: left">
-                合计人民币金额(大写):{{ pdfData.moneyChinese }}
-              </td>
-            </tr>
-            <tr>
-              <td>交货地点:</td>
-              <td colspan="6" style="text-align: left">
-                福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
-              </td>
-            </tr>
-            <tr>
-              <td>保修期:</td>
-              <td colspan="6" style="text-align: left">一年</td>
-            </tr>
-            <tr>
-              <td colspan="7" style="text-align: left; padding: 0px">
-                <div style="padding: 2px 0px">
-                  一、交货地点:福州软件园A区28座5层。
-                </div>
-                <div style="padding: 2px 0px">
-                  二、运输方式及运费:买方承担。
-                </div>
-                <div style="padding: 2px 0px">
-                  三、质量要求:样品品质、型号、规格、数量如同买方确认上表规格所示,不符合则由卖方承担责任。
-                </div>
-                <div style="padding: 2px 0px">
-                  四、交货时间:2023年4月13日。
-                </div>
-                <div style="padding: 2px 0px">五、付款方式:银行转账。</div>
-                <div style="padding: 2px 0px">六、保修期:一年。</div>
-                <div style="padding: 2px 0px">
-                  七、本合同经买卖双方签字盖章后生效,传真件有效。
-                </div>
-                <div style="padding: 2px 0px">
-                  八、解决合同纠纷:原双方另有约定外,均按《中华人民共和国合同法》有关规定处理。
-                </div>
-                <div style="padding: 2px 0px">九、其他约定事项:友好解决。</div>
-              </td>
-            </tr>
-          </table>
-          <div style="display: flex">
-            <div style="width: 50%; padding-right: 20px">
-              <div>买方:</div>
-              <div>单位名称:福建宏星电子科技有限公司</div>
-              <div>
-                地址:福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
-              </div>
-              <div>电话:</div>
-              <div>传真:</div>
-              <div style="opacity: 0">|</div>
-              <div style="margin-top: auto">代表人签字:</div>
-            </div>
-            <div style="width: 50%; padding-left: 20px">
-              <div>卖方:</div>
-              <div>单位名称:{{ pdfData.supplyName }}</div>
-              <div>统一社会信用代码:</div>
-              <div>开户银行:{{ pdfData.openingBank }}</div>
-              <div>帐号:{{ pdfData.accountOpening }}</div>
-              <div>
-                地址:<span
-                  v-if="
-                    pdfData.supplyAddress && pdfData.supplyAddress.countryName
-                  "
-                  >{{ pdfData.supplyAddress.countryName }}</span
-                >
-                <span
-                  v-if="
-                    pdfData.supplyAddress && pdfData.supplyAddress.provinceName
-                  "
-                  >,{{ pdfData.supplyAddress.provinceName }}</span
-                >
-                <span
-                  v-if="pdfData.supplyAddress && pdfData.supplyAddress.cityName"
-                  >,{{ pdfData.supplyAddress.cityName }}</span
-                >
-                <span
-                  v-if="
-                    pdfData.supplyAddress && pdfData.supplyAddress.areaDetail
-                  "
-                  >,{{ pdfData.supplyAddress.areaDetail }}</span
-                >
-              </div>
-              <div>电话:{{ pdfData.contactNumber }}</div>
-              <div>代表人签字:</div>
-            </div>
-          </div>
-          <div
-            style="
-              padding: 30px 0px 20px 0;
-              text-align: right;
-              border-top: 1px solid #000;
-            "
-          >
-            签订日期:{{ pdfData.approvedDate }}
-          </div>
-        </div>
-      </div> -->
       <PurchasePDF :rowData="rowData"></PurchasePDF>
-      <template #footer ref="printBtn">
+      <!-- <template #footer ref="printBtn">
         <el-button @click="openPdf = false" size="default">关闭</el-button>
         <el-button type="primary" v-print="printObj" size="default">打印</el-button>
         <el-button type="primary" @click="clickDownload()" size="default">下载PDF</el-button>
-      </template>
+      </template> -->
     </el-dialog>
   </div>
 </template>

+ 2 - 1
src/views/purchaseManage/purchaseManage/purchase/index.vue

@@ -15,7 +15,7 @@
           },
         ]" @get-list="getList">
         <template #pic="{ item }">
-          <div v-if="item.fileList.length > 0">
+          <div v-if="item.fileList &&item.fileList.length > 0">
             <img :src="item.fileList[0].fileUrl" class="pic" @click="handleClickFile(item.fileList[0])" />
           </div>
           <div v-else></div>
@@ -339,6 +339,7 @@ const getList = async (req) => {
         isCheck: true,
       }));
       sourceList.value.pagination.total = res.total;
+      console.log(res.total, "ss");
       setTimeout(() => {
         loading.value = false;
       }, 200);

+ 6 - 0
src/views/purchaseManage/supplier/supplier/index.vue

@@ -291,6 +291,12 @@ const formConfig = computed(() => {
       label: "账期信息",
     },
     {
+      type: "input",
+      label: "传真",
+      prop: "fax",
+      itemType: "text",
+    },
+    {
       type: "upload",
       listType: "text",
       accept: "",

+ 37 - 20
src/views/purchaseSales/warehouseConfig/warehouse/index.vue

@@ -52,17 +52,23 @@ let dialogVisible = ref(false);
 let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
+  companyId: [
+    { required: true, message: "请选择归属公司", trigger: ["change"] },
+  ],
   type: [
     { required: true, message: "请选择仓库类型", trigger: ["blur", "change"] },
   ],
   name: [{ required: true, message: "请输入仓库名称", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
-const selectConfig = reactive([
+const warehouseType = computed(
+  () => proxy.useUserStore().allDict["warehouse_type"]
+);
+const selectConfig = computed(() => [
   {
     label: "仓库类型",
     prop: "type",
-    data: [],
+    data: warehouseType.value,
   },
 ]);
 
@@ -70,6 +76,12 @@ const config = computed(() => {
   return [
     {
       attrs: {
+        label: "归属公司",
+        prop: "companyName",
+      },
+    },
+    {
+      attrs: {
         label: "仓库名称",
         prop: "name",
       },
@@ -157,7 +169,6 @@ const config = computed(() => {
 
 let formData = reactive({
   data: {},
-  treeData: [],
 });
 const formOption = reactive({
   inline: true,
@@ -166,14 +177,22 @@ const formOption = reactive({
   rules: [],
 });
 const byform = ref(null);
-const treeData = ref([]);
-const formConfig = reactive([
+const formConfig = computed(() => [
+  {
+    type: "treeSelect",
+    prop: "companyId",
+    label: "归属公司",
+    data: treeData.value,
+    propsTreeLabel: "deptName",
+    propsTreeValue: "deptId",
+    itemWidth: 100,
+  },
   {
     type: "select",
     prop: "type",
     label: "仓库类型",
     required: true,
-    data: [],
+    data: warehouseType.value,
   },
   {
     type: "input",
@@ -246,26 +265,24 @@ const getDtl = (row) => {
     formData.data = res;
   });
 };
-const warehouseType = ref([]);
+const companyData = ref([]);
+const treeData = ref([]);
 const getDict = () => {
-  // // 币种数据
   proxy
-    .post("/dictTenantData/page", {
+    .get("/tenantDept/list", {
       pageNum: 1,
-      pageSize: 999,
-      tenantId: useUserStore().user.tenantId,
-      dictCode: "warehouse_type",
+      pageSize: 9999,
+      keyword: "",
+      tenantId: proxy.useUserStore().user.tenantId,
+      type: 0,
     })
     .then((res) => {
-      warehouseType.value = res.rows;
-      selectConfig[0].data = res.rows.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
-      }));
-      formConfig[0].data = res.rows.map((x) => ({
-        label: x.dictValue,
-        value: x.dictKey,
+      companyData.value = res.data.map((x) => ({
+        ...x,
+        label: x.deptName,
+        value: x.deptId,
       }));
+      treeData.value = proxy.handleTree(res.data, "deptId");
     });
 };
 getList();

+ 19 - 19
src/views/systemTenant/tenant/roleTenant/index.vue

@@ -67,16 +67,16 @@ const config = computed(() => {
         align: "left",
       },
     },
-    {
-      attrs: {
-        label: "权限等级",
-        prop: "authorityLv",
-        align: "left",
-      },
-      render(authorityLv) {
-        return proxy.dictValueLabel(authorityLv, authorityLvList.value);
-      },
-    },
+    // {
+    //   attrs: {
+    //     label: "权限等级",
+    //     prop: "authorityLv",
+    //     align: "left",
+    //   },
+    //   render(authorityLv) {
+    //     return proxy.dictValueLabel(authorityLv, authorityLvList.value);
+    //   },
+    // },
     {
       attrs: {
         label: "创建时间",
@@ -200,15 +200,15 @@ const formConfig = computed(() => {
       prop: "roleName",
       label: "角色名称",
     },
-    {
-      type: "select",
-      prop: "authorityLv",
-      label: "权限等级",
-      data: authorityLvList.value,
-      style: {
-        width: "100%",
-      },
-    },
+    // {
+    //   type: "select",
+    //   prop: "authorityLv",
+    //   label: "权限等级",
+    //   data: authorityLvList.value,
+    //   style: {
+    //     width: "100%",
+    //   },
+    // },
   ];
 });
 const rules = ref({