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 { ...@@ -18,10 +18,9 @@ export default {
name: "AppMain", name: "AppMain",
computed: { computed: {
cachedViews() { cachedViews() {
return ( return process.env.NODE_ENV === "development"
process.env.NODE_ENV === "development" || ? []
this.$store.state.tagsView.cachedViews : this.$store.state.tagsView.cachedViews;
);
}, },
key() { key() {
return this.$route.path; return this.$route.path;
......
// cover some element-ui styles // cover some element-ui styles
.top-search { .top-search {
.el-input, .el-input,
.el-select { .el-select {
width: 220px; width: 220px;
...@@ -10,14 +11,8 @@ ...@@ -10,14 +11,8 @@
} }
} }
.el-button { .el-tag+.el-tag {
&:first-of-type { margin-left: 10px;
margin-left: 10px;
}
&:first-child {
margin-left: 0;
}
} }
.el-breadcrumb__inner, .el-breadcrumb__inner,
...@@ -35,12 +30,6 @@ ...@@ -35,12 +30,6 @@
display: none; display: none;
} }
.cell {
.el-tag {
margin-right: 0px;
}
}
.small-padding { .small-padding {
.cell { .cell {
padding-left: 5px; padding-left: 5px;
...@@ -101,4 +90,4 @@ ...@@ -101,4 +90,4 @@
// to fix el-date-picker css style // to fix el-date-picker css style
.el-range-separator { .el-range-separator {
box-sizing: content-box; box-sizing: content-box;
} }
\ No newline at end of file \ No newline at end of file
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
v-if="scope.row.userId !== 1" v-if="scope.row.userId !== 1"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-close-notification"
@click="startOrStop(scope.row)" @click="startOrStop(scope.row)"
v-hasPermi="['system:user:remove']" v-hasPermi="['system:user:remove']"
>{{scope.row.enable == 1 ? '禁用' : '启用'}}</el-button> >{{scope.row.enable == 1 ? '禁用' : '启用'}}</el-button>
...@@ -207,8 +207,7 @@ ...@@ -207,8 +207,7 @@
v-model="form.department" v-model="form.department"
:options="treeData" :options="treeData"
:show-all-levels="false" :show-all-levels="false"
:props="{ expandTrigger: 'hover', checkStrictly: true, multiple: true, emitPath: false, value: 'id', label: 'name' }" :props="{ expandTrigger: 'hover', checkStrictly: true,/** multiple: true,*/ emitPath: false, value: 'id', label: 'name' }"
@change="handleChange"
></el-cascader> ></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="职位"> <el-form-item label="职位">
...@@ -326,8 +325,12 @@ export default { ...@@ -326,8 +325,12 @@ export default {
}, },
form: {}, form: {},
dialogVisible: false, dialogVisible: false,
disabled: false,
loading: false, loading: false,
pickerOptions: { pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
shortcuts: [ shortcuts: [
{ {
text: "最近一周", text: "最近一周",
...@@ -368,7 +371,7 @@ export default { ...@@ -368,7 +371,7 @@ export default {
}, },
totalImg: 0, totalImg: 0,
// 表单校验 // 表单校验
rules: { rules: Object.freeze({
name: [{ required: true, message: "必填项", trigger: "blur" }], name: [{ required: true, message: "必填项", trigger: "blur" }],
userId: [{ required: true, message: "必填项", trigger: "blur" }], userId: [{ required: true, message: "必填项", trigger: "blur" }],
department: [{ required: true, message: "必填项", trigger: "blur" }], department: [{ required: true, message: "必填项", trigger: "blur" }],
...@@ -390,7 +393,7 @@ export default { ...@@ -390,7 +393,7 @@ export default {
trigger: "blur", trigger: "blur",
}, },
], ],
}, }),
}; };
}, },
watch: {}, watch: {},
...@@ -407,7 +410,7 @@ export default { ...@@ -407,7 +410,7 @@ export default {
}); });
}, },
getList(page) { getList(page) {
console.log(this.dateRange); // console.log(this.dateRange);
if (this.dateRange[0]) { if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0]; this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1]; this.query.endTime = this.dateRange[1];
...@@ -418,7 +421,7 @@ export default { ...@@ -418,7 +421,7 @@ export default {
.getList(this.query) .getList(this.query)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.userList = rows; this.userList = rows;
this.total = total; this.total = +total;
this.loading = false; this.loading = false;
}) })
.catch(() => { .catch(() => {
......
...@@ -68,14 +68,14 @@ ...@@ -68,14 +68,14 @@
@click="dialogVisible = true" @click="dialogVisible = true"
>打标签</el-button> >打标签</el-button>
<el-button type="primary" size="mini" icon="el-icon-brush">移除标签</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> <el-button type="primary" size="mini" icon="el-icon-view">查看重复客户</el-button>
</div> </div>
</div> </div>
<el-table <el-table
ref="multipleTable" ref="multipleTable"
:data="tableData" :data="list"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
...@@ -149,19 +149,26 @@ ...@@ -149,19 +149,26 @@
</template> </template>
<script> <script>
import * as api from "@/api/customer";
export default { export default {
name: "Customer", name: "Customer",
components: {}, components: {},
props: {}, props: {},
data() { data() {
return { return {
query: {
pageNum: 1,
pageSize: 10,
},
loading: false,
isMoreFilter: false, isMoreFilter: false,
total: 0, total: 0,
form: { form: {
user: "", user: "",
region: "", region: "",
}, },
tableData: [], list: [],
multipleSelection: [], multipleSelection: [],
dialogVisible: false, dialogVisible: false,
labelSelect: [], labelSelect: [],
...@@ -192,10 +199,32 @@ export default { ...@@ -192,10 +199,32 @@ export default {
watch: {}, watch: {},
computed: {}, computed: {},
created() {}, created() {},
mounted() { mounted() {},
this.$nextTick;
},
methods: { 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) { submitForm(formName) {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!