From 3453eed4c505a5ffe765cc702836f5f5d9d5d5da Mon Sep 17 00:00:00 2001 From: kimi <kimi42345@gmail.com> Date: 星期四, 23 一月 2020 14:50:52 +0800 Subject: [PATCH] 添加逻辑 --- src/components/popup/newProject.vue | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/components/popup/newProject.vue b/src/components/popup/newProject.vue index 5d6d823..589a4cc 100644 --- a/src/components/popup/newProject.vue +++ b/src/components/popup/newProject.vue @@ -35,8 +35,8 @@ </el-date-picker> </el-form-item> - <el-form-item label="椤圭洰鎻忚堪:" prop="desc" style="width: 50%;"> - <el-input type="textarea" v-model="ruleForm.desc"></el-input> + <el-form-item label="椤圭洰鎻忚堪:" prop="desp" style="width: 50%;"> + <el-input type="textarea" v-model="ruleForm.desp"></el-input> </el-form-item> </el-form> </div> @@ -63,12 +63,20 @@ import substepReadOnly from './portion/substepReadOnly.vue' export default { name: 'dataImport', + props:{ + rowData:{ + type: Object, + required: true + } + }, components: { substep, substepReadOnly }, data () { return { + userId: undefined, + assign: undefined, add_Step: 0, loading_nextStep: false, nextStepName: "涓嬩竴姝�", @@ -125,7 +133,14 @@ } }, - +mounted() { + if(this.rowData.id) { + this.ruleForm = this.rowData; + this.xmId = this.rowData.id; + } + this.userId = localStorage.getItem('userId'); + this.assign = localStorage.getItem('assign'); +}, methods:{ Cancel() { this.add_Step = 0; @@ -171,7 +186,7 @@ // this.nextStepName = "瀹� 鎴�"; } else if (this.add_Step == 2) { - this.Cancel(); + this.saveStep3(); } }, @@ -189,7 +204,9 @@ name: ruleForm_.name, startTime: items1, endTime: items2, - id: this.xmId + id: this.xmId, + desp:ruleForm_.desp, + userId: this.userId } }).then(data_ => { console.log(data_); @@ -229,10 +246,11 @@ form_obj.endTime = this.$moment(form_obj.endTime).format('YYYY-MM-DD'); // form_obj.endTime = new Date(form_obj.endTime).Format("yyyy-MM-dd").toLocaleString(); } - if (form_obj.userId) { - let leng = form_obj.userId.length; + if (form_obj.userIds) { + let leng = form_obj.userIds.length; - form_obj.userId = form_obj.userId[leng-1]; + form_obj.roleName = form_obj.userIds[leng-2]; + form_obj.userId = form_obj.userIds[leng-1]; } form_obj.type = itm_k; form_obj.parentId = this.xmId; @@ -243,7 +261,7 @@ if (is_null1) { let datas = "?datas=" + encodeURI(JSON.stringify(form_array)); - let url = "/api/schemeDetail/updates"; + let url = "/api/detail/updates"; this.$axios.get(url + datas).then(data_ => { console.log(data_); @@ -254,7 +272,20 @@ }) } }, - + saveStep3() { + let url = "/api/scheme/working/" + this.ruleForm.id; + this.$axios.get(url).then(data_ => { + if(data_.data.success) { + this.$message('椤圭洰鍚姩鎴愬姛'); + this.Cancel(); + }else { + + this.$message({message:'椤圭洰鍚姩澶辫触', type: 'warning'}); + } + }).catch(error =>{ + console.log(error); + }) + }, } } </script> -- Gitblit v1.8.0