Commit 2f874ed0 authored by daywrite's avatar daywrite

修复列表,新增表单

parent 41f3f0a5
export default {
getTaskFilter: {
url: '/vue/task/get-filter'
},
getTaskNew: {
url: '/vue/task/get-new'
},
getMembersById: {
url: '/vue/task/get-member-of-task'
},
saveNewTask: {
url: '/vue/task/save-new'
},
saveEditTask: {
url: '/vue/task/save-edit'
},
getTaskList: {
url: '/vue/task/list'
},
deleteTask: {
url: '/vue/task/delete'
},
// ---项目列表---
getTaskGroupList: {
url: '/vue/task/list-group'
}
}
......@@ -32,4 +32,28 @@
.mb10 {
margin-bottom:10px;
}
.single {
& .el-radio-button__inner, .el-radio-button:last-child .el-radio-button__inner, .el-radio-button:first-child .el-radio-button__inner{
border-left: 1px solid #DCDFE6;
margin: 0 10px 5px 0;
border-radius: 3px;
}
& .el-radio-button__inner:hover{
color: #333;
background-color: #e6e6e6;
border-color: #adadad;
}
& .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{
color: #333;
background-color: #d4d4d4;
border-color: #8c8c8c;
}
}
}
......@@ -2,8 +2,8 @@
<div>
<el-row class="form-content">
<el-form ref="clientForm" size="mini" :model="clientForm" label-width="0" label-position="top">
<el-col :span="4" v-for="(item, key) in filter" :key="key">
<solt name="pre"></solt>
<slot name="pre"></slot>
<el-col :span="4" v-for="(item, key) in filter" :key="key">
<el-form-item>
<span slot="label" v-if="item.key !== 'Filter[sort]'">
<a @click.prevent="timeSort" v-if="item.key === 'Filter[name]'">
......
......@@ -53,6 +53,11 @@ export default {
reimbursementSettleAccountsAt () {
let ret = this.getArrayByKey('Reimbursements', 'settle_accounts_at')
return ret && [].concat(ret.value)
},
taskGroupArray () {
let ret = this.getArrayByKey('Tasks', 'task_group_id')
return ret && [].concat(ret.value)
}
},
......@@ -76,6 +81,13 @@ export default {
})
},
getTaskTask () {
requestAPI(api.getTaskNew)
.then((res) => {
this.retNewArray = res.options
})
},
getReimbursementNew () {
requestAPI(api.getReimNew)
.then((res) => {
......
<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="task_group_id" class="ec-clear-left ec-form-item-lg is-required">
<el-select v-model="model.task_group_id" size="small" placeholder="请选择">
<el-option v-for="(option, optKey) in taskGroupArray"
:key="optKey"
:label="option.name"
:value="option.key"></el-option>
</el-select>
</el-form-item>
<el-form-item label="任务内容:" prop="title" 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">
</el-input>
</el-form-item>
<el-form-item label="重要性:" prop="is_important" class="ec-clear-left is-required">
<single-radio
:form-item="model.is_important"
:options-list="taskImportantArray"
@update:item="val => {model.is_important = val}">
</single-radio>
</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"
@change="targetCompletedAtChange"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注:" prop="description" class="ec-clear-left ec-form-item-lg">
<el-input
class="ec-input-normal"
v-model.trim="model.description">
</el-input>
</el-form-item>
<el-form-item label="负责人:" prop="head_of" class="ec-clear-left ec-form-item-lg is-required">
<el-select v-model="model.head_of" size="small" placeholder="请选择">
<el-option v-for="(option, optKey) in options.headOfArray"
:key="optKey"
:label="option.name"
:value="option.key"></el-option>
</el-select>
</el-form-item>
</el-form>
</section>
</template>
<script>
import singleRadio from '../common/singleRadio'
import settingMixin from '../common/settingMixin'
import {
requestAPI,
api
} from '@/lib/commonMixin'
export default {
name: 'taskForm',
mixins: [settingMixin],
props: {
model: Object
},
components: {
singleRadio
},
data () {
return {
taskImportantArray: [
{
'name': '普通',
'key': 0
},
{
'name': '重要',
'key': 1
}
],
activateTimeStrRules: {
disabledDate (time) {
return time.getTime() < Date.now() - 8.64e7
}
},
options: {
headOfArray: []
},
rules: {},
query: {}
}
},
created () {
this.$watch('model.task_group_id', function (val) {
this.getHeadOfArray(val)
})
},
mounted () {
this.initSetting(['getTaskTask'])
},
computed: {
},
methods: {
targetCompletedAtChange (val) {
this.model.target_completed_at = val
},
getHeadOfArray (id) {
requestAPI(api.getMembersById, {
id: id
}).then(res => {
this.options.headOfArray = res
})
}
}
}
</script>
<style lang="scss" scoped>
.ec-create-form .el-form-item {
width: 100%;
}
</style>
<template>
<section>
<sidePopup ref="sidePopup" title="新建项目清单" :width="40">
<TaskForm
:model="model">
</TaskForm>
<div class="mt20" style="margin-left: 150px;">
<el-button type="cancel" @click.stop.prevent="handleClose" size="mini">取 消</el-button>
<el-button type="confirm" @click.stop.prevent="save" size="mini">确 定</el-button>
</div>
</sidePopup>
</section>
</template>
<script>
import {
requestAPI,
api,
UTIL
} from '@/lib/commonMixin'
import TaskForm from './taskForm'
import { setModule } from '@/lib/viewHelper'
export default {
components: {
TaskForm
},
data () {
return {
diaVis: false,
model: {
id: '',
task_group_id: '',
title: '',
is_important: '',
target_completed_at: '',
description: ''
}
}
},
methods: {
show (model) {
model && UTIL.flatten(this.model, model)
this.$refs.sidePopup.show()
},
handleClose () {
Object.keys(this.model).forEach(item => {
this.model[item] = ''
})
this.$refs.sidePopup.close()
},
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]']
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => {
this.$refs.sidePopup.close()
this.$message.success('操作成功')
this.$parent.reload()
})
}
}
}
</script>
<style lang="scss" scoped>
</style>
<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">
<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-input
class="ec-input-normal"
v-model.trim="model.description">
</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"
@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-input
class="ec-input-normal"
type="textarea"
:rows="2"
v-model.trim="model.title">
</el-input>
</el-form-item>
<el-form-item label="备注:" prop="title" 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">
</el-input>
</el-form-item>
</el-form>
</section>
</template>
<script>
import singleRadio from '../common/singleRadio'
import settingMixin from '../common/settingMixin'
import depSelect from '../schedule/depSelect'
import {
requestAPI,
api
} from '@/lib/commonMixin'
export default {
name: 'taskForm',
mixins: [settingMixin],
props: {
model: Object
},
components: {
singleRadio,
depSelect
},
data () {
return {
taskImportantArray: [
{
'name': '普通',
'key': 0
},
{
'name': '重要',
'key': 1
}
],
activateTimeStrRules: {
disabledDate (time) {
return time.getTime() < Date.now() - 8.64e7
}
},
options: {
headOfArray: []
},
rules: {},
query: {}
}
},
created () {
this.$watch('model.task_group_id', function (val) {
this.getHeadOfArray(val)
})
},
mounted () {
this.initSetting(['getTaskTask'])
},
computed: {
},
methods: {
targetCompletedAtChange (val) {
this.model.target_completed_at = val
},
getHeadOfArray (id) {
requestAPI(api.getMembersById, {
id: id
}).then(res => {
this.options.headOfArray = res
})
}
}
}
</script>
<style lang="scss" scoped>
.ec-create-form .el-form-item {
width: 100%;
}
</style>
<template>
<section>
<sidePopup ref="sidePopup" title="新建项目清单" :width="40">
<TaskForm
:model="model">
</TaskForm>
<div class="mt20" style="margin-left: 150px;">
<el-button type="cancel" @click.stop.prevent="handleClose" size="mini">取 消</el-button>
<el-button type="confirm" @click.stop.prevent="save" size="mini">确 定</el-button>
</div>
</sidePopup>
</section>
</template>
<script>
import {
requestAPI,
api,
UTIL
} from '@/lib/commonMixin'
import TaskForm from './taskForm'
import { setModule } from '@/lib/viewHelper'
export default {
components: {
TaskForm
},
data () {
return {
diaVis: false,
model: {
id: '',
task_group_id: '',
title: '',
is_important: '',
target_completed_at: '',
description: ''
}
}
},
methods: {
show (model) {
model && UTIL.flatten(this.model, model)
this.$refs.sidePopup.show()
},
handleClose () {
Object.keys(this.model).forEach(item => {
this.model[item] = ''
})
this.$refs.sidePopup.close()
},
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]']
requestAPI(Object.assign(_apiUrl, { method: 'POST' }), _params)
.then((res) => {
this.$refs.sidePopup.close()
this.$message.success('操作成功')
this.$parent.reload()
})
}
}
}
</script>
<style lang="scss" scoped>
</style>
......@@ -13,13 +13,15 @@
ref="clientForm"
:filter="filter"
@update:clientList="form =>{ updateForm(form) }">
<el-form-item>
<singleRadioTool
:form-item="groupType"
:options-list="groupArray"
@update:item="val => { reimTypeChange(val) }">
</singleRadioTool>
</el-form-item>
<el-col :span="4" slot="pre">
<el-form-item>
<singleRadioTool
:form-item="groupType"
:options-list="groupArray"
@update:item="val => { reimTypeChange(val) }">
</singleRadioTool>
</el-form-item>
</el-col>
</search-form>
<div class="page-body-content">
<div class="mb10">
......@@ -273,21 +275,14 @@ export default {
},
getList (params) {
requestAPI(api.getReimList, params).then((res) => {
requestAPI(api.getTaskGroupList, params).then((res) => {
const {
list = [],
countArr = [],
navCount = [],
pagenation = {},
thisUser = {}
pagenation = {}
} = res
this.result.list = list
this.result.countArr = countArr
this.result.navCount = navCount
// this.reimType = navCount[0].key
this.result.pagenation = pagenation
this.result.thisUser = thisUser
})
}
}
......
......@@ -4,17 +4,17 @@
<el-col :span="8" :xs="24" class="obear-schedule-left" :style="{background: item.bgcolor}">
<el-row :gutter="10">
<el-col :span="24">
<router-link :to="{ path: '/scheduleView/' + item.client_id }">
<i class="fa fa-fw fa-th-list" aria-hidden="true"></i>{{ isNullClient ? '客户名称(未设置)' : item.client.name }}
<router-link :to="{ path: '/scheduleView/' + item.id }">
<i class="fa fa-fw fa-th-list" aria-hidden="true"></i>{{ item.title }}
</router-link>
</el-col>
<el-col :span="24">
<div class="obear-group-left__second">
<div>
<span class="obear-app-frame__white">剩余时间 超时</span>
<span class="obear-app-frame__white">剩余时间 {{ item.remain_time }}</span>
</div>
<div>
<span class="obear-app-frame__white">剩余任务: 1</span>
<span class="obear-app-frame__white">剩余任务: {{ item.remainCount.remain }}</span>
</div>
</div>
</el-col>
......@@ -28,7 +28,7 @@
<el-col :span="6" :xs="24">
<span>负责人:</span>
<span>
<img class="user-avatar rounded-circle" :src="item.icon">{{ item.name }}
<img class="user-avatar rounded-circle" :src="item.headOf.avatar.name">{{ item.headOf.name }}
</span>
</el-col>
<el-col :span="6" :xs="24">
......@@ -38,14 +38,14 @@
<span>状态:</span><span class="obear-schedule-right__content" :style="{'border-color': item.bgcolor, color: item.bgcolor}">{{ item.status_display }}</span>
</el-col>
<el-col :span="6" :xs="24">
<span class="obear-schedule-right__content">截至日期</span><span>{{ item.description }}</span>
<span class="obear-schedule-right__content">截至日期</span><span>{{ item.target_completed_at }}</span>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="6" :xs="24">
<span>成员:</span>
<span v-for="item in reimCarbonCopyRelsArray">
<img class="user-avatar rounded-circle" :src="item.icon">{{ item.name }}
<span v-for="sItem in item.taskGroupUserRelationships">
<img class="user-avatar rounded-circle" :src="item.user.avatar.name">{{ item.user.name }}
</span>
</el-col>
<el-col :span="6" :xs="24">
......
......@@ -44,10 +44,10 @@
</leave-message>
</div>
</div>
<ReimModal
ref="reimModal">
<TaskModal
ref="taskModal">
<!-- v-click-outside="scheduleClose" -->
</ReimModal>
</TaskModal>
</section>
</template>
......@@ -55,7 +55,7 @@
import SearchHeader from '../common/searchHeader'
import SearchForm from '../common/SearchForm'
import TaskItem from './taskItem'
import ReimModal from '../reimbursement/reimbursementModal'
import TaskModal from '../task/taskModal'
import Pagenation from './taskPagenation'
import clickOutside from '@/lib/bind'
import singleRadioTool from '../common/singleRadioTool'
......@@ -65,7 +65,7 @@ import {
api
} from '@/lib/commonMixin'
export default {
name: 'reimbursementHome',
name: 'taskHome',
mixins: [SetParams],
......@@ -73,7 +73,7 @@ export default {
SearchHeader,
SearchForm,
TaskItem,
ReimModal,
TaskModal,
Pagenation,
singleRadioTool
},
......@@ -226,25 +226,25 @@ export default {
},
scheduleClose () {
this.$refs.reimModal &&
this.$refs.reimModal.handleClose()
this.$refs.taskModal &&
this.$refs.taskModal.handleClose()
},
addSch () {
this.$refs.reimModal.show()
this.$refs.taskModal.show()
},
editSch (item) {
this.$refs.reimModal.show(item)
this.$refs.taskModal.show(item)
},
deleteSch (id) {
this.$confirm('删除该待办事项?', '提示', {
this.$confirm('删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestAPI(api.deleteReim, { id })
requestAPI(api.deleteTask, { id })
.then((res) => {
this._reload()
this.$message.success('删除成功')
......@@ -255,21 +255,14 @@ export default {
},
getList (params) {
requestAPI(api.getReimList, params).then((res) => {
requestAPI(api.getTaskList, params).then((res) => {
const {
list = [],
countArr = [],
navCount = [],
pagenation = {},
thisUser = {}
pagenation = {}
} = res
this.result.list = list
this.result.countArr = countArr
this.result.navCount = navCount
// this.reimType = navCount[0].key
this.result.pagenation = pagenation
this.result.thisUser = thisUser
})
}
}
......
......@@ -7,10 +7,10 @@
<el-checkbox v-model="checked">
<span class="obear-schedule-left__checkbox">普通</span>
</el-checkbox>
<span>剩余时间 超时剩余时间 超剩余时间 超剩余时间 超剩余时间 超剩余时间 超剩余时间 超剩余时间 超</span>
<span>{{ item.title }}</span>
</el-col>
<el-col :span="24">
<span class="obear-app-frame__white">剩余时间</span>
<span class="obear-app-frame__white">剩余时间 {{ item. remain_time }}</span>
</el-col>
</el-row>
</el-col>
......@@ -19,14 +19,14 @@
<el-col :span="6" :xs="24">
<span>负责人:</span>
<span>
<img class="user-avatar rounded-circle" :src="item.icon">{{ item.name }}
<img class="user-avatar rounded-circle" :src="item.headOf.avatar.name">{{ item.headOf.name }}
</span>
</el-col>
<el-col :span="6" :xs="24">
<span>项目列表:</span><span class="collightBlue">{{ item.project.name }}</span>
<span>项目列表:</span><span class="collightBlue">{{ item.taskGroup.name }}</span>
</el-col>
<el-col :span="6" :xs="24">
<span>客户名称:</span><span class="collightBlue">{{ item.client.name }}</span>
<span>客户名称:</span><span class="collightBlue">{{ item.taskGroup.client.name }}</span>
</el-col>
<el-col :span="6" :xs="24">
<span>状态:</span><span class="obear-schedule-right__content" :style="{'border-color': item.bgcolor, color: item.bgcolor}">{{ item.status_display }}</span>
......@@ -34,10 +34,10 @@
</el-row>
<el-row :gutter="10">
<el-col :span="6" :xs="24">
<span class="obear-schedule-right__content">截至日期</span><span>{{ item.description }}</span>
<span class="obear-schedule-right__content">截至日期</span><span>{{ item.target_completed_at }}</span>
</el-col>
<el-col :span="6" :xs="24">
<span class="obear-schedule-right__content">完成时间</span><span>{{ item.description }}</span>
<span class="obear-schedule-right__content">完成时间</span><span>{{ item.target_completed_at }}</span>
</el-col>
<el-col :span="6" :xs="24">
</el-col>
......@@ -61,6 +61,7 @@ export default {
data () {
return {
checked: ''
}
},
......@@ -71,6 +72,12 @@ export default {
},
methods: {
},
watch: {
checked (val) {
console.log(val)
}
}
}
</script>
......
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