Commit d176ad86 by Kyle_Li

Merge branch 'feature/202011' of http://git.gicdev.com/office/haoban-4 into feature/202011

parents 13c17b43 6cc5c543
......@@ -4,13 +4,14 @@
* @Author: 无尘
* @Date: 2020-07-24 12:19:48
* @LastEditors: 无尘
* @LastEditTime: 2020-09-11 16:26:02
* @LastEditTime: 2020-11-17 13:46:07
*/
import getFetch from './get-fetch.js';
let api = {
getAuthEnterprise: '/auth-enterprise-list', // 获取授权商户列表
getGroupList: '/department-list', // 获取 gic 分组列表
getTagList: '/', // 获取标签
getStoreList: '/store-list', // 获取 gic 门店
getAuthDetail: '/enterprise-auth-detail', // 获取授权详情(编辑时获取信息)
getAuditLog: '/enterprise-auth-audit-list', // 获取审核日志
......
<!--
* @Descripttion: 应用内选择门店分组
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-11-17 14:02:31
* @LastEditors: 无尘
* @LastEditTime: 2020-11-17 14:22:27
-->
<!--
<app-select-group :company-id="companyId" :store-type="storeType" :select-group="selectGroup"></app-select-group>
import appSelectGroup from '@/components/set/app-select-group.vue';
-->
<template>
<div class="bind-store-body">
<div class="select-search">
<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 }" >
<span class="font-14 color-606266">{{ node.label }}</span>
</span>
</el-tree>
</div>
</div>
</template>
<script>
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: {
type: String,
default: ''
},
storeType: {
type: String,
default: '1' // 1 门店绑定, 2 门店共享
},
selectGroup: {
type: [ Object, Array ],
default() {
return {};
}
}
},
data() {
return {
searchSelect: '', // 搜索字段
groupData: [],
groupDataCopy: [],
defaultProps: {
children: 'children',
label: 'storeGroupName'
}
};
},
mounted() {
const that = this;
if (that.companyId) {
that.getGroup();
}
if (that.selectGroup.length) {
that.$nextTick(()=>{
that.$refs.groupTree.setCheckedKeys(that.selectGroup.map(ele=>ele.storeGroupId));
});
}else {
that.$nextTick(()=>{
that.$refs.groupTree.setCheckedKeys([]);
});
}
},
methods: {
/**
* @description: 过滤搜索
* @param {String} value
* @param {Object} data
* @returns {Boolean}
* @author: 无尘
*/
filterNode(value, data) {
if (!value || !data.label) return true;
return data.label.indexOf(value) !== -1;
},
/**
* @description: 输入
* @param {Object} e
* @param {String} value
* @returns {Boolean}
* @author: 无尘
*/
toInput: _debounce(function(e, value) {
const that = this;
if (!that.groupDataCopy.length) {
return false;
}
}, 200),
/**
* @description: 清空
* @returns {Boolean}
* @author: 无尘
*/
clearSearch() {
// const that = this;
return false;
// that.groupData = JSON.parse(JSON.stringify(that.groupDataCopy));
},
/**
* @description: 选择 tree 节点,获取选择节点信息
* @param {Object} e
* @param {Array} checkedKeys
* @author: 无尘
*/
checkGroup: function(e, checkedKeys) {
const that = this;
const groups = that.$refs.groupTree.getCheckedNodes();
that.$emit('checkGroupIds', groups);
},
/**
* @description: 简单数组-->父子结构
* @param {Array} data
* @returns {Array}
* @author: 无尘
*/
treeData(data) {
let tree = data.filter(father => {
// 循环所有项
let branchArr = data.filter(child => {
return father.storeGroupId == child.parentId; // 返回每一项的子级数组
});
if (branchArr.length > 0) {
father.hasSonNode = true;
father.children = branchArr; // 如果存在子级,则给父级添加一个children属性,并赋值
} else {
father.children = [];
father.hasSonNode = false;
}
return father.parentId == 0; // 返回第一层
});
return tree;
},
/**
* @description: 获取门店分组
* @author: 无尘
*/
getGroup() {
const that = this;
const para = {
type: that.storeType,
enterpriseId: that.companyId
};
getGroupList(para)
.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))) || [];
// 存一份数据自己搜索
that.groupDataCopy = JSON.parse(JSON.stringify(res.result));
})
.catch(function(error) {
});
},
},
watch: {
searchSelect(val) {
this.$refs.groupTree.filter(val);
},
selectGroup(val) {
const that = this;
if (val.length) {
that.$nextTick(()=>{
that.$refs.groupTree.setCheckedKeys(val.map(ele=>ele.storeGroupId));
});
}else {
that.$nextTick(()=>{
that.$refs.groupTree.setCheckedKeys([]);
});
}
},
companyId(val) {
const that = this;
if (!!val) {
that.getGroup();
}
}
},
};
</script>
<style lang="less" scoped>
.bind-store-body {
width: 331px;
padding: 10px;
margin: 20px 0 0 0 ;
border: 1px solid #e4e7ed;
.w-215 {
width: 215px;
}
.w-115 {
width: 115px;
}
.select-tree-wrap {
height: 323px;
overflow-y: auto;
.el-tree {
width: 309px;
height: 323px;
overflow-x: auto;
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
}
}
}
</style>
<!--
* @Descripttion: 应用内选择门店
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-11-17 14:03:15
* @LastEditors: 无尘
* @LastEditTime: 2020-11-17 14:22:41
-->
<!--
<app-select-store :company-id="companyId" :store-type="storeType" ></app-select-store>
import appSelectStore from '@/components/set/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>
</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">
<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" >
<el-checkbox :label="item.storeInfoId" >{{ item.storeInfoName }}</el-checkbox>
</li>
<li v-if="!stores.length" class="text-center"><span>暂无数据</span></li>
</ul>
</el-checkbox-group>
</div>
</div>
</div>
</template>
<script>
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: {
type: String,
default: ''
},
storeType: {
type: String,
default: '1' // 1 门店绑定, 2 门店共享
},
selectStore: {
type: [ Object, Array ],
default() {
return {};
}
}
},
data() {
return {
checkAll: false, // 全选
isIndeterminate: false,
searchSelect: '', // 搜索字段
stores: [], // 门店列表集合
storesCopy: [],
dailyRuleForm: {
stores: [], // 已选门店id结果集
},
pageNum: 1,
pageSize: 300
};
},
mounted() {
const that = this;
that.stores = [];
that.storesCopy = [];
if (!!that.companyId) {
that.pageNum = 1;
that.getStoreData();
}
if (!!that.selectStore.length) {
that.dailyRuleForm.stores = that.selectStore.map(el=>el.storeInfoId) || [];
}else {
that.dailyRuleForm.stores = [];
}
},
methods: {
/**
* @description: 判断提示
* @param {Object} data
* @author: 无尘
*/
toShowMsg(data) {
if (data.bindFlag == 1) {
showMsg.showmsg('当前门店已被其他企业绑定,当前企业无法选择!', 'warning');
}
},
/**
* @description: 选择改变
* @param {Array} value
* @author: 无尘
*/
handleStoresChange(value) {
const that = this;
let arr = [];
that.stores.forEach(ele => {
if (value.includes(ele.storeInfoId)) {
arr.push(ele);
}
});
that.$emit('checkStoreIds', JSON.parse(JSON.stringify(arr)));
},
/**
* @description: 输入
* @param {Object} e
* @param {String} value
* @author: 无尘
*/
toInput: _debounce(function(e, value) {
const that = this;
if (that.searchSelect != '') {
that.stores = [];
that.pageNum = 1;
that.getStoreData();
}
}, 500),
/**
* @description: 清空
* @author: 无尘
*/
clearSearch() {
const that = this;
that.stores = [];
that.pageNum = 1;
that.getStoreData();
// that.stores = JSON.parse(JSON.stringify(that.storesCopy));
},
/**
* @description: 获取门店
* @author: 无尘
*/
getStoreData() {
const that = this;
const para = {
search: that.searchSelect,
enterpriseId: that.companyId,
type: that.storeType,
pageNum: that.pageNum,
pageSize: that.pageSize
};
getStoreList(para)
.then(res => {
if (that.pageNum == 1) {
that.stores = JSON.parse(JSON.stringify(res.result.result)) || [];
that.storesCopy = JSON.parse(JSON.stringify(res.result.result)) || [];
}else {
res.result.result.forEach(ele => {
that.stores.push(ele);
that.storesCopy.push(ele);
});
}
if (that.pageNum * that.pageSize < res.result.totalCount) {
that.pageNum ++;
that.$nextTick(()=>{
that.getStoreData();
});
}
})
.catch(function(error) {
});
}
},
watch: {
selectStore: function(newData, oldData) {
const that = this;
if (!!newData.length) {
that.dailyRuleForm.stores = newData.map(el=>el.storeInfoId) || [];
}else {
that.dailyRuleForm.stores = [];
}
},
companyId(val) {
const that = this;
if (!!val) {
that.pageNum = 1;
that.getStoreData();
}
}
}
};
</script>
<style lang="less" scoped>
.daily-store-select {
position: relative;
width: 331px;
min-height: 398px;
margin: 20px 0 0 0;
padding: 10px;
border: 1px solid #e4e7ed;
.define-search-select {
.el-select-dropdown__wrap {
max-height: 343px;
}
.el-checkbox-group {
overflow-x: auto;
height: 338px;
ul {
height: 100%;
li {
overflow: unset;
text-overflow: unset;
}
}
}
}
}
</style>
<!--
* @Descripttion: 当前组件信息
* @Descripttion: 选择门店分组组件
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-02-08 10:27:21
* @Date: 2020-11-08 10:27:21
* @LastEditors: 无尘
* @LastEditTime: 2020-09-14 10:11:19
* @LastEditTime: 2020-11-17 17:50:58
-->
<!--
选择门店分组组件:
<gic-select-group-mult
:select-data="selectData"
@checkGroupIds="checkGroupIds">
......@@ -27,7 +26,7 @@
</div>
<div class="select-tree-wrap m-t-10">
<!--:load="loadNode"-->
<el-tree :filter-node-method="filterNode" clearable :data="groupData" :default-checked-keys="checkedKeys" node-key="storeGroupId" ref="groupTree" show-checkbox default-expand-all :props="defaultProps" :expand-on-click-node="false" @check="checkGroup">
<el-tree :filter-node-method="filterNode" :data="groupData" :default-checked-keys="checkedKeys" node-key="storeGroupId" ref="groupTree" show-checkbox default-expand-all :props="defaultProps" :expand-on-click-node="false" @check="checkGroup">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :class="['font-14 p-r-10 iconfont', data.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', data.bindFlag == 1 ? 'color-2f54eb' : 'color-dedfe6']"></span><span class="font-14 color-606266">{{ node.label }}</span>
</span>
......@@ -53,8 +52,8 @@
</el-popover>
</template>
<script>
import fetch from '@/api/contact.js';
const { getGicGroup } = fetch;
import fetch from '@/api/merchant-auth.js';
const { getGroupList } = fetch;
import { _debounce } from '@/common/js/public';
export default {
name: 'GicSelectGroupMult',
......@@ -116,21 +115,7 @@ export default {
if (!value || !data.label) return true;
return data.label.indexOf(value) !== -1;
},
/**
* @description: 加载更多
* @param {Object} node
* @param {Function} resolve
* @returns {Function}
* @author: 无尘
*/
async loadNode(node, resolve) {
const that = this;
if (node.level === 0) {
return resolve(that.getGroup());
} else {
await that.getGroup(node, node.data, resolve);
}
},
/**
* @description: 输入
* @param {Object} e
......@@ -186,24 +171,6 @@ export default {
that.$refs.groupTree.setCheckedKeys(keys);
that.$emit('checkGroupIds', that.$refs.groupTree.getCheckedNodes());
},
/**
* @description: 处理排序
* @param {Object} item
* @author: 无尘
*/
async handleSort(item) {
const that = this;
for (let i = 0; i < item.children.length; i++) {
item.children.sort(function(a, b) {
return a.storeGroupSort - b.storeGroupSort;
});
if (item.children[i].length) {
await that.handleSort(item.children[i]);
}
}
},
/**
* @description: 简单数组-->父子数组对象
* @param {Array} data
......@@ -213,30 +180,14 @@ export default {
let tree = data.filter(father => {
// 循环所有项
let branchArr = data.filter(child => {
return father.storeGroupId == child.parentGroupId; // 返回每一项的子级数组
return father.storeGroupId == child.parentId; // 返回每一项的子级数组
});
if (branchArr.length > 0) {
father.children = branchArr; // 如果存在子级,则给父级添加一个children属性,并赋值
}else {
father.children = [];
}
return father.parentGroupId == 0; // 返回第一层
});
// 排序
if (tree.length) {
tree.sort(function(a, b) {
return a.storeGroupSort - b.storeGroupSort;
});
}
/* for (let i = 0; i < tree[0].children.length; i++) {
if (tree[0].children[i].lenth) {
await that.handleSort(tree[0].children[i]);
}
} */
tree.forEach(function(ele, index) {
if (!!ele.children && ele.children.length) {
ele.children.sort(function(a, b) {
return a.storeGroupSort - b.storeGroupSort;
});
}
return father.parentId == 0; // 返回第一层
});
return tree;
},
......@@ -250,12 +201,11 @@ export default {
let para = {
enterpriseId: that.brandId
};
getGicGroup(para)
getGroupList(para)
.then(async res => {
if (!!res.result && !!res.result.length) {
res.result.forEach(ele => {
ele.label = ele.storeGroupName;
ele.departmentName = ele.storeGroupName;
});
const data = await that.treeData(res.result);
that.$nextTick(() => {
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2020-02-08 10:27:21
* @LastEditors: 无尘
* @LastEditTime: 2020-11-17 13:49:40
-->
<!--
选择门店分组组件:
<gic-select-tag
:selectData="selectData"
@returnTags="returnTags">
</gic-select-tag>
import gicSelectTag from '@/components/app/card/gic-select-tag.vue';
returnTags: function(nodes) {
const that = this;
that.conditionObj.tags = nodes;
},
-->
<template>
<el-popover placement="bottom" title="" width="350" trigger="click" v-model="storeVisible">
<div class="daily-store-select">
<div class="el-scrollbar define-search-select">
<div class="el-select-dropdown__wrap el-scrollbar__wrap" style="margin-bottom: -5px; margin-right: -5px;">
<el-checkbox-group v-model="dailyRuleForm.tags" @change="handleStoresChange">
<ul class="el-scrollbar__view el-select-dropdown__list">
<li class="el-select-dropdown__item" v-for="item in tags" :key="item.tagId">
<el-checkbox :label="item.tagId">{{ item.tagName }}</el-checkbox>
</li>
<li v-if="!tags.length" class="text-center el-select-dropdown__item"><span>暂无门店标签</span></li>
</ul>
</el-checkbox-group>
</div>
<div class="el-scrollbar__bar is-horizontal"><div class="el-scrollbar__thumb" style="transform: translateX(0%);"></div></div>
<div class="el-scrollbar__bar is-vertical"><div class="el-scrollbar__thumb" style="transform: translateY(0%);"></div></div>
</div>
</div>
<div class="flex-column item-cell-select inline-block " slot="reference">
<div class="depart-item-wrap">
<div :style="{ width: width }" class="el-select el-select--large depart-item-content">
<span class="font-14 color-c0c4cc p-l-10" style="display: inline-block;line-height: 32px;color: #c0c4cc;" v-if="!dailyRuleForm.tags.length">请选择门店标签</span>
<div class="el-select__tags" style="max-width: 348px;">
<span style="display:block">
<template v-for="(item, index) in selectTags">
<span class="el-tag el-tag--info el-tag--small" :key="index + 'tag'">
<span class="el-select__tags-text">{{ item.tagName }}</span>
<i class="el-tag__close el-icon-close" @click.stop="delDepart(index, selectTags)"></i>
</span>
</template>
</span>
</div>
</div>
</div>
</div>
</el-popover>
</template>
<script>
import fetch from '@/api/merchant-auth.js';
const { getTagList } = fetch;
// import errMsg from '@/common/js/error';
// import { _debounce } from '@/common/js/public';
export default {
name: 'GicSelectTag',
props: {
width: {
type: String,
default() {
return '357px';
}
},
selectData: {
type: [ Object, Array ],
default() {
return [];
}
},
brandId: {
type: String,
default() {
return '';
}
}
},
data() {
return {
projectName: '', // 当前项目名
enterpriseId: this.brandId,
storeVisible: false,
tags: [],
dailyRuleForm: {
tags: []
},
selectTags: []
};
},
mounted() {
const that = this;
if (!!that.brandId) {
that.tags = [];
that.getTagsData();
}
if (!!that.selectData.length) {
that.selectTags = JSON.parse(JSON.stringify(that.selectData));
that.dailyRuleForm.tags = that.selectData.map(ele => ele.tagId);
} else {
that.dailyRuleForm.tags = [];
that.selectTags = [];
}
},
methods: {
/**
* @description: 选中改变
* @param {Array} value
* @author: 无尘
*/
handleStoresChange(value) {
const that = this;
let arr = [];
that.tags.forEach(ele => {
if (value.includes(ele.tagId)) {
arr.push(ele);
}
});
that.selectTags = JSON.parse(JSON.stringify(arr));
that.$emit('returnTags', that.selectTags);
},
/**
* @description: 删除
* @param {Number} index
* @param {Array} arr
* @author: 无尘
*/
delDepart(index, arr) {
const that = this;
arr.splice(index, 1);
that.$emit('returnTags', that.selectTags);
},
/**
* @description: 获取门店标签
* @author: 无尘
*/
getTagsData() {
const that = this;
let para = {
gicEnterpriseId: that.brandId
};
getTagList(para)
.then(res => {
if (res.code == '0000') {
that.tags = res.result || [];
return;
}
})
.catch(function(error) {
});
}
},
watch: {
brandId(val) {
const that = this;
if (val) {
that.dailyRuleForm.tags = [];
that.selectTags = [];
that.tags = [];
that.getTagsData();
}
},
selectData: function(newData, oldData) {
const that = this;
if (!!newData.length) {
that.selectTags = JSON.parse(JSON.stringify(newData));
that.dailyRuleForm.tags = newData.map(ele => ele.tagId);
} else {
that.dailyRuleForm.tags = [];
that.selectTags = [];
}
}
}
};
</script>
<style lang="less" scoped>
.depart-item-content {
width: 213px;
height: 32px;
overflow: hidden;
white-space: nowrap;
border-radius: 2px;
border: 1px solid #c4c6cf;
cursor: pointer;
box-sizing: border-box;
}
.select-tree-wrap {
max-height: 300px;
overflow-y: auto;
}
.item-cell-select {
/deep/ .el-select__tags {
white-space: nowrap;
overflow: hidden;
}
.el-select {
.el-tag {
border-radius: 2px;
border: 1px solid rgba(220, 223, 230, 1);
background-color: #fff;
.el-tag__close {
top: 1px;
color: #909399;
&:hover {
background-color: transparent;
}
}
}
}
}
.w-350 {
width: 350px;
}
.show-select-num {
position: relative;
display: inline-block;
font-size: inherit;
height: 32px;
line-height: 32px;
padding-left: 10px;
-webkit-appearance: none;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #606266;
.el-select__caret {
color: #c0c4cc;
font-size: 14px;
transition: transform 0.3s;
transform: rotate(180deg);
cursor: pointer;
&.is-reverse {
transform: rotate(0deg);
}
}
}
.daily-store-select {
position: relative;
}
</style>
......@@ -4,51 +4,112 @@
* @Author: 无尘
* @Date: 2020-11-09 10:05:27
* @LastEditors: 无尘
* @LastEditTime: 2020-11-09 10:22:49
* @LastEditTime: 2020-11-17 17:12:42
-->
<!-- -->
<template>
<div class="common-app-right" style="padding:40px">
<div class="target-content">
下发时间当月,第
<el-input-number v-model="days" controls-position="right" :min="1" style="width: 90px;margin: 0 8px"></el-input-number>
天下发下月指标
<span class="tips">注:如当月第28天下发,如果现在是1月份,即1月28号下发2月份指标。设置后次日生效</span>
</div>
<el-button type="primary">保存</el-button>
<div>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" @submit.native.prevent>
<el-form-item label="" prop="days">
<span class="font-14 color-606266">下发时间当月,第 </span><el-input-number controls-position="right" class="w-100" v-model="ruleForm.days" placeholder="请输入" :step="1" :step-strictly="true" :min="1" :max="99999999"></el-input-number><span class="font-14 color-606266 p-l-10"></span>
<span class="font-14 color-909399">注:如当月第28天下发,如果现在是1月份,即1月28号下发2月份指标。设置后次日生效</span>
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="loadingBtn" @click="submitForm('ruleForm')">保存</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import fetch from '@/api/target-manage-app.js';
const { saveTargetSet, getTargetSet } = fetch;
import { _debounce } from '@/common/js/public';
export default {
name: 'TargetSet',
components: {},
props: {
brandId: {
type: String,
default() {
return '';
}
}
},
data() {
return {
days: 1
wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
userInfo: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')) : { staffId: '', staffName: '' },
ruleForm: {
days: ''
},
rules: {
days: [
{ required: true, message: '请输入', trigger: 'blur' },
]
},
loadingBtn: false
};
},
// 生命周期 - 挂载完成(访问DOM元素)
mounted() {
this.$emit('showTab', '/quota-set');
this.$emit('change-nav', [ { name: '下发设置' } ]);
},
// methods
methods: {
/**
* 保存
*/
saveSet: _debounce(function() {
const that = this;
that.loadingBtn = true;
that.postSave();
}, 300),
postSave() {
const that = this;
const para = {
days: that.ruleForm.days,
enterpriseId: that.brandId,
wxEnterpriseId: that.wxEnterpriseId,
submitStaffId: that.userInfo.staffId,
submitStaffName: that.userInfo.staffName
};
saveTargetSet(para)
.then(res => {
that.loadingBtn = false;
that.$message.success('保存成功');
})
.catch(function(error) {
that.loadingBtn = false;
});
},
/**
* 获取设置数据
*/
getData() {
const that = this;
const para = {
enterpriseId: that.brandId,
wxEnterpriseId: that.wxEnterpriseId
};
getTargetSet(para)
.then(res => {
that.ruleForm.days = res.result.days || '';
})
.catch(function(error) {
});
}
},
watch: {
brandId: function(newData, oldData) {
const that = this;
if (!!newData) {
that.getData();
}
}
},
watch: {}
};
</script>
<style lang='less' scoped>
.target-content {
color: #303133;
margin-bottom: 35px;
.tips {
margin-left: 35px;
color: #909399;
}
}
</style>
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