Commit 16deb5c2 by 无尘

fix: 修改指标

parent 5cc1205f
......@@ -4,11 +4,11 @@
* @Author: 无尘
* @Date: 2020-11-17 14:02:31
* @LastEditors: 无尘
* @LastEditTime: 2020-11-17 14:22:27
* @LastEditTime: 2020-11-24 16:40:59
-->
<!--
<app-select-group :company-id="companyId" :store-type="storeType" :select-group="selectGroup"></app-select-group>
import appSelectGroup from '@/components/set/app-select-group.vue';
<app-select-group :brand-id="brandId" :store-type="storeType" :select-group="selectGroup"></app-select-group>
import appSelectGroup from '@/components/app/app-select-group.vue';
-->
<template>
<div class="bind-store-body">
......@@ -16,8 +16,8 @@
<el-input placeholder="请输入分组名称" clearable v-model="searchSelect" @keyup.native="value => toInput(value, searchSelect)" @clear="clearSearch"> <i slot="prefix" class="el-input__icon el-icon-search"></i> </el-input>
</div>
<div class="select-tree-wrap auth-select-tree m-t-20">
<el-tree ref="groupTree" :filter-node-method="filterNode" check-strictly :data="groupData" node-key="storeGroupId" show-checkbox default-expand-all :props="defaultProps" :expand-on-click-node="false" @check="checkGroup">
<span :id="data.storeGroupId" class="custom-tree-node" slot-scope="{ node, data }" >
<el-tree ref="groupTree" :filter-node-method="filterNode" :data="groupData" node-key="storeGroupId" show-checkbox default-expand-all :props="defaultProps" :expand-on-click-node="false" @check="checkGroup">
<span :id="data.storeGroupId" class="custom-tree-node" slot-scope="{ node, data }">
<span class="font-14 color-606266">{{ node.label }}</span>
</span>
</el-tree>
......@@ -25,20 +25,19 @@
</div>
</template>
<script>
import { _debounce } from '@/common/js/public';
import { _debounce } from '@/common/js/public';
import fetch from '@/api/merchant-auth.js';
const { getGroupList } = fetch;
// import showMsg from '@/common/js/showmsg';
export default {
name: 'AppSelectGroup',
props: {
companyId: {
brandId: {
type: String,
default: ''
},
storeType: {
type: String,
default: '1' // 1 门店绑定, 2 门店共享
default: '2' // 1 门店绑定, 2 门店共享
},
selectGroup: {
type: [ Object, Array ],
......@@ -49,6 +48,7 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
searchSelect: '', // 搜索字段
groupData: [],
groupDataCopy: [],
......@@ -60,7 +60,7 @@ export default {
},
mounted() {
const that = this;
if (that.companyId) {
if (that.brandId) {
that.getGroup();
}
if (that.selectGroup.length) {
......@@ -104,9 +104,7 @@ export default {
* @author: 无尘
*/
clearSearch() {
// const that = this;
return false;
// that.groupData = JSON.parse(JSON.stringify(that.groupDataCopy));
},
/**
* @description: 选择 tree 节点,获取选择节点信息
......@@ -116,13 +114,19 @@ export default {
*/
checkGroup: function(e, checkedKeys) {
const that = this;
// 这里还要过滤已选的数据,把非禁用的数据过滤出来
const groups = that.$refs.groupTree.getCheckedNodes();
that.$emit('checkGroupIds', groups);
if (!!groups.length) {
that.$emit('checkGroupIds', groups);
}else {
that.$emit('checkGroupIds', []);
}
},
/**
* @description: 简单数组-->父子结构
* @description: 简单数组变父子关系
* @param {Array} data
* @returns {Array}
* @return {Array}
* @author: 无尘
*/
treeData(data) {
......@@ -142,6 +146,7 @@ export default {
});
return tree;
},
/**
* @description: 获取门店分组
* @author: 无尘
......@@ -150,20 +155,21 @@ export default {
const that = this;
const para = {
type: that.storeType,
enterpriseId: that.companyId
enterpriseId: that.brandId,
wxEnterpriseId: that.wxEnterpriseId
};
getGroupList(para)
getGroupList(para, { headers: { sign: that.brandId } })
.then(async res => {
if (!!res.result && res.result.length) {
res.result.forEach(ele => {
ele.expand = false;
ele.children = [];
ele.disabled = false;
ele.label = ele.storeGroupName;
});
}
that.groupData = await that.treeData(JSON.parse(JSON.stringify(res.result))) || [];
// 存一份数据自己搜索
// console.log(that.groupData)
that.groupDataCopy = JSON.parse(JSON.stringify(res.result));
})
......@@ -188,13 +194,13 @@ export default {
});
}
},
companyId(val) {
brandId(val) {
const that = this;
if (!!val) {
that.getGroup();
}
}
},
}
};
</script>
......
......@@ -4,25 +4,25 @@
* @Author: 无尘
* @Date: 2020-11-17 14:03:15
* @LastEditors: 无尘
* @LastEditTime: 2020-11-17 14:22:41
* @LastEditTime: 2020-11-24 16:41:57
-->
<!--
<app-select-store :company-id="companyId" :store-type="storeType" ></app-select-store>
import appSelectStore from '@/components/set/app-select-store.vue';
<app-select-store :brand-id="brandId" :store-type="storeType" :select-store="selectStore" ></app-select-store>
import appSelectStore from '@/components/app/app-select-store.vue';
-->
<template>
<div class="daily-store-select">
<div class="select-search">
<el-input placeholder="请输入门店名称/代码" v-model="searchSelect" style="width: 100%;" clearable @keyup.native="value => toInput(value, searchSelect)" @clear="clearSearch"> <i slot="prefix" class="el-input__icon el-icon-search"></i> </el-input>
<el-input placeholder="请输入门店名称/代码" v-model="searchSelect" prefix-icon="el-icon-search" style="width: 100%;" clearable @keyup.native="value => toInput(value, searchSelect)" @clear="clearSearch"></el-input>
</div>
<!-- <div class="checkbox border-box" style="padding: 15px 20px;">
<el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
</div> -->
<div class="el-scrollbar define-search-select">
<div class="el-select-dropdown__wrap el-scrollbar__wrap" style="overflow: auto;">
<el-checkbox-group v-model="dailyRuleForm.stores" @change="handleStoresChange" :max="50">
<el-checkbox-group v-model="dailyRuleForm.stores" @change="handleStoresChange">
<ul class="el-scrollbar__view el-select-dropdown__list">
<li :class="['el-select-dropdown__item', item.select ? 'selected hover' : '']" v-for="item in stores" :key="item.storeInfoId" >
<li :class="['el-select-dropdown__item', item.select ? 'selected hover' : '']" v-for="item in stores" :key="item.storeInfoId">
<el-checkbox :label="item.storeInfoId" >{{ item.storeInfoName }}</el-checkbox>
</li>
<li v-if="!stores.length" class="text-center"><span>暂无数据</span></li>
......@@ -36,17 +36,16 @@
import { _debounce } from '@/common/js/public';
import fetch from '@/api/merchant-auth.js';
const { getStoreList } = fetch;
import showMsg from '@/common/js/showmsg';
export default {
name: 'AppSelectStore',
props: {
companyId: {
brandId: {
type: String,
default: ''
},
storeType: {
type: String,
default: '1' // 1 门店绑定, 2 门店共享
default: '2' // 1 门店绑定, 2 门店共享
},
selectStore: {
type: [ Object, Array ],
......@@ -57,11 +56,12 @@ export default {
},
data() {
return {
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
checkAll: false, // 全选
isIndeterminate: false,
searchSelect: '', // 搜索字段
stores: [], // 门店列表集合
storesCopy: [],
storesCopy: [], // 最后保存值用
dailyRuleForm: {
stores: [], // 已选门店id结果集
},
......@@ -73,7 +73,7 @@ export default {
const that = this;
that.stores = [];
that.storesCopy = [];
if (!!that.companyId) {
if (!!that.brandId) {
that.pageNum = 1;
that.getStoreData();
}
......@@ -84,16 +84,7 @@ export default {
}
},
methods: {
/**
* @description: 判断提示
* @param {Object} data
* @author: 无尘
*/
toShowMsg(data) {
if (data.bindFlag == 1) {
showMsg.showmsg('当前门店已被其他企业绑定,当前企业无法选择!', 'warning');
}
},
/**
* @description: 选择改变
* @param {Array} value
......@@ -102,7 +93,7 @@ export default {
handleStoresChange(value) {
const that = this;
let arr = [];
that.stores.forEach(ele => {
that.storesCopy.forEach(ele => {
if (value.includes(ele.storeInfoId)) {
arr.push(ele);
}
......@@ -123,6 +114,7 @@ export default {
that.getStoreData();
}
}, 500),
/**
* @description: 清空
* @author: 无尘
......@@ -132,8 +124,8 @@ export default {
that.stores = [];
that.pageNum = 1;
that.getStoreData();
// that.stores = JSON.parse(JSON.stringify(that.storesCopy));
},
/**
* @description: 获取门店
* @author: 无尘
......@@ -142,20 +134,21 @@ export default {
const that = this;
const para = {
search: that.searchSelect,
enterpriseId: that.companyId,
enterpriseId: that.brandId,
type: that.storeType,
pageNum: that.pageNum,
pageSize: that.pageSize
pageSize: that.pageSize,
wxEnterpriseId: that.wxEnterpriseId
};
getStoreList(para)
getStoreList(para, { headers: { sign: that.brandId } })
.then(res => {
if (that.pageNum == 1) {
that.stores = JSON.parse(JSON.stringify(res.result.result)) || [];
that.storesCopy = JSON.parse(JSON.stringify(res.result.result)) || [];
that.searchSelect === '' ? that.storesCopy = JSON.parse(JSON.stringify(res.result.result)) || [] : '';
}else {
res.result.result.forEach(ele => {
that.stores.push(ele);
that.storesCopy.push(ele);
that.searchSelect === '' ? that.storesCopy.push(ele) : '';
});
}
if (that.pageNum * that.pageSize < res.result.totalCount) {
......@@ -179,7 +172,7 @@ export default {
that.dailyRuleForm.stores = [];
}
},
companyId(val) {
brandId(val) {
const that = this;
if (!!val) {
that.pageNum = 1;
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-08 10:27:21
* @LastEditors: 无尘
* @LastEditTime: 2020-11-24 15:40:21
* @LastEditTime: 2020-11-24 16:46:45
-->
<!--
<gic-select-group-mult
......@@ -21,6 +21,7 @@
-->
<template>
<el-popover placement="bottom" v-model="departmentVisible">
<!-- <div>最终选择范围是根据选择范围和管理员管辖范围内的相同分组或门店。</div> -->
<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>
</div>
......
......@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-12 10:47:17
* @LastEditors: 无尘
* @LastEditTime: 2020-11-24 15:37:01
* @LastEditTime: 2020-11-24 16:53:27
-->
<template>
<div class="common-app-right" style="padding: 20px 0;color: #303133">
......@@ -352,23 +352,23 @@ export default {
.target-title {
display: flex;
justify-content: space-between;
width: 1145px;
max-width: 100%;
margin: 20px;
span {
font-weight: 600;
}
}
.target-table {
width: 97%;
max-width: 100%;
margin: 0 20px 50px;
}
.table-title {
display: flex;
li {
width: 14%;
max-width: 14%;
min-width: 14%;
width: 14.28%;
max-width: 14.28%;
min-width: 14.28%;
height: 48px;
line-height: 48px;
text-indent: 35px;
......@@ -384,9 +384,9 @@ export default {
display: flex;
flex-wrap: wrap;
li {
width: 14%;
max-width: 14%;
min-width: 14%;
width: 14.28%;
max-width: 14.28%;
min-width: 14.28%;
height: 70px;
padding: 5px 0 8px 10px;
border-bottom: 1px solid #DCDFE6;
......
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