Commit 73d0bc89 authored by xiongjinke's avatar xiongjinke

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	dsk-operate-ui/src/views/project/projectList/component/gjjl.vue
#	dsk-operate-ui/src/views/project/projectList/component/zlwd.vue
parents 01c00971 13fe9995
......@@ -108,9 +108,8 @@ export function addGJJL(param) {
//删除跟进记录
export function delGJJL(param) {
return request({
url: '/business/record/remove/',
url: '/business/record/remove/'+param,
method: 'DELETE',
params:param
})
}
......@@ -183,3 +182,20 @@ export function delZLWD(param) {
data:param
})
}
//查询关联项目
export function relateProject(param) {
return request({
url: '/business/record/relate/project/'+param,
method: 'get',
})
}
//查询跟进动态
export function allRecord(param) {
return request({
url: '/business/record/all/list',
method: 'get',
params:param,
})
}
......@@ -579,8 +579,8 @@
}
}
.el-input__prefix{
left: 8px;
.el-input__prefix .el-input__icon{
//left: 8px;
top: -2px;
position: absolute;
}
......@@ -869,6 +869,7 @@
.img{
float: left;
margin-right: 8px;
margin-top: -2px;
}
}
}
......
......@@ -62,11 +62,25 @@ export default {
saveAs(text, name, opts) {
saveAs(text, name, opts);
},
exportByPost(url, params){
var url = baseURL + url
axios({
method: 'post',
url: url,
responseType: 'blob',
data: params,
headers: { 'Authorization': 'Bearer ' + getToken() }
}).then(res => {
const blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
this.saveAs(blob, decodeURI(res.headers['download-filename']))
})
},
async printErrMsg(data) {
const resText = await data.text();
const rspObj = JSON.parse(resText);
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
Message.error(errMsg);
}
},
}
<template>
<div>
<el-card class="box-card noborder">
<div class="cardtitles">跟进记录</div>
<div class="cardtitles" v-if="showtype != 'projectgjdt'">跟进记录</div>
<div style="height: 24px" v-if="showtype == 'projectgjdt'"></div>
<div class="records">
<div class="writeIn">
<div class="default" v-if="isEdit == false" @click="getEdit">
......@@ -24,6 +25,10 @@
<el-option v-for="(item,index) in glqylist" :key="index" :label="item.companyName" :value="item.customerId"></el-option>
</el-select>
</template>
<el-select v-if="showtype == 'projectgjdt'" v-model="projectId" class="w128" placeholder="关联项目">
<i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_1.png"></i>
<el-option v-for="(item,index) in projectList" :key="index" :label="item.projectName" :value="item.id"></el-option>
</el-select>
<el-input v-model="addParam.name" placeholder="拜访对象" style="width: 100px;">
<i slot="prefix" class="el-input__icon"><img src="@/assets/images/project/ico_2.png"></i>
</el-input>
......@@ -65,7 +70,7 @@
</div>
</div>
</div>
<div class="recordlist" v-if="showtype=='gjjl' && recordlist.total>0">
<div class="recordlist" v-if="showtype=='gjjl' || showtype == 'projectgjdt' && recordlist.total>0">
<div class="rec_detail" v-for="(item,index) in recordlist.rows">
<div class="rec_time">
......@@ -116,7 +121,7 @@
<script>
import "@/assets/styles/project.scss"
import {getFollowList,addFollowRecord,getUserList,delFollowRecord} from '@/api/custom/custom'
import {getGJJL,addGJJL,delGJJL} from '@/api/project/project'
import {getGJJL,addGJJL,delGJJL,relateProject,allRecord} from '@/api/project/project'
import {getEnterprise,getDictType,} from '@/api/main'
export default {
props:{
......@@ -129,10 +134,6 @@
default: ""
},
datas:[],//数据源
detailId: { //从企业详情跳转过来ID
type: Number,
default: 0
}
},
name: 'gjjl',
data(){
......@@ -156,7 +157,9 @@
recordlist:[],//列表数据源
isdel:false,
delID:'',//删除记录的ID
projectId:this.detailId ? this.detailId : parseInt(this.$route.query.id),//项目详情id
projectId:parseInt(this.$route.query.id),//项目详情id
userId:this.$store.state.user.userId,//当前用户id
projectList:[],//关联项目
}
},
computed: {
......@@ -178,11 +181,25 @@
if(this.showtype == 'gjjl'){
this.getGJJL()
}
//项目管理跟进动态
if(this.showtype == 'projectgjdt'){
this.projectId = null//项目id暂时清空,必须手选id
relateProject(this.userId).then(res=>{
this.projectList = res.data
})
this.getGJDT()
}
console.log(this.types)
},
methods:{
//添加跟进动态
addFollow(){
if(this.types == 'projectgjdt'){
if(this.projectId == "" || this.projectId == null){
this.$message.error('请选择关联项目!')
return false
}
}
if(this.types == 'gjdt'){
if(this.customerIds){
this.addParam.customerId = this.customerIds
......@@ -197,7 +214,7 @@
}
})
}
if(this.types == 'gjjl'){
if(this.types == 'gjjl' || this.types == 'projectgjdt'){
let param = {
businessId:this.projectId,
userId:this.$store.state.user.userId,
......@@ -233,7 +250,7 @@
}
})
}
if(this.types == 'gjjl') {
if(this.types == 'gjjl' || this.types == 'projectgjdt') {
delGJJL(this.delID).then(result => {
if (result.code == 200) {
this.handleCurrentChange(1)
......@@ -244,6 +261,7 @@
}
},
//跟进动态列表
//客户管理跟进动态
getGJDTlist(){
let param = {
pageNum:this.pageNum,//页码
......@@ -260,6 +278,22 @@
})
})
},
//项目管理跟进动态
getGJDT(){
let param = {
pageNum:this.pageNum,//页码
pageSize:this.pageSize,
userId: this.userId
}
allRecord(param).then(result=>{
this.recordlist = result.code == 200?result:[]
// this.recordlist.rows.forEach(item=>{
// item.createTime = this.gettime(item.createTime)
// item.nextVisitTime = this.gettime(item.nextVisitTime)
// })
})
},
//项目管理项目详情跟进记录
getGJJL(){
let param = {
pageNum:this.pageNum,//页码
......@@ -278,12 +312,15 @@
if(this.showtype == 'gjjl'){
this.getGJJL()
}
if(this.showtype == 'projectgjdt'){
this.getGJDT()
}
},
getEdit(){
this.isEdit = true;
this.value = ""
this.addParam={
customerId:'', //客户id
customerId:'', //客户id
visitMode:'',//拜访方式
nextVisitTime:'',//下次拜访时间
name:'',//拜访对象姓名
......
......@@ -218,7 +218,7 @@
if(res.code == 200){
this.$message.success('删除成功')
this.ondel = -1
this.getlist()
this.handleCurrentChange(1)
}
})
},
......
......@@ -5,7 +5,7 @@
<div class="cardtitles">资料文档</div>
<div class="searchbtns">
<div class="searchInput">
<el-input type="text" placeholder="输入关键词查询"></el-input>
<el-input type="text" v-model="param.keyword" placeholder="输入关键词查询"></el-input>
<div class="btn" @click="handleCurrentChange(1)">搜索</div>
</div>
<div class="btn btn_primary h32 b2" @click="getUP"><div class="img img2"></div>上传</div>
......@@ -20,7 +20,7 @@
:multiple="false"
ref="upload"
:file-list="fileList"
accept=".word,.pdf.excel,.xlsx"
accept=".word,.pdf.excel,.xlsx,.doc,.docx"
:headers="headers"
:show-file-list="false"
:on-success="onSuccess">
......@@ -105,6 +105,13 @@
</el-pagination>
</div>
</div>
<div class="delform" v-if="ondel != ''">
<div class="words">是否将文档删除</div>
<div>
<div class="btnsmall btn_primary h28" @click="delQY()">确定</div>
<div class="btnsmall btn_cancel h28" @click="ondel = ''">取消</div>
</div>
</div>
</div>
</el-card>
</div>
......@@ -116,12 +123,6 @@
import { getZLWD ,delZLWD} from "@/api/project/project";
export default {
name: 'zlwd',
props: {
detailId: { //从企业详情跳转过来ID
type: Number,
default: 0
}
},
data(){
return{
isupload:false,
......@@ -131,15 +132,17 @@
fileList: [],
headers: {
Authorization: "Bearer " + getToken(),
filePath:this.detailId ? this.detailId : this.$route.query.id,
filePath:this.$route.query.id,
},
param:{
pageNum:1,
pagesize:20,
filePath:this.detailId ? this.detailId : this.$route.query.id,
filePath:this.$route.query.id,
keyword:'',
},
fileDatas:[],
filename:'',
ondel:"",
}
},
created(){
......@@ -148,20 +151,24 @@
},
methods:{
getall(){
this.param.filePath = this.detailId ? this.detailId : this.$route.query.id
this.param.filePath = this.$route.query.id
this.filename=''
this.headers.filePath = this.detailId ? this.detailId : this.$route.query.id
this.headers.filePath = this.$route.query.id
this.handleCurrentChange(1)
},
getList(){
getZLWD(this.param).then(res=>{
this.fileDatas = res
if(this.fileDatas.rows!=null && this.fileDatas .length>0){
this.fileDatas.forEach(item=>{
let names = item.filePath.split('\\')
if(this.fileDatas.rows!=null && this.fileDatas.rows.length>0){
this.fileDatas.rows.forEach(item=>{
let names = item.filePath.split('/')
item.name = names[names.length-1]
let types = item.name.split('.')
item.type = types.length>1?types[1]:'file'
if(item.type == 'xls' || item.type == 'xlsx' )
item.type = 'excel'
if(item.type == 'doc' || item.type == 'docx' )
item.type = 'word'
})
}
})
......@@ -169,7 +176,7 @@
getFile(row){
if(row.type == 'file'){
this.filename = row.name
this.headers.filePath = this.detailId ? this.detailId : this.$route.query.id+'\\'+row.name
this.headers.filePath = this.$route.query.id+'/'+row.name
this.param.filePath = row.filePath
this.handleCurrentChange(1)
......@@ -184,20 +191,33 @@
})
},
downnlod(row){
let a = document.createElement("a");
a.setAttribute("href", row.filePath);
a.setAttribute("download", row.name);
document.body.appendChild(a);
a.click();
let param = {filePath:row.filePath}
// this.$download.saveAs(row.filePath,row.name);
this.$download.exportByPost('/business/file/download',param);
// // this.$download()
// let a = document.createElement("a");
// a.setAttribute("href", row.filePath);
// a.setAttribute("download", row.name);
// document.body.appendChild(a);
// a.click();
},
del(path){
delZLWD(path).then(res=>{
delQY(){
let param = {
filePath:this.ondel
}
delZLWD(JSON.stringify(param)).then(res=>{
if(res.code == 200){
this.$message.success('删除成功!')
this.handleCurrentChange(1)
this.ondel = ''
}
})
},
del(path){
this.ondel = path
},
handleFileListChange(file, fileList) {
if (fileList.length > 0) {
this.fileList = [fileList[fileList.length - 1]];
......@@ -231,7 +251,7 @@
//翻页
handleCurrentChange(val) {
this.param.pageNum(1)
this.param.pageNum=val
this.getList()
},
cancel(){
......@@ -246,6 +266,10 @@
</script>
<style lang="scss" scoped>
.delform{
position: fixed; left:50%; top:50%; transform:translate(-50%,-50%)
}
.filepath{
font-size: 12px;
height: 30px;
......
<template>
<div class="app-container">
跟进动态
<gjjl types="projectgjdt"></gjjl>
</div>
</template>
<script>
import gjjl from '../projectList/component/gjjl.vue'
export default {
name: 'Trends',
components: {gjjl,},
data() {
return {
}
......
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