master_merge v11.0.3
monkey 4 years ago
parent 54a788a917
commit f131de1dc4

@ -413,7 +413,7 @@ export function printTemplateListAPI(data) {
*/ */
export function printTemplateByIdAPI(data) { export function printTemplateByIdAPI(data) {
return request({ return request({
url: 'crmPrint/queryPrintTemplateById', url: 'admin/printing/read',
method: 'post', method: 'post',
data: data data: data
}) })
@ -488,7 +488,7 @@ export function printQueryFieldsAPI(data) {
*/ */
export function printPrintAPI(data) { export function printPrintAPI(data) {
return request({ return request({
url: 'crmPrint/print', url: 'crm/printing/printingData',
method: 'post', method: 'post',
data: data data: data
}) })
@ -514,7 +514,7 @@ export function printCopyTemplateAPI(data) {
*/ */
export function printSaveRecordAPI(data) { export function printSaveRecordAPI(data) {
return request({ return request({
url: 'crmPrint/savePrintRecord', url: 'crm/printing/setRecord',
method: 'post', method: 'post',
data: data, data: data,
headers: { headers: {
@ -530,7 +530,7 @@ export function printSaveRecordAPI(data) {
*/ */
export function printQueryPrintRecordAPI(data) { export function printQueryPrintRecordAPI(data) {
return request({ return request({
url: 'crmPrint/queryPrintRecord', url: 'crm/printing/getRecord',
method: 'post', method: 'post',
data: data data: data
}) })
@ -543,7 +543,7 @@ export function printQueryPrintRecordAPI(data) {
*/ */
export function printRecordDetailAPI(data) { export function printRecordDetailAPI(data) {
return request({ return request({
url: 'crmPrint/queryPrintRecordById', url: 'crm/printing/printingData',
method: 'post', method: 'post',
data: data data: data
}) })
@ -556,7 +556,7 @@ export function printRecordDetailAPI(data) {
*/ */
export function printPreviewAPI(data) { export function printPreviewAPI(data) {
return request({ return request({
url: 'crmPrint/preview', url: 'crm/printing/preview',
method: 'post', method: 'post',
data: data data: data
}) })

@ -171,3 +171,27 @@ export function userErrorExcelDownAPI(data) {
responseType: 'blob' responseType: 'blob'
}) })
} }
/**
* 员工数量
* @param {*} data
*/
export function adminUserCountNumOfUserAPI() {
return request({
url: 'admin/users/countNumOfUser',
method: 'post'
})
}
/**
* 重置部门
* @param {*} data
*/
export function adminUserSetUserDeptPI(data) {
return request({
url: 'admin/users/setUserDept',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}

@ -0,0 +1,80 @@
import request from '@/utils/request'
/**
* 查询系统登录日志列表页接口
* @param {*} data
*/
export function queryLoginLogListAPI(data) {
return request({
url: 'admin/log/loginRecord',
method: 'post',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},
data: data
})
}
/**
* 系统登录日志导出
* @param {*} data
*/
// export function loginLogExportAPI(data) {
// return request({
// url: 'admin/log/excelImport',
// method: 'post',
// data: data,
// responseType: 'blob',
// headers: {
// 'Content-Type': 'application/json;charset=UTF-8'
// },
// timeout: 60000
// })
// }
/**
* 查看系统操作日志接口
* @param {*} data
*/
export function querySystemLogListAPI(data) {
return request({
url: 'admin/log/systemRecord',
method: 'post',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},
data: data
})
}
/**
* 查看数据操作日志接口
* @param {*} data
*/
export function queryDataOptionLogListAPI(data) {
return request({
url: 'admin/log/dataRecord',
method: 'post',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},
data: data
})
}
/**
* 系统日志导出
* @param {*} data
*/
export function systemLogExportAPI(data) {
return request({
url: 'admin/log/excelImport',
method: 'post',
data: data,
responseType: 'blob',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},
timeout: 60000
})
}

@ -130,10 +130,12 @@ export function webFileSaveAPI(data) {
var param = new FormData() var param = new FormData()
Object.keys(data).forEach(key => { Object.keys(data).forEach(key => {
param.append(key, data[key]) param.append(key, data[key])
param.append('isPublic', '1') // param.append('isPublic', '1')
param.append('module', 'print')
param.append('type', 'img')
}) })
return request({ return request({
url: 'adminFile/upload', url: 'admin/file/save',
method: 'post', method: 'post',
data: param, data: param,
headers: { headers: {
@ -210,7 +212,7 @@ export function crmFileUpdateAPI(data) {
*/ */
export function crmFileDownByPathAPI(data) { export function crmFileDownByPathAPI(data) {
return request({ return request({
url: 'crmPrint/down', url: 'crm/printing/down',
method: 'post', method: 'post',
data: data, data: data,
responseType: 'blob' responseType: 'blob'
@ -330,9 +332,9 @@ export function systemMessageDeleteByIdAPI(data) {
}) })
} }
export function downloadFileAPI(data) { export function downloadFileAPI(data, url) {
return request({ return request({
url: 'admin/file/download', url: `${url || `admin/file/download`}`,
method: 'post', method: 'post',
data, data,
responseType: 'blob' responseType: 'blob'

@ -92,7 +92,7 @@ export function filedUpdateTableFieldAPI(data) {
*/ */
export function filedGetPoolTableFieldAPI(data) { export function filedGetPoolTableFieldAPI(data) {
return request({ return request({
url: 'admin/field/getField', url: 'crm/customerPool/field',
method: 'post', method: 'post',
data: data data: data
}) })
@ -245,7 +245,7 @@ export function crmFieldConfigAPIIndexAPI(data) {
*/ */
export function crmPoolFieldConfigIndexAPI(data) { export function crmPoolFieldConfigIndexAPI(data) {
return request({ return request({
url: 'admin/field/configIndex', url: 'crm/customerPool/fieldConfig',
method: 'post', method: 'post',
data: data data: data
}) })
@ -269,7 +269,7 @@ export function crmFieldConfigAPI(data) {
*/ */
export function crmPoolFieldConfigAPI(data) { export function crmPoolFieldConfigAPI(data) {
return request({ return request({
url: 'admin/field/config', url: 'crm/customerPool/setFieldConfig',
method: 'post', method: 'post',
data: data data: data
}) })
@ -296,7 +296,7 @@ export function crmFieldColumnWidthAPI(data) {
*/ */
export function crmPoolFieldColumnWidthAPI(data) { export function crmPoolFieldColumnWidthAPI(data) {
return request({ return request({
url: 'crmField/setPoolFieldStyle', url: 'crm/customerPool/setFieldWidth',
method: 'post', method: 'post',
data: data, data: data,
headers: { headers: {

@ -264,3 +264,18 @@ export function crmContractQueryVisitAPI(data) {
} }
}) })
} }
/**
*
* @param {*} data
*/
export function crmContractQueryListByProductIdAPI(data) {
return request({
url: 'bi/product/listProduct',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}

@ -46,7 +46,7 @@ export function crmCustomerDeleteAPI(data) {
*/ */
export function crmCustomerPoolListAPI(data) { export function crmCustomerPoolListAPI(data) {
return request({ return request({
url: 'crm/customer/pool', url: 'crm/customerPool/index',
method: 'post', method: 'post',
data: data data: data
}) })
@ -58,7 +58,7 @@ export function crmCustomerPoolListAPI(data) {
*/ */
export function crmCustomerPoolDeleteAPI(data) { export function crmCustomerPoolDeleteAPI(data) {
return request({ return request({
url: 'crm/customer/delete', url: 'crm/customerPool/delete',
method: 'post', method: 'post',
data: data, data: data,
headers: { headers: {
@ -73,7 +73,7 @@ export function crmCustomerPoolDeleteAPI(data) {
*/ */
export function crmCustomerPoolSetAPI(data) { export function crmCustomerPoolSetAPI(data) {
return request({ return request({
url: 'crmCustomerPool/setCustomerPool', url: 'admin/setting/setPool',
method: 'post', method: 'post',
data: data, data: data,
headers: { headers: {
@ -88,7 +88,7 @@ export function crmCustomerPoolSetAPI(data) {
*/ */
export function crmCustomerPoolSetListAPI(data) { export function crmCustomerPoolSetListAPI(data) {
return request({ return request({
url: 'crmCustomerPool/queryPoolSettingList', url: 'admin/setting/pool',
method: 'post', method: 'post',
data: data, data: data,
headers: { headers: {
@ -102,7 +102,7 @@ export function crmCustomerPoolSetListAPI(data) {
*/ */
export function crmCustomerPoolSetDeleteAPI(data) { export function crmCustomerPoolSetDeleteAPI(data) {
return request({ return request({
url: 'crmCustomerPool/deleteCustomerPool', url: 'admin/setting/deletePool',
method: 'post', method: 'post',
data: data data: data
}) })
@ -114,7 +114,7 @@ export function crmCustomerPoolSetDeleteAPI(data) {
*/ */
export function crmCustomerPoolSetDetailAPI(data) { export function crmCustomerPoolSetDetailAPI(data) {
return request({ return request({
url: 'crmCustomerPool/queryPoolById', url: 'admin/setting/readPool',
method: 'post', method: 'post',
data: data data: data
}) })
@ -126,7 +126,7 @@ export function crmCustomerPoolSetDetailAPI(data) {
*/ */
export function crmCustomerPoolSetChangeStatusAPI(data) { export function crmCustomerPoolSetChangeStatusAPI(data) {
return request({ return request({
url: 'crmCustomerPool/changeStatus', url: 'admin/setting/changePool',
method: 'post', method: 'post',
data: data data: data
}) })
@ -140,7 +140,7 @@ export function crmCustomerPoolSetChangeStatusAPI(data) {
*/ */
export function crmCustomerPoolSetTransferAPI(data) { export function crmCustomerPoolSetTransferAPI(data) {
return request({ return request({
url: 'crmCustomerPool/transfer', url: 'admin/setting/transferPool',
method: 'post', method: 'post',
data: data data: data
}) })
@ -152,7 +152,7 @@ export function crmCustomerPoolSetTransferAPI(data) {
*/ */
export function crmCustomerPoolSetNameListAPI(data) { export function crmCustomerPoolSetNameListAPI(data) {
return request({ return request({
url: 'crmCustomerPool/queryPoolNameList', url: 'admin/setting/pool',
method: 'post', method: 'post',
data: data data: data
}) })
@ -164,7 +164,7 @@ export function crmCustomerPoolSetNameListAPI(data) {
*/ */
export function crmCustomerPoolNameListAPI(data) { export function crmCustomerPoolNameListAPI(data) {
return request({ return request({
url: 'crmCustomerPool/queryPoolNameListByAuth', url: 'crm/customerPool/pondList',
method: 'post', method: 'post',
data: data data: data
}) })
@ -176,7 +176,7 @@ export function crmCustomerPoolNameListAPI(data) {
*/ */
export function crmCustomerPoolQueryLevelAPI(data) { export function crmCustomerPoolQueryLevelAPI(data) {
return request({ return request({
url: 'crmCustomerPool/queryCustomerLevel', url: 'admin/setting/customerLevel',
method: 'post', method: 'post',
data: data data: data
}) })
@ -187,7 +187,7 @@ export function crmCustomerPoolQueryLevelAPI(data) {
*/ */
export function crmCustomerReadAPI(data) { export function crmCustomerReadAPI(data) {
return request({ return request({
url: `crm/customer/read`, url: `crm/${data.pool_id ? 'customerPool' : 'customer'}/read`,
method: 'post', method: 'post',
data: data data: data
}) })
@ -301,7 +301,7 @@ export function crmCustomerPoolExcelImportAPI(data) {
param.append(key, data[key]) param.append(key, data[key])
}) })
return request({ return request({
url: 'crmCustomerPool/uploadExcel', url: 'crm/customerPool/import',
method: 'post', method: 'post',
data: param, data: param,
headers: { headers: {
@ -325,13 +325,31 @@ export function crmCustomerDownloadExcelAPI(data) {
}) })
} }
/**
* 客户公海导入模板下载
* @param {*} data
*
*/
export function crmCustomerPoolDownloadExcelAPI(data) {
return request({
url: 'crm/customerPool/excelDownload',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
},
responseType: 'blob'
})
}
/** /**
* 公海导出 * 公海导出
* @param {*} data * @param {*} data
*/ */
export function crmCustomerPoolExcelExportAPI(data) { export function crmCustomerPoolExcelExportAPI(data) {
return request({ return request({
url: 'crm/customer/poolExcelExport', url: 'crm/customerPool/export',
method: 'post', method: 'post',
data: data, data: data,
headers: { headers: {
@ -348,7 +366,7 @@ export function crmCustomerPoolExcelExportAPI(data) {
*/ */
export function crmCustomerPoolExcelAllExport(data) { export function crmCustomerPoolExcelAllExport(data) {
return request({ return request({
url: 'crm/customer/poolExcelExport', url: 'crm/customerPool/export',
method: 'post', method: 'post',
data: data, data: data,
responseType: 'blob', responseType: 'blob',
@ -364,7 +382,7 @@ export function crmCustomerPoolExcelAllExport(data) {
*/ */
export function crmCustomerPoolQueryPoolFieldAPI(data) { export function crmCustomerPoolQueryPoolFieldAPI(data) {
return request({ return request({
url: 'crmCustomerPool/queryPoolField', url: 'admin/setting/poolField',
method: 'post', method: 'post',
data: data data: data
}) })
@ -376,7 +394,8 @@ export function crmCustomerPoolQueryPoolFieldAPI(data) {
*/ */
export function crmCustomerPoolQueryAuthAPI(data) { export function crmCustomerPoolQueryAuthAPI(data) {
return request({ return request({
url: 'crm/customer/poolAuthority', // url: 'crm/customer/poolAuthority',
url: 'crm/customerPool/authority',
method: 'post', method: 'post',
data: data data: data
}) })
@ -388,7 +407,7 @@ export function crmCustomerPoolQueryAuthAPI(data) {
*/ */
export function crmCustomerDistributeAPI(data) { export function crmCustomerDistributeAPI(data) {
return request({ return request({
url: 'crm/customer/distribute', url: 'crm/customerPool/distribute',
method: 'post', method: 'post',
data: data, data: data,
headers: { headers: {
@ -403,7 +422,7 @@ export function crmCustomerDistributeAPI(data) {
*/ */
export function crmCustomerReceiveAPI(data) { export function crmCustomerReceiveAPI(data) {
return request({ return request({
url: 'crm/customer/receive', url: 'crm/customerPool/receive',
method: 'post', method: 'post',
data: data, data: data,
headers: { headers: {

@ -248,3 +248,49 @@ export function crmIndexUnContactCustomerAPI(data) {
} }
}) })
} }
//* **********************************
/**
*
* @param {*} data
*/
export function crmInstrumentExportRecordListAPI(data) {
return request({
url: '',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
/**
*
* @param {*} data
*/
export function crmInstrumentImportRecordListAPI(data) {
return request({
url: '',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
/**
*
* @param {*} data
*/
export function crmInstrumentDownloadRecordExcelAPI(data) {
return request({
url: '',
method: 'post',
data: data,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}

@ -18,7 +18,7 @@ export function oaAllExamineCategoryListAPI(data) {
*/ */
export function oaAllExamineCategorySortAPI(data) { export function oaAllExamineCategorySortAPI(data) {
return request({ return request({
url: 'oaExamineCategory/saveOrUpdateOaExamineSort', url: 'oa/examine/examineSort',
method: 'post', method: 'post',
data: data, data: data,
headers: { headers: {

@ -68,12 +68,12 @@
<div class="sections__title">请选择公海</div> <div class="sections__title">请选择公海</div>
<div class="content"> <div class="content">
<div class="user-cell"> <div class="user-cell">
<el-select v-model="poolId" placeholder="请选择"> <el-select v-model="pool_id" placeholder="请选择">
<el-option <el-option
v-for="item in poolList" v-for="item in poolList"
:key="item.poolId" :key="item.pool_id"
:label="item.poolName" :label="item.pool_name"
:value="item.poolId"/> :value="item.pool_id"/>
</el-select> </el-select>
</div> </div>
</div> </div>
@ -153,7 +153,9 @@ import {
import { import {
crmCustomerExcelImportAPI, crmCustomerExcelImportAPI,
crmCustomerDownloadExcelAPI, crmCustomerDownloadExcelAPI,
crmCustomerPoolExcelImportAPI crmCustomerPoolExcelImportAPI,
crmCustomerPoolNameListAPI,
crmCustomerPoolDownloadExcelAPI
} from '@/api/crm/customer' } from '@/api/crm/customer'
import { import {
crmLeadsExcelImportAPI, crmLeadsExcelImportAPI,
@ -228,7 +230,7 @@ export default {
user: [], user: [],
// //
poolId: '', pool_id: '',
poolList: [], poolList: [],
stepsActive: 1, stepsActive: 1,
@ -422,7 +424,7 @@ export default {
params.file = this.file params.file = this.file
params.owner_user_id = this.user.length > 0 ? this.user[0].id : '' params.owner_user_id = this.user.length > 0 ? this.user[0].id : ''
if (this.config.poolSelectShow) { if (this.config.poolSelectShow) {
params.poolId = this.poolId params.pool_id = this.pool_id
} }
const request = this.config.importRequest || { const request = this.config.importRequest || {
@ -517,12 +519,12 @@ export default {
// //
download() { download() {
const request = this.config.templateRequest || { const request = this.config.templateRequest || {
customer: crmCustomerDownloadExcelAPI, customer: this.config.poolSelectShow ? crmCustomerPoolDownloadExcelAPI : crmCustomerDownloadExcelAPI,
leads: crmLeadsDownloadExcelAPI, leads: crmLeadsDownloadExcelAPI,
contacts: crmContactsDownloadExcelAPI, contacts: crmContactsDownloadExcelAPI,
product: crmProductDownloadExcelAPI product: crmProductDownloadExcelAPI
}[this.crmType] }[this.crmType]
request() request({ pool_id: this.config.poolSelectShow && this.pool_id })
.then(res => { .then(res => {
downloadExcelWithResData(res) downloadExcelWithResData(res)
}) })
@ -571,17 +573,13 @@ export default {
* 公海数据 * 公海数据
*/ */
getPoolList() { getPoolList() {
// crmCustomerPoolNameListAPI() crmCustomerPoolNameListAPI()
// .then(res => { .then(res => {
// this.poolList = res.data || [] this.poolList = res.data || []
// this.poolId = this.poolList.length > 0 ? this.poolList[0].poolId : '' this.pool_id = this.poolList.length > 0 ? this.poolList[0].pool_id : ''
// }) })
// .catch(() => { .catch(() => {
// }) })
this.poolList = [
{ 'poolId': 1, 'poolName': '系统默认公海', 'adminUserId': null, 'memberUserId': null, 'memberDeptId': null, 'status': null, 'preOwnerSetting': null, 'preOwnerSettingDay': null, 'receiveSetting': null, 'receiveNum': null, 'remindSetting': null, 'remindDay': null, 'putInRule': null, 'createUserId': null, 'createTime': null, 'companyId': null }
]
this.poolId = 1
}, },
// //

@ -296,6 +296,7 @@ export default {
* 删除 * 删除
*/ */
deleteDep(index) { deleteDep(index) {
if (this.disabled) return
// splice ,dataValue watch // splice ,dataValue watch
const dataValue = objDeepCopy(this.dataValue) const dataValue = objDeepCopy(this.dataValue)
dataValue.splice(index, 1) dataValue.splice(index, 1)

@ -33,27 +33,14 @@ export default {
}, },
data() { data() {
return { return {
message: `修复: message: `新增:
1修复自定义字段设置隐藏生效问题 1客户管理模块字段授权
2修复线索自定义字段转化字段设置生效问题 2客户管理模块打印模板
3修复导入数据超过100条部分的数据无法导入问题 3客户管理多公海模块
4修复新建场景保存报错问题 4数据操作日志
5修复客户新建后显示为公海客户无法操作问题 5系统操作日志
6修复多选字段高级筛选不生效问题 6登录日志
7修复产品编辑报错问题 7员工管理增加批量重设部门的功能`
8修复部门人员字段列表展示问题
9修复手机邮箱字段详情编辑校验问题
10修复活动记录展示其他客户信息的问题
11修复系统提示账号在其他地方登录问题
12修复待办事项今日需联系客户标记完成不生效问题
13修复仪表盘数据统计错误问题
14修复仪表盘遗忘提醒数据查询统计错误问题
15修复仪表盘自定义时间部门筛选数据统计错误问题
16修复商业智能自定义时间筛选数据统计错误问题
17修复商业智能部门人员默认筛选数据统计错误问题
18修复 72crm-11.0-webPHP版部署后部门成员不展示问题;
19修复其他已知bug
20新增商业智能导出功能`
} }
}, },
computed: {}, computed: {},

@ -3,7 +3,7 @@ const getLocationOrigin = () => {
} }
const companyName = '悟空CRM' const companyName = '悟空CRM'
const version = 'V11.0.2' const version = 'V11.0.3'
const baiduKey = 'lcuOQ71SCZhqpxsr1vL2mXoplWEoVctL' const baiduKey = 'lcuOQ71SCZhqpxsr1vL2mXoplWEoVctL'
export default { export default {

@ -250,7 +250,7 @@ export default {
* 获取客户位置提交参数 * 获取客户位置提交参数
*/ */
getCustomerAddressParams(params, dataValue) { getCustomerAddressParams(params, dataValue) {
params['address'] = dataValue.address params['address'] = (dataValue.address && dataValue.address.filter(item => item).length > 0)
? dataValue.address ? dataValue.address
: '' : ''
params['detail_address'] = dataValue.detail_address params['detail_address'] = dataValue.detail_address
@ -298,14 +298,19 @@ export default {
if (dataValue) { if (dataValue) {
return dataValue return dataValue
} }
delete data[field.field] // delete data[field.field]
return return ''
} else if (field.form_type == 'datetime') { } else if (field.form_type == 'datetime') {
if (dataValue) { if (dataValue) {
return moment(dataValue).unix() return moment(dataValue).unix()
} }
delete data[field.field] // delete data[field.field]
return return ''
} else if (field.form_type == 'number') {
if (dataValue) {
return dataValue
}
return ''
} }
return dataValue return dataValue

@ -150,24 +150,24 @@ export default [
permissions: ['manage', 'crm', 'field'] permissions: ['manage', 'crm', 'field']
} }
}, },
// { {
// path: 'customer',
// component: () => import('@/views/admin/crm/customer'),
// meta: {
// title: '客户公海规则设置',
// requiresAuth: true,
// permissions: ['manage', 'crm', 'pool']
// }
// },
{ // 临时 使用 后期删除
path: 'customer', path: 'customer',
component: () => import('@/views/admin/crm/customerPool'), component: () => import('@/views/admin/crm/customer'),
meta: { meta: {
title: '客户公海规则设置', title: '客户公海规则设置',
requiresAuth: true, requiresAuth: true,
permissions: ['manage', 'crm', 'pool'] permissions: ['manage', 'crm', 'pool']
} }
}, },
// { // 临时 使用 后期删除
// path: 'customer',
// component: () => import('@/views/admin/crm/customerPool'),
// meta: {
// title: '客户公海规则设置',
// requiresAuth: true,
// permissions: ['manage', 'crm', 'pool']
// }
// },
{ {
path: 'print-templates', path: 'print-templates',
component: () => import('@/views/admin/crm/printTemplates'), component: () => import('@/views/admin/crm/printTemplates'),
@ -216,6 +216,39 @@ export default [
} }
}] }]
}, },
{
...layout({
permissions: ['manage', 'adminLog'],
title: '系统日志',
icon: 'record'
}, '/manage/log/'),
alwaysShow: true,
children: [{
path: 'handle',
component: () => import('@/views/admin/log/DataHandleLog'),
meta: {
title: '数据操作日志',
requiresAuth: true,
permissions: ['manage', 'adminLog', 'actionRecord']
}
}, {
path: 'sys',
component: () => import('@/views/admin/log/SysHandleLog'),
meta: {
title: '系统操作日志',
requiresAuth: true,
permissions: ['manage', 'adminLog', 'systemLog']
}
}, {
path: 'login',
component: () => import('@/views/admin/log/LoginLog'),
meta: {
title: '登录日志',
requiresAuth: true,
permissions: ['manage', 'adminLog', 'loginLog']
}
}]
},
{ {
...layout({ ...layout({
permissions: ['manage', 'other_rule', 'setwelcome'] permissions: ['manage', 'other_rule', 'setwelcome']

@ -5,14 +5,14 @@
class="detail-recycle-rule__content"> class="detail-recycle-rule__content">
<div class="range-rule"> <div class="range-rule">
<span>选择不进入公海客户</span> <span>选择不进入公海客户</span>
<span v-if="dealHandleShow && data.dealHandle === 0"></span> <span v-if="dealHandleShow && data.deal_handle === 1"></span>
<span v-if="businessHandleShow && data.businessHandle === 0"></span> <span v-if="businessHandleShow && data.business_handle === 1"></span>
</div> </div>
<div> <div>
<div v-if="data.customerLevelSetting === 1" class="type-rule"></div> <div v-if="data.level_conf === 1" class="type-rule"></div>
<div v-else-if="data.customerLevelSetting === 2" class="type-rule">根据客户级别分别设置</div> <div v-else-if="data.level_conf === 2" class="type-rule">根据客户级别分别设置</div>
<el-table <el-table
:data="data.levelSetting" :data="data.level_setting"
border border
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
@ -21,9 +21,9 @@
width="180"/> width="180"/>
<el-table-column <el-table-column
:label="limitDayName" :label="limitDayName"
prop="limitDay"> prop="limit_day">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ `超过${scope.row.limitDay}${getLimitDayUnit(data.type)},进入公海` }}</span> <span>{{ `超过${scope.row.limit_day}${getLimitDayUnit(data.type)},进入公海` }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

@ -28,7 +28,7 @@
label-position="top" label-position="top"
class="pool-add-items"> class="pool-add-items">
<el-form-item <el-form-item
prop="poolName" prop="pool_name"
class="pool-add-item pool-add-item__left"> class="pool-add-item pool-add-item__left">
<div <div
slot="label" slot="label"
@ -37,7 +37,7 @@
公海名称 公海名称
</div> </div>
</div> </div>
<el-input v-model="baseFrom.poolName" :maxlength="100" /> <el-input v-model="baseFrom.pool_name" :maxlength="100" />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
prop="adminUsers" prop="adminUsers"
@ -89,13 +89,13 @@
align="stretch"> align="stretch">
<div class="row-label">前负责人领取规则</div> <div class="row-label">前负责人领取规则</div>
<div class="row-content"> <div class="row-content">
<el-radio-group v-model="baseFrom.preOwnerSetting"> <el-radio-group v-model="baseFrom.before_owner_conf">
<el-radio :label="0">不限制</el-radio> <el-radio :label="0">不限制</el-radio>
<el-radio :label="1">限制</el-radio> <el-radio :label="1">限制</el-radio>
</el-radio-group> </el-radio-group>
<div v-if="baseFrom.preOwnerSetting === 1" class="xr-input"> <div v-if="baseFrom.before_owner_conf === 1" class="xr-input">
<span>前负责人</span> <span>前负责人</span>
<el-input v-model="baseFrom.preOwnerSettingDay" @keyup.native="inputLimit('preOwnerSettingDay')" /> <el-input v-model="baseFrom.before_owner_day" @keyup.native="inputLimit('before_owner_day')" />
<span>天内不允许领取该客户</span> <span>天内不允许领取该客户</span>
</div> </div>
</div> </div>
@ -106,13 +106,13 @@
align="stretch"> align="stretch">
<div class="row-label">领取频率规则</div> <div class="row-label">领取频率规则</div>
<div class="row-content"> <div class="row-content">
<el-radio-group v-model="baseFrom.receiveSetting"> <el-radio-group v-model="baseFrom.receive_conf">
<el-radio :label="0">不限制</el-radio> <el-radio :label="0">不限制</el-radio>
<el-radio :label="1">限制</el-radio> <el-radio :label="1">限制</el-radio>
</el-radio-group> </el-radio-group>
<div v-if="baseFrom.receiveSetting === 1" class="xr-input"> <div v-if="baseFrom.receive_conf === 1" class="xr-input">
<span>每天最多领取</span> <span>每天最多领取</span>
<el-input v-model="baseFrom.receiveNum" @keyup.native="inputLimit('receiveNum')" /> <el-input v-model="baseFrom.receive_count" @keyup.native="inputLimit('receive_count')" />
<span>个公海客户</span> <span>个公海客户</span>
</div> </div>
</div> </div>
@ -123,13 +123,13 @@
align="stretch"> align="stretch">
<div class="row-label">提醒规则</div> <div class="row-label">提醒规则</div>
<div class="row-content"> <div class="row-content">
<el-radio-group v-model="baseFrom.remindSetting"> <el-radio-group v-model="baseFrom.remind_conf">
<el-radio :label="0">不提醒</el-radio> <el-radio :label="0">不提醒</el-radio>
<el-radio :label="1">提醒</el-radio> <el-radio :label="1">提醒</el-radio>
</el-radio-group> </el-radio-group>
<div v-if="baseFrom.remindSetting === 1" class="xr-input"> <div v-if="baseFrom.remind_conf === 1" class="xr-input">
<span>提前</span> <span>提前</span>
<el-input v-model="baseFrom.remindDay" @keyup.native="inputLimit('remindDay')" /> <el-input v-model="baseFrom.remain_day" @keyup.native="inputLimit('remain_day')" />
<span>天提醒负责人</span> <span>天提醒负责人</span>
</div> </div>
</div> </div>
@ -140,14 +140,14 @@
align="stretch"> align="stretch">
<div class="row-label">收回规则</div> <div class="row-label">收回规则</div>
<div class="row-content"> <div class="row-content">
<el-radio-group v-model="baseFrom.putInRule"> <el-radio-group v-model="baseFrom.recycle_conf">
<el-radio :label="1">自动回收</el-radio> <el-radio :label="1">自动回收</el-radio>
<el-radio :label="0">不自动回收</el-radio> <el-radio :label="0">不自动回收</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
</flexbox> </flexbox>
<template v-if="baseFrom.putInRule == 1"> <template v-if="baseFrom.recycle_conf == 1">
<recycle-rule <recycle-rule
v-for="(item, index) in recycleRuleData" v-for="(item, index) in recycleRuleData"
:key="index" :key="index"
@ -172,7 +172,7 @@
<el-checkbox <el-checkbox
v-for="(item, index) in customerPoolFields" v-for="(item, index) in customerPoolFields"
:key="index" :key="index"
v-model="item.isHidden" v-model="item.is_hidden"
:true-label="0" :true-label="0"
:false-label="1">{{ item.name }}</el-checkbox> :false-label="1">{{ item.name }}</el-checkbox>
</flexbox> </flexbox>
@ -251,7 +251,7 @@ export default {
loading: false, loading: false,
baseFrom: null, baseFrom: null,
baseRules: { baseRules: {
poolName: [ pool_name: [
{ required: true, message: '请输入公海名称', trigger: 'blur' } { required: true, message: '请输入公海名称', trigger: 'blur' }
], ],
adminUsers: [ adminUsers: [
@ -265,9 +265,9 @@ export default {
levelCustomerName: [], // levelCustomerName: [], //
customerPoolFields: [], customerPoolFields: [],
requestFields: { requestFields: {
preOwnerSettingDay: '前负责人限制领取天数需大于0', before_owner_day: '前负责人限制领取天数需大于0',
receiveNum: '领取频率限制个数需大于0', receive_count: '领取频率限制个数需大于0',
remindDay: '提醒规则天数需大于0' remain_day: '提醒规则天数需大于0'
} }
} }
}, },
@ -309,7 +309,7 @@ export default {
getDetail() { getDetail() {
this.loading = true this.loading = true
crmCustomerPoolSetDetailAPI({ crmCustomerPoolSetDetailAPI({
poolId: this.action.id pool_id: this.action.id
}).then(res => { }).then(res => {
this.getEditInfo(res.data) this.getEditInfo(res.data)
this.loading = false this.loading = false
@ -319,20 +319,25 @@ export default {
}, },
getEditInfo(data) { getEditInfo(data) {
if (data.user_info) {
data.user_info.forEach(item => {
item.type = 'user'
})
}
this.baseFrom = { this.baseFrom = {
poolName: data.poolName, pool_name: data.pool_name,
adminUsers: data.adminUser, adminUsers: data.admin_user_info,
memberUsers: { memberUsers: {
users: data.memberUser, users: data.user_info,
strucs: data.memberDept strucs: data.department_info
}, },
preOwnerSetting: data.preOwnerSetting, // 0 1 before_owner_conf: data.before_owner_conf, // 0 1
preOwnerSettingDay: data.preOwnerSettingDay, before_owner_day: data.before_owner_day,
receiveSetting: data.receiveSetting, // 0 1 receive_conf: data.receive_conf, // 0 1
remindSetting: data.remindSetting, // 0 1 remind_conf: data.remind_conf, // 0 1
receiveNum: data.receiveNum, // receive_count: data.receive_count, //
remindDay: data.remindDay, // remain_day: data.remain_day, //
putInRule: data.putInRule // 0 1 recycle_conf: data.recycle_conf // 0 1
} }
this.recycleRuleData = this.getEditRule(data.rule) this.recycleRuleData = this.getEditRule(data.rule)
@ -345,23 +350,23 @@ export default {
const baseRule = [ const baseRule = [
{ {
type: '', type: '',
dealHandle: 1, deal_handle: 0,
businessHandle: 1, business_handle: 0,
customerLevelSetting: 1, level_conf: 1,
level: [] level: []
}, },
{ {
type: '', type: '',
dealHandle: 1, deal_handle: 0,
businessHandle: 1, business_handle: 0,
customerLevelSetting: 1, level_conf: 1,
level: [] level: []
}, },
{ {
type: '', type: '',
dealHandle: 1, deal_handle: 0,
businessHandle: 1, business_handle: 0,
customerLevelSetting: 1, level_conf: 1,
level: [] level: []
} }
] ]
@ -369,7 +374,7 @@ export default {
if (detailRule) { if (detailRule) {
for (let index = 0; index < detailRule.length; index++) { for (let index = 0; index < detailRule.length; index++) {
const element = detailRule[index] const element = detailRule[index]
element.level = element.levelSetting element.level = element.level_setting
baseRule.splice(element.type - 1, 1, element) baseRule.splice(element.type - 1, 1, element)
} }
} }
@ -382,19 +387,19 @@ export default {
*/ */
getCreateInfo() { getCreateInfo() {
this.baseFrom = { this.baseFrom = {
poolName: '', pool_name: '',
adminUsers: [], adminUsers: [],
memberUsers: { memberUsers: {
users: [], users: [],
strucs: [] strucs: []
}, },
preOwnerSetting: 0, // 0 1 before_owner_conf: 0, // 0 1
preOwnerSettingDay: '', before_owner_day: '',
receiveSetting: 0, // 0 1 receive_conf: 0, // 0 1
receiveNum: '', // receive_count: '', //
remindSetting: 0, // 0 1 remind_conf: 0, // 0 1
remindDay: '', // remain_day: '', //
putInRule: 1 // 0 1 recycle_conf: 1 // 0 1
} }
this.recycleRuleData = this.getEditRule() this.recycleRuleData = this.getEditRule()
@ -410,10 +415,18 @@ export default {
*/ */
getCustomerPoolFields(allFields) { getCustomerPoolFields(allFields) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
crmCustomerPoolQueryPoolFieldAPI().then(res => { crmCustomerPoolQueryPoolFieldAPI(
{
types: 'crm_customer',
module: 'crm',
action: 'pool',
controller: 'customer',
pool_id: this.action.id
}
).then(res => {
const list = res.data || [] const list = res.data || []
const baseField = list.map(item => { const baseField = list.map(item => {
item.isHidden = item.isHidden = allFields ? 1 : 0 item.is_hidden = item.is_hidden = allFields ? 1 : 0
return item return item
}) })
if (allFields) { if (allFields) {
@ -436,16 +449,16 @@ export default {
for (let editIndex = 0; editIndex < allFields.length; editIndex++) { for (let editIndex = 0; editIndex < allFields.length; editIndex++) {
const editItem = allFields[editIndex] const editItem = allFields[editIndex]
// fieldId fieldId fieldName // field_id fieldId field_name
if (item.fieldId) { if (item.field_id) {
if (item.fieldId === editItem.fieldId) { if (item.field_id === editItem.field_id) {
item.settingId = editItem.settingId item.setting_id = editItem.setting_id
item.isHidden = editItem.isHidden item.is_hidden = editItem.is_hidden
} }
} else { } else {
if (item.fieldName === editItem.fieldName) { if (item.field === editItem.field_name) {
item.settingId = editItem.settingId item.setting_id = editItem.setting_id
item.isHidden = editItem.isHidden item.is_hidden = editItem.is_hidden
} }
} }
} }
@ -503,7 +516,7 @@ export default {
*/ */
uploadPoolSet(params) { uploadPoolSet(params) {
if (this.isEdit) { if (this.isEdit) {
params.poolId = this.action.id params.pool_id = this.action.id
} }
this.loading = true this.loading = true
crmCustomerPoolSetAPI(params).then(res => { crmCustomerPoolSetAPI(params).then(res => {
@ -520,11 +533,11 @@ export default {
* 必填字段验证 * 必填字段验证
*/ */
requestFieldsVerify(key) { requestFieldsVerify(key) {
if (key == 'preOwnerSettingDay' && this.baseFrom.preOwnerSetting == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) { if (key == 'before_owner_day' && this.baseFrom.before_owner_conf == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) {
return false return false
} else if (key == 'receiveNum' && this.baseFrom.receiveSetting == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) { } else if (key == 'receive_count' && this.baseFrom.receive_conf == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) {
return false return false
} else if (key == 'remindDay' && this.baseFrom.remindSetting == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) { } else if (key == 'remain_day' && this.baseFrom.remind_conf == 1 && (!this.baseFrom[key] || this.baseFrom[key] <= 0)) {
return false return false
} }
@ -544,17 +557,17 @@ export default {
} else { } else {
if (key == 'adminUsers') { if (key == 'adminUsers') {
const adminUsers = this.baseFrom.adminUsers || [] const adminUsers = this.baseFrom.adminUsers || []
params.adminUserId = adminUsers.map(item => { params.admin_user_ids = adminUsers.map(item => {
return item.userId return item.id
}).join(',') }).join(',')
} else if (key == 'memberUsers') { } else if (key == 'memberUsers') {
const memberUserObj = this.baseFrom.memberUsers || {} const memberUserObj = this.baseFrom.memberUsers || {}
const adminUsers = memberUserObj.users || [] const adminUsers = memberUserObj.users || []
const adminStrucs = memberUserObj.strucs || [] const adminStrucs = memberUserObj.strucs || []
params.memberUserId = adminUsers.map(item => { params.user_ids = adminUsers.map(item => {
return item.userId return item.id
}).join(',') }).join(',')
params.memberDeptId = adminStrucs.map(item => { params.department_ids = adminStrucs.map(item => {
return item.id return item.id
}).join(',') }).join(',')
} else { } else {
@ -564,7 +577,7 @@ export default {
} }
// 1 // 1
if (this.baseFrom.putInRule == 1) { if (this.baseFrom.recycle_conf == 1) {
const ruleVerify = this.recycleRuleData.filter(item => { const ruleVerify = this.recycleRuleData.filter(item => {
return item.type return item.type
}) })
@ -583,7 +596,7 @@ export default {
const newLevel = [] const newLevel = []
for (let levelIndex = 0; levelIndex < ruleItem.level.length; levelIndex++) { for (let levelIndex = 0; levelIndex < ruleItem.level.length; levelIndex++) {
const levelItem = ruleItem.level[levelIndex] const levelItem = ruleItem.level[levelIndex]
if (levelItem.limitDay && levelItem.limitDay > 0) { if (levelItem.limit_day && levelItem.limit_day > 0) {
rulePass = true rulePass = true
newLevel.push(levelItem) newLevel.push(levelItem)
} }
@ -604,7 +617,7 @@ export default {
} }
const showFields = this.customerPoolFields.filter(item => { const showFields = this.customerPoolFields.filter(item => {
return item.isHidden == 0 return item.is_hidden == 0
}) })
if (showFields.length < 2) { if (showFields.length < 2) {

@ -17,11 +17,11 @@
</div> </div>
<div> <div>
<div class="header-title">公海名称</div> <div class="header-title">公海名称</div>
<div class="header-name">{{ detail.poolName }}</div> <div class="header-name">{{ detail.pool_name }}</div>
</div> </div>
<span class="customer-num"> <span class="customer-num">
客户数量<span class="customer-num__value">{{ detail.customerNum || 0 }}</span> 客户数量<span class="customer-num__value">{{ detail.customer_count || 0 }}</span>
</span> </span>
</flexbox> </flexbox>
<flexbox <flexbox
@ -31,7 +31,7 @@
<div class="label">公海管理员</div> <div class="label">公海管理员</div>
<div class="value"> <div class="value">
<xr-avatar <xr-avatar
v-for="(item, index) in detail.adminUser" v-for="(item, index) in detail.admin_user_info"
:key="`admin${index}`" :key="`admin${index}`"
:name="item.realname" :name="item.realname"
:size="32" :size="32"
@ -42,13 +42,13 @@
<div class="label">公海成员</div> <div class="label">公海成员</div>
<div class="value"> <div class="value">
<xr-avatar <xr-avatar
v-for="(item, index) in detail.memberUser" v-for="(item, index) in detail.user_info"
:key="`member${index}`" :key="`member${index}`"
:name="item.realname" :name="item.realname"
:size="32" :size="32"
:src="item.img || item.thumb_img" /> :src="item.img || item.thumb_img" />
<xr-avatar <xr-avatar
v-for="(item, index) in detail.memberDept" v-for="(item, index) in detail.department_info"
:title="`dept${index}`" :title="`dept${index}`"
:key="`dept${index}`" :key="`dept${index}`"
:name="item.name" :name="item.name"
@ -63,25 +63,25 @@
align="stretch" align="stretch"
class="rule-item"> class="rule-item">
<div class="label">前负责人领取规则</div> <div class="label">前负责人领取规则</div>
<div class="value">{{ detail.preOwnerSetting == 1 ? `前负责人${detail.preOwnerSettingDay}天内不允许领取该客户` : '不限制' }}</div> <div class="value">{{ detail.before_owner_conf == 1 ? `前负责人${detail.before_owner_day}天内不允许领取该客户` : '不限制' }}</div>
</flexbox> </flexbox>
<flexbox <flexbox
align="stretch" align="stretch"
class="rule-item"> class="rule-item">
<div class="label">领取频率规则</div> <div class="label">领取频率规则</div>
<div class="value">{{ detail.receiveSetting == 1 ? `每天最多领取${detail.receiveNum}个公海客户` : '不限制' }}</div> <div class="value">{{ detail.receive_conf == 1 ? `每天最多领取${detail.receive_count}个公海客户` : '不限制' }}</div>
</flexbox> </flexbox>
<flexbox <flexbox
align="stretch" align="stretch"
class="rule-item"> class="rule-item">
<div class="label">提醒规则</div> <div class="label">提醒规则</div>
<div class="value">{{ detail.remindSetting == 1 ? `提前${detail.remindDay}天提醒负责人` : '不提醒' }}</div> <div class="value">{{ detail.remind_conf == 1 ? `提前${detail.remain_day}天提醒负责人` : '不提醒' }}</div>
</flexbox> </flexbox>
<flexbox <flexbox
align="stretch" align="stretch"
class="rule-item"> class="rule-item">
<div class="label">收回规则</div> <div class="label">收回规则</div>
<div v-if="detail.putInRule == 0" class="value"></div> <div v-if="detail.recycle_conf == 0" class="value"></div>
<div v-else class="value rule-value"> <div v-else class="value rule-value">
<detail-recycle-rule <detail-recycle-rule
v-for="(item, index) in detail.rule" v-for="(item, index) in detail.rule"
@ -121,7 +121,7 @@ export default {
filters: { filters: {
fieldNameFilter(list) { fieldNameFilter(list) {
return list.filter(item => { return list.filter(item => {
return item.isHidden === 0 return item.is_hidden === 0
}).map(item => { }).map(item => {
return item.name return item.name
}).join('') }).join('')
@ -158,7 +158,7 @@ export default {
getDetail() { getDetail() {
this.loading = true this.loading = true
crmCustomerPoolSetDetailAPI({ crmCustomerPoolSetDetailAPI({
poolId: this.id pool_id: this.id
}).then(res => { }).then(res => {
this.detail = res.data this.detail = res.data
this.loading = false this.loading = false

@ -12,9 +12,9 @@
<el-select v-model="selectId" > <el-select v-model="selectId" >
<el-option <el-option
v-for="item in list" v-for="item in list"
:key="item.poolId" :key="item.pool_id"
:label="item.poolName" :label="item.pool_name"
:value="item.poolId"/> :value="item.pool_id"/>
</el-select> </el-select>
</flexbox> </flexbox>
</div> </div>
@ -62,14 +62,14 @@ export default {
computed: { computed: {
list() { list() {
return this.allList.filter(item => { return this.allList.filter(item => {
return item.poolId != this.id return item.pool_id != this.id
}) })
} }
}, },
watch: { watch: {
list: { list: {
handler() { handler() {
this.selectId = this.list && this.list.length > 0 ? this.list[0].poolId : '' this.selectId = this.list && this.list.length > 0 ? this.list[0].pool_id : ''
}, },
immediate: true immediate: true
}, },
@ -89,9 +89,9 @@ export default {
const loading = Loading.service({ const loading = Loading.service({
target: document.querySelector(`.el-dialog[aria-label="转移"]`) target: document.querySelector(`.el-dialog[aria-label="转移"]`)
}) })
crmCustomerPoolSetNameListAPI() crmCustomerPoolSetNameListAPI({ limit: 9999 })
.then(res => { .then(res => {
this.allList = res.data || [] this.allList = res.data.list || []
loading && loading.close() loading && loading.close()
}) })
.catch(() => { .catch(() => {
@ -115,8 +115,8 @@ export default {
target: document.querySelector(`.el-dialog[aria-label="转移"]`) target: document.querySelector(`.el-dialog[aria-label="转移"]`)
}) })
crmCustomerPoolSetTransferAPI({ crmCustomerPoolSetTransferAPI({
prePoolId: this.id, source_pool_id: this.id,
postPoolId: this.selectId target_pool_id: this.selectId
}) })
.then(res => { .then(res => {
this.$message({ this.$message({

@ -10,9 +10,9 @@
<span class="check-label">选择不进入公海客户</span> <span class="check-label">选择不进入公海客户</span>
<el-checkbox <el-checkbox
v-if="dealHandleShow" v-if="dealHandleShow"
v-model="data.dealHandle" v-model="data.deal_handle"
:true-label="0" :true-label="1"
:false-label="1">已成交客户<el-tooltip :false-label="0">已成交客户<el-tooltip
content="已成交是指客户状态为“已成交”" content="已成交是指客户状态为“已成交”"
effect="dark" effect="dark"
placement="top"> placement="top">
@ -20,12 +20,12 @@
</el-tooltip></el-checkbox> </el-tooltip></el-checkbox>
<el-checkbox <el-checkbox
v-if="businessHandleShow" v-if="businessHandleShow"
v-model="data.businessHandle" v-model="data.business_handle"
:true-label="0" :true-label="1"
:false-label="1">有商机客户</el-checkbox> :false-label="0">有商机客户</el-checkbox>
</div> </div>
<div> <div>
<el-radio v-model="data.customerLevelSetting" :label="1"></el-radio> <el-radio v-model="data.level_conf" :label="1"></el-radio>
<el-table <el-table
:data="allCustomerData" :data="allCustomerData"
border border
@ -36,10 +36,10 @@
width="180"/> width="180"/>
<el-table-column <el-table-column
:label="limitDayName" :label="limitDayName"
prop="limitDay"> prop="limit_day">
<template slot-scope="scope"> <template slot-scope="scope">
<span>超过</span> <span>超过</span>
<el-input v-model="scope.row.limitDay" class="value-input" @keyup.native="inputLimit(scope.row)" /> <el-input v-model="scope.row.limit_day" class="value-input" @keyup.native="inputLimit(scope.row)" />
<span>{{ limitDayUnit }}进入公海</span> <span>{{ limitDayUnit }}进入公海</span>
</template> </template>
</el-table-column> </el-table-column>
@ -47,7 +47,7 @@
</div> </div>
<div> <div>
<el-radio v-model="data.customerLevelSetting" :label="2"></el-radio> <el-radio v-model="data.level_conf" :label="2"></el-radio>
<el-table <el-table
:data="levelCustomerData" :data="levelCustomerData"
border border
@ -58,10 +58,10 @@
width="180"/> width="180"/>
<el-table-column <el-table-column
:label="limitDayName" :label="limitDayName"
prop="limitDay"> prop="limit_day">
<template slot-scope="scope"> <template slot-scope="scope">
<span>超过</span> <span>超过</span>
<el-input v-model="scope.row.limitDay" class="value-input" @keyup.native="inputLimit(scope.row)" /> <el-input v-model="scope.row.limit_day" class="value-input" @keyup.native="inputLimit(scope.row)" />
<span>{{ limitDayUnit }}进入公海</span> <span>{{ limitDayUnit }}进入公海</span>
</template> </template>
</el-table-column> </el-table-column>
@ -86,16 +86,16 @@ export default {
default: () => { default: () => {
/** /**
* "type":1, // 1 2 3 * "type":1, // 1 2 3
"dealHandle":0, // 0 1 "deal_handle":0, // 0 1
"businessHandle":1, // 0 1 "business_handle":1, // 0 1
"level":1, // 1 2 A3 B4 C "level":1, // 1 2 A3 B4 C
"limitDay":30 // "limit_day":30 //
*/ */
return { return {
type: '', type: '',
dealHandle: 1, deal_handle: 0,
businessHandle: 1, business_handle: 0,
customerLevelSetting: null, level_conf: null,
level: [] level: []
} }
} }
@ -111,7 +111,7 @@ export default {
return { return {
allCustomerData: [{ allCustomerData: [{
level: '所有客户', // 1 2 A3 B4 C level: '所有客户', // 1 2 A3 B4 C
limitDay: '' limit_day: ''
}], }],
levelCustomerData: [] levelCustomerData: []
} }
@ -149,7 +149,7 @@ export default {
} }
}, },
watch: { watch: {
'data.customerLevelSetting': { 'data.level_conf': {
handler(val, oldVal) { handler(val, oldVal) {
if (val == 1) { if (val == 1) {
if (this.isEdit && oldVal == null) { if (this.isEdit && oldVal == null) {
@ -175,14 +175,14 @@ export default {
if (value && value.length) { if (value && value.length) {
this.levelCustomerData = value.map(item => { this.levelCustomerData = value.map(item => {
const obj = { const obj = {
limitDay: '' limit_day: ''
} }
obj.level = item obj.level = item
return obj return obj
}) })
// 2 // 2
if (this.data.customerLevelSetting == 2) { if (this.data.level_conf == 2) {
if (this.isEdit && this.levelCustomerData && this.levelCustomerData.length) { if (this.isEdit && this.levelCustomerData && this.levelCustomerData.length) {
this.data.level = this.getEditData(this.levelCustomerData, this.data.level) this.data.level = this.getEditData(this.levelCustomerData, this.data.level)
} }
@ -202,7 +202,7 @@ export default {
for (let editIndex = 0; editIndex < editList.length; editIndex++) { for (let editIndex = 0; editIndex < editList.length; editIndex++) {
const editItem = editList[editIndex] const editItem = editList[editIndex]
if (editItem.level == item.level) { if (editItem.level == item.level) {
item.limitDay = editItem.limitDay item.limit_day = editItem.limit_day
} }
} }
} }
@ -214,7 +214,7 @@ export default {
* 阻挡输入 * 阻挡输入
*/ */
inputLimit(data) { inputLimit(data) {
data.limitDay = data.limitDay.replace(/[^0-9]/g, '') data.limit_day = data.limit_day.replace(/[^0-9]/g, '')
} }
} }
} }

@ -27,22 +27,22 @@
@row-click="handleRowClick"> @row-click="handleRowClick">
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
prop="poolName" prop="pool_name"
width="150" width="150"
label="公海名称"/> label="公海名称"/>
<el-table-column <el-table-column
:formatter="fieldFormatter" :formatter="fieldFormatter"
show-overflow-tooltip show-overflow-tooltip
prop="adminUser" prop="admin_user_names"
label="公海管理员"/> label="公海管理员"/>
<el-table-column <el-table-column
:formatter="fieldFormatter" :formatter="fieldFormatter"
show-overflow-tooltip show-overflow-tooltip
prop="memberUser" prop="user_names"
label="公海成员"/> label="公海成员"/>
<el-table-column <el-table-column
show-overflow-tooltip show-overflow-tooltip
prop="customerNum" prop="customer_count"
width="100" width="100"
label="客户数量"/> label="客户数量"/>
<el-table-column <el-table-column
@ -188,7 +188,7 @@ export default {
}) })
.then(res => { .then(res => {
this.list = res.data.list this.list = res.data.list
this.total = res.data.totalRow this.total = res.data.count
this.loading = false this.loading = false
}) })
.catch(() => { .catch(() => {
@ -200,34 +200,35 @@ export default {
* 格式化字段 * 格式化字段
*/ */
fieldFormatter(row, column) { fieldFormatter(row, column) {
if (column.property === 'adminUser') { // if (column.property === 'admin_user_names') {
const users = row['adminUser'] || [] // const users = row['admin_user_names'] || []
return users // return users
.map(item => { // .map(item => {
return item.realname // return item.realname
}) // })
.join('、') // .join('')
} else if (column.property === 'memberUser') { // } else if (column.property === 'user_names') {
const structures = row['memberDept'] || [] // const structures = row['memberDept'] || []
let strName = structures // let strName = structures
.map(item => { // .map(item => {
return item.name // return item.name
}) // })
.join('、') // .join('')
const users = row['memberUser'] || [] // const users = row['user_names'] || []
const userName = users // const userName = users
.map(item => { // .map(item => {
return item.realname // return item.realname
}) // })
.join('、') // .join('')
if (strName && userName) { // if (strName && userName) {
strName += '、' // strName += ''
} // }
const name = strName + userName // const name = strName + userName
return name // return name
} else if (column.property === 'status') { // } else
if (column.property === 'status') {
if (row.status === 0) { if (row.status === 0) {
return '停用' return '停用'
} }
@ -240,7 +241,7 @@ export default {
* 通过回调控制class * 通过回调控制class
*/ */
cellClassName({ row, column, rowIndex, columnIndex }) { cellClassName({ row, column, rowIndex, columnIndex }) {
if (column.property === 'poolName') { if (column.property === 'pool_name') {
return 'can-visit--underline' return 'can-visit--underline'
} else { } else {
return '' return ''
@ -262,8 +263,8 @@ export default {
* 当某一行被点击时会触发该事件 * 当某一行被点击时会触发该事件
*/ */
handleRowClick(row, column, event) { handleRowClick(row, column, event) {
if (column.property === 'poolName') { if (column.property === 'pool_name') {
this.detailId = row.poolId this.detailId = row.pool_id
this.detailShow = true this.detailShow = true
} }
}, },
@ -275,12 +276,12 @@ export default {
if (type === 'edit') { if (type === 'edit') {
this.createAction = { this.createAction = {
type: 'update', type: 'update',
id: scope.row.poolId, id: scope.row.pool_id,
data: scope.row data: scope.row
} }
this.createShow = true this.createShow = true
} else if (type === 'transfer') { } else if (type === 'transfer') {
this.detailId = scope.row.poolId this.detailId = scope.row.pool_id
this.transferShow = true this.transferShow = true
} else if (type === 'delete') { } else if (type === 'delete') {
this.$confirm('您确定要删除吗?', '提示', { this.$confirm('您确定要删除吗?', '提示', {
@ -290,7 +291,7 @@ export default {
}) })
.then(() => { .then(() => {
crmCustomerPoolSetDeleteAPI({ crmCustomerPoolSetDeleteAPI({
poolId: scope.row.poolId pool_id: scope.row.pool_id
}) })
.then(res => { .then(res => {
this.list.splice(scope.$index, 1) this.list.splice(scope.$index, 1)
@ -319,7 +320,7 @@ export default {
) )
.then(() => { .then(() => {
crmCustomerPoolSetChangeStatusAPI({ crmCustomerPoolSetChangeStatusAPI({
poolId: scope.row.poolId, pool_id: scope.row.pool_id,
status: scope.row.status === 0 ? 1 : 0 status: scope.row.status === 0 ? 1 : 0
}) })
.then(res => { .then(res => {

@ -32,7 +32,7 @@
<div <div
v-for="(item, index) in menuList" v-for="(item, index) in menuList"
:key="index" :key="index"
:class="{'is-select' : item.fieldName == menuIndex}" :class="{'is-select' : item.field == menuIndex}"
class="menu-item" class="menu-item"
@click="menuSelect(item, index)"> @click="menuSelect(item, index)">
{{ item.name }} {{ item.name }}
@ -122,7 +122,7 @@ export default {
getDetail() { getDetail() {
this.loading = true this.loading = true
printTemplateByIdAPI({ printTemplateByIdAPI({
templateId: this.$route.query.templateId id: this.$route.query.templateId
}).then(res => { }).then(res => {
const data = res.data || {} const data = res.data || {}
this.content = data.content this.content = data.content
@ -178,9 +178,9 @@ export default {
menuSelect(item, index) { menuSelect(item, index) {
// console.log(this.editor.selection.getNode()) // console.log(this.editor.selection.getNode())
this.menuIndex = item.fieldName this.menuIndex = item.field
// //
if (this.activeTab == 'product' && item.fieldName != 'discount_rate' && item.fieldName != 'total_price') { if (this.activeTab == 'product' && item.field != 'discount_rate' && item.field != 'total_price') {
const tableParent = this.getCurrentParentByTag('table[data-wk-table-tag="table"]') const tableParent = this.getCurrentParentByTag('table[data-wk-table-tag="table"]')
if (tableParent) { if (tableParent) {
const headerTr = this.editor.dom.select('tr[data-wk-table-tr-tag="header"]', tableParent) const headerTr = this.editor.dom.select('tr[data-wk-table-tr-tag="header"]', tableParent)
@ -201,7 +201,7 @@ export default {
// //
// const parentPNode = this.getCurrentParentByTag('p') // const parentPNode = this.getCurrentParentByTag('p')
if (this.activeTab == 'product' && (item.fieldName == 'discount_rate' || item.fieldName == 'total_price')) { if (this.activeTab == 'product' && (item.field == 'discount_rate' || item.field == 'total_price')) {
this.editor.insertContent(this.getSpanNode(item, '', crmTypeModel.convertTypeToKey(this.type))) this.editor.insertContent(this.getSpanNode(item, '', crmTypeModel.convertTypeToKey(this.type)))
// this.editor.dom.add(parentPNode, 'span', this.getSpanNodeAttrsByType(item, '', crmTypeModel.convertTypeToKey(this.type)), `{${item.name}}`) // this.editor.dom.add(parentPNode, 'span', this.getSpanNodeAttrsByType(item, '', crmTypeModel.convertTypeToKey(this.type)), `{${item.name}}`)
} else { } else {
@ -244,7 +244,7 @@ export default {
getSpanNodeAttrsByType(item, tag = '', type) { getSpanNodeAttrsByType(item, tag = '', type) {
const attrs = {} const attrs = {}
const dataKey = `data-wk${tag ? `-${tag}` : ''}-tag` const dataKey = `data-wk${tag ? `-${tag}` : ''}-tag`
const dataValue = `${type}.${item.fieldName}` const dataValue = `${type}.${item.field}`
attrs[dataKey] = dataValue attrs[dataKey] = dataValue
attrs.class = `wk-print-tag-wukong ${this.getSpanColorClass()}` attrs.class = `wk-print-tag-wukong ${this.getSpanColorClass()}`
@ -253,7 +253,7 @@ export default {
}, },
getSpanNode(item, tag = '', type = this.activeTab) { getSpanNode(item, tag = '', type = this.activeTab) {
return `<span data-wk${tag ? `-${tag}` : ''}-tag="${type}.${item.fieldName}" class="wk-print-tag-wukong ${this.getSpanColorClass()}" contenteditable="false">{${item.name}}</span>` return `<span data-wk${tag ? `-${tag}` : ''}-tag="${type}.${item.field}" class="wk-print-tag-wukong ${this.getSpanColorClass()}" contenteditable="false">{${item.name}}</span>`
}, },
/** /**
@ -281,13 +281,13 @@ export default {
const request = this.isCreate ? printAddTemplateAPI : printUpdateTemplateAPI const request = this.isCreate ? printAddTemplateAPI : printUpdateTemplateAPI
const data = this.$route.query const data = this.$route.query
const params = { const params = {
name: data.templateName, name: data.name,
type: data.type, type: data.type,
content: this.content content: this.content
} }
if (!this.isCreate) { if (!this.isCreate) {
params.templateId = data.templateId params.id = data.templateId
} }
request(params) request(params)

@ -55,15 +55,15 @@ export default {
options: [ options: [
{ {
label: '商机', label: '商机',
value: 1 value: 5
}, },
{ {
label: '合同', label: '合同',
value: 2 value: 6
}, },
{ {
label: '回款', label: '回款',
value: 3 value: 7
} }
] ]
} }
@ -87,7 +87,7 @@ export default {
if (val) { if (val) {
this.dataForm = { this.dataForm = {
name: '', name: '',
type: 1 type: 5
} }
if (this.isEdit) { if (this.isEdit) {
@ -112,6 +112,10 @@ export default {
*/ */
handleConfirm() { handleConfirm() {
if (!this.dataForm.name) { if (!this.dataForm.name) {
this.$message({
type: 'error',
message: '请输入模板名称'
})
return return
} }

@ -198,7 +198,7 @@ export default {
* 通过回调控制class * 通过回调控制class
*/ */
cellClassName({ row, column, rowIndex, columnIndex }) { cellClassName({ row, column, rowIndex, columnIndex }) {
if (column.property === 'templateName') { if (column.property === 'name') {
return 'can-visit--underline' return 'can-visit--underline'
} else { } else {
return '' return ''
@ -209,13 +209,13 @@ export default {
* 当某一行被点击时会触发该事件 * 当某一行被点击时会触发该事件
*/ */
handleRowClick(row, column, event) { handleRowClick(row, column, event) {
if (column.property === 'templateName') { if (column.property === 'name') {
this.$router.push({ this.$router.push({
name: 'crmPrintDetail', name: 'crmPrintDetail',
query: { query: {
handle: 'detail', handle: 'detail',
templateName: row.templateName, name: row.name,
templateId: row.templateId, templateId: row.id,
type: row.type type: row.type
} }
}) })

@ -0,0 +1,129 @@
<template>
<el-dialog
ref="wkDialog"
:visible="visible"
:append-to-body="true"
:close-on-click-modal="false"
title="重置部门"
width="500px"
@close="handleCancel">
<div >
<el-form
ref="form"
:model="fieldFrom"
:rules="rules"
label-position="top">
<el-form-item
label="部门"
prop="structure_id">
<wk-dep-select
v-model="fieldFrom.structure_id"
radio
style="width: 100%;"
/>
</el-form-item>
</el-form>
</div>
<span
slot="footer"
class="dialog-footer">
<el-button @click.native="handleCancel">取消</el-button>
<el-button
v-debounce="handleConfirm"
type="primary">保存</el-button>
</span>
</el-dialog>
</template>
<script>
import {
adminUserSetUserDeptPI
} from '@/api/admin/employeeDep'
import WkDepSelect from '@/components/NewCom/WkDepSelect'
import ElDialogLoadingMixin from '@/mixins/ElDialogLoading'
export default {
//
name: 'EditDepDialog',
components: {
WkDepSelect
},
mixins: [ElDialogLoadingMixin],
props: {
selectionList: Array, //
visible: {
type: Boolean,
required: true,
default: false
}
},
data() {
return {
fieldFrom: {
structure_id: ''
},
rules: {
structure_id: { required: true, message: '请选择', trigger: 'change' }
}
}
},
computed: {},
watch: {},
created() {},
mounted() {},
beforeDestroy() {},
methods: {
/**
* 取消选择
*/
handleCancel() {
this.$emit('update:visible', false)
},
/**
* 点击确定
*/
handleConfirm() {
this.$refs.form.validate(valid => {
if (valid) {
const id = this.selectionList.map(item => item.id)
this.loading = true
adminUserSetUserDeptPI({
...this.fieldFrom,
id
}).then(res => {
this.loading = false
this.$message.success('操作成功')
this.$emit('change')
this.handleCancel()
}).catch(() => {
this.loading = false
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.el-form {
margin-top: 10px;
/deep/ .el-form-item__label {
line-height: 30px;
padding-bottom: 0;
}
}
</style>

@ -34,7 +34,7 @@
<i <i
:class="item.icon" :class="item.icon"
class="menu-item__icon" /> class="menu-item__icon" />
<div class="menu-item__content">{{ item.label }}</div> <div class="menu-item__content">{{ item.label }}&nbsp;<span v-if="item.count > 0" style="color: #999;">({{ item.count }})</span></div>
</flexbox> </flexbox>
</div> </div>
</div> </div>
@ -86,13 +86,27 @@
justify="space-between" justify="space-between"
class="table-top"> class="table-top">
<div class="table-top__title"> <div class="table-top__title">
<span>{{ `${currentMenuData ? currentMenuData.label : ''}${ total || 0 }` }}</span> <span>{{ `${currentMenuData ? currentMenuData.label : ''}` }}<template v-if="!isDepUserShow">{{ `${userTotal || 0}` }}</template></span>
<el-tooltip
v-if="currentMenuData && currentMenuData.tips"
:content="currentMenuData.tips"
effect="dark"
placement="top">
<i class="wk wk-help wk-help-tips"/>
</el-tooltip>
<reminder <reminder
v-if="currentMenuData && currentMenuData.type && currentMenuData.type == 'all'" v-if="currentMenuData && currentMenuData.type && currentMenuData.type == 'all'"
class="all-user-reminder" class="all-user-reminder"
content="未添加部门和角色的员工无法正常登录系统" /> content="未添加部门和角色的员工无法正常登录系统" />
</div> </div>
<div> <div>
<el-checkbox
v-if="isDepUserShow"
v-model="isNeedChild"
:true-label="1"
:false-label="0"
@change="refreshUserList">包含子部门</el-checkbox>
<el-button <el-button
v-if="userSaveAuth" v-if="userSaveAuth"
type="text" type="text"
@ -145,14 +159,16 @@
width="55" /> width="55" />
<el-table-column <el-table-column
prop="realname" prop="realname"
width="100" width="150"
show-overflow-tooltip show-overflow-tooltip
label="姓名"> label="姓名">
<template slot-scope="scope"> <template slot-scope="{ row, column }">
<div class="status-name"> <span class="status-name">
<div :style="{'background-color' : getStatusColor(scope.row.status)}" /> <span :style="{'background-color' : getStatusColor(row.status)}" class="status-mark" />
{{ scope.row.realname }} <span v-if="row.userIdentity === 0" class="main-mark"></span>
</div> <span v-if="row.userIdentity === 1" class="main-mark"></span>
<span>{{ row.realname }}</span>
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -217,6 +233,14 @@
:value="item.id" /> :value="item.id" />
</el-select> </el-select>
</div> </div>
<flexbox
class="nav-dialog-div">
<label>部门负责人</label>
<wk-user-select
v-model="depOwnerUserId"
radio
/>
</flexbox>
<span <span
slot="footer" slot="footer"
class="dialog-footer"> class="dialog-footer">
@ -402,7 +426,8 @@
<template v-if="item.type == 'select'"> <template v-if="item.type == 'select'">
<el-select <el-select
v-model="formInline[item.field]" v-model="formInline[item.field]"
filterable> filterable
@change="addUserSelectChange(item)">
<el-option <el-option
v-for="optionItem in optionsList[item.field].list" v-for="optionItem in optionsList[item.field].list"
:key="optionItem.id" :key="optionItem.id"
@ -459,6 +484,13 @@
:visible.sync="editRoleDialogShow" :visible.sync="editRoleDialogShow"
@change="getUserList" @change="getUserList"
/> />
<!-- 重置部门 -->
<edit-dep-dialog
v-if="editDepDialogShow"
:selection-list="selectionList"
:visible.sync="editDepDialogShow"
@change="getUserList"
/>
</div> </div>
</template> </template>
@ -473,7 +505,8 @@ import {
adminUsersUpdatePwdAPI, adminUsersUpdatePwdAPI,
adminUsersUsernameEditAPI, adminUsersUsernameEditAPI,
adminUsersManagerUsernameEditAPI, adminUsersManagerUsernameEditAPI,
usersEditStatusAPI usersEditStatusAPI,
adminUserCountNumOfUserAPI
} from '@/api/admin/employeeDep' } from '@/api/admin/employeeDep'
import { userListAPI, depListAPI, listDialogAPI, usersListIndexAPI } from '@/api/common' // import { userListAPI, depListAPI, listDialogAPI, usersListIndexAPI } from '@/api/common' //
@ -487,6 +520,8 @@ import XrHeader from '@/components/XrHeader'
import Reminder from '@/components/Reminder' import Reminder from '@/components/Reminder'
import SlideVerify from '@/components/SlideVerify' import SlideVerify from '@/components/SlideVerify'
import EditRoleDialog from './components/EditRoleDialog' import EditRoleDialog from './components/EditRoleDialog'
import WkUserSelect from '@/components/NewCom/WkUserSelect'
import EditDepDialog from './components/EditDepDialog'
import { chinaMobileRegex, objDeepCopy } from '@/utils' import { chinaMobileRegex, objDeepCopy } from '@/utils'
@ -499,7 +534,9 @@ export default {
XrHeader, XrHeader,
Reminder, Reminder,
SlideVerify, SlideVerify,
EditRoleDialog EditRoleDialog,
EditDepDialog,
WkUserSelect
}, },
data() { data() {
return { return {
@ -507,27 +544,42 @@ export default {
{ {
icon: 'wk wk-employees', icon: 'wk wk-employees',
label: '所有员工', label: '所有员工',
type: 'all' type: 'all',
field: 'allUserCount',
count: 0,
tips: '未添加部门和角色的员工无法正常登录系统'
}, },
{ {
icon: 'wk wk-new-employee', icon: 'wk wk-new-employee',
label: '新加入的员工', label: '新加入的员工',
type: 'new' type: 'new',
field: 'addNewlyCount',
count: 0,
tips: '入职7天内的员工'
}, },
{ {
icon: 'wk wk-active-employee', icon: 'wk wk-active-employee',
label: '激活员工', label: '激活员工',
type: 'active' type: 'active',
field: 'activateCount',
count: 0,
tips: '已经登录系统的员工'
}, },
{ {
icon: 'wk wk-inactive-employee', icon: 'wk wk-inactive-employee',
label: '未激活员工', label: '未激活员工',
type: 'inactive' type: 'inactive',
field: 'inactiveCount',
count: 0,
tips: '未登录过系统的员工'
}, },
{ {
icon: 'wk wk-disable-employees', icon: 'wk wk-disable-employees',
label: '停用员工', label: '停用员工',
type: 'disable' type: 'disable',
field: 'disableCount',
count: 0,
tips: '已禁用的员工,无法登录系统'
} }
], ],
// //
@ -536,6 +588,7 @@ export default {
depSelect: '', depSelect: '',
// //
superDepList: [], superDepList: [],
depOwnerUserId: '', //
depCreateLabel: '', depCreateLabel: '',
allDepData: [], // allDepData: [], //
showDepData: [], showDepData: [],
@ -569,6 +622,7 @@ export default {
width: '150' width: '150'
} }
], ],
isNeedChild: 1, // 0 1
selectionList: [], // selectionList: [], //
tableData: [], tableData: [],
tableHeight: document.documentElement.clientHeight - 240, // tableHeight: document.documentElement.clientHeight - 240, //
@ -673,7 +727,10 @@ export default {
bulkImportShow: false, bulkImportShow: false,
// //
editRoleType: '', editRoleType: '',
editRoleDialogShow: false editRoleDialogShow: false,
userTotal: 0, // ,
editDepDialogShow: false
} }
}, },
computed: { computed: {
@ -787,7 +844,11 @@ export default {
icon: 'wk wk-edit' icon: 'wk wk-edit'
}) })
} }
temps.push({
name: '重置部门',
type: 'editDep',
icon: 'wk wk-employees'
})
return temps return temps
}, },
@ -828,6 +889,12 @@ export default {
*/ */
canSlideVerify() { canSlideVerify() {
return chinaMobileRegex.test(this.resetUserNameForm.username) return chinaMobileRegex.test(this.resetUserNameForm.username)
},
/**
* 是查看部门员工
*/
isDepUserShow() {
return this.currentMenuData && this.currentMenuData.structure_id
} }
}, },
mounted() { mounted() {
@ -841,13 +908,43 @@ export default {
this.currentMenuData = this.employeeMenu[0] this.currentMenuData = this.employeeMenu[0]
this.getDepTreeList() this.getDepTreeList()
this.getUserList() this.getUserList()
this.getUserCount()
}, },
methods: { methods: {
/**
* 编辑员工单选change
*/
addUserSelectChange(item) {
if (item.field === 'structure_id') {
const options = this.optionsList.structure_id.list || []
const deptObj = options.find(o => o.id === this.formInline.structure_id)
if (deptObj) {
this.$set(this.formInline, 'parent_id', deptObj.owner_user_id || '')
}
}
},
/**
* 员工数量
*/
getUserCount() {
this.depLoading = true
adminUserCountNumOfUserAPI().then(res => {
this.depLoading = false
const resData = res.data[0] || {}
this.employeeMenu.forEach(item => {
item.count = resData[item.field]
})
this.userTotal = this.currentMenuData.count
}).catch(() => {
this.depLoading = false
})
},
/** /**
* 选择部门 * 选择部门
*/ */
changeDepClick(data) { changeDepClick(data) {
this.currentMenuData = data this.currentMenuData = data
this.userTotal = data.count
// this.structureValue = data.id // this.structureValue = data.id
this.refreshUserList() this.refreshUserList()
}, },
@ -857,6 +954,7 @@ export default {
*/ */
changeUserClick(data) { changeUserClick(data) {
// this.structureValue = '' // this.structureValue = ''
this.userTotal = data.count
this.currentMenuData = data this.currentMenuData = data
this.refreshUserList() this.refreshUserList()
}, },
@ -879,7 +977,9 @@ export default {
limit: this.pageSize, limit: this.pageSize,
search: this.searchInput search: this.searchInput
} }
if (this.isDepUserShow) {
params.isNeedChild = this.isNeedChild
}
if (this.currentMenuData) { if (this.currentMenuData) {
// type // type
if (this.currentMenuData.type) { if (this.currentMenuData.type) {
@ -959,6 +1059,9 @@ export default {
structure_id: structure_id:
this.currentMenuData && this.currentMenuData.id this.currentMenuData && this.currentMenuData.id
? this.currentMenuData.id ? this.currentMenuData.id
: '',
parent_id: this.currentMenuData && this.currentMenuData.owner_user_id
? this.currentMenuData.owner_user_id
: '' : ''
} }
this.employeeCreateDialog = true this.employeeCreateDialog = true
@ -1036,6 +1139,7 @@ export default {
this.depCreateLabelValue = '' this.depCreateLabelValue = ''
this.depCreateLabel = '新增部门' this.depCreateLabel = '新增部门'
this.depCreateTitle = '新增部门' this.depCreateTitle = '新增部门'
this.depOwnerUserId = ''
this.depSelect = id this.depSelect = id
this.getStructuresListBySuperior({ id: id, type: 'save' }) this.getStructuresListBySuperior({ id: id, type: 'save' })
this.depCreateDialog = true this.depCreateDialog = true
@ -1084,6 +1188,7 @@ export default {
this.depCreateLabelValue = data.label this.depCreateLabelValue = data.label
this.treeEditId = data.id this.treeEditId = data.id
this.depSelect = data.pid this.depSelect = data.pid
this.depOwnerUserId = data.owner_user_id
this.depCreateTitle = '编辑部门' this.depCreateTitle = '编辑部门'
this.depCreateLabel = '编辑部门' this.depCreateLabel = '编辑部门'
this.getStructuresListBySuperior({ id: data.id, type: 'update' }) this.getStructuresListBySuperior({ id: data.id, type: 'update' })
@ -1126,7 +1231,7 @@ export default {
// //
submitDialog() { submitDialog() {
if (this.depCreateLabel == '新增部门') { if (this.depCreateLabel == '新增部门') {
depSaveAPI({ name: this.depCreateLabelValue, pid: this.depSelect }).then( depSaveAPI({ name: this.depCreateLabelValue, pid: this.depSelect, owner_user_id: this.depOwnerUserId }).then(
res => { res => {
this.getDepList() // this.getDepList() //
this.getDepTreeList() this.getDepTreeList()
@ -1137,7 +1242,8 @@ export default {
depEditAPI({ depEditAPI({
name: this.depCreateLabelValue, name: this.depCreateLabelValue,
id: this.treeEditId, id: this.treeEditId,
pid: this.depSelect pid: this.depSelect,
owner_user_id: this.depOwnerUserId
}).then(res => { }).then(res => {
this.$message.success('操作成功') this.$message.success('操作成功')
this.getDepTreeList() this.getDepTreeList()
@ -1309,7 +1415,7 @@ export default {
}) })
: [] : []
} else if (element.field === 'parent_id') { } else if (element.field === 'parent_id') {
detail.parent_id = this.dialogData.parent_id detail.parent_id = this.dialogData.parent_id || ''
} else if (element.field === 'structure_id') { } else if (element.field === 'structure_id') {
detail.structure_id = this.dialogData.structure_id detail.structure_id = this.dialogData.structure_id
} else { } else {
@ -1323,6 +1429,8 @@ export default {
} else if (type === 'editRole' || type === 'copyRole') { } else if (type === 'editRole' || type === 'copyRole') {
this.editRoleType = type this.editRoleType = type
this.editRoleDialogShow = true this.editRoleDialogShow = true
} else if (type === 'editDep') {
this.editDepDialogShow = true
} }
}, },
// -- // --
@ -1692,9 +1800,8 @@ export default {
// .status > span { // .status > span {
// margin-right: 10px; // margin-right: 10px;
// } // }
.status-name { .status-name {
div { .status-mark {
display: inline-block; display: inline-block;
width: 6px; width: 6px;
height: 6px; height: 6px;
@ -1702,7 +1809,31 @@ export default {
} }
color: $xr-color-primary; color: $xr-color-primary;
cursor: pointer; cursor: pointer;
.main-mark {
background-color: #ff6a00;
color: white;
border-radius: 2px;
font-size: 12px;
padding: 0px 4px;
margin: 0 3px;
}
} }
/* .status-name {
.status-mark {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 3px;
}
div {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 3px;
}
color: $xr-color-primary;
cursor: pointer;
} */
/* 详情 */ /* 详情 */
.employee-dep-management /deep/ .el-dialog__wrapper { .employee-dep-management /deep/ .el-dialog__wrapper {
margin-top: 60px !important; margin-top: 60px !important;
@ -1737,6 +1868,9 @@ export default {
} }
.nav-dialog-div { .nav-dialog-div {
margin-bottom: 20px; margin-bottom: 20px;
.wk-user-select {
flex: 1;
}
} }
.nav-dialog-div { .nav-dialog-div {
.el-input, .el-input,

@ -0,0 +1,263 @@
<template>
<div class="main">
<xr-header
icon-class="wk wk-record"
icon-color="#2362FB"
label="数据操作日志" />
<div class="main-body">
<flexbox class="main-table-header">
<el-date-picker
v-model="dateTime"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"/>
<xh-user-cell
:radio="false"
placeholder="选择人员"
@value-change="userChange" />
<el-select
v-model="model"
@click="modelChange">
<el-option
v-for="item in modelOptions"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-select
v-model="subModelLabels"
multiple
collapse-tags>
<el-option
v-for="item in subModelsOptions"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="primary"
@click="refreshList">查询</el-button>
<el-button
class="main-table-header-button"
@click="exportClick">导出</el-button>
</flexbox>
<el-table
v-loading="loading"
:data="list"
:height="tableHeight"
class="main-table"
highlight-current-row
style="width: 100%">
<el-table-column
v-for="(item, index) in fieldList"
:key="index"
:prop="item.prop"
:label="item.label"
show-overflow-tooltip/>
<el-table-column/>
</el-table>
<div class="p-contianer">
<el-pagination
:current-page="currentPage"
:page-sizes="pageSizes"
:page-size.sync="pageSize"
:total="total"
class="p-bar"
background
layout="prev, pager, next, sizes, total, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</div>
</div>
</template>
<script>
import {
systemLogExportAPI,
queryDataOptionLogListAPI
} from '@/api/admin/log'
import XrHeader from '@/components/XrHeader'
import XhUserCell from '@/components/CreateCom/XhUserCell'
import { Loading } from 'element-ui'
import HandleLogMixin from './mixins/HandleLog'
import { downloadExcelWithResData } from '@/utils'
export default {
//
name: 'DataHandleLog',
components: {
XrHeader,
XhUserCell
},
mixins: [HandleLogMixin],
data() {
return {
loading: false, //
tableHeight: document.documentElement.clientHeight - 240, //
dateTime: [],
userList: [],
model: '',
subModelLabels: [],
list: [],
currentPage: 1,
pageSize: 10,
pageSizes: [10, 20, 30, 40],
total: 0,
postParams: {}
}
},
computed: {
subModelsOptions() {
const item = this.modelOptions.find(item => item.value === this.model)
return item ? item.list : []
}
},
mounted() {
// table
window.onresize = () => {
self.tableHeight = document.documentElement.clientHeight - 240
}
this.getList()
},
methods: {
userChange(data) {
this.userList = data.value || []
},
refreshList() {
this.currentPage = 1
this.getList()
},
/**
* 模块change
*/
modelChange() {
this.subModelLabels = []
},
/**
* 获取列表数据
*/
getList() {
this.loading = true
const params = {
page: this.currentPage,
limit: this.pageSize,
model: this.model
// type: 1 // 1 2
}
if (this.userList && this.userList.length) {
params.userIds = this.userList.map(item => item.id)
}
if (this.dateTime && this.dateTime.length) {
params.startTime = this.dateTime[0]
params.endTime = this.dateTime[1]
}
params.subModelLabels = this.subModelLabels
this.postParams = params
queryDataOptionLogListAPI(params)
.then(res => {
const list = res.data.list
// list.forEach(item => {
// item.model = this.getModelName(item.model)
// })
this.list = list
this.total = res.data.count
this.loading = false
})
.catch(() => {
this.loading = false
})
},
/**
* 添加审批流
*/
exportClick() {
const loading = Loading.service({ fullscreen: true, text: '导出中...' })
systemLogExportAPI({ ...this.postParams, action: 'getRecordLogs' })
.then(res => {
downloadExcelWithResData(res)
loading.close()
})
.catch(() => {
loading.close()
})
},
//
handleSizeChange(val) {
this.pageSize = val
this.getList()
},
//
handleCurrentChange(val) {
this.currentPage = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.main {
height:100%;
/deep/ .xr-header {
padding: 15px 30px;
}
}
.main-body {
background-color: white;
border-top: 1px solid $xr-border-line-color;
border-bottom: 1px solid $xr-border-line-color;
}
.main-table-header {
height: 50px;
background-color: white;
position: relative;
.main-table-header-button {
margin-right: 20px;
position: absolute;
right: 20px;
}
.el-date-editor--daterange {
width: 300px;
margin: 0 20px;
}
/deep/ .user-container {
width: 200px;
margin-right: 20px;
}
.el-select {
margin-right: 20px;
}
}
.p-contianer {
position: relative;
background-color: white;
height: 44px;
.p-bar {
float: right;
margin: 5px 100px 0 0;
font-size: 14px !important;
}
}
@import '../styles/table.scss';
</style>

@ -0,0 +1,275 @@
<template>
<div class="main">
<xr-header
icon-class="wk wk-record"
icon-color="#2362FB"
label="登录日志" />
<div class="main-body">
<flexbox class="main-table-header">
<el-date-picker
v-model="dateTime"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"/>
<xh-user-cell
:radio="false"
placeholder="选择人员"
@value-change="userChange" />
<el-button
type="primary"
@click="refreshList">查询</el-button>
<el-button
class="main-table-header-button"
@click="exportClick">导出</el-button>
</flexbox>
<el-table
v-loading="loading"
:data="list"
:height="tableHeight"
:cell-class-name="cellClassName"
class="main-table"
highlight-current-row
style="width: 100%">
<el-table-column
v-for="(item, index) in fieldList"
:key="index"
:prop="item.prop"
:label="item.label"
show-overflow-tooltip/>
<el-table-column/>
</el-table>
<div class="p-contianer">
<el-pagination
:current-page="currentPage"
:page-sizes="pageSizes"
:page-size.sync="pageSize"
:total="total"
class="p-bar"
background
layout="prev, pager, next, sizes, total, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</div>
</div>
</template>
<script>
import {
queryLoginLogListAPI,
systemLogExportAPI
} from '@/api/admin/log'
import XrHeader from '@/components/XrHeader'
import XhUserCell from '@/components/CreateCom/XhUserCell'
import { Loading } from 'element-ui'
import { downloadExcelWithResData } from '@/utils'
export default {
//
name: 'LoginLog',
components: {
XrHeader,
XhUserCell
},
mixins: [],
data() {
return {
loading: false, //
tableHeight: document.documentElement.clientHeight - 240, //
dateTime: [],
userList: [],
list: [],
fieldList: [
{
prop: 'username',
label: '用户',
width: 100
},
{
prop: 'create_time',
label: '登录时间',
width: 150
},
{
prop: 'ip',
label: 'IP地址',
width: 100
},
{
prop: 'address',
label: '登录地点',
width: 150
},
{
prop: 'remark',
label: '设备类型',
width: 150
},
{
prop: 'browser',
label: '终端内核',
width: 150
},
{
prop: 'os',
label: '平台',
width: 100
},
{
prop: 'type',
label: '认证结果',
width: 100
}
],
currentPage: 1,
pageSize: 10,
pageSizes: [10, 20, 30, 40],
total: 0,
postParams: {}
}
},
computed: {},
mounted() {
// table
window.onresize = () => {
self.tableHeight = document.documentElement.clientHeight - 240
}
this.getList()
},
methods: {
userChange(data) {
this.userList = data.value || []
},
refreshList() {
this.currentPage = 1
this.getList()
},
/** 获取列表数据 */
getList() {
this.loading = true
const params = {
page: this.currentPage,
limit: this.pageSize
}
if (this.userList && this.userList.length) {
params.userIds = this.userList.map(item => item.id)
}
if (this.dateTime && this.dateTime.length) {
params.startTime = this.dateTime[0]
params.endTime = this.dateTime[1]
}
this.postParams = params
queryLoginLogListAPI(params)
.then(res => {
const list = res.data.list || []
// list.forEach(item => {
// item.authResult = {
// 1: '',
// 2: ''
// }[item.authResult]
// })
this.list = list
this.total = res.data.dataCount
this.loading = false
})
.catch(() => {
this.loading = false
})
},
/**
* 通过回调控制class
*/
cellClassName({ row, column, rowIndex, columnIndex }) {
if (column.property === 'name') {
return 'can-visit--underline'
} else {
return ''
}
},
/**
* 添加审批流
*/
exportClick() {
const loading = Loading.service({ fullscreen: true, text: '导出中...' })
systemLogExportAPI({ ...this.postParams, action: 'getLoginRecord' })
.then(res => {
downloadExcelWithResData(res)
loading.close()
})
.catch(() => {
loading.close()
})
},
//
handleSizeChange(val) {
this.pageSize = val
this.getList()
},
//
handleCurrentChange(val) {
this.currentPage = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.main {
height:100%;
/deep/ .xr-header {
padding: 15px 30px;
}
}
.main-body {
background-color: white;
border-top: 1px solid $xr-border-line-color;
border-bottom: 1px solid $xr-border-line-color;
}
.main-table-header {
height: 50px;
background-color: white;
position: relative;
.main-table-header-button {
margin-right: 20px;
position: absolute;
right: 20px;
}
.el-date-editor--daterange {
width: 300px;
margin: 0 20px;
}
/deep/ .user-container {
width: 200px;
margin-right: 20px;
}
}
.p-contianer {
position: relative;
background-color: white;
height: 44px;
.p-bar {
float: right;
margin: 5px 100px 0 0;
font-size: 14px !important;
}
}
@import '../styles/table.scss';
</style>

@ -0,0 +1,240 @@
<template>
<div class="main">
<xr-header
icon-class="wk wk-record"
icon-color="#2362FB"
label="系统操作日志" />
<div class="main-body">
<flexbox class="main-table-header">
<el-date-picker
v-model="dateTime"
type="daterange"
value-format="yyyy-MM-dd"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"/>
<xh-user-cell
:radio="false"
placeholder="选择人员"
@value-change="userChange" />
<el-select
v-model="subModelLabels"
multiple
style="width: 200px;"
collapse-tags>
<el-option
v-for="item in sysOptions"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button
type="primary"
@click="refreshList">查询</el-button>
<el-button
class="main-table-header-button"
@click="exportClick">导出</el-button>
</flexbox>
<el-table
v-loading="loading"
:data="list"
:height="tableHeight"
class="main-table"
highlight-current-row
style="width: 100%">
<el-table-column
v-for="(item, index) in fieldList"
:key="index"
:prop="item.prop"
:label="item.label"
show-overflow-tooltip/>
<el-table-column/>
</el-table>
<div class="p-contianer">
<el-pagination
:current-page="currentPage"
:page-sizes="pageSizes"
:page-size.sync="pageSize"
:total="total"
class="p-bar"
background
layout="prev, pager, next, sizes, total, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</div>
</div>
</template>
<script>
import {
querySystemLogListAPI,
systemLogExportAPI
} from '@/api/admin/log'
import XrHeader from '@/components/XrHeader'
import XhUserCell from '@/components/CreateCom/XhUserCell'
import { Loading } from 'element-ui'
import HandleLogMixin from './mixins/HandleLog'
import { downloadExcelWithResData } from '@/utils'
export default {
//
name: 'SysHandleLog',
components: {
XrHeader,
XhUserCell
},
mixins: [HandleLogMixin],
data() {
return {
loading: false, //
tableHeight: document.documentElement.clientHeight - 240, //
dateTime: [],
userList: [],
subModelLabels: [],
list: [],
currentPage: 1,
pageSize: 10,
pageSizes: [10, 20, 30, 40],
total: 0,
postParams: {}
}
},
computed: {},
mounted() {
// table
window.onresize = () => {
self.tableHeight = document.documentElement.clientHeight - 240
}
this.getList()
},
methods: {
userChange(data) {
this.userList = data.value || []
},
refreshList() {
this.currentPage = 1
this.getList()
},
/** 获取列表数据 */
getList() {
this.loading = true
const params = {
page: this.currentPage,
limit: this.pageSize
// modules: 'admin'
// type: 2 // 1 2
}
if (this.userList && this.userList.length) {
params.userIds = this.userList.map(item => item.id)
}
if (this.dateTime && this.dateTime.length) {
params.startTime = this.dateTime[0]
params.endTime = this.dateTime[1]
}
params.subModelLabels = this.subModelLabels
this.postParams = params
querySystemLogListAPI(params)
.then(res => {
const list = res.data.list
list.forEach(item => {
item.action = item.module
})
this.list = list
this.total = res.data.count
this.loading = false
})
.catch(() => {
this.loading = false
})
},
/**
* 添加审批流
*/
exportClick() {
const loading = Loading.service({ fullscreen: true, text: '导出中...' })
systemLogExportAPI({ ...this.postParams, action: 'getSystemLogs' })
.then(res => {
downloadExcelWithResData(res)
loading.close()
})
.catch(() => {
loading.close()
})
},
//
handleSizeChange(val) {
this.pageSize = val
this.getList()
},
//
handleCurrentChange(val) {
this.currentPage = val
this.getList()
}
}
}
</script>
<style lang="scss" scoped>
.main {
height:100%;
/deep/ .xr-header {
padding: 15px 30px;
}
}
.main-body {
background-color: white;
border-top: 1px solid $xr-border-line-color;
border-bottom: 1px solid $xr-border-line-color;
}
.main-table-header {
height: 50px;
background-color: white;
position: relative;
.main-table-header-button {
margin-right: 20px;
position: absolute;
right: 20px;
}
.el-date-editor--daterange {
width: 300px;
margin: 0 20px;
}
/deep/ .user-container {
width: 200px;
margin-right: 20px;
}
.el-select {
margin-right: 20px;
}
}
.p-contianer {
position: relative;
background-color: white;
height: 44px;
.p-bar {
float: right;
margin: 5px 100px 0 0;
font-size: 14px !important;
}
}
@import '../styles/table.scss';
</style>

@ -0,0 +1,226 @@
export default {
data() {
return {
modelOptions: [{
label: '客户管理',
value: 'crm',
list: [{
label: '线索',
value: 'crm_leads'
}, {
label: '客户',
value: 'crm_customer'
}, {
label: '联系人',
value: 'crm_contacts'
}, {
label: '商机',
value: 'crm_business'
}, {
label: '合同',
value: 'crm_contract'
}, {
label: '回款',
value: 'crm_receivables'
}, {
label: '发票',
value: 'crm_invoice'
}, {
label: '回访',
value: 'crm_visit'
}, {
label: '产品',
value: 'crm_product'
}
// {
// label: '市场活动',
// value: 30
// }
]
}, {
label: '办公管理',
value: 'oa',
list: [{
label: '日历',
value: 'oa_event'
}, {
label: '日志',
value: 'oa_log'
}]
}, {
label: '项目管理',
value: 'work',
list: [{
label: '项目',
value: 'work'
}, {
label: '任务',
value: 'work_task'
}]
}
// {
// label: '人力资源',
// value: 'hrm',
// list: [{
// label: '组织管理',
// value: 61
// }, {
// label: '招聘管理',
// value: 62
// }, {
// label: '候选人',
// value: 63
// }, {
// label: '员工管理',
// value: 64
// }, {
// label: '社保管理',
// value: 65
// }, {
// label: '薪资管理',
// value: 66
// }, {
// label: '薪资档案',
// value: 67
// }, {
// label: '工资条',
// value: 68
// }, {
// label: '绩效考核',
// value: 69
// }]
// },
// {
// label: '进销存',
// value: 'jxc',
// list: [{
// label: '供应商',
// value: 81
// }, {
// label: '采购订单',
// value: 82
// }, {
// label: '采购退货',
// value: 83
// }, {
// label: '产品管理',
// value: 84
// }, {
// label: '销售订单',
// value: 85
// }, {
// label: '销售退货',
// value: 86
// }, {
// label: '仓库管理',
// value: 87
// }, {
// label: '产品库存',
// value: 88
// }, {
// label: '产品入库',
// value: 89
// }, {
// label: '产品出库',
// value: 90
// }, {
// label: '库存调拨',
// value: 91
// }, {
// label: '库存盘点',
// value: 92
// }, {
// label: '回款',
// value: 93
// }, {
// label: '付款',
// value: 93
// }]
// }
],
sysOptions: [{
label: '企业首页',
value: 'company'
}, {
label: '应用管理',
value: 'application'
}, {
label: '员工管理',
value: 'employee'
}, {
label: '部门管理',
value: 'structures'
}, {
label: '角色管理',
value: 'role'
}, {
label: '项目管理',
value: 'project'
}, {
label: '客户管理',
value: 'customer'
},
// {
// label: '人力资源',
// value: 8
// }, {
// label: '进销存',
// value: 9
// },
{
label: '其他设置',
value: 'work_task'
}],
fieldList: [
{
prop: 'user_name',
label: '用户',
width: 100
},
{
prop: 'create_time',
label: '时间',
width: 150
},
{
prop: 'ip',
label: 'IP地址',
width: 100
},
{
prop: 'action',
label: '模块',
width: 150
},
{
prop: 'action_name',
label: '行为',
width: 150
},
{
prop: 'source_name',
label: '对象',
width: 150
},
{
prop: 'content',
label: '操作详情',
width: 100
}
]
}
},
methods: {
getModelName(model) {
return {
crm: '客户管理',
oa: '办公管理',
work: '项目管理',
hrm: '人力资源',
jxc: '进销存',
admin: '系统管理'
}[model]
}
}
}

@ -171,13 +171,13 @@
style="height: 0;" style="height: 0;"
empty-text="" empty-text=""
default-expand-all> default-expand-all>
<!-- <span <span
slot-scope="{ node }" slot-scope="{ node }"
:class="{ 'node-label': node.level == 1 || node.level == 2} ">{{ node.label }}<el-button :class="{ 'node-label': node.level == 1 || node.level == 2} ">{{ node.label }}<el-button
v-if="node.level == 2 && canSetField(node.data.name) && node.data.title!='公海管理'" v-if="node.level == 2 && canSetField(node.data.name) && node.data.title!='公海管理'"
icon="wk wk-manage" icon="wk wk-manage"
type="text" type="text"
@click="fieldSetClick(node)" >字段授权</el-button></span> --> @click="fieldSetClick(node)" >字段授权</el-button></span>
</el-tree> </el-tree>
</div> </div>
</div> </div>

@ -16,10 +16,12 @@
<div class="content"> <div class="content">
<el-table <el-table
id="crm-table" id="crm-table"
:data="newList" ref="tableRef"
:data="list"
:height="tableHeight" :height="tableHeight"
:span-method="objectSpanMethod" :cell-class-name="cellClassName"
:cell-style="cellStyle" :summary-method="getSummaries"
show-summary
border border
@row-click="handleRowClick"> @row-click="handleRowClick">
<el-table-column <el-table-column
@ -31,277 +33,172 @@
header-align="center" header-align="center"
show-overflow-tooltip/> show-overflow-tooltip/>
</el-table> </el-table>
<div class="p-contianer">
<el-pagination
:current-page="currentPage"
:page-sizes="pageSizes"
:page-size.sync="pageSize"
:total="total"
:pager-count="5"
class="p-bar"
background
layout="prev, pager, next, sizes, total, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div> </div>
<contract-detail </div>
v-if="showContractview && rowID" <!-- 预览合同 -->
:id="rowID" <report-list
class="d-view" :show.sync="reportListShow"
@hide-view="showContractview=false"/> :title="reportData.title"
<customer-detail :placeholder="reportData.placeholder"
v-if="showCustomerView && rowID" :request="reportData.request"
:id="rowID" :params="reportData.params"
class="d-view" crm-type="contract"/>
@hide-view="showCustomerView=false"/>
<product-detail
v-if="showProductview && rowID"
:id="rowID"
class="d-view"
@hide-view="showProductview=false"/>
</div> </div>
</template> </template>
<script> <script>
import { biProductStatisticsAPI, biProductStatisticsExportAPI } from '@/api/bi/bi' import { biProductStatisticsAPI, biProductStatisticsExportAPI } from '@/api/bi/bi'
import ContractDetail from '@/views/crm/contract/Detail' import { crmContractQueryListByProductIdAPI } from '@/api/crm/contract'
import CustomerDetail from '@/views/crm/customer/Detail'
import ProductDetail from '@/views/crm/product/Detail' import ReportList from '@/views/crm/workbench/components/ReportList'
import BaseMixin from '../mixins/Base' import BaseMixin from '../mixins/Base'
import { floatAdd } from '@/utils'
export default { export default {
/** 产品销售情况统计 */ /** 产品销售情况统计 */
name: 'ProductStatistics', name: 'ProductStatistics',
components: { components: {
ContractDetail, ReportList
CustomerDetail,
ProductDetail
}, },
mixins: [BaseMixin], mixins: [BaseMixin],
data() { data() {
return { return {
loading: false, loading: false,
tableHeight: document.documentElement.clientHeight - 170, tableHeight: document.documentElement.clientHeight - 220,
currentPage: 1,
pageSize: 15,
pageSizes: [15, 30, 60, 100],
total: 0,
postParams: {}, // postParams: {}, //
headFieldList: [ headFieldList: [
{ field: 'category_id_info', name: '产品分类', width: '115px' }, { field: 'category_id_info', name: '产品分类', width: '115px' },
{ field: 'product_name', name: '产品名称', width: '115px' }, { field: 'product_name', name: '产品名称', width: '115px' },
{ field: 'contract_num', name: '合同编号', width: '115px' }, { field: 'contract_product_sum', name: '合同数', width: '115px' },
{ field: 'owner_user_name', name: '负责人', width: '115px' }, { field: 'product_sum', name: '数量合计', width: '115px' },
{ field: 'contract_name', name: '客户名称', width: '115px' }, { field: 'contract_money', name: '订单产品小计', width: '115px' }
{ field: 'price', name: '销售单价', width: '115px' },
{ field: 'num', name: '数量', width: '115px' }, // { field: 'category_id_info', name: '', width: '115px' },
{ field: 'subtotal', name: '订单产品小计', width: '115px' } // { field: 'product_name', name: '', width: '115px' },
// { field: 'contract_product_sum', name: '', width: '115px' },
// { field: 'owner_user_name', name: '', width: '115px' },
// { field: 'contract_name', name: '', width: '115px' },
// { field: 'price', name: '', width: '115px' },
// { field: 'product_sum', name: '', width: '115px' },
// { field: 'subtotal', name: '', width: '115px' }
], ],
list: [], list: [],
// //
spanList: [], extraData: {
newList: [], contract_product_sum: 0,
/** 控制详情展示 */ product_sum: 0,
showContractview: false, contract_money: 0
showCustomerView: false, },
showProductview: false,
rowID: '' reportListShow: false,
reportData: {
title: '',
placeholder: '',
request: null,
params: null
}
} }
}, },
computed: {}, computed: {},
mounted() { mounted() {
var self = this
/** 控制table的高度 */ /** 控制table的高度 */
window.onresize = function() { window.onresize = () => {
var offsetHei = document.documentElement.clientHeight const offsetHei = document.documentElement.clientHeight
self.tableHeight = offsetHei - 170 this.tableHeight = offsetHei - 220
} }
}, },
methods: { methods: {
objectSpanMethod({ row, column, rowIndex, columnIndex }) { /**
var item = this.spanList[rowIndex] * 通过回调控制class
if (columnIndex == 0) { */
if (item.rowspan == 0) { cellClassName({ row, column, rowIndex, columnIndex }) {
return { if (column.property === 'contract_product_sum') {
rowspan: 0, return 'can-visit--underline'
colspan: 0
}
} else { } else {
return { return ''
rowspan: item.rowspan,
colspan: 1
}
}
} else if (columnIndex == 1) {
if (item.productRowspan == 0) {
return {
rowspan: 0,
colspan: 0
}
} else {
return {
rowspan: item.productRowspan,
colspan: 1
}
}
} }
}, },
/** 列表操作 */ /**
// * 更改每页展示数量
handleRowClick(row, column, event) { */
if (column.property === 'contract_name') { handleSizeChange(val) {
if (this.showProductview) { this.pageSize = val
this.showProductview = false this.getProductDatalist()
}
if (this.showContractview) {
this.showContractview = false
}
this.rowID = row.customer_id
this.showCustomerView = true
} else if (column.property === 'product_name') {
if (this.showCustomerView) {
this.showCustomerView = false
}
if (this.showContractview) {
this.showContractview = false
}
this.rowID = row.product_id
this.showProductview = true
} else if (column.property === 'contract_num') {
if (this.showProductview) {
this.showProductview = false
}
if (this.showCustomerView) {
this.showCustomerView = false
}
this.rowID = row.contract_id
this.showContractview = true
}
}, },
cellStyle({ row, column, rowIndex, columnIndex }) {
var item = this.spanList[rowIndex] /**
if (item.isSum == true) { * 更改当前页数
return { backgroundColor: '#FFF9F2', borderRight: '0 none', fontWeight: 'bold' } */
} else if (item.isAllSum == true) { handleCurrentChange(val) {
return { backgroundColor: '#FFF3E8', borderRight: '0 none', fontWeight: 'bold' } this.currentPage = val
} else if (columnIndex === 1 || columnIndex === 2 || columnIndex === 4) { this.getProductDatalist()
return { color: '#2362FB', cursor: 'pointer' } },
/**
* 当某一行被点击时会触发该事件
*/
handleRowClick(row, column, event) {
if (column.property === 'contract_product_sum') {
this.reportData.title = `${column.label}详情`
this.reportData.request = crmContractQueryListByProductIdAPI
this.reportData.placeholder = '请输入客户名称/合同编号/合同名称'
const params = { ...this.postParams, product_id: row.product_id }
this.reportData.params = params
this.reportListShow = true
} }
}, },
/** 获取部门业绩完成信息 */ /** 获取部门业绩完成信息 */
getProductDatalist(params) { getProductDatalist(params) {
if (params) {
this.postParams = params this.postParams = params
}
this.loading = true this.loading = true
biProductStatisticsAPI(params) biProductStatisticsAPI({
...this.postParams,
page: this.currentPage,
limit: this.pageSize
})
.then(res => { .then(res => {
if (res.data && res.data.length > 0) { const resData = res.data || {}
this.list = res.data this.list = resData.list || []
this.handleShowInfo() this.extraData = resData.total || { extraData: 0,
} else { product_sum: 0,
this.list = [] contract_money: 0 }
this.spanList = [] this.total = resData.count
this.newList = []
}
this.loading = false this.loading = false
}) })
.catch(() => { .catch(() => {
this.loading = false this.loading = false
}) })
}, },
/** 处理展示数据 */
handleShowInfo() {
//
//
//
/** /**
* rowspan 数量 * 合计
*
*/ */
getSummaries(param) {
var newList = [] this.$nextTick(() => {
var spanList = [] this.$refs.tableRef.doLayout()
var seriesIndex = 0 // span })
var productIndex = 0 return ['合计', '', this.extraData.contract_product_sum, this.extraData.product_sum, this.extraData.contract_money]
var subCount = 0 //
var subMoney = 0
var allCount = 0 //
var allMoney = 0
for (let index = 0; index < this.list.length; index++) {
const element = this.list[index]
if (spanList.length == 0) {
seriesIndex = 0 //
productIndex = 0 //
subCount = parseFloat(element.num) //
subMoney = parseFloat(element.subtotal)
allCount = parseFloat(element.num) //
allMoney = parseFloat(element.subtotal)
spanList.push({ rowspan: 1, productRowspan: 1 })
newList.push(element) //
} else if (element.category_id != this.list[index - 1].category_id) {
//
/** 上一个最后产品的处理 */
var preItem = spanList[seriesIndex]
preItem.rowspan += 1
newList.push({ price: '合计', num: subCount, subtotal: subMoney }) //
spanList.push({ rowspan: 0, productRowspan: 1, isSum: true }) // style
newList.push({ price: '总计', num: allCount, subtotal: allMoney }) //
spanList.push({ rowspan: 1, productRowspan: 1, isAllSum: true }) // style
/** * 新系列开始 */
spanList.push({ rowspan: 1, productRowspan: 1 }) // style
subCount = parseFloat(element.num) // 0
subMoney = parseFloat(element.subtotal)
allCount = parseFloat(element.num) //
allMoney = parseFloat(element.subtotal)
newList.push(element) //
seriesIndex = spanList.length - 1 //
productIndex = spanList.length - 1 //
} else {
var preItem = spanList[seriesIndex]
preItem.rowspan += 1
/** * 相同产品 */
if (element.product_id == this.list[index - 1].product_id) {
var preProItem = spanList[productIndex]
preProItem.productRowspan += 1
spanList.push({ rowspan: 0, productRowspan: 0 }) // style
subCount = floatAdd(subCount, parseFloat(element.num)) //
subMoney = floatAdd(subMoney, parseFloat(element.subtotal))
allCount = floatAdd(allCount, parseFloat(element.num)) //
allMoney = floatAdd(allMoney, parseFloat(element.subtotal))
newList.push(element) //
} else {
/** * 不相同产品 */
//
preItem.rowspan += 1
newList.push({ price: '合计', num: subCount, subtotal: subMoney }) //
spanList.push({ rowspan: 0, productRowspan: 1, isSum: true }) // Style
spanList.push({ rowspan: 0, productRowspan: 1 }) // style
productIndex = spanList.length - 1 // =
subCount = parseFloat(element.num)
subMoney = parseFloat(element.subtotal) //
allCount = floatAdd(allCount, parseFloat(element.num)) //
allMoney = floatAdd(allMoney, parseFloat(element.subtotal))
newList.push(element) //
}
}
if (this.list.length - 1 == index) {
//
var preItem = spanList[seriesIndex]
preItem.rowspan += 1
newList.push({ price: '合计', num: subCount, subtotal: subMoney }) //
subCount = 0
subMoney = 0 //
spanList.push({ rowspan: 0, productRowspan: 1, isSum: true }) // style
newList.push({ price: '合计', num: allCount, subtotal: allMoney }) //
allCount = 0
allMoney = 0 //
spanList.push({ rowspan: 1, productRowspan: 1, isAllSum: true }) // style
}
}
this.spanList = spanList
newList[newList.length - 1].price = '总计'
this.newList = newList
}, },
/** /**
* 导出点击 * 导出点击
*/ */
@ -377,5 +274,6 @@ export default {
tr td:first-child[rowspan='1'], tr td:nth-child(2)[rowspan='1'] { tr td:first-child[rowspan='1'], tr td:nth-child(2)[rowspan='1'] {
border-right: 0 none !important; border-right: 0 none !important;
} }
overflow:visible !important;
} }
</style> </style>

@ -325,9 +325,9 @@ export default {
tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' }) tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' })
tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' }) tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' })
tempsTabs.push({ label: '操作记录', name: 'RelativeHandle' }) tempsTabs.push({ label: '操作记录', name: 'RelativeHandle' })
// if (this.crm.business && this.crm.business.print) { if (this.crm.business && this.crm.business.print) {
// tempsTabs.push({ label: '', name: 'RelativePrint' }) tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
// } }
return tempsTabs return tempsTabs
}, },

@ -165,7 +165,7 @@ export default {
props: { props: {
// ID // ID
id: [String, Number], id: [String, Number],
poolId: [String, Number], pool_id: [String, Number],
detail: { detail: {
type: Object, type: Object,
default: () => { default: () => {
@ -244,8 +244,8 @@ export default {
} }
// id // id
if (this.poolId) { if (this.pool_id) {
params.poolId = this.poolId params.pool_id = this.pool_id
} }
filedGetInformationAPI(params) filedGetInformationAPI(params)

@ -93,7 +93,7 @@
@handle="handleCallBack" /> @handle="handleCallBack" />
<alloc-handle <alloc-handle
:crm-type="crmType" :crm-type="crmType"
:pool-id="poolId" :pool_id="pool_id"
:selection-list="[detail]" :selection-list="[detail]"
:dialog-visible.sync="allocDialogShow" :dialog-visible.sync="allocDialogShow"
@handle="handleCallBack" /> @handle="handleCallBack" />
@ -150,7 +150,7 @@ export default {
props: { props: {
/** 模块ID */ /** 模块ID */
id: [String, Number], id: [String, Number],
poolId: [String, Number], pool_id: [String, Number],
// //
poolAuth: Object, poolAuth: Object,
/** 没有值就是全部类型 有值就是当个类型 */ /** 没有值就是全部类型 有值就是当个类型 */
@ -415,7 +415,7 @@ export default {
}[this.crmType] }[this.crmType]
const params = {} const params = {}
if (this.isSeas) { if (this.isSeas) {
// params.poolId = this.poolId params.pool_id = this.pool_id
params.isSeas = 1 params.isSeas = 1
} }
params.id = [parseInt(this.id)] params.id = [parseInt(this.id)]
@ -431,8 +431,8 @@ export default {
} else if (type === 'get') { } else if (type === 'get') {
// //
crmCustomerReceiveAPI({ crmCustomerReceiveAPI({
customer_id: [this.id] customer_id: [this.id],
// poolId: this.poolId pool_id: this.pool_id
}) })
.then(res => { .then(res => {
this.$message({ this.$message({
@ -606,7 +606,7 @@ export default {
return this.crm[this.crmType].transform return this.crm[this.crmType].transform
} else if (type == 'export') { } else if (type == 'export') {
if (this.isSeas) { if (this.isSeas) {
if (this.poolId) { if (this.pool_id) {
return this.poolAuth.excelexport return this.poolAuth.excelexport
} }
return this.crm.pool.excelexport return this.crm.pool.excelexport
@ -614,10 +614,10 @@ export default {
return this.crm[this.crmType].excelexport return this.crm[this.crmType].excelexport
} else if (type == 'delete') { } else if (type == 'delete') {
if (this.isSeas) { if (this.isSeas) {
if (this.poolId) { if (this.pool_id) {
return this.poolAuth && this.poolAuth.delete return this.poolAuth && this.poolAuth.delete
} }
return this.crm.pool.delete && this.poolId return this.crm.pool.delete && this.pool_id
} }
return this.crm[this.crmType].delete return this.crm[this.crmType].delete
} else if (type == 'put_seas') { } else if (type == 'put_seas') {
@ -631,16 +631,16 @@ export default {
return this.crm[this.crmType].teamsave return this.crm[this.crmType].teamsave
} else if (type == 'alloc') { } else if (type == 'alloc') {
// () // ()
if (this.poolId) { if (this.pool_id) {
return this.poolAuth && this.poolAuth.distribute return this.poolAuth && this.poolAuth.distribute
} }
return this.crm.pool.distribute return this.crm.pool.distribute
} else if (type == 'get') { } else if (type == 'get') {
// () // ()
if (this.poolId) { if (this.pool_id) {
return this.poolAuth && this.poolAuth.receive return this.poolAuth && this.poolAuth.receive
} }
return this.crm.pool.receive && this.poolId return this.crm.pool.receive && this.pool_id
} else if (type == 'start' || type == 'disable') { } else if (type == 'start' || type == 'disable') {
// () // ()
return this.crm[this.crmType].status return this.crm[this.crmType].status
@ -655,8 +655,8 @@ export default {
return false return false
} else if (type == 'print') { } else if (type == 'print') {
// //
// return this.crm[this.crmType].print return this.crm[this.crmType].print
return false // return false
} else if (type == 'copyContract') { } else if (type == 'copyContract') {
// //
return this.crm[this.crmType].save return this.crm[this.crmType].save

@ -224,7 +224,7 @@ export default {
props: { props: {
// ID // ID
id: [String, Number], id: [String, Number],
poolId: [String, Number], pool_id: [String, Number],
isSeas: { isSeas: {
type: Boolean, type: Boolean,
default: false default: false
@ -332,8 +332,8 @@ export default {
} }
// id // id
if (this.poolId) { if (this.pool_id) {
params.poolId = this.poolId params.pool_id = this.pool_id
} }
filedGetInformationAPI(params) filedGetInformationAPI(params)
@ -773,7 +773,8 @@ export default {
} else { } else {
var validatesParams = { var validatesParams = {
field: item.field, field: item.field,
types: 'crm_' + this.crmType types: 'crm_' + this.crmType,
id: this.id
} }
validatesParams.fieldId = item.fieldId validatesParams.fieldId = item.fieldId
if (isArray(value)) { if (isArray(value)) {

@ -127,7 +127,7 @@ export default {
}, },
mounted() { mounted() {
// 线 // 线
if (this.crm[this.crmType] && this.crm[this.crmType].excelimport && !this.isSeas) { if (this.crm[this.crmType] && this.crm[this.crmType].excelimport) {
this.moreTypes.push({ type: 'enter', name: '导入', icon: 'import' }) this.moreTypes.push({ type: 'enter', name: '导入', icon: 'import' })
} }
if (this.crm[this.crmType] && this.crm[this.crmType].excelexport) { if (this.crm[this.crmType] && this.crm[this.crmType].excelexport) {

@ -82,7 +82,7 @@
@handle="handleCallBack" /> @handle="handleCallBack" />
<alloc-handle <alloc-handle
:crm-type="crmType" :crm-type="crmType"
:pool-id="poolId" :pool_id="pool_id"
:selection-list="selectionList" :selection-list="selectionList"
:dialog-visible.sync="allocDialogShow" :dialog-visible.sync="allocDialogShow"
@handle="handleCallBack" /> @handle="handleCallBack" />
@ -202,7 +202,7 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
poolId: [String, Number], pool_id: [String, Number],
// //
poolAuth: Object, poolAuth: Object,
// //
@ -284,8 +284,7 @@ export default {
getFilterFieldInfo() { getFilterFieldInfo() {
const params = {} const params = {}
if (this.isSeas) { if (this.isSeas) {
// params.poolId = this.poolId params.types = 'crm_customer_pool'
params.types = crmTypeModel[this.crmType]
} else { } else {
params.types = crmTypeModel[this.crmType] params.types = crmTypeModel[this.crmType]
} }
@ -363,7 +362,7 @@ export default {
let request = null let request = null
if (this.isSeas) { if (this.isSeas) {
request = crmCustomerPoolExcelExportAPI request = crmCustomerPoolExcelExportAPI
// params.poolId = this.poolId params.pool_id = this.pool_id
// params.isSeas = 1 // params.isSeas = 1
params.customer_id = this.selectionList params.customer_id = this.selectionList
.map(item => item.customer_id) .map(item => item.customer_id)
@ -509,7 +508,7 @@ export default {
const params = { const params = {
} }
if (this.isSeas) { if (this.isSeas) {
// params.poolId = this.poolId params.pool_id = this.pool_id
params.isSeas = 1 params.isSeas = 1
} }
params.id = id params.id = id
@ -530,8 +529,8 @@ export default {
// //
this.loading = true this.loading = true
crmCustomerReceiveAPI({ crmCustomerReceiveAPI({
customer_id: this.selectionList.map(item => item.customer_id) customer_id: this.selectionList.map(item => item.customer_id),
// poolId: this.poolId pool_id: this.pool_id
}) })
.then(res => { .then(res => {
this.loading = false this.loading = false
@ -714,7 +713,7 @@ export default {
: this.crm[this.crmType].transform : this.crm[this.crmType].transform
} else if (type == 'export') { } else if (type == 'export') {
if (this.isSeas) { if (this.isSeas) {
if (this.poolId) { if (this.pool_id) {
return this.poolAuth.excelexport return this.poolAuth.excelexport
} }
return this.crm.pool.excelexport return this.crm.pool.excelexport
@ -726,7 +725,7 @@ export default {
} }
} else if (type == 'delete') { } else if (type == 'delete') {
if (this.isSeas) { if (this.isSeas) {
if (this.poolId) { if (this.pool_id) {
return this.poolAuth.delete return this.poolAuth.delete
} }
return this.crm.pool.delete return this.crm.pool.delete
@ -743,13 +742,13 @@ export default {
return this.crm[this.crmType].teamsave return this.crm[this.crmType].teamsave
} else if (type == 'alloc') { } else if (type == 'alloc') {
// () // ()
if (this.poolId) { if (this.pool_id) {
return this.poolAuth.distribute return this.poolAuth.distribute
} }
return this.crm.pool.distribute return this.crm.pool.distribute
} else if (type == 'get') { } else if (type == 'get') {
// () // ()
if (this.poolId) { if (this.pool_id) {
return this.poolAuth.receive return this.poolAuth.receive
} }
return this.crm.pool.receive return this.crm.pool.receive

@ -77,7 +77,7 @@ export default {
}, },
props: { props: {
id: [Number, String], id: [Number, String],
poolId: [Number, String], pool_id: [Number, String],
contactsId: [Number, String], contactsId: [Number, String],
crmType: { crmType: {
required: true, required: true,
@ -189,8 +189,8 @@ export default {
} }
// id // id
if (this.poolId) { if (this.pool_id) {
params.poolId = this.poolId params.pool_id = this.pool_id
} }
filedGetInformationAPI(params) filedGetInformationAPI(params)

@ -78,11 +78,11 @@
:visible.sync="showFullDetail" :visible.sync="showFullDetail"
:crm-type="relationCrmType" :crm-type="relationCrmType"
:id="relationId" :id="relationId"
:pool-id="poolId" :pool_id="pool_id"
@handle="getList"/> @handle="getList"/>
<alloc-handle <alloc-handle
:pool-id="poolId" :pool_id="pool_id"
:selection-list="[relationData]" :selection-list="[relationData]"
:dialog-visible.sync="allocDialogShow" :dialog-visible.sync="allocDialogShow"
crm-type="customer" crm-type="customer"
@ -124,7 +124,7 @@ export default {
showFullDetail: false, // showFullDetail: false, //
relationId: '', // ID relationId: '', // ID
relationData: {}, // relationData: {}, //
poolId: '', // Id pool_id: '', // Id
relationCrmType: '', // relationCrmType: '', //
allocDialogShow: false // allocDialogShow: false //
} }
@ -222,8 +222,8 @@ export default {
const list = res.data || [] const list = res.data || []
this.tableData = list.map(item => { this.tableData = list.map(item => {
// item.module = crmTypeModel.convertTypeToName(item.type) // item.module = crmTypeModel.convertTypeToName(item.type)
if (item.poolName) { if (item.pool_name) {
item.module = `${item.module}${item.poolName}` item.module = `${item.module}${item.pool_name}`
} }
// //
if (!this.isCustomerFilter) { if (!this.isCustomerFilter) {
@ -254,9 +254,9 @@ export default {
if (column.property == 'name' && row.id) { if (column.property == 'name' && row.id) {
this.relationId = row.id this.relationId = row.id
if (row.poolAuthList) { if (row.poolAuthList) {
this.poolId = row.poolAuthList.poolId this.pool_id = row.poolAuthList.pool_id
} else { } else {
this.poolId = '' this.pool_id = ''
} }
const key = crmTypeModel.convertTypeToKey(row.type) const key = crmTypeModel.convertTypeToKey(row.type)
this.relationCrmType = key == 'pool' ? 'customer' : key this.relationCrmType = key == 'pool' ? 'customer' : key
@ -289,7 +289,7 @@ export default {
.then(() => { .then(() => {
crmCustomerReceiveAPI({ crmCustomerReceiveAPI({
customer_id: [data.id], customer_id: [data.id],
poolId: data.poolAuthList.poolId pool_id: data.poolAuthList.pool_id
}) })
.then(res => { .then(res => {
this.$message.success('操作成功') this.$message.success('操作成功')

@ -67,7 +67,7 @@ export default {
default: false default: false
}, },
poolId: [String, Number] pool_id: [String, Number]
}, },
data() { data() {
return { return {
@ -97,7 +97,7 @@ export default {
} }
}, },
poolId() { pool_id() {
this.fields = [] this.fields = []
} }
}, },
@ -114,8 +114,8 @@ export default {
const params = {} const params = {}
if (this.isSeas) { if (this.isSeas) {
request = crmPoolFieldConfigIndexAPI request = crmPoolFieldConfigIndexAPI
params.poolId = this.poolId params.pool_id = this.pool_id
params.types = crmTypeModel[this.crmType] + '_pool' // params.types = crmTypeModel[this.crmType] + '_pool'
} else { } else {
request = crmFieldConfigAPIIndexAPI request = crmFieldConfigAPIIndexAPI
params.types = crmTypeModel[this.crmType] params.types = crmTypeModel[this.crmType]
@ -184,7 +184,7 @@ export default {
} }
if (this.isSeas) { if (this.isSeas) {
request = crmPoolFieldConfigAPI request = crmPoolFieldConfigAPI
params.poolId = this.poolId params.pool_id = this.pool_id
params.types = crmTypeModel[this.crmType] + '_pool' params.types = crmTypeModel[this.crmType] + '_pool'
} else { } else {
request = crmFieldConfigAPI request = crmFieldConfigAPI

@ -18,9 +18,9 @@
@change="getDetail"> @change="getDetail">
<el-option <el-option
v-for="item in templateOptions" v-for="item in templateOptions"
:key="item.templateId" :key="item.id"
:label="item.templateName" :label="item.name"
:value="item.templateId"/> :value="item.id"/>
</el-select> </el-select>
<span class="select-label">选择模版</span> <span class="select-label">选择模版</span>
<el-select <el-select
@ -146,7 +146,7 @@ export default {
this.templateOptions = res.data.list || [] this.templateOptions = res.data.list || []
if (this.$route.query.type != 'history') { if (this.$route.query.type != 'history') {
if (this.templateOptions.length) { if (this.templateOptions.length) {
this.templateId = this.templateOptions[0].templateId this.templateId = this.templateOptions[0].id
this.getDetail() this.getDetail()
} else { } else {
this.templateId = '' this.templateId = ''
@ -166,8 +166,9 @@ export default {
getDetail() { getDetail() {
this.loading = true this.loading = true
printPrintAPI({ printPrintAPI({
templateId: this.templateId, template_id: this.templateId,
id: this.typeId action_id: this.typeId,
type: crmTypeModel.convertKeyToType(this.$route.query.module)
}) })
.then(res => { .then(res => {
this.loading = false this.loading = false
@ -184,17 +185,18 @@ export default {
getRecordDetail() { getRecordDetail() {
this.loading = true this.loading = true
printRecordDetailAPI({ printRecordDetailAPI({
recordId: this.$route.query.recordId record_id: this.$route.query.id,
type: 20
}) })
.then(res => { .then(res => {
this.loading = false this.loading = false
const data = res.data || {} const data = res.data || {}
this.historyData = data this.historyData = data
this.templateId = data.templateId this.templateId = data.template_id
this.typeId = data.typeId this.typeId = data.typeId
this.getTemplateOptions(data.crmType) this.getTemplateOptions(data.type)
this.content = data.recordContent || '' this.content = data.content || ''
}) })
.catch(() => { .catch(() => {
this.loading = false this.loading = false
@ -221,8 +223,8 @@ export default {
.then(res => { .then(res => {
this.loading = false this.loading = false
const data = res.data const data = res.data
const iframeUrl = `/crmPrint/preview.pdf?type=1&key=${data}` const iframeUrl = `/crm/preview/previewPDF?key=${data}`
downloadFileAPI(iframeUrl).then(res => { downloadFileAPI({ key: data }, iframeUrl).then(res => {
this.iframeUrl = window.URL.createObjectURL(res.data) this.iframeUrl = window.URL.createObjectURL(res.data)
}).catch(() => {}) }).catch(() => {})
@ -240,9 +242,10 @@ export default {
savePrintRecord() { savePrintRecord() {
if (this.templateId && this.typeId) { if (this.templateId && this.typeId) {
printSaveRecordAPI({ printSaveRecordAPI({
templateId: this.templateId, template_id: this.templateId,
typeId: this.typeId, action_id: this.typeId,
recordContent: this.content recordContent: this.content,
type: crmTypeModel.convertKeyToType(this.$route.query.module)
}) })
.then(res => { .then(res => {
}) })

@ -54,8 +54,8 @@ export default {
nopermission: false, nopermission: false,
list: [], list: [],
fieldList: [ fieldList: [
{ prop: 'createTime', label: '打印时间', width: '115px' }, { prop: 'create_time', label: '打印时间', width: '115px' },
{ prop: 'templateName', label: '打印模板', width: '115px' } { prop: 'template_name', label: '打印模板', width: '115px' }
], ],
tableHeight: '450px' tableHeight: '450px'
} }
@ -90,7 +90,7 @@ export default {
.then(res => { .then(res => {
this.nopermission = false this.nopermission = false
this.loading = false this.loading = false
this.list = res.data this.list = res.data.list
}) })
.catch(res => { .catch(res => {
if (res.code == 102) { if (res.code == 102) {
@ -101,7 +101,7 @@ export default {
}, },
print(data) { print(data) {
const routeData = this.$router.resolve(`/print/?&type=history&recordId=${data.recordId}`) const routeData = this.$router.resolve(`/print/?&type=history&module=${this.crmType}&id=${data.record_id}`)
window.open(routeData.href, '_blank') window.open(routeData.href, '_blank')
} }
} }

@ -189,6 +189,7 @@ import VDistpicker from '@/components/VDistpicker'
import { objDeepCopy } from '@/utils' import { objDeepCopy } from '@/utils'
import AdvancedFilterMixin from '@/mixins/AdvancedFilter' import AdvancedFilterMixin from '@/mixins/AdvancedFilter'
import { isArray } from '@/utils/types'
/** /**
* fieldList: 高级筛选的字段 * fieldList: 高级筛选的字段
@ -312,15 +313,16 @@ export default {
item.value = [] item.value = []
this.getProductCategoryValue(item, element.value[0]) this.getProductCategoryValue(item, element.value[0])
} else if (element.form_type == 'map_address') { } else if (element.form_type == 'map_address') {
const addressArr = element.value[0].split(',') const addressArr = element.value
item.address = { item.address = addressArr
state: addressArr.length > 0 ? addressArr[0] : '', // item.address = {
city: addressArr.length > 1 ? addressArr[1] : '', // state: addressArr.length > 0 ? addressArr[0] : '',
area: addressArr.length > 2 ? addressArr[2] : '' // city: addressArr.length > 1 ? addressArr[1] : '',
} // area: addressArr.length > 2 ? addressArr[2] : ''
// }
} else { } else {
item.setting = element.setting item.setting = element.setting
item.value = element.value item.value = isArray(element.value) ? element.value.join(';') : element.value
} }
this.form.push(item) this.form.push(item)
@ -386,7 +388,7 @@ export default {
const users = res.data || [] const users = res.data || []
for (let index = 0; index < users.length; index++) { for (let index = 0; index < users.length; index++) {
const user = users[index] const user = users[index]
if (user.userId == id) { if (user.id == id) {
item.value = [user] item.value = [user]
break break
} }
@ -776,6 +778,8 @@ export default {
if (typeof o.value === 'string') { if (typeof o.value === 'string') {
const temp = o.value.replace(//g, ';') const temp = o.value.replace(//g, ';')
value = temp.split(';').filter(item => item !== '' && item !== null) value = temp.split(';').filter(item => item !== '' && item !== null)
} else if (Object.prototype.toString.call(o.value) === '[object Array]') {
value = o.value
} else { } else {
value = [o.value] value = [o.value]
} }

@ -53,7 +53,7 @@ export default {
type: String, type: String,
default: '' default: ''
}, },
poolId: [String, Number], pool_id: [String, Number],
/** 转移数据 */ /** 转移数据 */
selectionList: { selectionList: {
type: Array, type: Array,
@ -103,8 +103,8 @@ export default {
this.$message.error('请选择负责人') this.$message.error('请选择负责人')
} else { } else {
const params = { const params = {
owner_user_id: this.usersList[0].id user_id: this.usersList[0].id,
// poolId: this.poolId pool_id: this.pool_id
} }
params.customer_id = this.selectionList.map(item => item[this.crmType + '_id']) params.customer_id = this.selectionList.map(item => item[this.crmType + '_id'])
this.loading = true this.loading = true

@ -12,9 +12,9 @@
<el-select v-model="selectId" > <el-select v-model="selectId" >
<el-option <el-option
v-for="item in list" v-for="item in list"
:key="item.poolId" :key="item.pool_id"
:label="item.poolName" :label="item.pool_name"
:value="item.poolId"/> :value="item.pool_id"/>
</el-select> </el-select>
</flexbox> </flexbox>
</div> </div>
@ -31,7 +31,8 @@
<script> <script>
import { import {
crmCustomerPutInPoolAPI crmCustomerPutInPoolAPI,
crmCustomerPoolNameListAPI
} from '@/api/crm/customer' } from '@/api/crm/customer'
import { Loading } from 'element-ui' import { Loading } from 'element-ui'
@ -69,7 +70,7 @@ export default {
watch: { watch: {
list: { list: {
handler() { handler() {
this.selectId = this.list && this.list.length > 0 ? this.list[0].poolId : '' this.selectId = this.list && this.list.length > 0 ? this.list[0].pool_id : ''
}, },
immediate: true immediate: true
}, },
@ -86,20 +87,20 @@ export default {
* 获取数据源 * 获取数据源
*/ */
getList() { getList() {
// const loading = Loading.service({ const loading = Loading.service({
// target: document.querySelector(`.el-dialog[aria-label=""]`) target: document.querySelector(`.el-dialog[aria-label="放入公海"]`)
// }) })
this.list = [ this.list = [
{ 'poolId': 1, 'poolName': '系统默认公海', 'adminUserId': null, 'memberUserId': null, 'memberDeptId': null, 'status': null, 'preOwnerSetting': null, 'preOwnerSettingDay': null, 'receiveSetting': null, 'receiveNum': null, 'remindSetting': null, 'remindDay': null, 'putInRule': null, 'createUserId': null, 'createTime': null, 'companyId': null } // { 'pool_id': 1, 'pool_name': '', 'adminUserId': null, 'memberUserId': null, 'memberDeptId': null, 'status': null, 'preOwnerSetting': null, 'preOwnerSettingDay': null, 'receiveSetting': null, 'receiveNum': null, 'remindSetting': null, 'remindDay': null, 'putInRule': null, 'createUserId': null, 'createTime': null, 'companyId': null }
] ]
// crmCustomerPoolNameListAPI() crmCustomerPoolNameListAPI()
// .then(res => { .then(res => {
// this.list = res.data || [] this.list = res.data || []
// loading && loading.close() loading && loading.close()
// }) })
// .catch(() => { .catch(() => {
// loading && loading.close() loading && loading.close()
// }) })
}, },
/** /**
@ -118,8 +119,8 @@ export default {
target: document.querySelector(`.el-dialog[aria-label="放入公海"]`) target: document.querySelector(`.el-dialog[aria-label="放入公海"]`)
}) })
crmCustomerPutInPoolAPI({ crmCustomerPutInPoolAPI({
customer_id: this.selectionList.map(item => item.customer_id) customer_id: this.selectionList.map(item => item.customer_id),
// poolId: this.selectId pool_id: this.selectId
}) })
.then(res => { .then(res => {
this.$message({ this.$message({

@ -203,9 +203,9 @@ export default {
tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' }) tempsTabs.push({ label: this.getTabName('团队成员', this.tabsNumber.memberCount), name: 'RelativeTeam' })
tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' }) tempsTabs.push({ label: this.getTabName('附件', this.tabsNumber.fileCount), name: 'RelativeFiles' })
tempsTabs.push({ label: '操作记录', name: 'RelativeHandle' }) tempsTabs.push({ label: '操作记录', name: 'RelativeHandle' })
// if (this.crm.contract && this.crm.contract.print) { if (this.crm.contract && this.crm.contract.print) {
// tempsTabs.push({ label: '', name: 'RelativePrint' }) tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
// } }
return tempsTabs return tempsTabs
}, },

@ -23,7 +23,7 @@
:detail="detailData" :detail="detailData"
:head-details="headDetails" :head-details="headDetails"
:id="id" :id="id"
:pool-id="seasPoolId" :pool_id="seasPoolId"
:pool-auth="poolAuth" :pool-auth="poolAuth"
:crm-type="crmType" :crm-type="crmType"
@handle="detailHeadHandle" @handle="detailHeadHandle"
@ -56,7 +56,7 @@
:detail="detailData" :detail="detailData"
:type-list="logTyps" :type-list="logTyps"
:id="id" :id="id"
:pool-id="seasPoolId" :pool_id="seasPoolId"
:handle="activityHandle" :handle="activityHandle"
:is-seas="isSeasDetail" :is-seas="isSeasDetail"
:crm-type="crmType" :crm-type="crmType"
@ -77,7 +77,7 @@
<chiefly-contacts <chiefly-contacts
:contacts-id="firstContactsId" :contacts-id="firstContactsId"
:id="id" :id="id"
:pool-id="seasPoolId" :pool_id="seasPoolId"
:crm-type="crmType" :crm-type="crmType"
:is-seas="isSeasDetail" :is-seas="isSeasDetail"
@add="addChieflyContacts" /> @add="addChieflyContacts" />
@ -146,7 +146,7 @@ export default {
props: { props: {
// id // id
id: [String, Number], id: [String, Number],
poolId: [String, Number], pool_id: [String, Number],
// dom // dom
listenerIDs: { listenerIDs: {
type: Array, type: Array,
@ -283,11 +283,10 @@ export default {
* 公海id * 公海id
*/ */
seasPoolId() { seasPoolId() {
// if (this.poolAuth && this.poolAuth.poolId) { if (this.poolAuth && this.poolAuth.pool_id) {
// return this.poolAuth.poolId return this.poolAuth.pool_id
// } }
// return this.poolId return this.pool_id
return 1
}, },
/** /**
@ -365,12 +364,10 @@ export default {
id: this.id id: this.id
} }
if (this.poolId) { if (this.pool_id) {
params.poolId = this.poolId params.pool_id = this.pool_id
params.customer_id = this.id
} }
// if(this.isPool){
// }
crmCustomerReadAPI(params) crmCustomerReadAPI(params)
.then(res => { .then(res => {
@ -381,9 +378,9 @@ export default {
this.firstContactsId = this.detailData.contacts_id this.firstContactsId = this.detailData.contacts_id
// //
// this.poolAuth = resData.poolAuthList || {} this.poolAuth = resData.poolAuthList || {}
crmCustomerPoolQueryAuthAPI().then(res => { crmCustomerPoolQueryAuthAPI({ pool_id: this.pool_id }).then(res => {
this.poolAuth = res.data || {} this.poolAuth = res.data || {}
}) })
@ -416,7 +413,7 @@ export default {
} }
this.headDetails[2].title = this.isSeasDetail ? '' : '负责人' this.headDetails[2].title = this.isSeasDetail ? '' : '负责人'
this.headDetails[2].value = this.detailData.owner_user_id_info.realname || '' this.headDetails[2].value = this.isSeasDetail ? this.detailDatabefore_owner_user_name : this.detailData.owner_user_id_info.realname || ''
this.headDetails[3].value = this.detailData.create_time this.headDetails[3].value = this.detailData.create_time
}) })
.catch(() => { .catch(() => {

@ -258,6 +258,11 @@ export default {
name: '更新时间', name: '更新时间',
// formType: 'text', // formType: 'text',
value: data.essential.update_time value: data.essential.update_time
},
{
name: '审核状态',
// formType: 'text',
value: data.essential.check_status
} }
] ]
}, },

@ -145,8 +145,8 @@ export default {
} }
// 公海切换 // 公海切换
if (this.poolId) { if (this.pool_id) {
// params.poolId = this.poolId params.pool_id = this.pool_id
} }
if (this.filterObj && this.filterObj.length > 0) { if (this.filterObj && this.filterObj.length > 0) {
this.filterObj.forEach(element => { this.filterObj.forEach(element => {
@ -249,14 +249,15 @@ export default {
let params = {} let params = {}
if (this.isSeas) { if (this.isSeas) {
if (this.poolId) { if (this.pool_id) {
params.poolId = this.poolId params.pool_id = this.pool_id
} }
params = { params = {
types: 'crm_' + this.crmType, types: 'crm_' + this.crmType,
module: 'crm', module: 'crm',
action: 'pool', action: 'pool',
controller: this.crmType controller: this.crmType,
pool_id: this.pool_id
} }
} else { } else {
// params.label = crmTypeModel[this.crmType] // params.label = crmTypeModel[this.crmType]
@ -466,8 +467,8 @@ export default {
} }
// 公海切换 // 公海切换
if (this.poolId) { if (this.pool_id) {
// params.poolId = this.poolId params.pool_id = this.pool_id
} }
// if (this.filterObj && this.filterObj.length > 0) { // if (this.filterObj && this.filterObj.length > 0) {
@ -619,11 +620,11 @@ export default {
}[column.property] || field }[column.property] || field
} }
if (this.isSeas) { if (this.isSeas) {
if (!this.poolId) { if (!this.pool_id) {
return return
} }
request = crmPoolFieldColumnWidthAPI request = crmPoolFieldColumnWidthAPI
params.poolId = this.poolId params.pool_id = this.pool_id
} else { } else {
request = crmFieldColumnWidthAPI request = crmFieldColumnWidthAPI
} }

@ -17,6 +17,7 @@
<template slot-scope="{ data }"> <template slot-scope="{ data }">
<xh-prouct-cate <xh-prouct-cate
v-if="data && data.formType == 'category'" v-if="data && data.formType == 'category'"
:disabled="data.disabled"
:value="fieldForm[data.field]" :value="fieldForm[data.field]"
@value-change="otherChange($event, data)" @value-change="otherChange($event, data)"
/> />

@ -34,6 +34,7 @@
<xh-receivables-plan <xh-receivables-plan
v-if="data && data.formType == 'receivables_plan'" v-if="data && data.formType == 'receivables_plan'"
:value="fieldForm[data.field]" :value="fieldForm[data.field]"
:disabled="data.disabled"
:receivables-id="editId" :receivables-id="editId"
:relation="data.relation" :relation="data.relation"
@value-change="otherChange($event, data)" @value-change="otherChange($event, data)"

@ -148,9 +148,9 @@ export default {
{ label: '操作记录', name: 'RelativeHandle' } { label: '操作记录', name: 'RelativeHandle' }
] ]
// if (this.crm.receivables && this.crm.receivables.print) { if (this.crm.receivables && this.crm.receivables.print) {
// tempsTabs.push({ label: '', name: 'RelativePrint' }) tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
// } }
return tempsTabs return tempsTabs
} }

@ -34,7 +34,7 @@
<c-r-m-table-head <c-r-m-table-head
ref="crmTableHead" ref="crmTableHead"
:is-seas="isSeas" :is-seas="isSeas"
:pool-id="poolId" :pool_id="pool_id"
:pool-auth="poolAuth" :pool-auth="poolAuth"
:sort-data="sortData" :sort-data="sortData"
crm-type="customer" crm-type="customer"
@ -44,13 +44,13 @@
<template slot="custom"> <template slot="custom">
<div>公海</div> <div>公海</div>
<el-select <el-select
v-model="poolId" v-model="pool_id"
@change="poolChange"> @change="poolChange">
<el-option <el-option
v-for="item in poolList" v-for="item in poolList"
:key="item.poolId" :key="item.pool_id"
:label="item.poolName" :label="item.pool_name"
:value="item.poolId"/> :value="item.pool_id"/>
</el-select> </el-select>
</template> </template>
</c-r-m-table-head> </c-r-m-table-head>
@ -109,7 +109,7 @@
<field-set <field-set
:is-seas="isSeas" :is-seas="isSeas"
:crm-type="crmType" :crm-type="crmType"
:pool-id="poolId" :pool_id="pool_id"
@change="setSave"/> @change="setSave"/>
</template> </template>
</el-table-column> </el-table-column>
@ -131,7 +131,7 @@
<customer-detail <customer-detail
v-if="showDview" v-if="showDview"
:id="rowID" :id="rowID"
:pool-id="poolId" :pool_id="pool_id"
:is-seas="isSeas" :is-seas="isSeas"
class="d-view" class="d-view"
@handle="handleHandle" @handle="handleHandle"
@ -165,7 +165,7 @@ export default {
return { return {
crmType: 'customer', crmType: 'customer',
isSeas: true, // isSeas: true, //
poolId: '', pool_id: '',
poolAuth: {}, poolAuth: {},
poolList: [] poolList: []
} }
@ -201,7 +201,7 @@ export default {
} }
}, },
watch: { watch: {
poolId: { pool_id: {
handler(newVal) { handler(newVal) {
if (newVal) { if (newVal) {
this.getCustomerPoolAuth(newVal) this.getCustomerPoolAuth(newVal)
@ -215,10 +215,10 @@ export default {
this.getPoolList() this.getPoolList()
}, },
activated() { activated() {
// if (this.isRequested) { if (this.isRequested) {
// this.getList() // this.getList()
// } }
this.getFieldList() // this.getFieldList()
}, },
deactivated() { deactivated() {
this.$refs.elMenu.activeIndex = 'seas' this.$refs.elMenu.activeIndex = 'seas'
@ -227,12 +227,13 @@ export default {
/** /**
* 获取公海权限 * 获取公海权限
*/ */
getCustomerPoolAuth(poolId) { getCustomerPoolAuth(pool_id) {
crmCustomerPoolQueryAuthAPI({ crmCustomerPoolQueryAuthAPI({
poolId: poolId pool_id: pool_id
}) })
.then(res => { .then(res => {
this.poolAuth = res.data || {} this.poolAuth = res.data || {}
this.getFieldList()
}) })
.catch(() => { .catch(() => {
// this.poolAuth = { receive: true, excelexport: true, index: true, distribute: true, delete: true } // this.poolAuth = { receive: true, excelexport: true, index: true, distribute: true, delete: true }
@ -253,12 +254,9 @@ export default {
crmCustomerPoolNameListAPI() crmCustomerPoolNameListAPI()
.then(res => { .then(res => {
this.poolList = res.data || [] this.poolList = res.data || []
// this.poolId = this.poolList.length > 0 ? this.poolList[0].poolId : '' this.pool_id = this.poolList.length > 0 ? this.poolList[0].pool_id : ''
this.poolId = 1
}) })
.catch(() => { .catch(() => {
this.poolList = [{ 'poolId': 1, 'poolName': '系统默认公海', 'adminUserId': null, 'memberUserId': null, 'memberDeptId': null, 'status': null, 'preOwnerSetting': null, 'preOwnerSettingDay': null, 'receiveSetting': null, 'receiveNum': null, 'remindSetting': null, 'remindDay': null, 'putInRule': null, 'createUserId': null, 'createTime': null, 'companyId': null }]
this.poolId = 1
}) })
}, },

@ -35,7 +35,7 @@ export default {
}, },
props: { props: {
data: Object, data: Object,
dataIndex: Number dataIndex: [String, Number]
}, },
data() { data() {
return {} return {}

@ -121,7 +121,8 @@ export default {
.then(() => { .then(() => {
crmFileDeleteAPI({ crmFileDeleteAPI({
id: this.data.file_id, id: this.data.file_id,
save_name: this.data.save_name save_name: this.data.save_name,
module: 'work_task'
}) })
.then(res => { .then(res => {
this.$message.success('操作成功') this.$message.success('操作成功')

@ -109,9 +109,7 @@ export default {
* 拖拽结束 * 拖拽结束
*/ */
draggableEnd() { draggableEnd() {
oaAllExamineCategorySortAPI(this.categorys.map(item => { oaAllExamineCategorySortAPI({ examineIds: this.categorys.map(item => item.category_id) })
return { categoryId: item.categoryId }
}))
.then(res => {}) .then(res => {})
.catch(() => {}) .catch(() => {})
} }

@ -148,7 +148,7 @@ export default {
this.formData = { this.formData = {
title: this.action.data.title, title: this.action.data.title,
content: this.action.data.content, content: this.action.data.content,
dep: { staff: this.action.data.ownerUserList, dep: this.action.data.deptList } dep: { staff: this.action.data.ownerUserList, dep: this.action.data.structureList }
} }
} }
}, },

@ -32,7 +32,7 @@
</el-dropdown> </el-dropdown>
</flexbox> </flexbox>
<div class="detail-title">{{ detail.title }}</div> <div class="detail-title">{{ detail.title }}</div>
<div class="detail-time">{{ detail.updateTime }}</div> <div class="detail-time">{{ detail.update_time }}</div>
<div class="main__bd">{{ detail.content }}</div> <div class="main__bd">{{ detail.content }}</div>
</div> </div>

@ -10,6 +10,7 @@
@search="searchClick"> @search="searchClick">
<div slot="ft"> <div slot="ft">
<el-button <el-button
v-if="permissonProject"
type="primary" type="primary"
icon="el-icon-plus" icon="el-icon-plus"
class="xr-btn--orange" class="xr-btn--orange"

@ -398,7 +398,7 @@ export default {
fromlist: fromlist.map(item => { fromlist: fromlist.map(item => {
return item.task_id return item.task_id
}), }),
fromTopId: fromTop, from_top_id: fromTop,
tolist: tolist.map(item => { tolist: tolist.map(item => {
return item.task_id return item.task_id
}), }),

@ -39,6 +39,19 @@
:label="item.label" :label="item.label"
:value="item.value" /> :value="item.value" />
</el-select> </el-select>
<el-dropdown
v-if="moreTypes.length > 0"
trigger="click"
@command="handleTypeDrop">
<el-button icon="el-icon-more"/>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(item, index) in moreTypes"
:key="index"
:icon="item.icon"
:command="item.type">{{ item.name }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</flexbox> </flexbox>
<div <div
@ -90,7 +103,16 @@
</template> </template>
<script> <script>
import { crmIndexGetRecordListAPI } from '@/api/crm/workbench' // import { crmIndexGetRecordListAPI } from '@/api/crm/workbench'
import {
crmIndexGetRecordListAPI,
crmInstrumentExportRecordListAPI,
crmInstrumentImportRecordListAPI,
crmInstrumentDownloadRecordExcelAPI
} from '@/api/crm/workbench'
import {
userErrorExcelDownAPI
} from '@/api/admin/employeeDep'
import RecordTabHead from './components/RecordTabHead' import RecordTabHead from './components/RecordTabHead'
import XhUserCell from '@/components/CreateCom/XhUserCell' import XhUserCell from '@/components/CreateCom/XhUserCell'
@ -99,7 +121,8 @@ import LogCell from '@/views/crm/components/Activity/LogCell'
import LogEditDialog from '@/views/crm/components/Activity/LogEditDialog' import LogEditDialog from '@/views/crm/components/Activity/LogEditDialog'
import crmTypeModel from '@/views/crm/model/crmTypeModel' import crmTypeModel from '@/views/crm/model/crmTypeModel'
import { downloadExcelWithResData } from '@/utils'
import { mapGetters } from 'vuex'
export default { export default {
// //
name: 'FollowIndex', name: 'FollowIndex',
@ -182,10 +205,27 @@ export default {
seciton: 0, seciton: 0,
index: 0 index: 0
}, },
logEditDialogVisible: false logEditDialogVisible: false,
requestParams: {}
} }
}, },
computed: { computed: {
...mapGetters(['crm']),
followRecordAuth() {
return this.crm.followRecord
},
moreTypes() {
const temps = []
// if (this.followRecordAuth.excelimport) {
// temps.push({ type: 'enter', name: '', icon: 'wk wk-import' })
// }
// if (this.followRecordAuth.excelexport) {
// temps.push({ type: 'out', name: '', icon: 'wk wk-export' })
// }
return temps
},
// 线 // 线
scrollDisabled() { scrollDisabled() {
return this.loading || this.noMore return this.loading || this.noMore
@ -205,7 +245,18 @@ export default {
}, },
mounted() {}, mounted() {},
beforeDestroy() {}, created() {
//
this.$bus.on('import-crm-done-bus', (type) => {
console.log(type)
if (type === 'crmFollowLog') {
this.refreshList()
}
})
},
beforeDestroy() {
this.$bus.off('import-crm-done-bus')
},
methods: { methods: {
/** /**
* 中间tabs改变 * 中间tabs改变
@ -234,7 +285,7 @@ export default {
limit: 15, limit: 15,
isUser: 1, isUser: 1,
queryType: 0, queryType: 0,
label: 2 label: 0
} }
if (this.timeSelect.type) { if (this.timeSelect.type) {
@ -249,11 +300,12 @@ export default {
if (this.userSelectShow) { if (this.userSelectShow) {
params = { ...params, ...this.filterForm } params = { ...params, ...this.filterForm }
} else { } else {
// params.label = this.filterForm.crmType params.label = this.filterForm.crmType
params.subUser = this.filterForm.subUser params.subUser = this.filterForm.subUser
params.dataType = this.filterForm.queryType params.dataType = this.filterForm.queryType
params.search = this.filterForm.search params.search = this.filterForm.search
} }
this.requestParams = params
crmIndexGetRecordListAPI(params) crmIndexGetRecordListAPI(params)
.then(res => { .then(res => {
this.loading = false this.loading = false
@ -332,7 +384,53 @@ export default {
if (this.logEditPosition.index >= 0) { if (this.logEditPosition.index >= 0) {
this.list.splice(this.logEditPosition.index, 1, data) this.list.splice(this.logEditPosition.index, 1, data)
} }
},
handleTypeDrop(command) {
if (!this.requestParams.label) {
this.$message.error('请先选择一个模块导入/导出')
return
} }
if (command == 'out') {
crmInstrumentExportRecordListAPI(this.requestParams)
.then(res => {
downloadExcelWithResData(res)
})
.catch(() => {})
} else if (command == 'enter') {
const labelObj = this.options.find(item => item.value === this.requestParams.label)
this.$bus.emit('import-crm-bus', 'crmFollowLog', {
typeName: `${labelObj.label}跟进记录`,
ownerSelectShow: false,
repeatHandleShow: false,
historyShow: false,
noImportProcess: true,
importRequest: crmInstrumentImportRecordListAPI, //
importParams: { crmType: this.requestParams.label },
templateRequest: crmInstrumentDownloadRecordExcelAPI, //
templateParams: { crmType: this.requestParams.label },
downloadErrFuc: this.getImportError
})
}
},
/**
* 导入错误下载
*/
getImportError(result) {
return new Promise((resolve, reject) => {
userErrorExcelDownAPI({
token: result.token
})
.then(res => {
resolve(res)
})
.catch(() => {
reject()
})
})
}
} }
} }
</script> </script>

Loading…
Cancel
Save