Commit f79b85bf authored by huai.li's avatar huai.li

修复新建任务

parent 8e9e49b1
...@@ -38,8 +38,16 @@ export default { ...@@ -38,8 +38,16 @@ export default {
}, },
getTaskGroupNew: { getTaskGroupNew: {
// url: '/vue/task/get-new-group' url: '/vue/task/get-new-group'
url: '/vue/sales-order/get-new' // url: '/vue/sales-order/get-new'
},
saveNewTaskGroup: {
url: '/vue/task/save-new-group'
},
saveEditTaskGroup: {
url: '/vue/task/save-edit-group'
}, },
deleteTaskGroup: { deleteTaskGroup: {
......
...@@ -60,8 +60,8 @@ export default { ...@@ -60,8 +60,8 @@ export default {
return ret && [].concat(ret.value) return ret && [].concat(ret.value)
}, },
salesOrderRemindReceiversArray () { taskGroupsUArray () {
let ret = this.getArrayByKey('SalesOrders', 'salesOrderRemindReceivers') let ret = this.getArrayByKey('TaskGroups', 'taskGroupUsers')
return ret && [].concat(ret.value) return ret && [].concat(ret.value)
} }
}, },
......
<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">
<dep-select <dep-select
:query="model" :query="model"
:inputWidth="340" :inputWidth="340"
:startLoadInitial="false"/> :startLoadInitial="false"/>
</el-form-item> </el-form-item>
<el-form-item label="项目名臣:" prop="description" class="ec-clear-left ec-form-item-lg"> <el-form-item label="项目名称:" prop="title" class="ec-clear-left ec-form-item-lg">
<el-input <el-input
class="ec-input-normal" class="ec-input-normal"
v-model.trim="model.description"> v-model.trim="model.title">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="截止日期:" prop="target_completed_at" class="ec-clear-left"> <el-form-item label="截止日期:" prop="target_completed_at" class="ec-clear-left">
<el-date-picker <el-date-picker
size="small" size="small"
v-model="model.target_completed_at" v-model="model.target_completed_at"
type="datetime" type="date"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd"
@change="targetCompletedAtChange" @change="targetCompletedAtChange"
placeholder="选择日期时间"> placeholder="选择日期时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="情况说明:" prop="title" class="ec-clear-left ec-form-item-lg is-required"> <el-form-item label="情况说明:" prop="situation" class="ec-clear-left ec-form-item-lg is-required">
<el-input <el-input
class="ec-input-normal" class="ec-input-normal"
type="textarea" type="textarea"
:rows="2" :rows="2"
v-model.trim="model.title"> v-model.trim="model.situation">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注:" prop="title" class="ec-clear-left ec-form-item-lg is-required"> <el-form-item label="备注:" prop="description" class="ec-clear-left ec-form-item-lg is-required">
<el-input <el-input
class="ec-input-normal" class="ec-input-normal"
type="textarea" type="textarea"
:rows="2" :rows="2"
v-model.trim="model.title"> v-model.trim="model.description">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="成员" prop="remindReceivers" class="ec-clear-left ec-form-item-lg is-required"> <el-form-item label="成员" prop="TaskGroupUsers" class="ec-clear-left ec-form-item-lg is-required">
<multiple-check-group <multiple-check-group
:check-group-form-item="model.remindReceivers" :check-group-form-item="model.TaskGroupUsers"
:check-group-options-list="salesOrderRemindReceiversArray" :check-group-options-list="taskGroupsUArray"
@update:item="val => {model.remindReceivers = val}"> @update:item="val => {model.TaskGroupUsers = val}">
</multiple-check-group> </multiple-check-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
......
...@@ -30,19 +30,23 @@ export default { ...@@ -30,19 +30,23 @@ export default {
diaVis: false, diaVis: false,
model: { model: {
id: '', id: '',
task_group_id: '', client_id: '',
client_name: '', // 客户
title: '', title: '',
is_important: '',
target_completed_at: '', target_completed_at: '',
situation: '',
description: '', description: '',
remindReceivers: [] TaskGroupUsers: []
} }
} }
}, },
methods: { methods: {
show (model) { show (model) {
model && UTIL.flatten(this.model, model) if (model) {
UTIL.flatten(this.model, model)
this.model.client_name = model.client.name
}
this.$refs.sidePopup.show() this.$refs.sidePopup.show()
}, },
...@@ -54,9 +58,9 @@ export default { ...@@ -54,9 +58,9 @@ export default {
}, },
save () { save () {
let _params = Object.assign({}, setModule(this.model, 'Tasks')) let _params = Object.assign({}, setModule(this.model, 'TaskGroups'))
let _apiUrl = !this.model.id ? api.saveNewTask : api.saveEditTask let _apiUrl = !this.model.id ? api.saveNewTaskGroup : api.saveEditTaskGroup
!this.model.id && delete _params['Tasks[id]'] !this.model.id && delete _params['TaskGroups[id]']
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params) requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => { .then((res) => {
this.$refs.sidePopup.close() this.$refs.sidePopup.close()
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
:key="item.id"> :key="item.id">
<span slot="opearate" class="obear-opearate-button"> <span slot="opearate" class="obear-opearate-button">
<el-button type="primary" size="mini" @click.prevent.stop="leaveMessageSch(item)"><span class="badge" v-if="item.commentCount.comment">{{ item.commentCount.comment ? item.commentCount.comment : '' }}</span><i class="fa fa-commenting"></i>留言</el-button> <el-button type="primary" size="mini" @click.prevent.stop="leaveMessageSch(item)"><span class="badge" v-if="item.commentCount.comment">{{ item.commentCount.comment ? item.commentCount.comment : '' }}</span><i class="fa fa-commenting"></i>留言</el-button>
<el-button type="primary" size="mini" @click.prevent.stop="checkSch(item)" :disabled="!item.can_update"><i class="fa fa-fw fa-check"></i>完成</el-button> <el-button type="primary" size="mini" @click.prevent.stop="checkSch(item)" :disabled="!item.can_complete"><i class="fa fa-fw fa-check"></i>完成</el-button>
<el-button type="primary" size="mini" @click.prevent.stop="banSch(item)" :disabled="!item.can_update"><i class="fa fa-fw fa-ban"></i>中止</el-button> <el-button type="primary" size="mini" @click.prevent.stop="banSch(item)" :disabled="!item.can_stop"><i class="fa fa-fw fa-ban"></i>中止</el-button>
<el-button type="primary" size="mini" @click.prevent.stop="editSch(item)" :disabled="!item.can_update"><i class="fa fa-edit animated"></i>编辑</el-button> <el-button type="primary" size="mini" @click.prevent.stop="editSch(item)" :disabled="!item.can_update"><i class="fa fa-edit animated"></i>编辑</el-button>
<el-button type="primary" size="mini" @click.prevent.stop="deleteSch(item.id)" :disabled="!item.can_delete"><i class="fa fa-trash-o animated-hove"></i>删除</el-button> <el-button type="primary" size="mini" @click.prevent.stop="deleteSch(item.id)" :disabled="!item.can_delete"><i class="fa fa-trash-o animated-hove"></i>删除</el-button>
</span> </span>
......
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