Przeglądaj źródła

Merge branch 'master' of http://36.137.93.232:3000/scz/erp_ehsd

lxf 1 rok temu
rodzic
commit
3b80517feb

+ 3 - 1
package.json

@@ -34,10 +34,12 @@
     "axios": "0.27.2",
     "echarts": "^5.4.0",
     "element-plus": "2.2.27",
-    "file-saver": "2.0.5",
+    "file-saver": "^2.0.5",
     "fuse.js": "6.6.2",
     "html2canvas": "^1.4.1",
+    "jquery": "^3.7.0",
     "js-cookie": "3.0.1",
+    "js-table2excel": "^1.1.2",
     "jsencrypt": "3.3.1",
     "jspdf": "^2.5.1",
     "lossless-json": "^2.0.8",

BIN
src/assets/images/mail-preview.png


+ 2 - 2
src/components/process/EHSD/Contract.vue

@@ -814,7 +814,7 @@
 
         <div style="width: 100%">
           <el-row>
-            <el-col :span="10">
+            <el-col :span="10" style="border: 1px solid #ebeef5; padding: 10px">
               <el-form-item label="出货日期" required>
                 <el-date-picker
                   v-model="formData.data.shipmentTime"
@@ -863,7 +863,7 @@
               </div>
             </el-col>
             <el-col :span="14">
-              <div style="padding-left: 10px">
+              <div style="padding: 10px; margin-top: 77px">
                 <el-table
                   :data="formData.data.contractShipmentList"
                   :span-method="objectSpanMethod"

+ 2 - 2
src/components/process/EHSD/ContractChange.vue

@@ -802,7 +802,7 @@
         </div> -->
         <div style="width: 100%">
           <el-row>
-            <el-col :span="10">
+            <el-col :span="10" style="border: 1px solid #ebeef5; padding: 10px">
               <el-form-item label="出货日期" required>
                 <el-date-picker
                   v-model="formData.data.shipmentTime"
@@ -851,7 +851,7 @@
               </div>
             </el-col>
             <el-col :span="14">
-              <div style="padding-left: 10px">
+              <div style="padding: 10px; margin-top: 77px">
                 <el-table
                   :data="formData.data.contractShipmentList"
                   :span-method="objectSpanMethod"

+ 2 - 2
src/components/process/EHSD/Sample.vue

@@ -800,7 +800,7 @@
         </div> -->
         <div style="width: 100%">
           <el-row>
-            <el-col :span="10">
+            <el-col :span="10" style="border: 1px solid #ebeef5; padding: 10px">
               <el-form-item label="出货日期" required>
                 <el-date-picker
                   v-model="formData.data.shipmentTime"
@@ -847,7 +847,7 @@
               </div>
             </el-col>
             <el-col :span="14">
-              <div style="padding-left: 10px">
+              <div style="padding: 10px; margin-top: 77px">
                 <el-table
                   :data="formData.data.sampleShipmentList"
                   :span-method="objectSpanMethod"

+ 2 - 2
src/components/process/EHSD/SampleChange.vue

@@ -802,7 +802,7 @@
 
         <div style="width: 100%">
           <el-row>
-            <el-col :span="10">
+            <el-col :span="10" style="border: 1px solid #ebeef5; padding: 10px">
               <el-form-item label="出货日期" required>
                 <el-date-picker
                   v-model="formData.data.shipmentTime"
@@ -849,7 +849,7 @@
               </div>
             </el-col>
             <el-col :span="14">
-              <div style="padding-left: 10px">
+              <div style="padding: 10px; margin-top: 77px">
                 <el-table
                   :data="formData.data.sampleShipmentList"
                   :span-method="objectSpanMethod"

+ 1 - 0
src/main.js

@@ -7,6 +7,7 @@ import Cookies from 'js-cookie'
 import ElementPlus from 'element-plus'
 import locale from 'element-plus/lib/locale/lang/zh-cn' // 中文语言
 
