Commit 7a1b8638 by xinlaa

客户标签接口调试

1 parent 36913558
import request from '@/utils/request'
const service = config.services.wecom + '/customer'
/**
* 客户同步接口
*/
export function sync() {
return request({
url: service + '/synchWeCustomer',
})
}
import request from '@/utils/request'
const service = config.services.wecom + '/group'
// 客户标签
/**
* 标签列表获取
* {
"pageNum": "当前页",
"pageSize": "每页显示条数",
"gourpName": "标签组名"
}
*/
export function getList(params) {
return request({
url: service + '/list',
params
})
}
/**
* 新增客户标签
* @param {Object} data
{
"gourpName": "标签组名称",
"weTags": [{
"name": "标签名"
}]
}
*/
export function add(data) {
return request({
url: service,
method: 'post',
data,
})
}
/**
* 客户标签编辑
* @param {*} data
{
"id": "主键",
"gourpName": "标签分组名",
"weTags": [{
"id": "标签id",
"groupId": "标签组id",
"name": "标签名",
"status": "标签状态,如果编辑的时候删除标签,只需要把该字段设置为1"
}]
}
*/
export function update(data) {
return request({
url: service,
method: 'put',
data
})
}
/**
* 标签批量删除接口
* @param {*} ids
*/
export function remove(ids) {
return request({
url: service + '/' + ids,
method: 'DELETE',
})
}
......@@ -18,10 +18,9 @@ export default {
name: "AppMain",
computed: {
cachedViews() {
return (
process.env.NODE_ENV === "development" ||
this.$store.state.tagsView.cachedViews
);
return process.env.NODE_ENV === "development"
? []
: this.$store.state.tagsView.cachedViews;
},
key() {
return this.$route.path;
......
// cover some element-ui styles
.top-search {
.el-input,
.el-select {
width: 220px;
......@@ -10,14 +11,8 @@
}
}
.el-button {
&:first-of-type {
margin-left: 10px;
}
&:first-child {
margin-left: 0;
}
.el-tag+.el-tag {
margin-left: 10px;
}
.el-breadcrumb__inner,
......@@ -35,12 +30,6 @@
display: none;
}
.cell {
.el-tag {
margin-right: 0px;
}
}
.small-padding {
.cell {
padding-left: 5px;
......@@ -101,4 +90,4 @@
// to fix el-date-picker css style
.el-range-separator {
box-sizing: content-box;
}
}
\ No newline at end of file
......@@ -128,7 +128,7 @@
v-if="scope.row.userId !== 1"
size="mini"
type="text"
icon="el-icon-delete"
icon="el-icon-close-notification"
@click="startOrStop(scope.row)"
v-hasPermi="['system:user:remove']"
>{{scope.row.enable == 1 ? '禁用' : '启用'}}</el-button>
......@@ -207,8 +207,7 @@
v-model="form.department"
:options="treeData"
:show-all-levels="false"
:props="{ expandTrigger: 'hover', checkStrictly: true, multiple: true, emitPath: false, value: 'id', label: 'name' }"
@change="handleChange"
:props="{ expandTrigger: 'hover', checkStrictly: true,/** multiple: true,*/ emitPath: false, value: 'id', label: 'name' }"
></el-cascader>
</el-form-item>
<el-form-item label="职位">
......@@ -326,8 +325,12 @@ export default {
},
form: {},
dialogVisible: false,
disabled: false,
loading: false,
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [
{
text: "最近一周",
......@@ -368,7 +371,7 @@ export default {
},
totalImg: 0,
// 表单校验
rules: {
rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }],
userId: [{ required: true, message: "必填项", trigger: "blur" }],
department: [{ required: true, message: "必填项", trigger: "blur" }],
......@@ -390,7 +393,7 @@ export default {
trigger: "blur",
},
],
},
}),
};
},
watch: {},
......@@ -407,7 +410,7 @@ export default {
});
},
getList(page) {
console.log(this.dateRange);
// console.log(this.dateRange);
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
......@@ -418,7 +421,7 @@ export default {
.getList(this.query)
.then(({ rows, total }) => {
this.userList = rows;
this.total = total;
this.total = +total;
this.loading = false;
})
.catch(() => {
......
......@@ -68,14 +68,14 @@
@click="dialogVisible = true"
>打标签</el-button>
<el-button type="primary" size="mini" icon="el-icon-brush">移除标签</el-button>
<el-button type="primary" size="mini" icon="el-icon-refresh">同步客户</el-button>
<el-button type="primary" size="mini" icon="el-icon-refresh" @click="sync">同步客户</el-button>
<el-button type="primary" size="mini" icon="el-icon-view">查看重复客户</el-button>
</div>
</div>
<el-table
ref="multipleTable"
:data="tableData"
:data="list"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange"
......@@ -149,19 +149,26 @@
</template>
<script>
import * as api from "@/api/customer";
export default {
name: "Customer",
components: {},
props: {},
data() {
return {
query: {
pageNum: 1,
pageSize: 10,
},
loading: false,
isMoreFilter: false,
total: 0,
form: {
user: "",
region: "",
},
tableData: [],
list: [],
multipleSelection: [],
dialogVisible: false,
labelSelect: [],
......@@ -192,10 +199,32 @@ export default {
watch: {},
computed: {},
created() {},
mounted() {
this.$nextTick;
},
mounted() {},
methods: {
getList(page) {
// console.log(this.dateRange);
if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
}
page && (this.query.pageNum = page);
this.loading = true;
api
.getList(this.query)
.then(({ rows, total }) => {
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
sync() {
api.sync().then(() => {
this.msgSuccess("操作成功");
});
},
submitForm(formName) {
this.$refs["form"].validate((valid) => {
if (valid) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!