上传按钮增加 节流,防止重复点击

This commit is contained in:
liuyp 2024-08-18 00:06:51 +08:00
parent 5f3d416529
commit 5046b87a1f
14 changed files with 85 additions and 13 deletions

View File

@ -125,6 +125,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
import EmisGetPreSitePicker from '@/views/emis/EmisBaseTools/EmisGetPreSitePicker.vue';
import { parseTime, dateToStr } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "ArrivalAndDispathScan",
@ -191,6 +192,7 @@ export default {
this.form.recordMan=this.$store.getters.empName;
this.form.recordManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
@ -421,8 +423,11 @@ export default {
// }
},
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
async handleScanUpload(){
async handleScanUpload2(){
var selData = this.selection;
let newList = Array.from(this.emisTmsScanRecordList);
let dataMap = this.dataMap;

View File

@ -124,6 +124,7 @@
import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "ArrivalScan",
@ -193,6 +194,8 @@ export default {
this.form.dispatchOrSendMan=this.$store.getters.empName;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
let tableH = form.offsetHeight+265;
@ -369,8 +372,11 @@ export default {
// }
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -137,6 +137,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisGetNextSitePicker from '@/views/emis/EmisBaseTools/EmisGetNextSitePicker.vue';
import EmisPackNoPicker from '@/views/emis/EmisBaseTools/EmisPackNoPicker.vue';
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
@ -207,6 +208,7 @@ export default {
this.form.recordManCode=this.$store.getters.empCode;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
@ -387,8 +389,11 @@ export default {
// }
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -132,6 +132,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisGetNextSitePicker from '@/views/emis/EmisBaseTools/EmisGetNextSitePicker.vue';
import { parseTime } from "@/utils/custom";
import { getWaybillDetail} from "@/api/emis/emisWaybill";
import { throttle } from 'throttle-debounce'
export default {
name: "CustomsClearScan",
@ -200,6 +201,7 @@ export default {
this.form.recordManCode=this.$store.getters.empCode;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
@ -392,8 +394,11 @@ export default {
// }
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -130,6 +130,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisGetNextSitePicker from '@/views/emis/EmisBaseTools/EmisGetNextSitePicker.vue';
import { parseTime } from "@/utils/custom";
import { getWaybillDetail} from "@/api/emis/emisWaybill";
import { throttle } from 'throttle-debounce'
export default {
name: "CustomsDeclearScan",
@ -198,6 +199,7 @@ export default {
this.form.recordManCode=this.$store.getters.empCode;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
@ -394,8 +396,11 @@ export default {
// }
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -121,6 +121,7 @@
import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "DeliveryScan",
@ -188,6 +189,8 @@ export default {
this.form.recordMan=this.$store.getters.empName;
this.form.recordManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
// this.form.dispatchOrSendMan=this.$store.getters.empName;
// this.form.dispatchOrSendManCode=this.$store.getters.empCode;
@ -371,8 +374,11 @@ export default {
// }
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -125,6 +125,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisGetNextSitePicker from '@/views/emis/EmisBaseTools/EmisGetNextSitePicker.vue';
import CarSimplePicker from '@/views/emis/EmisBaseTools/CarSimplePicker.vue';
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "LoadingScan",
@ -193,6 +194,7 @@ export default {
this.form.recordManCode=this.$store.getters.empCode;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
@ -372,8 +374,11 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -130,6 +130,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisGetNextSitePicker from '@/views/emis/EmisBaseTools/EmisGetNextSitePicker.vue';
import { parseTime } from "@/utils/custom";
import { getWaybillDetail} from "@/api/emis/emisWaybill";
import { throttle } from 'throttle-debounce'
export default {
name: "OutgoingScan",
@ -198,6 +199,7 @@ export default {
this.form.recordManCode=this.$store.getters.empCode;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
@ -392,8 +394,11 @@ export default {
// }
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -131,6 +131,7 @@
import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "PositionScanning",
@ -202,6 +203,8 @@ export default {
this.form.dispatchOrSendMan=this.$store.getters.empName;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
let tableH = form.offsetHeight+265;
@ -381,8 +384,11 @@ export default {
// }
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -124,6 +124,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
// import { map } from "jquery";
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "ScanRecord",
@ -192,6 +193,7 @@ export default {
this.form.dispatchOrSendMan=this.$store.getters.empName;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
@ -359,8 +361,11 @@ export default {
this.multiple = !selection.length
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -269,6 +269,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import CustomerSimplePicker from '@/views/emis/EmisBaseTools/CustomerSimplePicker.vue';
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "SignAndRecord",
@ -334,6 +335,7 @@ export default {
this.form.dispatchOrSendMan=this.$store.getters.empName;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
},
methods: {
@ -569,8 +571,11 @@ export default {
this.sender = {};
}
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.$refs.multipleTable.selection;
console.log(selData);
let newList = [];

View File

@ -121,6 +121,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
// import { map } from "jquery";
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "TakeDeliveryScan",
@ -186,6 +187,7 @@ export default {
this.form.recordMan=this.$store.getters.empName;
this.form.recordManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
@ -347,8 +349,11 @@ export default {
this.multiple = !selection.length
},
// 扫描上传
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
handleScanUpload2(){
var selData = this.selection;
console.log(selData);

View File

@ -175,6 +175,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisUserSimplePicker from '@/views/emis/EmisBaseTools/EmisUserSimplePicker.vue';
import EmisGetNextSitePicker from '@/views/emis/EmisBaseTools/EmisGetNextSitePicker.vue';
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "TransmitReceiveScanning",
@ -249,6 +250,7 @@ export default {
this.form.dispatchOrSendMan=this.$store.getters.empName;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;
@ -486,8 +488,13 @@ export default {
// }
},
handleScanUpload(){
this.scanUpload();
},
// 扫描上传
async handleScanUpload(){
async handleScanUpload2(){
// 扫描上传
// async handleScanUpload(){
var selData = this.selection;
let newList = Array.from(this.emisTmsScanRecordList);
let dataMap = this.dataMap;

View File

@ -119,6 +119,7 @@ import { doScan } from "@/api/emis/emisTmsScanRecord";
import EmisGetNextSitePicker from '@/views/emis/EmisBaseTools/EmisGetNextSitePicker.vue';
import CarSimplePicker from '@/views/emis/EmisBaseTools/CarSimplePicker.vue';
import { parseTime } from "@/utils/custom";
import { throttle } from 'throttle-debounce'
export default {
name: "UnLoadingScan",
@ -187,6 +188,7 @@ export default {
this.form.recordManCode=this.$store.getters.empCode;
this.form.dispatchOrSendManCode=this.$store.getters.empCode;
this.scanUpload = throttle(1000, () => { this.handleScanUpload2()}, { noLeading: false, noTrailing: true });
this.$nextTick(function() {
let form = this.$refs.form.$el;