Merge pull request '提交' (#6) from dev-zcx into master
Reviewed-on: http://114.55.169.15:3000/qiushanhe/dm-manage-web/pulls/6
This commit was merged in pull request #6.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 对嘛管理系统
|
||||
VUE_APP_TITLE = 若依管理系统
|
||||
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
@@ -5,4 +5,4 @@ VUE_APP_TITLE = 对嘛管理系统
|
||||
ENV = 'production'
|
||||
|
||||
# 对嘛管理系统/生产环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
VUE_APP_BASE_API = '/duima'
|
||||
|
||||
@@ -14,7 +14,7 @@ module.exports = {
|
||||
// 添加全局变量
|
||||
globals: {
|
||||
uni: 'readonly',
|
||||
wx: 'readonly'
|
||||
wx: 'readonly',
|
||||
},
|
||||
extends: ['plugin:vue/recommended', 'eslint:recommended'], // 使用的默认的规则集
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "river",
|
||||
"version": "1.0.0",
|
||||
"description": "对嘛管理系统",
|
||||
"description": "若依管理系统",
|
||||
"author": "对嘛",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
@@ -88,5 +88,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/loading/index.js"></script>
|
||||
</body>
|
||||
<script type="text/javascript">
|
||||
window._AMapSecurityConfig = {
|
||||
securityJsCode:'420463f2f8c849ab78b9d29548aff7d3',
|
||||
}
|
||||
</script>
|
||||
<script src="https://webapi.amap.com/maps?v=1.4.15&key=ec6b7ebe38f7ff27126f7088d87a9091&plugin=AMap.Autocomplete,AMap.PlaceSearch,AMap.Geocoder,AMap.Scale"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
44
src/api/sch/file.js
Normal file
44
src/api/sch/file.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询文件列表
|
||||
export function listFile(query) {
|
||||
return request({
|
||||
url: '/sch/file/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询文件详细
|
||||
export function getFile(fileId) {
|
||||
return request({
|
||||
url: '/sch/file/' + fileId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增文件
|
||||
export function addFile(data) {
|
||||
return request({
|
||||
url: '/sch/file',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改文件
|
||||
export function updateFile(data) {
|
||||
return request({
|
||||
url: '/sch/file',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除文件
|
||||
export function delFile(fileId) {
|
||||
return request({
|
||||
url: '/sch/file/' + fileId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
44
src/api/sch/rules.js
Normal file
44
src/api/sch/rules.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询规章制度列表
|
||||
export function listRules(query) {
|
||||
return request({
|
||||
url: '/sch/rules/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询规章制度详细
|
||||
export function getRules(ruleId) {
|
||||
return request({
|
||||
url: '/sch/rules/' + ruleId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增规章制度
|
||||
export function addRules(data) {
|
||||
return request({
|
||||
url: '/sch/rules',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改规章制度
|
||||
export function updateRules(data) {
|
||||
return request({
|
||||
url: '/sch/rules',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除规章制度
|
||||
export function delRules(ruleId) {
|
||||
return request({
|
||||
url: '/sch/rules/' + ruleId,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -9,6 +9,15 @@ export function getClueList(query) {
|
||||
});
|
||||
}
|
||||
|
||||
// 查询线索列表
|
||||
export function getClueInfo(id) {
|
||||
return request({
|
||||
url: '/zs/clue/' + id,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 新增线索
|
||||
export function addClue(data) {
|
||||
return request({
|
||||
@@ -39,8 +48,8 @@ export function deleteClue(data) {
|
||||
export function exportData(query) {
|
||||
return request({
|
||||
url: '/zs/clue/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,12 +9,20 @@ export function getSignList(query) {
|
||||
});
|
||||
}
|
||||
|
||||
// 查询线索列表
|
||||
export function getSign(id) {
|
||||
return request({
|
||||
url: '/zs/sign/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 导出
|
||||
export function exportData(query) {
|
||||
return request({
|
||||
url: '/zs/sign/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
method: 'post',
|
||||
data: query
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
BIN
src/assets/images/place/position_black.png
Normal file
BIN
src/assets/images/place/position_black.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 903 B |
BIN
src/assets/images/place/position_blue.png
Normal file
BIN
src/assets/images/place/position_blue.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 958 B |
BIN
src/assets/images/place/position_green.png
Normal file
BIN
src/assets/images/place/position_green.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 926 B |
BIN
src/assets/images/place/position_purple.png
Normal file
BIN
src/assets/images/place/position_purple.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 926 B |
BIN
src/assets/images/place/position_red.png
Normal file
BIN
src/assets/images/place/position_red.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 950 B |
BIN
src/assets/images/place/position_yellow.png
Normal file
BIN
src/assets/images/place/position_yellow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 970 B |
@@ -233,3 +233,8 @@ aside {
|
||||
padding: 15px 20px 0 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.amap-sug-result {
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '对嘛管理系统',
|
||||
title: '若依管理系统',
|
||||
logo: logoImg
|
||||
};
|
||||
},
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
import router from './router';
|
||||
import store from './store';
|
||||
import { Message } from 'element-ui';
|
||||
import {
|
||||
Message
|
||||
} from 'element-ui';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { isRelogin } from '@/utils/request';
|
||||
import {
|
||||
getToken
|
||||
} from '@/utils/auth';
|
||||
import {
|
||||
isRelogin
|
||||
} from '@/utils/request';
|
||||
|
||||
NProgress.configure({ showSpinner: false });
|
||||
NProgress.configure({
|
||||
showSpinner: false
|
||||
});
|
||||
|
||||
const whiteList = ['/login', '/auth-redirect', '/bind', '/register'];
|
||||
|
||||
@@ -16,7 +24,9 @@ router.beforeEach((to, from, next) => {
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title);
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' });
|
||||
next({
|
||||
path: '/'
|
||||
});
|
||||
NProgress.done();
|
||||
} else {
|
||||
if (store.getters.roles.length === 0) {
|
||||
@@ -24,18 +34,25 @@ router.beforeEach((to, from, next) => {
|
||||
// 判断当前用户是否已拉取完user_info信息
|
||||
store
|
||||
.dispatch('GetInfo')
|
||||
.then(() => {
|
||||
.then((resp) => {
|
||||
isRelogin.show = false;
|
||||
localStorage.setItem('admin', resp.user.admin);
|
||||
localStorage.setItem('userId', resp.user.userId);
|
||||
store.dispatch('GenerateRoutes').then((accessRoutes) => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes); // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
|
||||
next({
|
||||
...to,
|
||||
replace: true
|
||||
}); // hack方法 确保addRoutes已完成
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
Message.error(err);
|
||||
next({ path: '/' });
|
||||
next({
|
||||
path: '/'
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -29,17 +29,14 @@ import Layout from '@/layout';
|
||||
*/
|
||||
|
||||
// 公共路由
|
||||
export const constantRoutes = [
|
||||
{
|
||||
export const constantRoutes = [{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: () => import('@/views/redirect')
|
||||
}
|
||||
]
|
||||
children: [{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: () => import('@/views/redirect')
|
||||
}]
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
@@ -65,18 +62,16 @@ export const constantRoutes = [
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: 'index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: {
|
||||
title: '首页',
|
||||
icon: 'dashboard',
|
||||
affix: true
|
||||
}
|
||||
children: [{
|
||||
path: 'index',
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: {
|
||||
title: '首页',
|
||||
icon: 'dashboard',
|
||||
affix: true
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
// {
|
||||
// path: '/demo',
|
||||
@@ -111,89 +106,93 @@ export const constantRoutes = [
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
{
|
||||
path: 'profile',
|
||||
component: () => import('@/views/system/user/profile/index'),
|
||||
name: 'Profile',
|
||||
meta: {
|
||||
title: '个人中心',
|
||||
icon: 'user'
|
||||
}
|
||||
children: [{
|
||||
path: 'profile',
|
||||
component: () => import('@/views/system/user/profile/index'),
|
||||
name: 'Profile',
|
||||
meta: {
|
||||
title: '个人中心',
|
||||
icon: 'user'
|
||||
}
|
||||
]
|
||||
}]
|
||||
}
|
||||
];
|
||||
|
||||
// 动态路由,基于用户权限动态去加载
|
||||
export const dynamicRoutes = [
|
||||
{
|
||||
export const dynamicRoutes = [{
|
||||
path: '/system/user-auth',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:user:edit'],
|
||||
children: [
|
||||
{
|
||||
path: 'role/:userId(\\d+)',
|
||||
component: () => import('@/views/system/user/authRole'),
|
||||
name: 'AuthRole',
|
||||
meta: {
|
||||
title: '分配角色',
|
||||
activeMenu: '/system/user'
|
||||
}
|
||||
children: [{
|
||||
path: 'role/:userId(\\d+)',
|
||||
component: () => import('@/views/system/user/authRole'),
|
||||
name: 'AuthRole',
|
||||
meta: {
|
||||
title: '分配角色',
|
||||
activeMenu: '/system/user'
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
path: '/system/role-auth',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:role:edit'],
|
||||
children: [
|
||||
{
|
||||
path: 'user/:roleId(\\d+)',
|
||||
component: () => import('@/views/system/role/authUser'),
|
||||
name: 'AuthUser',
|
||||
meta: {
|
||||
title: '分配用户',
|
||||
activeMenu: '/system/role'
|
||||
}
|
||||
children: [{
|
||||
path: 'user/:roleId(\\d+)',
|
||||
component: () => import('@/views/system/role/authUser'),
|
||||
name: 'AuthUser',
|
||||
meta: {
|
||||
title: '分配用户',
|
||||
activeMenu: '/system/role'
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
path: '/system/dict-data',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:dict:list'],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:dictId(\\d+)',
|
||||
component: () => import('@/views/system/dict/data'),
|
||||
name: 'Data',
|
||||
meta: {
|
||||
title: '字典数据',
|
||||
activeMenu: '/system/dict'
|
||||
}
|
||||
children: [{
|
||||
path: 'index/:dictId(\\d+)',
|
||||
component: () => import('@/views/system/dict/data'),
|
||||
name: 'Data',
|
||||
meta: {
|
||||
title: '字典数据',
|
||||
activeMenu: '/system/dict'
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
path: '/monitor/job-log',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['monitor:job:list'],
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/monitor/job/log'),
|
||||
name: 'JobLog',
|
||||
meta: {
|
||||
title: '调度日志',
|
||||
activeMenu: '/monitor/job'
|
||||
}
|
||||
children: [{
|
||||
path: 'index',
|
||||
component: () => import('@/views/monitor/job/log'),
|
||||
name: 'JobLog',
|
||||
meta: {
|
||||
title: '调度日志',
|
||||
activeMenu: '/monitor/job'
|
||||
}
|
||||
]
|
||||
}]
|
||||
},
|
||||
{
|
||||
path: '/zs/clue-form',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['zs:clue:add', 'zs:clue:edit'],
|
||||
children: [{
|
||||
path: 'index/:clueId(\\d+)',
|
||||
component: () => import('@/views/zs/clue/ClueForm'),
|
||||
name: 'ClueForm',
|
||||
meta: {
|
||||
title: '线索详情',
|
||||
activeMenu: '/zs/clue'
|
||||
}
|
||||
}]
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
import axios from 'axios';
|
||||
import { Notification, MessageBox, Message, Loading } from 'element-ui';
|
||||
import {
|
||||
Notification,
|
||||
MessageBox,
|
||||
Message,
|
||||
Loading
|
||||
} from 'element-ui';
|
||||
import store from '@/store';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import {
|
||||
getToken
|
||||
} from '@/utils/auth';
|
||||
import errorCode from '@/utils/errorCode';
|
||||
import { tansParams, blobValidate } from '@/utils/ruoyi';
|
||||
import {
|
||||
tansParams,
|
||||
blobValidate
|
||||
} from '@/utils/ruoyi';
|
||||
import cache from '@/plugins/cache';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { successCode } from '@/global/global';
|
||||
import {
|
||||
saveAs
|
||||
} from 'file-saver';
|
||||
import {
|
||||
successCode
|
||||
} from '@/global/global';
|
||||
|
||||
let downloadLoadingInstance;
|
||||
// 是否显示重新登录
|
||||
export const isRelogin = { show: false };
|
||||
export const isRelogin = {
|
||||
show: false
|
||||
};
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
|
||||
// 创建axios实例
|
||||
@@ -31,6 +47,11 @@ service.interceptors.request.use(
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
if (config.url.includes("http")) {
|
||||
config.baseURL = "";
|
||||
} else if (config.url.includes("amap")) {
|
||||
config.baseURL = "";
|
||||
}
|
||||
// get请求映射params参数
|
||||
if (config.method === 'get' && config.params) {
|
||||
let url = config.url + '?' + tansParams(config.params);
|
||||
@@ -84,10 +105,10 @@ service.interceptors.response.use(
|
||||
if (!isRelogin.show) {
|
||||
isRelogin.show = true;
|
||||
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
confirmButtonText: '重新登录',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
isRelogin.show = false;
|
||||
store.dispatch('LogOut').then(() => {
|
||||
@@ -116,7 +137,9 @@ service.interceptors.response.use(
|
||||
},
|
||||
(error) => {
|
||||
console.log('err' + error);
|
||||
let { message } = error;
|
||||
let {
|
||||
message
|
||||
} = error;
|
||||
if (message === 'Network Error') {
|
||||
message = '后端接口连接异常';
|
||||
} else if (message.includes('timeout')) {
|
||||
@@ -147,7 +170,9 @@ export function download(url, params, filename, config) {
|
||||
return tansParams(params);
|
||||
}
|
||||
],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
responseType: 'blob',
|
||||
...config
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<h3 class="title">对嘛管理系统</h3>
|
||||
<h3 class="title">若依管理系统</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
this.$store
|
||||
.dispatch('Login', this.loginForm)
|
||||
.then(() => {
|
||||
this.$router.push({ path: this.redirect || '/' }).catch(() => {});
|
||||
this.$router.push({ path: this.redirect || '/' }).catch(() => { });
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false;
|
||||
|
||||
234
src/views/sch/file/index.vue
Normal file
234
src/views/sch/file/index.vue
Normal file
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="组织id" prop="deptId">
|
||||
<el-input v-model="queryParams.deptId" placeholder="请输入组织id" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名" prop="fileName">
|
||||
<el-input v-model="queryParams.fileName" placeholder="请输入文件名" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件路径" prop="fileUrl">
|
||||
<el-input v-model="queryParams.fileUrl" placeholder="请输入文件路径" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上传时间" prop="uploadTime">
|
||||
<el-date-picker clearable v-model="queryParams.uploadTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择上传时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传人员" prop="uploadUser">
|
||||
<el-input v-model="queryParams.uploadUser" placeholder="请输入上传人员" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:file:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:file:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:file:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:file:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="fileList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="fileId" />
|
||||
<el-table-column label="组织id" align="center" prop="deptId" />
|
||||
<el-table-column label="文件名" align="center" prop="fileName" />
|
||||
<el-table-column label="文件路径" align="center" prop="fileUrl" />
|
||||
<el-table-column label="上传时间" align="center" prop="uploadTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.uploadTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="上传人员" align="center" prop="uploadUser" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:file:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:file:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改文件对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="组织id" prop="deptId">
|
||||
<el-input v-model="form.deptId" placeholder="请输入组织id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件名" prop="fileName">
|
||||
<el-input v-model="form.fileName" placeholder="请输入文件名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件路径" prop="fileUrl">
|
||||
<el-input v-model="form.fileUrl" placeholder="请输入文件路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上传时间" prop="uploadTime">
|
||||
<el-date-picker clearable v-model="form.uploadTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择上传时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传人员" prop="uploadUser">
|
||||
<el-input v-model="form.uploadUser" placeholder="请输入上传人员" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listFile, getFile, delFile, addFile, updateFile } from "@/api/sch/file";
|
||||
|
||||
export default {
|
||||
name: "File",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 文件表格数据
|
||||
fileList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deptId: null,
|
||||
fileName: null,
|
||||
fileUrl: null,
|
||||
uploadTime: null,
|
||||
uploadUser: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询文件列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFile(this.queryParams).then(response => {
|
||||
this.fileList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
fileId: null,
|
||||
deptId: null,
|
||||
fileName: null,
|
||||
fileUrl: null,
|
||||
uploadTime: null,
|
||||
uploadUser: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.fileId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加文件";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const fileId = row.fileId || this.ids
|
||||
getFile(fileId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改文件";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.fileId != null) {
|
||||
updateFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const fileIds = row.fileId || this.ids;
|
||||
this.$modal.confirm('是否确认删除文件编号为"' + fileIds + '"的数据项?').then(function () {
|
||||
return delFile(fileIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/file/export', {
|
||||
...this.queryParams
|
||||
}, `file_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -280,7 +280,7 @@ export default {
|
||||
},
|
||||
// 导入地图
|
||||
importMap() {
|
||||
const url = 'https://webapi.amap.com/maps?v=1.4.15&key=124646b0e6076de9d801400f833ac986&callback=onLoad';
|
||||
const url = 'https://webapi.amap.com/maps?v=1.4.15&key=f2f35d6adc4a16bb879d303cead56237&callback=onLoad';
|
||||
var jsapi = document.createElement('script');
|
||||
jsapi.charset = 'utf-8';
|
||||
jsapi.src = url;
|
||||
236
src/views/sch/rules/index.vue
Normal file
236
src/views/sch/rules/index.vue
Normal file
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="制度名" prop="ruleName">
|
||||
<el-input v-model="queryParams.ruleName" placeholder="请输入制度名" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实施时间" prop="implementTime">
|
||||
<el-date-picker clearable v-model="queryParams.implementTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择实施时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="到期时间" prop="dueTime">
|
||||
<el-date-picker clearable v-model="queryParams.dueTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择到期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:rules:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:rules:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:rules:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:rules:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="rulesList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="ruleId" />
|
||||
<el-table-column label="制度名" align="center" prop="ruleName" />
|
||||
<el-table-column label="实施时间" align="center" prop="implementTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.implementTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="到期时间" align="center" prop="dueTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.dueTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="制度内容" align="center" prop="ruleContent" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:rules:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:rules:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改规章制度对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="制度名" prop="ruleName">
|
||||
<el-input v-model="form.ruleName" placeholder="请输入制度名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="实施时间" prop="implementTime">
|
||||
<el-date-picker clearable v-model="form.implementTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择实施时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="到期时间" prop="dueTime">
|
||||
<el-date-picker clearable v-model="form.dueTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择到期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="制度内容">
|
||||
<editor v-model="form.ruleContent" :min-height="192" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否删除" prop="delFlag">
|
||||
<el-input v-model="form.delFlag" placeholder="请输入是否删除" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listRules, getRules, delRules, addRules, updateRules } from "@/api/sch/rules";
|
||||
|
||||
export default {
|
||||
name: "Rules",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 规章制度表格数据
|
||||
rulesList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
ruleName: null,
|
||||
implementTime: null,
|
||||
dueTime: null,
|
||||
ruleContent: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询规章制度列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listRules(this.queryParams).then(response => {
|
||||
this.rulesList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
ruleId: null,
|
||||
ruleName: null,
|
||||
implementTime: null,
|
||||
dueTime: null,
|
||||
ruleContent: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
delFlag: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.ruleId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加规章制度";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const ruleId = row.ruleId || this.ids
|
||||
getRules(ruleId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改规章制度";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.ruleId != null) {
|
||||
updateRules(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addRules(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ruleIds = row.ruleId || this.ids;
|
||||
this.$modal.confirm('是否确认删除规章制度编号为"' + ruleIds + '"的数据项?').then(function () {
|
||||
return delRules(ruleIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/rules/export', {
|
||||
...this.queryParams
|
||||
}, `rules_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -115,7 +115,7 @@ export default {
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
}
|
||||
}
|
||||
};
|
||||
42
src/views/zs/clue/ClueForm/components/ClassTypeDialog.vue
Normal file
42
src/views/zs/clue/ClueForm/components/ClassTypeDialog.vue
Normal file
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<el-dialog width="40%" :title="title" :visible.sync="visible" append-to-body @close="visible = false">
|
||||
<div v-if="classTypeList == undefined || classTypeList.length == 0">无班型数据</div>
|
||||
<el-table v-else :data="classTypeList" style="height: 300px; overflow-y: auto">
|
||||
<el-table-column label="班型" width="140">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.licenseType }}-{{ scope.row.typeName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="currentPrice" label="报价" width="120" />
|
||||
<el-table-column property="minPrice" label="底价" width="120" />
|
||||
<el-table-column property="description" label="描述" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getClassTypeTableList } from '@/api/sch/classType'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
classTypeList: [],
|
||||
visible: false,
|
||||
title: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async init(info) {
|
||||
this.title = info.schoolName + '-' + info.name + '-班型报价';
|
||||
const resp = await getClassTypeTableList({
|
||||
schoolId: info.schoolId,
|
||||
placeId: info.placeId,
|
||||
status: '0'
|
||||
});
|
||||
if (resp.code == 200) {
|
||||
this.classTypeList = resp.rows
|
||||
}
|
||||
this.visible = true
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
36
src/views/zs/clue/ClueForm/components/FollowRecord.vue
Normal file
36
src/views/zs/clue/ClueForm/components/FollowRecord.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-timeline v-if="folowInfos != undefined && folowInfos.length > 0" style="max-height: 200px; overflow-y: auto">
|
||||
<el-timeline-item v-for="item in folowInfos" :key="item.record" :timestamp="item.operateTime" placement="top" style="padding: 5px !important">
|
||||
<el-card>
|
||||
<div style="font-weight: bold">用户 {{ item.operateUserName }}</div>
|
||||
<div style="padding-left: 10px" v-html="item.centent" />
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getFollowRecord } from '@/api/zs/clue';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
clueId: {
|
||||
type: Number,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
folowInfos: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 加载跟进记录
|
||||
getFollowRecord({ clueId: this.clueId }).then((resp) => {
|
||||
this.folowInfos = resp.data;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
170
src/views/zs/clue/ClueForm/components/MapDialog.vue
Normal file
170
src/views/zs/clue/ClueForm/components/MapDialog.vue
Normal file
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<el-dialog width="800px" title="地图编辑" :visible.sync="visible" append-to-body @close="closeDialog">
|
||||
<div id="dialogMap" class="dialog-map" style="height: 400px; width: 100%;" />
|
||||
<el-input id="search" v-model="searchBody" class="search-body" placeholder="请输入..." />
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleMapSave">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import AMap from 'AMap';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogMap: null,
|
||||
visible: false,
|
||||
placeSearch: null,
|
||||
currentPoint: undefined,
|
||||
marker: null,
|
||||
searchBody: undefined
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
console.log("mapdialog----beforeDestroy")
|
||||
this.marker = null;
|
||||
this.placeSearch = null;
|
||||
|
||||
this.dialogMap && this.dialogMap.destroy();
|
||||
this.dialogMap = null;
|
||||
},
|
||||
mounted() {
|
||||
console.log("mounted")
|
||||
// this.initData()
|
||||
},
|
||||
created() {
|
||||
console.log("created")
|
||||
},
|
||||
methods: {
|
||||
initData(point = undefined) {
|
||||
console.log(point)
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.resetData();
|
||||
if (point) {
|
||||
this.currentPoint = point;
|
||||
}
|
||||
this.initMap()
|
||||
});
|
||||
},
|
||||
resetData() {
|
||||
this.currentPoint = undefined;
|
||||
this.dialogMap && this.marker && this.dialogMap.remove(this.marker);
|
||||
this.marker = null;
|
||||
this.placeSearch = null;
|
||||
this.searchBody = null
|
||||
},
|
||||
initMap() {
|
||||
console.log("初始化地图")
|
||||
if (!this.dialogMap) {
|
||||
this.dialogMap = new AMap.Map('dialogMap', {
|
||||
zoom: 12,
|
||||
resizeEnable: true,
|
||||
center: [117.283042, 31.86119]
|
||||
});
|
||||
this.dialogMap.on('click', ev => {
|
||||
this.currentPoint.lat = ev.lnglat.lat;
|
||||
this.currentPoint.lng = ev.lnglat.lng;
|
||||
this.regeoCode();
|
||||
this.marker && this.dialogMap.remove(this.marker);
|
||||
this.marker = new AMap.Marker({
|
||||
position: [this.currentPoint.lng, this.currentPoint.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.dialogMap.add(this.marker);
|
||||
});
|
||||
this.dialogMap.addControl(new AMap.Scale());
|
||||
const auto = new AMap.Autocomplete({
|
||||
input: 'search', // 前端搜索框
|
||||
})
|
||||
this.placeSearch = new AMap.PlaceSearch({
|
||||
map: this.dialogMap,
|
||||
pageSize: 10, // 单页显示结果条数
|
||||
pageIndex: 1, // 页码
|
||||
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
|
||||
})
|
||||
AMap.event.addListener(auto, 'select', this.select)
|
||||
this.geocoder = new AMap.Geocoder();
|
||||
}
|
||||
|
||||
this.initMapCenter();
|
||||
|
||||
},
|
||||
// 初始化编辑地图的中心点
|
||||
initMapCenter() {
|
||||
if (this.currentPoint && this.currentPoint.lat && this.currentPoint.lng) {
|
||||
this.searchBody = this.currentPoint.address;
|
||||
this.marker = new AMap.Marker({
|
||||
map: this.dialogMap,
|
||||
position: [this.currentPoint.lng, this.currentPoint.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.dialogMap.setCenter([this.currentPoint.lng, this.currentPoint.lat]);
|
||||
this.dialogMap.setZoom(14);
|
||||
}
|
||||
},
|
||||
// 选择查询结果
|
||||
select(e) {
|
||||
this.placeSearch.setCity(e.poi.adcode);
|
||||
this.placeSearch.search(e.poi.name, (status, result) => {
|
||||
// 搜索成功时,result即是对应的匹配数据
|
||||
if (result && result.info && result.info === 'OK' && result.poiList && result.poiList.pois && result.poiList.pois.length > 0) {
|
||||
this.currentPoint.lat = result.poiList.pois[0].location.lat;
|
||||
this.currentPoint.lng = result.poiList.pois[0].location.lng;
|
||||
this.currentPoint.address = e.poi.name;
|
||||
this.dialogMap.clearMap();
|
||||
this.marker && this.dialogMap.remove(this.marker);
|
||||
this.marker = new AMap.Marker({
|
||||
map: this.dialogMap,
|
||||
position: [this.currentPoint.lng, this.currentPoint.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.dialogMap.setZoom(14);
|
||||
this.dialogMap.setCenter([this.currentPoint.lng, this.currentPoint.lat]);
|
||||
}
|
||||
});
|
||||
},
|
||||
//定位地址
|
||||
regeoCode() {
|
||||
this.geocoder.getAddress(
|
||||
[this.currentPoint.lng, this.currentPoint.lat],
|
||||
(status, result) => {
|
||||
if (status === 'complete' && result.regeocode) {
|
||||
this.currentPoint.address = result.regeocode.formattedAddress;
|
||||
this.searchBody = result.regeocode.formattedAddress;
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
handleMapSave() {
|
||||
if (this.currentPoint.lat && this.currentPoint.lng) {
|
||||
//通知父组件
|
||||
this.$emit("handleMapDialogPoint", this.currentPoint);
|
||||
this.visible = false;
|
||||
this.$emit('update:mapDialogVisible', false);
|
||||
|
||||
} else {
|
||||
this.$message.error('请在地图上选择位置后保存!');
|
||||
}
|
||||
},
|
||||
closeDialog() {
|
||||
this.$emit('update:mapDialogVisible', false);
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog-map {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
}
|
||||
.search-body {
|
||||
position: absolute;
|
||||
top: 90px;
|
||||
left: 25px;
|
||||
width: 350px;
|
||||
}
|
||||
</style>
|
||||
232
src/views/zs/clue/ClueForm/components/PlaceMap.vue
Normal file
232
src/views/zs/clue/ClueForm/components/PlaceMap.vue
Normal file
@@ -0,0 +1,232 @@
|
||||
<template >
|
||||
<div>
|
||||
<el-form>
|
||||
<el-form-item label="显示场地">
|
||||
<el-radio-group v-model="mapPlaceType" @change="createMarkersInMap">
|
||||
<el-radio :label="0">自营场地</el-radio>
|
||||
<el-radio :label="1">全部场地</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div id="map" style="height: 600px; width: 100%;"></div>
|
||||
<el-collapse class="box-card">
|
||||
<el-collapse-item title="附近驾校">
|
||||
<div style="padding: 10px">
|
||||
<div slot="header">附近驾校</div>
|
||||
<div v-if="nearbySchoolSearching">正在搜索中...</div>
|
||||
<template v-else>
|
||||
<div v-for="p in nearbySchoolList" :key="p.index">
|
||||
<div class="hover-pointer" style="font-size: 14px; color: blue" @click="getClassType(p)">
|
||||
<i v-if="p.recommend" class="el-icon-star-off" />
|
||||
驾校: {{ p.deptName }}-{{ p.name }}
|
||||
</div>
|
||||
<div class="mt5">地址:{{ p.address }}</div>
|
||||
<div class="mt5">
|
||||
直线距离: {{ p.distance }} 公里;
|
||||
<span class="ml0">步行距离:{{ p.walkdistance }}</span>
|
||||
</div>
|
||||
<el-divider style="margin: 6px 0 !important;" />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
|
||||
<ClassTypeDialog v-if="classVisible" ref="classTypeDialog" :dialog-visible="classVisible" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import AMap from 'AMap';
|
||||
import ClassTypeDialog from './ClassTypeDialog.vue';
|
||||
|
||||
export default {
|
||||
name: 'PlaceMap',
|
||||
components: {
|
||||
ClassTypeDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mapPlaceType: 0,
|
||||
nearbySchoolSearching: true,
|
||||
nearbySchoolList: [],
|
||||
amap: null,
|
||||
locationMarker: null,
|
||||
geocoder: null,
|
||||
placeList: [],
|
||||
classVisible: false,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initMap();
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
console.log("placemap----beforeDestroy")
|
||||
this.geocoder = null;
|
||||
this.locationMarker = null;
|
||||
this.amap && this.amap.clearMap();
|
||||
this.amap && this.amap.destroy();
|
||||
this.amap = null;
|
||||
},
|
||||
methods: {
|
||||
// 初始化地图
|
||||
initMap() {
|
||||
if (!this.amap) {
|
||||
this.amap = new AMap.Map('map', {
|
||||
zoom: 12,
|
||||
center: [117.226095, 31.814372],
|
||||
resizeEnable: true
|
||||
});
|
||||
// 地图坐标点定位
|
||||
|
||||
// this.getAllPlaces();
|
||||
|
||||
// this.createMarkersInMap()
|
||||
}
|
||||
},
|
||||
setMapCenter(info) {
|
||||
if (info.lat && info.lng) {
|
||||
this.locationMarker && this.amap.remove(this.locationMarker);
|
||||
this.locationMarker = new AMap.Marker({
|
||||
position: [info.lng, info.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.amap.add(this.locationMarker);
|
||||
this.amap.setCenter([info.lng, info.lat]);
|
||||
this.amap.setZoom(14);
|
||||
|
||||
this.getNearbySchool(info);
|
||||
}
|
||||
},
|
||||
//获取附近驾校
|
||||
getNearbySchool(info) {
|
||||
if (info.lng && info.lat) {
|
||||
this.nearbySchoolList = [];
|
||||
this.nearbySchoolSearching = true;
|
||||
// 推荐的场地
|
||||
let places1 = [];
|
||||
// 普通的场地
|
||||
let places2 = [];
|
||||
|
||||
const p2 = [info.lng, info.lat];
|
||||
for (let i = 0; i < this.placeList.length; i++) {
|
||||
const element = this.placeList[i];
|
||||
const p1 = [element.lng, element.lat];
|
||||
// 计算直线距离
|
||||
element.distance = (window.AMap.GeometryUtil.distance(p1, p2) / 1000).toFixed(2);
|
||||
element.recommend ? places1.push(element) : places2.push(element);
|
||||
}
|
||||
// 按直线距离排序
|
||||
// 排序
|
||||
if (places1.length > 1) {
|
||||
places1 = places1.sort((a, b) => a.distance - b.distance);
|
||||
}
|
||||
// 排序
|
||||
if (places2.length > 1) {
|
||||
places2 = places2.sort((a, b) => a.distance - b.distance);
|
||||
}
|
||||
// 取普通场地和推荐场地,组合, 取四个
|
||||
this.nearbySchoolList = [];
|
||||
for (let i = 0; i < 4; i++) {
|
||||
places1.length > i && this.nearbySchoolList.push(places1[i]);
|
||||
places2.length > i && this.nearbySchoolList.push(places2[i]);
|
||||
if (this.nearbySchoolList.length === 4) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 计算步行距离
|
||||
this.nearbySchoolList.map(async (item) => {
|
||||
const p1 = [item.lng, item.lat];
|
||||
const resp = await this.getWalkingDistance(p1, p2);
|
||||
item.walkdistance = resp;
|
||||
this.$forceUpdate();
|
||||
});
|
||||
this.nearbySchoolSearching = false;
|
||||
}
|
||||
},
|
||||
// 获取两点之间的步行距离
|
||||
async getWalkingDistance(start, end) {
|
||||
return new Promise((resolve, reject) => {
|
||||
window.AMap.plugin('AMap.Walking', () => {
|
||||
const walking = new AMap.Walking();
|
||||
let num = 0;
|
||||
walking.search(start, end, (status, result) => {
|
||||
if (status === 'complete') {
|
||||
result.routes.forEach((item) => {
|
||||
num += item.distance;
|
||||
});
|
||||
resolve(
|
||||
num > 1000 ? `${(num / 1000).toFixed(2)} 公里` : `${num} 米`
|
||||
);
|
||||
} else {
|
||||
resolve('步行数据无法确定');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
handleMarkers(places) {
|
||||
this.placeList = places;
|
||||
this.createMarkersInMap();
|
||||
},
|
||||
//创建地图点标记
|
||||
createMarkersInMap() {
|
||||
let arr = this.placeList;
|
||||
if (this.mapPlaceType === 0) {
|
||||
arr = arr.filter((item) => item.recommend);
|
||||
}
|
||||
this.amap && this.amap.clearMap();
|
||||
this.locationMarker && this.amap.add(this.locationMarker);
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
const element = arr[i];
|
||||
const tmpMarker = new AMap.Marker({
|
||||
map: this.amap,
|
||||
position: [element.lng, element.lat],
|
||||
label: {
|
||||
content: element.name,
|
||||
direction: 'left'
|
||||
},
|
||||
icon: require(`@/assets/images/place/position_${element.flagColor}.png`),
|
||||
extData: element,
|
||||
clickable: true
|
||||
});
|
||||
tmpMarker.on('click', (ev) => this.getClassType(ev.target.getExtData()));
|
||||
}
|
||||
},
|
||||
// 查询该场地下的班型报价
|
||||
getClassType(item) {
|
||||
console.log(item)
|
||||
// this.classType = [];
|
||||
// getClassTypes({
|
||||
// schoolId: item.deptId,
|
||||
// placeId: item.placeId,
|
||||
// status: '0'
|
||||
// }).then((resp) => {
|
||||
// if (resp && resp.code === 200 && resp.data) {
|
||||
// this.classType = resp.data;
|
||||
// this.innerVisible = true;
|
||||
// }
|
||||
// });
|
||||
this.classVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.classTypeDialog.init(item);
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 45px;
|
||||
width: 400px;
|
||||
}
|
||||
::v-deep .el-divider--horizontal {
|
||||
margin: 6px 0 !important;
|
||||
}
|
||||
</style>
|
||||
328
src/views/zs/clue/ClueForm/index.vue
Normal file
328
src/views/zs/clue/ClueForm/index.vue
Normal file
@@ -0,0 +1,328 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <el-card class="box-card"> -->
|
||||
<div slot="header" class="clearfix">
|
||||
<div style="display: inline-block;">
|
||||
<div v-if="clueForm.consultCount && clueForm.consultCount < 2">
|
||||
学员信息
|
||||
<span v-if="clueForm.name">-【{{ clueForm.name }}】</span>
|
||||
</div>
|
||||
<el-popover v-else placement="top-start" trigger="hover">
|
||||
<el-table :data="consultRecord">
|
||||
<el-table-column width="120" prop="consultTime" label="咨询日期" />
|
||||
<el-table-column width="100" prop="consultUserName" label="咨询人" />
|
||||
</el-table>
|
||||
<el-badge slot="reference" :value="clueForm.consultCount">
|
||||
<span>
|
||||
学员信息
|
||||
<span v-if="clueForm.name">-【{{ clueForm.name }}】</span>
|
||||
</span>
|
||||
</el-badge>
|
||||
</el-popover>
|
||||
</div>
|
||||
<div style="float: right;">
|
||||
<div style="display: inline-block;margin-right: 5px;">
|
||||
<template v-if="saveNextShow">
|
||||
<el-checkbox v-model="saveNext" />
|
||||
<span class="ml5">保存后继续创建下一条</span>
|
||||
</template>
|
||||
</div>
|
||||
<!-- :disabled="!canSubmit" -->
|
||||
<el-button class="footer_button" type="primary" @click="clueSubmit">确 定</el-button>
|
||||
<el-button class="footer_button" @click="toBackClue">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-divider />
|
||||
<div>
|
||||
<el-form ref="clueForm" :model="clueForm" :rules="rules" label-width="110px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker style="width: 100%;" v-model="clueForm.createTime" value-format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm" type="datetime" :disabled="admin!='true'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="线索来源" prop="source">
|
||||
<el-select style="width: 100%;" v-model="clueForm.source" placeholder="请选择" clearable>
|
||||
<el-option v-for="dict in sourceOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="clueForm.name" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input v-model="clueForm.phone" placeholder="请输入联系方式" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="跟进人员" prop="followUser">
|
||||
<el-select style="width: 100%;" v-model="clueForm.followUser" multiple clearable :disabled="admin != 'true' && clueForm.clueId != undefined">
|
||||
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="意向状态" prop="intentionState">
|
||||
<el-select style="width: 100%;" v-model="clueForm.intentionState" placeholder="请选择" clearable>
|
||||
<el-option v-for="dict in intentionOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue">
|
||||
<i class="el-icon-star-on" :style="dict.cssClass" />
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">
|
||||
{{ dict.dictValue }}
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="下次跟进时间" prop="followTime">
|
||||
<el-date-picker style="width: 100%;" v-model="clueForm.followTime" value-format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm" type="datetime" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="是否近期看场地" prop="recentLook">
|
||||
<el-radio v-model="clueForm.recentLook" label="是">是</el-radio>
|
||||
<el-radio v-model="clueForm.recentLook" label="否">否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="clueMemo">
|
||||
<el-input v-model="clueForm.clueMemo" type="textarea" :rows="5" maxlength="1000" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 跟进记录 -->
|
||||
<el-col :span="24" style="margin-top: 20px;">
|
||||
<el-form-item label="跟进记录" prop="clueMemo" label-position="top">
|
||||
<FollowRecord v-if="clueId" :clueId="clueId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<div>
|
||||
<el-col :span="24" class="mb20 plr20" style="position: relative">
|
||||
<PlaceMap ref="placeMap" :placeList="placeList" />
|
||||
<div class="address">
|
||||
<el-form-item label="位置" prop="address" label-width="80px">
|
||||
<el-input v-model="clueForm.address" placeholder="请输入位置" disabled>
|
||||
<el-button slot="append" class="p10" icon="el-icon-location-information" @click="handleMapDialog" />
|
||||
<el-button slot="append" class="p10" icon="el-icon-delete-solid" @click="handleRemovePosition" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<!-- </el-card> -->
|
||||
|
||||
<MapDialog v-if="mapDialogVisible" ref="mapDialog" :dialog-visible="mapDialogVisible" @handleMapDialogPoint="handleMapDialogPoint" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getClueInfo, getConsultRecord, addClue, updateClue, } from '@/api/zs/clue'
|
||||
import empApi from '@/api/system/employee'
|
||||
import { getAllPlaces } from '@/api/sch/place'
|
||||
|
||||
import PlaceMap from './components/PlaceMap.vue';
|
||||
import FollowRecord from './components/FollowRecord.vue';
|
||||
import MapDialog from './components/MapDialog.vue';
|
||||
|
||||
export default {
|
||||
name: 'ClueForm',
|
||||
components: {
|
||||
PlaceMap, FollowRecord, MapDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
admin: localStorage.getItem('admin'),
|
||||
userId: localStorage.getItem('userId'),
|
||||
clueId: undefined,
|
||||
clueForm: {},
|
||||
rules: {
|
||||
name: { required: true, message: '姓名不为空', trigger: 'blur' },
|
||||
phone: { required: true, message: '联系方式不为空', trigger: 'blur' },
|
||||
createTime: { required: true, message: '创建时间不为空', trigger: 'blur,change' },
|
||||
consultTime: { required: true, message: '咨询时间不为空', trigger: 'blur,change' },
|
||||
source: { required: true, message: '线索来源不为空', trigger: 'blur,change' },
|
||||
address: { required: true, message: '位置不为空', trigger: 'blur' },
|
||||
intentionState: { required: true, message: '意向状态不为空', trigger: 'blur,change' }
|
||||
},
|
||||
userOptions: [],//跟进人员
|
||||
sourceOptions: [],//线索来源
|
||||
intentionOptions: [],//意向状态
|
||||
placeList: [],//场地信息
|
||||
mapDialogVisible: false,
|
||||
consultRecord: [],
|
||||
canSubmit: true,
|
||||
saveNextShow: true,
|
||||
saveNext: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//获取clueId
|
||||
this.clueId = Number(this.$route.params.clueId)
|
||||
this.getAllPlaces()
|
||||
this.getClueInfo(this.clueId);
|
||||
// 线索来源
|
||||
this.getDicts('dm_source').then((response) => {
|
||||
this.sourceOptions = response.data;
|
||||
});
|
||||
// 意向状态
|
||||
this.getDicts('dm_intention_state').then((response) => {
|
||||
this.intentionOptions = response.data;
|
||||
});
|
||||
this.getEmployee();
|
||||
},
|
||||
|
||||
methods: {
|
||||
async getClueInfo(clueId) {
|
||||
this.resetForm();
|
||||
if (clueId === 0)
|
||||
return
|
||||
this.saveNextShow = false
|
||||
this.saveNext = false
|
||||
const resp = await getClueInfo(clueId);
|
||||
if (resp.code == 200) {
|
||||
this.clueForm = resp.data
|
||||
this.handleMapCenter(this.clueForm);
|
||||
this.getConsultRecord(this.clueForm.clueId);
|
||||
}
|
||||
},
|
||||
resetForm() {
|
||||
this.clueForm = {
|
||||
clueId: undefined,
|
||||
createTime: this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}'),
|
||||
consultTime: undefined,
|
||||
source: undefined,
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
address: undefined,
|
||||
intentionState: undefined,
|
||||
followInfo: undefined,
|
||||
followTime: undefined,
|
||||
followUser: undefined,
|
||||
signupInfo: undefined,
|
||||
requirement: undefined,
|
||||
licenseType: undefined,
|
||||
lng: undefined,
|
||||
lat: undefined
|
||||
}
|
||||
},
|
||||
// 查询咨询记录
|
||||
getConsultRecord(clueId) {
|
||||
getConsultRecord({ clueId }).then((resp) => {
|
||||
if (resp && resp.code === 200 && resp.data) {
|
||||
this.consultRecord = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
//地图编辑弹框
|
||||
handleMapDialog() {
|
||||
this.mapDialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.mapDialog.initData(this.clueForm);
|
||||
});
|
||||
},
|
||||
//处理地图弹框返回的点
|
||||
handleMapDialogPoint(point) {
|
||||
console.log("handleMapDialogPoint")
|
||||
console.log(point)
|
||||
if (point) {
|
||||
this.handleMapCenter(point);
|
||||
}
|
||||
},
|
||||
//删除当前地址
|
||||
handleRemovePosition() {
|
||||
this.clueForm.lng = undefined;
|
||||
this.clueForm.lat = undefined;
|
||||
this.clueForm.address = undefined;
|
||||
},
|
||||
//定位地图的中心点
|
||||
handleMapCenter(info) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.placeMap.setMapCenter(info);
|
||||
});
|
||||
},
|
||||
// 查询不能接收线索的员工
|
||||
getEmployee() {
|
||||
empApi.getEmployee().then((resp) => {
|
||||
if (resp.code === 200) {
|
||||
this.userOptions = resp.data;
|
||||
// this.userOptions = this.userOptions.filter((item) => {
|
||||
// return item.accept;
|
||||
// });
|
||||
}
|
||||
});
|
||||
},
|
||||
// 查询场地信息
|
||||
async getAllPlaces() {
|
||||
const resp = await getAllPlaces();
|
||||
if (resp.code == 200) {
|
||||
this.placeList = resp.data.filter((item) => item.showInMap);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.placeMap.handleMarkers(this.placeList);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
//表单提交
|
||||
clueSubmit() {
|
||||
this.$refs.clueForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.canSubmit = false
|
||||
let resp
|
||||
if (this.clueForm.clueId) {
|
||||
resp = await updateClue(this.clueForm)
|
||||
this.canSubmit = true
|
||||
if (resp.code === 200) {
|
||||
this.$message.success('修改成功')
|
||||
this.toBackClue();
|
||||
}
|
||||
} else {
|
||||
resp = await addClue(this.clueForm)
|
||||
this.canSubmit = false
|
||||
if (resp.code === 200) {
|
||||
this.$message.success('新增成功')
|
||||
if (this.saveNext) {
|
||||
this.resetForm()
|
||||
} else {
|
||||
this.toBackClue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
toBackClue() {
|
||||
const obj = { path: "/zs/clue" };
|
||||
this.$tab.closeOpenPage(obj);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.address {
|
||||
position: absolute;
|
||||
left: 30px;
|
||||
top: 40px;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
::v-deep .el-divider--horizontal {
|
||||
margin: 10px 0 !important;
|
||||
}
|
||||
</style>
|
||||
104
src/views/zs/clue/columns.js
Normal file
104
src/views/zs/clue/columns.js
Normal file
@@ -0,0 +1,104 @@
|
||||
export const defaultColumns = [{
|
||||
key: 0,
|
||||
prop: 'createTime',
|
||||
label: '创建时间',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 1,
|
||||
prop: 'source',
|
||||
label: '线索来源',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
prop: 'name',
|
||||
label: '姓名',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
prop: 'phone',
|
||||
label: '联系方式',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
prop: 'address',
|
||||
label: '位置',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 5,
|
||||
prop: 'requirement',
|
||||
label: '学员诉求',
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 6,
|
||||
prop: 'licenseType',
|
||||
label: '咨询车型',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 7,
|
||||
prop: 'followTime',
|
||||
label: '下次跟进时间',
|
||||
width: 120,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 8,
|
||||
prop: 'firstFollowUserName',
|
||||
label: '首次跟进人员',
|
||||
width: 120,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 9,
|
||||
prop: 'followUserName',
|
||||
label: '跟进人员',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 10,
|
||||
prop: 'recentLook',
|
||||
label: '是否近期看场地',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 11,
|
||||
prop: 'offlineReceiverName',
|
||||
label: '线下接待人员',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 12,
|
||||
prop: 'clueMemo',
|
||||
label: '备注',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: true
|
||||
}
|
||||
];
|
||||
90
src/views/zs/clue/components/BatchUpdateDialog.vue
Normal file
90
src/views/zs/clue/components/BatchUpdateDialog.vue
Normal file
@@ -0,0 +1,90 @@
|
||||
<template>
|
||||
<el-dialog title="批量修改" :close-on-click-modal="false" append-to-body :visible.sync="visible" width="600px" @close="closeDialog">
|
||||
<el-form ref="dialogForm" :model="dialogForm" :rules="rules" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="跟进人员" prop="followUsers">
|
||||
<el-select v-model="dialogForm.followUsers" multiple placeholder="请选择" clearable>
|
||||
<el-option v-for="dict in options.userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button plain @click="(visible=false)">取消</el-button>
|
||||
<el-button v-jclick type="primary" :disabled="!canSubmit" @click="dialogFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { batchUpdate } from '@/api/zs/clue'; export default {
|
||||
name: 'BatchUpdateDialog',
|
||||
props: {
|
||||
options: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
userOptions: []
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
canSubmit: true,
|
||||
dialogForm: {},
|
||||
rules: {
|
||||
followUsers: {
|
||||
required: true,
|
||||
message: '跟进人员不能为空',
|
||||
trigger: 'blur'
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(info = undefined) {
|
||||
// debugger
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.resetDialogForm();
|
||||
this.$refs['dialogForm'].resetFields();
|
||||
if (info) {
|
||||
this.dialogForm = this.deepClone(info);
|
||||
}
|
||||
});
|
||||
},
|
||||
resetDialogForm() {
|
||||
this.dialogForm = {
|
||||
followUsers: [],
|
||||
clueIds: this.clueIds
|
||||
};
|
||||
},
|
||||
closeDialog() {
|
||||
this.$emit('update:dialog.batchUpdateVisible', false);
|
||||
},
|
||||
// 表单提交
|
||||
dialogFormSubmit() {
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.canSubmit = false;
|
||||
// 校验完成,调接口
|
||||
batchUpdate(this.dialogForm)
|
||||
.then((resp) => {
|
||||
this.canSubmit = true;
|
||||
if (resp.code == 200) {
|
||||
this.$message.success('修改成功');
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.canSubmit = true;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
635
src/views/zs/clue/components/ClueFormDialog.vue
Normal file
635
src/views/zs/clue/components/ClueFormDialog.vue
Normal file
@@ -0,0 +1,635 @@
|
||||
|
||||
<template>
|
||||
<div style="margin-bottom: 50px">
|
||||
<el-dialog title="学员信息导入" :close-on-click-modal="false" append-to-body :visible.sync="visible" width="400px" @close="closeDialog">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker v-model="form.createTime" value-format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm" type="datetime" :disabled="admin != 'true'" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="线索来源" prop="source">
|
||||
<el-select v-model="form.source" placeholder="请选择" clearable>
|
||||
<el-option v-for="dict in options.sourceOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="跟进人员" prop="followUser">
|
||||
<el-select v-model="form.followUser" multiple clearable :disabled="admin != 'true' && form.clueId != undefined">
|
||||
<el-option v-for="dict in options.userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系方式" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系方式" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="意向状态" prop="intentionState">
|
||||
<el-select v-model="form.intentionState" placeholder="请选择" clearable>
|
||||
<el-option v-for="dict in options.intentionOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue">
|
||||
<i class="el-icon-star-on" :style="dict.cssClass" />
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">
|
||||
{{ dict.dictValue }}
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="下次跟进时间" prop="followTime">
|
||||
<el-date-picker v-model="form.followTime" value-format="yyyy-MM-dd HH:mm" format="yyyy-MM-dd HH:mm" type="datetime" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否近期看场地" prop="recentLook">
|
||||
<el-radio v-model="form.recentLook" label="是">是</el-radio>
|
||||
<el-radio v-model="form.recentLook" label="否">否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="显示场地">
|
||||
<el-radio-group v-model="mapPlaceType" @change="createMarkersInMap">
|
||||
<el-radio :label="0">自营场地</el-radio>
|
||||
<el-radio :label="1">全部场地</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="clueMemo">
|
||||
<el-input v-model="form.clueMemo" type="textarea" :rows="2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20 plr20" style="position: relative">
|
||||
<div id="map" class="amap-cavans" />
|
||||
<el-collapse class="box-card">
|
||||
<el-collapse-item title="附近驾校">
|
||||
<div style="padding: 10px">
|
||||
<div slot="header">附近驾校</div>
|
||||
<div v-if="nearbySchoolSearching">正在搜索中...</div>
|
||||
<template v-else>
|
||||
<div v-for="p in nearbySchoolList" :key="p.index">
|
||||
<div class="hover-pointer" style="font-size: 14px; color: blue" @click="getClassType(p)">
|
||||
<i v-if="p.recommend" class="el-icon-star-off" />
|
||||
驾校: {{ p.deptName }}-{{ p.name }}
|
||||
</div>
|
||||
<div class="mt5">地址:{{ p.address }}</div>
|
||||
<div class="mt5">
|
||||
直线距离: {{ p.distance }} 公里;
|
||||
<span class="ml0">步行距离:{{ p.walkdistance }}</span>
|
||||
</div>
|
||||
<el-divider />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<div class="address">
|
||||
<el-form-item label="位置" prop="address" label-width="80px">
|
||||
<el-input v-model="form.address" placeholder="请输入位置" disabled>
|
||||
<el-button slot="append" class="p10" icon="el-icon-location-information" @click="handleMapEdit" />
|
||||
<el-button slot="append" class="p10" icon="el-icon-delete-solid" @click="handleRemovePosition" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-bottom: 20px">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="跟进情况">
|
||||
<el-timeline v-if="folowInfos != undefined && folowInfos.length > 0" style="max-height: 200px; overflow-y: auto">
|
||||
<el-timeline-item v-for="item in folowInfos" :key="item.record" :timestamp="item.operateTime" placement="top" style="padding: 5px !important">
|
||||
<el-card>
|
||||
<div style="font-weight: bold">用户 {{ item.operateUserName }}</div>
|
||||
<div style="padding-left: 10px" v-html="item.centent" />
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog width="800px" title="地图编辑" :visible.sync="mapDialogShow" append-to-body @opened="initDialogMap()">
|
||||
<div id="dialogMap" class="dialog-map" />
|
||||
<!-- <el-input id="search" v-model="searchBody" class="search-body" placeholder="请输入..." /> -->
|
||||
<el-autocomplete v-model="searchBody" popper-class="my-autocomplete" class="search-body" placeholder="请输入..." :trigger-on-focus="false" :fetch-suggestions="querySearch" @select="handleSelect">
|
||||
<template slot-scope="{ item }">
|
||||
<span class="name">{{ item.name }}</span>
|
||||
<span class="addr">{{ item.district }}</span>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="mapDialogShow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleMapSave">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog width="40%" :title="innerTitle" :visible.sync="innerVisible" append-to-body>
|
||||
<div v-if="classType == undefined || classType.length == 0">无班型数据</div>
|
||||
<el-table v-else :data="classType" style="height: 300px; overflow-y: auto">
|
||||
<el-table-column label="班型">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.licenseType }}-{{ scope.row.dictLabel }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="currentPrice" label="报价" />
|
||||
<el-table-column property="minPrice" label="底价" />
|
||||
<el-table-column property="description" label="描述" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<!-- eslint-disable no-undef -->
|
||||
<script>
|
||||
import { getFollowRecord } from '@/api/zs/clue';
|
||||
import { getClassTypes } from '@/api/tool/common';
|
||||
import { inputtips, regeo, walking } from '@/api/tool/map';
|
||||
// import AMap from 'AMap';
|
||||
export default {
|
||||
model: {
|
||||
prop: 'info',
|
||||
event: 'update'
|
||||
},
|
||||
props: {
|
||||
info: {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
userOptions: [],
|
||||
sourceOptions: [],
|
||||
intentionOptions: [],
|
||||
placeInfo: []
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
admin: localStorage.getItem('admin'),
|
||||
userId: localStorage.getItem('userId'),
|
||||
form: JSON.parse(JSON.stringify(this.info)),
|
||||
mapDialogShow: false,
|
||||
map: null,
|
||||
locationMarker: null,
|
||||
dialogMap: null, // 弹窗地图(打点用)
|
||||
currentPoint: {}, // 地图弹窗经纬度信息
|
||||
marker: null, // 地图打点
|
||||
placeSearch: null,
|
||||
geocoder: null,
|
||||
searchBody: '',
|
||||
nearbySchoolList: [],
|
||||
folowInfos: [],
|
||||
nearbySchoolSearching: false, // 搜索附近场地
|
||||
rules: {
|
||||
name: {
|
||||
required: true,
|
||||
message: '姓名不为空',
|
||||
trigger: 'blur'
|
||||
},
|
||||
phone: {
|
||||
required: true,
|
||||
message: '联系方式不为空',
|
||||
trigger: 'blur'
|
||||
},
|
||||
createTime: {
|
||||
required: true,
|
||||
message: '创建时间不为空',
|
||||
trigger: 'blur,change'
|
||||
},
|
||||
consultTime: {
|
||||
required: true,
|
||||
message: '咨询时间不为空',
|
||||
trigger: 'blur,change'
|
||||
},
|
||||
source: {
|
||||
required: true,
|
||||
message: '线索来源不为空',
|
||||
trigger: 'blur,change'
|
||||
},
|
||||
address: {
|
||||
required: true,
|
||||
message: '位置不为空',
|
||||
trigger: 'blur'
|
||||
},
|
||||
intentionState: {
|
||||
required: true,
|
||||
message: '意向状态不为空',
|
||||
trigger: 'blur,change'
|
||||
}
|
||||
},
|
||||
innerTitle: '',
|
||||
classType: [],
|
||||
innerVisible: false,
|
||||
consultRecord: [],
|
||||
mapPlaceType: 0 // 地图上展示的场地类型 0:自营 1 全部
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
form: {
|
||||
handler(val) {
|
||||
this.$emit('update', val);
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.form.clueId) {
|
||||
this.handleUpdate();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initMap();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.geocoder = null;
|
||||
this.locationMarker = null;
|
||||
this.marker = null;
|
||||
this.placeSearch = null;
|
||||
|
||||
this.map.clearMap();
|
||||
this.map && this.map.destroy();
|
||||
this.map = null;
|
||||
|
||||
this.dialogMap && this.dialogMap.destroy();
|
||||
this.dialogMap = null;
|
||||
},
|
||||
methods: {
|
||||
// 查询该场地下的班型报价
|
||||
getClassType(item) {
|
||||
this.classType = [];
|
||||
this.innerTitle = item.deptName + '-' + item.name + '-班型报价';
|
||||
getClassTypes({
|
||||
schoolId: item.deptId,
|
||||
placeId: item.placeId,
|
||||
status: '0'
|
||||
}).then((resp) => {
|
||||
if (resp && resp.code === 200 && resp.data) {
|
||||
this.classType = resp.data;
|
||||
this.innerVisible = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 编辑
|
||||
handleUpdate() {
|
||||
// 加载跟进记录
|
||||
getFollowRecord({ clueId: this.form.clueId }).then((resp) => {
|
||||
this.folowInfos = resp.data;
|
||||
});
|
||||
},
|
||||
initMap() {
|
||||
if (!this.map) {
|
||||
this.map = new AMap.Map('map', {
|
||||
zoom: 12,
|
||||
center: [117.226095, 31.814372],
|
||||
resizeEnable: true
|
||||
});
|
||||
}
|
||||
|
||||
// 地图坐标点定位
|
||||
if (this.form.lat && this.form.lng) {
|
||||
this.locationMarker = new AMap.Marker({
|
||||
position: [this.form.lng, this.form.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.map.add(this.locationMarker);
|
||||
this.map.setCenter([this.form.lng, this.form.lat]);
|
||||
this.map.setZoom(14);
|
||||
}
|
||||
this.getNearbySchool();
|
||||
this.createMarkersInMap();
|
||||
},
|
||||
// 生成markers
|
||||
createMarkersInMap() {
|
||||
let arr = this.options.placeInfo;
|
||||
if (this.mapPlaceType === 0) {
|
||||
arr = arr.filter((item) => item.recommend);
|
||||
}
|
||||
this.map && this.map.clearMap();
|
||||
this.locationMarker && this.map.add(this.locationMarker);
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
const element = arr[i];
|
||||
const tmpMarker = new AMap.Marker({
|
||||
map: this.map,
|
||||
position: [element.lng, element.lat],
|
||||
label: {
|
||||
content: element.name,
|
||||
direction: 'left'
|
||||
},
|
||||
icon: require(`@/assets/images/position_${element.flagColor}.png`),
|
||||
extData: element,
|
||||
clickable: true
|
||||
});
|
||||
tmpMarker.on('click', (ev) => this.getClassType(ev.target.getExtData()));
|
||||
}
|
||||
},
|
||||
handleMapEdit() {
|
||||
this.searchBody = '';
|
||||
this.mapDialogShow = true;
|
||||
if (this.form.lat && this.form.lng) {
|
||||
this.currentPoint.lat = this.form.lat;
|
||||
this.currentPoint.lng = this.form.lng;
|
||||
}
|
||||
this.dialogMap && this.dialogMap.clearMap();
|
||||
},
|
||||
handleRemovePosition() {
|
||||
this.form.lng = undefined;
|
||||
this.form.lat = undefined;
|
||||
this.form.address = undefined;
|
||||
},
|
||||
initDialogMap() {
|
||||
if (!this.dialogMap) {
|
||||
this.dialogMap = new AMap.Map('dialogMap', {
|
||||
zoom: 12,
|
||||
resizeEnable: true,
|
||||
center: [117.283042, 31.86119]
|
||||
});
|
||||
this.dialogMap.on('click', (ev) => {
|
||||
this.currentPoint.lat = ev.lnglat.lat;
|
||||
this.currentPoint.lng = ev.lnglat.lng;
|
||||
this.regeoCode();
|
||||
this.marker && this.dialogMap.remove(this.marker);
|
||||
this.marker = new AMap.Marker({
|
||||
position: [this.currentPoint.lng, this.currentPoint.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.dialogMap.add(this.marker);
|
||||
});
|
||||
this.dialogMap.addControl(new AMap.Scale());
|
||||
// const auto = new AMap.Autocomplete({
|
||||
// input: 'search', // 前端搜索框
|
||||
// })
|
||||
// this.placeSearch = new AMap.PlaceSearch({
|
||||
// map: this.dialogMap,
|
||||
// pageSize: 1, // 单页显示结果条数
|
||||
// pageIndex: 1, // 页码
|
||||
// autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
|
||||
// })
|
||||
// AMap.event.addListener(auto, 'select', this.select)
|
||||
this.geocoder = new AMap.Geocoder();
|
||||
}
|
||||
// 初始化编辑地图的中心点
|
||||
if (this.form.lat && this.form.lng) {
|
||||
this.searchBody = this.form.address;
|
||||
this.marker = new AMap.Marker({
|
||||
map: this.dialogMap,
|
||||
position: [this.form.lng, this.form.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.dialogMap.setCenter([this.form.lng, this.form.lat]);
|
||||
this.dialogMap.setZoom(14);
|
||||
}
|
||||
},
|
||||
handleMapSave() {
|
||||
if (this.currentPoint.lat && this.currentPoint.lng) {
|
||||
this.form.lng = this.currentPoint.lng;
|
||||
this.form.lat = this.currentPoint.lat;
|
||||
this.$set(this.form, 'address', this.currentPoint.address);
|
||||
this.locationMarker && this.map.remove(this.locationMarker);
|
||||
this.locationMarker = new AMap.Marker({
|
||||
map: this.map,
|
||||
position: [this.currentPoint.lng, this.currentPoint.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.map.setCenter([this.currentPoint.lng, this.currentPoint.lat]);
|
||||
this.map.setZoom(14);
|
||||
this.getNearbySchool();
|
||||
this.mapDialogShow = false;
|
||||
} else {
|
||||
this.$message.error('请在地图上选择位置后保存!');
|
||||
}
|
||||
},
|
||||
// 选择查询结果
|
||||
select(e) {
|
||||
this.placeSearch.setCity(e.poi.adcode);
|
||||
this.placeSearch.search(e.poi.name, (status, result) => {
|
||||
// 搜索成功时,result即是对应的匹配数据
|
||||
if (result && result.info && result.info === 'OK' && result.poiList && result.poiList.pois && result.poiList.pois.length > 0) {
|
||||
this.currentPoint.lat = result.poiList.pois[0].location.lat;
|
||||
this.currentPoint.lng = result.poiList.pois[0].location.lng;
|
||||
this.currentPoint.address = e.poi.name;
|
||||
this.dialogMap.clearMap();
|
||||
this.marker && this.dialogMap.remove(this.marker);
|
||||
this.marker = new AMap.Marker({
|
||||
map: this.dialogMap,
|
||||
position: [this.currentPoint.lng, this.currentPoint.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.dialogMap.setZoom(14);
|
||||
this.dialogMap.setCenter([this.currentPoint.lng, this.currentPoint.lat]);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 经纬度 -> 地址
|
||||
regeoCode() {
|
||||
// this.geocoder.getAddress(
|
||||
// [this.currentPoint.lng, this.currentPoint.lat],
|
||||
// (status, result) => {
|
||||
// if (status === 'complete' && result.regeocode) {
|
||||
// this.currentPoint.address = result.regeocode.formattedAddress;
|
||||
// this.searchBody = result.regeocode.formattedAddress;
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
if (this.currentPoint.lng && this.currentPoint.lat) {
|
||||
regeo({
|
||||
key: 'f2f35d6adc4a16bb879d303cead56237',
|
||||
location: this.currentPoint.lng + ',' + this.currentPoint.lat
|
||||
}).then((resp) => {
|
||||
if (resp.status === '1') {
|
||||
this.currentPoint.address = resp.regeocode.formatted_address;
|
||||
this.searchBody = resp.regeocode.formatted_address;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 计算各个场地到目标点的距离·
|
||||
getNearbySchool() {
|
||||
if (this.form.lng && this.form.lat) {
|
||||
this.nearbySchoolList = [];
|
||||
this.nearbySchoolSearching = true;
|
||||
// 推荐的场地
|
||||
let places1 = [];
|
||||
// 普通的场地
|
||||
let places2 = [];
|
||||
|
||||
const p2 = [this.form.lng, this.form.lat];
|
||||
for (let i = 0; i < this.options.placeInfo.length; i++) {
|
||||
const element = this.options.placeInfo[i];
|
||||
const p1 = [element.lng, element.lat];
|
||||
// 计算直线距离
|
||||
element.distance = (window.AMap.GeometryUtil.distance(p1, p2) / 1000).toFixed(2);
|
||||
element.recommend ? places1.push(element) : places2.push(element);
|
||||
}
|
||||
// 按直线距离排序
|
||||
// 排序
|
||||
if (places1.length > 1) {
|
||||
places1 = places1.sort((a, b) => a.distance - b.distance);
|
||||
}
|
||||
// 排序
|
||||
if (places2.length > 1) {
|
||||
places2 = places2.sort((a, b) => a.distance - b.distance);
|
||||
}
|
||||
// 取普通场地和推荐场地,组合, 取四个
|
||||
this.nearbySchoolList = [];
|
||||
for (let i = 0; i < 4; i++) {
|
||||
places1.length > i && this.nearbySchoolList.push(places1[i]);
|
||||
places2.length > i && this.nearbySchoolList.push(places2[i]);
|
||||
if (this.nearbySchoolList.length === 4) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 计算步行距离
|
||||
this.nearbySchoolList.map(async (item) => {
|
||||
const p1 = [item.lng, item.lat];
|
||||
const resp = await this.getWalkingDistance(p1, p2);
|
||||
item.walkdistance = resp;
|
||||
this.$forceUpdate();
|
||||
});
|
||||
this.nearbySchoolSearching = false;
|
||||
}
|
||||
},
|
||||
// 获取两点之间的步行距离
|
||||
async getWalkingDistance(start, end) {
|
||||
if (start && end) {
|
||||
const resp = await walking({
|
||||
key: 'f2f35d6adc4a16bb879d303cead56237',
|
||||
origin: start[0] + ',' + start[1],
|
||||
destination: end[0] + ',' + end[1]
|
||||
});
|
||||
if (resp.status === '1') {
|
||||
const num = resp.route.paths[0].distance;
|
||||
return num > 1000 ? `${(num / 1000).toFixed(2)} 公里` : `${num} 米`;
|
||||
} else {
|
||||
return '步行数据无法确定';
|
||||
}
|
||||
}
|
||||
|
||||
// return new Promise((resolve, reject) => {
|
||||
|
||||
// })
|
||||
|
||||
// return new Promise((resolve, reject) => {
|
||||
// window.AMap.plugin('AMap.Walking', () => {
|
||||
// const walking = new AMap.Walking();
|
||||
// let num = 0;
|
||||
// walking.search(start, end, (status, result) => {
|
||||
// debugger
|
||||
// if (status === 'complete') {
|
||||
// result.routes.forEach((item) => {
|
||||
// num += item.distance;
|
||||
// });
|
||||
// resolve(
|
||||
// num > 1000 ? `${(num / 1000).toFixed(2)} 公里` : `${num} 米`
|
||||
// );
|
||||
// } else {
|
||||
// resolve('步行数据无法确定');
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
},
|
||||
validateForm() {
|
||||
return this.$refs.form.validate();
|
||||
},
|
||||
async querySearch(queryString, cb) {
|
||||
if (queryString) {
|
||||
const resp = await inputtips({
|
||||
key: 'f2f35d6adc4a16bb879d303cead56237',
|
||||
keywords: queryString
|
||||
});
|
||||
cb(resp.tips);
|
||||
}
|
||||
},
|
||||
handleSelect(item) {
|
||||
this.currentPoint.lat = item.location.split(',')[1];
|
||||
this.currentPoint.lng = item.location.split(',')[0];
|
||||
this.currentPoint.address = item.name;
|
||||
this.searchBody = item.district + item.name;
|
||||
this.dialogMap.clearMap();
|
||||
this.marker && this.dialogMap.remove(this.marker);
|
||||
this.marker = new AMap.Marker({
|
||||
map: this.dialogMap,
|
||||
position: [this.currentPoint.lng, this.currentPoint.lat],
|
||||
icon: require(`@/assets/images/place/flag_red.png`)
|
||||
});
|
||||
this.dialogMap.setZoom(14);
|
||||
this.dialogMap.setCenter([this.currentPoint.lng, this.currentPoint.lat]);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.amap-cavans {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
}
|
||||
|
||||
.dialog-map {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
}
|
||||
.address {
|
||||
position: absolute;
|
||||
left: 30px;
|
||||
top: 10px;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
}
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 10px;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.search-body {
|
||||
position: absolute;
|
||||
top: 90px;
|
||||
left: 25px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
margin: 6px 0;
|
||||
}
|
||||
li {
|
||||
padding: 6px;
|
||||
.name {
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.addr {
|
||||
line-height: 16px;
|
||||
font-size: 10px;
|
||||
color: #b4b4b4;
|
||||
}
|
||||
|
||||
.highlighted .addr {
|
||||
color: #ddd;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
79
src/views/zs/clue/components/PublicDialog.vue
Normal file
79
src/views/zs/clue/components/PublicDialog.vue
Normal file
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<el-dialog title="公海" :close-on-click-modal="false" append-to-body :visible.sync="visible" width="1000px" height="500" @close="closeDialog">
|
||||
<div>
|
||||
<el-button type="text" icon="el-icon-refresh" style="margin-bottom: 10px" @click="_getTableList">刷新</el-button>
|
||||
<el-table v-loading="loading" :data="publicList" border :row-class-name="tableRowClassName">
|
||||
<el-table-column label="创建时间" prop="consultTime" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.consultTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="线索来源" prop="source" width="100" />
|
||||
<el-table-column label="姓名" prop="name" width="100" />
|
||||
<el-table-column label="位置" prop="address" min-width="160" />
|
||||
<el-table-column label="意向状态" prop="intentionState" width="100" />
|
||||
<el-table-column label="备注" prop="clueMemo" min-width="150" />
|
||||
<el-table-column label="操作" fixed="right" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handlePickup(scope.row)">获取</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="queryParams.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" :page-sizes="[50, 100]" @pagination="_getTableList" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getPublicList, pickupClue } from '@/api/zs/clue';
|
||||
export default {
|
||||
name: 'PublicDialog',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: true,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
total: 0
|
||||
},
|
||||
publicList: []
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.visible = true;
|
||||
this._getTableList();
|
||||
},
|
||||
_getTableList() {
|
||||
this.loading = true;
|
||||
getPublicList(this.queryParams).then((resp) => {
|
||||
if (resp && resp.code === 200) {
|
||||
this.publicList = resp.rows;
|
||||
this.loading = false;
|
||||
this.queryParams.total = resp.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
closeDialog() {
|
||||
this.$emit('update:dialog.publicVisible', false);
|
||||
},
|
||||
handlePickup(item) {
|
||||
pickupClue(item).then((resp) => {
|
||||
if (resp && resp.code === 200) {
|
||||
this.$message.success('拾取成功');
|
||||
this._getTableList();
|
||||
}
|
||||
});
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
if (row.followUser2 || row.followUser) {
|
||||
return 'warning-row';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,80 +1,101 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row>
|
||||
<el-form ref="queryForm" :model="queryParams" inline>
|
||||
<el-row>
|
||||
<el-form-item>
|
||||
<el-input v-model="queryParams.name" placeholder="姓名/联系方式" clearable style="width: 200px" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryParams.source" placeholder="选择线索来源" clearable @change="handleQuery">
|
||||
<el-option v-for="dict in sourceOptions" :key="dict.dictValue" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryParams.intentionState" placeholder="选择意向状态" clearable @change="handleQuery">
|
||||
<el-option v-for="dict in intentionOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue">
|
||||
<i class="el-icon-star-on" :style="dict.cssClass" />
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ dict.dictValue }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="queryParams.followUser2" placeholder="选择跟进人员" filterable clearable @change="handleQuery">
|
||||
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker v-model="queryParams.createTime" style="width: 240px" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-form-item label-width="80">
|
||||
<template slot="label">
|
||||
<el-button type="text" @click="handleFilter">筛选</el-button>
|
||||
</template>
|
||||
<el-checkbox-group v-model="queryParams.etc" @change="etcChange">
|
||||
<el-checkbox v-if="filterItems.myCreate" label="myCreate">我创建的</el-checkbox>
|
||||
<el-checkbox v-if="filterItems.myValid" label="myValid">我的有效</el-checkbox>
|
||||
<el-checkbox v-if="filterItems.valid" label="valid">有效线索</el-checkbox>
|
||||
<el-checkbox v-if="filterItems.todayValid" label="todayValid">今日有效线索</el-checkbox>
|
||||
<el-checkbox v-if="filterItems.todayFollow" label="todayFollow">今日跟踪</el-checkbox>
|
||||
<el-checkbox v-if="filterItems.outtime" label="outtime">
|
||||
<el-badge :value="expireCount" type="danger">过期线索</el-badge>
|
||||
</el-checkbox>
|
||||
<el-checkbox v-if="filterItems.relate" label="relate">相关线索</el-checkbox>
|
||||
<el-checkbox v-if="filterItems.reSign" label="reSign">撞单线索</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item class="m20">
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
<el-button type="primary" @click="handlePublicClue">公海</el-button>
|
||||
<el-dropdown trigger="click">
|
||||
<el-button type="primary">
|
||||
更多
|
||||
<i class="el-icon-arrow-down el-icon--right" />
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="handleImport(false)">导入</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="handleImport(true)">一点通导入</el-dropdown-item>
|
||||
<el-dropdown-item v-if="admin == 'true'" @click.native="handleExport">导出</el-dropdown-item>
|
||||
<el-dropdown-item v-if="admin == 'true'" @click.native="handleBatChUpdate()">批量修改</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-form-item>
|
||||
<!-- <el-button type="primary" v-if="admin != 'true' && accept" @click="handleAccept(false)">停止接收</el-button>
|
||||
<el-button type="primary" v-if="admin != 'true' && !accept" @click="handleAccept(true)">启动接收</el-button> -->
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-form ref="searchForm" :model="searchForm" inline>
|
||||
<el-form-item label="筛选:" label-width="90px">
|
||||
<DMRadio v-model="searchForm.quickSearch" :list="quickList" all-text="全部" @change="$emit('search')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="意向状态:" label-width="90px">
|
||||
<DMRadio v-model="searchForm.intentionState" :list="intentionOptions" all-text="全部" @change="$emit('search')" />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-form-item label="姓名/联系方式">
|
||||
<el-input v-model="searchForm.name" placeholder="姓名/联系方式" clearable style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="线索来源">
|
||||
<el-select v-model="searchForm.source" placeholder="选择线索来源" clearable>
|
||||
<el-option v-for="dict in sourceOptions" :key="dict.dictValue" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="跟进人员">
|
||||
<el-select v-model="searchForm.followUser2" placeholder="选择跟进人员" filterable clearable>
|
||||
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker v-model="dateRange" style="width: 240px" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="pickDateChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0">
|
||||
<el-button type="primary" icon="el-icon-search" @click="$emit('search')">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import DMRadio from '@/components/DMRadio';
|
||||
export default {
|
||||
components: {
|
||||
DMRadio
|
||||
},
|
||||
props: {
|
||||
userOptions: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
sourceOptions: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
searchForm: {},
|
||||
quickList: [
|
||||
{ value: 1, label: '我创建的' },
|
||||
{ value: 2, label: '我的有效' },
|
||||
{ value: 3, label: '有效线索' },
|
||||
{ value: 4, label: '今日有效线索' },
|
||||
{ value: 5, label: '今日跟踪' },
|
||||
{ value: 6, label: '过期线索' },
|
||||
{ value: 7, label: '相关线索' },
|
||||
{ value: 8, label: '撞单线索' }
|
||||
],
|
||||
intentionOptions: [],
|
||||
dateRange: []
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
// 意向状态
|
||||
this.getDicts('dm_intention_state').then((response) => {
|
||||
let list = response.data
|
||||
this.intentionOptions = []
|
||||
list.map(item => {
|
||||
this.intentionOptions.push({
|
||||
value: item.dictValue,
|
||||
label: item.dictLabel
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
resetQuery() {
|
||||
this.searchForm = {
|
||||
createTime: [],
|
||||
name: undefined,
|
||||
intentionState: undefined,
|
||||
followUser2: undefined,
|
||||
source: undefined,
|
||||
quickSearch: undefined,
|
||||
total: 0
|
||||
};
|
||||
this.dateRange = []
|
||||
},
|
||||
pickDateChange() {
|
||||
this.addDateRange(this.searchForm, this.dateRange)
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
85
src/views/zs/clue/components/UploadDialog.vue
Normal file
85
src/views/zs/clue/components/UploadDialog.vue
Normal file
@@ -0,0 +1,85 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :close-on-click-modal="false" append-to-body :visible.sync="visible" width="400px" @close="closeDialog">
|
||||
<el-upload ref="upload" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?ydtData=' + ydtData" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">
|
||||
<el-link type="info" style="font-size: 12px" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip" style="color: red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="closeDialog">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { importTemplate } from '@/api/zs/clue';
|
||||
import { importData } from '@/api/tool/common';
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
canSubmit: true,
|
||||
isUploading: true,
|
||||
ydtData: false,
|
||||
title: '学员信息导入',
|
||||
upload: {
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/zs/clue/importData',
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(info = false) {
|
||||
this.visible = true;
|
||||
this.ydtData = false;
|
||||
this.$nextTick(() => {
|
||||
if (info) {
|
||||
this.ydtData = info;
|
||||
this.title = "一点通-" + this.title;
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('zs/clue/importTemplate?ydtData=' + this.ydtData, {}, `clue_template_${new Date().getTime()}.xlsx`);
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.visible = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + '</div>', '导入结果', {
|
||||
dangerouslyUseHTMLString: true
|
||||
});
|
||||
this.$emit('update:dialog.batchUpdateVisible', false);
|
||||
this.$emit('refreshDataList');
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
closeDialog() {
|
||||
this.$emit('update:dialog.batchUpdateVisible', false);
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索插件 -->
|
||||
<SearchForm v-show="showSearch" ref="SearchForm" @search="_getTableList" :userOptions="userOptions" :sourceOptions="sourceOptions" />
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button icon="el-icon-plus" type="primary" @click="handleAddandUpdate(undefined)">新增</el-button>
|
||||
<el-button icon="el-icon-upload" type="warning" @click="handleImport(false)">导入</el-button>
|
||||
<el-button icon="el-icon-upload" type="warning" @click="handleImport(true)">一点通导入</el-button>
|
||||
<el-button icon="el-icon-download" type="warning" @click="handleExport">导出</el-button>
|
||||
<el-button icon="el-icon-edit" type="primary" :disabled="multiple" @click="handleBatChUpdate()">批量修改</el-button>
|
||||
<el-button type="primary" @click="handlePublicClue">公海</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :show-search.sync="showSearch" :columns="columns" @queryTable="_getTableList" />
|
||||
</el-row>
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="loading" :data="tableList" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<template v-for="item in columns">
|
||||
<el-table-column v-if="item.visible" :key="item.prop" :label="item.label" align="center" :width="item.width" :prop="item.prop" :show-overflow-tooltip="item.overflow" />
|
||||
</template>
|
||||
<el-table-column label="意向状态" prop="intentionState" sortable fixed="right" min-width="100">
|
||||
<template slot-scope="{ row }">
|
||||
<el-tag effect="dark" style="border: none" :color="tagColorMap[row.intentionState]">{{ row.intentionState }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" icon="el-icon-edit" @click.native.stop="handleAddandUpdate(scope.row)">编辑</el-button>
|
||||
<el-button v-if="scope.row.state" type="text" icon="el-icon-edit" style="color: #26a69a" @click.native.stop="handleSign(scope.row)">已登记</el-button>
|
||||
<el-button v-if="!scope.row.state" type="text" icon="el-icon-edit" @click.native.stop="handleSign(scope.row)">未登记</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click.native.stop="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button type="text" v-if="!scope.row.state" icon="el-icon-delete" @click.native.stop="handleDiscard(scope.row)">释放</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize" :page-sizes="[10, 20, 30, 50, 100]" @pagination="_getTableList" />
|
||||
|
||||
<!-- 新增、修改 -->
|
||||
<!-- <ClueForm v-if="dialog.addAndUpdateVisible" ref="addAndUpdateForm" :dialog-visible="dialog.addAndUpdateVisible" :options="options" @refreshDataList="_getTableList" /> -->
|
||||
<!-- 批量修改 -->
|
||||
<BatchUpdateDialog v-if="dialog.batchUpdateVisible" ref="batchUpdateDialogForm" :dialog-visible="dialog.batchUpdateVisible" :options="options" @refreshDataList="_getTableList" />
|
||||
<!-- 公海 -->
|
||||
<PublicDialog v-if="dialog.publicVisible" ref="publicDialogForm" :dialog-visible="dialog.publicVisible" @refreshDataList="_getTableList" />
|
||||
<!-- 上传 -->
|
||||
<UploadDialog v-if="dialog.uploadVisible" ref="uploadDialogForm" :dialog-visible="dialog.uploadVisible" @refreshDataList="_getTableList" />
|
||||
<!-- 登记弹框 -->
|
||||
<SignFormDialog v-if="dialog.signVisible" ref="signDialogForm" :dialog-visible="dialog.signVisible" :clueInfo="clueInfo" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import SearchForm from './components/SearchForm.vue';
|
||||
import BatchUpdateDialog from './components/BatchUpdateDialog.vue';
|
||||
import PublicDialog from './components/PublicDialog.vue';
|
||||
import UploadDialog from './components/UploadDialog.vue';
|
||||
import SignFormDialog from '../sign/components/SignFormDialog.vue';
|
||||
|
||||
import { defaultColumns } from './columns.js';
|
||||
import { getClueList, exportData, deleteClue, getClueCountBadge, discardClue, getSign } from '@/api/zs/clue';
|
||||
import empApi from '@/api/system/employee'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SearchForm, BatchUpdateDialog, PublicDialog, UploadDialog, SignFormDialog
|
||||
},
|
||||
name: 'Clue',
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
searchForm: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
tableList: [],
|
||||
total: 0,
|
||||
columns: [],
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
expireCount: 0,
|
||||
|
||||
dialog: {
|
||||
batchUpdateVisible: false,
|
||||
publicVisible: false,
|
||||
uploadVisible: false,
|
||||
addAndUpdateVisible: false,
|
||||
signVisible: false
|
||||
},
|
||||
userOptions2: [],
|
||||
userOptions: [],
|
||||
sourceOptions: [],
|
||||
tagColorMap: {
|
||||
A高意向: '#ff7043',
|
||||
B中意向: '#26a69a',
|
||||
C无意向: '#5c6bc0',
|
||||
D未知意向: '#ef5350',
|
||||
报名成功: '#ffa726',
|
||||
报名他校: '#afaeb0',
|
||||
无效线索: '#afaeb0'
|
||||
},
|
||||
options: undefined,
|
||||
clueInfo: undefined
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const str = localStorage.getItem(`${this.$route.name}-table-columns`);
|
||||
this.columns = str ? JSON.parse(str) : defaultColumns;
|
||||
this._getClueCountBadge();
|
||||
this.getEmployee();
|
||||
// 线索来源
|
||||
this.getDicts('dm_source').then((response) => {
|
||||
this.sourceOptions = response.data;
|
||||
});
|
||||
// 意向状态
|
||||
this.getDicts('dm_intention_state').then((response) => {
|
||||
this.intentionOptions = response.data;
|
||||
});
|
||||
this._getTableList();
|
||||
},
|
||||
methods: {
|
||||
// 分页查询表格数据
|
||||
_getTableList() {
|
||||
this.loading = true;
|
||||
const tempForm = this.$refs.SearchForm?.searchForm || {};
|
||||
const params = { ...this.searchForm, ...tempForm };
|
||||
getClueList(params).then((response) => {
|
||||
this.tableList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
},
|
||||
// 获取已过期线索数
|
||||
async _getClueCountBadge() {
|
||||
const resp = await getClueCountBadge();
|
||||
if (resp.code === 200) {
|
||||
this.expireCount = resp.data;
|
||||
}
|
||||
},
|
||||
// 新增或修改
|
||||
handleAddandUpdate(info) {
|
||||
this.$router.push("/zs/clue-form/index/" + (info ? info.clueId : 0));
|
||||
},
|
||||
// 批量修改
|
||||
handleBatChUpdate() {
|
||||
this.options = {
|
||||
userOptions: this.userOptions
|
||||
}
|
||||
this.getEmployee2();
|
||||
this.dialog.batchUpdateVisible = true;
|
||||
let item = {
|
||||
clueIds: this.ids
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.batchUpdateDialogForm.init(item);
|
||||
});
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.clueId);
|
||||
this.single = selection.length !== 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
// 释放线索操作
|
||||
handleDiscard(item) {
|
||||
discardClue(item).then((resp) => {
|
||||
if (resp && resp.code === 200) {
|
||||
this.$message.success('释放成功');
|
||||
this._getTableList();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
handleDelete(item) {
|
||||
this.$confirm('是否确认删除该条线索(“' + item.name + '/' + item.phone + '”)?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then((res) => {
|
||||
deleteClue({ clueId: item.clueId }).then((resp) => {
|
||||
if (resp.code === 200) {
|
||||
this.$message.success('删除成功');
|
||||
this._getTableList();
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(function () { });
|
||||
},
|
||||
// 登记
|
||||
// 导入
|
||||
handleImport(ydtData) {
|
||||
this.dialog.uploadVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.uploadDialogForm.init(ydtData);
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.$confirm('是否确认导出所有学员信息项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const tempForm = this.$refs.SearchForm?.searchForm || {};
|
||||
this.download('zs/clue/export', tempForm, `线索信息_${new Date().getTime()}.xlsx`);
|
||||
});
|
||||
},
|
||||
// 公海按钮点击时间
|
||||
handlePublicClue() {
|
||||
this.dialog.publicVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.publicDialogForm.init();
|
||||
});
|
||||
},
|
||||
getEmployee() {
|
||||
empApi.getEmployee().then((resp) => {
|
||||
if (resp.code === 200) {
|
||||
this.userOptions = resp.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 查询不能接收线索的员工
|
||||
getEmployee2() {
|
||||
empApi.getEmployee().then((resp) => {
|
||||
if (resp.code === 200) {
|
||||
this.userOptions2 = resp.data;
|
||||
this.userOptions2 = this.userOptions2.filter((item) => {
|
||||
return item.accept;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//登记成交
|
||||
async handleSign(item) {
|
||||
//根据clueId查询登记信息
|
||||
let signInfo = {};
|
||||
this.clueInfo = item;
|
||||
const resp = await getSign({ clueId: item.clueId })
|
||||
if (resp.code == 200) {
|
||||
signInfo = { ...resp.data }
|
||||
}
|
||||
this.dialog.signVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.signDialogForm.init(signInfo);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.drawer-form__footer {
|
||||
border-top: 1px solid rgba(69, 74, 91, 0.1);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
z-index: 2;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.footer_button {
|
||||
width: 49%;
|
||||
margin: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
import { getFollowRecord } from '@/api/zs/clue';
|
||||
import { getClassTypes } from '@/api/tool/common';
|
||||
import { inputtips, regeo, walking } from '@/api/tool/map';
|
||||
// import AMap from 'AMap';
|
||||
import AMap from 'AMap';
|
||||
export default {
|
||||
model: {
|
||||
prop: 'info',
|
||||
@@ -168,7 +168,7 @@ export default {
|
||||
props: {
|
||||
info: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
default: () => { }
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
|
||||
@@ -0,0 +1,411 @@
|
||||
<template>
|
||||
<!-- 成交登记对话框 -->
|
||||
<el-dialog title="审核" :visible.sync="modalVisible" width="800px" append-to-body :close-on-click-modal="false">
|
||||
<el-tabs v-model="checkTab" @tab-click="handleClick">
|
||||
<el-tab-pane label="登记信息" name="first">
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="审核" name="second">
|
||||
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 显示登记内容 -->
|
||||
<div v-show="first" style="height:500px;overflow-y:auto;">
|
||||
<el-form :model="modalForm" ref="modalForm" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学员联系方式" prop="phone">
|
||||
<el-input v-model="modalForm.phone" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学员姓名" prop="name">
|
||||
<el-input v-model="modalForm.name" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="线索来源" prop="source">
|
||||
<el-select v-model="modalForm.source" placeholder="请选择" size="small" disabled>
|
||||
<el-option v-for="dict in sourceOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否全款" prop="state">
|
||||
<el-radio-group v-model="modalForm.state" disabled>
|
||||
<el-radio :label="true">全款</el-radio>
|
||||
<el-radio :label="false">非全款</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker v-model="modalForm.dealDate" size="small" disabled value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名价格(元)" prop="signPrice">
|
||||
<el-input v-model="modalForm.signPrice" placeholder="学员报名时需要交纳总共的钱" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名驾校" prop="signSchool">
|
||||
<el-select v-model="modalForm.signSchool" filterable placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in schoolOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名场地" prop="signPlace">
|
||||
<el-select v-model="modalForm.signPlace" filterable placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in placeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名班型" prop="signClass">
|
||||
<el-select v-model="modalForm.signClass" filterable placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in classTypeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="对接人" prop="schoolPeople">
|
||||
<el-input v-model="modalForm.schoolPeople" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="驾校支付" prop="schoolPay">
|
||||
<el-input type="number" v-model="modalForm.schoolPay" placeholder="请输入驾校支付金额" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="驾考宝典款" prop="alipay">
|
||||
<el-input v-model="modalForm.alipay" placeholder="请输入驾考宝典款金额" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="额外支出" prop="extraPayType">
|
||||
<el-select v-model="modalForm.extraPayType" filterable placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in extraPayTypeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="额外支出金额" prop="extraPay">
|
||||
<el-input placeholder="请输入额外支出金额" v-model="modalForm.extraPay" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属人员" prop="followUser">
|
||||
<el-select v-model="modalForm.followUser" multiple placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属区域" prop="area">
|
||||
<el-select v-model="modalForm.area" placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in areaOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="线下接待人员" prop="offlineReceiver">
|
||||
<el-select v-model="modalForm.offlineReceiver" multiple placeholder="请选择" clearable size="small" :disabled="!modalForm.signEdit || modalForm.clueId != undefined">
|
||||
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="admin == 'true'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="佣金明细" prop="commission">
|
||||
<el-select v-model="modalForm.commission" placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in commissionOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="memo">
|
||||
<el-input type="textarea" :rows="2" v-model="modalForm.memo" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="凭据" prop="memo">
|
||||
<div class="demo-image__preview">
|
||||
<div v-for="(item, index) in modalForm.fileList" :key="index" class="pr dib">
|
||||
<el-image class="image-list-item" fit="contain" :src="preUrl + item.url" :preview-src-list="modalForm.fileList.map(url => preUrl + url)" lazy />
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="修改记录">
|
||||
<el-timeline style="max-height:260px;overflow-y:auto;">
|
||||
<el-timeline-item v-for="info in updateRecord" :key="info.record" :timestamp="info.operateTime" placement="top" style="padding:5px !important;">
|
||||
<el-card>
|
||||
<span style="display:block;font-weight: bold; font-size:13px;">用户 {{info.operateUserName}}</span>
|
||||
<span v-html="info.centent" style="display:block;padding-left: 10px; font-size:13px;" />
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- 录入审核结果 -->
|
||||
<div v-show="second" style="height:500px;overflow-y:auto;">
|
||||
<el-form :model="modalForm2" ref="modalForm2" label-width="110px">
|
||||
<el-row v-if="admin == 'true'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回款状态" prop="moneyState">
|
||||
<el-select v-model="modalForm2.moneyState" placeholder="请选择" clearable size="small">
|
||||
<el-option v-for="dict in moneyStateOptions" :key="dict.uid" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="驳回理由" prop="rejectReason">
|
||||
<el-input type="textarea" :rows="2" v-model="modalForm2.rejectReason"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核记录">
|
||||
<el-timeline style="max-height:260px;overflow-y:auto;">
|
||||
<el-timeline-item v-for="info in checkRecord" :key="info.record" :timestamp="info.operateTime" placement="top" style="padding:5px !important;">
|
||||
<el-card>
|
||||
<span style="display:block;font-weight: bold; font-size:13px;">用户 {{info.operateUserName}}</span>
|
||||
<span v-html="info.centent" style="display:block;padding-left: 10px; font-size:13px;" />
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer">
|
||||
<el-button type="primary" v-if="first" :loading="loading" @click="handleNext">下一步</el-button>
|
||||
<el-button type="primary" v-if="second" :loading="loading" @click="handleBack">上一步</el-button>
|
||||
<el-button type="primary" v-if="second" :loading="loading" @click="handleCheck(2)">通过</el-button>
|
||||
<el-button type="primary" v-if="second" :loading="loading" @click="handleCheck(3)">驳回</el-button>
|
||||
<el-button @click="modalVisible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { checkSign, getCheckRecord } from '@/api/zs/sign'
|
||||
import { validateMoney } from '@/utils/validate'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import {
|
||||
getEmployee,
|
||||
getSchools,
|
||||
getPlaces,
|
||||
getClassTypes,
|
||||
} from '@/api/tool/common'
|
||||
|
||||
export default {
|
||||
name: 'Check',
|
||||
data() {
|
||||
return {
|
||||
admin: localStorage.getItem('admin'),
|
||||
preUrl: process.env.VUE_APP_BASE_API,
|
||||
userId: localStorage.getItem('userId'),
|
||||
modalVisible: false,
|
||||
signLoading: false,
|
||||
first: true,
|
||||
second: false,
|
||||
modalForm: {},
|
||||
|
||||
modalRules: {
|
||||
name: { required: true, message: '姓名不为空', trigger: 'blur' },
|
||||
phone: { required: true, message: '联系方式不为空', trigger: 'blur' },
|
||||
source: { required: true, message: '线索来源不为空', trigger: 'blur' },
|
||||
area: { required: true, message: '所属区域不为空', trigger: 'blur' },
|
||||
},
|
||||
userOptions: [],
|
||||
clueOptions: [],
|
||||
schoolOptions: [],
|
||||
placeOptions: [],
|
||||
classTypeOptions: [],
|
||||
sourceOptions: [],
|
||||
commissionOptions: [],
|
||||
extraPayTypeOptions: [],
|
||||
areaOptions: [],
|
||||
moneyStateOptions: [],
|
||||
modalForm2: {},
|
||||
loading: false,
|
||||
updateRecord: [],
|
||||
checkRecord: [],
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
fileList: [],
|
||||
picList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//线索来源
|
||||
this.getDicts('dm_source').then((response) => {
|
||||
this.sourceOptions = response.data
|
||||
})
|
||||
//佣金明细
|
||||
this.getDicts('dm_commission').then((response) => {
|
||||
this.commissionOptions = response.data
|
||||
})
|
||||
//额外支出类型
|
||||
this.getDicts('dm_extra_pay').then((response) => {
|
||||
this.extraPayTypeOptions = response.data
|
||||
})
|
||||
//s所属区域
|
||||
this.getDicts('dm_area').then((response) => {
|
||||
this.areaOptions = response.data
|
||||
})
|
||||
//回款状态
|
||||
this.getDicts('dm_money_state').then((response) => {
|
||||
this.moneyStateOptions = response.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
init(data) {
|
||||
console.log('打开弹框')
|
||||
this.resetForm('modalForm')
|
||||
this.modalForm = data
|
||||
this.getSchools()
|
||||
this.getPlaces()
|
||||
this.getClassTypes()
|
||||
this.getEmployee()
|
||||
this.fileList = []
|
||||
this.picList = []
|
||||
if (data.fileList) {
|
||||
this.fileList = data.fileList
|
||||
for (let i in this.fileList) {
|
||||
this.picList.push(this.fileList[i]) //.url
|
||||
}
|
||||
}
|
||||
console.log(this.picList)
|
||||
this.getUpdateRecord(this.modalForm.signId)
|
||||
this.modalVisible = true
|
||||
this.first = true
|
||||
this.second = false
|
||||
this.resetForm('modalForm2')
|
||||
this.modalForm2 = {
|
||||
signId: this.modalForm.signId,
|
||||
checkState: undefined,
|
||||
rejectReason: data.rejectReason,
|
||||
moneyState: data.moneyState,
|
||||
}
|
||||
this.getCheckRecord(this.modalForm.signId)
|
||||
},
|
||||
getSchools() {
|
||||
getSchools().then((resp) => {
|
||||
this.schoolOptions = resp.data
|
||||
})
|
||||
},
|
||||
getPlaces() {
|
||||
getPlaces({ deptId: this.modalForm.signSchool, status: '0' }).then(
|
||||
(resp) => {
|
||||
this.placeOptions = resp.data
|
||||
}
|
||||
)
|
||||
},
|
||||
getClassTypes() {
|
||||
getClassTypes({
|
||||
deptId: this.modalForm.signSchool,
|
||||
placeId: this.modalForm.signPlace,
|
||||
status: '0',
|
||||
}).then((resp) => {
|
||||
this.classTypeOptions = resp.data
|
||||
})
|
||||
},
|
||||
|
||||
getEmployee() {
|
||||
getEmployee({ coach: false }).then((resp) => {
|
||||
if (resp.code == 200) {
|
||||
this.userOptions = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
handleNext() {
|
||||
this.first = false
|
||||
this.second = true
|
||||
},
|
||||
handleBack() {
|
||||
this.first = true
|
||||
this.second = false
|
||||
},
|
||||
handleCheck(state) {
|
||||
this.modalForm2.checkState = state
|
||||
this.modalForm2.signId = this.modalForm.signId
|
||||
this.loading = true
|
||||
checkSign(this.modalForm2).then((resp) => {
|
||||
if (resp && resp.code == 200) {
|
||||
if (state == 2) {
|
||||
this.$message.success('通过成功!')
|
||||
} else {
|
||||
this.$message.success('驳回成功!')
|
||||
}
|
||||
this.modalVisible = false
|
||||
this.loading = false
|
||||
this.$emit('refreshDataList')
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
getCheckRecord(signId) {
|
||||
getCheckRecord({ signId: signId, type: 1 }).then((resp) => {
|
||||
this.checkRecord = resp.data
|
||||
})
|
||||
},
|
||||
getUpdateRecord(signId) {
|
||||
getCheckRecord({ signId: signId, type: 0 }).then((resp) => {
|
||||
this.updateRecord = resp.data
|
||||
})
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisible = true
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
156
src/views/zs/sign/columns.js
Normal file
156
src/views/zs/sign/columns.js
Normal file
@@ -0,0 +1,156 @@
|
||||
export const defaultColumns = [{
|
||||
key: 0,
|
||||
prop: 'state',
|
||||
label: '全款状态',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
}, {
|
||||
key: 1,
|
||||
prop: 'followUserName',
|
||||
label: '归属人员',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
prop: 'area',
|
||||
label: '所属区域',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
prop: 'offlineReceiverName',
|
||||
label: '线下接待人员',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
prop: 'dealDate',
|
||||
label: '成交时间',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 5,
|
||||
prop: 'name',
|
||||
label: '学员姓名',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 6,
|
||||
prop: 'phone',
|
||||
label: '联系方式',
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 7,
|
||||
prop: 'source',
|
||||
label: '线索来源',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 8,
|
||||
prop: 'signPrice',
|
||||
label: '报名价格',
|
||||
width: 120,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 9,
|
||||
prop: 'schoolName',
|
||||
label: '报名驾校',
|
||||
width: 120,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 10,
|
||||
prop: 'placeName',
|
||||
label: '报名场地',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 11,
|
||||
prop: 'className',
|
||||
label: '报名班型',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 12,
|
||||
prop: 'schoolPeople',
|
||||
label: '对接人',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: false
|
||||
},
|
||||
{
|
||||
key: 13,
|
||||
prop: 'schoolPay',
|
||||
label: '驾校支付',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: true
|
||||
},
|
||||
{
|
||||
key: 14,
|
||||
prop: 'alipay',
|
||||
label: '驾考宝典款',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: true
|
||||
}, {
|
||||
key: 15,
|
||||
prop: 'extraPayType',
|
||||
label: '额外支出',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: true
|
||||
}, {
|
||||
key: 16,
|
||||
prop: 'extraPay',
|
||||
label: '额外支出金额',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: true
|
||||
},
|
||||
{
|
||||
key: 17,
|
||||
prop: 'commission',
|
||||
label: '佣金明细',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: true
|
||||
}, {
|
||||
key: 18,
|
||||
prop: 'memo',
|
||||
label: '备注',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: true
|
||||
},
|
||||
{
|
||||
key: 19,
|
||||
prop: 'moneyState',
|
||||
label: '回款状态',
|
||||
width: 140,
|
||||
visible: true,
|
||||
overflow: true
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,59 @@
|
||||
<template >
|
||||
<div style="height:500px;overflow-y:auto;">
|
||||
<el-form :model="checkForm" ref="checkForm" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="回款状态" prop="moneyState">
|
||||
<el-select v-model="checkForm.moneyState" placeholder="请选择" clearable size="small">
|
||||
<el-option v-for="dict in moneyStateOptions" :key="dict.uid" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="驳回理由" prop="rejectReason">
|
||||
<el-input type="textarea" :rows="2" v-model="checkForm.rejectReason"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核记录">
|
||||
<CheckRecord :signId="checkForm.signId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import CheckRecord from '../../CheckRecord.vue';
|
||||
export default {
|
||||
components: {
|
||||
CheckRecord
|
||||
},
|
||||
props: {
|
||||
checkForm: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
moneyStateOptions: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
//回款状态
|
||||
this.getDicts('dm_money_state').then((response) => {
|
||||
this.moneyStateOptions = response.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
293
src/views/zs/sign/components/CheckDialog/components/SignForm.vue
Normal file
293
src/views/zs/sign/components/CheckDialog/components/SignForm.vue
Normal file
@@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div style="height:500px;overflow-y:auto;">
|
||||
<el-form :model="modalForm" ref="modalForm" label-width="110px" disabled>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学员联系方式" prop="phone">
|
||||
<el-input v-model="modalForm.phone" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学员姓名" prop="name">
|
||||
<el-input v-model="modalForm.name" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="线索来源" prop="source">
|
||||
<el-select v-model="modalForm.source" placeholder="请选择" size="small" disabled>
|
||||
<el-option v-for="dict in sourceOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否全款" prop="state">
|
||||
<el-radio-group v-model="modalForm.state" disabled>
|
||||
<el-radio :label="true">全款</el-radio>
|
||||
<el-radio :label="false">非全款</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker v-model="modalForm.dealDate" size="small" disabled value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名价格(元)" prop="signPrice">
|
||||
<el-input v-model="modalForm.signPrice" placeholder="学员报名时需要交纳总共的钱" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名驾校" prop="signSchool">
|
||||
<el-select v-model="modalForm.signSchool" filterable placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in schoolOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名场地" prop="signPlace">
|
||||
<el-select v-model="modalForm.signPlace" filterable placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in placeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名班型" prop="signClass">
|
||||
<el-select v-model="modalForm.signClass" filterable placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in classTypeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="对接人" prop="schoolPeople">
|
||||
<el-input v-model="modalForm.schoolPeople" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="驾校支付" prop="schoolPay">
|
||||
<el-input type="number" v-model="modalForm.schoolPay" placeholder="请输入驾校支付金额" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="驾考宝典款" prop="alipay">
|
||||
<el-input v-model="modalForm.alipay" placeholder="请输入驾考宝典款金额" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="额外支出" prop="extraPayType">
|
||||
<el-select v-model="modalForm.extraPayType" filterable placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in extraPayTypeOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="额外支出金额" prop="extraPay">
|
||||
<el-input placeholder="请输入额外支出金额" v-model="modalForm.extraPay" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属人员" prop="followUser">
|
||||
<el-select v-model="modalForm.followUser" multiple placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属区域" prop="area">
|
||||
<el-select v-model="modalForm.area" placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in areaOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="线下接待人员" prop="offlineReceiver">
|
||||
<el-select v-model="modalForm.offlineReceiver" multiple placeholder="请选择" clearable size="small" :disabled="!modalForm.signEdit || modalForm.clueId != undefined">
|
||||
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="佣金明细" prop="commission">
|
||||
<el-select v-model="modalForm.commission" placeholder="请选择" clearable size="small" disabled>
|
||||
<el-option v-for="dict in commissionOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="memo">
|
||||
<el-input type="textarea" :rows="2" v-model="modalForm.memo" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="凭据" prop="memo">
|
||||
<div class="demo-image__preview">
|
||||
<div v-for="(item, index) in modalForm.fileList" :key="index" class="demo-image__item">
|
||||
<el-image class="image-list-item" fit="contain" :src="item.url" :preview-src-list="modalForm.fileList.map(file => file.url)" lazy />
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="修改记录">
|
||||
<el-timeline style="max-height:260px;overflow-y:auto;">
|
||||
<el-timeline-item v-for="info in updateRecord" :key="info.record" :timestamp="info.operateTime" placement="top" style="padding:5px !important;">
|
||||
<el-card>
|
||||
<span style="display:block;font-weight: bold; font-size:13px;">用户 {{info.operateUserName}}</span>
|
||||
<span v-html="info.centent" style="display:block;padding-left: 10px; font-size:13px;" />
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import empApi from '@/api/system/employee'
|
||||
import schoolAPi from '@/api/sch/school'
|
||||
import { getAllPlaces } from '@/api/sch/place'
|
||||
import { getClassTypeTableList } from '@/api/sch/classType'
|
||||
import { getCheckRecord } from '@/api/zs/sign'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
modalForm: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userOptions: [],
|
||||
clueOptions: [],
|
||||
schoolOptions: [],
|
||||
placeOptions: [],
|
||||
classTypeOptions: [],
|
||||
sourceOptions: [],
|
||||
commissionOptions: [],
|
||||
extraPayTypeOptions: [],
|
||||
areaOptions: [],
|
||||
moneyStateOptions: [],
|
||||
updateRecord: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
//线索来源
|
||||
this.getDicts('dm_source').then((response) => {
|
||||
this.sourceOptions = response.data
|
||||
})
|
||||
//佣金明细
|
||||
this.getDicts('dm_commission').then((response) => {
|
||||
this.commissionOptions = response.data
|
||||
})
|
||||
//额外支出类型
|
||||
this.getDicts('dm_extra_pay').then((response) => {
|
||||
this.extraPayTypeOptions = response.data
|
||||
})
|
||||
//s所属区域
|
||||
this.getDicts('dm_area').then((response) => {
|
||||
this.areaOptions = response.data
|
||||
})
|
||||
|
||||
this.getSchools()
|
||||
this.getPlaces()
|
||||
this.getClassTypes()
|
||||
this.getEmployee()
|
||||
this.getUpdateRecord(this.modalForm.signId)
|
||||
},
|
||||
//查询驾校
|
||||
getSchools() {
|
||||
schoolAPi.pageList().then((resp) => {
|
||||
this.schoolOptions = resp.data
|
||||
})
|
||||
},
|
||||
//查询场地
|
||||
getPlaces() {
|
||||
getAllPlaces({ schoolId: this.modalForm.signSchool, status: '0' }).then(
|
||||
(resp) => {
|
||||
this.placeOptions = resp.data
|
||||
}
|
||||
)
|
||||
},
|
||||
//查询班型
|
||||
getClassTypes() {
|
||||
getClassTypeTableList({
|
||||
schoolId: this.modalForm.signSchool,
|
||||
placeId: this.modalForm.signPlace,
|
||||
status: '0',
|
||||
}).then((resp) => {
|
||||
this.classTypeOptions = resp.data
|
||||
})
|
||||
},
|
||||
//查询员工
|
||||
getEmployee() {
|
||||
empApi.getEmployee().then((resp) => {
|
||||
if (resp.code == 200) {
|
||||
this.userOptions = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getUpdateRecord(signId) {
|
||||
getCheckRecord({ signId: signId, type: 0 }).then((resp) => {
|
||||
this.updateRecord = resp.data
|
||||
})
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.demo-image__item {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
display: inline-block;
|
||||
margin: 5px;
|
||||
}
|
||||
.image-list-item {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
82
src/views/zs/sign/components/CheckDialog/index.vue
Normal file
82
src/views/zs/sign/components/CheckDialog/index.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<!-- 成交登记对话框 -->
|
||||
<el-dialog title="审核" :visible.sync="visible" width="800px" append-to-body :close-on-click-modal="false">
|
||||
<el-tabs v-model="checkTab">
|
||||
<el-tab-pane label="登记信息" name="one">
|
||||
<SignForm v-if="visible" :modalForm="modalForm" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="审核" name="two">
|
||||
<CheckForm v-if="visible" :checkForm="checkForm" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<span slot="footer">
|
||||
<el-button type="primary" v-if="modalForm.state == 1 && checkTab == 'two'" :disabled="!canSubmit" :loading="loading" @click="handleCheck(2)">通过</el-button>
|
||||
<el-button type="primary" v-if="modalForm.state == 1 && checkTab == 'two'" :disabled="!canSubmit" :loading="loading" @click="handleCheck(3)">驳回</el-button>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { checkSign } from '@/api/zs/sign'
|
||||
import CheckForm from './components/CheckForm.vue'
|
||||
import SignForm from './components/SignForm.vue'
|
||||
import CheckRecord from '../CheckRecord.vue'
|
||||
|
||||
export default {
|
||||
name: 'CheckDialog',
|
||||
components: {
|
||||
CheckForm, SignForm, CheckRecord
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
admin: localStorage.getItem('admin'),
|
||||
preUrl: process.env.VUE_APP_BASE_API,
|
||||
userId: localStorage.getItem('userId'),
|
||||
visible: false,
|
||||
signLoading: false,
|
||||
modalForm: {},
|
||||
loading: false,
|
||||
checkTab: undefined,
|
||||
checkForm: {},
|
||||
canSubmit: true
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
init(data) {
|
||||
console.log('打开弹框')
|
||||
this.resetForm('modalForm')
|
||||
this.modalForm = data
|
||||
this.visible = true
|
||||
this.checkTab = 'one'
|
||||
this.resetForm('modalForm2')
|
||||
this.checkForm = {
|
||||
signId: this.modalForm.signId,
|
||||
checkState: undefined,
|
||||
rejectReason: data.rejectReason,
|
||||
moneyState: data.moneyState,
|
||||
}
|
||||
},
|
||||
handleCheck(state) {
|
||||
console.log(this.checkForm)
|
||||
this.checkForm.checkState = state
|
||||
this.checkForm.signId = this.modalForm.signId
|
||||
this.canSubmit = false
|
||||
checkSign(this.checkForm).then((resp) => {
|
||||
if (resp && resp.code == 200) {
|
||||
if (state == 2) {
|
||||
this.$message.success('通过成功!')
|
||||
} else {
|
||||
this.$message.success('驳回成功!')
|
||||
}
|
||||
this.canSubmit = true
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
} else {
|
||||
this.canSubmit = true
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
44
src/views/zs/sign/components/CheckRecord.vue
Normal file
44
src/views/zs/sign/components/CheckRecord.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-timeline style="max-height:260px;overflow-y:auto;">
|
||||
<el-timeline-item v-for="info in checkRecord" :key="info.record" :timestamp="info.operateTime" placement="top" style="padding:5px !important;">
|
||||
<el-card>
|
||||
<span style="display:block;font-weight: bold; font-size:13px;">用户 {{info.operateUserName}}</span>
|
||||
<span v-html="info.centent" style="display:block;padding-left: 10px; font-size:13px;" />
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getCheckRecord } from '@/api/zs/sign'
|
||||
|
||||
export default {
|
||||
name: "CheckRecord",
|
||||
props: {
|
||||
signId: {
|
||||
type: Number,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
checkRecord: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.signId) {
|
||||
this.getCheckRecord()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCheckRecord() {
|
||||
getCheckRecord({ signId: this.signId, type: 1 }).then((resp) => {
|
||||
this.checkRecord = resp.data
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
122
src/views/zs/sign/components/SearchForm.vue
Normal file
122
src/views/zs/sign/components/SearchForm.vue
Normal file
@@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="searchForm" :model="searchForm" inline>
|
||||
<!-- <el-form-item label="筛选:" label-width="90px">
|
||||
<DMRadio v-model="searchForm.quickSearch" :list="quickList" all-text="全部" @change="$emit('search')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="意向状态:" label-width="90px">
|
||||
<DMRadio v-model="searchForm.intentionState" :list="intentionOptions" all-text="全部" @change="$emit('search')" />
|
||||
</el-form-item> -->
|
||||
<el-row>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" style="width: 200px" placeholder="姓名/联系方式" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="成交时间">
|
||||
<el-date-picker v-model="dateRange" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="pickDateChange"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="全款状态">
|
||||
<el-select v-model="searchForm.state" placeholder="请选择" style="width: 120px" clearable>
|
||||
<el-option key="true" label="全款" value="true" />
|
||||
<el-option key="false" label="未全款" value="false" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="驾校" v-if="admin == 'true'">
|
||||
<el-select v-model="searchForm.signSchool" placeholder="请选择" style="width: 120px" clearable>
|
||||
<el-option v-for="dict in options.schoolOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="跟进人员">
|
||||
<el-select v-model="searchForm.followUser2" placeholder="请选择" clearable>
|
||||
<el-option v-for="dict in options.userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属区域">
|
||||
<el-select v-model="searchForm.area" placeholder="请选择" clearable size="small">
|
||||
<el-option v-for="dict in options.areaOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="回款状态" v-if="admin == 'true'">
|
||||
<el-select v-model="searchForm.moneyState" placeholder="请选择" clearable size="small">
|
||||
<el-option v-for="dict in options.moneyStateOptions" :key="dict.dictValue" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="审核状态" v-if="admin == 'true'">
|
||||
<el-select v-model="searchForm.checkState" placeholder="请选择" clearable size="small">
|
||||
<el-option key="1" label="待审核" value="1" />
|
||||
<el-option key="2" label="已审核" value="2" />
|
||||
<el-option key="3" label="驳回" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0">
|
||||
<el-button type="primary" icon="el-icon-search" @click="$emit('search')">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import DMRadio from '@/components/DMRadio';
|
||||
export default {
|
||||
components: {
|
||||
DMRadio
|
||||
},
|
||||
props: {
|
||||
admin: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
options: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
userOptions: [],
|
||||
schoolOptions: [],
|
||||
areaOptions: [],
|
||||
moneyStateOptions: []
|
||||
})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
searchForm: {},
|
||||
quickList: [
|
||||
{ value: 1, label: '我创建的' },
|
||||
{ value: 2, label: '我的有效' },
|
||||
{ value: 3, label: '有效线索' },
|
||||
{ value: 4, label: '今日有效线索' },
|
||||
{ value: 5, label: '今日跟踪' },
|
||||
{ value: 6, label: '过期线索' },
|
||||
{ value: 7, label: '相关线索' },
|
||||
{ value: 8, label: '撞单线索' }
|
||||
],
|
||||
intentionOptions: [],
|
||||
dateRange: []
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
resetQuery() {
|
||||
this.searchForm = {
|
||||
createTime: [],
|
||||
state: undefined,
|
||||
percentageState: undefined,
|
||||
followUser2: undefined,
|
||||
dealState: undefined,
|
||||
dealDate: undefined,
|
||||
name: undefined
|
||||
};
|
||||
this.dateRange = []
|
||||
this.$emit('search')
|
||||
},
|
||||
pickDateChange() {
|
||||
this.addDateRange(this.searchForm, this.dateRange)
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
641
src/views/zs/sign/components/SignFormDialog.vue
Normal file
641
src/views/zs/sign/components/SignFormDialog.vue
Normal file
@@ -0,0 +1,641 @@
|
||||
<template>
|
||||
<!-- 成交登记对话框 -->
|
||||
<el-dialog title="成交登记" :visible.sync="visible" width="800px" append-to-body :close-on-click-modal="false" v-loading="signLoading" style>
|
||||
<!-- <div style="height:500px;overflow-y:auto;"> -->
|
||||
<span style="color:red;">输入联系方式后会进行线索数据匹配!</span>
|
||||
<el-form :model="modalForm" ref="modalForm" :rules="modalRules" label-width="110px" :disabled="!modalForm.signEdit">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学员联系方式" prop="phone">
|
||||
<el-input v-model="modalForm.phone" :disabled="modalForm.clueId != undefined || !modalForm.phoneEdit" @blur="searchClue"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学员姓名" prop="name">
|
||||
<el-input v-model="modalForm.name" :disabled=" modalForm.clueId != undefined"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="线索来源" prop="source">
|
||||
<el-select v-model="modalForm.source" placeholder="请选择" clearable size="small" :disabled="modalForm.clueId != undefined">
|
||||
<el-option v-for="(dict, index) in sourceOptions" :key="index" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否全款" prop="state">
|
||||
<el-radio-group v-model="modalForm.state">
|
||||
<el-radio :label="true">全款</el-radio>
|
||||
<el-radio :label="false">非全款</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker v-model="modalForm.dealDate" size="small" :picker-options="dateControl" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名价格(元)" prop="signPrice">
|
||||
<el-input v-model="modalForm.signPrice" placeholder="学员报名时需要交纳总共的钱" @blur="priceChange"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名驾校" prop="signSchool">
|
||||
<el-select v-model="modalForm.signSchool" filterable placeholder="请选择" value-key="schoolId" clearable size="small" @change="schoolChange">
|
||||
<el-option v-for="(dict, index) in schoolOptions" :key="index" :label="dict.schoolName" :value="dict.schoolId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名场地" prop="signPlace">
|
||||
<el-select v-model="modalForm.signPlace" filterable placeholder="请选择" clearable value-key="placeId" size="small" @change="placeChange">
|
||||
<el-option v-for="(dict, index) in placeOptions" :key="index" :label="dict.name" :value="dict.placeId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报名班型" prop="signClass">
|
||||
<el-select v-model="modalForm.signClass" filterable placeholder="请选择" clearable value-key="typeId" size="small" @change="priceChange">
|
||||
<el-option v-for="(dict, index) in classTypeOptions" :key="index" :label="`${dict.licenseType}-${dict.typeName}`" :value="dict.typeId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="对接人" prop="schoolPeople">
|
||||
<el-input v-model="modalForm.schoolPeople"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="驾校支付" prop="schoolPay">
|
||||
<el-input type="number" v-model="modalForm.schoolPay" placeholder="请输入驾校支付金额" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="驾考宝典款" prop="alipay">
|
||||
<el-input v-model="modalForm.alipay" placeholder="请输入驾考宝典款金额"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="额外支出" prop="extraPayType">
|
||||
<el-select v-model="modalForm.extraPayTypes" filterable multiple placeholder="请选择" clearable size="small">
|
||||
<el-option v-for="(dict, index) in extraPayTypeOptions" :key="index" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="额外支出金额" prop="extraPay">
|
||||
<el-input placeholder="请输入额外支出金额" v-model="modalForm.extraPay"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属人员" prop="followUser">
|
||||
<el-select v-model="modalForm.followUser" multiple placeholder="请选择" clearable size="small" :disabled="modalForm.clueId != undefined">
|
||||
<el-option v-for="(dict, index) in userOptions" :key="index" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属区域" prop="area">
|
||||
<el-select v-model="modalForm.area" placeholder="请选择" clearable size="small">
|
||||
<el-option v-for="(dict, index) in areaOptions" :key="index" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="线下接待人员" prop="offlineReceiver">
|
||||
<el-select v-model="modalForm.offlineReceiver" multiple placeholder="请选择" clearable size="small" :disabled="modalForm.clueId != undefined">
|
||||
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="admin == 'true'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="佣金明细" prop="commission">
|
||||
<el-select v-model="modalForm.commission" placeholder="请选择" clearable size="small">
|
||||
<el-option v-for="(dict, index) in commissionOptions" :key="index" :label="dict.dictLabel" :value="dict.dictValue" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="memo">
|
||||
<el-input type="textarea" :rows="2" v-model="modalForm.memo"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-form-item label="凭据" prop="evidence">
|
||||
<el-upload ref="signUpload" accept="image/*" list-type="picture-card" :file-list="fileList" :headers="signUpload.headers" :action="signUpload.url + '?type=2'" class="evidence-uploader" multiple :disabled="!modalForm.signEdit" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :on-preview="handlePictureCardPreview" :on-remove="handleRemove">
|
||||
<i class="el-icon-plus evidence-uploader-icon" />
|
||||
</el-upload>
|
||||
|
||||
<el-dialog :visible.sync="dialogVisible">
|
||||
<img width="100%" :src="dialogImageUrl" alt="">
|
||||
</el-dialog>
|
||||
|
||||
<!-- <div class="demo-image__preview">
|
||||
<div v-for="(item, index) in fileList" :key="index" class="demo-image__item">
|
||||
<el-image class="image-list-item" fit="contain" :src="preUrl + item.url" :preview-src-list="fileList.map(file => preUrl + file.url)" lazy>
|
||||
<i class="el-icon-close btn-close" @click="handleRemoveImage(index,item)" v-show="modalForm.signEdit" />
|
||||
|
||||
</el-image>
|
||||
</div>
|
||||
</div> -->
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="modalForm && modalForm.signId">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核记录">
|
||||
<CheckRecord :signId="modalForm.signId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- </div> -->
|
||||
<span slot="footer" v-if="modalForm.signEdit">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" :disabled="!canSubmit" @click="handleSubmit">提 交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addSign, updateSign } from '@/api/zs/sign'
|
||||
import { validateMoney } from '@/utils/validate'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import empApi from '@/api/system/employee'
|
||||
import schoolAPi from '@/api/sch/school'
|
||||
import { getAllPlaces } from '@/api/sch/place'
|
||||
import { getClassTypeTableList } from '@/api/sch/classType'
|
||||
import { uploadEvidence, deleteFile, } from '@/api/tool/common'
|
||||
import { getClueList } from '@/api/zs/clue'
|
||||
|
||||
import CheckRecord from './CheckRecord.vue'
|
||||
|
||||
export default {
|
||||
name: 'SignFormDialog',
|
||||
components: {
|
||||
CheckRecord
|
||||
},
|
||||
props: {
|
||||
clueInfo: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
admin: localStorage.getItem('admin'),
|
||||
preUrl: process.env.VUE_APP_BASE_API,
|
||||
userId: localStorage.getItem('userId'),
|
||||
loading: {
|
||||
tableLoading: false,
|
||||
modalSaveLoading: false,
|
||||
},
|
||||
visible: false,
|
||||
signLoading: false,
|
||||
modalForm: {},
|
||||
modalRules: {
|
||||
name: { required: true, message: '姓名不为空', trigger: 'blur' },
|
||||
phone: { required: true, message: '联系方式不为空', trigger: 'blur' },
|
||||
source: { required: true, message: '线索来源不为空', trigger: 'blur' },
|
||||
area: { required: true, message: '所属区域不为空', trigger: 'blur' },
|
||||
dealDate: { required: true, message: '成交时间不为空', trigger: 'blur,change', },
|
||||
state: { required: true, message: '是否权限必选', trigger: 'blur,change', },
|
||||
followUser: { required: true, message: '归属人员不为空', trigger: 'blur,change', },
|
||||
signSchool: { required: true, message: '报名驾校不为空', trigger: 'blur,change', },
|
||||
signPlace: { required: true, message: '报名场地不为空', trigger: 'blur,change', },
|
||||
signClass: { required: true, message: '报名班型不为空', trigger: 'blur,change', },
|
||||
dealState: { required: true, message: '结算情况不为空', trigger: 'blur,change', },
|
||||
signPrice: { required: true, validator: validateMoney, trigger: 'blur', },
|
||||
},
|
||||
userOptions: [],
|
||||
clueOptions: [],
|
||||
schoolOptions: [],
|
||||
placeOptions: [],
|
||||
classTypeOptions: [],
|
||||
sourceOptions: [],
|
||||
commissionOptions: [],
|
||||
extraPayTypeOptions: [],
|
||||
percentageOptions: [
|
||||
{
|
||||
value: '驾校已结算',
|
||||
label: '驾校已结算',
|
||||
},
|
||||
{
|
||||
value: '提成已发放',
|
||||
label: '提成已发放',
|
||||
},
|
||||
],
|
||||
dateControl: undefined,
|
||||
areaOptions: [],
|
||||
fileList: [],
|
||||
dialogImageUrl: '',
|
||||
dialogVisible: false,
|
||||
uploadFile: undefined,
|
||||
checkRecord: [],
|
||||
canSubmit: true,
|
||||
signUpload: {
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/common/upload',
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
//线索来源
|
||||
this.getDicts('dm_source').then((response) => {
|
||||
this.sourceOptions = response.data
|
||||
})
|
||||
//意向状态
|
||||
this.getDicts('dm_intention_state').then((response) => {
|
||||
this.intentionOptions = response.data
|
||||
})
|
||||
//佣金明细
|
||||
this.getDicts('dm_commission').then((response) => {
|
||||
this.commissionOptions = response.data
|
||||
})
|
||||
//额外支出类型
|
||||
this.getDicts('dm_extra_pay').then((response) => {
|
||||
this.extraPayTypeOptions = response.data
|
||||
})
|
||||
//所属区域
|
||||
this.getDicts('dm_area').then((response) => {
|
||||
this.areaOptions = response.data
|
||||
})
|
||||
this.getSchools()
|
||||
this.getEmployee()
|
||||
|
||||
},
|
||||
methods: {
|
||||
init(info = undefined) {
|
||||
this.fileList = []
|
||||
this.picList = []
|
||||
this.canSubmit = true;
|
||||
this.checkRecord = []
|
||||
this.$nextTick(() => {
|
||||
this.resetForm('modalForm')
|
||||
this.resetForm();
|
||||
//如果是线索页面的弹框,则处理
|
||||
this.dealClue(this.clueInfo);
|
||||
if (info && info.signId) {
|
||||
//修改
|
||||
this.handleUpdate(info)
|
||||
} else {
|
||||
//新增
|
||||
this.handleAdd()
|
||||
}
|
||||
this.visible = true;
|
||||
});
|
||||
},
|
||||
getSchools() {
|
||||
schoolAPi.pageList().then((resp) => {
|
||||
this.schoolOptions = resp.rows
|
||||
})
|
||||
},
|
||||
getPlaces(schoolId) {
|
||||
getAllPlaces({ schoolId: schoolId, status: '0' }).then((resp) => {
|
||||
this.placeOptions = resp.data
|
||||
})
|
||||
},
|
||||
getClassTypes(schoolId, placeId) {
|
||||
getClassTypeTableList({ schoolId: schoolId, placeId: placeId, status: '0' }).then(
|
||||
(resp) => {
|
||||
this.classTypeOptions = resp.rows
|
||||
}
|
||||
)
|
||||
},
|
||||
getEmployee() {
|
||||
empApi.getEmployee().then((resp) => {
|
||||
if (resp.code == 200) {
|
||||
this.userOptions = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
checkDate(date) {
|
||||
let dealDate = new Date(date)
|
||||
let year = dealDate.getFullYear() //得到年份
|
||||
let month = dealDate.getMonth() + 1 //得到月份
|
||||
let endDate = new Date(year, month, 5)
|
||||
let now = new Date()
|
||||
if (now.getTime() >= endDate.getTime()) {
|
||||
this.signEdit = true
|
||||
}
|
||||
},
|
||||
//驾校change事件
|
||||
schoolChange(e) {
|
||||
this.$set(this.modalForm, 'signPlace', undefined)
|
||||
this.$set(this.modalForm, 'signClass', undefined)
|
||||
this.classTypeOptions = []
|
||||
this.$set(this.modalForm, 'schoolPeople', undefined)
|
||||
this.$set(this.modalForm, 'area', undefined)
|
||||
this.getPlaces(e)
|
||||
},
|
||||
//場地change事件
|
||||
placeChange() {
|
||||
this.$set(this.modalForm, 'signClass', undefined)
|
||||
if (this.modalForm.signPlace) {
|
||||
const place = this.placeOptions.find(
|
||||
(item) => item.placeId === this.modalForm.signPlace
|
||||
)
|
||||
this.$set(this.modalForm, 'schoolPeople', place.contact)
|
||||
this.$set(this.modalForm, 'area', place.area)
|
||||
this.getClassTypes(this.modalForm.signSchool, this.modalForm.signPlace)
|
||||
} else {
|
||||
this.classTypeOptions = []
|
||||
this.$set(this.modalForm, 'schoolPeople', undefined)
|
||||
this.$set(this.modalForm, 'area', undefined)
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
this.placeOptions = []
|
||||
this.classTypeOptions = []
|
||||
this.setDate(true)
|
||||
},
|
||||
handleUpdate(item) {
|
||||
this.setDate(false)
|
||||
this.modalForm = Object.assign({}, item)
|
||||
this.getPlaces(this.modalForm.signSchool)
|
||||
this.getClassTypes(this.modalForm.signSchool, this.modalForm.signPlace)
|
||||
this.modalForm.phoneEdit = false
|
||||
if (this.modalForm.fileList) {
|
||||
this.fileList = this.modalForm.fileList
|
||||
}
|
||||
},
|
||||
//重置表单
|
||||
resetForm() {
|
||||
let now = new Date()
|
||||
let year = now.getFullYear() //得到年份
|
||||
let month = now.getMonth() + 1 //得到月份
|
||||
let date = now.getDate() //得到日期
|
||||
this.modalForm = {
|
||||
signId: undefined,
|
||||
clueId: undefined,
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
source: undefined,
|
||||
followUser: [this.userId],
|
||||
offlineReceiver: undefined,
|
||||
dealDate: year + '-' + month + '-' + date,
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
signPrice: undefined,
|
||||
schoolPeople: undefined,
|
||||
schoolPay: undefined,
|
||||
alipay: undefined,
|
||||
profit: undefined,
|
||||
percentage: undefined,
|
||||
detail: undefined,
|
||||
dealState: undefined,
|
||||
extraPayType: undefined,
|
||||
extraPayTypes: undefined,
|
||||
extraPay: undefined,
|
||||
percentageState: undefined,
|
||||
memo: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined,
|
||||
state: true,
|
||||
commission: undefined,
|
||||
signEdit: true,
|
||||
phoneEdit: true,
|
||||
fileList: []
|
||||
}
|
||||
},
|
||||
setDate(flag) {
|
||||
let now = new Date()
|
||||
let year = now.getFullYear() //得到年份
|
||||
let month = now.getMonth() //得到月份
|
||||
let start = new Date(year, month - 1, 1)
|
||||
// console.log(new Date(year, month , 9, 9))
|
||||
if (flag && now >= new Date(year, month, 5)) {
|
||||
start = new Date(year, month, 1)
|
||||
}
|
||||
if (this.admin != 'true') {
|
||||
this.dateControl = {
|
||||
disabledDate: (time) => {
|
||||
return time.getTime() < start || time.getTime() >= new Date()
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
handleSignSave() {
|
||||
this.modalForm.checkState = 1
|
||||
this.modalForm.fileList = this.fileList
|
||||
//保存登记表
|
||||
this.$refs.modalForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.canSubmit = false;
|
||||
if (this.modalForm.signId) {
|
||||
updateSign(this.modalForm).then((resp) => {
|
||||
if (resp.code == 200) {
|
||||
this.$message.success('提交成功')
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList');
|
||||
} else {
|
||||
this.canSubmit = true;
|
||||
}
|
||||
})
|
||||
} else {
|
||||
addSign(this.modalForm).then((resp) => {
|
||||
if (resp.code == 200) {
|
||||
this.$message.success('提交成功')
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
} else {
|
||||
// this.$message.error("登记失败:" + resp.msg);
|
||||
this.canSubmit = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$confirm('提交后将进入审核阶段,是否提交确认提交?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then((res) => {
|
||||
this.handleSignSave()
|
||||
})
|
||||
.catch(function () { })
|
||||
},
|
||||
//自动检索对应的线索
|
||||
searchClue(e) {
|
||||
console.log(e.target.value)
|
||||
if (e.target.value && e.target.value != '') {
|
||||
this.signLoading = true
|
||||
getClueList({ state: false, name: e.target.value }).then((response) => {
|
||||
if (response.code == 200 && response.rows && response.rows[0]) {
|
||||
this.dealClue(response.rows[0]);
|
||||
} else {
|
||||
this.dealClue(undefined);
|
||||
}
|
||||
this.signLoading = false
|
||||
})
|
||||
} else {
|
||||
this.dealClue(undefined);
|
||||
}
|
||||
},
|
||||
//检索到的线索进行赋值
|
||||
dealClue(clueInfo) {
|
||||
if (clueInfo) {
|
||||
this.modalForm.clueId = clueInfo.clueId
|
||||
this.modalForm.name = clueInfo.name
|
||||
this.modalForm.phone = clueInfo.phone
|
||||
this.modalForm.source = clueInfo.source
|
||||
this.modalForm.followUser = clueInfo.followUser
|
||||
this.modalForm.offlineReceiver = clueInfo.offlineReceiver
|
||||
} else {
|
||||
this.modalForm.clueId = undefined
|
||||
this.modalForm.name = undefined
|
||||
this.modalForm.source = undefined
|
||||
this.modalForm.followUser = undefined
|
||||
this.modalForm.offlineReceiver = undefined
|
||||
}
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList)
|
||||
this.fileList = fileList
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dialogImageUrl = file.url
|
||||
this.dialogVisible = true
|
||||
},
|
||||
// handleSuccess(response, file, fileList) {
|
||||
// console.log(file, fileList)
|
||||
// },
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
console.log(file, fileList)
|
||||
this.signUpload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
console.log(file, fileList)
|
||||
this.signUpload.isUploading = false;
|
||||
this.$refs.signUpload.clearFiles();
|
||||
// this.dialogImageUrl = process.env.VUE_APP_BASE_API + response.fileName
|
||||
this.fileList.push({ name: response.newFileName, url: process.env.VUE_APP_BASE_API + response.fileName })
|
||||
},
|
||||
handleUploadFile(param) {
|
||||
let fileObj = param.file
|
||||
|
||||
const isLt2M = fileObj.size / 1024 / 1024 < 2
|
||||
if (!isLt2M) {
|
||||
this.$message.error('上传头像图片大小不能超过 2MB!')
|
||||
return
|
||||
}
|
||||
if (fileObj.type === 'image/jpeg') {
|
||||
this.uploadFile = new File([fileObj], new Date().getTime() + '.jpg', {
|
||||
type: 'image/jpeg',
|
||||
})
|
||||
this.upload()
|
||||
} else if (fileObj.type === 'image/png') {
|
||||
this.uploadFile = new File([fileObj], new Date().getTime() + '.png', {
|
||||
type: 'image/png',
|
||||
})
|
||||
this.upload()
|
||||
} else {
|
||||
this.$message.error('只能上传jpg/png文件')
|
||||
return
|
||||
}
|
||||
},
|
||||
upload() {
|
||||
var param = new FormData() // FormData 对象
|
||||
param.append('file', this.uploadFile) // 文件对象
|
||||
param.append('name', 'ziguiyu') // 其他参数
|
||||
uploadEvidence(param)
|
||||
.then((response) => {
|
||||
if (response.code == 200) {
|
||||
// this.$message({
|
||||
// message: '上传成功',
|
||||
// type: 'success'
|
||||
// });
|
||||
//this.form.logo = "https://duima.cainiao-xueche.com:8443/duima" + response.data;
|
||||
this.dialogImageUrl = process.env.VUE_APP_BASE_API + response.data
|
||||
this.fileList.push({ name: '', url: this.dialogImageUrl })
|
||||
// this.dialogImageUrl = file.url;
|
||||
// this.dialogVisible = true;
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$message.error('上传失败,请稍后重试')
|
||||
})
|
||||
},
|
||||
handleRemoveImage(index, item) {
|
||||
deleteFile(item).then((resp) => {
|
||||
if (resp && resp.data)
|
||||
// 最好先通过接口删除服务器图片
|
||||
this.modalForm.fileList.splice(index, 1)
|
||||
})
|
||||
},
|
||||
priceChange() {
|
||||
//计算驾校支付款 报名价格-班型底价
|
||||
if (this.modalForm.signClass && this.modalForm.signPrice) {
|
||||
const minprice = this.classTypeOptions.find(
|
||||
(item) => item.typeId == this.modalForm.signClass
|
||||
).minPrice
|
||||
if (minprice) {
|
||||
this.$set(this.modalForm, 'schoolPay', this.modalForm.signPrice - minprice)
|
||||
}
|
||||
} else {
|
||||
this.$set(this.modalForm, 'schoolPay', undefined)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.demo-image__item {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
display: inline-block;
|
||||
}
|
||||
.image-list-item {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.el-upload--picture-card {
|
||||
width: 100px !important;
|
||||
height: 100px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
95
src/views/zs/sign/components/UploadDialog.vue
Normal file
95
src/views/zs/sign/components/UploadDialog.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<!-- 用户导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body :close-on-click-modal="false">
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
<!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的学员数据 -->
|
||||
<el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
<div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { importTemplate, } from '@/api/zs/clue';
|
||||
import { importData } from '@/api/tool/common';
|
||||
|
||||
export default {
|
||||
name: 'UploadDialog',
|
||||
props: {
|
||||
userOptions: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
canSubmit: true,
|
||||
isUploading: true,
|
||||
ydtData: undefined,
|
||||
// 用户导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(用户导入)
|
||||
open: false,
|
||||
// 弹出层标题(用户导入)
|
||||
title: '',
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的用户数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: 'Bearer ' + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + '/system/sign/importData',
|
||||
},
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(info = undefined) {
|
||||
this.visible = true;
|
||||
this.ydtData = undefined;
|
||||
this.$nextTick(() => {
|
||||
if (info) {
|
||||
this.ydtData = this.deepClone(info);
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
importTemplate({ ydtData: this.ydtData }).then((response) => {
|
||||
this.download(response.msg);
|
||||
});
|
||||
},
|
||||
async handleUpload(data) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', data.file);
|
||||
this.isUploading = true;
|
||||
importData(this.ydtData, formData).then((resp) => {
|
||||
this.isUploading = false;
|
||||
if (resp.code === 200) {
|
||||
this.$alert(resp.msg, '导入结果', {
|
||||
dangerouslyUseHTMLString: true
|
||||
});
|
||||
this.$emit('update:dialog.batchUpdateVisible', false);
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
});
|
||||
},
|
||||
closeDialog() {
|
||||
this.$emit('update:dialog.batchUpdateVisible', false);
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
254
src/views/zs/sign/index.vue
Normal file
254
src/views/zs/sign/index.vue
Normal file
@@ -0,0 +1,254 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<SearchForm v-show="showSearch" ref="SearchForm" @search="_getTableList" :options="options" />
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAddAndUpdate(undefined)">新增</el-button>
|
||||
<el-button v-if="admin == 'true'" type="warning" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :show-search.sync="showSearch" :columns="columns" @queryTable="_getTableList" />
|
||||
</el-row>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table v-loading="loading" :data="tableDataList" stripe size="mini" border @sort-change="changeSort">
|
||||
<el-table-column type="index" width="50" align="center" />
|
||||
<template v-for="item in columns">
|
||||
<el-table-column v-if="item.visible && item.prop === 'state'" :key="item.prop" :label="item.label" align="center" :width="item.width" :prop="item.prop">
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="success" size="mini" v-if="row.state">全款</el-button>
|
||||
<el-button type="warning" size="mini" v-else>未全款</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-else-if="item.visible" :key="item.prop" :label="item.label" align="center" :width="item.width" :prop="item.prop" :show-overflow-tooltip="item.overflow" />
|
||||
</template>
|
||||
<el-table-column align="center" width="100" fixed="right" label="审核状态">
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="danger" size="mini" v-if="row.checkState == 1">待审核</el-button>
|
||||
<el-button type="success" size="mini" v-else-if="row.checkState == 2">已审核</el-button>
|
||||
<el-button type="warning" size="mini" v-else-if="row.checkState == 3">驳回</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="160">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" v-if="scope.row.signEdit" icon="el-icon-edit" @click="handleAddAndUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" v-if="scope.row.checkState == 1 " @click="handleCheck(scope.row)">审核</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination :total="total" :page.sync="searchForm.pageNum" :limit.sync="searchForm.pageSize" @pagination="_getTableList" />
|
||||
|
||||
<!-- 引入成交登记弹框 -->
|
||||
<SignFormDialog v-if="dialog.signVisible" ref="signDialogForm" :dialog-visible="dialog.signVisible" @refreshDataList="_getTableList" />
|
||||
|
||||
<!-- 引入审核弹框 -->
|
||||
<CheckDialog v-if="dialog.checkVisible" ref="checkDialogForm" :dialog-visible="dialog.checkVisible" @refreshDataList="_getTableList" />
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<UploadDialog v-if="dialog.uploadVisible" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import { getSignList, exportData, deleteSign } from '@/api/zs/sign'
|
||||
import empApi from '@/api/system/employee'
|
||||
import CheckDialog from './components/CheckDialog'
|
||||
import SearchForm from './components/SearchForm.vue'
|
||||
import SignFormDialog from './components/SignFormDialog.vue'
|
||||
import { defaultColumns } from './columns.js';
|
||||
import UploadDialog from './components/UploadDialog.vue'
|
||||
|
||||
|
||||
export default {
|
||||
name: 'Sign',
|
||||
components: {
|
||||
SearchForm,
|
||||
CheckDialog,
|
||||
SignFormDialog,
|
||||
UploadDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
admin: localStorage.getItem('admin'),
|
||||
userId: localStorage.getItem('userId'),
|
||||
searchForm: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
loading: false,
|
||||
columns: [],
|
||||
tableDataList: [],
|
||||
total: 0,
|
||||
userOptions: [],
|
||||
schoolOptions: [],
|
||||
moneyStateOptions: [],
|
||||
percentageOptions: [
|
||||
{
|
||||
value: '驾校已结算',
|
||||
label: '驾校已结算',
|
||||
},
|
||||
{
|
||||
value: '提成已发放',
|
||||
label: '提成已发放',
|
||||
},
|
||||
],
|
||||
areaOptions: [],
|
||||
showSearch: true,
|
||||
dialog: {
|
||||
signVisible: false,
|
||||
checkVisible: false,
|
||||
uploadVisible: false
|
||||
},
|
||||
options: {
|
||||
userOptions: [],
|
||||
schoolOptions: [],
|
||||
areaOptions: [],
|
||||
moneyStateOptions: []
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const str = localStorage.getItem(`${this.$route.name}-table-columns`);
|
||||
this.columns = str ? JSON.parse(str) : defaultColumns;
|
||||
//回款状态
|
||||
this.getDicts('dm_money_state').then((response) => {
|
||||
this.options.moneyStateOptions = response.data
|
||||
})
|
||||
//s所属区域
|
||||
this.getDicts('dm_area').then((response) => {
|
||||
this.options.areaOptions = response.data
|
||||
})
|
||||
this.getSchools()
|
||||
this._getTableList()
|
||||
this.getEmployee()
|
||||
},
|
||||
methods: {
|
||||
// 搜索
|
||||
handleQuery() {
|
||||
this.searchForm.pageNum = 1
|
||||
this._getTableList()
|
||||
},
|
||||
_getTableList() {
|
||||
this.loading = true;
|
||||
const tempForm = this.$refs.SearchForm?.searchForm || {};
|
||||
const params = { ...this.searchForm, ...tempForm };
|
||||
getSignList(params).then(
|
||||
(response) => {
|
||||
this.tableDataList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
}
|
||||
)
|
||||
},
|
||||
getSchools() {
|
||||
empApi.pageList().then((resp) => {
|
||||
this.options.schoolOptions = resp.data
|
||||
})
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.$confirm('是否确认导出所有成交记录项?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then((resp) => {
|
||||
const tempForm = this.$refs.SearchForm?.searchForm || {};
|
||||
this.download('zs/sign/export', tempForm, `登记信息_${new Date().getTime()}.xlsx`);
|
||||
})
|
||||
.catch(function () { })
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = '成交记录导入'
|
||||
this.upload.open = true
|
||||
},
|
||||
/** 查询员工 */
|
||||
getEmployee() {
|
||||
empApi.getEmployee().then((resp) => {
|
||||
if (resp.code == 200) {
|
||||
this.options.userOptions = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
changeSort(val) {
|
||||
if (val.order) {
|
||||
this.searchForm.orderName = val.prop
|
||||
if (val.order == 'ascending') {
|
||||
this.searchForm.orderType = 'asc'
|
||||
} else {
|
||||
this.searchForm.orderType = 'desc'
|
||||
}
|
||||
} else {
|
||||
this.searchForm.orderName = ''
|
||||
this.searchForm.orderType = ''
|
||||
}
|
||||
this.getPageList()
|
||||
},
|
||||
handleAddAndUpdate(item) {
|
||||
this.dialog.signVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.signDialogForm.init(item)
|
||||
})
|
||||
},
|
||||
handleDelete(item) {
|
||||
this.$confirm(
|
||||
'是否确认删除该条登记(“' + item.name + '/' + item.phone + '”)?',
|
||||
'警告',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then((res) => {
|
||||
deleteSign({ signId: item.signId }).then((resp) => {
|
||||
if (resp.code == 200) {
|
||||
this.$message.success('删除成功')
|
||||
this.getPageList()
|
||||
} else {
|
||||
//this.$message.error("删除失败:" + resp.msg);
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(function () { })
|
||||
},
|
||||
|
||||
handleCheck(item) {
|
||||
this.dialog.checkVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.checkDialogForm.init(item)
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss">
|
||||
.el-table .cell {
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
line-height: 23px;
|
||||
padding-left: 6px;
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
.el-card__body {
|
||||
padding: 10px !important;
|
||||
}
|
||||
|
||||
.el-timeline-item__wrapper {
|
||||
position: relative;
|
||||
padding-left: 20px;
|
||||
top: -3px;
|
||||
line-height: 25px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -35,20 +35,12 @@ module.exports = {
|
||||
proxy: {
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
target: `http://118.31.23.45/duima/`,
|
||||
// target: `http://vue.ruoyi.vip/prod-api/`,
|
||||
// target: `http://118.31.23.45/duima/`,
|
||||
target: `http://localhost:8086`,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
}
|
||||
},
|
||||
'/amap': {
|
||||
target: 'https://restapi.amap.com',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
pathRewrite: {
|
||||
'^/amap': ''
|
||||
}
|
||||
}
|
||||
},
|
||||
disableHostCheck: true
|
||||
@@ -105,12 +97,10 @@ module.exports = {
|
||||
config
|
||||
.plugin('ScriptExtHtmlWebpackPlugin')
|
||||
.after('html')
|
||||
.use('script-ext-html-webpack-plugin', [
|
||||
{
|
||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||
inline: /runtime\..*\.js$/
|
||||
}
|
||||
])
|
||||
.use('script-ext-html-webpack-plugin', [{
|
||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||
inline: /runtime\..*\.js$/
|
||||
}])
|
||||
.end();
|
||||
config.optimization.splitChunks({
|
||||
chunks: 'all',
|
||||
|
||||
Reference in New Issue
Block a user