| 
				
			 | 
			
			
				@@ -0,0 +1,145 @@ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1
			 | 
			
			
				+<template> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				2
			 | 
			
			
				+<div class="app-container calendar-list-container"> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3
			 | 
			
			
				+  <div class="app-container" v-show="visible.firstLayer"> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				4
			 | 
			
			
				+    <div class="app-container"> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				5
			 | 
			
			
				+      <el-date-picker 
			 | 
		
	
		
			
			| 
				
			 | 
			
				6
			 | 
			
			
				+        v-model="date" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7
			 | 
			
			
				+        type="datetimerange" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				8
			 | 
			
			
				+        :picker-options="pickerOptions" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				9
			 | 
			
			
				+        range-separator="至" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				10
			 | 
			
			
				+        start-placeholder="開始日期" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				11
			 | 
			
			
				+        end-placeholder="结束日期" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				12
			 | 
			
			
				+        align="right"> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				13
			 | 
			
			
				+      </el-date-picker> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				14
			 | 
			
			
				+      <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">搜尋</el-button> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				15
			 | 
			
			
				+    </div> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				16
			 | 
			
			
				+    <el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row 
			 | 
		
	
		
			
			| 
				
			 | 
			
				17
			 | 
			
			
				+      style="width: 100%"> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				18
			 | 
			
			
				+      <el-table-column label="工作室上繳金額" align="center"> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				19
			 | 
			
			
				+        <template slot-scope="scope"> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				20
			 | 
			
			
				+          <span>{{scope.row.all}}</span> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				21
			 | 
			
			
				+        </template> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				22
			 | 
			
			
				+      </el-table-column> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				23
			 | 
			
			
				+      <el-table-column align="center" label="工作室實收維護費" > 
			 | 
		
	
		
			
			| 
				
			 | 
			
				24
			 | 
			
			
				+        <template slot-scope="scope"> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				25
			 | 
			
			
				+          <span>{{scope.row.maintenanceFee}}</span> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				26
			 | 
			
			
				+        </template> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				27
			 | 
			
			
				+      </el-table-column> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				28
			 | 
			
			
				+    </el-table> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				29
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				30
			 | 
			
			
				+  </div> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				31
			 | 
			
			
				+  <router-view :bucket="bucket"></router-view> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				32
			 | 
			
			
				+</div> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				33
			 | 
			
			
				+</template> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				34
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				35
			 | 
			
			
				+<script> 
			 | 
		
	
		
			
			| 
				
			 | 
			
				36
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				37
			 | 
			
			
				+import { mapGetters, mapActions } from 'vuex' 
			 | 
		
	
		
			
			| 
				
			 | 
			
				38
			 | 
			
			
				+import { fetchStudiosDetail } from '@/api/studio' 
			 | 
		
	
		
			
			| 
				
			 | 
			
				39
			 | 
			
			
				+import waves from '@/directive/waves' // 水波纹指令 
			 | 
		
	
		
			
			| 
				
			 | 
			
				40
			 | 
			
			
				+import moment from 'moment-timezone' 
			 | 
		
	
		
			
			| 
				
			 | 
			
				41
			 | 
			
			
				+import { Decimal } from 'decimal.js'; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				42
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				43
			 | 
			
			
				+export default { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				44
			 | 
			
			
				+  directives: { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				45
			 | 
			
			
				+    waves 
			 | 
		
	
		
			
			| 
				
			 | 
			
				46
			 | 
			
			
				+  }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				47
			 | 
			
			
				+  data() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				48
			 | 
			
			
				+    return { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				49
			 | 
			
			
				+      list: [], 
			 | 
		
	
		
			
			| 
				
			 | 
			
				50
			 | 
			
			
				+      listLoading: true, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				51
			 | 
			
			
				+      bucket: '', 
			 | 
		
	
		
			
			| 
				
			 | 
			
				52
			 | 
			
			
				+      listQuery: { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				53
			 | 
			
			
				+        // startAt: moment().subtract(1, 'weeks').day(7).hour(16).minute(0).second(0), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				54
			 | 
			
			
				+        // endAt: moment().day(7).hour(11).minute(59).second(59) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				55
			 | 
			
			
				+      }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				56
			 | 
			
			
				+      temp: {}, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				57
			 | 
			
			
				+      pickerOptions: { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				58
			 | 
			
			
				+        shortcuts: [{ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				59
			 | 
			
			
				+          text: '本週', 
			 | 
		
	
		
			
			| 
				
			 | 
			
				60
			 | 
			
			
				+          onClick(picker) { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				61
			 | 
			
			
				+            const end = moment().day(7).hour(11).minute(59).second(59) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				62
			 | 
			
			
				+            const start = moment().subtract(1, 'weeks').day(7).hour(16).minute(0).second(0) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				63
			 | 
			
			
				+            picker.$emit('pick', [start, end]) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				64
			 | 
			
			
				+          } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				65
			 | 
			
			
				+        }, { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				66
			 | 
			
			
				+          text: '上週', 
			 | 
		
	
		
			
			| 
				
			 | 
			
				67
			 | 
			
			
				+          onClick(picker) { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				68
			 | 
			
			
				+            const end = moment().subtract(1, 'weeks').day(7).hour(11).minute(59).second(59) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				69
			 | 
			
			
				+            const start = moment().subtract(2, 'weeks').day(7).hour(16).minute(0).second(0) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				70
			 | 
			
			
				+            picker.$emit('pick', [start, end]) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				71
			 | 
			
			
				+          } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				72
			 | 
			
			
				+        }] 
			 | 
		
	
		
			
			| 
				
			 | 
			
				73
			 | 
			
			
				+      }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				74
			 | 
			
			
				+      date: null 
			 | 
		
	
		
			
			| 
				
			 | 
			
				75
			 | 
			
			
				+    } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				76
			 | 
			
			
				+  }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				77
			 | 
			
			
				+  created() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				78
			 | 
			
			
				+    this.getList() 
			 | 
		
	
		
			
			| 
				
			 | 
			
				79
			 | 
			
			
				+    this.SetVisible(1) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				80
			 | 
			
			
				+  }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				81
			 | 
			
			
				+  computed: { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				82
			 | 
			
			
				+    ...mapGetters([ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				83
			 | 
			
			
				+      'visible' 
			 | 
		
	
		
			
			| 
				
			 | 
			
				84
			 | 
			
			
				+    ]) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				85
			 | 
			
			
				+  }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				86
			 | 
			
			
				+  methods: { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				87
			 | 
			
			
				+    ...mapActions([ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				88
			 | 
			
			
				+      'SetVisible' 
			 | 
		
	
		
			
			| 
				
			 | 
			
				89
			 | 
			
			
				+    ]), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				90
			 | 
			
			
				+    getList() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				91
			 | 
			
			
				+      this.listLoading = true 
			 | 
		
	
		
			
			| 
				
			 | 
			
				92
			 | 
			
			
				+      fetchStudiosDetail(this.listQuery).then(response => { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				93
			 | 
			
			
				+        console.log('eee', response.data) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				94
			 | 
			
			
				+        let data = { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				95
			 | 
			
			
				+          bookies: {}, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				96
			 | 
			
			
				+          members: {} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				97
			 | 
			
			
				+        } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				98
			 | 
			
			
				+        // console.log('ddd', data) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				99
			 | 
			
			
				+        if(response.data.length !== 0){ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				100
			 | 
			
			
				+          response.data.map((item)=>{ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				101
			 | 
			
			
				+              if(item.isBookie){ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				102
			 | 
			
			
				+                  data.bookies.serviceFees = new Decimal(item.serviceFees) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				103
			 | 
			
			
				+                  data.bookies.count = new Decimal(item.count) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				104
			 | 
			
			
				+              }else{ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				105
			 | 
			
			
				+                  data.members.serviceFees = new Decimal(item.serviceFees) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				106
			 | 
			
			
				+                  data.members.count = new Decimal(item.count) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				107
			 | 
			
			
				+              } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				108
			 | 
			
			
				+          }) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				109
			 | 
			
			
				+          this.list.push({ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				110
			 | 
			
			
				+          all: data.bookies.serviceFees.plus(data.members.serviceFees).minus(data.bookies.count.times(500)).times(0.2).valueOf(), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				111
			 | 
			
			
				+          // all: (data.bookies.serviceFees - (data.bookies.count * 500) + data.members.serviceFees) * 0.2, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				112
			 | 
			
			
				+          maintenanceFee: data.bookies.count.times(500).valueOf() 
			 | 
		
	
		
			
			| 
				
			 | 
			
				113
			 | 
			
			
				+          }) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				114
			 | 
			
			
				+        }else{ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				115
			 | 
			
			
				+          this.list = []; 
			 | 
		
	
		
			
			| 
				
			 | 
			
				116
			 | 
			
			
				+        } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				117
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				118
			 | 
			
			
				+        this.listLoading = false 
			 | 
		
	
		
			
			| 
				
			 | 
			
				119
			 | 
			
			
				+      }) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				120
			 | 
			
			
				+    }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				121
			 | 
			
			
				+    handleFilter() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				122
			 | 
			
			
				+      this.listQuery.page = 1 
			 | 
		
	
		
			
			| 
				
			 | 
			
				123
			 | 
			
			
				+      if (this.date) { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				124
			 | 
			
			
				+        this.listQuery.startAt = moment.utc(this.date[0]).format() 
			 | 
		
	
		
			
			| 
				
			 | 
			
				125
			 | 
			
			
				+        this.listQuery.endAt = moment.utc(this.date[1]).format() 
			 | 
		
	
		
			
			| 
				
			 | 
			
				126
			 | 
			
			
				+      } else { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				127
			 | 
			
			
				+        this.listQuery.startAt = null 
			 | 
		
	
		
			
			| 
				
			 | 
			
				128
			 | 
			
			
				+        this.listQuery.endAt = null 
			 | 
		
	
		
			
			| 
				
			 | 
			
				129
			 | 
			
			
				+      } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				130
			 | 
			
			
				+      this.getList() 
			 | 
		
	
		
			
			| 
				
			 | 
			
				131
			 | 
			
			
				+    }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				132
			 | 
			
			
				+    handleSizeChange(val) { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				133
			 | 
			
			
				+      this.listQuery.limit = val 
			 | 
		
	
		
			
			| 
				
			 | 
			
				134
			 | 
			
			
				+      this.getList() 
			 | 
		
	
		
			
			| 
				
			 | 
			
				135
			 | 
			
			
				+    }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				136
			 | 
			
			
				+    handleCurrentChange(val) { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				137
			 | 
			
			
				+      this.listQuery.page = val 
			 | 
		
	
		
			
			| 
				
			 | 
			
				138
			 | 
			
			
				+      this.getList() 
			 | 
		
	
		
			
			| 
				
			 | 
			
				139
			 | 
			
			
				+    }, 
			 | 
		
	
		
			
			| 
				
			 | 
			
				140
			 | 
			
			
				+    moment(time) { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				141
			 | 
			
			
				+      return moment(time).tz('Asia/Taipei').format('YYYY-MM-DD HH:mm:ss') 
			 | 
		
	
		
			
			| 
				
			 | 
			
				142
			 | 
			
			
				+    } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				143
			 | 
			
			
				+  } 
			 | 
		
	
		
			
			| 
				
			 | 
			
				144
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				145
			 | 
			
			
				+</script> 
			 |