From a36a95ee0962af12a40e471cd706f2880f439887 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期四, 24 八月 2023 14:11:14 +0800 Subject: [PATCH] 面板的页面跳转 修改 2023-8-24 --- src/components/AddControl.vue | 76 +++++++++++++------------------------ 1 files changed, 27 insertions(+), 49 deletions(-) diff --git a/src/components/AddControl.vue b/src/components/AddControl.vue index 3317633..b913beb 100644 --- a/src/components/AddControl.vue +++ b/src/components/AddControl.vue @@ -23,14 +23,13 @@ <div style="color:#333;font-size:15px; font-weight:700;margin-bottom:10px;">宸ヨ壓鍙傛暟</div> <el-form ref="form" - :model="form" label-width="80px" label-position="left" > <div v-for="(item,index) in Arr" :key="index"> - <el-form-item :label="item.value" prop="estimateHour" class="form-item"> + <el-form-item :label="item.Key" prop="estimateHour" class="form-item"> <el-input - v-model="item.key" + v-model="item.Value" placeholder="璇疯緭鍏�" disabled ></el-input> @@ -41,7 +40,7 @@ <div slot="footer" class="dialog-footer tac"> <el-button @click="shutdown">鍏抽棴</el-button> - <el-button type="primary" @click="onSubmit(form)">涓嬪彂鍙傛暟</el-button> + <el-button type="primary" @click="onSubmit()">涓嬪彂鍙傛暟</el-button> </div> </el-dialog> </template> @@ -65,54 +64,32 @@ data() { return { islook: false, - form: { - consumedHour: null, - directorID: "", - endDate: "", - estimateHour: null, - priority: null, - progress: null, - projectID: "", - taskName: "", - }, - Arr:[ - { - value:'璁惧畾闀垮害', - key:'100m', - }, - { - value:'鍒囧壊鏃堕棿', - key:'100s', - } - ] + Arr:[] }; }, mounted() { - this.getStartInfo() + }, watch: { islook(val) { if (val) { - this.form = { - consumedHour: null, - directorID: "", - endDate: "", - estimateHour: null, - priority: null, - progress: null, - projectID: "", - taskName: "", - }; + this.getStartInfo() + } }, }, methods: { getStartInfo(){ - startTask({id:this.id}).then(res=>{ - if(res.code==200){ - - } - }) + if(this.id){ + startTask({id:this.id}).then(res=>{ + if(res.code==200){ + this.Arr=res.data.Params; + } + }) + }else{ + this.$message.error("褰撳墠璁惧娌℃湁宸ュ簭锛�"); + } + }, validatorNum(rule, value, callback) { if (value) { @@ -133,18 +110,19 @@ onSubmit() { - - sendProcessParams({id:this.id}).then(res=>{ - if(res.code==200){ - this.$message.success("涓嬪彂鎴愬姛锛�"); - this.$emit("shutdown", this.form); - this.shutdown(); - } - }) + if(this.id){ + sendProcessParams({id:this.id}).then(res=>{ + if(res.code==200){ + this.$message.success("涓嬪彂鎴愬姛锛�"); + this.shutdown(); + } + }) + }else{ + this.$message.error("褰撳墠璁惧娌℃湁宸ュ簭锛�"); + } }, shutdown() { this.islook = false; - this.$refs.form.resetFields(); }, }, }; -- Gitblit v1.8.0