Commit e69c0704 by caoyanzhi

update: 门店范围设置-门店选择器组件调整

parent 8aae90ff
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
import setVisiable from '@/components/app/customer/set-visiable.vue'; import setVisiable from '@/components/app/customer/set-visiable.vue';
--> -->
<template> <template>
<el-dialog :title="!!editRow.templateId ? '可见范围' : '可见范围'" :visible.sync="dialogVisible" width="873px" :before-close="handleClose"> <el-dialog v-if="false" :title="!!editRow.templateId ? '可见范围' : '可见范围'" :visible.sync="dialogVisible" width="873px" :before-close="handleClose">
<div class=""> <div class="">
<div class="el-form-item el-form-item--large"> <div class="el-form-item el-form-item--large">
<label for="name" class="el-form-item__label" style="width: 100px; cursor: pointer;"> <label for="name" class="el-form-item__label" style="width: 100px; cursor: pointer;">
...@@ -161,6 +161,7 @@ export default { ...@@ -161,6 +161,7 @@ export default {
} }
}, },
mounted() { mounted() {
return console.log('此组件废弃');
const that = this; const that = this;
that.dialogVisible = that.setStoreShow; that.dialogVisible = that.setStoreShow;
} }
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
}, },
--> -->
<template> <template>
<el-popover placement="bottom" style="min-width: 357px" v-model="departmentVisible"> <el-popover v-if="false" placement="bottom" style="min-width: 357px" v-model="departmentVisible">
<div class="select-search"> <div class="select-search">
<el-input placeholder="请输入内容" maxlength="50" v-model="searchSelect" style="width: 100%;" @keyup.native="value => toInput(value, searchSelect)" @clear="clearSearch"> <i slot="prefix" class="el-input__icon el-icon-search"></i> </el-input> <el-input placeholder="请输入内容" maxlength="50" v-model="searchSelect" style="width: 100%;" @keyup.native="value => toInput(value, searchSelect)" @clear="clearSearch"> <i slot="prefix" class="el-input__icon el-icon-search"></i> </el-input>
</div> </div>
...@@ -268,6 +268,8 @@ export default { ...@@ -268,6 +268,8 @@ export default {
} }
}, },
mounted() { mounted() {
console.log('此组件废弃');
return;
const that = this; const that = this;
// 对否有默认选中数据 // 对否有默认选中数据
if (!!that.selectData.length) { if (!!that.selectData.length) {
......
...@@ -47,11 +47,20 @@ ...@@ -47,11 +47,20 @@
<div v-if="tableData.length == 0" class="text-center table-set-line"><span class="font-14 color-606266">暂无门店分组,</span><el-button :disabled="disableSet" type="text" @click="toSetStore()">去设置</el-button></div> <div v-if="tableData.length == 0" class="text-center table-set-line"><span class="font-14 color-606266">暂无门店分组,</span><el-button :disabled="disableSet" type="text" @click="toSetStore()">去设置</el-button></div>
</div> </div>
</div> </div>
<set-visiable :setStoreShow="setStoreShow" :brandId="brandId" @closeStore="closeStore" @submitStore="submitStore"></set-visiable> <el-dialog :visible.sync="setRange.show" title="可见范围" width="873px" @closed="onClosed">
<el-form>
<el-form-item label="选择范围">
<dm-store-selector v-if="setRange.isAdd || (!setRange.isAdd && setRange.storeWidgetId)" :options="setRange.options" :uuid.sync="setRange.storeWidgetId"></dm-store-selector>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="setRange.show = false">取消</el-button>
<el-button :loading="setRange.loading" @click="submitStore" type="primary">确定</el-button>
</template>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import setVisiable from '@/components/app/customer/set-visiable.vue';
import showMsg from '@/common/js/showmsg'; import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public'; import { _debounce } from '@/common/js/public';
...@@ -64,21 +73,20 @@ export default { ...@@ -64,21 +73,20 @@ export default {
default() { default() {
return ''; return '';
} }
},
tabType: {
type: String,
default() {
return '1';
}
} }
}, },
data() { data() {
return { return {
projectName: '', // 当前项目名 setRange: {
show: false,
isAdd: true,
loading: false,
storeWidgetId: '',
options: [0, 1, 2, 3, 4, 5]
},
wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '', wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '',
searchInput: '', searchInput: '',
tableData: [], tableData: [],
activeId: '1',
loading: false, loading: false,
multipleSelection: [], multipleSelection: [],
...@@ -86,27 +94,40 @@ export default { ...@@ -86,27 +94,40 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
total: 0, total: 0,
setStoreShow: false,
disableSet: false disableSet: false
}; };
}, },
methods: { methods: {
onClosed() {
this.setRange.storeWidgetId = '';
},
/** /**
* 门店范围设置 * 门店范围设置
*/ */
toSetStore() { toSetStore() {
const that = this; this.setRange.show = true;
that.setStoreShow = true;
},
closeStore() {
const that = this;
that.setStoreShow = false;
}, },
submitStore() { submitStore() {
const that = this; const data = {
that.setStoreShow = false; templateId: this.$route.query.templateId,
that.currentPage = 1; storeWidgetId: this.setRange.storeWidgetId
that.getTableList(); };
this.setRange.loading = true;
postRequest('/haoban-app-customer-web/save-template-store', data)
.then(res => {
const { errorCode } = res.data || {};
if (errorCode != 1) {
errMsg.errorMsg(res.data);
return;
}
this.$message.success('保存成功');
this.setRange.show = false;
this.currentPage = 1;
this.getTableList();
})
.finally(() => {
setTimeout(() => (this.setRange.loading = false), 200);
});
}, },
/** /**
* 输入 * 输入
...@@ -280,8 +301,7 @@ export default { ...@@ -280,8 +301,7 @@ export default {
if (that.brandId) { if (that.brandId) {
that.getTableList(that.brandId); that.getTableList(that.brandId);
} }
}, }
components: { setVisiable }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
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