Commit ba6c9af1 authored by 高宇's avatar 高宇

完成商机信息;

parent 2a5b34f8
...@@ -8,6 +8,14 @@ export default { ...@@ -8,6 +8,14 @@ export default {
getProjectList: { getProjectList: {
url: '/vue/project/list' url: '/vue/project/list'
}, },
// 保存新建商机
saveProjectNew: {
url: '/vue/project/save-new'
},
// 保存编辑商机
saveProjectEdit: {
url: '/vue/project/save-edit'
},
// 删除商机 // 删除商机
delProject: { delProject: {
url: '/vue/project/delete' url: '/vue/project/delete'
......
.element-app { .project-app {
.mb20 { .mb20 {
margin-bottom:20px; margin-bottom:20px;
} }
.el-button--cancel {
color:white;
background-color: #EB7567;
border-color: #e86150;
}
.el-button--confirm {
color:white;
background-color:#649FD7;
border-color:#5092d2;
}
.el-dialog__header {
background-color: #333744;
}
.el-dialog__title {
color:white;
}
.is-disabled {
color: #fff!important;
background-color: #999!important;
border-color: #888!important;
}
} }
<template> <template>
<section> <section class="single-radio">
<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>
...@@ -36,23 +36,23 @@ ...@@ -36,23 +36,23 @@
</script> </script>
<style> <style>
.el-radio-button__inner, .el-radio-button:last-child .el-radio-button__inner, .el-radio-button:first-child .el-radio-button__inner{ .single-radio .el-radio-button__inner, .single-radio .el-radio-button:last-child .el-radio-button__inner, .single-radio .el-radio-button:first-child .el-radio-button__inner{
border-left: 1px solid #DCDFE6; border-left: 1px solid #DCDFE6;
margin: 0 10px 5px 0; margin: 0 10px 5px 0;
border-radius: 6px!important; border-radius: 6px!important;
} }
.el-radio-button__inner:hover{ .single-radio .el-radio-button__inner:hover{
color: #333; color: #333;
background-color: #e6e6e6; background-color: #e6e6e6;
border-color: #adadad; border-color: #adadad;
} }
.el-radio-button__orig-radio:checked+.el-radio-button__inner{ .single-radio .el-radio-button__orig-radio:checked+.el-radio-button__inner{
color: #fff; color: #fff;
background-color: #3c3c3c; background-color: #3c3c3c;
border-color: #373737; border-color: #373737;
box-shadow: 0 0 0 0 #373737; box-shadow: 0 0 0 0 #373737;
} }
.el-radio-button__orig-radio:checked+.el-radio-button__inner:hover{ .single-radio .el-radio-button__orig-radio:checked+.el-radio-button__inner:hover{
color: #333; color: #333;
background-color: #d4d4d4; background-color: #d4d4d4;
border-color: #8c8c8c; border-color: #8c8c8c;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<section> <section>
<div class="content"> <div class="content">
<client-header ref="clientHeader" <client-header ref="clientHeader"
title="工作日志" title="商机信息"
:title-span="6" :title-span="6"
:model="form" :model="form"
search-key="ProjectSearch" search-key="ProjectSearch"
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
type="primary" type="primary"
size="mini" size="mini"
:disabled="!item.can_schedule"> :disabled="!item.can_schedule">
<i class="fa fa-th-list"></i>新建待办事项 <i class="fa fa-th-list"></i> 新建待办事项
</el-button> </el-button>
<el-button class="pull-right" <el-button class="pull-right"
type="primary" type="primary"
...@@ -46,8 +46,9 @@ ...@@ -46,8 +46,9 @@
<el-button class="pull-right" <el-button class="pull-right"
type="primary" type="primary"
size="mini" size="mini"
@click="editAnnotation(item)"
:disabled="!item.can_update"> :disabled="!item.can_update">
<i class="fa fa-tag"></i>批注</el-button> <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"
...@@ -80,9 +81,10 @@ ...@@ -80,9 +81,10 @@
<side-popup ref="sidePopup" :title="operationTitle"> <side-popup ref="sidePopup" :title="operationTitle">
<component :is="operationPage" :ref="operationPage" @close="close"></component> <component :is="operationPage" :ref="operationPage" @close="close"></component>
</side-popup> </side-popup>
<operation-annotation ref="operationAnnotation" @update:list="getList()"></operation-annotation>
</section> </section>
</template> </template>
`
<script> <script>
import ScheduleItem from '../common/scheduleItem' import ScheduleItem from '../common/scheduleItem'
import Pagenation from './schedulePagenation' import Pagenation from './schedulePagenation'
...@@ -95,7 +97,7 @@ ...@@ -95,7 +97,7 @@
requestAPI, requestAPI,
api api
} from '@/lib/commonMixin' } from '@/lib/commonMixin'
import operationAnnotation from './operation/operationAnnotation'
export default { export default {
name: '', name: '',
components: { components: {
...@@ -104,7 +106,8 @@ ...@@ -104,7 +106,8 @@
ScheduleItem, ScheduleItem,
Pagenation, Pagenation,
addProject, addProject,
editProject editProject,
operationAnnotation
}, },
directives: { directives: {
clickOutside clickOutside
...@@ -186,6 +189,9 @@ ...@@ -186,6 +189,9 @@
} }
}, },
methods: { methods: {
editAnnotation (item) {
this.$refs.operationAnnotation.show(item)
},
leaveMessageSch (item) { leaveMessageSch (item) {
this.$refs.leaveMessage.btnShow(item) this.$refs.leaveMessage.btnShow(item)
}, },
......
...@@ -13,7 +13,12 @@ ...@@ -13,7 +13,12 @@
</template> </template>
<script> <script>
import {
requestAPI,
api
} from '@/lib/commonMixin'
import operationProject from './operationProject' import operationProject from './operationProject'
import {setModule} from '../../../lib/viewHelper'
export default { export default {
name: '', name: '',
components: { components: {
...@@ -25,7 +30,23 @@ ...@@ -25,7 +30,23 @@
} }
}, },
methods: { methods: {
saveProject () {}, saveProject () {
let form = this.$refs.operationProject.getFormData()
let subData = Object.assign({}, setModule(form.Projects, 'Projects', this.options), setModule(form.ProjectArchitects, 'ProjectArchitects', this.options))
requestAPI(api.saveProjectNew, {
data: {...subData}
}).then(res => {
this.$message({
message: '保存成功!',
type: 'success'
})
this.close()
}, error => {
error.msg.forEach(item => {
this.$set(this.errorData, item.name, item.error)
})
})
},
close () { close () {
this.$emit('close') this.$emit('close')
}, },
......
...@@ -13,7 +13,12 @@ ...@@ -13,7 +13,12 @@
</template> </template>
<script> <script>
import {
requestAPI,
api
} from '@/lib/commonMixin'
import operationProject from './operationProject' import operationProject from './operationProject'
import {setModule} from '../../../lib/viewHelper'
export default { export default {
name: '', name: '',
components: { components: {
...@@ -25,7 +30,23 @@ ...@@ -25,7 +30,23 @@
} }
}, },
methods: { methods: {
saveProject () {}, saveProject () {
let form = this.$refs.operationProject.getFormData()
let subData = Object.assign({}, setModule(form.Projects, 'Projects', this.options), setModule(form.ProjectArchitects, 'ProjectArchitects', this.options))
requestAPI(api.saveProjectEdit, {
data: {...subData}
}).then(res => {
this.$message({
message: '保存成功!',
type: 'success'
})
this.close()
}, error => {
error.msg.forEach(item => {
this.$set(this.errorData, item.name, item.error)
})
})
},
close () { close () {
this.$emit('close') this.$emit('close')
}, },
......
<template>
<section>
<el-dialog
title="编辑商机批注"
:visible.sync="formVisible"
:modal-append-to-body="false"
:close="cancel">
<el-form ref="form" :model="model" label-width="0">
<el-input v-model="model.comment" type="textarea" :rows="15" placeholder="请输入商机批注"></el-input>
</el-form>
<div slot="footer" class="text-center">
<el-button size="small" @click="formVisible = false">取消</el-button><!--确定-->
<el-button size="small" type="primary" @click="submit">保存</el-button><!--取 消-->
</div>
</el-dialog>
</section>
</template>
<script>
import {
requestAPI,
api
} from '@/lib/commonMixin'
import {setModule} from '../../../lib/viewHelper'
export default {
name: '',
data () {
return {
formVisible: false,
model: {
id: 0,
comment: ''
}
}
},
methods: {
cancel () {
Object.keys(this.model).forEach(item => {
this.model[item] = ''
})
},
submit () {
// console.log(this.model.comment.replace(/\n/g, '\r\n'))
requestAPI(api.saveProjectEdit, {
data: {
...setModule({
id: this.model.id,
comment: this.model.comment.replace(/\n/g, '\r\n')
}, 'Projects')
}
}).then(res => {
this.$message({
message: '保存成功!',
type: 'success'
})
this.formVisible = false
this.$emit('update:list')
}, () => {
this.$message.error('保存失败!')
})
},
show (model) {
console.log(model)
Object.keys(this.model).forEach(item => {
console.log(this.model[item])
this.model[item] = model[item]
})
this.formVisible = true
}
},
created () {
}
}
</script>
<style scoped>
</style>
...@@ -273,7 +273,6 @@ ...@@ -273,7 +273,6 @@
description: '', description: '',
project_title: '', project_title: '',
collected: '', collected: '',
uncollected: '',
projectTags: '', projectTags: '',
salesForecast: 0, salesForecast: 0,
purchaseType: '', purchaseType: '',
...@@ -368,11 +367,11 @@ ...@@ -368,11 +367,11 @@
}) })
} }
if (!this.options[item]) { if (!this.options[item]) {
if (item === 'Projects[project_tags]') { // if (item === 'Projects[project_tags]') {
this.$set(this.options, 'Projects[projectTags]', res.options[item]) // this.$set(this.options, 'Projects[projectTags]', res.options[item])
} else { // } else {
this.$set(this.options, item, res.options[item]) this.$set(this.options, item, res.options[item])
} // }
} else { } else {
Object.assign(this.options[item], res.options[item]) Object.assign(this.options[item], res.options[item])
} }
...@@ -404,6 +403,9 @@ ...@@ -404,6 +403,9 @@
this.Projects.client_id = res.model.client.key this.Projects.client_id = res.model.client.key
} }
}) })
},
getFormData () {
return {Projects: this.Projects, ProjectArchitects: this.ProjectArchitects}
} }
}, },
created () { created () {
......
...@@ -37,11 +37,13 @@ ...@@ -37,11 +37,13 @@
<el-button class="pull-right" <el-button class="pull-right"
type="primary" type="primary"
size="mini" size="mini"
@click="editAnnotation(item)"
:disabled="!item.can_update"> :disabled="!item.can_update">
<i class="fa fa-tag"></i>批注</el-button> <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"
@click="editAnnotation(item)"
@click.prevent.stop="leaveMessageSch(item)"> @click.prevent.stop="leaveMessageSch(item)">
<span :class="['badge', {'badge-unread': item.unread > 0}]" <span :class="['badge', {'badge-unread': item.unread > 0}]"
v-if="item.commentCount">{{item.commentCount.comment}}</span> v-if="item.commentCount">{{item.commentCount.comment}}</span>
...@@ -71,6 +73,7 @@ ...@@ -71,6 +73,7 @@
<side-popup ref="sidePopup" :title="operationTitle"> <side-popup ref="sidePopup" :title="operationTitle">
<component :is="operationPage" :ref="operationPage" @close="close"></component> <component :is="operationPage" :ref="operationPage" @close="close"></component>
</side-popup> </side-popup>
<operation-annotation ref="operationAnnotation" @update:list="getList()"></operation-annotation>
</section> </section>
</template> </template>
...@@ -85,6 +88,7 @@ ...@@ -85,6 +88,7 @@
import clickOutside from '@/lib/bind' import clickOutside from '@/lib/bind'
import addProject from '../operation/addProject' import addProject from '../operation/addProject'
import editProject from '../operation/editProject' import editProject from '../operation/editProject'
import operationAnnotation from '../operation/operationAnnotation'
export default { export default {
name: '', name: '',
directives: { directives: {
...@@ -173,9 +177,13 @@ ...@@ -173,9 +177,13 @@
clientHeader, clientHeader,
Pagenation, Pagenation,
addProject, addProject,
editProject editProject,
operationAnnotation
}, },
methods: { methods: {
editAnnotation (item) {
this.$refs.operationAnnotation.show(item)
},
leaveMessageSch (item) { leaveMessageSch (item) {
this.$refs.leaveMessage.btnShow(item) this.$refs.leaveMessage.btnShow(item)
}, },
......
...@@ -128,6 +128,7 @@ export default { ...@@ -128,6 +128,7 @@ export default {
'optionsList': { 'optionsList': {
handler (val) { handler (val) {
if (this.engineerKey) { if (this.engineerKey) {
this.engineer = []
val.forEach(item => { val.forEach(item => {
this.engineer.push({ this.engineer.push({
name: item.name, name: item.name,
......
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