Commit a5bb8c8c by lixiaomin

修改店铺

parent 5c7fd7d5
...@@ -38,12 +38,12 @@ export default { ...@@ -38,12 +38,12 @@ export default {
} }
}, },
watch: { watch: {
shopId() { // shopId() {
this.getList() // this.getList()
} // }
}, },
mounted() { mounted() {
this.getList() //this.getList()
}, },
methods: { methods: {
getList() { getList() {
......
...@@ -59,14 +59,12 @@ export default { ...@@ -59,14 +59,12 @@ export default {
if (id) { if (id) {
this.getShopInfo(id) this.getShopInfo(id)
} }
} }
}, },
mounted() { mounted() {
if (this.shopId) { if (this.shopId) {
this.getShopInfo(this.shopId) this.getShopInfo(this.shopId)
} }
}, },
data() { data() {
return { return {
...@@ -114,7 +112,10 @@ export default { ...@@ -114,7 +112,10 @@ export default {
surplus.zone = province[2] surplus.zone = province[2]
if (surplus.id != null) { if (surplus.id != null) {
updateShop(surplus).then((res) => { updateShop(surplus).then((res) => {
this.$modal.msgSuccess("修改成功"); if(res.code=="200"){
this.$modal.msgSuccess("修改成功");
this.$emit('getList')
}
}); });
} else { } else {
addShop(surplus).then(({ data }) => { addShop(surplus).then(({ data }) => {
...@@ -128,9 +129,7 @@ export default { ...@@ -128,9 +129,7 @@ export default {
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.$emit('closeDialog') this.$emit('closeDialog');
// this.open = false;
// this.reset();
}, },
// 表单重置 // 表单重置
reset() { reset() {
......
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.getList() //this.getList()
}, },
methods: { methods: {
getPicsList(str){ getPicsList(str){
......
...@@ -63,13 +63,13 @@ export default { ...@@ -63,13 +63,13 @@ export default {
} }
}, },
watch: { watch: {
shopId() { //shopId() {
this.getList() //this.getList()
} //}
}, },
mounted() { mounted() {
if (!this.shopId) return if (!this.shopId) return
this.getList() //this.getList()
}, },
methods: { methods: {
/** 查询列表 */ /** 查询列表 */
......
...@@ -38,12 +38,12 @@ export default { ...@@ -38,12 +38,12 @@ export default {
} }
}, },
watch: { watch: {
shopId() { //shopId() {
this.getList() //this.getList()
} //}
}, },
mounted() { mounted() {
this.getList() //this.getList()
}, },
methods: { methods: {
getList() { getList() {
......
<template> <template>
<div class="app-container"> <div class="app-container">
<SetShop ref="setShop" /> <SetShop ref="setShop" @getList="getList"/>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="店铺名称" prop="name"> <el-form-item label="店铺名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入店铺名称" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.name" placeholder="请输入店铺名称" clearable @keyup.enter.native="handleQuery" />
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-dialog title="店铺设置" :visible.sync="open" width="1200px" append-to-body > <el-dialog title="店铺设置" :visible.sync="open" width="1200px" append-to-body >
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="店铺信息" name="first"> <el-tab-pane label="店铺信息" name="first">
<AddShop :shopId="shopId" @setShopId="setShopId" @closeDialog="closeHandle"/> <AddShop :shopId="shopId" @closeDialog="closeHandle" @getList="getList"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :disabled="!shopId" label="机器信息" name="second"> <el-tab-pane :disabled="!shopId" label="机器信息" name="second">
<Machine ref="Machine" :shopId="shopId" /> <Machine ref="Machine" :shopId="shopId" />
...@@ -66,7 +66,12 @@ export default { ...@@ -66,7 +66,12 @@ export default {
}, },
closeHandle () { closeHandle () {
this.activeName='first'; this.activeName='first';
this.open = false // 控制取消和X按钮,关闭弹窗 this.open = false // 控制取消和X按钮,关闭弹窗;
this.getList();
},
// 店铺列表
getList(){
this.$emit('getList');
} }
} }
......
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