Commit 62bbb809 authored by daywrite's avatar daywrite

添加费用报销列表

parent 2f999c92
......@@ -25,10 +25,16 @@
"title": "首页",
"appName": portalName,
"url": "/scheduleHome"
}, {
"icon": "fa-home",
"isRouteShow": 1,
"title": "费用报销",
"appName": 'reimbursement',
"url": "/reimbursementHome"
}],
homePage: {
appName: portalName,
url: '/scheduleHome'
appName: 'reimbursement',
url: '/reimbursementHome'
}
}
......
import ScheduleApi from './apis/schedule.js'
import ReimburrsementApi from './apis/reimbursement.js'
const API_HOST = process.env.API_HOST
const API_PORT = process.env.API_PORT
......@@ -24,6 +25,7 @@ const option = {
let apis = {}
apis = Object.assign(apis, ScheduleApi)
apis = Object.assign(apis, ReimburrsementApi)
export default {
option,
......
export default {
getReimburrsementFilter: {
url: '/vue/reimbursement/get-filter'
}
}
......@@ -25,3 +25,26 @@
border-color: #888!important;
}
}
.reimbursement-app {
.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: 1px;
}
.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>
<el-radio-group size="mini" v-model="item">
<el-radio-button v-for="(radio, key) in optionsList" :key="key" :label="radio.name" :value="radio.value">{{ radio.value }}</el-radio-button>
</el-radio-group>
</section>
</template>
<script>
import singleItemMixin from './singleItemMixin'
export default {
name: 'single-radio',
mixins: [singleItemMixin]
}
</script>
<style scoped>
</style>
<template>
<el-button type="primary">弹出</el-button>
<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 leaveMessage">
<div class="mb20">
<singleRadioTool
:form-item="reimType"
:options-list="reimTypeArray"
@update:item="val => {reimType = val}">
</singleRadioTool>
</div>
<ScheduleItem
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.unread">{{ item.unread ? item.unread : '' }}</span><i class="fa fa-commenting"></i>留言</el-button>
<el-button type="primary" size="mini" @click.prevent.stop="editSch(item)" :disabled="!item.can_report"><i class="fa fa-calendar-check-o"></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>
</ScheduleItem>
<Pagenation
@update:pager="pager => {updatePage(pager)}"
:total="result.pagenation.totalcount">
</Pagenation>
<leave-message
v-click-outside="lmClose"
ref="leaveMessage"
:lmTemplate="lmTemplate"
:type="9">
</leave-message>
</div>
</div>
<ScheduleModal
ref="scheduleModal"
v-click-outside="scheduleClose">
</ScheduleModal>
</section>
</template>
<script>
import SearchHeader from '../common/searchHeader'
import SearchForm from '../common/SearchForm'
import ScheduleItem from '../common/scheduleItem'
import ScheduleModal from '../schedule/scheduleModal'
import LeaveMessage from '../common/leaveMessage'
import Pagenation from './reimbursementPagenation'
import clickOutside from '@/lib/bind'
import singleRadioTool from '../common/singleRadioTool'
import {
requestAPI,
api
} from '@/lib/commonMixin'
export default {
name: 'reimbursement'
name: '',
components: {
SearchHeader,
SearchForm,
ScheduleItem,
ScheduleModal,
LeaveMessage,
Pagenation,
singleRadioTool
},
directives: {
clickOutside
},
data () {
return {
lmTemplate: [
{
name: '客户名称',
value: 'client.name',
default: '未设置'
},
{
name: '内容',
value: 'description'
},
{
name: '待办时间',
value: 'schedule_week_display'
},
{
name: '状态',
value: 'schedule_status_display'
},
{
name: '开始时间',
value: 'start_at'
},
{
name: '结束时间',
value: 'end_at'
},
{
name: '重复',
value: 'repeatSchedule'
},
{
name: '负责人',
value: 'repeatSchedule'
},
{
name: '创建时间',
value: 'created_at'
}
],
filter: [],
form: {
'ClientSearch[keyword]': ''
},
reimType: '',
reimTypeArray: [
{
'name': 0,
'value': '报销单'
},
{
'name': 1,
'value': '我审核的'
},
{
'name': 2,
'value': '抄送我的'
},
{
'name': 3,
'value': '我结算的'
}
],
pagenation: {
thispage: 1,
pagesize: 10
},
result: {
list: [],
pagenation: {
totalcount: 1,
thispage: 1,
pagesize: 10
},
thisUser: {
id: '',
name: '',
sex: ''
}
}
}
},
mounted () {
this.init()
},
methods: {
init () {
this.getFilter()
this.getScheduleList()
},
searchKeyword (search) {
this.updateForm(search)
},
updateForm (search) {
Object.assign(this.form, search)
this.getScheduleList()
},
updatePage (pager) {
Object.assign(this.pagenation, pager)
this.getScheduleList()
},
getFilter () {
requestAPI(api.getReimburrsementFilter).then(res => {
this.filter = res
})
},
leaveMessageSch (item) {
this.$refs.leaveMessage.isShow(item)
},
lmClose () {
this.$refs.leaveMessage &&
this.$refs.leaveMessage.isClose()
},
scheduleClose () {
this.$refs.scheduleModal &&
this.$refs.scheduleModal.handleClose()
},
addSch () {
this.$refs.scheduleModal.show()
},
editSch (item) {
this.$refs.scheduleModal.show(item)
},
deleteSch (id) {
this.$confirm('删除该待办事项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestAPI(api.deleteSchedule, { id })
.then((res) => {
this.$message.success('删除成功')
})
}).catch(() => {
this.$message.info('取消删除')
})
},
getScheduleList () {
requestAPI(api.getScheduleList, {
...this.form,
page: this.pagenation.thispage
}).then((res) => {
const {
list = [],
pagenation = {},
thisUser = {}
} = res
this.result.list = list
this.result.pagenation = pagenation
this.result.thisUser = thisUser
})
}
}
}
</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;
}
i {
display: inline-block;
padding-right: 3px;
}
}
</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 portal from 'vis-portal'
import ScheduleRoute from './routes/schedule'
import ReimbursementRoute from './routes/reimbursement'
let routes = []
let reimRoutes = []
const appName = 'schedule'
routes = [].concat(ScheduleRoute)
reimRoutes = [].concat(ReimbursementRoute)
let RouterInit = () => {
portal.createApp(appName, {}, app => {
app.mapRoute(routes)
})
portal.createApp('reimbursement', {}, app => {
app.mapRoute(reimRoutes)
})
// portal.createApp('client', {}, app => {
// app.mapRoute([
// {
......
import ReimbursementHome from '../components/reimbursement_list/reimbursementHome'
const routes = [{
path: '/reimbursementHome',
name: 'reimbursementHome',
component: ReimbursementHome
}]
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