You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
8.2 KiB

import Mock from 'mockjs'
//表格字段数据
const ListField = [{"fieldId":1,"formType":"text","fieldName":"leadsName","name":"线索名称","width":100,"type":1,"setting":[]},{"fieldId":2,"formType":"select","fieldName":"线索来源","name":"线索来源","width":100,"type":3},{"fieldId":3,"formType":"text","fieldName":"telephone","name":"电话","width":100,"type":1,"setting":[]},{"fieldId":4,"formType":"mobile","fieldName":"mobile","name":"手机","width":100,"type":7,"setting":[]},{"fieldId":5,"formType":"select","fieldName":"客户行业","name":"客户行业","width":100,"type":3},{"fieldId":6,"formType":"select","fieldName":"客户级别","name":"客户级别","width":100,"type":3},{"fieldId":7,"formType":"text","fieldName":"address","name":"地址","width":100,"type":1,"setting":[]},{"fieldId":8,"formType":"datetime","fieldName":"nextTime","name":"下次联系时间","width":100,"type":13,"setting":[]},{"fieldId":9,"formType":"text","fieldName":"remark","name":"备注","width":100,"type":1,"setting":[]},{"fieldId":null,"formType":"text","fieldName":"lastContent","name":"最后跟进记录","width":100,"type":1,"setting":[]},{"fieldId":null,"formType":"date","fieldName":"updateTime","name":"更新时间","width":100,"type":4,"setting":[]},{"fieldId":null,"formType":"date","fieldName":"createTime","name":"创建时间","width":100,"type":4,"setting":[]},{"fieldId":null,"formType":"text","fieldName":"ownerUserName","name":"负责人","width":100,"type":1,"setting":[]},{"fieldId":null,"formType":"text","fieldName":"createUserName","name":"创建人","width":100,"type":1,"setting":[]}]
//表格list数据
const List=[{"createUserId":3,"ownerUserName":"admin","address":"","createTime":"2020-11-10 10:05:32","createUserName":"admin","ownerUserId":3,"batchId":"3f9e3f45400f452a988bd466a5a36561","mobile":"","telephone":"","remark":"","客户行业":"IT","fieldBatchId":"3f9e3f45400f452a988bd466a5a36561","线索来源":"促销","isTransform":0,"lastContent":null,"followup":null,"leadsId":2,"updateTime":"2020-11-10 10:05:32","nextTime":"2020-11-12 00:00:00","leadsName":"77","customerId":null,"客户级别":"A(重点客户)"},{"createUserId":3,"ownerUserName":"admin","address":"","createTime":"2020-10-13 16:08:48","createUserName":"admin","ownerUserId":3,"batchId":"215f6dfc0b544a84b3b095d505bb62b8","mobile":"1336544343","telephone":"i","remark":"","客户行业":"","fieldBatchId":"215f6dfc0b544a84b3b095d505bb62b8","线索来源":"搜索引擎","isTransform":0,"lastContent":null,"followup":null,"leadsId":1,"updateTime":"2020-10-13 16:08:48","nextTime":null,"leadsName":"ii","customerId":null,"客户级别":"A(重点客户)"}]
//detail 数据
//record 数据
const recordList= [{"recordId":2,"img":[],"file":[],"createTime":"2020-11-11 14:06:31","nextTime":"2020-11-23 00:00:00","batchId":null,"category":"上门拜访","userImg":"","content":"77","realname":"admin"}]
//基本信息
const baseInfoListOne=[{"formType":"text","name":"线索名称","value":"ii"},{"formType":"text","name":"电话","value":"i"},{"formType":"mobile","name":"手机","value":"1336544343"},{"formType":"text","name":"地址","value":""},{"formType":"datetime","name":"下次联系时间","value":"2020-11-09 00:00:00"},{"formType":"text","name":"备注","value":""},{"formType":"select","name":"线索来源","value":"搜索引擎"},{"formType":"select","name":"客户行业","value":""},{"formType":"select","name":"客户级别","value":"A(重点客户)"}]
const baseInfoListTwo=[{"formType":"text","name":"线索名称","value":"77"},{"formType":"text","name":"电话","value":""},{"formType":"mobile","name":"手机","value":""},{"formType":"text","name":"地址","value":""},{"formType":"datetime","name":"下次联系时间","value":"2020-11-23 00:00:00"},{"formType":"text","name":"备注","value":""},{"formType":"select","name":"线索来源","value":"促销"},{"formType":"select","name":"客户行业","value":"IT"},{"formType":"select","name":"客户级别","value":"A(重点客户)"}]
const scenList=[{"formType":"text","fieldName":"leads_name","name":"线索名称","setting":[]},{"formType":"text","fieldName":"telephone","name":"电话","setting":[]},{"formType":"mobile","fieldName":"mobile","name":"手机","setting":[]},{"formType":"text","fieldName":"address","name":"地址","setting":[]},{"formType":"datetime","fieldName":"next_time","name":"下次联系时间","setting":[]},{"formType":"text","fieldName":"remark","name":"备注","setting":[]},{"formType":"user","fieldName":"owner_user_id","name":"负责人","setting":[]},{"formType":"user","fieldName":"create_user_id","name":"创建人","setting":[]},{"formType":"datetime","fieldName":"update_time","name":"更新时间","setting":[]},{"formType":"datetime","fieldName":"create_time","name":"创建时间","setting":[]},{"fieldId":2,"formType":"select","name":"线索来源","options":"促销,搜索引擎,广告,转介绍,线上注册,线上询价,预约上门,电话咨询,邮件咨询","type":3,"fieldName":"线索来源","setting":["促销","搜索引擎","广告","转介绍","线上注册","线上询价","预约上门","电话咨询","邮件咨询"]},{"fieldId":5,"formType":"select","name":"客户行业","options":"IT,金融业,房地产,商业服务,运输/物流,生产,政府,文化传媒","type":3,"fieldName":"客户行业","setting":["IT","金融业","房地产","商业服务","运输/物流","生产","政府","文化传媒"]},{"fieldId":6,"formType":"select","name":"客户级别","options":"A(重点客户),B(普通客户),C(非优先客户)","type":3,"fieldName":"客户级别977","setting":["A(重点客户)","B(普通客户)","C(非优先客户)"]}]
export default [
{
url: '/vue-element-admin/ux/queryField',
type: 'get',
response: _ => {
return {
"code": 20000,
"data": ListField
}
}
},
{
url: '/vue-element-admin/ux/queryPageList',
type: 'get',
response: config => {
const { importance, type, title, page = 1, limit = 20, sort } = config.query
let mockList = List.filter(item => {
if (importance && item.importance !== +importance) return false
if (type && item.type !== type) return false
if (title && item.title.indexOf(title) < 0) return false
return true
})
if (sort === '-id') {
mockList = mockList.reverse()
}
const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))
return {
code: 20000,
data: {
totalRow: mockList.length,
list: pageList
}
}
}
},
{
url: '/vue-element-admin/ux/detail',
type: 'get',
response: config => {
const { id } = config.query
for (const article of List) {
if (article.leadsId == id) {
return {
code: 20000,
data: article
}
}
}
}
},
{
url: '/vue-element-admin/ux/queryRecordOptions',
type: 'get',
response: _ => {
return {
"code": 20000,
"data":["打电话","发短信","上门拜访"]
}
}
},
{
url: '/vue-element-admin/ux/getRecord',
type: 'get',
response: config => {
const { page, limit, leadsId } = config.query
let mockList = recordList.filter(item => {
return true
})
const pageList = mockList.filter((item, index) => index < limit * page && index >= limit * (page - 1))
for (const item of recordList) {
if (item.recordId == leadsId) {
return {
code: 20000,
data: recordList
}
}else{
return {
code: 20000,
data: []
}
}
}
}
},
{
url: '/vue-element-admin/ux/information',
type: 'get',
response: config => {
const { types, id } = config.query
console.log(id)
if(id==1){
return {
code: 20000,
data: baseInfoListOne
}
}else{
return {
code: 20000,
data: baseInfoListTwo
}
}
}
},
{
url: '/vue-element-admin/ux/scene/queryField',
type: 'get',
response: _ => {
return {
"code": 20000,
"data":scenList
}
}
},
]