diff --git a/package.json b/package.json
index 98e49d2e..95317096 100644
--- a/package.json
+++ b/package.json
@@ -66,7 +66,7 @@
"js-beautify": "1.13.0",
"js-cookie": "3.0.1",
"js-md5": "^0.7.3",
- "jsbarcode": "^3.11.5",
+ "jsbarcode": "^3.11.6",
"jsencrypt": "3.2.1",
"jsmind": "^0.4.11",
"jspdf": "^2.5.1",
diff --git a/src/utils/custom.js b/src/utils/custom.js
index 0d573e9d..775b8ea1 100644
--- a/src/utils/custom.js
+++ b/src/utils/custom.js
@@ -570,18 +570,22 @@ return null;
}
export function dateToStr(date){
- var year = date.getFullYear();//年
- var month = date.getMonth();//月
- var day = date.getDate();//日
- var hours = date.getHours();//时
- var min = date.getMinutes();//分
- var second = date.getSeconds();//秒
- return year + "-" +
- ((month + 1) > 9 ? (month + 1) : "0" + (month + 1)) + "-" +
- (day > 9 ? day : ("0" + day)) + " " +
- (hours > 9 ? hours : ("0" + hours)) + ":" +
- (min > 9 ? min : ("0" + min)) + ":" +
- (second > 9 ? second : ("0" + second));
+ if (typeof date === "object" && date instanceof Date) {
+ var year = date.getFullYear();//年
+ var month = date.getMonth();//月
+ var day = date.getDate();//日
+ var hours = date.getHours();//时
+ var min = date.getMinutes();//分
+ var second = date.getSeconds();//秒
+ return year + "-" +
+ ((month + 1) > 9 ? (month + 1) : "0" + (month + 1)) + "-" +
+ (day > 9 ? day : ("0" + day)) + " " +
+ (hours > 9 ? hours : ("0" + hours)) + ":" +
+ (min > 9 ? min : ("0" + min)) + ":" +
+ (second > 9 ? second : ("0" + second));
+ }else{
+ return date;
+ }
}
export function strToDate(datestr){
@@ -590,15 +594,21 @@ export function strToDate(datestr){
//字符串转字符串
export function formatDate(dateStr) {
+ if(!dateStr) return dateStr;
+
var newdateStr = dateStr.replace(/\d+(?=-[^-]+$)/, (a) => (parseInt(a, 10) - 1)); //字符串处理(月份)
var nums = newdateStr.match(/\d+/g); //取数
var date = eval('new Date(' + nums + ')'); //转换
//重组
- var datetime =
- date.getFullYear() + "-" + //年
- ((date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0" + (date.getMonth() + 1)) + "-" + //月
- (date.getDate() > 9 ? date.getDate() : ("0" + date.getDate())); //日
- return datetime;
+ if (typeof date === "object" && date instanceof Date) {
+ var datetime =
+ date.getFullYear() + "-" + //年
+ ((date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0" + (date.getMonth() + 1)) + "-" + //月
+ (date.getDate() > 9 ? date.getDate() : ("0" + date.getDate())); //日
+ return datetime;
+ }else{
+ return dateStr;
+ }
}
diff --git a/src/utils/pdfUtils.js b/src/utils/pdfUtils.js
index 86260839..17297128 100644
--- a/src/utils/pdfUtils.js
+++ b/src/utils/pdfUtils.js
@@ -1,4 +1,5 @@
import { degrees,PageSizes, PDFDocument, rgb, StandardFonts } from 'pdf-lib';
+import JsBarcode from 'jsbarcode'
import axios from "axios";
import Buffer from 'vue-buffer'
import * as pdfjs from 'pdfjs-dist';
diff --git a/src/views/emis/emisTmsScanRecord/signatureAbnormalComparison.vue b/src/views/emis/emisTmsScanRecord/signatureAbnormalComparison.vue
index fd0bfb90..fa3cfece 100644
--- a/src/views/emis/emisTmsScanRecord/signatureAbnormalComparison.vue
+++ b/src/views/emis/emisTmsScanRecord/signatureAbnormalComparison.vue
@@ -17,9 +17,10 @@