Commit d3dca5aa by 无尘

fix: 更新loading

parent 9a4a6123
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-08-28 15:24:12 * @Date: 2020-08-28 15:24:12
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-11-24 17:55:36 * @LastEditTime: 2020-12-22 11:39:30
--> -->
<!-- <!--
门店绑定-选择分组 门店绑定-选择分组
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
import customerStoreGroup from '@/components/app/my-customer/customer-store-group.vue'; import customerStoreGroup from '@/components/app/my-customer/customer-store-group.vue';
--> -->
<template> <template>
<div class="bind-store-body"> <div class="bind-store-body" v-loading="loading">
<div class="font-12 color-909399">最终选择范围是根据选择范围和管理员管辖范围内的相同分组或门店。</div> <div class="font-12 color-909399">最终选择范围是根据选择范围和管理员管辖范围内的相同分组或门店。</div>
<div class="store-body-wrap"> <div class="store-body-wrap">
<div class="select-search m-t-10"> <div class="select-search m-t-10">
...@@ -59,7 +59,8 @@ export default { ...@@ -59,7 +59,8 @@ export default {
defaultProps: { defaultProps: {
children: 'children', children: 'children',
label: 'storeGroupName' label: 'storeGroupName'
} },
loading: false
}; };
}, },
mounted() { mounted() {
...@@ -157,6 +158,7 @@ export default { ...@@ -157,6 +158,7 @@ export default {
*/ */
getGroup() { getGroup() {
const that = this; const that = this;
that.loading = true;
const para = { const para = {
type: that.storeType, type: that.storeType,
enterpriseId: that.brandId, enterpriseId: that.brandId,
...@@ -164,6 +166,7 @@ export default { ...@@ -164,6 +166,7 @@ export default {
}; };
getGroupList(para, { headers: { sign: that.brandId } }) getGroupList(para, { headers: { sign: that.brandId } })
.then(async res => { .then(async res => {
that.loading = false;
if (!!res.result && res.result.length) { if (!!res.result && res.result.length) {
res.result.forEach(ele => { res.result.forEach(ele => {
ele.expand = false; ele.expand = false;
...@@ -175,10 +178,9 @@ export default { ...@@ -175,10 +178,9 @@ export default {
// 存一份数据自己搜索 // 存一份数据自己搜索
// console.log(that.groupData) // console.log(that.groupData)
that.groupDataCopy = JSON.parse(JSON.stringify(res.result)); that.groupDataCopy = JSON.parse(JSON.stringify(res.result));
}) })
.catch(function(error) { .catch(function(error) {
that.loading = false;
}); });
}, },
}, },
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-08-28 15:24:42 * @Date: 2020-08-28 15:24:42
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-11-24 18:05:50 * @LastEditTime: 2020-12-22 11:40:38
--> -->
<!-- <!--
<customer-store :brand-id="brandId" :select-store="selectStore" @checkStoreIds="checkStoreIds"></customer-store> <customer-store :brand-id="brandId" :select-store="selectStore" @checkStoreIds="checkStoreIds"></customer-store>
import customerStore from '@/components/app/my-customer/customer-store.vue'; import customerStore from '@/components/app/my-customer/customer-store.vue';
--> -->
<template> <template>
<div class="daily-store-select"> <div class="daily-store-select" v-loading="loading">
<div class="font-12 color-909399">最终选择范围是根据选择范围和管理员管辖范围内的相同分组或门店。</div> <div class="font-12 color-909399">最终选择范围是根据选择范围和管理员管辖范围内的相同分组或门店。</div>
<div class="store-select-wrap"> <div class="store-select-wrap">
<div class="select-search m-t-10"> <div class="select-search m-t-10">
...@@ -69,7 +69,8 @@ export default { ...@@ -69,7 +69,8 @@ export default {
stores: [], // 已选门店id结果集 stores: [], // 已选门店id结果集
}, },
pageNum: 1, pageNum: 1,
pageSize: 300 pageSize: 300,
loading: false
}; };
}, },
mounted() { mounted() {
...@@ -135,6 +136,7 @@ export default { ...@@ -135,6 +136,7 @@ export default {
*/ */
getStoreData() { getStoreData() {
const that = this; const that = this;
that.loading = true;
const para = { const para = {
search: that.searchSelect, search: that.searchSelect,
enterpriseId: that.brandId, enterpriseId: that.brandId,
...@@ -145,6 +147,7 @@ export default { ...@@ -145,6 +147,7 @@ export default {
}; };
getStoreList(para, { headers: { sign: that.brandId } }) getStoreList(para, { headers: { sign: that.brandId } })
.then(res => { .then(res => {
that.loading = false;
if (that.pageNum == 1) { if (that.pageNum == 1) {
that.stores = JSON.parse(JSON.stringify(res.result.result)) || []; that.stores = JSON.parse(JSON.stringify(res.result.result)) || [];
that.searchSelect === '' ? that.storesCopy = JSON.parse(JSON.stringify(res.result.result)) || [] : ''; that.searchSelect === '' ? that.storesCopy = JSON.parse(JSON.stringify(res.result.result)) || [] : '';
...@@ -162,7 +165,7 @@ export default { ...@@ -162,7 +165,7 @@ export default {
} }
}) })
.catch(function(error) { .catch(function(error) {
that.loading = false;
}); });
} }
}, },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-08-28 10:31:09 * @Date: 2020-08-28 10:31:09
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-12-22 10:36:16 * @LastEditTime: 2020-12-22 11:33:31
--> -->
<!-- <!--
<sync-crowd-dialog :brand-id="brandId" :select-ids="selectIds" :total-num="totalNum" @refreshData="refreshData"></sync-crowd-dialog> <sync-crowd-dialog :brand-id="brandId" :select-ids="selectIds" :total-num="totalNum" @refreshData="refreshData"></sync-crowd-dialog>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</div> </div>
</div> </div>
<div class="m-t-20"> <div class="m-t-20">
<el-table class="select-table" v-loading="loadingPage" ref="multipleTable" height="400" :data="tableData" tooltip-effect="dark" :style="{ width: '100%' }" @selection-change="handleSelectionChange"> <el-table class="select-table" ref="multipleTable" height="400" :data="tableData" tooltip-effect="dark" :style="{ width: '100%' }" @selection-change="handleSelectionChange">
<el-table-column type="selection" :selectable="selectable" width="55"> </el-table-column> <el-table-column type="selection" :selectable="selectable" width="55"> </el-table-column>
<el-table-column prop="" label="人群名称" show-overflow-tooltip> <el-table-column prop="" label="人群名称" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -93,7 +93,6 @@ export default { ...@@ -93,7 +93,6 @@ export default {
classifyId: '', classifyId: '',
classifyList: [], classifyList: [],
// 分页参数 // 分页参数
loadingPage: false,
currentPage: 1, currentPage: 1,
pageSize: 20, pageSize: 20,
total: 0, total: 0,
...@@ -285,7 +284,7 @@ export default { ...@@ -285,7 +284,7 @@ export default {
*/ */
getTableList() { getTableList() {
const that = this; const that = this;
that.loadingPage = true; that.loadingBtn = true;
const para = { const para = {
wxEnterpriseId: that.wxEnterpriseId, wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId, enterpriseId: that.brandId,
...@@ -296,12 +295,12 @@ export default { ...@@ -296,12 +295,12 @@ export default {
}; };
getSyncMemberData(para, { headers: { sign: that.brandId } }) getSyncMemberData(para, { headers: { sign: that.brandId } })
.then(res => { .then(res => {
that.loadingPage = false; that.loadingBtn = false;
that.tableData = res.result.result || []; that.tableData = res.result.result || [];
that.total = res.result.totalCount; that.total = res.result.totalCount;
}) })
.catch(function(error) { .catch(function(error) {
that.loadingPage = false; that.loadingBtn = false;
}); });
} }
}, },
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-09-01 13:53:59 * @Date: 2020-09-01 13:53:59
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-12-08 16:19:07 * @LastEditTime: 2020-12-22 11:43:19
--> -->
<!-- <!--
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
--> -->
<template> <template>
<el-dialog :title="form.categoryId ? '编辑分类' : '新建分类'" width="600px" :visible.sync="editVisible" :before-close="handleClose"> <el-dialog :title="form.categoryId ? '编辑分类' : '新建分类'" width="600px" :visible.sync="editVisible" :before-close="handleClose">
<el-form :model="form" :rules="rules" ref="tagForm" label-width="110px"> <el-form v-loading="loadingBtn" :model="form" :rules="rules" ref="tagForm" label-width="110px">
<el-form-item label="分类名称" prop="categoryName"> <el-form-item label="分类名称" prop="categoryName">
<limit-input <limit-input
:input-width="440" :input-width="440"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button> <el-button @click="cancel">取消</el-button>
<el-button type="primary" :loading="loadingBtn" @click="submit('tagForm')">{{form.categoryId ? '保存' : '新建'}}</el-button> <el-button type="primary" @click="submit('tagForm')">{{form.categoryId ? '保存' : '新建'}}</el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-08-27 10:16:37 * @Date: 2020-08-27 10:16:37
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-12-22 10:36:57 * @LastEditTime: 2020-12-22 11:35:22
--> -->
<template> <template>
<div class="common-app-right"> <div class="common-app-right">
...@@ -119,6 +119,7 @@ export default { ...@@ -119,6 +119,7 @@ export default {
*/ */
getCustomerData() { getCustomerData() {
const that = this; const that = this;
that.loading = true;
const para = { const para = {
wxEnterpriseId: that.wxEnterpriseId, wxEnterpriseId: that.wxEnterpriseId,
enterpriseId: that.brandId, enterpriseId: that.brandId,
...@@ -126,6 +127,7 @@ export default { ...@@ -126,6 +127,7 @@ export default {
}; };
getCustomerSet(para, { headers: { sign: that.brandId } }) getCustomerSet(para, { headers: { sign: that.brandId } })
.then(res => { .then(res => {
that.loading = false;
if (res.result && !!res.result.length) { if (res.result && !!res.result.length) {
res.result.forEach(ele => { res.result.forEach(ele => {
that.customerShowData[ele.switchCode] = ele.switchFlag == 1 ? true : false; that.customerShowData[ele.switchCode] = ele.switchFlag == 1 ? true : false;
...@@ -142,7 +144,7 @@ export default { ...@@ -142,7 +144,7 @@ export default {
} }
}) })
.catch(function(error) { .catch(function(error) {
that.loading = false;
}); });
} }
}, },
......
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