+import '@/utils/table2excel'
 import '@/assets/styles/index.scss' // global css
 
 import App from './App'

+ 188 - 0
src/utils/table2excel.js

@@ -0,0 +1,188 @@
+/*
+ *  jQuery table2excel - v1.0.2
+ *  jQuery plugin to export an .xls file in browser from an HTML table
+ *  https://github.com/rainabba/jquery-table2excel
+ *
+ *  Made by rainabba
+ *  Under MIT License
+ */
+//table2excel.js
+import jQuery from 'jquery';
+(function ($, window, document, undefined) {
+  var pluginName = 'table2excel',
+    defaults = {
+      exclude: '.noExl',
+      name: 'Table2Excel',
+    }
+
+  // The actual plugin constructor
+  function Plugin(element, options) {
+    this.element = element
+    // jQuery has an extend method which merges the contents of two or
+    // more objects, storing the result in the first object. The first object
+    // is generally empty as we don't want to alter the default options for
+    // future instances of the plugin
+    //
+    this.settings = $.extend({}, defaults, options)
+    this._defaults = defaults
+    this._name = pluginName
+    this.init()
+  }
+
+  Plugin.prototype = {
+    init: function () {
+      var e = this
+
+      e.template = {
+        head: '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><meta charset="UTF-8"><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets>',
+        sheet: {
+          head: '<x:ExcelWorksheet><x:Name>',
+          tail: '</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>',
+        },
+        mid: '</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><style>td{vnd.ms-excel.numberformat:@}</style></head><body>',
+        table: {
+          head: "<table border='1'>",
+          tail: '</table>',
+        },
+        foot: '</body></html>',
+      }
+
+      e.tableRows = []
+
+      // get contents of table except for exclude
+      $(e.element).each(function (i, o) {
+        var tempRows = ''
+        $(o)
+          .find('tr')
+          .not(e.settings.exclude)
+          .each(function (i, o) {
+            tempRows += "<tr align='center' valign='center'>" + $(o).html() + '</tr>'
+          })
+        e.tableRows.push(tempRows)
+      })
+
+      // exclude img tags
+      if (e.settings.exclude_img) {
+        e.tableRows[0] = exclude_img(e.tableRows[0])
+      }
+
+      // exclude link tags
+      if (e.settings.exclude_links) {
+        e.tableRows[0] = exclude_links(e.tableRows[0])
+      }
+
+      // exclude input tags
+      if (e.settings.exclude_inputs) {
+        e.tableRows[0] = exclude_inputs(e.tableRows[0])
+      }
+
+      e.tableToExcel(e.tableRows, e.settings.name, e.settings.sheetName)
+    },
+
+    tableToExcel: function (table, name, sheetName) {
+      var e = this,
+        fullTemplate = '',
+        i,
+        link,
+        a
+
+      e.uri = 'data:application/vnd.ms-excel;base64,'
+      e.base64 = function (s) {
+        return window.btoa(unescape(encodeURIComponent(s)))
+      }
+      e.format = function (s, c) {
+        return s.replace(/{(\w+)}/g, function (m, p) {
+          return c[p]
+        })
+      }
+      e.ctx = {
+        worksheet: name || 'Worksheet',
+        table: table,
+      }
+
+      fullTemplate = e.template.head
+
+      if ($.isArray(table)) {
+        for (i in table) {
+          //fullTemplate += e.template.sheet.head + "{worksheet" + i + "}" + e.template.sheet.tail;
+          fullTemplate += e.template.sheet.head + sheetName + e.template.sheet.tail
+        }
+      }
+
+      fullTemplate += e.template.mid
+
+      if ($.isArray(table)) {
+        for (i in table) {
+          fullTemplate += e.template.table.head + '{table' + i + '}' + e.template.table.tail
+        }
+      }
+
+      fullTemplate += e.template.foot
+
+      for (i in table) {
+        e.ctx['table' + i] = table[i]
+      }
+      delete e.ctx.table
+
+      if ((typeof msie !== 'undefined' && msie > 0) || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
+        // If Internet Explorer
+        if (typeof Blob !== 'undefined') {
+          //use blobs if we can
+          fullTemplate = [fullTemplate]
+          //convert to array
+          var blob1 = new Blob(fullTemplate, {
+            type: 'text/html'
+          })
+          window.navigator.msSaveBlob(blob1, getFileName(e.settings))
+        } else {
+          //otherwise use the iframe and save
+          //requires a blank iframe on page called txtArea1
+          txtArea1.document.open('text/html', 'replace')
+          txtArea1.document.write(fullTemplate)
+          txtArea1.document.close()
+          txtArea1.focus()
+          sa = txtArea1.document.execCommand('SaveAs', true, getFileName(e.settings))
+        }
+      } else {
+        link = e.uri + e.base64(e.format(fullTemplate, e.ctx))
+        a = document.createElement('a')
+        a.download = getFileName(e.settings)
+        a.href = link
+        a.click()
+      }
+
+      return true
+    },
+  }
+
+  function getFileName(settings) {
+    return (settings.filename ? settings.filename : 'table2excel') + '.xls'
+  }
+
+  // Removes all img tags
+  function exclude_img(string) {
+    return string.replace(/<img[^>]*>/gi, '')
+  }
+
+  // Removes all link tags
+  function exclude_links(string) {
+    return string.replace(/<A[^>]*>|<\/A>/g, '')
+  }
+
+  // Removes input params
+  function exclude_inputs(string) {
+    return string.replace(/<input[^>]*>|<\/input>/gi, '')
+  }
+
+  $.fn[pluginName] = function (options) {
+    var e = this
+    e.each(function () {
+      if (!$.data(e, 'plugin_' + pluginName)) {
+        $.data(e, 'plugin_' + pluginName, new Plugin(this, options))
+      }
+    })
+
+    // chain jQuery functions
+    return e
+  }
+})(jQuery, window, document)

