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

添加编辑功能

parent a4c401cb
......@@ -2,6 +2,7 @@
.mb20 {
margin-bottom:20px;
}
.el-button--cancel {
color:white;
background-color: #EB7567;
......
......@@ -4,15 +4,13 @@
<el-col :span="4" :xs="24" class="obear-schedule-left">
<el-row :gutter="10">
<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 :span="24">
<img class="user-avatar rounded-circle" :src="item.createdBy.avatar.name">
<span>{{ item.createdBy.name }}</span>
<span><img class="user-avatar rounded-circle" :src="item.createdBy.avatar.name">{{ item.createdBy.name }}</span>
</el-col>
<el-col :span="24">
<i class="fa fa-connectdevelop" aria-hidden="true"></i>
<span>{{ item.department.name }}</span>
<span><i class="fa fa-connectdevelop" aria-hidden="true"></i>{{ item.department.name }}</span>
<span class="obear-schedule-left__private" :class="[isPublic ? 'colRed' : 'colGreen']">{{ isPublic ? '私人' : '共享' }}</span>
</el-col>
</el-row>
......@@ -56,10 +54,8 @@
<el-col :span="6" :xs="24">
</el-col>
<el-col :span="6" :xs="24">
<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"><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>
<slot name="opearate">
</slot>
</el-col>
</el-row>
</el-col>
......@@ -68,10 +64,6 @@
</template>
<script>
import {
requestWithJsonAPI,
api
} from '@/lib/commonMixin'
export default {
name: 'scheduleItem',
......@@ -98,20 +90,6 @@ export default {
},
methods: {
deleteSch (id) {
this.$confirm('删除该待办事项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestWithJsonAPI(api.deleteSchedule)
.then((res) => {
console.log(res)
})
}).catch(() => {
this.$message.info('取消删除')
})
}
}
}
</script>
......@@ -166,6 +144,10 @@ export default {
display: inline-block;
padding-left: 5px;
}
i {
display:inline-block;
padding-right:5px;
}
@include e('private') {
display: inline-block;
padding-right: 5px;
......
<template>
<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-item label="客户名称" prop="actName" class="ec-clear-left">
<el-form-item label="客户名称" prop="actName" class="ec-clear-left" v-if="isCreate">
<dep-select
:query="query"
:inputWidth="340"
......@@ -138,20 +138,12 @@ export default {
mounted () {
this.initSetting(['getNewArray'])
// if (this.isEdit) {
// let id = this.$route.params.id
// this.getActById(id)
// }
},
computed: {
// isCreate () {
// return this.pageType === 'create'
// },
//
// isEdit () {
// return this.pageType === 'edit'
// }
isCreate () {
return !this.model.client_id
}
},
methods: {
......@@ -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 () {
this.$refs['form'].validate((valid) => {
if (valid) {
......
......@@ -14,7 +14,8 @@
<script>
import {
requestAPI,
api
api,
UTIL
} from '@/lib/commonMixin'
import ScheduleForm from './scheduleForm'
export default {
......@@ -27,7 +28,7 @@ export default {
return {
diaVis: false,
model: {
client_id: '111',
client_id: '',
schedule_title: '',
start_at: '',
end_at: '',
......@@ -41,12 +42,12 @@ export default {
},
methods: {
show () {
show (model) {
model && UTIL.flatten(this.model, model)
this.diaVis = true
},
save () {
console.log('this.model', this.model)
requestAPI(Object.assign({}, api.saveNewSchedule, { method: 'POST' }), this.model)
.then((res) => {
console.log(res)
......@@ -56,9 +57,4 @@ export default {
}
</script>
<style lang="scss" scoped>
.el-dialog .el-dialog__header {
background-color: #333744!important;
}
@include c('dialog-title') {
}
</style>
......@@ -7,7 +7,7 @@
:search-key="'ClientSearch'"
:add-title="'新建待办事项'"
@update:headerSearch="search => searchKeyword(search)"
@update:headerAdd="() => add()">
@update:headerAdd="() => addSch()">
</search-header>
<search-form
ref="clientForm"
......@@ -19,6 +19,12 @@
v-for="item in result.list"
:item="item"
: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>
</div>
<Pagenation
......@@ -95,10 +101,29 @@ export default {
})
},
add () {
addSch () {
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 () {
requestWithJsonAPI(api.getScheduleList)
.then((res) => {
......@@ -119,5 +144,9 @@ export default {
</script>
<style scoped lang="scss">
@include c('opearate-button') {
> .el-button {
margin-right:0px;
}
}
</style>
......@@ -2,3 +2,4 @@
export { requestAPI, requestWithJsonAPI } from '../ajax'
export { requestJanusAPI } from '../ajax-janus'
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