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

修复新建任务

parent 8e9e49b1
......@@ -38,8 +38,16 @@ export default {
},
getTaskGroupNew: {
// url: '/vue/task/get-new-group'
url: '/vue/sales-order/get-new'
url: '/vue/task/get-new-group'
// url: '/vue/sales-order/get-new'
},
saveNewTaskGroup: {
url: '/vue/task/save-new-group'
},
saveEditTaskGroup: {
url: '/vue/task/save-edit-group'
},
deleteTaskGroup: {
......
......@@ -60,8 +60,8 @@ export default {
return ret && [].concat(ret.value)
},
salesOrderRemindReceiversArray () {
let ret = this.getArrayByKey('SalesOrders', 'salesOrderRemindReceivers')
taskGroupsUArray () {
let ret = this.getArrayByKey('TaskGroups', 'taskGroupUsers')
return ret && [].concat(ret.value)
}
},
......
<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">
<dep-select
:query="model"
:inputWidth="340"
:startLoadInitial="false"/>
</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
class="ec-input-normal"
v-model.trim="model.description">
v-model.trim="model.title">
</el-input>
</el-form-item>
<el-form-item label="截止日期:" prop="target_completed_at" class="ec-clear-left">
<el-date-picker
size="small"
v-model="model.target_completed_at"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
type="date"
value-format="yyyy-MM-dd"
@change="targetCompletedAtChange"
placeholder="选择日期时间">
</el-date-picker>
</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
class="ec-input-normal"
type="textarea"
:rows="2"
v-model.trim="model.title">
v-model.trim="model.situation">
</el-input>
</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
class="ec-input-normal"
type="textarea"
:rows="2"
v-model.trim="model.title">
v-model.trim="model.description">
</el-input>
</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
:check-group-form-item="model.remindReceivers"
:check-group-options-list="salesOrderRemindReceiversArray"
@update:item="val => {model.remindReceivers = val}">
:check-group-form-item="model.TaskGroupUsers"
:check-group-options-list="taskGroupsUArray"
@update:item="val => {model.TaskGroupUsers = val}">
</multiple-check-group>
</el-form-item>
</el-form>
......
......@@ -30,19 +30,23 @@ export default {
diaVis: false,
model: {
id: '',
task_group_id: '',
client_id: '',
client_name: '', // 客户
title: '',
is_important: '',
target_completed_at: '',
situation: '',
description: '',
remindReceivers: []
TaskGroupUsers: []
}
}
},
methods: {
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()
},
......@@ -54,9 +58,9 @@ export default {
},
save () {
let _params = Object.assign({}, setModule(this.model, 'Tasks'))
let _apiUrl = !this.model.id ? api.saveNewTask : api.saveEditTask
!this.model.id && delete _params['Tasks[id]']
let _params = Object.assign({}, setModule(this.model, 'TaskGroups'))
let _apiUrl = !this.model.id ? api.saveNewTaskGroup : api.saveEditTaskGroup
!this.model.id && delete _params['TaskGroups[id]']
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => {
this.$refs.sidePopup.close()
......
......@@ -37,8 +37,8 @@
:key="item.id">
<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="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="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="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_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="deleteSch(item.id)" :disabled="!item.can_delete"><i class="fa fa-trash-o animated-hove"></i>删除</el-button>
</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