Commit 4f05661c by cpa

修改添加后页面未关闭

parent 3be66547
<template> <template>
<div class="execution"> <div class="execution">
<basic-container v-loading="loading"> <basic-container v-loading="loading">
<el-form :model="form" :rules="rules" ref="refForm" label-width="110px" label-position="left"> <el-form :model="form" :rules="rules" ref="refForm" label-width="110px" label-position="left">
...@@ -163,18 +161,14 @@ ...@@ -163,18 +161,14 @@
</el-form> </el-form>
</basic-container> </basic-container>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button> <el-button @click="handleClose">取 消</el-button>
<el-button type="primary" :loading="loading" @click="onSubmit">确 认</el-button> <el-button type="primary" :loading="loading" @click="onSubmit">确 认</el-button>
</span> </span>
<!-- 规格显示控件 --> <!-- 规格显示控件 -->
<type-select v-if="this.form.goodsClassId != undefined" :show="showSpecList" :classId="this.form.goodsClassId" <type-select v-if="this.form.goodsClassId != undefined" :show="showSpecList" :classId="this.form.goodsClassId"
@chosen="onChosen" @close="showSpecList = false" /> @chosen="onChosen" @close="showSpecList = false" />
</div> </div>
</template> </template>
<script> <script>
...@@ -696,6 +690,7 @@ ...@@ -696,6 +690,7 @@
{headers:{'Content-Type':'application/json;charset=UTF-8'}}) {headers:{'Content-Type':'application/json;charset=UTF-8'}})
.then((res)=>{ .then((res)=>{
this.$message.success('添加成功') this.$message.success('添加成功')
this.$emit('success')
}).catch(e => { }).catch(e => {
this.$message.success('添加失败') this.$message.success('添加失败')
}); });
...@@ -705,8 +700,7 @@ ...@@ -705,8 +700,7 @@
}else{ }else{
addOrEditGoods(this.form).then(data => { addOrEditGoods(this.form).then(data => {
this.$message.success('修改成功') this.$message.success('修改成功')
done() this.$emit('success')
this.handleClose()
}).catch(() => { }).catch(() => {
}); });
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
:before-close="handleClose" append-to-body> :before-close="handleClose" append-to-body>
<goods-edit ref="editContent" :id="id" /> <goods-edit ref="editContent" :id="id" @success="onChangeDone"/>
</el-dialog> </el-dialog>
</template> </template>
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
}, },
computed: { computed: {
topTitle() { topTitle() {
return "新增商品" console.log("【ID】:"+this.id)
return this.id?"新增商品":"编辑商品"
} }
}, },
watch: { watch: {
...@@ -36,6 +37,9 @@ ...@@ -36,6 +37,9 @@
} }
}, },
methods: { methods: {
onChangeDone() {
this.show=false
},
handleClose() { handleClose() {
this.$emit('close') this.$emit('close')
} }
......
...@@ -105,6 +105,7 @@ ...@@ -105,6 +105,7 @@
this.$router.push('/businessGoods/details?id=' + row.id) this.$router.push('/businessGoods/details?id=' + row.id)
}, },
onChangeDone() { onChangeDone() {
this.goodsEditVue=false
this.refreshChange() this.refreshChange()
}, },
// 列表查询 // 列表查询
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment