Browse Source

用印重新申请bug

jwyu 3 years ago
parent
commit
32786f5aab
1 changed files with 15 additions and 1 deletions
  1. 15 1
      pages-approve/seal/edit.vue

+ 15 - 1
pages-approve/seal/edit.vue

@@ -234,7 +234,7 @@
 
 			//预览文件
 			handlePreviewFiles(e){
-				if (e.type === "pdf") {
+				if (e.type === "pdf"||e.type==='word') {
 					preViewFile(e.url)
 				} else {
 					uni.previewImage({
@@ -275,12 +275,19 @@
 			//处理文件
 			handleFile(filesUrl){
 				const reg = /\.(pdf)$/;
+				const reg2=	/\.doc|\.docx$/
 				if(reg.test(filesUrl)){
 					this.file={
 						type: "pdf",
 						url: filesUrl,
 						img: require("../static/pdf.png"),
 					}
+				}else if(reg2.test(filesUrl)){
+					this.file={
+						type: "word",
+						url: filesUrl,
+						img: require("../static/word.png"),
+					}
 				}else{
 					this.file={
 						type: "img",
@@ -294,12 +301,19 @@
 			async handleUpload(){
 				const res=await uploadFiles({type:'all'})
 				const reg = /\.(pdf)$/;
+				const reg2=	/\.doc|\.docx$/
 				if(reg.test(res[0])){
 					this.file={
 						type:'pdf',
 						url:res[0],
 						img:require('../static/pdf.png')
 					}
+				}else if(reg2.test(res[0])){
+					this.file={
+						type:'word',
+						url:res[0],
+						img:require('../static/word.png')
+					}
 				}else{
 					this.file={
 						type:'img',