Commit f33ef8ab by caoyanzhi

update: 切换默认商户

parent f7386d05
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<el-dropdown-item v-for="el in storeList" :key="el.enterpriseId" :class="['store-item', { actived: el.enterpriseId == activedStoreId }]" :command="el.enterpriseId"> <el-dropdown-item v-for="el in storeList" :key="el.enterpriseId" :class="['store-item', { actived: el.enterpriseId == activedStoreId }]" :command="el.enterpriseId">
<div> <div>
<div class="store-name">{{ el.brandName }}</div> <div class="store-name">{{ el.brandName }}</div>
<div class="default-store-tag" v-if="el.enterpriseId == defaultStoreId">默认商户</div> <div class="default-store-tag" v-if="el.defaultFlag == 1">默认商户</div>
</div> </div>
<i class="el-icon-check checked" v-if="el.enterpriseId == activedStoreId"></i> <i class="el-icon-check checked" v-if="el.enterpriseId == activedStoreId"></i>
</el-dropdown-item> </el-dropdown-item>
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
</template> </template>
<script> <script>
// 更改默认商户 接口联调
import { getRequest } from '@/api/api.js'; import { getRequest } from '@/api/api.js';
import errorMsg from '@/common/js/error.js'; import errorMsg from '@/common/js/error.js';
import expiredDialog from '@/components/company/expired-dialog.vue'; import expiredDialog from '@/components/company/expired-dialog.vue';
...@@ -51,7 +50,6 @@ export default { ...@@ -51,7 +50,6 @@ export default {
}, },
storeList: [], storeList: [],
activedStoreId: '', activedStoreId: '',
defaultStoreId: '',
isExpired: false isExpired: false
}; };
}, },
...@@ -85,10 +83,9 @@ export default { ...@@ -85,10 +83,9 @@ export default {
this.$emit('changeStore', true); this.$emit('changeStore', true);
getRequest('/haoban-manage3-web/enterprise-is-over', { enterpriseId }) getRequest('/haoban-manage3-web/enterprise-is-over', { enterpriseId })
.then(res => { .then(res => {
let resData = res.data;
const { errorCode, result } = res.data || {}; const { errorCode, result } = res.data || {};
if (errorCode != 1) { if (errorCode != 1) {
errorMsg.errorMsg(resData); errorMsg.errorMsg(res.data);
return; return;
} }
this.isExpired = result; this.isExpired = result;
...@@ -104,9 +101,22 @@ export default { ...@@ -104,9 +101,22 @@ export default {
// onClosed() {}, // onClosed() {},
onSave() { onSave() {
this.changeStore.loading = true; this.changeStore.loading = true;
getRequest('/haoban-manage3-web/set-default-gicenterprise', { enterpriseId: this.changeStore.storeId })
.then(res => {
const { errorCode } = res.data || {};
if (errorCode != 1) {
errorMsg.errorMsg(res.data);
return;
}
this.getStoreList();
this.changeStore.show = false;
this.$message.succes('设置成功');
})
.finally(() => {
setTimeout(() => { setTimeout(() => {
this.changeStore.loading = false; this.changeStore.loading = false;
}, 1000); }, 100);
});
} }
} }
}; };
......
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