Commit b495d97a authored by lei's avatar lei

代码格式美化

parent ac0d908a
{
"printWidth": 120,
"tabWidth": 2,
"singleQuote": true,
"semi": false,
"bracketSpacing": true,
"trailingComma": "none",
"jsxSingleQuote": true
}
<!-- 信息管理 --> <!-- 信息管理 -->
<template> <template>
<div class="boxmain"> <div class="boxmain">
<div class="title">推广部门信息统计</div> <div class="title">推广部门信息统计</div>
<div class="box-search"> <div class="box-search">
<el-select <el-select v-model="dateValue" placeholder="请选择报表统计形式" @change="setDateRange(dateValue)" clearable>
v-model="dateValue" <el-option v-for="item in formallyData" :label="item.name" :value="item.value" />
placeholder="请选择报表统计形式" </el-select>
@change="setDateRange(dateValue)" <el-date-picker
clearable size="mini"
> style="margin-left: 30px; height: 32px"
<el-option v-if="this.dateValue === 0"
v-for="item in formallyData" type="year"
:label="item.name" placeholder="选择年"
:value="item.value" v-model="preYear"
/> @change="yearChange"
</el-select> ></el-date-picker>
<el-date-picker <el-date-picker
size="mini" size="mini"
style="margin-left: 30px; height:32px;" style="margin-left: 30px; height: 32px"
v-if="this.dateValue === 0 " v-if="this.dateValue === 1"
type="year" v-model="preMonth"
placeholder="选择年" type="month"
v-model="preYear" placeholder="选择月"
@change="yearChange" value-format="timestamp"
></el-date-picker> @change="monthChange"
<el-date-picker ></el-date-picker>
size="mini" <div class="data_week" ref="data_week">
style="margin-left: 30px; height:32px;" <el-date-picker
v-if="this.dateValue === 1 " class="picker"
v-model="preMonth" type="week"
type="month" :editable="false"
placeholder="选择月" placeholder="请选择周"
value-format="timestamp" v-if="this.dateValue === 2"
@change="monthChange" :picker-options="{ firstDayOfWeek: 1 }"
></el-date-picker> v-model="seletWeekValue"
<div class="data_week" ref="data_week"> format="yyyy年第WW周"
<el-date-picker :clearable="false"
class="picker" @change="changeweek"
type="week" ></el-date-picker>
:editable="false" <div class="week-picker">
placeholder="请选择周" <el-input
v-if="this.dateValue === 2" v-if="this.dateValue === 2"
:picker-options="{'firstDayOfWeek': 1}" class="weekDataInput"
v-model="seletWeekValue" v-model="weekTime"
format="yyyy年第WW周" prefix-icon="el-icon-date"
:clearable="false" placeholder="请选择日期"
@change="changeweek" :clearable="true"
></el-date-picker> ></el-input>
<div class="week-picker"> </div>
<el-input </div>
v-if="this.dateValue === 2"
class="weekDataInput"
v-model="weekTime"
prefix-icon="el-icon-date"
placeholder="请选择日期"
:clearable="true"
></el-input>
</div>
</div>
<!-- <el-select <!-- <el-select
style="margin-left: 30px;" style="margin-left: 30px;"
v-model="newManage.customerSource" v-model="newManage.customerSource"
placeholder="请选择信息分类" placeholder="请选择信息分类"
...@@ -74,623 +64,626 @@ ...@@ -74,623 +64,626 @@
/> />
</el-select> --> </el-select> -->
<treeselect <treeselect
v-model="newManage.customerSource" v-model="newManage.customerSource"
:options="infoTree.menus" :options="infoTree.menus"
:load-options="loadInfoTreeMenus" :load-options="loadInfoTreeMenus"
style="width:230px;margin-left:20px;" style="width: 230px; margin-left: 20px"
placeholder="请选择类别" placeholder="请选择类别"
/> />
<el-button <el-button type="primary" style="margin-left: 30px" @click="toSearch" icon="el-icon-share"> 统计 </el-button>
type="primary"
style="margin-left: 30px"
@click="toSearch"
icon="el-icon-share"
>
统计
</el-button>
</div>
<div class="box-top">
<div class="boxtext">
<div>今日新增信息:<span>{{this.typeManage.newToday}}</span></div>
<div>昨日新增信息:<span>{{this.typeManage.newlyIncreased}}</span></div>
</div>
</div>
<div class="box-center">
<div class="box-center-left">
<div>推广信息统计</div>
<div ref="histogram" class="chartOne" />
</div>
<div class="box-center-right">
<div>推广信息分类统计</div>
<div ref="pieChart" class="chartTwo"/>
</div>
</div>
<div class="box-bottom">
<div class="box-bottom-top">
<div class="list">数据列表</div>
<el-date-picker
:default-time="['00:00:00', '23:59:59']"
v-model="exportTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="margin-left: 30px;"
>
</el-date-picker>
<el-button
type="success"
@click="exportRecord"
icon="el-icon-share"
style="margin-left: 30px;"
>导出客户跟进情况记录</el-button>
</div>
<div class="box-bottom-table">
<el-table :data="typeManage.selectdata" style="width: 97%;margin-left: 30px;" >
<el-table-column type="index" label="序号" width="200"/>
<el-table-column prop="name" label="姓名"/>
<el-table-column prop="tel" label="电话"/>
<el-table-column prop="saleidStr" label="销售人员"/>
<el-table-column prop="classidStr" label="信息分类"/>
<el-table-column prop="useridStr" label="推广人员"/>
<el-table-column prop="inforStatus" label="信息状态">
<template slot-scope="scope">
<span v-if="scope.row.inforStatus==='0'">未成交</span>
<span v-else>已成交</span>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
:total="typeManage.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
style="margin:20px 0px 20px 30px;"
/>
</div>
</div>
</div> </div>
<div class="box-top">
<div class="boxtext">
<div>
今日新增信息:<span>{{ this.typeManage.newToday }}</span
>
</div>
<div>
昨日新增信息:<span>{{ this.typeManage.newlyIncreased }}</span
>
</div>
</div>
</div>
<div class="box-center">
<div class="box-center-left">
<div>推广信息统计</div>
<div ref="histogram" class="chartOne" />
</div>
<div class="box-center-right">
<div>推广信息分类统计</div>
<div ref="pieChart" class="chartTwo" />
</div>
</div>
<div class="box-bottom">
<div class="box-bottom-top">
<div class="list">数据列表</div>
<el-date-picker
:default-time="['00:00:00', '23:59:59']"
v-model="exportTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
style="margin-left: 30px"
>
</el-date-picker>
<el-button type="success" @click="exportRecord" icon="el-icon-share" style="margin-left: 30px"
>导出客户跟进情况记录</el-button
>
</div>
<div class="box-bottom-table">
<el-table :data="typeManage.selectdata" style="width: 97%; margin-left: 30px">
<el-table-column type="index" label="序号" width="200" />
<el-table-column prop="name" label="姓名" />
<el-table-column prop="tel" label="电话" />
<el-table-column prop="saleidStr" label="销售人员" />
<el-table-column prop="classidStr" label="信息分类" />
<el-table-column prop="useridStr" label="推广人员" />
<el-table-column prop="inforStatus" label="信息状态">
<template slot-scope="scope">
<span v-if="scope.row.inforStatus === '0'">未成交</span>
<span v-else>已成交</span>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
:total="typeManage.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
style="margin: 20px 0px 20px 30px"
/>
</div>
</div>
</div>
</template> </template>
<script> <script>
import axios from "axios"; import axios from 'axios'
import echarts from "echarts"; import echarts from 'echarts'
import {parseTime, Tools, FileStream } from "../../utils"; import { parseTime, Tools, FileStream } from '../../utils'
import {getAllCategory,deliverList,allDepartments,getEchrtsData,expRecord, expClientData} from "@/api/census.js"; import { getAllCategory, deliverList, allDepartments, getEchrtsData, expRecord, expClientData } from '@/api/census.js'
import {reqInformationTreeList} from "@/api/treeMenus.js"; import { reqInformationTreeList } from '@/api/treeMenus.js'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default { export default {
data() { data() {
return { return {
// 周选择器 // 周选择器
seletWeekValue:"", seletWeekValue: '',
weekTime: "", weekTime: '',
startTimeNum: "", startTimeNum: '',
endTimeNum: "", endTimeNum: '',
options: [{ options: [
value: 'zhinan', {
label: '副总经理', value: 'zhinan',
children: [ label: '副总经理',
{ children: [
value: 'shejiyuanze', {
label: '推广一部', value: 'shejiyuanze',
}, { label: '推广一部'
value: 'daohang', },
label: '销售二中心', {
children: [{ value: 'daohang',
value: 'cexiangdaohang', label: '销售二中心',
label: '销售一部' children: [
}, { {
value: 'dingbudaohang', value: 'cexiangdaohang',
label: '销售二部' label: '销售一部'
}, },
{ {
value: 'san', value: 'dingbudaohang',
label: '销售三部' label: '销售二部'
}] },
}] {
}], value: 'san',
//默认x轴数据 label: '销售三部'
xAxisData:['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'], }
//选择时间后的数组 ]
preYear:'', }
preMonth:'', ]
// 时间状态选择 }
dateValue: 2, ],
// 信息分类接口 // 默认x轴数据
newManage:{ xAxisData: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
page:1, // 选择时间后的数组
size:10, preYear: '',
total:0, preMonth: '',
newdata:[], // 时间状态选择
customerSource:0,//信息分类 dateValue: 2,
departmentValue:"",//部门选择 // 信息分类接口
countPeople:"",//统计人员 newManage: {
countDepartment:""//统计部门 page: 1,
}, size: 10,
// 日期选择 total: 0,
formallyData: [ newdata: [],
{ customerSource: 0, // 信息分类
name: "年度", departmentValue: '', // 部门选择
value: 0, countPeople: '', // 统计人员
}, countDepartment: '' // 统计部门
{ },
name: "", // 日期选择
value: 1, formallyData: [
}, {
{ name: '年度',
name: "", value: 0
value:2, },
}, {
], name: '',
chooseVal:"", value: 1
//销售人员 },
salesPersonnelfrom:{ {
deliverAssign:[], name: '',
department:[] value: 2
}, }
typeManage:{ ],
page:0, chooseVal: '',
size:10, //销售人员
total:0, salesPersonnelfrom: {
selectdata:[], deliverAssign: [],
dropData:[], department: []
addDialog:false, },
newToday:"",//今日新增 typeManage: {
newlyIncreased:"",//昨日新增 page: 0,
editDialog:false, size: 10,
echartOneData:[], total: 0,
echartNewData:[], selectdata: [],
echartTwoData:[], dropData: [],
addDialog: false,
}, newToday: '', // 今日新增
tatilData:[], newlyIncreased: '', // 昨日新增
MonthstartTime:"", editDialog: false,
MonthendTime:"", echartOneData: [],
WeekstartTime:"", echartNewData: [],
WeekendTime:"", echartTwoData: []
// 遍历数组 },
foreachArr:[], tatilData: [],
data:[], MonthstartTime: '',
exportTime:"",//导出时间 MonthendTime: '',
// WeekstartTime: '',
infoTree:{ WeekendTime: '',
menus:[{id:0, label:'信息分类', children:null}], // 遍历数组
}, foreachArr: [],
}; data: [],
exportTime: '', // 导出时间
//
infoTree: {
menus: [{ id: 0, label: '信息分类', children: null }]
}
}
}, },
components: {Treeselect}, components: { Treeselect },
mounted() { mounted() {
this.setDateRange(); this.setDateRange()
this.changeweek(); this.changeweek()
this.echartshistogram = echarts.init(this.$refs.histogram); this.echartshistogram = echarts.init(this.$refs.histogram)
this.echrtsOne() this.echrtsOne()
this.echartspie = echarts.init(this.$refs.pieChart); this.echartspie = echarts.init(this.$refs.pieChart)
this.echrtsTwo() this.echrtsTwo()
this.classification() this.classification()
this.getSelectInfo(); this.getSelectInfo()
// 初始化搜索 // 初始化搜索
this.toSearch(); this.toSearch()
}, },
methods: { methods: {
// 获取分类下拉列表 // 获取分类下拉列表
getSelectInfo(){ getSelectInfo() {
var typeM = this.typeManage; var typeM = this.typeManage
var params = { var params = {
page:1, page: 1,
pageSize:999, pageSize: 999
}; }
getAllCategory(params).then((res) => { getAllCategory(params).then((res) => {
var dropDown = res.object.records || []; var dropDown = res.object.records || []
typeM.dropData = dropDown; typeM.dropData = dropDown
}); })
}, },
// 信息分类接口 // 信息分类接口
classification(params){ classification(params) {
var params = { var params = {
page:this.newManage.page, page: this.newManage.page,
pageSize:this.newManage.size, pageSize: this.newManage.size
}; }
getAllCategory(params).then((res) => { getAllCategory(params).then((res) => {
var newlist = res.object.records || []; var newlist = res.object.records || []
this.newManage.newdata=newlist this.newManage.newdata = newlist
}); })
}, },
// 切换时间 // 切换时间
setDateRange (val) { setDateRange(val) {
this.preMonth='' this.preMonth = ''
var date = new Date(); var date = new Date()
var year = date.getFullYear(); var year = date.getFullYear()
var month = date.getMonth() + 1; var month = date.getMonth() + 1
if(val===0){ if (val === 0) {
this.preMonth=`${year}` this.preMonth = `${year}`
this.xAxisData=['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'] this.xAxisData = [
this.echrtsOne() '一月',
}else if(val===1){ '二月',
this.preMonth=`${year}-${month}` '三月',
this.xAxisData=this.foreachArr; '四月',
this.echrtsOne() '五月',
}else if(val===2){ '六月',
this.xAxisData=['星期一','星期二','星期三','星期四','星期五','星期六','星期日'] '七月',
this.echrtsOne() '八月',
} '九月',
//this.dateValue = val '十月',
}, '十一月',
// 选择年时间 '十二月'
yearChange(e){ ]
var firstDay = new Date(e); this.echrtsOne()
firstDay.setDate(1); } else if (val === 1) {
firstDay.setMonth(0); this.preMonth = `${year}-${month}`
var lastDay = new Date(e); this.xAxisData = this.foreachArr
lastDay.setFullYear(lastDay.getFullYear()+2); this.echrtsOne()
lastDay.setDate(0); } else if (val === 2) {
lastDay.setMonth(-1); this.xAxisData = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日']
var startTime = e && Tools.Dates.format.call(new Date(firstDay), 'yyyy-MM-dd HH:mm:ss') || ''; this.echrtsOne()
var endTime = e && Tools.Dates.format.call(new Date(lastDay.getTime()+86399000), 'yyyy-MM-dd HH:mm:ss') || ''; }
this.MonthstartTime=startTime // this.dateValue = val
this.MonthendTime=endTime },
}, // 选择年时间
// 选择月时间 yearChange(e) {
monthChange(e){ var firstDay = new Date(e)
var dateList = Tools.Dates.format.call(new Date(e), 'yyyy-MM').split('-'); firstDay.setDate(1)
var year = dateList[0]; firstDay.setMonth(0)
var startMonth = dateList[1]; var lastDay = new Date(e)
var endStamp = new Date(year, startMonth, 0).getTime()+86399000; lastDay.setFullYear(lastDay.getFullYear() + 2)
var startTime = e && Tools.Dates.format.call(new Date(e), 'yyyy-MM-dd HH:mm:ss') || ''; lastDay.setDate(0)
var endTime = e && Tools.Dates.format.call(new Date(endStamp), 'yyyy-MM-dd HH:mm:ss') || ''; lastDay.setMonth(-1)
this.MonthstartTime=startTime var startTime = (e && Tools.Dates.format.call(new Date(firstDay), 'yyyy-MM-dd HH:mm:ss')) || ''
this.MonthendTime=endTime var endTime = (e && Tools.Dates.format.call(new Date(lastDay.getTime() + 86399000), 'yyyy-MM-dd HH:mm:ss')) || ''
}, this.MonthstartTime = startTime
// 计算周时间 this.MonthendTime = endTime
timestampToTime(timestamp) { },
var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000 // 选择月时间
let Y = date.getFullYear() + '-'; monthChange(e) {
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; var dateList = Tools.Dates.format.call(new Date(e), 'yyyy-MM').split('-')
let D = date.getDate() + ' '; var year = dateList[0]
return Y + M + D; var startMonth = dateList[1]
}, var endStamp = new Date(year, startMonth, 0).getTime() + 86399000
// 选择周时间 var startTime = (e && Tools.Dates.format.call(new Date(e), 'yyyy-MM-dd HH:mm:ss')) || ''
changeweek(val) { var endTime = (e && Tools.Dates.format.call(new Date(endStamp), 'yyyy-MM-dd HH:mm:ss')) || ''
if (val) { this.MonthstartTime = startTime
var todayDay = new Date(val); this.MonthendTime = endTime
} else { },
var todayDay = new Date(); // 计算周时间
} timestampToTime(timestamp) {
let todayOfWeek = todayDay.getDay(); var date = new Date(timestamp) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
let todayOfmonth = todayDay.getMonth(); let Y = date.getFullYear() + '-'
let todayOfDate = todayDay.getDate(); let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
let spendDay = 1; let D = date.getDate() + ' '
if (todayOfWeek != 0) { return Y + M + D
spendDay = 7 - todayOfWeek; },
} // 选择周时间
this.startTimeNum = todayDay.valueOf() - (6 - spendDay) * 86400000; changeweek(val) {
this.endTimeNum = todayDay.valueOf() + spendDay * 86400000; if (val) {
var startTimeStr = this.timestampToTime(this.startTimeNum); // 时间戳转字符串 var todayDay = new Date(val)
var endTimeStr = this.timestampToTime(this.endTimeNum); } else {
var startTime = Tools.Dates.format.call(new Date(startTimeStr), 'yyyy-MM-dd HH:mm:ss'); var todayDay = new Date()
var endTime = Tools.Dates.format.call(new Date(endTimeStr+"23:59:59"), 'yyyy-MM-dd HH:mm:ss'); }
this.MonthstartTime=startTime let todayOfWeek = todayDay.getDay()
this.MonthendTime=endTime; let todayOfmonth = todayDay.getMonth()
this.weekTime = startTimeStr + " - " + endTimeStr; // 2020-09-21~2020-09-27默认 let todayOfDate = todayDay.getDate()
}, let spendDay = 1
if (todayOfWeek != 0) {
// 柱状图 spendDay = 7 - todayOfWeek
echrtsOne(xAxisList){ }
let that = this; this.startTimeNum = todayDay.valueOf() - (6 - spendDay) * 86400000
this.echartshistogram.setOption({ this.endTimeNum = todayDay.valueOf() + spendDay * 86400000
tooltip: { var startTimeStr = this.timestampToTime(this.startTimeNum) // 时间戳转字符串
trigger: 'axis', var endTimeStr = this.timestampToTime(this.endTimeNum)
axisPointer: { var startTime = Tools.Dates.format.call(new Date(startTimeStr), 'yyyy-MM-dd HH:mm:ss')
type: 'shadow', var endTime = Tools.Dates.format.call(new Date(endTimeStr + '23:59:59'), 'yyyy-MM-dd HH:mm:ss')
} this.MonthstartTime = startTime
}, this.MonthendTime = endTime
xAxis: [ this.weekTime = startTimeStr + ' - ' + endTimeStr // 2020-09-21~2020-09-27默认
{ },
type: 'category',
name: '(数量/日)',
data: that.xAxisData[0] ? that.xAxisData : (xAxisList || []),
axisTick: {
alignWithLabel: true
},
axisLabel: {
interval: 0,//横轴信息全部显示
margin: 10, //刻度标签与轴线之间的距离
textStyle: {
fontSize: 9, //横轴字体大小
color: "#000000",//颜色
},
},
}
],
yAxis: [
{
type:'value',//关键
scale:true,
name: '(数量/条)',
min: (value) => {
return value.min
},
max: (value) => {
return value.max
},
interval: 50,
nameTextStyle: {
color: "#000000",
fontSize: 14,
fontFamily: "Microsoft YaHei",
fontWeight: 400,
},
}
],
series: [
{
name: '增加信息总数',
type: 'bar',
barWidth : 20, //柱图宽度
color: ['#5470c6'],
data:this.typeManage.echartOneData
}
]
});
},
// 饼图
echrtsTwo(){
this.echartspie.setOption({
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: '40',
fontWeight: 'bold'
}
},
itemStyle: {
normal: {
color: function (colors) {
var colorList = [
'#5470c6',
'#91cc75',
'#fac858',
'#ee6666',
'#73c0de',
'#3ba272'
];
return colorList[colors.dataIndex];
}
},
},
labelLine: {
show: false
},
data:this.typeManage.echartTwoData
},
]
})
},
// 请求接口根据参数不同获取数据
toSearch(){
var params = {
page:this.typeManage.page,
pageSize:this.typeManage.size,
form:this.dateValue,
startTime:this.MonthstartTime,
endTime: this.MonthendTime,
infoClassNo:this.newManage.customerSource,
};
getEchrtsData(params).then((res) => {
if(res.code ===200){
var selectArr=res.object.dataList||[]
this.typeManage.selectdata=selectArr
this.typeManage.total=res.object.total
this.typeManage.newToday=res.object.newInformationToday
this.typeManage.newlyIncreased=res.object.newInformationYesterday
this.data = JSON.parse(JSON.stringify(res).replace(/"tableArrayMonth"/g,'"tableArray"'))
this.typeManage.echartOneData=this.data.object.tableArray||[]
this.typeManage.echartTwoData=res.object.iconArray||[]
var arr=[];
for(var item of this.typeManage.echartOneData){
arr.push(item.data)
}
this.foreachArr=arr;
// 查询成功后调用echarts图一接口
this.echrtsOne(arr)
this.echrtsTwo()
}else if(res.object === 403){
var self = this;
self.$message({
type: "error",
message: "查询失败!请选择具体日期",
});
}
});
},
//获取全部信息分类分页
handleSizeChange(val) {
// 每页多少条
this.typeManage.size =val ;
this.toSearch();
},
handleCurrentChange(val) {
// 当前是多少页
this.typeManage.page = val;
this.toSearch();
},
// 导出数据表格
exportRecord(){
var params = {};
// 时间
if(this.exportTime instanceof Array) {
params.startTime = parseTime(new Date(this.exportTime[0]));
params.endTime = parseTime(new Date(this.exportTime[1]));
}
expRecord(params).then((res) => {
var file = res.object;
window.open('oa.gemho.cn:8004/customer_follow_form/'+file);
});
},
// 加载信息分类列表 // 柱状图
loadInfoTreeMenus({ action, parentNode, callback }) { echrtsOne(xAxisList) {
if(action === 'LOAD_CHILDREN_OPTIONS'){ let that = this
reqInformationTreeList({pid:parentNode.id}).then((res) => { this.echartshistogram.setOption({
if(res.code === 200){ tooltip: {
var list = res.object.records || []; trigger: 'axis',
parentNode.children = list.map(function(obj) { axisPointer: {
if(!obj.leaf) { type: 'shadow'
obj.children = null }
}; return obj },
}); xAxis: [
setTimeout(() => { {
callback() type: 'category',
}, 100) name: '(数量/日)',
}; data: that.xAxisData[0] ? that.xAxisData : xAxisList || [],
}); axisTick: {
}; alignWithLabel: true
}, },
axisLabel: {
interval: 0, // 横轴信息全部显示
margin: 10, // 刻度标签与轴线之间的距离
textStyle: {
fontSize: 9, // 横轴字体大小
color: '#000000' // 颜色
}
}
}
],
yAxis: [
{
type: 'value', // 关键
scale: true,
name: '(数量/条)',
min: (value) => {
return value.min
},
max: (value) => {
return value.max
},
interval: 50,
nameTextStyle: {
color: '#000000',
fontSize: 14,
fontFamily: 'Microsoft YaHei',
fontWeight: 400
}
}
],
series: [
{
name: '增加信息总数',
type: 'bar',
barWidth: 20, // 柱图宽度
color: ['#5470c6'],
data: this.typeManage.echartOneData
}
]
})
},
// 饼图
echrtsTwo() {
this.echartspie.setOption({
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: '40',
fontWeight: 'bold'
}
},
itemStyle: {
normal: {
color: function (colors) {
var colorList = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272']
return colorList[colors.dataIndex]
}
}
},
labelLine: {
show: false
},
data: this.typeManage.echartTwoData
}
]
})
},
// 请求接口根据参数不同获取数据
toSearch() {
var params = {
page: this.typeManage.page,
pageSize: this.typeManage.size,
form: this.dateValue,
startTime: this.MonthstartTime,
endTime: this.MonthendTime,
infoClassNo: this.newManage.customerSource
}
getEchrtsData(params).then((res) => {
if (res.code === 200) {
var selectArr = res.object.dataList || []
this.typeManage.selectdata = selectArr
this.typeManage.total = res.object.total
this.typeManage.newToday = res.object.newInformationToday
this.typeManage.newlyIncreased = res.object.newInformationYesterday
this.data = JSON.parse(JSON.stringify(res).replace(/"tableArrayMonth"/g, '"tableArray"'))
this.typeManage.echartOneData = this.data.object.tableArray || []
this.typeManage.echartTwoData = res.object.iconArray || []
var arr = []
for (var item of this.typeManage.echartOneData) {
arr.push(item.data)
}
this.foreachArr = arr
// 查询成功后调用echarts图一接口
this.echrtsOne(arr)
this.echrtsTwo()
} else if (res.object === 403) {
var self = this
self.$message({
type: 'error',
message: '查询失败!请选择具体日期'
})
}
})
},
// 获取全部信息分类分页
handleSizeChange(val) {
// 每页多少条
this.typeManage.size = val
this.toSearch()
}, },
}; handleCurrentChange(val) {
// 当前是多少页
this.typeManage.page = val
this.toSearch()
},
// 导出数据表格
exportRecord() {
var params = {}
// 时间
if (this.exportTime instanceof Array) {
params.startTime = parseTime(new Date(this.exportTime[0]))
params.endTime = parseTime(new Date(this.exportTime[1]))
}
expRecord(params).then((res) => {
var file = res.object
window.open('oa.gemho.cn:8004/customer_follow_form/' + file)
})
},
// 加载信息分类列表
loadInfoTreeMenus({ action, parentNode, callback }) {
if (action === 'LOAD_CHILDREN_OPTIONS') {
reqInformationTreeList({ pid: parentNode.id }).then((res) => {
if (res.code === 200) {
var list = res.object.records || []
parentNode.children = list.map(function (obj) {
if (!obj.leaf) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 100)
}
})
}
}
}
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.boxmain{ .boxmain {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
} }
.title{ .title {
width: 100%; width: 100%;
height: 75px; height: 75px;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
font-size: 24px; font-size: 24px;
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-weight: 700; font-weight: 700;
color: #666666; color: #666666;
line-height: 150px; line-height: 150px;
} }
.box-search { .box-search {
width: 97%; width: 97%;
display: flex; display: flex;
margin:30px 30px 30px 30px; margin: 30px 30px 30px 30px;
} }
.box-top{ .box-top {
width: 97%; width: 97%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content:start; justify-content: start;
margin: 10px 30px 10px 30px; margin: 10px 30px 10px 30px;
} }
.box-top div{ .box-top div {
font-family: 'Arial Negreta', 'Arial Normal', 'Arial'; font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700; font-weight: 700;
font-style: normal; font-style: normal;
font-size: 18px; font-size: 18px;
margin: 0px 30px 10px 0px; margin: 0px 30px 10px 0px;
} }
.boxtext{ .boxtext {
width: 50%; width: 50%;
display: flex; display: flex;
justify-content: start; justify-content: start;
align-items: center; align-items: center;
} }
.box-center{ .box-center {
width: 100%; width: 100%;
display: flex; display: flex;
} }
.box-center-left{ .box-center-left {
width: 60%; width: 60%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.box-center-left div{ .box-center-left div {
font-family: 'Arial Negreta', 'Arial Normal', 'Arial'; font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700; font-weight: 700;
font-style: normal; font-style: normal;
font-size: 18px; font-size: 18px;
} }
.box-center-right{ .box-center-right {
width: 40%; width: 40%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.box-center-right div{ .box-center-right div {
font-family: 'Arial Negreta', 'Arial Normal', 'Arial'; font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700; font-weight: 700;
font-style: normal; font-style: normal;
font-size: 18px; font-size: 18px;
} }
.chartOne{ .chartOne {
width: 90%; width: 90%;
height: 300px; height: 300px;
} }
.chartTwo{ .chartTwo {
width: 80%; width: 80%;
height: 300px; height: 300px;
} }
.box-bottom{ .box-bottom {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.box-bottom-top{ .box-bottom-top {
width: 97%; width: 97%;
display: flex; display: flex;
align-items: center; align-items: center;
margin:10px 30px 10px 30px; margin: 10px 30px 10px 30px;
} }
.list{ .list {
font-family: 'Arial Negreta', 'Arial Normal', 'Arial'; font-family: 'Arial Negreta', 'Arial Normal', 'Arial';
font-weight: 700; font-weight: 700;
font-style: normal; font-style: normal;
font-size: 18px; font-size: 18px;
} }
.export{ .export {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-size: 14px; font-size: 14px;
color: #169bd5; color: #169bd5;
text-align: center; text-align: center;
margin-left: 30px; margin-left: 30px;
} }
.print{ .print {
font-family: Microsoft YaHei; font-family: Microsoft YaHei;
font-size: 14px; font-size: 14px;
color: #169bd5; color: #169bd5;
text-align: center; text-align: center;
margin-left: 30px; margin-left: 30px;
} }
// 周选择器样式 // 周选择器样式
.data_week { .data_week {
...@@ -711,16 +704,16 @@ export default { ...@@ -711,16 +704,16 @@ export default {
min-width: 40px; min-width: 40px;
} }
} }
.weekDataInput{ .weekDataInput {
width: 250px; width: 250px;
} }
} }
::v-deep input::-webkit-outer-spin-button, ::v-deep input::-webkit-outer-spin-button,
::v-deep input::-webkit-inner-spin-button { ::v-deep input::-webkit-inner-spin-button {
-webkit-appearance: none !important; -webkit-appearance: none !important;
} }
::v-deep input[type=number] { ::v-deep input[type='‘number’'] {
-moz-appearance: textfield !important; -moz-appearance: textfield !important;
} }
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="dashboard-editor-container"> <div class="dashboard-editor-container">
<github-corner class="github-corner" /> <github-corner class="github-corner" />
<panel-group @handleSetLineChartData="handleSetLineChartData" /> <panel-group @handleSetLineChartData="handleSetLineChartData" />
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> <el-row style="background: #fff; padding: 16px 16px 0; margin-bottom: 32px">
<line-chart :chart-data="lineChartData" /> <line-chart :chart-data="lineChartData" />
</el-row> </el-row>
<el-row :gutter="32"> <el-row :gutter="32">
...@@ -78,28 +78,28 @@ export default { ...@@ -78,28 +78,28 @@ export default {
</script> </script>
<style rel="stylesheet/scss" lang="scss" scoped> <style rel="stylesheet/scss" lang="scss" scoped>
.dashboard-editor-container { .dashboard-editor-container {
padding: 32px; padding: 32px;
background-color: rgb(240, 242, 245); background-color: rgb(240, 242, 245);
position: relative; position: relative;
.github-corner { .github-corner {
position: absolute; position: absolute;
top: 0; top: 0;
border: 0; border: 0;
right: 0; right: 0;
} }
.chart-wrapper { .chart-wrapper {
background: #fff; background: #fff;
padding: 16px 16px 0; padding: 16px 16px 0;
margin-bottom: 32px; margin-bottom: 32px;
}
} }
}
@media (max-width:1024px) { @media (max-width: 1024px) {
.chart-wrapper { .chart-wrapper {
padding: 8px; padding: 8px;
}
} }
}
</style> </style>
<template> <template>
<div class="login" :style="'background-image:url('+ Background +');'"> <div class="login" :style="'background-image:url(' + Background + ');'">
<h2 class="title"> <h2 class="title">
<img src="../assets/images/loginlogo.png" alt="" style="margin-right: 10px;"> <img src="../assets/images/loginlogo.png" alt="" style="margin-right: 10px" />
晶合CRM 晶合CRM
</h2> </h2>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form"> <el-form
<div class="loginTitle"> ref="loginForm"
用户登录 :model="loginForm"
</div> :rules="loginRules"
label-position="left"
label-width="0px"
class="login-form"
>
<div class="loginTitle">用户登录</div>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="请输入账号"> <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" /> <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input v-model="loginForm.password" type="password" auto-complete="off" placeholder="请输入密码" @keyup.enter.native="handleLogin"> <el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="请输入密码"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="code"> <el-form-item prop="code">
<el-input v-model="loginForm.code" auto-complete="off" placeholder="请输入验证码" style="width: 63%" @keyup.enter.native="handleLogin"> <el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="请输入验证码"
style="width: 63%"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" /> <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input> </el-input>
<div class="login-code"> <div class="login-code">
<img :src="codeUrl" @click="getCode"> <img :src="codeUrl" @click="getCode" />
</div> </div>
</el-form-item> </el-form-item>
<!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0 0 25px 0;"> <!-- <el-checkbox v-model="loginForm.rememberMe" style="margin:0 0 25px 0;">
记住我 记住我
</el-checkbox> --> </el-checkbox> -->
<el-form-item style="width:100%;"> <el-form-item style="width: 100%">
<el-button :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleLogin"> <el-button
:loading="loading"
size="medium"
type="primary"
style="width: 100%"
@click.native.prevent="handleLogin"
>
<span v-if="!loading">登 录</span> <span v-if="!loading">登 录</span>
<span v-else>登 录 中...</span> <span v-else>登 录 中...</span>
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
<!-- <div v-if="$store.state.settings.showFooter" id="el-login-footer"> <!-- <div v-if="$store.state.settings.showFooter" id="el-login-footer">
<span v-html="$store.state.settings.footerTxt" /> <span v-html="$store.state.settings.footerTxt" />
<span></span> <span></span>
<a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">{{ $store.state.settings.caseNumber }}</a> <a href="https://beian.miit.gov.cn/#/Integrated/index" target="_blank">{{ $store.state.settings.caseNumber }}</a>
...@@ -76,7 +99,7 @@ export default { ...@@ -76,7 +99,7 @@ export default {
}, },
watch: { watch: {
$route: { $route: {
handler: function(route) { handler: function (route) {
const data = route.query const data = route.query
if (data && data.redirect) { if (data && data.redirect) {
this.redirect = data.redirect this.redirect = data.redirect
...@@ -99,14 +122,14 @@ export default { ...@@ -99,14 +122,14 @@ export default {
}, },
methods: { methods: {
getCode() { getCode() {
getCodeImg().then(res => { getCodeImg().then((res) => {
this.codeUrl = res.img this.codeUrl = res.img
this.loginForm.uuid = res.uuid this.loginForm.uuid = res.uuid
}) })
}, },
getCookie() { getCookie() {
const username = Cookies.get('username') const username = Cookies.get('username')
console.log(username,"usernameusernameusername") console.log(username, 'usernameusernameusername')
let password = Cookies.get('password') let password = Cookies.get('password')
const rememberMe = Cookies.get('rememberMe') const rememberMe = Cookies.get('rememberMe')
// 保存cookie里面的加密后的密码 // 保存cookie里面的加密后的密码
...@@ -120,7 +143,7 @@ export default { ...@@ -120,7 +143,7 @@ export default {
} }
}, },
handleLogin() { handleLogin() {
this.$refs.loginForm.validate(valid => { this.$refs.loginForm.validate((valid) => {
const user = { const user = {
username: this.loginForm.username, username: this.loginForm.username,
password: this.loginForm.password, password: this.loginForm.password,
...@@ -134,21 +157,30 @@ export default { ...@@ -134,21 +157,30 @@ export default {
if (valid) { if (valid) {
this.loading = true this.loading = true
if (user.rememberMe) { if (user.rememberMe) {
Cookies.set('username', user.username, { expires: Config.passCookieExpires }) Cookies.set('username', user.username, {
Cookies.set('password', user.password, { expires: Config.passCookieExpires }) expires: Config.passCookieExpires
Cookies.set('rememberMe', user.rememberMe, { expires: Config.passCookieExpires }) })
Cookies.set('password', user.password, {
expires: Config.passCookieExpires
})
Cookies.set('rememberMe', user.rememberMe, {
expires: Config.passCookieExpires
})
} else { } else {
Cookies.remove('username') Cookies.remove('username')
Cookies.remove('password') Cookies.remove('password')
Cookies.remove('rememberMe') Cookies.remove('rememberMe')
} }
this.$store.dispatch('Login', user).then(() => { this.$store
this.loading = false .dispatch('Login', user)
this.$router.push({ path: this.redirect || '/' }) .then(() => {
}).catch(() => { this.loading = false
this.loading = false this.$router.push({ path: this.redirect || '/' })
this.getCode() })
}) .catch(() => {
this.loading = false
this.getCode()
})
} else { } else {
console.log('error submit!!') console.log('error submit!!')
return false return false
...@@ -172,66 +204,68 @@ export default { ...@@ -172,66 +204,68 @@ export default {
</script> </script>
<style rel="stylesheet/scss" lang="scss"> <style rel="stylesheet/scss" lang="scss">
.login { .login {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-size: cover; background-size: cover;
} }
.title { .title {
width: 100%; width: 100%;
height: 30%; height: 30%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
color: #fff; color: #fff;
margin-left: -25px; margin-left: -25px;
font-size: 35px; font-size: 35px;
font-weight: bold; font-weight: bold;
text-shadow: 0px 1px 1px #555; text-shadow: 0px 1px 1px #555;
} }
.login-form { .login-form {
border-radius: 6px; border-radius: 6px;
background: #ffffff; background: #ffffff;
width: 400px; width: 400px;
height: 360px; height: 360px;
padding: 25px 25px 5px 25px; padding: 25px 25px 5px 25px;
.loginTitle{ .loginTitle {
width: 103px; width: 103px;
height: 25px; height: 25px;
text-align: center; text-align: center;
font-family: SourceHanSansCN-Bold; font-family: SourceHanSansCN-Bold;
font-weight: 700; font-weight: 700;
color: #298aed; color: #298aed;
font-size: 24px; font-size: 24px;
line-height: 25px; line-height: 25px;
margin: 20px auto; margin: 20px auto;
} }
.el-input { .el-input {
height: 45px;
input {
height: 45px; height: 45px;
input {
height: 45px;
}
}
.input-icon{
height: 45px;width: 20px;margin-left: 2px;
} }
} }
.login-tip { .input-icon {
font-size: 13px; height: 45px;
text-align: center; width: 20px;
color: #bfbfbf; margin-left: 2px;
} }
.login-code { }
width: 33%; .login-tip {
display: inline-block; font-size: 13px;
height: 38px; text-align: center;
float: right; color: #bfbfbf;
img{ }
cursor: pointer; .login-code {
vertical-align:middle width: 33%;
} display: inline-block;
height: 38px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
} }
}
</style> </style>
<!-- 信息管理 --> <!-- 信息管理 -->
<template> <template>
<div class="datamanage-wrapper"> <div class="datamanage-wrapper">
<div class="search-wrapper"> <div class="search-wrapper">
<el-input <el-input
type="number" type="number"
v-model="tel" v-model="tel"
style="width: 180px; margin-left: 20px" style="width: 180px; margin-left: 20px"
placeholder="请输入电话" placeholder="请输入电话"
clearable clearable
/> />
<el-select <el-select
clearable clearable
v-model="className" v-model="className"
placeholder="请选择类别" placeholder="请选择类别"
style="margin-left: 30px;" style="margin-left: 30px"
> >
<el-option <el-option
v-for="item in typeManage.dropData" v-for="item in typeManage.dropData"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.name" :value="item.name"
/> />
</el-select> </el-select>
<el-date-picker <el-date-picker
:default-time="['00:00:00', '23:59:59']" :default-time="['00:00:00', '23:59:59']"
style="width: 380px !important;margin-left: 30px;" style="width: 380px !important; margin-left: 30px"
v-model="searchTime" v-model="searchTime"
type="datetimerange" type="datetimerange"
range-separator="至" range-separator="至"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
clearable clearable
/> />
<el-input <el-input
v-model="salesName" v-model="salesName"
type="text" type="text"
style="width: 180px; margin-left: 20px" style="width: 180px; margin-left: 20px"
placeholder="请输入销售人员" placeholder="请输入销售人员"
clearable clearable
/> />
<el-button <el-button
type="success" type="success"
style="margin-left: 30px" style="margin-left: 30px"
icon="el-icon-search" icon="el-icon-search"
@click="toSearch" @click="toSearch"
>搜索</el-button >搜索</el-button
> >
<el-button type="primary" icon="el-icon-circle-plus" @click="addDialogData()" style="margin-left: 30px"> <el-button
自动分配 type="primary"
</el-button> icon="el-icon-circle-plus"
<el-button type="primary" icon="el-icon-circle-plus" @click="manualAssignment()" style="margin-left: 30px"> @click="addDialogData()"
手动分配 style="margin-left: 30px"
</el-button> >
</div> 自动分配
<div class="table-wrapper"> </el-button>
<el-table <el-button
:data="typeManage.selectdata" type="primary"
style="width: 100%" icon="el-icon-circle-plus"
@click="manualAssignment()"
style="margin-left: 30px"
>
手动分配
</el-button>
</div>
<div class="table-wrapper">
<el-table :data="typeManage.selectdata" style="width: 100%">
<el-table-column type="index" label="序号" width="80" />
<el-table-column prop="name" label="姓名" width="140" />
<el-table-column prop="tel" label="电话" width="180" />
<el-table-column prop="saleidStr" label="销售人员" width="140" />
<el-table-column prop="classidStr" label="信息分类" width="180" />
<el-table-column prop="addtime" label="时间" width="200" />
<el-table-column prop="useridStr" label="推广人员" width="160" />
<el-table-column prop="inforStatus" label="信息状态" width="180" />
<el-table-column prop="alloStatus" label="分配状态" width="180" />
<el-table-column label="操作" fixed="right" width="180">
<template slot-scope="scope">
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click="typeEdit($event, scope.$index, scope.row)"
>编辑</el-button
>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="typeDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
:total="typeManage.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
style="margin-top: 20px"
/>
</div>
<el-dialog title="自动分配新增信息" :visible.sync="typeManage.addDialog">
<el-form ref="addDataForm" :model="addFormInfo.from" :rules="rules">
<el-form-item prop="type" label="信息分类" :label-width="'120px'">
<el-select
clearable
v-model="addFormInfo.from.type"
placeholder="请选择类别"
filterable
allow-create
> >
<el-table-column type="index" label="序号" width="80" /> <el-option
<el-table-column prop="name" label="姓名" width="140" /> v-for="item in typeManage.dropData"
<el-table-column prop="tel" label="电话" width="180" /> :key="item.id"
<el-table-column prop="saleidStr" label="销售人员" width="140" /> :label="item.name"
<el-table-column prop="classidStr" label="信息分类" width="180" /> :value="item.name"
<el-table-column prop="addtime" label="时间" width="200" /> />
<el-table-column prop="useridStr" label="推广人员" width="160" /> </el-select>
<el-table-column prop="inforStatus" label="信息状态" width="180" /> </el-form-item>
<el-table-column prop="alloStatus" label="分配状态" width="180" /> <div class="contact">
<el-table-column label="操作" fixed="right" width="180"> <el-form-item prop="name" label="姓名">
<template slot-scope="scope"> <el-input v-model="addFormInfo.from.name" type="text" clearable />
<el-button </el-form-item>
size="mini" <div>
type="primary" <el-form-item prop="qq" label="QQ号">
icon="el-icon-edit" <el-input v-model="addFormInfo.from.qq" clearable />
@click="typeEdit($event, scope.$index, scope.row)" </el-form-item>
>编辑</el-button </div>
> </div>
<el-button <div class="contact">
size="mini" <el-form-item prop="telephone" label="电话">
type="danger" <el-input
icon="el-icon-delete" v-model="addFormInfo.from.telephone"
@click="typeDelete(scope.row)" clearable
>删除</el-button type="number"
> />
</template> </el-form-item>
</el-table-column> <div>
</el-table> <el-form-item prop="wechatNumber" label="微信号">
<el-pagination <el-input v-model="addFormInfo.from.wechatNumber" clearable />
:page-sizes="[10, 20, 30, 40]" </el-form-item>
layout="total, sizes, prev, pager, next, jumper" </div>
:total="typeManage.total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
style="margin-top: 20px;"
/>
</div> </div>
<el-dialog title="自动分配新增信息" :visible.sync="typeManage.addDialog"> <el-form-item
<el-form prop="corporate"
ref="addDataForm" label="公司名称"
:model="addFormInfo.from" style="margin-left: 67px; margin-top: 10px"
:rules="rules" >
<el-input
v-model="addFormInfo.from.corporate"
clearable
style="width: 80% !important"
/>
</el-form-item>
<el-form-item
label="需求描述:"
autosize
prop="description"
style="margin-left: 67px; margin-top: 10px"
>
<el-input
type="textarea"
v-model="addFormInfo.from.description"
:rows="5"
style="width: 80% !important"
></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button
type="primary"
@click="uploadAddForm"
:loading="addFormInfo.flag === 0"
>确定</el-button
>
</div>
</el-dialog>
<el-dialog title="手动分配新增信息" :visible.sync="typeManage.manualDialog">
<el-form ref="manuaDataForm" :model="addFormInfo.from" :rules="rules">
<el-form-item prop="type" label="信息分类" :label-width="'120px'">
<el-select
clearable
v-model="addFormInfo.from.type"
placeholder="请选择类别"
filterable
allow-create
>
<el-option
v-for="item in typeManage.dropData"
:key="item.id"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
<el-form-item
prop="changesalesman"
label="选择销售人员"
style="margin-left: 30px"
>
<el-select
v-model="addFormInfo.from.changesalesman"
clearable
placeholder="请选择销售人员"
> >
<el-form-item prop="type" label="信息分类" :label-width="'120px'"> <el-option
<el-select v-for="item in addFormInfo.from.deliverAssign"
clearable :key="item.nickName"
v-model="addFormInfo.from.type" :label="item.nickName"
placeholder="请选择类别" :value="item.userId"
filterable >
allow-create </el-option>
> </el-select>
<el-option </el-form-item>
v-for="item in typeManage.dropData" <div class="contact">
:key="item.id" <el-form-item prop="name" label="姓名">
:label="item.name" <el-input v-model="addFormInfo.from.name" type="text" clearable />
:value="item.name" </el-form-item>
/> <div>
</el-select> <el-form-item prop="qq" label="QQ号">
<el-input v-model="addFormInfo.from.qq" clearable />
</el-form-item> </el-form-item>
<div class="contact"> </div>
<el-form-item prop="name" label="姓名"> </div>
<el-input v-model="addFormInfo.from.name" type="text" clearable/> <div class="contact">
</el-form-item> <el-form-item prop="telephone" label="电话">
<div> <el-input
<el-form-item prop="qq" label="QQ号" > v-model="addFormInfo.from.telephone"
<el-input v-model="addFormInfo.from.qq" clearable/> clearable
</el-form-item> type="number"
</div> />
</div> </el-form-item>
<div class="contact"> <div>
<el-form-item prop="telephone" label="电话" > <el-form-item prop="wechatNumber" label="微信号">
<el-input <el-input v-model="addFormInfo.from.wechatNumber" clearable />
v-model="addFormInfo.from.telephone"
clearable
type="number"/>
</el-form-item>
<div>
<el-form-item prop="wechatNumber" label="微信号">
<el-input v-model="addFormInfo.from.wechatNumber" clearable/>
</el-form-item>
</div>
</div>
<el-form-item prop="corporate" label="公司名称" style="margin-left: 67px;margin-top:10px;">
<el-input v-model="addFormInfo.from.corporate" clearable style="width: 80%!important;"/>
</el-form-item> </el-form-item>
<el-form-item label="需求描述:" autosize prop="description" style="margin-left: 67px;margin-top:10px;">
<el-input type="textarea" v-model="addFormInfo.from.description"
:rows="5"
style="width: 80%!important;"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="uploadAddForm" :loading="addFormInfo.flag === 0">确定</el-button>
</div> </div>
</el-dialog> </div>
<el-form-item
prop="corporate"
<el-dialog title="手动分配新增信息" :visible.sync="typeManage.manualDialog"> label="公司名称"
<el-form style="margin-left: 67px; margin-top: 10px"
ref="manuaDataForm" >
:model="addFormInfo.from" <el-input
:rules="rules" v-model="addFormInfo.from.corporate"
> clearable
<el-form-item prop="type" label="信息分类" :label-width="'120px'"> style="width: 80% !important"
<el-select />
clearable </el-form-item>
v-model="addFormInfo.from.type" <el-form-item
placeholder="请选择类别" label="需求描述:"
filterable autosize
allow-create prop="description"
> style="margin-left: 67px; margin-top: 10px"
<el-option >
v-for="item in typeManage.dropData" <el-input
:key="item.id" type="textarea"
:label="item.name" v-model="addFormInfo.from.description"
:value="item.name" :rows="5"
/> style="width: 80% !important"
</el-select> ></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="changesalesman" label="选择销售人员" style="margin-left: 30px;"> </el-form>
<el-select v-model="addFormInfo.from.changesalesman" clearable placeholder="请选择销售人员"> <div slot="footer">
<el-option <el-button
v-for="item in addFormInfo.from.deliverAssign" type="primary"
:key="item.nickName" @click="manualuploadAddForm"
:label="item.nickName" :loading="addFormInfo.flag === 0"
:value="item.userId"> >确定</el-button
</el-option> >
</el-select> </div>
</el-form-item> </el-dialog>
<div class="contact"> <el-dialog title="编辑信息" :visible.sync="editDialog">
<el-form-item prop="name" label="姓名"> <el-form ref="addDataForm" :model="editFormInfo.from" :rules="rules">
<el-input v-model="addFormInfo.from.name" type="text" clearable/> <el-form-item prop="type" label="信息分类" :label-width="'120px'">
</el-form-item> <el-select
<div>
<el-form-item prop="qq" label="QQ号" >
<el-input v-model="addFormInfo.from.qq" clearable/>
</el-form-item>
</div>
</div>
<div class="contact">
<el-form-item prop="telephone" label="电话" >
<el-input
v-model="addFormInfo.from.telephone"
clearable
type="number"/>
</el-form-item>
<div>
<el-form-item prop="wechatNumber" label="微信号">
<el-input v-model="addFormInfo.from.wechatNumber" clearable/>
</el-form-item>
</div>
</div>
<el-form-item prop="corporate" label="公司名称" style="margin-left: 67px;margin-top:10px;">
<el-input v-model="addFormInfo.from.corporate" clearable style="width: 80%!important;"/>
</el-form-item>
<el-form-item label="需求描述:" autosize prop="description" style="margin-left: 67px;margin-top:10px;">
<el-input type="textarea" v-model="addFormInfo.from.description"
:rows="5"
style="width: 80%!important;"></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="manualuploadAddForm" :loading="addFormInfo.flag === 0">确定</el-button>
</div>
</el-dialog>
<el-dialog title="编辑信息" :visible.sync="editDialog">
<el-form
ref="addDataForm"
:model="editFormInfo.from"
:rules="rules"
>
<el-form-item prop="type" label="信息分类" :label-width="'120px'">
<el-select
v-model="editFormInfo.from.type" v-model="editFormInfo.from.type"
placeholder="请选择类别" placeholder="请选择类别"
filterable filterable
allow-create allow-create
clearable clearable
> >
<el-option <el-option
v-for="item in typeManage.dropData" v-for="item in typeManage.dropData"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.name" :value="item.name"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<div class="contact"> <div class="contact">
<el-form-item prop="name" label="姓名"> <el-form-item prop="name" label="姓名">
<el-input v-model="editFormInfo.from.name" type="text" clearable/> <el-input v-model="editFormInfo.from.name" type="text" clearable />
</el-form-item> </el-form-item>
<el-form-item prop="telephone" label="电话" > <el-form-item prop="telephone" label="电话">
<el-input <el-input
v-model="editFormInfo.from.telephone" type="number" clearable v-bind:readonly="pMobile"/> v-model="editFormInfo.from.telephone"
</el-form-item> type="number"
clearable
v-bind:readonly="pMobile"
/>
</el-form-item>
</div>
<div class="contact">
<div>
<el-form-item prop="qq" label="QQ号">
<el-input v-model="editFormInfo.from.qq" clearable />
</el-form-item>
</div> </div>
<div class="contact"> <div>
<div> <el-form-item prop="wechatNumber" label="微信号">
<el-form-item prop="qq" label="QQ号" > <el-input
<el-input v-model="editFormInfo.from.qq" v-model="editFormInfo.from.wechatNumber"
clearable/> clearable
</el-form-item> v-bind:readonly="mPassport"
</div> />
<div> </el-form-item>
<el-form-item prop="wechatNumber" label="微信号"> </div>
<el-input v-model="editFormInfo.from.wechatNumber" clearable v-bind:readonly="mPassport"/> </div>
</el-form-item> <el-form-item
</div> prop="corporate"
</div> label="公司名称"
<el-form-item prop="corporate" label="公司名称" style="margin-left: 67px;margin-top:10px;"> style="margin-left: 67px; margin-top: 10px"
<el-input v-model="editFormInfo.from.corporate" style="width: 80%!important;" clearable/> >
</el-form-item> <el-input
<el-form-item label="需求描述:" prop="description" style="margin-left: 67px;margin-top:10px;"> v-model="editFormInfo.from.corporate"
<el-input type="textarea" v-model="editFormInfo.from.description" style="width: 80% !important"
:rows="5" clearable
style="width: 80%!important;" />
></el-input> </el-form-item>
</el-form-item> <el-form-item
</el-form> label="需求描述:"
<div slot="footer"> prop="description"
<el-button type="primary" @click="editConfig" :loading="editFormInfo.flag === 0">确定</el-button> style="margin-left: 67px; margin-top: 10px"
</div> >
</el-dialog> <el-input
type="textarea"
v-model="editFormInfo.from.description"
:rows="5"
style="width: 80% !important"
></el-input>
</el-form-item>
</el-form>
<div slot="footer">
<el-button
type="primary"
@click="editConfig"
:loading="editFormInfo.flag === 0"
>确定</el-button
>
</div> </div>
</el-dialog>
</div>
</template> </template>
<script> <script>
import axios from "axios"; import axios from "axios";
import { import {
getAllcategory,getNamecategory,addcategory,editcategory,deletecategory,getAllCategory,deliverList,manualInfo} from "@/api/management.js"; getAllcategory,
getNamecategory,
addcategory,
editcategory,
deletecategory,
getAllCategory,
deliverList,
manualInfo,
} from "@/api/management.js";
import { parseTime } from "../../utils"; import { parseTime } from "../../utils";
export default { export default {
data() { data() {
return { return {
// 微信电话二选一 // 微信电话二选一
pMobile:false, pMobile: false,
mPassport:false, mPassport: false,
// 获取其他页数据 // 获取其他页数据
newManage:{ newManage: {
page:1, page: 1,
size:10, size: 10,
total:0, total: 0,
newdata:[], newdata: [],
},
}, //1.获取全部信息分类
//1.获取全部信息分类 typeManage: {
typeManage:{ page: 1,
page:1, size: 10,
size:10, total: 0,
total:0, selectdata: [],
selectdata:[], dropData: [],
dropData:[], addDialog: false,
addDialog:false, manualDialog: false,
manualDialog:false, fromData: [],
fromData:[] },
}, //2.根据名称获取信息分类
//2.根据名称获取信息分类 tel: "", //电话
tel: '',//电话 className: "", //信息分类
className:'',//信息分类 salesName: "", //销售人员
salesName:'',//销售人员 searchTime: "", //时间
searchTime: "",//时间 // 新增
// 新增 editDialog: false,
editDialog:false, addFormInfo: {
addFormInfo:{ from: {
from:{ localdata: [],
localdata:[], type: "",
type:'', name: "",
name:'', telephone: "",
telephone:'', qq: "",
qq:'', wechatNumber: "",
wechatNumber:'', corporate: "",
corporate:'', description: "",
description:'', user: "",
user:'', adduserId: "",
adduserId:'', putdata: [],
putdata:[], deliverAssign: [],
deliverAssign:[], changesalesman: "",
changesalesman:'' },
}, flag: 1,
flag:1, },
}, // 4.编辑信息分类
// 4.编辑信息分类 editFormInfo: {
editFormInfo: { from: {
from:{ type: "",
type:'', name: "",
name:'', telephone: "",
telephone:'', qq: "",
qq:'', wechatNumber: "",
wechatNumber:'', corporate: "",
corporate:'', description: "",
description:'', userId: "",
userId:'', id: "",
id:'', listid: "",
listid:'', pushdata: [],
pushdata:[], },
}, flag: 1,
flag:1, },
}, // 验证
// 验证 rules: {
rules:{ name: [{ required: true, message: "请输入姓名", trigger: "blur" }],
name: [{ required: true, message: "请输入姓名", trigger: "blur"}], telephone: [
telephone: [ {
{ // required: true, message: "请输入正确的联系方式",
// required: true, message: "请输入正确的联系方式", pattern: /^1[3456789]\d{9}$/,
pattern:/^1[3456789]\d{9}$/,message: "请输入正确的联系方式", trigger: "blur"}], message: "请输入正确的联系方式",
qq: [ trigger: "blur",
// { required: true, message: 'QQ号只可输入5-11位数字', trigger: 'change' }, },
{ pattern: /^[1-9][0-9]{0,12}$/, message: 'QQ号只可输入5-11位数字', trigger: 'change' }, ],
{ pattern: /^\d{5,12}$/, message: 'QQ号只可输入5-11位数字', trigger: 'change' } qq: [
], // { required: true, message: 'QQ号只可输入5-11位数字', trigger: 'change' },
// wechatNumber: [ {
// {pattern:/^[a-zA-Z][a-zA-Z0-9_-]{5,19}$/,message: "请输入正确的微信号码",trigger: "blur"}, pattern: /^[1-9][0-9]{0,12}$/,
// ], message: "QQ号只可输入5-11位数字",
wechatNumber: [ trigger: "change",
{message: "请输入正确的微信号码",trigger: "blur"}, },
], {
type: [{ required: true, message: "请选择类别", trigger: "blur"}], pattern: /^\d{5,12}$/,
changesalesman: [{ required: true, message: "请选择销售人员", trigger: "blur"}], message: "QQ号只可输入5-11位数字",
// corporate: [{ required: true, message: "请输入公司名称", trigger: "blur"}], trigger: "change",
}, },
],
// wechatNumber: [
// {pattern:/^[a-zA-Z][a-zA-Z0-9_-]{5,19}$/,message: "请输入正确的微信号码",trigger: "blur"},
// ],
wechatNumber: [{ message: "请输入正确的微信号码", trigger: "blur" }],
type: [{ required: true, message: "请选择类别", trigger: "blur" }],
changesalesman: [
{ required: true, message: "请选择销售人员", trigger: "blur" },
],
// corporate: [{ required: true, message: "请输入公司名称", trigger: "blur"}],
},
}; };
}, },
mounted() { mounted() {
this.allManagement(); this.allManagement();
this.classification(); this.classification();
this.getSelectInfo(); this.getSelectInfo();
// 销售人员列表 // 销售人员列表
deliverList().then(function(res){ deliverList().then(
var deliverData = res.object||[]; function (res) {
this.addFormInfo.from.deliverAssign = deliverData; var deliverData = res.object || [];
}.bind(this)); this.addFormInfo.from.deliverAssign = deliverData;
}.bind(this)
);
}, },
watch:{ watch: {
computer: { computer: {
deep: true, deep: true,
handler: function (val) { handler: function (val) {
if (val.length > 0) { if (val.length > 0) {
this.mPassport = true this.mPassport = true;
} else { } else {
this.mPassport = false this.mPassport = false;
}
} }
}, },
mobile: { },
deep: true, mobile: {
handler: function (val) { deep: true,
if (val.length > 0) { handler: function (val) {
this.pMobile = true if (val.length > 0) {
} else { this.pMobile = true;
this.pMobile = false } else {
} this.pMobile = false;
} }
}, },
},
}, },
methods: { methods: {
// 获取其他页数据 // 获取其他页数据
classification(params){ classification(params) {
var params = { var params = {
page:this.newManage.page, page: this.newManage.page,
pageSize:this.newManage.size, pageSize: this.newManage.size,
}; };
getAllCategory(params).then((res) => { getAllCategory(params).then((res) => {
var newlist = res.object.records || []; var newlist = res.object.records || [];
this.newManage.newdata = newlist; this.newManage.newdata = newlist;
}); });
},
}, // 获取分类下拉列表
// 获取分类下拉列表 getSelectInfo() {
getSelectInfo(){ var typeM = this.typeManage;
var typeM = this.typeManage; var params = {
var params = { page: 1,
page:1, pageSize: 999,
pageSize:999, };
}; getAllCategory(params).then((res) => {
getAllCategory(params).then((res) => { var dropDown = res.object.records || [];
var dropDown = res.object.records || []; typeM.dropData = dropDown;
typeM.dropData = dropDown; });
},
}); //1.获取全部信息管理
}, allManagement(params) {
//1.获取全部信息管理 var typeM = this.typeManage;
allManagement(params){ var params = {
var typeM = this.typeManage; page: typeM.page,
var params = { pageSize: typeM.size,
page:typeM.page, };
pageSize:typeM.size, getAllcategory(params).then((res) => {
}; var selectlist = res.object.records || [];
getAllcategory(params).then((res) => { typeM.selectdata = selectlist;
var selectlist = res.object.records || []; typeM.total = res.object.total;
typeM.selectdata = selectlist; });
typeM.total = res.object.total; },
}); //获取全部信息管理分页
}, handleSizeChange(val) {
//获取全部信息管理分页 // 每页多少条
handleSizeChange(val) { this.typeManage.size = val;
// 每页多少条 this.toSearch();
this.typeManage.size =val ; },
this.toSearch() handleCurrentChange(val) {
}, // 当前是多少页
handleCurrentChange(val) { this.typeManage.page = val;
// 当前是多少页 this.toSearch();
this.typeManage.page = val; },
this.toSearch() //2.根据名称获取信息分类
}, toSearch() {
//2.根据名称获取信息分类 var typeM = this.typeManage;
toSearch() { var param = {
var typeM = this.typeManage; page: this.typeManage.page,
var param = { pageSize: this.typeManage.size,
page: this.typeManage.page, };
pageSize: this.typeManage.size, this.tel && (param.tel = this.tel);
}; this.salesName && (param.salesName = this.salesName);
this.tel && (param.tel = this.tel); this.className && (param.className = this.className);
this.salesName && (param.salesName = this.salesName); // 时间
this.className && (param.className = this.className); if (this.searchTime instanceof Array) {
// 时间 param.startTime = parseTime(new Date(this.searchTime[0]));
if (this.searchTime instanceof Array) { param.endTime = parseTime(new Date(this.searchTime[1]));
param.startTime = parseTime(new Date(this.searchTime[0])); }
param.endTime = parseTime(new Date(this.searchTime[1])); var typeM = this.typeManage;
} getNamecategory(param).then((res) => {
var typeM = this.typeManage; var selectlist = res.object.records || [];
getNamecategory(param).then((res) => { typeM.selectdata = selectlist;
var selectlist = res.object.records || []; typeM.total = res.object.total;
typeM.selectdata = selectlist; });
typeM.total = res.object.total; },
}); // 新增
}, addDialogData() {
// 新增 // username
addDialogData(){ this.typeManage.addDialog = true;
// username this.addFormInfo.from.user = this.$store.getters.user.username;
this.typeManage.addDialog = true; // userId
this.addFormInfo.from.user=this.$store.getters.user.username; this.addFormInfo.from.adduserId = this.$store.getters.user.id;
// userId },
this.addFormInfo.from.adduserId=this.$store.getters.user.id uploadAddForm() {
}, if (this.addFormInfo.flag) {
uploadAddForm(){ this.addFormInfo.flag = 0;
if(this.addFormInfo.flag){ this.$refs.addDataForm.validate((valid) => {
this.addFormInfo.flag = 0; if (valid) {
this.$refs.addDataForm.validate((valid) => { var params = {
if (valid) { classidStr: this.addFormInfo.from.type,
var params = { name: this.addFormInfo.from.name,
classidStr:this.addFormInfo.from.type, tel: this.addFormInfo.from.telephone,
name:this.addFormInfo.from.name, qqnub: this.addFormInfo.from.qq,
tel:this.addFormInfo.from.telephone, weixin: this.addFormInfo.from.wechatNumber,
qqnub:this.addFormInfo.from.qq, company: this.addFormInfo.from.corporate,
weixin:this.addFormInfo.from.wechatNumber, remarks: this.addFormInfo.from.description,
company:this.addFormInfo.from.corporate, username: this.addFormInfo.from.user,
remarks:this.addFormInfo.from.description, userId: this.addFormInfo.from.adduserId,
username:this.addFormInfo.from.user, };
userId:this.addFormInfo.from.adduserId if (
this.addFormInfo.from.telephone == "" &&
}; this.addFormInfo.from.wechatNumber == ""
if((this.addFormInfo.from.telephone=='')&& (this.addFormInfo.from.wechatNumber=='')){ ) {
this.$message({ this.$message({
type: "error", type: "error",
message: "电话或微信号必须填一个", message: "电话或微信号必须填一个",
}); });
} }
var self = this; var self = this;
addcategory(params).then((res) => { addcategory(params).then((res) => {
this.typeManage.addDialog = false; this.typeManage.addDialog = false;
setTimeout(function(){ setTimeout(function () {
self.addFormInfo.flag = 1; self.addFormInfo.flag = 1;
}, 300); }, 300);
if(res.code === 200){ if (res.code === 200) {
this.allManagement(); this.allManagement();
self.$message({ self.$message({
type: "success", type: "success",
message: "新增成功", message: "新增成功",
}); });
} } else if (res.code === 401) {
else if(res.code === 401){ self.$message({
self.$message({ type: "error",
type: "error", message: "已有客户",
message: "已有客户", });
}); } else if (res.code === 402) {
}else if(res.code === 402){ self.$message({
self.$message({ type: "error",
type: "error", message: "没有销售被分配了该类别的权重",
message: "没有销售被分配了该类别的权重", });
}); } else {
}else{ self.$message({
self.$message({ type: "error",
type: "error", message: "新增失败",
message: "新增失败", });
}); }
} });
}); }
} });
}) }
},
} // 手动分配新增信息
manualAssignment() {
}, // username
// 手动分配新增信息 this.typeManage.manualDialog = true;
manualAssignment(){ this.addFormInfo.from.user = this.$store.getters.user.username;
// username // userId
this.typeManage.manualDialog = true; this.addFormInfo.from.adduserId = this.$store.getters.user.id;
this.addFormInfo.from.user=this.$store.getters.user.username; },
// userId manualuploadAddForm() {
this.addFormInfo.from.adduserId=this.$store.getters.user.id; if (this.addFormInfo.flag) {
}, this.addFormInfo.flag = 0;
manualuploadAddForm(){ this.$refs.manuaDataForm.validate((valid) => {
if(this.addFormInfo.flag){ if (valid) {
this.addFormInfo.flag = 0; var params = {
this.$refs.manuaDataForm.validate((valid) => { classidStr: this.addFormInfo.from.type,
if (valid) { name: this.addFormInfo.from.name,
var params = { tel: this.addFormInfo.from.telephone,
classidStr:this.addFormInfo.from.type, qqnub: this.addFormInfo.from.qq,
name:this.addFormInfo.from.name, weixin: this.addFormInfo.from.wechatNumber,
tel:this.addFormInfo.from.telephone, company: this.addFormInfo.from.corporate,
qqnub:this.addFormInfo.from.qq, remarks: this.addFormInfo.from.description,
weixin:this.addFormInfo.from.wechatNumber, username: this.addFormInfo.from.user,
company:this.addFormInfo.from.corporate, userId: this.addFormInfo.from.adduserId,
remarks:this.addFormInfo.from.description, saleidStr: this.addFormInfo.from.changesalesman,
username:this.addFormInfo.from.user, };
userId:this.addFormInfo.from.adduserId, if (
saleidStr:this.addFormInfo.from.changesalesman, this.addFormInfo.from.telephone == "" &&
}; this.addFormInfo.from.wechatNumber == ""
if((this.addFormInfo.from.telephone=='')&& (this.addFormInfo.from.wechatNumber=='')){ ) {
this.$message({ this.$message({
type: "error", type: "error",
message: "电话或微信号必须填一个", message: "电话或微信号必须填一个",
}); });
} }
var self = this; var self = this;
manualInfo(params).then((res) => { manualInfo(params).then((res) => {
this.typeManage.manualDialog = false; this.typeManage.manualDialog = false;
setTimeout(function(){ setTimeout(function () {
self.addFormInfo.flag = 1; self.addFormInfo.flag = 1;
}, 300); }, 300);
if(res.code === 200){ if (res.code === 200) {
this.allManagement(); this.allManagement();
self.$message({ self.$message({
type: "success", type: "success",
message: "新增成功", message: "新增成功",
}); });
} } else if (res.code === 401) {
else if(res.code === 401){ self.$message({
self.$message({ type: "error",
type: "error", message: "已有客户",
message: "已有客户", });
}); } else {
}else{ self.$message({
self.$message({ type: "error",
type: "error", message: "新增失败",
message: "新增失败", });
}); }
} });
}); }
} });
}) }
} },
}, // 编辑
typeEdit(e, index, item) {
// 编辑 // userId
typeEdit(e, index, item){ this.editFormInfo.from.userData = this.$store.getters.user.id;
// userId this.editDialog = true;
this.editFormInfo.from.userData=this.$store.getters.user.id this.editFormInfo.from.type = item.classidStr;
this.editDialog = true this.editFormInfo.from.name = item.name;
this.editFormInfo.from.type=item.classidStr this.editFormInfo.from.telephone = item.tel;
this.editFormInfo.from.name=item.name this.editFormInfo.from.wechatNumber = item.weixin;
this.editFormInfo.from.telephone=item.tel this.editFormInfo.from.corporate = item.company;
this.editFormInfo.from.wechatNumber=item.weixin this.editFormInfo.from.description = item.remarks;
this.editFormInfo.from.corporate=item.company this.editFormInfo.from.qq = item.qqnub;
this.editFormInfo.from.description=item.remarks this.editFormInfo.from.listid = item.id;
this.editFormInfo.from.qq=item.qqnub },
this.editFormInfo.from.listid=item.id editConfig() {
}, if (this.editFormInfo.flag) {
editConfig(){ this.editFormInfo.flag = 0;
if(this.editFormInfo.flag){ this.$refs.addDataForm.validate((valid) => {
this.editFormInfo.flag = 0; if (valid) {
this.$refs.addDataForm.validate((valid) => { var params = {
if (valid) { classidStr: this.editFormInfo.from.type,
var params = { name: this.editFormInfo.from.name,
classidStr:this.editFormInfo.from.type, tel: this.editFormInfo.from.telephone,
name:this.editFormInfo.from.name, qqnub: this.editFormInfo.from.qq,
tel:this.editFormInfo.from.telephone, weixin: this.editFormInfo.from.wechatNumber,
qqnub:this.editFormInfo.from.qq, company: this.editFormInfo.from.corporate,
weixin:this.editFormInfo.from.wechatNumber, remarks: this.editFormInfo.from.description,
company:this.editFormInfo.from.corporate, userId: this.editFormInfo.from.userData,
remarks:this.editFormInfo.from.description, id: this.editFormInfo.from.listid,
userId:this.editFormInfo.from.userData, };
id:this.editFormInfo.from.listid var self = this;
}; editcategory(params).then((res) => {
var self = this; this.editDialog = false;
editcategory(params).then((res) => { setTimeout(function () {
this.editDialog = false; self.editFormInfo.flag = 1;
setTimeout(function(){ }, 300);
self.editFormInfo.flag = 1; this.allManagement();
}, 300); self.$message({
this.allManagement(); type: "success",
self.$message({ message: "编辑成功",
type: "success", });
message: "编辑成功", });
}); }
});
}); }
}
})
}
}, },
// 删除 // 删除
typeDelete(item) { typeDelete(item) {
var id = item.id; var id = item.id;
this.$confirm("销售部门已记录该客户,删除该条信息后,后续无法添加该客户相关信息,请谨慎操作", "提示", { this.$confirm(
confirmButtonText: "确定", "销售部门已记录该客户,删除该条信息后,后续无法添加该客户相关信息,请谨慎操作",
cancelButtonText: "取消", "提示",
type: "warning", {
}).then(() => { confirmButtonText: "确定",
deletecategory({id:id}).then( cancelButtonText: "取消",
(res) => { type: "warning",
this.$message({ }
message: "删除成功", ).then(() => {
type: "success", deletecategory({ id: id }).then(
}); (res) => {
this.allManagement(); this.$message({
}, message: "删除成功",
() => { type: "success",
this.$message.error("删除失败"); });
} this.allManagement();
); },
}); () => {
}, this.$message.error("删除失败");
}
);
});
},
}, },
}; };
</script> </script>
...@@ -712,11 +802,11 @@ export default { ...@@ -712,11 +802,11 @@ export default {
} }
} }
.datamanage-wrapper { .datamanage-wrapper {
width: 100%; width: 100%;
height:100%; height: 100%;
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
background-color: #f5f6fb; background-color: #f5f6fb;
.tool-wrapper { .tool-wrapper {
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
...@@ -736,18 +826,16 @@ export default { ...@@ -736,18 +826,16 @@ export default {
background: #fff; background: #fff;
} }
} }
.contact{ .contact {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
} }
::v-deep input::-webkit-outer-spin-button, ::v-deep input::-webkit-outer-spin-button,
::v-deep input::-webkit-inner-spin-button { ::v-deep input::-webkit-inner-spin-button {
-webkit-appearance: none !important; -webkit-appearance: none !important;
} }
::v-deep input[type=number] { ::v-deep input[type="‘number’"] {
-moz-appearance: textfield !important; -moz-appearance: textfield !important;
} }
</style> </style>
...@@ -49,27 +49,11 @@ ...@@ -49,27 +49,11 @@
placeholder="请输入销售人员" placeholder="请输入销售人员"
clearable clearable
/> />
<el-button <el-button type="success" style="margin-left: 30px" icon="el-icon-search" @click="toSearch">搜索</el-button>
type="success" <el-button type="primary" icon="el-icon-circle-plus" @click="addDialogData()" style="margin-left: 30px">
style="margin-left: 30px"
icon="el-icon-search"
@click="toSearch"
>搜索</el-button
>
<el-button
type="primary"
icon="el-icon-circle-plus"
@click="addDialogData()"
style="margin-left: 30px"
>
自动分配 自动分配
</el-button> </el-button>
<el-button <el-button type="primary" icon="el-icon-circle-plus" @click="manualAssignment()" style="margin-left: 30px">
type="primary"
icon="el-icon-circle-plus"
@click="manualAssignment()"
style="margin-left: 30px"
>
手动分配 手动分配
</el-button> </el-button>
</div> </div>
...@@ -88,8 +72,8 @@ ...@@ -88,8 +72,8 @@
<i v-if="item.icon" :class="item.icon" style="font-size:16px;"></i>{{sitem[item.key||'name']}} <i v-if="item.icon" :class="item.icon" style="font-size:16px;"></i>{{sitem[item.key||'name']}}
</span> </span>
</template> </template>
</template> </template>
</el-table-column> --> </el-table-column> -->
<!-- <el-table-column prop="classidStr" label="信息分类" width="120" /> --> <!-- <el-table-column prop="classidStr" label="信息分类" width="120" /> -->
<el-table-column prop="classidStr" label="信息分类" width="120"> <el-table-column prop="classidStr" label="信息分类" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -106,20 +90,10 @@ ...@@ -106,20 +90,10 @@
<el-table-column prop="alloStatus" label="分配状态" width="180" /> <el-table-column prop="alloStatus" label="分配状态" width="180" />
<el-table-column label="操作" fixed="right" width="180"> <el-table-column label="操作" fixed="right" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button size="mini" type="primary" icon="el-icon-edit" @click="typeEdit(scope.$index, scope.row)"
size="mini"
type="primary"
icon="el-icon-edit"
@click="typeEdit(scope.$index, scope.row)"
>编辑</el-button >编辑</el-button
> >
<el-button <el-button size="mini" type="danger" icon="el-icon-delete" @click="typeDelete(scope.row)">删除</el-button>
size="mini"
type="danger"
icon="el-icon-delete"
@click="typeDelete(scope.row)"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -158,17 +132,8 @@ ...@@ -158,17 +132,8 @@
/> />
</el-form-item> </el-form-item>
<div class="contact1"> <div class="contact1">
<el-form-item <el-form-item prop="eCommerceId" label="电商ID" :label-width="'100px'">
prop="eCommerceId" <el-input v-model="addFormInfo.from.eCommerceId" style="width: 180px" type="text" clearable />
label="电商ID"
:label-width="'100px'"
>
<el-input
v-model="addFormInfo.from.eCommerceId"
style="width: 180px"
type="text"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item label="是否是内蒙的信息" :label-width="'160px'"> <el-form-item label="是否是内蒙的信息" :label-width="'160px'">
<el-radio-group v-model="addFormInfo.from.isNeiMeng"> <el-radio-group v-model="addFormInfo.from.isNeiMeng">
...@@ -193,59 +158,33 @@ ...@@ -193,59 +158,33 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item prop="telephone" label="电话" :label-width="'100px'"> <el-form-item prop="telephone" label="电话" :label-width="'100px'">
<el-input <el-input v-model="addFormInfo.from.telephone" clearable type="number" />
v-model="addFormInfo.from.telephone"
clearable
type="number"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item prop="wechatNumber" label="微信号" :label-width="'100px'">
prop="wechatNumber"
label="微信号"
:label-width="'100px'"
>
<el-input v-model="addFormInfo.from.wechatNumber" clearable /> <el-input v-model="addFormInfo.from.wechatNumber" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="20"> <el-col :span="20">
<el-form-item <el-form-item prop="corporate" label="公司名称" :label-width="'100px'">
prop="corporate"
label="公司名称"
:label-width="'100px'"
>
<el-input v-model="addFormInfo.from.corporate" clearable /> <el-input v-model="addFormInfo.from.corporate" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item <el-form-item label="需求描述:" autosize prop="description" :label-width="'100px'">
label="需求描述:" <el-input type="textarea" v-model="addFormInfo.from.description" :rows="5"></el-input>
autosize
prop="description"
:label-width="'100px'"
>
<el-input
type="textarea"
v-model="addFormInfo.from.description"
:rows="5"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<div></div> <div></div>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button <el-button type="primary" @click="uploadAddForm" :loading="addFormInfo.flag === 0">确定</el-button>
type="primary"
@click="uploadAddForm"
:loading="addFormInfo.flag === 0"
>确定</el-button
>
</div> </div>
</el-dialog> </el-dialog>
...@@ -273,32 +212,14 @@ ...@@ -273,32 +212,14 @@
placeholder="请选择类别" placeholder="请选择类别"
/> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item prop="changesalesman" label="选择销售人员" style="margin-left: 30px">
prop="changesalesman" <el-select v-model="addFormInfo.from.changesalesman" clearable placeholder="请选择销售人员">
label="选择销售人员" <el-option v-for="item in deliverAssign" :key="item.nickName" :label="item.nickName" :value="item.userId">
style="margin-left: 30px"
>
<el-select
v-model="addFormInfo.from.changesalesman"
clearable
placeholder="请选择销售人员"
>
<el-option
v-for="item in deliverAssign"
:key="item.nickName"
:label="item.nickName"
:value="item.userId"
>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="eCommerceId" label="电商ID" :label-width="'100px'"> <el-form-item prop="eCommerceId" label="电商ID" :label-width="'100px'">
<el-input <el-input v-model="addFormInfo.from.eCommerceId" style="width: 180px" type="text" clearable />
v-model="addFormInfo.from.eCommerceId"
style="width: 180px"
type="text"
clearable
/>
</el-form-item> </el-form-item>
<div class="contact"> <div class="contact">
<el-form-item prop="name" label="姓名" :label-width="'60px'"> <el-form-item prop="name" label="姓名" :label-width="'60px'">
...@@ -312,11 +233,7 @@ ...@@ -312,11 +233,7 @@
</div> </div>
<div class="contact"> <div class="contact">
<el-form-item prop="telephone" label="电话" :label-width="'60px'"> <el-form-item prop="telephone" label="电话" :label-width="'60px'">
<el-input <el-input v-model="addFormInfo.from.telephone" clearable type="number" />
v-model="addFormInfo.from.telephone"
clearable
type="number"
/>
</el-form-item> </el-form-item>
<div> <div>
<el-form-item prop="wechatNumber" label="微信号" :label-width="'60px'"> <el-form-item prop="wechatNumber" label="微信号" :label-width="'60px'">
...@@ -324,23 +241,10 @@ ...@@ -324,23 +241,10 @@
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<el-form-item <el-form-item prop="corporate" label="公司名称" style="margin-left: 40px; margin-top: 10px">
prop="corporate" <el-input v-model="addFormInfo.from.corporate" clearable style="width: 80% !important" />
label="公司名称"
style="margin-left: 40px; margin-top: 10px"
>
<el-input
v-model="addFormInfo.from.corporate"
clearable
style="width: 80% !important"
/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="需求描述:" autosize prop="description" style="margin-left: 40px; margin-top: 10px">
label="需求描述:"
autosize
prop="description"
style="margin-left: 40px; margin-top: 10px"
>
<el-input <el-input
type="textarea" type="textarea"
v-model="addFormInfo.from.description" v-model="addFormInfo.from.description"
...@@ -350,12 +254,7 @@ ...@@ -350,12 +254,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button <el-button type="primary" @click="manualuploadAddForm" :loading="addFormInfo.flag === 0">确定</el-button>
type="primary"
@click="manualuploadAddForm"
:loading="addFormInfo.flag === 0"
>确定</el-button
>
</div> </div>
</el-dialog> </el-dialog>
...@@ -385,24 +284,14 @@ ...@@ -385,24 +284,14 @@
/> />
</el-form-item> </el-form-item>
<el-form-item prop="eCommerceId" label="电商ID" :label-width="'100px'"> <el-form-item prop="eCommerceId" label="电商ID" :label-width="'100px'">
<el-input <el-input v-model="editFormInfo.from.eCommerceId" style="width: 180px" type="text" clearable />
v-model="editFormInfo.from.eCommerceId"
style="width: 180px"
type="text"
clearable
/>
</el-form-item> </el-form-item>
<div class="contact"> <div class="contact">
<el-form-item prop="name" label="姓名"> <el-form-item prop="name" label="姓名">
<el-input v-model="editFormInfo.from.name" type="text" clearable /> <el-input v-model="editFormInfo.from.name" type="text" clearable />
</el-form-item> </el-form-item>
<el-form-item prop="telephone" label="电话"> <el-form-item prop="telephone" label="电话">
<el-input <el-input v-model="editFormInfo.from.telephone" type="number" clearable v-bind:readonly="pMobile" />
v-model="editFormInfo.from.telephone"
type="number"
clearable
v-bind:readonly="pMobile"
/>
</el-form-item> </el-form-item>
</div> </div>
<div class="contact"> <div class="contact">
...@@ -413,30 +302,14 @@ ...@@ -413,30 +302,14 @@
</div> </div>
<div> <div>
<el-form-item prop="wechatNumber" label="微信号"> <el-form-item prop="wechatNumber" label="微信号">
<el-input <el-input v-model="editFormInfo.from.wechatNumber" clearable v-bind:readonly="mPassport" />
v-model="editFormInfo.from.wechatNumber"
clearable
v-bind:readonly="mPassport"
/>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<el-form-item <el-form-item prop="corporate" label="公司名称" style="margin-left: 30px; margin-top: 10px">
prop="corporate" <el-input v-model="editFormInfo.from.corporate" style="width: 80% !important" clearable />
label="公司名称"
style="margin-left: 30px; margin-top: 10px"
>
<el-input
v-model="editFormInfo.from.corporate"
style="width: 80% !important"
clearable
/>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="需求描述:" prop="description" style="margin-left: 30px; margin-top: 10px">
label="需求描述:"
prop="description"
style="margin-left: 30px; margin-top: 10px"
>
<el-input <el-input
type="textarea" type="textarea"
v-model="editFormInfo.from.description" v-model="editFormInfo.from.description"
...@@ -446,19 +319,14 @@ ...@@ -446,19 +319,14 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer"> <div slot="footer">
<el-button <el-button type="primary" @click="editConfig" :loading="editFormInfo.flag === 0">确定</el-button>
type="primary"
@click="editConfig"
:loading="editFormInfo.flag === 0"
>确定</el-button
>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import axios from "axios"; import axios from 'axios'
import { import {
getAllcategory, getAllcategory,
getNamecategory, getNamecategory,
...@@ -467,16 +335,12 @@ import { ...@@ -467,16 +335,12 @@ import {
deletecategory, deletecategory,
getAllCategory, getAllCategory,
deliverList, deliverList,
manualInfo, manualInfo
} from "@/api/management.js"; } from '@/api/management.js'
import { parseTime } from "../../utils"; import { parseTime } from '../../utils'
import { import { reqInformationTreeList, reqAllInfoTreeList, reqAllInfoTreeBuild } from '@/api/treeMenus.js'
reqInformationTreeList, import Treeselect from '@riophae/vue-treeselect'
reqAllInfoTreeList, import '@riophae/vue-treeselect/dist/vue-treeselect.css'
reqAllInfoTreeBuild,
} from "@/api/treeMenus.js";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
data() { data() {
return { return {
...@@ -488,7 +352,7 @@ export default { ...@@ -488,7 +352,7 @@ export default {
page: 1, page: 1,
size: 10, size: 10,
total: 0, total: 0,
newdata: [], newdata: []
}, },
//1.获取全部信息分类 //1.获取全部信息分类
typeManage: { typeManage: {
...@@ -499,33 +363,33 @@ export default { ...@@ -499,33 +363,33 @@ export default {
dropData: [], dropData: [],
addDialog: false, addDialog: false,
manualDialog: false, manualDialog: false,
fromData: [], fromData: []
}, },
//2.根据名称获取信息分类 //2.根据名称获取信息分类
tel: "", //电话 tel: '', //电话
className: 0, //信息分类 className: 0, //信息分类
salesName: "", //销售人员 salesName: '', //销售人员
searchTime: "", //时间 searchTime: '', //时间
// 新增 // 新增
editDialog: false, editDialog: false,
addFormInfo: { addFormInfo: {
from: { from: {
localdata: [], localdata: [],
classidStr: 0, classidStr: 0,
name: "", name: '',
telephone: "", telephone: '',
qq: "", qq: '',
wechatNumber: "", wechatNumber: '',
corporate: "", corporate: '',
description: "", description: '',
user: "", user: '',
adduserId: "", adduserId: '',
putdata: [], putdata: [],
changesalesman: "", changesalesman: '',
eCommerceId: "", eCommerceId: '',
isNeiMeng: false, isNeiMeng: false
}, },
flag: 1, flag: 1
}, },
deliverAssign: [], deliverAssign: [],
...@@ -533,86 +397,82 @@ export default { ...@@ -533,86 +397,82 @@ export default {
editFormInfo: { editFormInfo: {
from: { from: {
classidStr: 0, classidStr: 0,
name: "", name: '',
telephone: "", telephone: '',
qq: "", qq: '',
wechatNumber: "", wechatNumber: '',
corporate: "", corporate: '',
description: "", description: '',
userId: "", userId: '',
id: "", id: '',
listid: "", listid: '',
pushdata: [], pushdata: [],
eCommerceId: "", eCommerceId: ''
}, },
flag: 1, flag: 1
}, },
// 验证 // 验证
rules: { rules: {
name: [{ required: true, message: "请输入姓名", trigger: "blur" }], name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
telephone: [ telephone: [
{ {
// required: true, message: "请输入正确的联系方式", // required: true, message: "请输入正确的联系方式",
pattern: /^1[3456789]\d{9}$/, pattern: /^1[3456789]\d{9}$/,
message: "请输入正确的联系方式", message: '请输入正确的联系方式',
trigger: "blur", trigger: 'blur'
}, }
], ],
qq: [ qq: [
// { required: true, message: 'QQ号只可输入5-11位数字', trigger: 'change' }, // { required: true, message: 'QQ号只可输入5-11位数字', trigger: 'change' },
{ {
pattern: /^[1-9][0-9]{0,12}$/, pattern: /^[1-9][0-9]{0,12}$/,
message: "QQ号只可输入5-11位数字", message: 'QQ号只可输入5-11位数字',
trigger: "change", trigger: 'change'
}, },
{ {
pattern: /^\d{5,12}$/, pattern: /^\d{5,12}$/,
message: "QQ号只可输入5-11位数字", message: 'QQ号只可输入5-11位数字',
trigger: "change", trigger: 'change'
}, }
], ],
// wechatNumber: [ // wechatNumber: [
// {pattern:/^[a-zA-Z][a-zA-Z0-9_-]{5,19}$/,message: "请输入正确的微信号码",trigger: "blur"}, // {pattern:/^[a-zA-Z][a-zA-Z0-9_-]{5,19}$/,message: "请输入正确的微信号码",trigger: "blur"},
// ], // ],
wechatNumber: [{ message: "请输入正确的微信号码", trigger: "blur" }], wechatNumber: [{ message: '请输入正确的微信号码', trigger: 'blur' }],
classidStr: [ classidStr: [{ required: true, message: '请选择类别', trigger: 'blur' }],
{ required: true, message: "请选择类别", trigger: "blur" }, changesalesman: [{ required: true, message: '请选择销售人员', trigger: 'blur' }]
],
changesalesman: [
{ required: true, message: "请选择销售人员", trigger: "blur" },
],
// corporate: [{ required: true, message: "请输入公司名称", trigger: "blur"}], // corporate: [{ required: true, message: "请输入公司名称", trigger: "blur"}],
}, },
infoTree: { infoTree: {
menus: [{ id: 0, label: "信息分类", children: null, pid: -1 }], menus: [{ id: 0, label: '信息分类', children: null, pid: -1 }],
Dict: [], Dict: []
}, }
}; }
}, },
components: { Treeselect }, components: { Treeselect },
mounted() { mounted() {
var that = this; var that = this
deliverList().then( deliverList().then(
function (res) { function (res) {
var deliverData = res.object || []; var deliverData = res.object || []
this.deliverAssign = deliverData; this.deliverAssign = deliverData
}.bind(this) }.bind(this)
); )
// 信息分类字典 // 信息分类字典
reqAllInfoTreeList().then(function (res) { reqAllInfoTreeList().then(function (res) {
if (res.code === 200) { if (res.code === 200) {
var list = res.object.records || []; var list = res.object.records || []
list.push(that.infoTree.menus[0]); list.push(that.infoTree.menus[0])
qf.Utils.treeListBuild(list); qf.Utils.treeListBuild(list)
that.infoTree.Dict = qf.Utils.arrayToJsonDict(list, "id"); that.infoTree.Dict = qf.Utils.arrayToJsonDict(list, 'id')
} }
}); })
this.allManagement(); this.allManagement()
this.classification(); this.classification()
this.getSelectInfo(); this.getSelectInfo()
// 销售人员列表 // 销售人员列表
}, },
...@@ -621,22 +481,22 @@ export default { ...@@ -621,22 +481,22 @@ export default {
deep: true, deep: true,
handler: function (val) { handler: function (val) {
if (val.length > 0) { if (val.length > 0) {
this.mPassport = true; this.mPassport = true
} else { } else {
this.mPassport = false; this.mPassport = false
} }
}, }
}, },
mobile: { mobile: {
deep: true, deep: true,
handler: function (val) { handler: function (val) {
if (val.length > 0) { if (val.length > 0) {
this.pMobile = true; this.pMobile = true
} else { } else {
this.pMobile = false; this.pMobile = false
} }
}, }
}, }
}, },
methods: { methods: {
...@@ -644,81 +504,81 @@ export default { ...@@ -644,81 +504,81 @@ export default {
classification(params) { classification(params) {
var params = { var params = {
page: this.newManage.page, page: this.newManage.page,
pageSize: this.newManage.size, pageSize: this.newManage.size
}; }
getAllCategory(params).then((res) => { getAllCategory(params).then((res) => {
var newlist = res.object.records || []; var newlist = res.object.records || []
this.newManage.newdata = newlist; this.newManage.newdata = newlist
}); })
}, },
// 获取分类下拉列表 // 获取分类下拉列表
getSelectInfo() { getSelectInfo() {
var typeM = this.typeManage; var typeM = this.typeManage
var params = { var params = {
page: 1, page: 1,
pageSize: 999, pageSize: 999
}; }
getAllCategory(params).then((res) => { getAllCategory(params).then((res) => {
var dropDown = res.object.records || []; var dropDown = res.object.records || []
typeM.dropData = dropDown; typeM.dropData = dropDown
}); })
}, },
//1.获取全部信息管理 //1.获取全部信息管理
allManagement(params) { allManagement(params) {
var typeM = this.typeManage; var typeM = this.typeManage
var params = { var params = {
page: typeM.page, page: typeM.page,
pageSize: typeM.size, pageSize: typeM.size
}; }
getAllcategory(params).then((res) => { getAllcategory(params).then((res) => {
var selectlist = res.object.records || []; var selectlist = res.object.records || []
typeM.selectdata = selectlist; typeM.selectdata = selectlist
typeM.total = res.object.total; typeM.total = res.object.total
}); })
}, },
//获取全部信息管理分页 //获取全部信息管理分页
handleSizeChange(val) { handleSizeChange(val) {
// 每页多少条 // 每页多少条
this.typeManage.size = val; this.typeManage.size = val
this.toSearch(); this.toSearch()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
// 当前是多少页 // 当前是多少页
this.typeManage.page = val; this.typeManage.page = val
this.toSearch(); this.toSearch()
}, },
//2.根据名称获取信息分类 //2.根据名称获取信息分类
toSearch() { toSearch() {
var typeM = this.typeManage; var typeM = this.typeManage
var param = { var param = {
page: this.typeManage.page, page: this.typeManage.page,
pageSize: this.typeManage.size, pageSize: this.typeManage.size
}; }
this.tel && (param.tel = this.tel); this.tel && (param.tel = this.tel)
this.salesName && (param.salesName = this.salesName); this.salesName && (param.salesName = this.salesName)
this.className && (param.className = this.className); this.className && (param.className = this.className)
// 时间 // 时间
if (this.searchTime instanceof Array) { if (this.searchTime instanceof Array) {
param.startTime = parseTime(new Date(this.searchTime[0])); param.startTime = parseTime(new Date(this.searchTime[0]))
param.endTime = parseTime(new Date(this.searchTime[1])); param.endTime = parseTime(new Date(this.searchTime[1]))
} }
var typeM = this.typeManage; var typeM = this.typeManage
getNamecategory(param).then((res) => { getNamecategory(param).then((res) => {
var selectlist = res.object.records || []; var selectlist = res.object.records || []
typeM.selectdata = selectlist; typeM.selectdata = selectlist
typeM.total = res.object.total; typeM.total = res.object.total
}); })
}, },
// 新增 // 新增
addDialogData() { addDialogData() {
this.typeManage.addDialog = true; this.typeManage.addDialog = true
// this.addFormInfo.from = { // this.addFormInfo.from = {
// classidStr: 0, // classidStr: 0,
// }; // };
this.addFormInfo.from.classidStr = 0; this.addFormInfo.from.classidStr = 0
this.addFormInfo.from.user = this.$store.getters.user.username; this.addFormInfo.from.user = this.$store.getters.user.username
// userId // userId
this.addFormInfo.from.adduserId = this.$store.getters.user.id; this.addFormInfo.from.adduserId = this.$store.getters.user.id
}, },
uploadAddForm() { uploadAddForm() {
if (this.addFormInfo.flag) { if (this.addFormInfo.flag) {
...@@ -735,61 +595,58 @@ export default { ...@@ -735,61 +595,58 @@ export default {
username: this.addFormInfo.from.user, username: this.addFormInfo.from.user,
userId: this.addFormInfo.from.adduserId, userId: this.addFormInfo.from.adduserId,
eCommerceId: this.addFormInfo.from.eCommerceId, eCommerceId: this.addFormInfo.from.eCommerceId,
isNeiMeng: this.addFormInfo.from.isNeiMeng, isNeiMeng: this.addFormInfo.from.isNeiMeng
}; }
if ( if (this.addFormInfo.from.telephone === undefined && this.addFormInfo.from.wechatNumber === undefined) {
this.addFormInfo.from.telephone === undefined &&
this.addFormInfo.from.wechatNumber === undefined
) {
this.$message({ this.$message({
type: "error", type: 'error',
message: "电话或微信号必须填一个", message: '电话或微信号必须填一个'
}); })
} else { } else {
var self = this; var self = this
addcategory(params).then((res) => { addcategory(params).then((res) => {
this.typeManage.addDialog = false; this.typeManage.addDialog = false
setTimeout(function () { setTimeout(function () {
self.addFormInfo.flag = 1; self.addFormInfo.flag = 1
}, 300); }, 300)
if (res.code === 200) { if (res.code === 200) {
this.allManagement(); this.allManagement()
self.$message({ self.$message({
type: "success", type: 'success',
message: "新增成功", message: '新增成功'
}); })
} else if (res.code === 401) { } else if (res.code === 401) {
self.$message({ self.$message({
type: "error", type: 'error',
message: "已有客户", message: '已有客户'
}); })
} else if (res.code === 402) { } else if (res.code === 402) {
self.$message({ self.$message({
type: "error", type: 'error',
message: "没有销售被分配了该类别的权重", message: '没有销售被分配了该类别的权重'
}); })
} else { } else {
self.$message({ self.$message({
type: "error", type: 'error',
message: "新增失败", message: '新增失败'
}); })
} }
}); })
} }
} }
}); })
} }
}, },
// 手动分配新增信息 // 手动分配新增信息
manualAssignment() { manualAssignment() {
// username // username
this.typeManage.manualDialog = true; this.typeManage.manualDialog = true
this.addFormInfo.from = { classidStr: 0 }; this.addFormInfo.from = { classidStr: 0 }
this.addFormInfo.from.user = this.$store.getters.user.username; this.addFormInfo.from.user = this.$store.getters.user.username
// userId // userId
this.addFormInfo.from.adduserId = this.$store.getters.user.id; this.addFormInfo.from.adduserId = this.$store.getters.user.id
}, },
manualuploadAddForm() { manualuploadAddForm() {
if (this.addFormInfo.flag) { if (this.addFormInfo.flag) {
...@@ -806,67 +663,64 @@ export default { ...@@ -806,67 +663,64 @@ export default {
username: this.addFormInfo.from.user, username: this.addFormInfo.from.user,
userId: this.addFormInfo.from.adduserId, userId: this.addFormInfo.from.adduserId,
saleidStr: this.addFormInfo.from.changesalesman, saleidStr: this.addFormInfo.from.changesalesman,
eCommerceId: this.addFormInfo.from.eCommerceId, eCommerceId: this.addFormInfo.from.eCommerceId
}; }
console.log(params); console.log(params)
if ( if (this.addFormInfo.from.telephone === undefined && this.addFormInfo.from.wechatNumber === undefined) {
this.addFormInfo.from.telephone === undefined &&
this.addFormInfo.from.wechatNumber === undefined
) {
this.$message({ this.$message({
type: "error", type: 'error',
message: "电话或微信号必须填一个", message: '电话或微信号必须填一个'
}); })
} else { } else {
var self = this; var self = this
manualInfo(params).then((res) => { manualInfo(params).then((res) => {
this.typeManage.manualDialog = false; this.typeManage.manualDialog = false
setTimeout(function () { setTimeout(function () {
self.addFormInfo.flag = 1; self.addFormInfo.flag = 1
}, 300); }, 300)
if (res.code === 200) { if (res.code === 200) {
this.allManagement(); this.allManagement()
self.$message({ self.$message({
type: "success", type: 'success',
message: "新增成功", message: '新增成功'
}); })
} else if (res.code === 401) { } else if (res.code === 401) {
self.$message({ self.$message({
type: "error", type: 'error',
message: "已有客户", message: '已有客户'
}); })
} else { } else {
self.$message({ self.$message({
type: "error", type: 'error',
message: "新增失败", message: '新增失败'
}); })
} }
}); })
} }
} }
}); })
} }
}, },
// 编辑 // 编辑
typeEdit(index, item) { typeEdit(index, item) {
// userId // userId
this.editFormInfo.from.userData = this.$store.getters.user.id; this.editFormInfo.from.userData = this.$store.getters.user.id
this.editDialog = true; this.editDialog = true
this.editFormInfo.from.classidStr = item.classidStr; this.editFormInfo.from.classidStr = item.classidStr
this.editFormInfo.from.name = item.name; this.editFormInfo.from.name = item.name
this.editFormInfo.from.telephone = item.tel; this.editFormInfo.from.telephone = item.tel
this.editFormInfo.from.wechatNumber = item.weixin; this.editFormInfo.from.wechatNumber = item.weixin
this.editFormInfo.from.corporate = item.company; this.editFormInfo.from.corporate = item.company
this.editFormInfo.from.description = item.remarks; this.editFormInfo.from.description = item.remarks
this.editFormInfo.from.qq = item.qqnub; this.editFormInfo.from.qq = item.qqnub
this.editFormInfo.from.listid = item.id; this.editFormInfo.from.listid = item.id
this.editFormInfo.from.eCommerceId = item.eCommerceId; this.editFormInfo.from.eCommerceId = item.eCommerceId
}, },
editConfig() { editConfig() {
if (this.editFormInfo.flag) { if (this.editFormInfo.flag) {
this.editFormInfo.flag = 0; this.editFormInfo.flag = 0
this.$refs.addDataForm.validate((valid) => { this.$refs.addDataForm.validate((valid) => {
if (valid) { if (valid) {
var params = { var params = {
...@@ -879,79 +733,75 @@ export default { ...@@ -879,79 +733,75 @@ export default {
remarks: this.editFormInfo.from.description, remarks: this.editFormInfo.from.description,
userId: this.editFormInfo.from.userData, userId: this.editFormInfo.from.userData,
id: this.editFormInfo.from.listid, id: this.editFormInfo.from.listid,
eCommerceId: this.editFormInfo.from.eCommerceId, eCommerceId: this.editFormInfo.from.eCommerceId
}; }
var self = this; var self = this
editcategory(params).then((res) => { editcategory(params).then((res) => {
this.editDialog = false; this.editDialog = false
setTimeout(function () { setTimeout(function () {
self.editFormInfo.flag = 1; self.editFormInfo.flag = 1
}, 300); }, 300)
this.allManagement(); this.allManagement()
self.$message({ self.$message({
type: "success", type: 'success',
message: "编辑成功", message: '编辑成功'
}); })
}); })
} }
}); })
} }
}, },
// 删除 // 删除
typeDelete(item) { typeDelete(item) {
var id = item.id; var id = item.id
this.$confirm( this.$confirm('销售部门已记录该客户,删除该条信息后,后续无法添加该客户相关信息,请谨慎操作', '提示', {
"销售部门已记录该客户,删除该条信息后,后续无法添加该客户相关信息,请谨慎操作", confirmButtonText: '确定',
"提示", cancelButtonText: '取消',
{ type: 'warning'
confirmButtonText: "确定", }).then(() => {
cancelButtonText: "取消",
type: "warning",
}
).then(() => {
deletecategory({ id: id }).then( deletecategory({ id: id }).then(
(res) => { (res) => {
this.$message({ this.$message({
message: "删除成功", message: '删除成功',
type: "success", type: 'success'
}); })
this.allManagement(); this.allManagement()
}, },
() => { () => {
this.$message.error("删除失败"); this.$message.error('删除失败')
} }
); )
}); })
}, },
// 加载信息分类列表 // 加载信息分类列表
loadInfoTreeMenus({ action, parentNode, callback }) { loadInfoTreeMenus({ action, parentNode, callback }) {
if (action === "LOAD_CHILDREN_OPTIONS") { if (action === 'LOAD_CHILDREN_OPTIONS') {
setTimeout(() => { setTimeout(() => {
callback(); callback()
}, 100); }, 100)
return; return
reqInformationTreeList({ pid: parentNode.id }).then((res) => { reqInformationTreeList({ pid: parentNode.id }).then((res) => {
if (res.code === 200) { if (res.code === 200) {
var list = res.object.records || []; var list = res.object.records || []
console.log("list ________________ ", list); console.log('list ________________ ', list)
parentNode.children = list.map(function (obj) { parentNode.children = list.map(function (obj) {
if (!obj.leaf) { if (!obj.leaf) {
obj.children = null; obj.children = null
} }
return obj; return obj
}); })
setTimeout(() => { setTimeout(() => {
callback(); callback()
}, 100); }, 100)
} }
}); })
} }
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -959,36 +809,43 @@ export default { ...@@ -959,36 +809,43 @@ export default {
display: flex; display: flex;
margin: 20px 0; margin: 20px 0;
} }
.tools-wrapper { .tools-wrapper {
display: flex; display: flex;
margin: 20px 0; margin: 20px 0;
} }
.upload-file-wrapper { .upload-file-wrapper {
display: flex; display: flex;
.file-wrapper { .file-wrapper {
width: 240px; width: 240px;
height: 100px; height: 100px;
background: aliceblue; background: aliceblue;
} }
} }
.datamanage-wrapper { .datamanage-wrapper {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
background-color: #f5f6fb; background-color: #f5f6fb;
.tool-wrapper { .tool-wrapper {
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
margin: 10px 10px; margin: 10px 10px;
background: #fff; background: #fff;
} }
.search-wrapper { .search-wrapper {
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
margin: 10px 10px; margin: 10px 10px;
background: #fff; background: #fff;
} }
.table-wrapper { .table-wrapper {
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
...@@ -996,17 +853,20 @@ export default { ...@@ -996,17 +853,20 @@ export default {
background: #fff; background: #fff;
} }
} }
.contact { .contact {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
margin-left: -100px; margin-left: -100px;
} }
::v-deep input::-webkit-outer-spin-button, ::v-deep input::-webkit-outer-spin-button,
::v-deep input::-webkit-inner-spin-button { ::v-deep input::-webkit-inner-spin-button {
-webkit-appearance: none !important; -webkit-appearance: none !important;
} }
::v-deep input[type="‘number’"] {
::v-deep input[type='‘number’'] {
-moz-appearance: textfield !important; -moz-appearance: textfield !important;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment