Commit e04d1ca5 authored by 高宇's avatar 高宇

完成商机信息;

parent 3e3b0988
......@@ -37,7 +37,7 @@
],
homePage: {
appName: portalName,
url: '/list'
url: '/project'
}
}
......
......@@ -8,25 +8,16 @@ export default {
getProjectList: {
url: '/vue/project/list'
},
// 删除日志
delWorkLog: {
url: '/vue/work-log/delete'
// 删除商机
delProject: {
url: '/vue/project/delete'
},
// 获取工作日志新建 option
getWorkLogNewOptions: {
url: '/vue/work-log/get-new'
getProjectNewOptions: {
url: '/vue/project/get-new'
},
// 获取工作日志编辑
getWorkLogEdit: {
url: '/vue/work-log/get-edit'
},
// 工作日志编辑
saveWorkLogEdit: {
url: '/vue/work-log/save-edit'
},
// 工作日志新建
saveWorkLogAdd: {
url: '/vue/work-log/save-new'
getProjectEdit: {
url: '/vue/project/get-edit'
},
// 留言
......@@ -48,9 +39,9 @@ export default {
getClient: {
url: '/vue/client/get-edit'
},
// 获取客户工作日志列表
getWorkLogClient: {
url: '/vue/work-log/of-client'
// 获取客户商机列表
getProjectClient: {
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 @@
<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">
<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-button slot="append" v-if="key === 0" icon="el-icon-plus" @click="addItem(item)"></el-button>
<el-button slot="append" v-else icon="el-icon-minus" @click="delItem(item, key)"></el-button>
<template slot="prepend">{{setPerText(key)}}</template>
<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>
</span>
</el-col>
......
......@@ -5,19 +5,19 @@
<el-row :gutter="10">
<el-col :span="24" class="entity-name">
<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>
<span v-else>客户名称{{noneText}}</span>
</el-col>
<el-col :span="24" class="entity-name">
<i class="fa fa-th-list" aria-hidden="true"></i>
<span>{{ item.project_title }}</span>
<span> {{ item.project_title }}</span>
</el-col>
<el-col :span="12">
<el-col :span="12" class="entity-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 :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>
</el-col>
</el-row>
......@@ -55,12 +55,39 @@
</span>
</el-col>
<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 :span="6" :xs="24" class="show-picture">
成交日期: <span class="date-time">{{item.bargain_date !== '' ? item.bargain_date : noneText}}</span>
</el-col>
</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-col :span="24" :xs="24">
<span class="border border-danger text-danger rounded px-1">商机内容</span>:
......@@ -104,6 +131,7 @@
},
toView (item) {
let obj = {
app: 'project',
name: 'ofClient',
params: {
id: item.client_id
......@@ -169,6 +197,27 @@
@include c('schedule-item') {
margin-bottom: 10px;
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') {
......@@ -198,7 +247,10 @@
}
span {
display: inline-block;
padding-left: 5px;
padding-left: 3px;
}
span.np{
padding-left: 0;
}
@include e('private') {
display: inline-block;
......@@ -213,27 +265,6 @@
@include c('schedule-right') {
height: 100%;
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-col {
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 @@
</el-col>
<el-col :span="14">
<el-date-picker
size="mini"
v-model="timeItem"
type="date"
placeholder="选择日期"
......
......@@ -41,6 +41,7 @@
display: block;
line-height: 1.5;
color: #6c757d;
font-size: 12px;
}
</style>
<style>
......
......@@ -27,16 +27,27 @@
type="primary"
size="mini"
:disabled="!item.can_delete"
@click="delLog(item.id)">
@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="editLog(item)">
@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"
......@@ -105,9 +116,36 @@
}
},
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 () {
this.$router.push({name: 'addProject'})
},
editProject (row) {
this.$router.push({name: 'editProject', params: {id: row.id}})
},
searchKeyword () {
searchKeyword (search) {
this.updateForm(search)
},
updateForm (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 @@
this.$set(this.clientTimeForm, val + '[' + item + ']', '')
})
}
console.log(val)
},
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>
<section class="pull-right">
<el-pagination v-if="total > 0" class=""
<section class="pull-right page-footer">
<el-pagination v-if="total > pager.pagesize" class=""
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
......@@ -10,10 +10,13 @@
layout="total, prev, pager, next, jumper"
:total="total">
</el-pagination>
<span v-else>
总计{{total}}条 当前显示第1至第{{total}}
</span>
</section>
</template>
<script>
export default {
export default {
props: {
total: {
type: Number,
......@@ -47,8 +50,10 @@ export default {
// this.$parent.loadList()
}
}
}
}
</script>
<style scoped>
.page-footer{
padding: 0 30px;
}
</style>
......@@ -14,7 +14,8 @@ export default {
endDateTime: {
date: '',
time: ''
}
},
engineer: []
}
},
props: {
......@@ -28,6 +29,9 @@ export default {
formTimeItem: {
type: String
},
calcItem: '',
minuendItem: Array,
disabled: false,
startDateTimeItem: {
type: String
},
......@@ -79,7 +83,10 @@ export default {
multipleKey: {
type: String,
default: 'name'
}
},
setPrepend: Function,
setPrependText: '',
engineerKey: ''
},
methods: {
addItem (items) {
......@@ -90,13 +97,17 @@ export default {
},
delItem (items, key) {
items.splice(key, 1)
},
setPerText (index) {
if (this.setPrepend) {
return this.setPrepend(index, this.setPrependText)
}
}
},
watch: {
'formItem': {
handler (val) {
if (Array.isArray(val)) {
console.log(val)
this.items = val
} else {
this.item = val
......@@ -114,6 +125,21 @@ export default {
'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': {
handler (val) {
this.$emit('update:item', val)
......@@ -125,6 +151,21 @@ export default {
},
'inputSelectItem' (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 projectOfClient from '../components/project/projectOfClient/projectOfClient'
import addProject from '../components/project/operation/addProject'
import editProject from '../components/project/operation/editProject'
const projectTitle = '金畅逍BMS - '
const routes = [
{
......@@ -8,6 +11,34 @@ const routes = [
meta: {
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
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