+ 5 - 0
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -250,6 +250,11 @@ const selectConfig = computed(() => {
       prop: "sellCorporationId",
       data: corporationList.value,
     },
+    {
+      label: "业务员",
+      prop: "userId",
+      data: userList.value,
+    },
   ];
 });
 const config = computed(() => {

+ 23 - 1
src/views/EHSD/saleContract/sampleEHSD/index.vue

@@ -159,7 +159,9 @@
     </el-dialog>
 
     <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="920">
-      <SamplePDF :rowData="rowData"></SamplePDF>
+      <div id="tableId">
+        <SamplePDF :rowData="rowData"></SamplePDF>
+      </div>
       <template #footer>
         <el-button @click="openPrint = false" size="large">取消</el-button>
         <el-button type="primary" v-print="printObj" size="large"
@@ -168,6 +170,9 @@
         <el-button type="primary" @click="clickDownload()" size="large"
           >下载PDF</el-button
         >
+        <!-- <el-button type="primary" @click="deriveExcel()" size="large"
+          >导出</el-button
+        > -->
       </template>
     </el-dialog>
   </div>
@@ -181,6 +186,18 @@ import useUserStore from "@/store/modules/user";
 import { ElMessage, ElMessageBox } from "element-plus";
 import ContractDetailsOne from "@/components/contractCom/contractDetailsOne.vue";
 import SamplePDF from "@/components/PDF/samplePDF.vue";
+
+import $ from "jquery";
+const deriveExcel = () => {
+  $("#tableId").table2excel({
+    exclude: ".noExl",
+    sheetName: "订单对账单",
+    filename: "订单对账单",
+    exclude_img: false,
+    exclude_links: false,
+    exclude_inputs: true,
+  });
+};
 const route = useRoute();
 const { proxy } = getCurrentInstance();
 const accountCurrency = ref([]);
@@ -250,6 +267,11 @@ const selectConfig = computed(() => {
       prop: "sellCorporationId",
       data: corporationList.value,
     },
+    {
+      label: "业务员",
+      prop: "userId",
+      data: userList.value,
+    },
   ];
 });
 

