From c676e48cfcfae16cf276e75af57d0c79344bbcdc Mon Sep 17 00:00:00 2001 From: zhangyanpeng <bob.zhang@highdatas.com> Date: 星期二, 21 一月 2020 13:47:43 +0800 Subject: [PATCH] 添加文件库,上传参数 --- src/views/calendarTask.vue | 35 +++++++++++++++++++++++++++++------ 1 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/views/calendarTask.vue b/src/views/calendarTask.vue index 93960d9..6d33cd1 100644 --- a/src/views/calendarTask.vue +++ b/src/views/calendarTask.vue @@ -16,12 +16,12 @@ <span>{{task_itm.desc}}</span> <div v-for="(type_itm, k_) in task_itm.children" :key="k_" class="right_row_"> <span>{{k_+1}}銆亄{type_itm.name}}</span> - <el-button size="mini" type="primary" style="float: right; margin-top: 10px;" @click="handleTask(type_itm.id, type_itm.mustAttach)">澶勭悊浠诲姟</el-button> + <el-button size="mini" type="primary" style="float: right; margin-top: 10px;" @click="handleTask(type_itm.id, type_itm.mustAttach, type_itm)">澶勭悊浠诲姟</el-button> </div> </div> </div> - <el-dialog @close="Cancel" width="20%" top="10%" :visible.sync="dialog_1"> + <el-dialog @close="Cancel" width="40%" top="10%" :visible.sync="dialog_1"> <div slot="title" class="dialog-title" style="text-align: left;"> <span> 涓婁紶浜や粯鐗� </span> </div> @@ -31,17 +31,29 @@ class="upload-demo" :action="upload_url" multiple + :data="upData" :limit="3" :file-list="fileList" + :auto-upload='false' ref="upload" > - <el-button size="medium" type="text">鐐瑰嚮涓婁紶</el-button> + <el-button size="medium" type="text">閫夋嫨鏂囦欢</el-button> <div slot="tip" class="el-upload__tip">鏂囦欢涓嶈秴杩�500kb</div> </el-upload> + <div style="text-align: left;"> + <span>鎻忚堪</span> + <el-input + type="textarea" + :rows="2" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="desc_task"> + </el-input> + </div> </div> <!-- 澶勭悊瀹屾垚 --> <div slot="footer" class="dialog-footer"> + <el-button @click="submitUpload">鐐瑰嚮涓婁紶</el-button> <el-button @click="Cancel">鍙� 娑�</el-button> <el-button type="primary" @click="doHandleTask">澶勭悊瀹屾垚</el-button> </div> @@ -69,6 +81,8 @@ dialog_1: false, handleTaskType: {}, upload_url: "", + desc_task: "", + upData: {}, fileList: [], } }, @@ -110,15 +124,14 @@ ); }, - handleTask(id, mustAttach) { - this.handleTaskType.id = id; + handleTask(id, mustAttach, type_itm) { + this.handleTaskType = type_itm; if(mustAttach) { this.dialog_1 = true; } else { this.doHandleTask(); } - }, doHandleTask() { @@ -129,7 +142,17 @@ if (this.dialog_1) { this.Cancel(); } + }, + + submitUpload() { + this.handleTaskType; //瑕佸鐞嗙殑鏄庣粏鏁版嵁 + this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁� + desc_task: this.desc_task, + + }, + this.upload_url = ""; //璁剧疆涓婁紶鎺ュ彛 + this.$refs.upload.submit();//寮�濮嬩笂浼� }, Cancel() { -- Gitblit v1.8.0