From fadf2795757ac6df1c792546725ea177c93d9d7a Mon Sep 17 00:00:00 2001 From: kimi <kimi42345@gmail.com> Date: 星期三, 18 三月 2020 14:03:10 +0800 Subject: [PATCH] Merge branch 'master' of http://highdatas.com:9000/r/~kimi/srs --- src/views/calendarTask.vue | 46 ++++++++++++++++++++++++++++++---------------- 1 files changed, 30 insertions(+), 16 deletions(-) diff --git a/src/views/calendarTask.vue b/src/views/calendarTask.vue index d83e86c..7683f38 100644 --- a/src/views/calendarTask.vue +++ b/src/views/calendarTask.vue @@ -16,7 +16,7 @@ <span>{{task_itm.desp}}</span> <div v-for="(type_itm, k_) in task_itm.children" :key="k_" class="right_row_"> <span>{{k_+1}}銆亄{type_itm.typeStr}}</span> - <el-button size="mini" type="primary" style="float: right; margin-top: 10px;" @click="handleTask(type_itm.id, type_itm.mustAttach, type_itm)">澶勭悊浠诲姟</el-button> + <el-button size="mini" type="primary" v-if="userId === task_itm.userId" style="float: right; margin-top: 10px;" @click="handleTask(type_itm.id, type_itm.mustAttach, type_itm)">澶勭悊浠诲姟</el-button> </div> </div> </div> @@ -30,12 +30,14 @@ <el-upload class="upload-demo" :action="upload_url" - :data="upData" :limit="1" :file-list="fileList" :auto-upload='false' ref="upload" + :on-success="upSuccess" + :on-error="upError" + > <el-button size="medium" type="text">閫夋嫨鏂囦欢</el-button> <div slot="tip" class="el-upload__tip">鏂囦欢涓嶈秴杩�50M</div> @@ -77,7 +79,7 @@ ], prop:'date' ,//瀵瑰簲鏃ユ湡瀛楁鍚� DayDataTree: [], - + userId:undefined, dialog_1: false, handleTaskType: {}, upload_url: "", @@ -97,7 +99,7 @@ let iformat = imoment.format('YYYY-MM'); let systemDate = iformat + '-01 00:00:00'; this.getDatedef(systemDate); - + this.userId = localStorage.getItem('userId'); }, methods: { @@ -133,11 +135,15 @@ doHandleTask() { //姝d鐨勬槑缁嗕换鍔″畬鎴� let id = this.handleTaskType.id; + if (!this.desc_task) { + this.$message('璇峰~鍐欐弿杩�'); + return + } + this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁� + desp: this.desc_task + }; + if(this.handleTaskType.mustAttach) { - this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁� - desp: this.desc_task - }, - this.$refs.upload.submit();//寮�濮嬩笂浼� } else { @@ -167,15 +173,23 @@ } }, - // submitUpload() { - // this.handleTaskType; //瑕佸鐞嗙殑鏄庣粏鏁版嵁 + submitUpload() { + this.handleTaskType; //瑕佸鐞嗙殑鏄庣粏鏁版嵁 + + this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁� - // this.upData = {//璁剧疆瑕佷紶鐨勫弬鏁� - - // }, - // this.upload_url = ""; //璁剧疆涓婁紶鎺ュ彛 - // this.$refs.upload.submit();//寮�濮嬩笂浼� - // }, + }, + this.upload_url; //璁剧疆涓婁紶鎺ュ彛 + this.$refs.upload.submit();//寮�濮嬩笂浼� + }, + + upSuccess(response, file, fileList) { + this.$message('涓婁紶鎴愬姛'); + }, + + upError(err, file, fileList) { + this.$message('涓婁紶澶辫触'); + }, Cancel() { this.dialog_1 = false; -- Gitblit v1.8.0