Commit ba6c9af1 authored by 高宇's avatar 高宇

完成商机信息;

parent 2a5b34f8
......@@ -8,6 +8,14 @@ export default {
getProjectList: {
url: '/vue/project/list'
},
// 保存新建商机
saveProjectNew: {
url: '/vue/project/save-new'
},
// 保存编辑商机
saveProjectEdit: {
url: '/vue/project/save-edit'
},
// 删除商机
delProject: {
url: '/vue/project/delete'
......
.element-app {
.project-app {
.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>
<section>
<section class="single-radio">
<el-row :gutter="10">
<el-col :span="4" :class="['client-label', 'text-right', {'required': required}]">
<span>{{label}}</span>
......@@ -36,23 +36,23 @@
</script>
<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;
margin: 0 10px 5px 0;
border-radius: 6px!important;
}
.el-radio-button__inner:hover{
.single-radio .el-radio-button__inner:hover{
color: #333;
background-color: #e6e6e6;
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;
background-color: #3c3c3c;
border-color: #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;
background-color: #d4d4d4;
border-color: #8c8c8c;
......
......@@ -2,7 +2,7 @@
<section>
<div class="content">
<client-header ref="clientHeader"
title="工作日志"
title="商机信息"
:title-span="6"
:model="form"
search-key="ProjectSearch"
......@@ -34,7 +34,7 @@
type="primary"
size="mini"
:disabled="!item.can_schedule">
<i class="fa fa-th-list"></i>新建待办事项
<i class="fa fa-th-list"></i> 新建待办事项
</el-button>
<el-button class="pull-right"
type="primary"
......@@ -46,8 +46,9 @@
<el-button class="pull-right"
type="primary"
size="mini"
@click="editAnnotation(item)"
: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"
type="primary"
size="mini"
......@@ -80,9 +81,10 @@
<side-popup ref="sidePopup" :title="operationTitle">
<component :is="operationPage" :ref="operationPage" @close="close"></component>
</side-popup>
<operation-annotation ref="operationAnnotation" @update:list="getList()"></operation-annotation>
</section>
</template>
`
<script>
import ScheduleItem from '../common/scheduleItem'
import Pagenation from './schedulePagenation'
......@@ -95,7 +97,7 @@
requestAPI,
api
} from '@/lib/commonMixin'
import operationAnnotation from './operation/operationAnnotation'
export default {
name: '',
components: {
......@@ -104,7 +106,8 @@
ScheduleItem,
Pagenation,
addProject,
editProject
editProject,
operationAnnotation
},
directives: {
clickOutside
......@@ -186,6 +189,9 @@
}
},
methods: {
editAnnotation (item) {
this.$refs.operationAnnotation.show(item)
},
leaveMessageSch (item) {
this.$refs.leaveMessage.btnShow(item)
},
......
......@@ -13,7 +13,12 @@
</template>
<script>
import {
requestAPI,
api
} from '@/lib/commonMixin'
import operationProject from './operationProject'
import {setModule} from '../../../lib/viewHelper'
export default {
name: '',
components: {
......@@ -25,7 +30,23 @@
}
},
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 () {
this.$emit('close')
},
......
......@@ -13,7 +13,12 @@
</template>
<script>
import {
requestAPI,
api
} from '@/lib/commonMixin'
import operationProject from './operationProject'
import {setModule} from '../../../lib/viewHelper'
export default {
name: '',
components: {
......@@ -25,7 +30,23 @@
}
},
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 () {
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 @@
description: '',
project_title: '',
collected: '',
uncollected: '',
projectTags: '',
salesForecast: 0,
purchaseType: '',
......@@ -368,11 +367,11 @@
})
}
if (!this.options[item]) {
if (item === 'Projects[project_tags]') {
this.$set(this.options, 'Projects[projectTags]', res.options[item])
} else {
this.$set(this.options, item, res.options[item])
}
// if (item === 'Projects[project_tags]') {
// this.$set(this.options, 'Projects[projectTags]', res.options[item])
// } else {
this.$set(this.options, item, res.options[item])
// }
} else {
Object.assign(this.options[item], res.options[item])
}
......@@ -404,6 +403,9 @@
this.Projects.client_id = res.model.client.key
}
})
},
getFormData () {
return {Projects: this.Projects, ProjectArchitects: this.ProjectArchitects}
}
},
created () {
......
......@@ -37,11 +37,13 @@
<el-button class="pull-right"
type="primary"
size="mini"
@click="editAnnotation(item)"
:disabled="!item.can_update">
<i class="fa fa-tag"></i>批注</el-button>
<el-button class="pull-right"
type="primary"
size="mini"
@click="editAnnotation(item)"
@click.prevent.stop="leaveMessageSch(item)">
<span :class="['badge', {'badge-unread': item.unread > 0}]"
v-if="item.commentCount">{{item.commentCount.comment}}</span>
......@@ -71,6 +73,7 @@
<side-popup ref="sidePopup" :title="operationTitle">
<component :is="operationPage" :ref="operationPage" @close="close"></component>
</side-popup>
<operation-annotation ref="operationAnnotation" @update:list="getList()"></operation-annotation>
</section>
</template>
......@@ -85,6 +88,7 @@
import clickOutside from '@/lib/bind'
import addProject from '../operation/addProject'
import editProject from '../operation/editProject'
import operationAnnotation from '../operation/operationAnnotation'
export default {
name: '',
directives: {
......@@ -173,9 +177,13 @@
clientHeader,
Pagenation,
addProject,
editProject
editProject,
operationAnnotation
},
methods: {
editAnnotation (item) {
this.$refs.operationAnnotation.show(item)
},
leaveMessageSch (item) {
this.$refs.leaveMessage.btnShow(item)
},
......
......@@ -128,6 +128,7 @@ export default {
'optionsList': {
handler (val) {
if (this.engineerKey) {
this.engineer = []
val.forEach(item => {
this.engineer.push({
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