+ 44 - 2
src/views/connect/E-mail/signature/index.vue

@@ -62,6 +62,25 @@
         >
       </template>
     </el-dialog>
+
+    <el-dialog
+      title="预览"
+      v-if="previewDialog"
+      v-model="previewDialog"
+      width="60%"
+    >
+      <div style="width: 100%" class="main">
+        <img src="@/assets/images/mail-preview.png" alt="" class="img" />
+        <div class="body">签名</div>
+      </div>
+      <div style="display: flex; align-items: center; margin-top: 20px">
+        <div style="margin-right: 5px">选择签名</div>
+        <el-select disabled v-model="selectRowData"> </el-select>
+      </div>
+      <template #footer>
+        <el-button @click="previewDialog = false" size="large">取 消</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -127,7 +146,7 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              openModal(row);
+              openModalOne(row);
             },
           },
           {
@@ -138,7 +157,7 @@ const config = computed(() => {
             },
             el: "button",
             click() {
-              clickPrint(row);
+              getDtl(row);
             },
           },
           {
@@ -265,6 +284,11 @@ const getDtl = (row) => {
     formData.data = res;
   });
 };
+const selectRowData = ref("ceshi");
+const previewDialog = ref(false);
+const openModalOne = (row) => {
+  previewDialog.value = true;
+};
 </script>
 
 <style lang="scss" scoped>
@@ -274,4 +298,22 @@ const getDtl = (row) => {
 .ql-editor {
   padding: 0px;
 }
+.main {
+  position: relative;
+  .img {
+    width: 100%;
+    // height: 500px;
+    object-fit: contain;
+    vertical-align: middle;
+  }
+  .body {
+    padding: 10px;
+    position: absolute;
+    background: #fff;
+    min-height: 20%;
+    left: 6%;
+    bottom: 16px;
+    min-width: 50%;
+  }
+}
 </style>

+ 4 - 5
src/views/customer/file/index.vue

@@ -134,9 +134,9 @@
                         跟进人:
                         {{ dictValueLabel(record.createUser, userList) }}
                       </div>
-                      <div style="margin-top: 8px">
+                      <!-- <div style="margin-top: 8px">
                         跟进内容: {{ record.content }}
-                      </div>
+                      </div> -->
 
                       <div v-if="record.type == '30'">
                         <div
@@ -219,7 +219,7 @@
                 >
                   <el-option
                     v-for="item in countryData"
-                    :label="item.chineseName"
+                    :label="item.name"
                     :value="item.id"
                   >
                   </el-option>
@@ -593,7 +593,7 @@
                 >
                   <el-option
                     v-for="item in countrySearchData"
-                    :label="item.chineseName"
+                    :label="item.name"
                     :value="item.id"
                   >
                   </el-option>
@@ -1111,7 +1111,6 @@ const formConfig = computed(() => {
       slotName: "person",
       label: "客户联系人",
     },
-    
   ];
 });
 const rules = ref({

+ 2 - 2
src/views/customer/highseas/index.vue

@@ -215,7 +215,7 @@
                 >
                   <el-option
                     v-for="item in countryData"
-                    :label="item.chineseName"
+                    :label="item.name"
                     :value="item.id"
                   >
                   </el-option>
@@ -565,7 +565,7 @@
                 >
                   <el-option
                     v-for="item in countrySearchData"
-                    :label="item.chineseName"
+                    :label="item.name"
                     :value="item.id"
                   >
                   </el-option>

+ 2 - 2
src/views/customer/privatesea/index.vue

@@ -215,7 +215,7 @@
                 >
                   <el-option
                     v-for="item in countryData"
-                    :label="item.chineseName"
+                    :label="item.name"
                     :value="item.id"
                   >
                   </el-option>
@@ -565,7 +565,7 @@
                 >
                   <el-option
                     v-for="item in countrySearchData"
-                    :label="item.chineseName"
+                    :label="item.name"
                     :value="item.id"
                   >
                   </el-option>