Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 15th, 2017 68 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <template>
  2.     <div>
  3.         <List
  4.             ref="list"
  5.             :data="data"
  6.             :columns="columns"
  7.             :actions="actions"
  8.             :global-actions="gactions"
  9.             :filters="filters"
  10.             @update="update"
  11.             @repeal="repeal"
  12.             @apply="$router.push({name: 'BusinessTripApply'})"
  13.             @detail="detail"
  14.             @cancel="cancel"
  15.         >
  16.             <DateRange slot="filter-申请日期" slot-scope="{set, search}" class="col-11" @input="val=>(set({VacationStartTime:val.startDate, VacationEndTime: val.endDate}),search())"></DateRange>
  17.             <StatusPicker slot="filter-流程状态" slot-scope="{set, search}" class="grow" @input="val=>(set(val),search())"></StatusPicker>
  18.             <TypePicker slot="filter-出差类型" slot-scope="{value, set, search}" multiple name="TravalType" :value="value" @input="val=>(set(val), search())"></TypePicker>
  19.         </List>
  20.     </div>
  21. </template>
  22. <script>
  23. import List from '@/components/List/List'
  24. import DateRange from '@/components/List/DateRange'
  25. import StatusPicker from '@/components/List/StatusPicker'
  26. import TypePicker from '@/components/Form/TypePicker'
  27. import Common  from './Common'
  28. export default {
  29.     name: 'BusinessList',
  30.         components: { List, DateRange, StatusPicker, TypePicker },
  31.         mixins: [Common],
  32.     data() {
  33.             return {
  34.         // 面包屑导航
  35.         crumbs: [{
  36.             name: '考勤'
  37.         },{
  38.             name: '请假列表'
  39.         }],
  40.         // 列表配置
  41.         data: null,
  42.         columns: {
  43.           '表单号': 'FormNo',
  44.           '申请时间': ['FApplyTime', {
  45.             sortable: true,
  46.             datetime: true
  47.           }],
  48.           '出差时间': ['FVacationStartTime', {
  49.             datetime: true,
  50.           }],
  51.           '出差时数': 'FTotalHours',
  52.           '出差类型': ['FBussinessTravalType', {
  53.               type: 'TravalType'
  54.           }],
  55.           '流程': ['FormStatus', {
  56.               type: 'FormStatus'
  57.           }]
  58.         },
  59.         actions: {
  60.           '详情': 'detail',
  61.           '撤回': ['repeal', {
  62.             scene: 'warn',
  63.             confirm: '确定要撤回吗?',
  64.             condition: this.repealCondition
  65.           }],
  66.           '销差': ['cancel', {
  67.             condition: this.cancelCondition
  68.           }]
  69.          
  70.         },
  71.         gactions: {
  72.           '申请': 'apply'
  73.         },
  74.         filters: {
  75.           '申请日期': 'VacationStartTime,VacationEndTime',
  76.           '流程状态': ['FormStatus', {
  77.               col: 0
  78.           }]
  79.         }
  80.         }
  81.         },
  82.     methods: {
  83.         detail(item) {
  84.             this.$router.push({
  85.                 name: 'BusinessTripDetail',
  86.                 query: {
  87.                   FormID: item.FormID
  88.                 }
  89.             })
  90.         },
  91.         update({filters, page}) {
  92.             this.data = this.$get('/Attendance/Vacation/GetApplyVacationList', {
  93.                 PageSize: page.size,
  94.                 PageIndex: page.index,
  95.                 VacationType: 12,
  96.                 ...filters
  97.             }).then(res=>({
  98.                 list: res.ReturnValue,
  99.                 total: res.Total
  100.             }))
  101.         }
  102.     }
  103. }
  104. </script>
  105. <style scoped>
  106. .d-cur {
  107.     background: rgba(0, 0, 0, 0.05);
  108. }
  109. </style>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top