Commit 7984f4f9 authored by huai.li's avatar huai.li

添加编辑功能

parent a4c401cb
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
.mb20 { .mb20 {
margin-bottom:20px; margin-bottom:20px;
} }
.el-button--cancel { .el-button--cancel {
color:white; color:white;
background-color: #EB7567; background-color: #EB7567;
......
...@@ -4,15 +4,13 @@ ...@@ -4,15 +4,13 @@
<el-col :span="4" :xs="24" class="obear-schedule-left"> <el-col :span="4" :xs="24" class="obear-schedule-left">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24"> <el-col :span="24">
<i class="fa fa-star" aria-hidden="true"></i><span>客户名称({{ isNullClient ? '未设置' : item.client.name }}</span> <span><i class="fa fa-star" aria-hidden="true"></i>客户名称({{ isNullClient ? '未设置' : item.client.name }}</span>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<img class="user-avatar rounded-circle" :src="item.createdBy.avatar.name"> <span><img class="user-avatar rounded-circle" :src="item.createdBy.avatar.name">{{ item.createdBy.name }}</span>
<span>{{ item.createdBy.name }}</span>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<i class="fa fa-connectdevelop" aria-hidden="true"></i> <span><i class="fa fa-connectdevelop" aria-hidden="true"></i>{{ item.department.name }}</span>
<span>{{ item.department.name }}</span>
<span class="obear-schedule-left__private" :class="[isPublic ? 'colRed' : 'colGreen']">{{ isPublic ? '私人' : '共享' }}</span> <span class="obear-schedule-left__private" :class="[isPublic ? 'colRed' : 'colGreen']">{{ isPublic ? '私人' : '共享' }}</span>
</el-col> </el-col>
</el-row> </el-row>
...@@ -56,10 +54,8 @@ ...@@ -56,10 +54,8 @@
<el-col :span="6" :xs="24"> <el-col :span="6" :xs="24">
</el-col> </el-col>
<el-col :span="6" :xs="24"> <el-col :span="6" :xs="24">
<el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>留言</el-button> <slot name="opearate">
<el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>汇报</el-button> </slot>
<el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>编辑</el-button>
<el-button type="primary" size="mini" @click="deleteSch(item.id)"><i class="el-icon-share el-icon--left"></i>删除</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-col> </el-col>
...@@ -68,10 +64,6 @@ ...@@ -68,10 +64,6 @@
</template> </template>
<script> <script>
import {
requestWithJsonAPI,
api
} from '@/lib/commonMixin'
export default { export default {
name: 'scheduleItem', name: 'scheduleItem',
...@@ -98,20 +90,6 @@ export default { ...@@ -98,20 +90,6 @@ export default {
}, },
methods: { methods: {
deleteSch (id) {
this.$confirm('删除该待办事项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestWithJsonAPI(api.deleteSchedule)
.then((res) => {
console.log(res)
})
}).catch(() => {
this.$message.info('取消删除')
})
}
} }
} }
</script> </script>
...@@ -166,6 +144,10 @@ export default { ...@@ -166,6 +144,10 @@ export default {
display: inline-block; display: inline-block;
padding-left: 5px; padding-left: 5px;
} }
i {
display:inline-block;
padding-right:5px;
}
@include e('private') { @include e('private') {
display: inline-block; display: inline-block;
padding-right: 5px; padding-right: 5px;
......
<template> <template>
<section class="ec-page-wrapper" style="overflow: hidden; padding-bottom: 0px;"> <section class="ec-page-wrapper" style="overflow: hidden; padding-bottom: 0px;">
<el-form label-width="120px" ref="form" :rules="rules" :model="model" class="ec-create-form"> <el-form label-width="120px" ref="form" :rules="rules" :model="model" class="ec-create-form">
<el-form-item label="客户名称" prop="actName" class="ec-clear-left"> <el-form-item label="客户名称" prop="actName" class="ec-clear-left" v-if="isCreate">
<dep-select <dep-select
:query="query" :query="query"
:inputWidth="340" :inputWidth="340"
...@@ -138,20 +138,12 @@ export default { ...@@ -138,20 +138,12 @@ export default {
mounted () { mounted () {
this.initSetting(['getNewArray']) this.initSetting(['getNewArray'])
// if (this.isEdit) {
// let id = this.$route.params.id
// this.getActById(id)
// }
}, },
computed: { computed: {
// isCreate () { isCreate () {
// return this.pageType === 'create' return !this.model.client_id
// }, }
//
// isEdit () {
// return this.pageType === 'edit'
// }
}, },
methods: { methods: {
...@@ -163,22 +155,6 @@ export default { ...@@ -163,22 +155,6 @@ export default {
}) })
}, },
edit (res) {
let resModel = res.actFullCutDetailModel
this.visStatus = resModel.visStatus
this.oldBeginTimeFormat = resModel.beginTimeFormat
this.oldEndTimeFormat = resModel.endTimeFormat
this.oaDeptNameArray.push(
{
oaDepCode: resModel.bearOaCode,
oaDepName: resModel.bearOaName
}
)
// UTIL.flatten(this.Act.form.editModel.actFullcutParam, resModel)
},
saveEvent () { saveEvent () {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
<script> <script>
import { import {
requestAPI, requestAPI,
api api,
UTIL
} from '@/lib/commonMixin' } from '@/lib/commonMixin'
import ScheduleForm from './scheduleForm' import ScheduleForm from './scheduleForm'
export default { export default {
...@@ -27,7 +28,7 @@ export default { ...@@ -27,7 +28,7 @@ export default {
return { return {
diaVis: false, diaVis: false,
model: { model: {
client_id: '111', client_id: '',
schedule_title: '', schedule_title: '',
start_at: '', start_at: '',
end_at: '', end_at: '',
...@@ -41,12 +42,12 @@ export default { ...@@ -41,12 +42,12 @@ export default {
}, },
methods: { methods: {
show () { show (model) {
model && UTIL.flatten(this.model, model)
this.diaVis = true this.diaVis = true
}, },
save () { save () {
console.log('this.model', this.model)
requestAPI(Object.assign({}, api.saveNewSchedule, { method: 'POST' }), this.model) requestAPI(Object.assign({}, api.saveNewSchedule, { method: 'POST' }), this.model)
.then((res) => { .then((res) => {
console.log(res) console.log(res)
...@@ -56,9 +57,4 @@ export default { ...@@ -56,9 +57,4 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.el-dialog .el-dialog__header {
background-color: #333744!important;
}
@include c('dialog-title') {
}
</style> </style>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:search-key="'ClientSearch'" :search-key="'ClientSearch'"
:add-title="'新建待办事项'" :add-title="'新建待办事项'"
@update:headerSearch="search => searchKeyword(search)" @update:headerSearch="search => searchKeyword(search)"
@update:headerAdd="() => add()"> @update:headerAdd="() => addSch()">
</search-header> </search-header>
<search-form <search-form
ref="clientForm" ref="clientForm"
...@@ -19,6 +19,12 @@ ...@@ -19,6 +19,12 @@
v-for="item in result.list" v-for="item in result.list"
:item="item" :item="item"
:key="item.id"> :key="item.id">
<span slot="opearate" class="obear-opearate-button">
<el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>留言</el-button>
<el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>汇报</el-button>
<el-button type="primary" size="mini" @click="editSch(item)"><i class="fa fa-edit animated"></i>编辑</el-button>
<el-button type="primary" size="mini" @click="deleteSch(item.id)"><i class="el-icon-share el-icon--left"></i>删除</el-button>
</span>
</ScheduleItem> </ScheduleItem>
</div> </div>
<Pagenation <Pagenation
...@@ -95,10 +101,29 @@ export default { ...@@ -95,10 +101,29 @@ export default {
}) })
}, },
add () { addSch () {
this.$refs.scheduleModal.show() this.$refs.scheduleModal.show()
}, },
editSch (item) {
this.$refs.scheduleModal.show(item)
},
deleteSch (id) {
this.$confirm('删除该待办事项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestWithJsonAPI(api.deleteSchedule)
.then((res) => {
console.log(res)
})
}).catch(() => {
this.$message.info('取消删除')
})
},
getScheduleList () { getScheduleList () {
requestWithJsonAPI(api.getScheduleList) requestWithJsonAPI(api.getScheduleList)
.then((res) => { .then((res) => {
...@@ -119,5 +144,9 @@ export default { ...@@ -119,5 +144,9 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@include c('opearate-button') {
> .el-button {
margin-right:0px;
}
}
</style> </style>
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
export { requestAPI, requestWithJsonAPI } from '../ajax' export { requestAPI, requestWithJsonAPI } from '../ajax'
export { requestJanusAPI } from '../ajax-janus' export { requestJanusAPI } from '../ajax-janus'
export { default as api } from '@/api' export { default as api } from '@/api'
export { default as UTIL } from './util'
import { MessageBox } from 'element-ui'
function flatten (target, src) {
if (!isObject(target) || !isObject(src)) return
Object.keys(src).forEach(key => {
target.hasOwnProperty(key) && (target[key] = src[key])
})
}
function isObject (o) {
return Object.prototype.toString.call(o) === '[object Object]'
}
function confirm (tips) {
return MessageBox.confirm(tips, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
}
export default {
flatten,
isObject,
confirm
}
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