DESKTOP-70VPDLK\Administrator 1 yıl önce
ebeveyn
işleme
f814003be6

+ 1 - 0
api/transfer.js

@@ -4,3 +4,4 @@ const newsUrl = '/api/transfer/'
 // 获取基本信息
 export const getTransferList = (data) => request(newsUrl + 'list', 'post', { ...data },false)
 export const addTransferPdf = (data) => request(newsUrl + 'add', 'post', { ...data },true)
+export const cancelPassword = (data) => request(newsUrl + 'cancel', 'post', { ...data },true)

+ 46 - 19
page_subpack/transition/components/add-file.vue

@@ -1,7 +1,9 @@
 <template>
 	<view class="text-color-12">
 		<view class="p-30">
-			<textarea class="sys-from-background-color r-20 textarea p-20" name="" id="" cols="30" rows="10"
+      <en-input :label="'文件密码'"
+                v-model="msgData.password" type="digit" placeholder="文件有密码必填"></en-input>
+			<textarea class="sys-from-background-color r-20 textarea p-20 m-t20" name="" id="" cols="30" rows="10"
 				v-model="msgData.msg" :maxlength="999" :placeholder="placeholder"></textarea>
 			<view class="size-26 m-tb20 sys-weight-600">上传附件</view>
 			<view class="">
@@ -19,7 +21,7 @@
 					<image class="delete-iocn wh-25" src="/page_subpack/static/img/task-details/hint-subtract.png"
 						@click.stop="delFile(fileIndex)" mode=""></image>
 				</view>
-				<view class="sys-from-background-color row-c p-20 r-20" @click.stop="uploadingWord()">
+				<view class="sys-from-background-color row-c p-20 r-20" @click.stop="uploadingWord()" v-if="is_multifile===true || msgData.file_list.length<1">
 					<image class="wh-80 m-r20" src="/page_subpack/static/img/task-details/add-file.png"
 						mode="aspectFill">
 					</image>
@@ -38,16 +40,22 @@
 <script>
 	import tools from "@/service/tools";
 	import txUploadFile from "@/service/txOssSts";
-	import {
-		addTransferPdf
-	} from "@/api/transfer";
+  import {
+    addTransferPdf, cancelPassword
+  } from "@/api/transfer";
+  import EnInput from "@/components/en-from/en-input/en-input.vue";
 
 	export default {
+    components: {EnInput},
 		props: {
 			is_button: {
 				type: Boolean,
 				default: false
 			},
+      is_multifile: {
+        type: Boolean,
+        default: true
+      },
 			placeholder: {
 				default: '留个言吧~~'
 			}
@@ -58,6 +66,7 @@
 				msgData: {
 					business_id: '',
 					msg: '',
+          password: '',
 					reply_id: 0,
 					msg_img: [],
 					file_list: [],
@@ -68,25 +77,43 @@
 		},
 
 		methods: {
-
+      cancelPassword(){
+        cancelPassword(this.msgData).then(res=>{
+          if(res.code===1){
+            this.msgData.file_list=res.data
+            this.addTransferPdf()
+          }else {
+            tools.error(res.msg)
+            this.isAjax = false;
+          }
+        })
+      },
 
 			clickBut() {
 				if (this.isAjax) {
 					return;
 				}
-				addTransferPdf(this.msgData).then((res) => {
-					if (res.code === 1) {
-						tools.success(res.msg)
-						this.$emit('newMsg')
-						this.msgData.msg = ''
-						this.msgData.file_list = []
-					} else {
-						tools.error(res.msg)
-						this.isAjax = false;
-					}
-
-				})
+				if(this.msgData.password!==''){
+          this.cancelPassword()
+        }else {
+          this.addTransferPdf()
+        }
 			},
+      addTransferPdf(){
+        addTransferPdf(this.msgData).then((res) => {
+          if (res.code === 1) {
+            tools.success(res.msg)
+            this.$emit('newMsg')
+            this.msgData.msg = ''
+            this.msgData.password = ''
+            this.msgData.file_list = []
+          } else {
+            tools.error(res.msg)
+
+          }
+          this.isAjax = false;
+        })
+      },
 			delFile(fileIndex) {
 				this.msgData.file_list.splice(fileIndex, 1)
 				this.fileNum = -1
@@ -230,4 +257,4 @@
 		display: inline-block;
 		margin-bottom: 10rpx;
 	}
-</style>
+</style>

+ 2 - 2
page_subpack/transition/to_excel.vue

@@ -40,7 +40,7 @@
           <image class="wh-25" src="/page_subpack/static/img/task-details/close.png" mode="" @click="endAdd(true)">
           </image>
         </view>
-        <add-file @newMsg="endAdd"></add-file>
+        <add-file @newMsg="endAdd" :is_multifile="false"></add-file>
       </view>
 
     </uni-popup>
@@ -202,4 +202,4 @@ export default {
 button::after {
   border: none;
 }
-</style>
+</style>

+ 4 - 0
pages.json

@@ -274,6 +274,10 @@
         "name": "任务详情",
         "path": "/page_task/task_details/task_details",
         "query": "taskId=4290&isReturn=1"
+      },
+      {
+        "name": "文件识别",
+        "path": "page_subpack/transition/to_excel"
       }
     ]
   }

+ 7 - 0
service/ajax.js

@@ -12,12 +12,19 @@ export const request = (url, method, data, show = false) => {
   let token=uni.getStorageSync('token')
   // data.token = token;
   // data.m_id = uni.getStorageSync('m_id')
+  if(url==='/api/task/add'){
+    console.log('token:'+token)
+  }
+
   if (show) {
     tools.showLoading();
   }
   if (data === undefined) {
     data = {};
   }
+  if(url==='/api/task/add'){
+    console.log(data)
+  }
   return new Promise((resolve, reject) => {
     // 封装主体:网络请求
     console.log(url)