Commit e04d1ca5 authored by 高宇's avatar 高宇

完成商机信息;

parent 3e3b0988
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
], ],
homePage: { homePage: {
appName: portalName, appName: portalName,
url: '/list' url: '/project'
} }
} }
......
...@@ -8,25 +8,16 @@ export default { ...@@ -8,25 +8,16 @@ export default {
getProjectList: { getProjectList: {
url: '/vue/project/list' url: '/vue/project/list'
}, },
// 删除日志 // 删除商机
delWorkLog: { delProject: {
url: '/vue/work-log/delete' url: '/vue/project/delete'
}, },
// 获取工作日志新建 option // 获取工作日志新建 option
getWorkLogNewOptions: { getProjectNewOptions: {
url: '/vue/work-log/get-new' url: '/vue/project/get-new'
}, },
// 获取工作日志编辑 getProjectEdit: {
getWorkLogEdit: { url: '/vue/project/get-edit'
url: '/vue/work-log/get-edit'
},
// 工作日志编辑
saveWorkLogEdit: {
url: '/vue/work-log/save-edit'
},
// 工作日志新建
saveWorkLogAdd: {
url: '/vue/work-log/save-new'
}, },
// 留言 // 留言
...@@ -48,9 +39,9 @@ export default { ...@@ -48,9 +39,9 @@ export default {
getClient: { getClient: {
url: '/vue/client/get-edit' url: '/vue/client/get-edit'
}, },
// 获取客户工作日志列表 // 获取客户商机列表
getWorkLogClient: { getProjectClient: {
url: '/vue/work-log/of-client' url: '/vue/project/of-client'
}, },
// 搜索客户名称列表 // 搜索客户名称列表
......
<template>
<section class="multiple-input">
<el-row :gutter="10">
<el-col :span="4" :class="['client-label', 'text-right', {'required': required}]">
<span>{{label}}</span>
</el-col>
<el-col :span="14">
<div class="engineer-box pull-left" v-for="(item, key) in engineer" :key="key">
<div class="engineer-name pull-left">
<el-checkbox v-model="item.disabled">{{item.name}}</el-checkbox>
</div>
<div class="engineer-percent pull-right">
<el-select v-model="item[item.key]" size="mini" :disabled="!item.disabled">
<el-option
v-for="item in contribution"
:key="item"
:label="item * 10 + '%'"
:value="item / 10">
</el-option>
</el-select>
</div>
</div>
</el-col>
<el-col :span="6">
<slot name="formError"></slot>
</el-col>
</el-row>
</section>
</template>
<script>
// 多级选择支持用户占比
import itemMixin from '../../lib/singleItemMixin'
let contribution = () => {
let a = []
for (let i = 10; i >= 0; i--) {
a.push(i)
}
return a
}
export default {
name: '',
mixins: [itemMixin],
data () {
return {
contribution: contribution()
}
},
methods: {},
created () {
}
}
</script>
<style scoped>
.engineer-box {
width: 130px;
margin: 0 10px 5px 0;
}
.engineer-box .engineer-name {
width: 60px;
}
.engineer-box .engineer-percent {
width: 70px;
}
</style>
...@@ -3,12 +3,14 @@ ...@@ -3,12 +3,14 @@
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="4" :class="['client-label', 'text-right', {'required': required}]"> <el-col :span="4" :class="['client-label', 'text-right', {'required': required}]">
<span>{{label}}</span> <span>{{label}}</span>
{{item}}
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<span v-for="(i, key) in item" :key="key"> <span v-for="(i, key) in items" :key="key">
<el-input v-model="i[multipleKey]" :placeholder="label" size="mini"> <el-input v-model="i[multipleKey]" :placeholder="label" size="mini">
<el-button slot="append" v-if="key === 0" icon="el-icon-plus" @click="addItem(item)"></el-button> <template slot="prepend">{{setPerText(key)}}</template>
<el-button slot="append" v-else icon="el-icon-minus" @click="delItem(item, key)"></el-button> <el-button slot="append" v-if="key === 0" icon="el-icon-plus" @click="addItem(items)"></el-button>
<el-button slot="append" v-else icon="el-icon-minus" @click="delItem(items, key)"></el-button>
</el-input> </el-input>
</span> </span>
</el-col> </el-col>
......
...@@ -5,19 +5,19 @@ ...@@ -5,19 +5,19 @@
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24" class="entity-name"> <el-col :span="24" class="entity-name">
<i class="fa fa-star" aria-hidden="true"></i> <i class="fa fa-star" aria-hidden="true"></i>
<router-link :to="toView(item)" v-if="Object.keys(item.client).length > 0">{{ item.client.name }} <router-link :to="toView(item)" v-if="Object.keys(item.client).length > 0">&nbsp;{{ item.client.name }}
</router-link> </router-link>
<span v-else>客户名称{{noneText}}</span> <span v-else>客户名称{{noneText}}</span>
</el-col> </el-col>
<el-col :span="24" class="entity-name"> <el-col :span="24" class="entity-name">
<i class="fa fa-th-list" aria-hidden="true"></i> <i class="fa fa-th-list" aria-hidden="true"></i>
<span>{{ item.project_title }}</span> <span> {{ item.project_title }}</span>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" class="entity-name">
<img class="user-avatar rounded-circle" :src="item.createdBy.avatar.name"> <img class="user-avatar rounded-circle" :src="item.createdBy.avatar.name">
<span>{{ item.createdBy.name }}</span> <span class="np"> {{ item.createdBy.name }}</span>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" class="entity-name">
<span class="border rounded px-1">{{Object.keys(item.projectStatus).length === 0 ? noneText : item.projectStatus.name}}</span> <span class="border rounded px-1">{{Object.keys(item.projectStatus).length === 0 ? noneText : item.projectStatus.name}}</span>
</el-col> </el-col>
</el-row> </el-row>
...@@ -55,12 +55,39 @@ ...@@ -55,12 +55,39 @@
</span> </span>
</el-col> </el-col>
<el-col :span="6" :xs="24"> <el-col :span="6" :xs="24">
售前支持: {{item.projectArchitects.length === 0 ? noneText : item.projectArchitects.map(i => i.name).join(' ') }} 售前支持: {{item.projectArchitects.length === 0 ? noneText : item.projectArchitects.map(i => i.name).join(' ')}}
</el-col> </el-col>
<el-col :span="6" :xs="24" class="show-picture"> <el-col :span="6" :xs="24" class="show-picture">
成交日期: <span class="date-time">{{item.bargain_date !== '' ? item.bargain_date : noneText}}</span> 成交日期: <span class="date-time">{{item.bargain_date !== '' ? item.bargain_date : noneText}}</span>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10">
<el-col :span="6" :xs="24">
采购方式: <span class="border border-success text-success rounded px-1"
v-if="Object.keys(item.purchaseType).length > 0">{{item.purchaseType.name}}</span>
<span v-else>{{noneText}}</span>
</el-col>
<el-col :span="6" :xs="24">
商机来源: <span class="border border-success text-success rounded px-1"
v-if="Object.keys(item.opportunityFrom).length > 0">{{item.opportunityFrom.name}}</span>
<span v-else>{{noneText}}</span>
</el-col>
<el-col :span="6" :xs="24">
<span class="border border-danger text-danger rounded px-1">阶段停留</span> :
{{item.remain_display !== '' ? item.remain_display + '天' : noneText}}
</el-col>
<el-col :span="6" :xs="24">
创建时间: {{item.created_at !== '' ? item.created_at : noneText}}
</el-col>
</el-row>
<el-row :gutter="10" v-if="item.project_status === 3">
<el-col :span="6">
未回款金额: <span :class="[{'text-danger': parseInt(item.collected) === 0}]">¥{{ parseInt(item.budget) - parseInt(item.collected) }}</span>
</el-col>
<el-col :span="6">
未开发票: <span :class="[{'text-danger': parseInt(item.issued_invoices === '' ? 0 : item.issued_invoices) === 0}]">¥{{ parseInt(item.budget) - parseInt(item.issued_invoices === '' ? 0 : item.issued_invoices) }}</span>
</el-col>
</el-row>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24" :xs="24"> <el-col :span="24" :xs="24">
<span class="border border-danger text-danger rounded px-1">商机内容</span>: <span class="border border-danger text-danger rounded px-1">商机内容</span>:
...@@ -104,6 +131,7 @@ ...@@ -104,6 +131,7 @@
}, },
toView (item) { toView (item) {
let obj = { let obj = {
app: 'project',
name: 'ofClient', name: 'ofClient',
params: { params: {
id: item.client_id id: item.client_id
...@@ -169,6 +197,27 @@ ...@@ -169,6 +197,27 @@
@include c('schedule-item') { @include c('schedule-item') {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 12px; font-size: 12px;
.border {
border: 1px solid #dee2e6;
}
.border-success {
border-color: #28a745 !important;
}
.border-danger {
border-color: #dc3545;
}
.text-success {
color: #28a745 !important;
}
.text-danger {
color: #E45744;
}
.rounded {
border-radius: .25rem !important;
}
.px-1 {
padding: 0 .25rem;
}
} }
@include c('schedule-item:first-child') { @include c('schedule-item:first-child') {
...@@ -198,7 +247,10 @@ ...@@ -198,7 +247,10 @@
} }
span { span {
display: inline-block; display: inline-block;
padding-left: 5px; padding-left: 3px;
}
span.np{
padding-left: 0;
} }
@include e('private') { @include e('private') {
display: inline-block; display: inline-block;
...@@ -213,27 +265,6 @@ ...@@ -213,27 +265,6 @@
@include c('schedule-right') { @include c('schedule-right') {
height: 100%; height: 100%;
padding: 10px 15px 6px; padding: 10px 15px 6px;
.border {
border: 1px solid #dee2e6;
}
.border-success {
border-color: #28a745 !important;
}
.border-danger {
border-color: #dc3545;
}
.text-success {
color: #28a745 !important;
}
.text-danger {
color: #E45744;
}
.rounded {
border-radius: .25rem !important;
}
.px-1 {
padding: 0 .25rem;
}
> .el-row { > .el-row {
> .el-col { > .el-col {
margin-bottom: 4px; margin-bottom: 4px;
......
<template>
<section class="single-calc-input">
<el-row :gutter="10">
<el-col :span="4" :class="['client-label', 'text-right', {'required': required}]">
<span>{{label}}</span>
{{item}}
</el-col>
<el-col :span="14">
<el-input :value="calcValue" placeholder="" :disabled="disabled" size="mini"></el-input>
</el-col>
<el-col :span="6">
<slot name="formError"></slot>
<span>{{errorText}}</span>
</el-col>
</el-row>
</section>
</template>
<script>
import itemMixin from '../../lib/singleItemMixin'
export default {
name: '',
mixins: [itemMixin],
data () {
return {
errorText: ''
}
},
computed: {
calcValue () {
let sum = 0
this.minuendItem.map(i => {
sum += parseInt(i.name === '' ? 0 : i.name)
})
let calc = parseInt(this.calcItem === '' ? 0 : this.calcItem) - sum
if (calc > 0) {
return calc
} else {
this.errorText = ''
return 0
}
}
},
methods: {},
created () {
}
}
</script>
<style scoped>
</style>
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<el-date-picker <el-date-picker
size="mini"
v-model="timeItem" v-model="timeItem"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
display: block; display: block;
line-height: 1.5; line-height: 1.5;
color: #6c757d; color: #6c757d;
font-size: 12px;
} }
</style> </style>
<style> <style>
......
...@@ -27,16 +27,27 @@ ...@@ -27,16 +27,27 @@
type="primary" type="primary"
size="mini" size="mini"
:disabled="!item.can_delete" :disabled="!item.can_delete"
@click="delLog(item.id)"> @click="delProject(item.id)">
<i class="fa fa-trash-o faa-shake"></i> 删除 <i class="fa fa-trash-o faa-shake"></i> 删除
</el-button> </el-button>
<el-button class="pull-right"
type="primary"
size="mini"
:disabled="!item.can_schedule">
<i class="fa fa-th-list"></i>新建待办事项
</el-button>
<el-button class="pull-right" <el-button class="pull-right"
type="primary" type="primary"
size="mini" size="mini"
:disabled="!item.can_update" :disabled="!item.can_update"
@click="editLog(item)"> @click="editProject(item)">
<i class="fa fa-edit"></i> 编辑 <i class="fa fa-edit"></i> 编辑
</el-button> </el-button>
<el-button class="pull-right"
type="primary"
size="mini"
:disabled="!item.can_update">
<i class="fa fa-tag"></i>批注</el-button>
<el-button class="pull-right" <el-button class="pull-right"
type="primary" type="primary"
size="mini" size="mini"
...@@ -105,9 +116,36 @@ ...@@ -105,9 +116,36 @@
} }
}, },
methods: { methods: {
delProject (id) {
this.$confirm('确认删除吗?', '提示').then(() => {
requestAPI(api.delProject, {
data: {
id
}
}).then(() => {
this.$message('删除成功!')
this.getList()
}, error => {
if (Array.isArray(error.msg)) {
error.msg.forEach(item => {
this.$notify.error({
title: '错误',
message: item.error
})
})
}
})
}).catch(_ => {
})
},
addNewProject () { addNewProject () {
this.$router.push({name: 'addProject'})
},
editProject (row) {
this.$router.push({name: 'editProject', params: {id: row.id}})
}, },
searchKeyword () { searchKeyword (search) {
this.updateForm(search)
}, },
updateForm (form) { updateForm (form) {
Object.assign(this.form, form) Object.assign(this.form, form)
......
<template>
<section>
<operation-project
ref="operationProject"
type="add"
:error-data="errorData">
<span slot="operationBtn">
<el-button type="primary" @click="saveProject" size="mini">保存</el-button>
<el-button @click="close" size="mini">关闭</el-button>
</span>
</operation-project>
</section>
</template>
<script>
import operationProject from './operationProject'
export default {
name: '',
components: {
operationProject
},
data () {
return {
errorData: {}
}
},
methods: {
saveProject () {},
close () {}
},
created () {
},
mounted () {
this.$refs.operationProject.initAdd()
}
}
</script>
<style scoped>
</style>
<template>
<section>
<operation-project
ref="operationProject"
type="edit"
:error-data="errorData">
<span slot="operationBtn">
<el-button type="primary" @click="saveProject" size="mini">保存</el-button>
<el-button @click="close" size="mini">关闭</el-button>
</span>
</operation-project>
</section>
</template>
<script>
import operationProject from './operationProject'
export default {
name: '',
components: {
operationProject
},
data () {
return {
errorData: {}
}
},
methods: {
saveProject () {},
close () {}
},
created () {
},
mounted () {
this.$refs.operationProject.initEdit()
}
}
</script>
<style scoped>
</style>
This diff is collapsed.
...@@ -213,7 +213,6 @@ ...@@ -213,7 +213,6 @@
this.$set(this.clientTimeForm, val + '[' + item + ']', '') this.$set(this.clientTimeForm, val + '[' + item + ']', '')
}) })
} }
console.log(val)
}, },
immediate: true immediate: true
} }
......
<template>
<section>
<div class="content">
<client-header ref="clientHeader"
:title="'客户名称:' + model.name"
:title-span="12"
type=""></client-header>
<div class="page-body-content">
<client-nav :trigger="addProject" trigger-text="新建商机"></client-nav>
<div v-loading="loading">
<ScheduleItem
v-for="(item, key) in result.list"
:item="item"
:key="key"
@update:image="imgs => {setImage(imgs)}">
<span slot="opearate">
<el-button class="pull-right"
type="primary"
size="mini"
:disabled="!item.can_delete"
@click="delProject(item.id)">
<i class="fa fa-trash-o faa-shake"></i> 删除
</el-button>
<el-button class="pull-right"
type="primary"
size="mini"
:disabled="!item.can_schedule">
<i class="fa fa-th-list"></i>新建待办事项
</el-button>
<el-button class="pull-right"
type="primary"
size="mini"
:disabled="!item.can_update"
@click="editProject(item)">
<i class="fa fa-edit"></i> 编辑
</el-button>
<el-button class="pull-right"
type="primary"
size="mini"
:disabled="!item.can_update">
<i class="fa fa-tag"></i>批注</el-button>
<el-button class="pull-right"
type="primary"
size="mini"
@click.prevent.stop="leaveMessageSch(item)">
<span :class="['badge', {'badge-unread': item.unread > 0}]"
v-if="item.commentCount">{{item.commentCount.comment}}</span>
<i class="fa fa-commenting"></i> 留言
</el-button>
</span>
</ScheduleItem>
<div v-if="result.list.length === 0">
<el-card class="box-card">
未查询到数据!
</el-card>
</div>
</div>
<Pagenation
@update:pager="pager => {updatePage(pager)}"
:pager.sync="pagenation"
:total="totalcount">
</Pagenation>
</div>
</div>
</section>
</template>
<script>
import {
requestAPI,
api
} from '@/lib/commonMixin'
import ScheduleItem from '../../common/scheduleItem'
import clientHeader from '../../common/clientHeader'
import Pagenation from '../schedulePagenation'
export default {
name: '',
data () {
return {
client_id: '',
loading: false,
clientName: '',
model: {
name: ''
},
result: {
list: []
},
detailModel: [],
pagenation: {
page: 1
},
totalcount: 0,
tableList: []
}
},
components: {
ScheduleItem,
clientHeader,
Pagenation
},
methods: {
delProject (id) {
this.$confirm('确认删除吗?', '提示').then(() => {
requestAPI(api.delProject, {
data: {
id
}
}).then(() => {
this.$message('删除成功!')
this.getList()
}, error => {
if (Array.isArray(error.msg)) {
error.msg.forEach(item => {
this.$notify.error({
title: '错误',
message: item.error
})
})
}
})
}).catch(_ => {
})
},
addProject () {
this.$router.push({name: 'addProjectClient', params: {clientId: this.$route.params.id}})
},
editProject (row) {
this.$router.push({name: 'editProjectClient', params: {id: row.id, clientId: row.client_id}})
},
getList () {
if (this.loading) {
return
}
this.loading = true
requestAPI(api.getProjectClient, {
data: {
id: this.$route.params.id
}
}).then(res => {
this.result.list = res.list
// this.pagenation.page = res.pagenation.thispage
this.totalcount = res.pagenation.totalcount
}).finally(_ => {
this.loading = false
})
}
},
created () {
requestAPI(api.getClient, {
data: {
id: this.$route.params.id
}
}).then(res => {
Object.keys(res.model).forEach(item => {
this.$set(this.model, item, res.model[item])
})
this.getList()
}, error => {
if (Array.isArray(error.msg)) {
error.msg.forEach(item => {
this.$notify.error({
title: '错误',
message: item.error
})
})
}
})
}
}
</script>
<style scoped>
.badge {
border-radius: 2px;
color: #333744;
background: #ffffff;
vertical-align: baseline;
display: inline;
padding: 2px 6px;
text-align: center;
}
</style>
<template> <template>
<section class="pull-right"> <section class="pull-right page-footer">
<el-pagination v-if="total > 0" class="" <el-pagination v-if="total > pager.pagesize" class=""
background background
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
...@@ -10,10 +10,13 @@ ...@@ -10,10 +10,13 @@
layout="total, prev, pager, next, jumper" layout="total, prev, pager, next, jumper"
:total="total"> :total="total">
</el-pagination> </el-pagination>
<span v-else>
总计{{total}}条 当前显示第1至第{{total}}
</span>
</section> </section>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
total: { total: {
type: Number, type: Number,
...@@ -47,8 +50,10 @@ export default { ...@@ -47,8 +50,10 @@ export default {
// this.$parent.loadList() // this.$parent.loadList()
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.page-footer{
padding: 0 30px;
}
</style> </style>
...@@ -14,7 +14,8 @@ export default { ...@@ -14,7 +14,8 @@ export default {
endDateTime: { endDateTime: {
date: '', date: '',
time: '' time: ''
} },
engineer: []
} }
}, },
props: { props: {
...@@ -28,6 +29,9 @@ export default { ...@@ -28,6 +29,9 @@ export default {
formTimeItem: { formTimeItem: {
type: String type: String
}, },
calcItem: '',
minuendItem: Array,
disabled: false,
startDateTimeItem: { startDateTimeItem: {
type: String type: String
}, },
...@@ -79,7 +83,10 @@ export default { ...@@ -79,7 +83,10 @@ export default {
multipleKey: { multipleKey: {
type: String, type: String,
default: 'name' default: 'name'
} },
setPrepend: Function,
setPrependText: '',
engineerKey: ''
}, },
methods: { methods: {
addItem (items) { addItem (items) {
...@@ -90,13 +97,17 @@ export default { ...@@ -90,13 +97,17 @@ export default {
}, },
delItem (items, key) { delItem (items, key) {
items.splice(key, 1) items.splice(key, 1)
},
setPerText (index) {
if (this.setPrepend) {
return this.setPrepend(index, this.setPrependText)
}
} }
}, },
watch: { watch: {
'formItem': { 'formItem': {
handler (val) { handler (val) {
if (Array.isArray(val)) { if (Array.isArray(val)) {
console.log(val)
this.items = val this.items = val
} else { } else {
this.item = val this.item = val
...@@ -114,6 +125,21 @@ export default { ...@@ -114,6 +125,21 @@ export default {
'item' (val) { 'item' (val) {
this.$emit('update:item', val) this.$emit('update:item', val)
}, },
'optionsList': {
handler (val) {
if (this.engineerKey) {
val.forEach(item => {
this.engineer.push({
name: item.name,
disabled: false,
[item.key]: '',
key: item.key
})
})
}
},
immediate: true
},
'items': { 'items': {
handler (val) { handler (val) {
this.$emit('update:item', val) this.$emit('update:item', val)
...@@ -125,6 +151,21 @@ export default { ...@@ -125,6 +151,21 @@ export default {
}, },
'inputSelectItem' (val) { 'inputSelectItem' (val) {
this.$emit('update:inputSelect', val) this.$emit('update:inputSelect', val)
},
'engineer': {
handler (val) {
let engine = val.filter(i => {
if (i[i.key] !== '') {
return typeof i[i.key] !== 'undefined'
}
}).map(i => {
return {
[i.key]: i[i.key]
}
})
this.$emit('update:item', engine)
},
deep: true
} }
} }
} }
import projectList from '../components/project/list' import projectList from '../components/project/list'
import projectOfClient from '../components/project/projectOfClient/projectOfClient'
import addProject from '../components/project/operation/addProject'
import editProject from '../components/project/operation/editProject'
const projectTitle = '金畅逍BMS - ' const projectTitle = '金畅逍BMS - '
const routes = [ const routes = [
{ {
...@@ -8,6 +11,34 @@ const routes = [ ...@@ -8,6 +11,34 @@ const routes = [
meta: { meta: {
title: projectTitle + '商机列表' title: projectTitle + '商机列表'
} }
},
{
path: '/ofClient/:id',
name: 'ofClient',
component: projectOfClient,
meta: {
title: projectTitle + '客户信息'
}
},
{
path: '/addProject',
name: 'addProject',
component: addProject
},
{
path: '/editProject/:id',
name: 'editProject',
component: editProject
},
{
path: '/addProjectClient/:clientId',
name: 'addProjectClient',
component: addProject
},
{
path: '/editProjectClient/:id/:clientId',
name: 'editProjectClient',
component: editProject
} }
] ]
export default routes export default routes
This diff is collapsed.
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