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

合并

parent 1b759ef8
import ScheduleApi from './apis/schedule.js'
import ReimburrsementApi from './apis/reimbursement.js'
const usingJSONP = process.env.NODE_ENV !== 'production'
const API_HOST = process.env.API_HOST
const API_PORT = process.env.API_PORT
const JANUS_HOST = process.env.JANUS_HOST
const JANUS_PORT = process.env.JANUS_PORT
const option = {
tokenKey: '__token__',
sessionExpiredCode: 401,
loginUrl: '/logout.php',
host: API_HOST,
port: API_PORT,
hostJanus: JANUS_HOST,
portJanus: JANUS_PORT,
baseUrl: '',
ajax: {
method: usingJSONP ? 'GET' : 'POST',
dataType: 'json',
getQuery: usingJSONP ? '?duplextrans' : '',
contentType: 'application/x-www-form-urlencoded; charset=UTF-8'
}
}
let apis = {}
apis = Object.assign(apis, ScheduleApi)
apis = Object.assign(apis, ReimburrsementApi)
export default {
option,
...apis
}
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'
},
getTaskGroupNew: {
// url: '/vue/task/get-new-group'
url: '/vue/sales-order/get-new'
}
}
.task-app {
.obear-app-frame__white {
border: 1px solid white;
border-radius:2px;
padding: 0 2px 0 2px;
}
.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 2px 0 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: #17a2b8;
border-color: #17a2b8;
box-shadow: 0 0 0 0 #17a2b8;
}
.el-radio-button__orig-radio:checked+.el-radio-button__inner:hover{
color: #333;
background-color: #d4d4d4;
border-color: #8c8c8c;
}
.ec-page-wrapper .el-form-item__label {
color: white;
}
.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;
}
}
}
<template>
<section class="multiple-check-group">
<el-row :gutter="10">
<el-col :span="4" :class="['client-label', 'text-right', {'required': required}]">
<span>{{label}}</span>
</el-col>
<el-col :span="14">
<span v-for="(item, key) in groupOptionsList"
:key="key">
<el-card class="box-card"
:body-style="{ padding: '10px' }"
v-if="item.child.length > 0">
<div slot="header" class="clearfix">
<el-checkbox
:indeterminate="item.isIndeterminate"
v-model="item.checkAll"
@change="(val) => {handleCheckGroupAll(val, item)}">{{item.name}}
</el-checkbox>
</div>
<el-checkbox-group v-model="item.checkItems" @change="(value) => {handleCheckGroupChange(value, item)}">
<el-checkbox v-for="(check, key) in item.child" :label="check.key" :key="key">{{check.name}}</el-checkbox>
</el-checkbox-group>
</el-card>
</span>
</el-col>
<el-col :span="6">
<slot name="formError"></slot>
<span class="tips">{{tips}}</span>
</el-col>
</el-row>
</section>
</template>
<script>
// import itemMixin from '../../lib/singleItemMixin'
export default {
name: 'multiple-check-group',
// mixins: [itemMixin],
props: {
label: {
type: String
},
required: {
type: Boolean
},
tips: {
type: String
},
checkGroupFormItem: Array,
checkGroupOptionsList: Array
},
data () {
return {
groupOptionsList: []
}
},
methods: {
handleCheckGroupAll (val, item) {
item.checkItems = val ? item.child.map(i => i.key) : []
item.isIndeterminate = false
},
handleCheckGroupChange (value, item) {
let checkedCount = value.length
item.checkAll = checkedCount === item.child.length
item.isIndeterminate = checkedCount > 0 && checkedCount < item.child.length
}
},
watch: {
checkGroupOptionsList (val) {
this.groupOptionsList = []
val.forEach(item => {
let checkItems = item.child.map(i => i.key).filter(i => this.checkGroupFormItem.some(ele => ele === i))
this.$set(item, 'isIndeterminate', checkItems.length > 0 && checkItems.length < item.child.length)
this.$set(item, 'checkAll', checkItems.length > 0 && checkItems.length === item.child.length)
this.$set(item, 'checkItems', checkItems)
this.groupOptionsList.push(item)
})
},
groupOptionsList: {
handler (val) {
let conArray = []
val.forEach(item => {
conArray = conArray.concat(item.checkItems)
})
this.$emit('update:item', Array.from(new Set(conArray)))
},
deep: true
}
}
}
</script>
<style>
.multiple-check-group .el-card {
border: 1px solid #5092d2;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
margin-bottom: 20px;
line-height: 20px;
}
.multiple-check-group .el-card .el-card__header {
padding: 10px;
background-color: #649FD7;
}
.multiple-check-group .el-card .el-card__header .el-checkbox__label {
color: #ffffff;
}
</style>
import multipleCheckGroup from './multipleCheckGroup'
export default {
components: {
multipleCheckGroup
}
}
<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-item label="提醒人" prop="remindReceivers" 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}">
</multiple-check-group>
</el-form-item>
</el-form>
</section>
</template>
<script>
import singleRadio from '../common/singleRadio'
import settingMixin from '../common/settingMixin'
import operationMixins from '../common/operationMixins'
import depSelect from '../schedule/depSelect'
import {
requestAPI,
api
} from '@/lib/commonMixin'
export default {
name: 'taskForm',
mixins: [settingMixin, operationMixins],
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(['getTaskGroupNew'])
},
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="50">
<TaskGroupForm
:model="model">
</TaskGroupForm>
<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 TaskGroupForm from './taskGroupForm'
import { setModule } from '@/lib/viewHelper'
export default {
components: {
TaskGroupForm
},
data () {
return {
diaVis: false,
model: {
id: '',
task_group_id: '',
title: '',
is_important: '',
target_completed_at: '',
description: '',
remindReceivers: []
}
}
},
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>
<div class="content">
<search-header
ref="searchHeader"
:title="'项目列表'"
:search-key="'ClientSearch'"
:add-title="'新建项目'"
@update:headerSearch="search => searchKeyword(search)"
@update:headerAdd="() => addSch()">
</search-header>
<search-form
ref="clientForm"
:filter="filter"
@update:clientList="form =>{ updateForm(form) }">
<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">
<singleRadioTool
:form-item="taskType"
:options-list="navArray"
@update:item="val => { reimTypeChange(val) }">
</singleRadioTool>
</div>
<GroupItem
v-for="item in result.list"
:item="item"
: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="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>
</GroupItem>
<Pagenation
@update:pager="pager => {updatePage(pager)}"
:total="result.pagenation.totalcount">
</Pagenation>
<leave-message
v-click-outside="lmClose"
ref="leaveMessage"
:lmTemplate="lmTemplate"
:type="20">
</leave-message>
</div>
</div>
<TaskGroupModal
ref="taskGroupModal">
<!-- v-click-outside="scheduleClose" -->
</TaskGroupModal>
</section>
</template>
<script>
import SearchHeader from '../common/searchHeader'
import SearchForm from '../common/SearchForm'
import GroupItem from './groupItem'
import TaskGroupModal from '../task_group/taskGroupModal'
import Pagenation from './groupPagenation'
import clickOutside from '@/lib/bind'
import singleRadioTool from '../common/singleRadioTool'
import SetParams from '../common/setParams'
import {
requestAPI,
api
} from '@/lib/commonMixin'
export default {
name: 'taskGroupHome',
mixins: [SetParams],
components: {
SearchHeader,
SearchForm,
GroupItem,
TaskGroupModal,
Pagenation,
singleRadioTool
},
directives: {
clickOutside
},
data () {
return {
lmTemplate: [
{
name: '报销类型',
value: 'type.name',
default: ''
},
{
name: '费用金额',
value: 'amount'
},
{
name: '报销状态',
value: 'status_display'
},
{
name: '发生时间',
value: 'occurrence_at'
},
{
name: '费用说明',
value: 'description'
},
{
name: '费用类型',
value: 'costType.name'
},
{
name: '录入人',
value: 'createdBy.name'
}
],
filter: [],
groupType: 'all',
groupArray: [{
'key': 'all',
'name': '全部'
}, {
'key': '1',
'name': '我参与的'
}, {
'key': '2',
'name': '我领导的'
}],
taskType: 'group_list',
navArray: [{
'key': 'list',
'name': '项目清单'
}, {
'key': 'group_list',
'name': '项目列表'
}],
form: {
'ClientSearch[keyword]': ''
},
pagenation: {
thispage: 1,
pagesize: 10
},
result: {
list: [],
countArr: [],
navCount: [],
pagenation: {
totalcount: 1,
thispage: 1,
pagesize: 10
},
thisUser: {
id: '',
name: '',
sex: ''
}
}
}
},
mounted () {
this.init()
},
methods: {
init () {
this.getFilter()
},
_reload () {
let params = this.setParams({
...this.form,
page: this.pagenation.thispage
}, {})
this.getList(params)
},
reimTypeChange (val) {
if (val === 'list') {
this.$router.push({
path: '/task'
})
} else {
this.$router.push({
path: '/group'
})
}
},
timeSearchForm (search) {
let params = this.setParams({
...this.form,
page: this.pagenation.thispage
}, search)
this.getList(params)
},
searchKeyword (search) {
let params = this.setParams({
...this.form,
page: this.pagenation.thispage
}, search)
this.getList(params)
},
updateForm (search) {
let params = this.setParams({
...this.form,
page: this.pagenation.thispage
}, search)
this.getList(params)
},
updatePage (pager) {
let ret = this.setParams({
...this.form,
page: this.pagenation.thispage
}, {page: pager.thispage})
this.getList(ret)
},
getFilter () {
requestAPI(api.getTaskFilter).then(res => {
this.filter = res
})
},
leaveMessageSch (item) {
this.$refs.leaveMessage.btnShow(item)
},
lmClose () {
this.$refs.leaveMessage &&
this.$refs.leaveMessage.btnClose()
},
scheduleClose () {
this.$refs.taskGroupModal &&
this.$refs.taskGroupModal.handleClose()
},
addSch () {
this.$refs.taskGroupModal.show()
},
editSch (item) {
this.$refs.taskGroupModal.show(item)
},
deleteSch (id) {
this.$confirm('删除该待办事项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestAPI(api.deleteReim, { id })
.then((res) => {
this._reload()
this.$message.success('删除成功')
})
}).catch(() => {
this.$message.info('取消删除')
})
},
getList (params) {
requestAPI(api.getTaskGroupList, params).then((res) => {
const {
list = [],
pagenation = {}
} = res
this.result.list = list
this.result.pagenation = pagenation
})
}
}
}
</script>
<style scoped lang="scss">
@include c('opearate-button') {
> .el-button {
margin-right:0px;
}
& .btn-primary .badge {
color: #333744;
background-color: #fff;
}
& .badge {
position: relative;
top: 0px;
left: -5px;
display: inline-block;
padding: 0px 5px;
font-size: 12px;
font-weight: 700;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25rem;
background: white;
color: black;
}
i {
display: inline-block;
padding-right: 3px;
}
}
</style>
<template>
<section class="obear-schedule-item">
<el-row class="obear-schedule-row">
<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.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">剩余时间 {{ item.remain_time }}</span>
</div>
<div>
<span class="obear-app-frame__white">剩余任务: {{ item.remainCount.remain }}</span>
</div>
</div>
</el-col>
<el-col :span="24">
<span class="obear-app-frame__white">情况说明</span><span>{{ item.description }}</span>
</el-col>
</el-row>
</el-col>
<el-col :span="16" :xs="24" class="obear-schedule-right">
<el-row :gutter="10">
<el-col :span="6" :xs="24">
<span>负责人:</span>
<span>
<!-- <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.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>
</el-col>
<el-col :span="6" :xs="24">
<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="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">
</el-col>
<el-col :span="6" :xs="24">
</el-col>
<el-col :span="6" :xs="24">
<slot name="opearate">
</slot>
</el-col>
</el-row>
</el-col>
</el-row>
</section>
</template>
<script>
export default {
name: 'taskItem',
props: {
item: Object
},
data () {
return {
}
},
computed: {
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang="scss">
.colRed {
color: red;
border: 1px solid red;
}
.colGreen {
color: green;
border: 1px solid green;
}
.colWhite {
color: white;
}
.collightBlue {
color: #649FD7;
}
.colBlue {
color: #0056b3;
}
.rounded-circle {
border-radius: 50% !important;
}
.user-avatar {
width: 16px;
max-width: 16px;
height: 16px;
max-height: 16px;
}
@include c('group-left') {
@include e('second') {
display:flex;
justify-content:space-between;
}
}
@include c('schedule-item') {
margin-bottom: 10px;
font-size: 12px;
}
@include c('schedule-item:first-child') {
.obear-schedule-left {
border-radius: 5px 0 0 0;
}
}
@include c('schedule-row') {
// min-height:100px;
background-color:white;
display: flex;
flex-wrap: wrap;
}
@include c('schedule-left') {
background-color: #EB7567;
color: white;
min-height: 100%;
padding: 10px 15px 6px;
> .el-row {
> .el-col {
margin-bottom: 4px;
}
}
.el-row div:first-child, .el-row div:first-child a{
color: white;
}
span {
display: inline-block;
// padding-left: 5px;
}
i {
display:inline-block;
padding-right:5px;
}
img {
display:inline-block;
margin-right:3px;
}
@include e('private') {
display: inline-block;
padding-left: 5px;
border-radius:5px;
border: 1px solid white;
width:35px;
height:17px;
}
}
@include c('schedule-right') {
height:100%;
padding: 10px 15px 6px;
> .el-row {
> .el-col {
margin-bottom: 4px;
.el-button {
margin: 0 2px;
padding: 7px;
}
.date-time {
color: #649FD7;
}
}
}
.badge {
border-radius: 2px;
color: #333744;
background: #ffffff;
vertical-align: baseline;
display: inline;
padding: 2px 6px;
}
span.badge-unread {
&:hover {
border-color: #de321d
}
color: #fff;
background-color: #e54c3a;
border-color: #a32516
}y: flex;
@include e('item') {
display: flex;
flex-direction: column;
justify-content: space-around;
padding: 5px 0 5px 5px;
flex:1;
}
@include e('status') {
color: red;
}
@include e('content') {
display: inline-block;
border: 1px solid #dc3545;
border-radius:2px;
padding: 0 2px 0 2px;
color: #dc3545;
}
}
</style>
<template>
<section class="pull-right">
<el-pagination v-if="total > 0" class="mb20 mt20"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pager.thispage"
:page-sizes="[10, 20, 40, 60, 80, 100]"
:page-size="pager.pagesize"
layout="total, prev, pager, next, jumper"
:total="total">
</el-pagination>
</section>
</template>
<script>
export default {
props: {
total: {
type: Number,
default: 0
}
},
data () {
return {
pager: {
thispage: 1,
pagesize: 20,
totalcount: 0
}
}
},
created () {
this.$emit('update:pager', this.pager)
},
methods: {
handleSizeChange (val) {
this.pager.thispage = 1
this.pager.pagesize = val
this.pager.totalcount = this.total
this.$emit('update:pager', this.pager)
},
handleCurrentChange (val) {
this.pager.thispage = val
this.pager.totalcount = this.total
this.$emit('update:pager', this.pager)
}
}
}
</script>
<style scoped>
</style>
<template>
<section>
<div class="content">
<search-header
ref="searchHeader"
:title="'项目清单'"
:search-key="'ClientSearch'"
:add-title="'新建项目清单'"
@update:headerSearch="search => searchKeyword(search)"
@update:headerAdd="() => addSch()">
</search-header>
<search-form
ref="clientForm"
:filter="filter"
@update:clientList="form =>{ updateForm(form) }">
</search-form>
<div class="page-body-content">
<div class="mb10">
<singleRadioTool
:form-item="taskType"
:options-list="navArray"
@update:item="val => { reimTypeChange(val) }">
</singleRadioTool>
</div>
<TaskItem
v-for="item in result.list"
:item="item"
: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="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>
</TaskItem>
<Pagenation
@update:pager="pager => {updatePage(pager)}"
:total="result.pagenation.totalcount">
</Pagenation>
<leave-message
v-click-outside="lmClose"
ref="leaveMessage"
:lmTemplate="lmTemplate"
:type="20">
</leave-message>
</div>
</div>
<TaskModal
ref="taskModal">
<!-- v-click-outside="scheduleClose" -->
</TaskModal>
</section>
</template>
<script>
import SearchHeader from '../common/searchHeader'
import SearchForm from '../common/SearchForm'
import TaskItem from './taskItem'
import TaskModal from '../task/taskModal'
import Pagenation from './taskPagenation'
import clickOutside from '@/lib/bind'
import singleRadioTool from '../common/singleRadioTool'
import SetParams from '../common/setParams'
import {
requestAPI,
api
} from '@/lib/commonMixin'
export default {
name: 'taskHome',
mixins: [SetParams],
components: {
SearchHeader,
SearchForm,
TaskItem,
TaskModal,
Pagenation,
singleRadioTool
},
directives: {
clickOutside
},
data () {
return {
lmTemplate: [
{
name: '报销类型',
value: 'type.name',
default: ''
},
{
name: '费用金额',
value: 'amount'
},
{
name: '报销状态',
value: 'status_display'
},
{
name: '发生时间',
value: 'occurrence_at'
},
{
name: '费用说明',
value: 'description'
},
{
name: '费用类型',
value: 'costType.name'
},
{
name: '录入人',
value: 'createdBy.name'
}
],
filter: [],
taskType: 'list',
navArray: [{
'key': 'list',
'name': '项目清单'
}, {
'key': 'group_list',
'name': '项目列表'
}],
form: {
'ClientSearch[keyword]': ''
},
pagenation: {
thispage: 1,
pagesize: 10
},
result: {
list: [],
countArr: [],
navCount: [],
pagenation: {
totalcount: 1,
thispage: 1,
pagesize: 10
},
thisUser: {
id: '',
name: '',
sex: ''
}
}
}
},
mounted () {
this.init()
},
methods: {
init () {
this.getFilter()
},
_reload () {
let params = this.setParams({
...this.form,
page: this.pagenation.thispage
}, {})
this.getList(params)
},
reimTypeChange (val) {
if (val === 'list') {
this.$router.push({
path: '/task'
})
} else {
this.$router.push({
path: '/group'
})
}
},
timeSearchForm (search) {
let params = this.setParams({
...this.form,
page: this.pagenation.thispage
}, search)
this.getList(params)
},
searchKeyword (search) {
let params = this.setParams({
...this.form,
page: this.pagenation.thispage
}, search)
this.getList(params)
},
updateForm (search) {
let params = this.setParams({
...this.form,
page: this.pagenation.thispage
}, search)
this.getList(params)
},
updatePage (pager) {
let ret = this.setParams({
...this.form,
page: this.pagenation.thispage
}, {page: pager.thispage})
this.getList(ret)
},
getFilter () {
requestAPI(api.getTaskFilter).then(res => {
this.filter = res
})
},
leaveMessageSch (item) {
this.$refs.leaveMessage.btnShow(item)
},
lmClose () {
this.$refs.leaveMessage &&
this.$refs.leaveMessage.btnClose()
},
scheduleClose () {
this.$refs.taskModal &&
this.$refs.taskModal.handleClose()
},
addSch () {
this.$refs.taskModal.show()
},
editSch (item) {
this.$refs.taskModal.show(item)
},
deleteSch (id) {
this.$confirm('删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestAPI(api.deleteTask, { id })
.then((res) => {
this._reload()
this.$message.success('删除成功')
})
}).catch(() => {
this.$message.info('取消删除')
})
},
getList (params) {
requestAPI(api.getTaskList, params).then((res) => {
const {
list = [],
pagenation = {}
} = res
this.result.list = list
this.result.pagenation = pagenation
})
}
}
}
</script>
<style scoped lang="scss">
@include c('opearate-button') {
> .el-button {
margin-right:0px;
}
& .btn-primary .badge {
color: #333744;
background-color: #fff;
}
& .badge {
position: relative;
top: 0px;
left: -5px;
display: inline-block;
padding: 0px 5px;
font-size: 12px;
font-weight: 700;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
border-radius: .25rem;
background: white;
color: black;
}
i {
display: inline-block;
padding-right: 3px;
}
}
</style>
<template>
<section class="obear-schedule-item">
<el-row class="obear-schedule-row">
<el-col :span="8" :xs="24" class="obear-schedule-left" :style="{background: item.bgcolor}">
<el-row :gutter="10">
<el-col :span="24">
<el-checkbox v-model="checked">
<span class="obear-schedule-left__checkbox">普通</span>
</el-checkbox>
<span>{{ item.title }}</span>
</el-col>
<el-col :span="24">
<span class="obear-app-frame__white">剩余时间 {{ item. remain_time }}</span>
</el-col>
</el-row>
</el-col>
<el-col :span="16" :xs="24" class="obear-schedule-right">
<el-row :gutter="10">
<el-col :span="6" :xs="24">
<span>负责人:</span>
<span>
<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.taskGroup.name }}</span>
</el-col>
<el-col :span="6" :xs="24">
<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>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="6" :xs="24">
<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.target_completed_at }}</span>
</el-col>
<el-col :span="6" :xs="24">
</el-col>
<el-col :span="6" :xs="24">
<slot name="opearate">
</slot>
</el-col>
</el-row>
</el-col>
</el-row>
</section>
</template>
<script>
export default {
name: 'taskItem',
props: {
item: Object
},
data () {
return {
checked: ''
}
},
computed: {
},
mounted () {
},
methods: {
},
watch: {
checked (val) {
console.log(val)
}
}
}
</script>
<style scoped lang="scss">
$lightBlue: #20a0ff;
$lightRed: #dc3545;
.colRed {
color: red;
border: 1px solid red;
}
.colGreen {
color: green;
border: 1px solid green;
}
.colWhite {
color: white;
}
.collightBlue {
color: #649FD7;
}
.colBlue {
color: #0056b3;
}
.rounded-circle {
border-radius: 50% !important;
}
.user-avatar {
width: 16px;
max-width: 16px;
height: 16px;
max-height: 16px;
}
@include c('schedule-item') {
margin-bottom: 10px;
font-size: 12px;
}
@include c('schedule-item:first-child') {
.obear-schedule-left {
border-radius: 5px 0 0 0;
}
}
@include c('schedule-row') {
// min-height:100px;
background-color:white;
display: flex;
flex-wrap: wrap;
}
@include c('schedule-left') {
background-color: #EB7567;
color: white;
min-height: 100%;
padding: 10px 15px 6px;
> .el-row {
> .el-col {
margin-bottom: 4px;
}
}
.el-row div:first-child, .el-row div:first-child a{
color: white;
}
@include e('checkbox') {
display:block;
font-size: 12px;
background:white;
border-radius:2px;
color: $lightBlue;
padding: 0 2px 0 2px;
}
.el-checkbox {
margin-right: 10px;
}
span {
// display: inline-block;
// padding-left: 5px;
}
i {
display:inline-block;
padding-right:5px;
}
img {
display:inline-block;
margin-right:3px;
}
@include e('private') {
display: inline-block;
padding-left: 5px;
border-radius:5px;
border: 1px solid white;
width:35px;
height:17px;
}
}
@include c('schedule-right') {
height:100%;
padding: 10px 15px 6px;
> .el-row {
> .el-col {
margin-bottom: 4px;
.el-button {
margin: 0 2px;
padding: 7px;
}
.date-time {
color: #649FD7;
}
}
}
.badge {
border-radius: 2px;
color: #333744;
background: #ffffff;
vertical-align: baseline;
display: inline;
padding: 2px 6px;
}
span.badge-unread {
&:hover {
border-color: #de321d
}
color: #fff;
background-color: #e54c3a;
border-color: #a32516
}y: flex;
@include e('item') {
display: flex;
flex-direction: column;
justify-content: space-around;
padding: 5px 0 5px 5px;
flex:1;
}
@include e('status') {
color: red;
}
@include e('content') {
display: inline-block;
border: 1px solid $lightRed;
border-radius:2px;
// height:20px;
padding: 0 2px 0 2px;
color: $lightRed;
}
}
</style>
<template>
<section class="pull-right">
<el-pagination v-if="total > 0" class="mb20 mt20"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pager.thispage"
:page-sizes="[10, 20, 40, 60, 80, 100]"
:page-size="pager.pagesize"
layout="total, prev, pager, next, jumper"
:total="total">
</el-pagination>
</section>
</template>
<script>
export default {
props: {
total: {
type: Number,
default: 0
}
},
data () {
return {
pager: {
thispage: 1,
pagesize: 20,
totalcount: 0
}
}
},
created () {
this.$emit('update:pager', this.pager)
},
methods: {
handleSizeChange (val) {
this.pager.thispage = 1
this.pager.pagesize = val
this.pager.totalcount = this.total
this.$emit('update:pager', this.pager)
},
handleCurrentChange (val) {
this.pager.thispage = val
this.pager.totalcount = this.total
this.$emit('update:pager', this.pager)
}
}
}
</script>
<style scoped>
</style>
import TaskHome from '../components/task_list/taskHome'
import GroupHome from '../components/task_group_list/groupHome'
const routes = [{
path: '/task',
name: 'taskHome',
component: TaskHome
}, {
path: '/group',
name: 'groupHome',
component: GroupHome
}]
export default routes
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