qukaidi 3 yıl önce
ebeveyn
işleme
390fb91f32
2 değiştirilmiş dosya ile 31 ekleme ve 16 silme
  1. 24 12
      src/main.js
  2. 7 4
      src/views/businessManagement/purchaseOrder/index.vue

+ 24 - 12
src/main.js

@@ -73,7 +73,7 @@ import {
 // 导入弹窗放大样式
 import '@/assets/css/form.css'
 // 客户调出收发货地址
-import {corpAddr} from "@/components/function/corpAddrSelect"
+import { corpAddr } from "@/components/function/corpAddrSelect"
 //获取浏览器指纹并生成ID
 import Fingerprint2 from 'fingerprintjs2'
 Vue.component('trackPlayback', trackPlayback);
@@ -139,11 +139,11 @@ iconfontVersion.forEach(ele => {
 Vue.prototype.getColumnName = getColumnName
 Vue.prototype.getColumnData = getColumnData
 Vue.prototype.saveColumnData = saveColumnData
-Vue.prototype.delColumnData=delColumnData
+Vue.prototype.delColumnData = delColumnData
 //进入详情页时,保存id和其他参数
-Vue.prototype.inDetailsKey=inDetailsKey
+Vue.prototype.inDetailsKey = inDetailsKey
 //离开详情页时,清除对应key的id和其他参数
-Vue.prototype.leaveDetailsKey=leaveDetailsKey
+Vue.prototype.leaveDetailsKey = leaveDetailsKey
 Vue.config.productionTip = false;
 Vue.prototype.corpAddr = corpAddr;
 // 业务锁
@@ -174,7 +174,7 @@ Vue.directive("input-limit", {
       flag = true;
     });
     target.addEventListener("input", e => {
-      setTimeout(function() {
+      setTimeout(function () {
         if (flag) {
           if (binding.value == 0) {
             if (wins_0.test(e.target.value)) {
@@ -203,7 +203,7 @@ Vue.directive("input-limit", {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
                   '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(
-                  ".") + 2)
+                    ".") + 2)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
               }
@@ -231,7 +231,7 @@ Vue.directive("input-limit", {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
                   '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(
-                  ".") + 3)
+                    ".") + 3)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
               }
@@ -259,7 +259,7 @@ Vue.directive("input-limit", {
               if (!no_int) {
                 e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
                   '$#$', '.').substring(0, e.target.value.indexOf(
-                  ".") + 5)
+                    ".") + 5)
               } else {
                 e.target.value = e.target.value.replace(wins_0, "")
               }
@@ -271,8 +271,20 @@ Vue.directive("input-limit", {
     })
   }
 })
-Fingerprint2.get(function(components) {
-  const values = components.map(function(component,index) {
+
+Vue.directive('debounce', { //防抖函数指令
+  inserted: function (el, binding) {
+    el.addEventListener("click", () => {
+      if (!el.disabled)
+        el.disabled = true
+      setTimeout(() => {
+        el.disabled = false
+      }, binding.value || 1000);
+    });
+  }
+})
+Fingerprint2.get(function (components) {
+  const values = components.map(function (component, index) {
     if (index === 0) {
       return component.value.replace(/\bNetType\/\w+\b/, '')
     }
@@ -280,7 +292,7 @@ Fingerprint2.get(function(components) {
   })
   // 生成最终id murmur
   const murmur = Fingerprint2.x64hash128(values.join(''), 31)
-  if(localStorage.getItem('browserID')!=murmur){
-    localStorage.setItem('browserID',murmur)
+  if (localStorage.getItem('browserID') != murmur) {
+    localStorage.setItem('browserID', murmur)
   }
 })

+ 7 - 4
src/views/businessManagement/purchaseOrder/index.vue

@@ -39,7 +39,7 @@
           {{ scope.row.createFreight == 1 ? '是' : '否' }}
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button type="text" icon="el-icon-delete" size="small" @click.stop="createPlant(scope.row, scope.index)"
+          <el-button type="text" icon="el-icon-delete" size="small" v-debounce @click.stop="createPlant(scope.row, scope.index)"
             :disabled="scope.row.status > 0 || scope.row.createFreight == 1">生成工厂发货
           </el-button>
           <!--          <el-button-->
@@ -67,7 +67,8 @@
     <el-dialog append-to-body title="账单" class="el-dialogDeep" :visible.sync="financialAccountDialog" width="70%"
       :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
       <financial-account v-if="financialAccountDialog" :billType="billType" :billData="billData"
-        :checkData="financeData" :arrList="applyPaymentList" @choceFun="choceFun" tradeType="GN" @submit="feeSubmit" :addBut="false">
+        :checkData="financeData" :arrList="applyPaymentList" @choceFun="choceFun" tradeType="GN" @submit="feeSubmit"
+        :addBut="false">
       </financial-account>
     </el-dialog>
   </div>
@@ -493,8 +494,8 @@ export default {
           price,
           unit: '条',
           remarks: item.orderRemark,
-          itemorderAmount:item.orderAmount,
-          itemId:item.id
+          itemorderAmount: item.orderAmount,
+          itemId: item.id
         }
         a.push(form)
         // item.itemsList.forEach(e => {
@@ -547,6 +548,7 @@ export default {
     },
     // 生成工厂发货
     createPlant(row, index) {
+      console.log(111)
       let ids = [];
       row.itemsList.forEach(item => {
         ids.push(item.id)
@@ -561,6 +563,7 @@ export default {
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
+          this.loading = true
           res.data.data.orgId = res.data.data.id
           res.data.data.deliveryStatus = '录入'
           res.data.data.salesCompany = res.data.data.belongToCorpId