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

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

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

@ -92,7 +92,7 @@ export function filedUpdateTableFieldAPI(data) {
*/
export function filedGetPoolTableFieldAPI(data) {
return request({
url: 'admin/field/getField',
url: 'crm/customerPool/field',
method: 'post',
data: data
})
@ -245,7 +245,7 @@ export function crmFieldConfigAPIIndexAPI(data) {
*/
export function crmPoolFieldConfigIndexAPI(data) {
return request({
url: 'admin/field/configIndex',
url: 'crm/customerPool/fieldConfig',
method: 'post',
data: data
})
@ -269,7 +269,7 @@ export function crmFieldConfigAPI(data) {
*/
export function crmPoolFieldConfigAPI(data) {
return request({
url: 'admin/field/config',
url: 'crm/customerPool/setFieldConfig',
method: 'post',
data: data
})
@ -296,7 +296,7 @@ export function crmFieldColumnWidthAPI(data) {
*/
export function crmPoolFieldColumnWidthAPI(data) {
return request({
url: 'crmField/setPoolFieldStyle',
url: 'crm/customerPool/setFieldWidth',
method: 'post',
data: data,
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) {
return request({
url: 'crm/customer/pool',
url: 'crm/customerPool/index',
method: 'post',
data: data
})
@ -58,7 +58,7 @@ export function crmCustomerPoolListAPI(data) {
*/
export function crmCustomerPoolDeleteAPI(data) {
return request({
url: 'crm/customer/delete',
url: 'crm/customerPool/delete',
method: 'post',
data: data,
headers: {
@ -73,7 +73,7 @@ export function crmCustomerPoolDeleteAPI(data) {
*/
export function crmCustomerPoolSetAPI(data) {
return request({
url: 'crmCustomerPool/setCustomerPool',
url: 'admin/setting/setPool',
method: 'post',
data: data,
headers: {
@ -88,7 +88,7 @@ export function crmCustomerPoolSetAPI(data) {
*/
export function crmCustomerPoolSetListAPI(data) {
return request({
url: 'crmCustomerPool/queryPoolSettingList',
url: 'admin/setting/pool',
method: 'post',
data: data,
headers: {
@ -102,7 +102,7 @@ export function crmCustomerPoolSetListAPI(data) {
*/
export function crmCustomerPoolSetDeleteAPI(data) {
return request({
url: 'crmCustomerPool/deleteCustomerPool',
url: 'admin/setting/deletePool',
method: 'post',
data: data
})
@ -114,7 +114,7 @@ export function crmCustomerPoolSetDeleteAPI(data) {
*/
export function crmCustomerPoolSetDetailAPI(data) {
return request({
url: 'crmCustomerPool/queryPoolById',
url: 'admin/setting/readPool',
method: 'post',
data: data
})
@ -126,7 +126,7 @@ export function crmCustomerPoolSetDetailAPI(data) {
*/
export function crmCustomerPoolSetChangeStatusAPI(data) {
return request({
url: 'crmCustomerPool/changeStatus',
url: 'admin/setting/changePool',
method: 'post',
data: data
})
@ -140,7 +140,7 @@ export function crmCustomerPoolSetChangeStatusAPI(data) {
*/
export function crmCustomerPoolSetTransferAPI(data) {
return request({
url: 'crmCustomerPool/transfer',
url: 'admin/setting/transferPool',
method: 'post',
data: data
})
@ -152,7 +152,7 @@ export function crmCustomerPoolSetTransferAPI(data) {
*/
export function crmCustomerPoolSetNameListAPI(data) {
return request({
url: 'crmCustomerPool/queryPoolNameList',
url: 'admin/setting/pool',
method: 'post',
data: data
})
@ -164,7 +164,7 @@ export function crmCustomerPoolSetNameListAPI(data) {
*/
export function crmCustomerPoolNameListAPI(data) {
return request({
url: 'crmCustomerPool/queryPoolNameListByAuth',
url: 'crm/customerPool/pondList',
method: 'post',
data: data
})
@ -176,7 +176,7 @@ export function crmCustomerPoolNameListAPI(data) {
*/
export function crmCustomerPoolQueryLevelAPI(data) {
return request({
url: 'crmCustomerPool/queryCustomerLevel',
url: 'admin/setting/customerLevel',
method: 'post',
data: data
})
@ -187,7 +187,7 @@ export function crmCustomerPoolQueryLevelAPI(data) {
*/
export function crmCustomerReadAPI(data) {
return request({
url: `crm/customer/read`,
url: `crm/${data.pool_id ? 'customerPool' : 'customer'}/read`,
method: 'post',
data: data
})
@ -301,7 +301,7 @@ export function crmCustomerPoolExcelImportAPI(data) {
param.append(key, data[key])
})
return request({
url: 'crmCustomerPool/uploadExcel',
url: 'crm/customerPool/import',
method: 'post',
data: param,
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
*/
export function crmCustomerPoolExcelExportAPI(data) {
return request({
url: 'crm/customer/poolExcelExport',
url: 'crm/customerPool/export',
method: 'post',
data: data,
headers: {
@ -348,7 +366,7 @@ export function crmCustomerPoolExcelExportAPI(data) {
*/
export function crmCustomerPoolExcelAllExport(data) {
return request({
url: 'crm/customer/poolExcelExport',
url: 'crm/customerPool/export',
method: 'post',
data: data,
responseType: 'blob',
@ -364,7 +382,7 @@ export function crmCustomerPoolExcelAllExport(data) {
*/
export function crmCustomerPoolQueryPoolFieldAPI(data) {
return request({
url: 'crmCustomerPool/queryPoolField',
url: 'admin/setting/poolField',
method: 'post',
data: data
})
@ -376,7 +394,8 @@ export function crmCustomerPoolQueryPoolFieldAPI(data) {
*/
export function crmCustomerPoolQueryAuthAPI(data) {
return request({
url: 'crm/customer/poolAuthority',
// url: 'crm/customer/poolAuthority',
url: 'crm/customerPool/authority',
method: 'post',
data: data
})
@ -388,7 +407,7 @@ export function crmCustomerPoolQueryAuthAPI(data) {
*/
export function crmCustomerDistributeAPI(data) {
return request({
url: 'crm/customer/distribute',
url: 'crm/customerPool/distribute',
method: 'post',
data: data,
headers: {
@ -403,7 +422,7 @@ export function crmCustomerDistributeAPI(data) {
*/
export function crmCustomerReceiveAPI(data) {
return request({
url: 'crm/customer/receive',
url: 'crm/customerPool/receive',
method: 'post',
data: data,
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) {
return request({
url: 'oaExamineCategory/saveOrUpdateOaExamineSort',
url: 'oa/examine/examineSort',
method: 'post',
data: data,
headers: {

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

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

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

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

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

@ -150,24 +150,24 @@ export default [
permissions: ['manage', 'crm', 'field']
}
},
// {
// path: 'customer',
// component: () => import('@/views/admin/crm/customer'),
// meta: {
// title: '客户公海规则设置',
// requiresAuth: true,
// permissions: ['manage', 'crm', 'pool']
// }
// },
{ // 临时 使用 后期删除
{
path: 'customer',
component: () => import('@/views/admin/crm/customerPool'),
component: () => import('@/views/admin/crm/customer'),
meta: {
title: '客户公海规则设置',
requiresAuth: true,
permissions: ['manage', 'crm', 'pool']
}
},
// { // 临时 使用 后期删除
// path: 'customer',
// component: () => import('@/views/admin/crm/customerPool'),
// meta: {
// title: '客户公海规则设置',
// requiresAuth: true,
// permissions: ['manage', 'crm', 'pool']
// }
// },
{
path: 'print-templates',
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({
permissions: ['manage', 'other_rule', 'setwelcome']

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

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

@ -17,11 +17,11 @@
</div>
<div>
<div class="header-title">公海名称</div>
<div class="header-name">{{ detail.poolName }}</div>
<div class="header-name">{{ detail.pool_name }}</div>
</div>
<span class="customer-num">
客户数量<span class="customer-num__value">{{ detail.customerNum || 0 }}</span>
客户数量<span class="customer-num__value">{{ detail.customer_count || 0 }}</span>
</span>
</flexbox>
<flexbox
@ -31,7 +31,7 @@
<div class="label">公海管理员</div>
<div class="value">
<xr-avatar
v-for="(item, index) in detail.adminUser"
v-for="(item, index) in detail.admin_user_info"
:key="`admin${index}`"
:name="item.realname"
:size="32"
@ -42,13 +42,13 @@
<div class="label">公海成员</div>
<div class="value">
<xr-avatar
v-for="(item, index) in detail.memberUser"
v-for="(item, index) in detail.user_info"
:key="`member${index}`"
:name="item.realname"
:size="32"
:src="item.img || item.thumb_img" />
<xr-avatar
v-for="(item, index) in detail.memberDept"
v-for="(item, index) in detail.department_info"
:title="`dept${index}`"
:key="`dept${index}`"
:name="item.name"
@ -63,25 +63,25 @@
align="stretch"
class="rule-item">
<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
align="stretch"
class="rule-item">
<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
align="stretch"
class="rule-item">
<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
align="stretch"
class="rule-item">
<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">
<detail-recycle-rule
v-for="(item, index) in detail.rule"
@ -121,7 +121,7 @@ export default {
filters: {
fieldNameFilter(list) {
return list.filter(item => {
return item.isHidden === 0
return item.is_hidden === 0
}).map(item => {
return item.name
}).join('')
@ -158,7 +158,7 @@ export default {
getDetail() {
this.loading = true
crmCustomerPoolSetDetailAPI({
poolId: this.id
pool_id: this.id
}).then(res => {
this.detail = res.data
this.loading = false

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

@ -10,9 +10,9 @@
<span class="check-label">选择不进入公海客户</span>
<el-checkbox
v-if="dealHandleShow"
v-model="data.dealHandle"
:true-label="0"
:false-label="1">已成交客户<el-tooltip
v-model="data.deal_handle"
:true-label="1"
:false-label="0">已成交客户<el-tooltip
content="已成交是指客户状态为“已成交”"
effect="dark"
placement="top">
@ -20,12 +20,12 @@
</el-tooltip></el-checkbox>
<el-checkbox
v-if="businessHandleShow"
v-model="data.businessHandle"
:true-label="0"
:false-label="1">有商机客户</el-checkbox>
v-model="data.business_handle"
:true-label="1"
:false-label="0">有商机客户</el-checkbox>
</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
:data="allCustomerData"
border
@ -36,10 +36,10 @@
width="180"/>
<el-table-column
:label="limitDayName"
prop="limitDay">
prop="limit_day">
<template slot-scope="scope">
<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>
</template>
</el-table-column>
@ -47,7 +47,7 @@
</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
:data="levelCustomerData"
border
@ -58,10 +58,10 @@
width="180"/>
<el-table-column
:label="limitDayName"
prop="limitDay">
prop="limit_day">
<template slot-scope="scope">
<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>
</template>
</el-table-column>
@ -86,16 +86,16 @@ export default {
default: () => {
/**
* "type":1, // 1 2 3
"dealHandle":0, // 0 1
"businessHandle":1, // 0 1
"deal_handle":0, // 0 1
"business_handle":1, // 0 1
"level":1, // 1 2 A3 B4 C
"limitDay":30 //
"limit_day":30 //
*/
return {
type: '',
dealHandle: 1,
businessHandle: 1,
customerLevelSetting: null,
deal_handle: 0,
business_handle: 0,
level_conf: null,
level: []
}
}
@ -111,7 +111,7 @@ export default {
return {
allCustomerData: [{
level: '所有客户', // 1 2 A3 B4 C
limitDay: ''
limit_day: ''
}],
levelCustomerData: []
}
@ -149,7 +149,7 @@ export default {
}
},
watch: {
'data.customerLevelSetting': {
'data.level_conf': {
handler(val, oldVal) {
if (val == 1) {
if (this.isEdit && oldVal == null) {
@ -175,14 +175,14 @@ export default {
if (value && value.length) {
this.levelCustomerData = value.map(item => {
const obj = {
limitDay: ''
limit_day: ''
}
obj.level = item
return obj
})
// 2
if (this.data.customerLevelSetting == 2) {
if (this.data.level_conf == 2) {
if (this.isEdit && this.levelCustomerData && this.levelCustomerData.length) {
this.data.level = this.getEditData(this.levelCustomerData, this.data.level)
}
@ -202,7 +202,7 @@ export default {
for (let editIndex = 0; editIndex < editList.length; editIndex++) {
const editItem = editList[editIndex]
if (editItem.level == item.level) {
item.limitDay = editItem.limitDay
item.limit_day = editItem.limit_day
}
}
}
@ -214,7 +214,7 @@ export default {
* 阻挡输入
*/
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">
<el-table-column
show-overflow-tooltip
prop="poolName"
prop="pool_name"
width="150"
label="公海名称"/>
<el-table-column
:formatter="fieldFormatter"
show-overflow-tooltip
prop="adminUser"
prop="admin_user_names"
label="公海管理员"/>
<el-table-column
:formatter="fieldFormatter"
show-overflow-tooltip
prop="memberUser"
prop="user_names"
label="公海成员"/>
<el-table-column
show-overflow-tooltip
prop="customerNum"
prop="customer_count"
width="100"
label="客户数量"/>
<el-table-column
@ -188,7 +188,7 @@ export default {
})
.then(res => {
this.list = res.data.list
this.total = res.data.totalRow
this.total = res.data.count
this.loading = false
})
.catch(() => {
@ -200,34 +200,35 @@ export default {
* 格式化字段
*/
fieldFormatter(row, column) {
if (column.property === 'adminUser') {
const users = row['adminUser'] || []
return users
.map(item => {
return item.realname
})
.join('、')
} else if (column.property === 'memberUser') {
const structures = row['memberDept'] || []
let strName = structures
.map(item => {
return item.name
})
.join('、')
// if (column.property === 'admin_user_names') {
// const users = row['admin_user_names'] || []
// return users
// .map(item => {
// return item.realname
// })
// .join('')
// } else if (column.property === 'user_names') {
// const structures = row['memberDept'] || []
// let strName = structures
// .map(item => {
// return item.name
// })
// .join('')
const users = row['memberUser'] || []
const userName = users
.map(item => {
return item.realname
})
.join('、')
// const users = row['user_names'] || []
// const userName = users
// .map(item => {
// return item.realname
// })
// .join('')
if (strName && userName) {
strName += '、'
}
const name = strName + userName
return name
} else if (column.property === 'status') {
// if (strName && userName) {
// strName += ''
// }
// const name = strName + userName
// return name
// } else
if (column.property === 'status') {
if (row.status === 0) {
return '停用'
}
@ -240,7 +241,7 @@ export default {
* 通过回调控制class
*/
cellClassName({ row, column, rowIndex, columnIndex }) {
if (column.property === 'poolName') {
if (column.property === 'pool_name') {
return 'can-visit--underline'
} else {
return ''
@ -262,8 +263,8 @@ export default {
* 当某一行被点击时会触发该事件
*/
handleRowClick(row, column, event) {
if (column.property === 'poolName') {
this.detailId = row.poolId
if (column.property === 'pool_name') {
this.detailId = row.pool_id
this.detailShow = true
}
},
@ -275,12 +276,12 @@ export default {
if (type === 'edit') {
this.createAction = {
type: 'update',
id: scope.row.poolId,
id: scope.row.pool_id,
data: scope.row
}
this.createShow = true
} else if (type === 'transfer') {
this.detailId = scope.row.poolId
this.detailId = scope.row.pool_id
this.transferShow = true
} else if (type === 'delete') {
this.$confirm('您确定要删除吗?', '提示', {
@ -290,7 +291,7 @@ export default {
})
.then(() => {
crmCustomerPoolSetDeleteAPI({
poolId: scope.row.poolId
pool_id: scope.row.pool_id
})
.then(res => {
this.list.splice(scope.$index, 1)
@ -319,7 +320,7 @@ export default {
)
.then(() => {
crmCustomerPoolSetChangeStatusAPI({
poolId: scope.row.poolId,
pool_id: scope.row.pool_id,
status: scope.row.status === 0 ? 1 : 0
})
.then(res => {

@ -32,7 +32,7 @@
<div
v-for="(item, index) in menuList"
:key="index"
:class="{'is-select' : item.fieldName == menuIndex}"
:class="{'is-select' : item.field == menuIndex}"
class="menu-item"
@click="menuSelect(item, index)">
{{ item.name }}
@ -122,7 +122,7 @@ export default {
getDetail() {
this.loading = true
printTemplateByIdAPI({
templateId: this.$route.query.templateId
id: this.$route.query.templateId
}).then(res => {
const data = res.data || {}
this.content = data.content
@ -178,9 +178,9 @@ export default {
menuSelect(item, index) {
// 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"]')
if (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')
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.dom.add(parentPNode, 'span', this.getSpanNodeAttrsByType(item, '', crmTypeModel.convertTypeToKey(this.type)), `{${item.name}}`)
} else {
@ -244,7 +244,7 @@ export default {
getSpanNodeAttrsByType(item, tag = '', type) {
const attrs = {}
const dataKey = `data-wk${tag ? `-${tag}` : ''}-tag`
const dataValue = `${type}.${item.fieldName}`
const dataValue = `${type}.${item.field}`
attrs[dataKey] = dataValue
attrs.class = `wk-print-tag-wukong ${this.getSpanColorClass()}`
@ -253,7 +253,7 @@ export default {
},
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 data = this.$route.query
const params = {
name: data.templateName,
name: data.name,
type: data.type,
content: this.content
}
if (!this.isCreate) {
params.templateId = data.templateId
params.id = data.templateId
}
request(params)

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

@ -198,7 +198,7 @@ export default {
* 通过回调控制class
*/
cellClassName({ row, column, rowIndex, columnIndex }) {
if (column.property === 'templateName') {
if (column.property === 'name') {
return 'can-visit--underline'
} else {
return ''
@ -209,13 +209,13 @@ export default {
* 当某一行被点击时会触发该事件
*/
handleRowClick(row, column, event) {
if (column.property === 'templateName') {
if (column.property === 'name') {
this.$router.push({
name: 'crmPrintDetail',
query: {
handle: 'detail',
templateName: row.templateName,
templateId: row.templateId,
name: row.name,
templateId: row.id,
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
:class="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>
</div>
</div>
@ -86,13 +86,27 @@
justify="space-between"
class="table-top">
<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
v-if="currentMenuData && currentMenuData.type && currentMenuData.type == 'all'"
class="all-user-reminder"
content="未添加部门和角色的员工无法正常登录系统" />
</div>
<div>
<el-checkbox
v-if="isDepUserShow"
v-model="isNeedChild"
:true-label="1"
:false-label="0"
@change="refreshUserList">包含子部门</el-checkbox>
<el-button
v-if="userSaveAuth"
type="text"
@ -145,14 +159,16 @@
width="55" />
<el-table-column
prop="realname"
width="100"
width="150"
show-overflow-tooltip
label="姓名">
<template slot-scope="scope">
<div class="status-name">
<div :style="{'background-color' : getStatusColor(scope.row.status)}" />
{{ scope.row.realname }}
</div>
<template slot-scope="{ row, column }">
<span class="status-name">
<span :style="{'background-color' : getStatusColor(row.status)}" class="status-mark" />
<span v-if="row.userIdentity === 0" class="main-mark"></span>
<span v-if="row.userIdentity === 1" class="main-mark"></span>
<span>{{ row.realname }}</span>
</span>
</template>
</el-table-column>
<el-table-column
@ -217,6 +233,14 @@
:value="item.id" />
</el-select>
</div>
<flexbox
class="nav-dialog-div">
<label>部门负责人</label>
<wk-user-select
v-model="depOwnerUserId"
radio
/>
</flexbox>
<span
slot="footer"
class="dialog-footer">
@ -402,7 +426,8 @@
<template v-if="item.type == 'select'">
<el-select
v-model="formInline[item.field]"
filterable>
filterable
@change="addUserSelectChange(item)">
<el-option
v-for="optionItem in optionsList[item.field].list"
:key="optionItem.id"
@ -459,6 +484,13 @@
:visible.sync="editRoleDialogShow"
@change="getUserList"
/>
<!-- 重置部门 -->
<edit-dep-dialog
v-if="editDepDialogShow"
:selection-list="selectionList"
:visible.sync="editDepDialogShow"
@change="getUserList"
/>
</div>
</template>
@ -473,7 +505,8 @@ import {
adminUsersUpdatePwdAPI,
adminUsersUsernameEditAPI,
adminUsersManagerUsernameEditAPI,
usersEditStatusAPI
usersEditStatusAPI,
adminUserCountNumOfUserAPI
} from '@/api/admin/employeeDep'
import { userListAPI, depListAPI, listDialogAPI, usersListIndexAPI } from '@/api/common' //
@ -487,6 +520,8 @@ import XrHeader from '@/components/XrHeader'
import Reminder from '@/components/Reminder'
import SlideVerify from '@/components/SlideVerify'
import EditRoleDialog from './components/EditRoleDialog'
import WkUserSelect from '@/components/NewCom/WkUserSelect'
import EditDepDialog from './components/EditDepDialog'
import { chinaMobileRegex, objDeepCopy } from '@/utils'
@ -499,7 +534,9 @@ export default {
XrHeader,
Reminder,
SlideVerify,
EditRoleDialog
EditRoleDialog,
EditDepDialog,
WkUserSelect
},
data() {
return {
@ -507,27 +544,42 @@ export default {
{
icon: 'wk wk-employees',
label: '所有员工',
type: 'all'
type: 'all',
field: 'allUserCount',
count: 0,
tips: '未添加部门和角色的员工无法正常登录系统'
},
{
icon: 'wk wk-new-employee',
label: '新加入的员工',
type: 'new'
type: 'new',
field: 'addNewlyCount',
count: 0,
tips: '入职7天内的员工'
},
{
icon: 'wk wk-active-employee',
label: '激活员工',
type: 'active'
type: 'active',
field: 'activateCount',
count: 0,
tips: '已经登录系统的员工'
},
{
icon: 'wk wk-inactive-employee',
label: '未激活员工',
type: 'inactive'
type: 'inactive',
field: 'inactiveCount',
count: 0,
tips: '未登录过系统的员工'
},
{
icon: 'wk wk-disable-employees',
label: '停用员工',
type: 'disable'
type: 'disable',
field: 'disableCount',
count: 0,
tips: '已禁用的员工,无法登录系统'
}
],
//
@ -536,6 +588,7 @@ export default {
depSelect: '',
//
superDepList: [],
depOwnerUserId: '', //
depCreateLabel: '',
allDepData: [], //
showDepData: [],
@ -569,6 +622,7 @@ export default {
width: '150'
}
],
isNeedChild: 1, // 0 1
selectionList: [], //
tableData: [],
tableHeight: document.documentElement.clientHeight - 240, //
@ -673,7 +727,10 @@ export default {
bulkImportShow: false,
//
editRoleType: '',
editRoleDialogShow: false
editRoleDialogShow: false,
userTotal: 0, // ,
editDepDialogShow: false
}
},
computed: {
@ -787,7 +844,11 @@ export default {
icon: 'wk wk-edit'
})
}
temps.push({
name: '重置部门',
type: 'editDep',
icon: 'wk wk-employees'
})
return temps
},
@ -828,6 +889,12 @@ export default {
*/
canSlideVerify() {
return chinaMobileRegex.test(this.resetUserNameForm.username)
},
/**
* 是查看部门员工
*/
isDepUserShow() {
return this.currentMenuData && this.currentMenuData.structure_id
}
},
mounted() {
@ -841,13 +908,43 @@ export default {
this.currentMenuData = this.employeeMenu[0]
this.getDepTreeList()
this.getUserList()
this.getUserCount()
},
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) {
this.currentMenuData = data
this.userTotal = data.count
// this.structureValue = data.id
this.refreshUserList()
},
@ -857,6 +954,7 @@ export default {
*/
changeUserClick(data) {
// this.structureValue = ''
this.userTotal = data.count
this.currentMenuData = data
this.refreshUserList()
},
@ -879,7 +977,9 @@ export default {
limit: this.pageSize,
search: this.searchInput
}
if (this.isDepUserShow) {
params.isNeedChild = this.isNeedChild
}
if (this.currentMenuData) {
// type
if (this.currentMenuData.type) {
@ -959,7 +1059,10 @@ export default {
structure_id:
this.currentMenuData && this.currentMenuData.id
? this.currentMenuData.id
: ''
: '',
parent_id: this.currentMenuData && this.currentMenuData.owner_user_id
? this.currentMenuData.owner_user_id
: ''
}
this.employeeCreateDialog = true
},
@ -1036,6 +1139,7 @@ export default {
this.depCreateLabelValue = ''
this.depCreateLabel = '新增部门'
this.depCreateTitle = '新增部门'
this.depOwnerUserId = ''
this.depSelect = id
this.getStructuresListBySuperior({ id: id, type: 'save' })
this.depCreateDialog = true
@ -1084,6 +1188,7 @@ export default {
this.depCreateLabelValue = data.label
this.treeEditId = data.id
this.depSelect = data.pid
this.depOwnerUserId = data.owner_user_id
this.depCreateTitle = '编辑部门'
this.depCreateLabel = '编辑部门'
this.getStructuresListBySuperior({ id: data.id, type: 'update' })
@ -1126,7 +1231,7 @@ export default {
//
submitDialog() {
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 => {
this.getDepList() //
this.getDepTreeList()
@ -1137,7 +1242,8 @@ export default {
depEditAPI({
name: this.depCreateLabelValue,
id: this.treeEditId,
pid: this.depSelect
pid: this.depSelect,
owner_user_id: this.depOwnerUserId
}).then(res => {
this.$message.success('操作成功')
this.getDepTreeList()
@ -1309,7 +1415,7 @@ export default {
})
: []
} 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') {
detail.structure_id = this.dialogData.structure_id
} else {
@ -1323,6 +1429,8 @@ export default {
} else if (type === 'editRole' || type === 'copyRole') {
this.editRoleType = type
this.editRoleDialogShow = true
} else if (type === 'editDep') {
this.editDepDialogShow = true
}
},
// --
@ -1692,9 +1800,8 @@ export default {
// .status > span {
// margin-right: 10px;
// }
.status-name {
div {
.status-mark {
display: inline-block;
width: 6px;
height: 6px;
@ -1702,7 +1809,31 @@ export default {
}
color: $xr-color-primary;
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 {
margin-top: 60px !important;
@ -1737,6 +1868,9 @@ export default {
}
.nav-dialog-div {
margin-bottom: 20px;
.wk-user-select {
flex: 1;
}
}
.nav-dialog-div {
.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;"
empty-text=""
default-expand-all>
<!-- <span
<span
slot-scope="{ node }"
: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!='公海管理'"
icon="wk wk-manage"
type="text"
@click="fieldSetClick(node)" >字段授权</el-button></span> -->
@click="fieldSetClick(node)" >字段授权</el-button></span>
</el-tree>
</div>
</div>

@ -16,10 +16,12 @@
<div class="content">
<el-table
id="crm-table"
:data="newList"
ref="tableRef"
:data="list"
:height="tableHeight"
:span-method="objectSpanMethod"
:cell-style="cellStyle"
:cell-class-name="cellClassName"
:summary-method="getSummaries"
show-summary
border
@row-click="handleRowClick">
<el-table-column
@ -31,277 +33,172 @@
header-align="center"
show-overflow-tooltip/>
</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
v-if="showContractview && rowID"
:id="rowID"
class="d-view"
@hide-view="showContractview=false"/>
<customer-detail
v-if="showCustomerView && rowID"
:id="rowID"
class="d-view"
@hide-view="showCustomerView=false"/>
<product-detail
v-if="showProductview && rowID"
:id="rowID"
class="d-view"
@hide-view="showProductview=false"/>
<!-- 预览合同 -->
<report-list
:show.sync="reportListShow"
:title="reportData.title"
:placeholder="reportData.placeholder"
:request="reportData.request"
:params="reportData.params"
crm-type="contract"/>
</div>
</template>
<script>
import { biProductStatisticsAPI, biProductStatisticsExportAPI } from '@/api/bi/bi'
import ContractDetail from '@/views/crm/contract/Detail'
import CustomerDetail from '@/views/crm/customer/Detail'
import ProductDetail from '@/views/crm/product/Detail'
import { crmContractQueryListByProductIdAPI } from '@/api/crm/contract'
import ReportList from '@/views/crm/workbench/components/ReportList'
import BaseMixin from '../mixins/Base'
import { floatAdd } from '@/utils'
export default {
/** 产品销售情况统计 */
name: 'ProductStatistics',
components: {
ContractDetail,
CustomerDetail,
ProductDetail
ReportList
},
mixins: [BaseMixin],
data() {
return {
loading: false,
tableHeight: document.documentElement.clientHeight - 170,
tableHeight: document.documentElement.clientHeight - 220,
currentPage: 1,
pageSize: 15,
pageSizes: [15, 30, 60, 100],
total: 0,
postParams: {}, //
headFieldList: [
{ field: 'category_id_info', name: '产品分类', width: '115px' },
{ field: 'product_name', name: '产品名称', width: '115px' },
{ field: 'contract_num', name: '合同编号', width: '115px' },
{ field: 'owner_user_name', name: '负责人', width: '115px' },
{ field: 'contract_name', name: '客户名称', width: '115px' },
{ field: 'price', name: '销售单价', width: '115px' },
{ field: 'num', name: '数量', width: '115px' },
{ field: 'subtotal', name: '订单产品小计', width: '115px' }
{ field: 'contract_product_sum', name: '合同数', width: '115px' },
{ field: 'product_sum', name: '数量合计', width: '115px' },
{ field: 'contract_money', name: '订单产品小计', width: '115px' }
// { field: 'category_id_info', 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: [],
//
spanList: [],
newList: [],
/** 控制详情展示 */
showContractview: false,
showCustomerView: false,
showProductview: false,
rowID: ''
extraData: {
contract_product_sum: 0,
product_sum: 0,
contract_money: 0
},
reportListShow: false,
reportData: {
title: '',
placeholder: '',
request: null,
params: null
}
}
},
computed: {},
mounted() {
var self = this
/** 控制table的高度 */
window.onresize = function() {
var offsetHei = document.documentElement.clientHeight
self.tableHeight = offsetHei - 170
window.onresize = () => {
const offsetHei = document.documentElement.clientHeight
this.tableHeight = offsetHei - 220
}
},
methods: {
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
var item = this.spanList[rowIndex]
if (columnIndex == 0) {
if (item.rowspan == 0) {
return {
rowspan: 0,
colspan: 0
}
} else {
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
}
}
/**
* 通过回调控制class
*/
cellClassName({ row, column, rowIndex, columnIndex }) {
if (column.property === 'contract_product_sum') {
return 'can-visit--underline'
} else {
return ''
}
},
/** 列表操作 */
//
handleRowClick(row, column, event) {
if (column.property === 'contract_name') {
if (this.showProductview) {
this.showProductview = false
}
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
}
/**
* 更改每页展示数量
*/
handleSizeChange(val) {
this.pageSize = val
this.getProductDatalist()
},
/**
* 更改当前页数
*/
handleCurrentChange(val) {
this.currentPage = val
this.getProductDatalist()
},
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) {
return { backgroundColor: '#FFF3E8', borderRight: '0 none', fontWeight: 'bold' }
} else if (columnIndex === 1 || columnIndex === 2 || columnIndex === 4) {
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) {
this.postParams = params
if (params) {
this.postParams = params
}
this.loading = true
biProductStatisticsAPI(params)
biProductStatisticsAPI({
...this.postParams,
page: this.currentPage,
limit: this.pageSize
})
.then(res => {
if (res.data && res.data.length > 0) {
this.list = res.data
this.handleShowInfo()
} else {
this.list = []
this.spanList = []
this.newList = []
}
const resData = res.data || {}
this.list = resData.list || []
this.extraData = resData.total || { extraData: 0,
product_sum: 0,
contract_money: 0 }
this.total = resData.count
this.loading = false
})
.catch(() => {
this.loading = false
})
},
/** 处理展示数据 */
handleShowInfo() {
//
//
//
/**
* rowspan 数量
*
*/
var newList = []
var spanList = []
var seriesIndex = 0 // span
var productIndex = 0
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
/**
* 合计
*/
getSummaries(param) {
this.$nextTick(() => {
this.$refs.tableRef.doLayout()
})
return ['合计', '', this.extraData.contract_product_sum, this.extraData.product_sum, this.extraData.contract_money]
},
/**
* 导出点击
*/
@ -377,5 +274,6 @@ export default {
tr td:first-child[rowspan='1'], tr td:nth-child(2)[rowspan='1'] {
border-right: 0 none !important;
}
overflow:visible !important;
}
</style>

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

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

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

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

@ -127,7 +127,7 @@ export default {
},
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' })
}
if (this.crm[this.crmType] && this.crm[this.crmType].excelexport) {

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

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

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

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

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

@ -54,8 +54,8 @@ export default {
nopermission: false,
list: [],
fieldList: [
{ prop: 'createTime', label: '打印时间', width: '115px' },
{ prop: 'templateName', label: '打印模板', width: '115px' }
{ prop: 'create_time', label: '打印时间', width: '115px' },
{ prop: 'template_name', label: '打印模板', width: '115px' }
],
tableHeight: '450px'
}
@ -90,7 +90,7 @@ export default {
.then(res => {
this.nopermission = false
this.loading = false
this.list = res.data
this.list = res.data.list
})
.catch(res => {
if (res.code == 102) {
@ -101,7 +101,7 @@ export default {
},
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')
}
}

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

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

@ -12,9 +12,9 @@
<el-select v-model="selectId" >
<el-option
v-for="item in list"
:key="item.poolId"
:label="item.poolName"
:value="item.poolId"/>
:key="item.pool_id"
:label="item.pool_name"
:value="item.pool_id"/>
</el-select>
</flexbox>
</div>
@ -31,7 +31,8 @@
<script>
import {
crmCustomerPutInPoolAPI
crmCustomerPutInPoolAPI,
crmCustomerPoolNameListAPI
} from '@/api/crm/customer'
import { Loading } from 'element-ui'
@ -69,7 +70,7 @@ export default {
watch: {
list: {
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
},
@ -86,20 +87,20 @@ export default {
* 获取数据源
*/
getList() {
// const loading = Loading.service({
// target: document.querySelector(`.el-dialog[aria-label=""]`)
// })
const loading = Loading.service({
target: document.querySelector(`.el-dialog[aria-label="放入公海"]`)
})
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()
// .then(res => {
// this.list = res.data || []
// loading && loading.close()
// })
// .catch(() => {
// loading && loading.close()
// })
crmCustomerPoolNameListAPI()
.then(res => {
this.list = res.data || []
loading && loading.close()
})
.catch(() => {
loading && loading.close()
})
},
/**
@ -118,8 +119,8 @@ export default {
target: document.querySelector(`.el-dialog[aria-label="放入公海"]`)
})
crmCustomerPutInPoolAPI({
customer_id: this.selectionList.map(item => item.customer_id)
// poolId: this.selectId
customer_id: this.selectionList.map(item => item.customer_id),
pool_id: this.selectId
})
.then(res => {
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.fileCount), name: 'RelativeFiles' })
tempsTabs.push({ label: '操作记录', name: 'RelativeHandle' })
// if (this.crm.contract && this.crm.contract.print) {
// tempsTabs.push({ label: '', name: 'RelativePrint' })
// }
if (this.crm.contract && this.crm.contract.print) {
tempsTabs.push({ label: '打印记录', name: 'RelativePrint' })
}
return tempsTabs
},

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

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

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

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

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

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

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

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

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

@ -148,7 +148,7 @@ export default {
this.formData = {
title: this.action.data.title,
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>
</flexbox>
<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>

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

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

@ -39,6 +39,19 @@
:label="item.label"
:value="item.value" />
</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>
<div
@ -90,7 +103,16 @@
</template>
<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 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 crmTypeModel from '@/views/crm/model/crmTypeModel'
import { downloadExcelWithResData } from '@/utils'
import { mapGetters } from 'vuex'
export default {
//
name: 'FollowIndex',
@ -182,10 +205,27 @@ export default {
seciton: 0,
index: 0
},
logEditDialogVisible: false
logEditDialogVisible: false,
requestParams: {}
}
},
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() {
return this.loading || this.noMore
@ -205,7 +245,18 @@ export default {
},
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: {
/**
* 中间tabs改变
@ -234,7 +285,7 @@ export default {
limit: 15,
isUser: 1,
queryType: 0,
label: 2
label: 0
}
if (this.timeSelect.type) {
@ -249,11 +300,12 @@ export default {
if (this.userSelectShow) {
params = { ...params, ...this.filterForm }
} else {
// params.label = this.filterForm.crmType
params.label = this.filterForm.crmType
params.subUser = this.filterForm.subUser
params.dataType = this.filterForm.queryType
params.search = this.filterForm.search
}
this.requestParams = params
crmIndexGetRecordListAPI(params)
.then(res => {
this.loading = false
@ -332,7 +384,53 @@ export default {
if (this.logEditPosition.index >= 0) {
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>

Loading…
Cancel
Save