|
|
@@ -103,177 +103,198 @@
|
|
|
<div class="white-box-footer">
|
|
|
<pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
|
|
|
</div>
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" size="small" @click="doAutoWithdraw()">
|
|
|
+ 批量提现
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import Vue from 'vue'
|
|
|
- import {BONUS_WEBSOCKET_HOST} from '@/utils/config'
|
|
|
- import userInfo from '@/utils/userInfo'
|
|
|
- import network from './../../utils/network'
|
|
|
- import tool from './../../utils/tool'
|
|
|
- import store from '@/utils/vuexStore'
|
|
|
- import FilterUser from '@/components/FilterUser'
|
|
|
- import permission from '@/utils/permission'
|
|
|
- import Pagination from '@/components/Pagination'
|
|
|
- import filterHelper from '../../utils/filterHelper'
|
|
|
+import Vue from 'vue'
|
|
|
+import {BONUS_WEBSOCKET_HOST} from '@/utils/config'
|
|
|
+import userInfo from '@/utils/userInfo'
|
|
|
+import network from './../../utils/network'
|
|
|
+import tool from './../../utils/tool'
|
|
|
+import store from '@/utils/vuexStore'
|
|
|
+import FilterUser from '@/components/FilterUser'
|
|
|
+import permission from '@/utils/permission'
|
|
|
+import Pagination from '@/components/Pagination'
|
|
|
+import filterHelper from '../../utils/filterHelper'
|
|
|
|
|
|
- export default {
|
|
|
- name: 'bonus-period',
|
|
|
- components: {FilterUser,Pagination},
|
|
|
- created() {
|
|
|
- let wsServer = BONUS_WEBSOCKET_HOST
|
|
|
- let webSocket = new WebSocket(wsServer)
|
|
|
- webSocket.onopen = function (evt) {
|
|
|
- let userId = userInfo.userId()
|
|
|
- let sendData = {app: 'admin', userId: userId}
|
|
|
- webSocket.send(JSON.stringify(sendData))
|
|
|
+export default {
|
|
|
+ name: 'bonus-period',
|
|
|
+ components: {FilterUser, Pagination},
|
|
|
+ created () {
|
|
|
+ let wsServer = BONUS_WEBSOCKET_HOST
|
|
|
+ let webSocket = new WebSocket(wsServer)
|
|
|
+ webSocket.onopen = function (evt) {
|
|
|
+ let userId = userInfo.userId()
|
|
|
+ let sendData = {app: 'admin', userId: userId}
|
|
|
+ webSocket.send(JSON.stringify(sendData))
|
|
|
+ }
|
|
|
+ webSocket.onmessage = (env) => {
|
|
|
+ let data = JSON.parse(env.data)
|
|
|
+ if (data.handle === 'adminAsyncPercent') {
|
|
|
+ this.onMessageCallback(data)
|
|
|
}
|
|
|
- webSocket.onmessage = (env) => {
|
|
|
- let data = JSON.parse(env.data)
|
|
|
- if (data.handle === 'adminAsyncPercent') {
|
|
|
- this.onMessageCallback(data)
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ this.getData(this.currentPage, this.pageSize)
|
|
|
+ store.state.socket.onMessageCallback = this.onMessageCallback
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ tableData: null,
|
|
|
+ loading: true,
|
|
|
+ multipleSelection: [],
|
|
|
+ currentPage: 1,
|
|
|
+ totalPages: 1,
|
|
|
+ totalCount: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ tool: tool,
|
|
|
+ permission: permission,
|
|
|
+ filterTypes: {
|
|
|
+ 'periodNum': {isUserTable: false, name: 'Number of periods'}, // 期数
|
|
|
+ 'year': {isUserTable: false, name: 'Bonus Year'}, // 所在结算年
|
|
|
+ 'month': {isUserTable: false, name: 'Bonus Month'}, // 所在结算月
|
|
|
+ 'startTime': {isUserTable: false, name: 'Period start time', other: 'date'}, // 期数开始时间
|
|
|
+ 'endTime': {isUserTable: false, name: 'Period end time', other: 'date'}, // 期数结束时间
|
|
|
+ 'closedAt': {isUserTable: false, name: 'Closing time', other: 'date'}, // 封期时间
|
|
|
+ 'perfStartedAt': {isUserTable: false, name: 'Start time of generating performance sheet', other: 'date'}, // 生成业绩单开始时间
|
|
|
+ 'perfedAt': {isUserTable: false, name: 'End time of generating performance sheet', other: 'date'}, // 生成业绩单结束时间
|
|
|
+ 'calStartedAt': {isUserTable: false, name: 'Settlement start time', other: 'date'}, // 结算开始时间
|
|
|
+ 'calculatedAt': {isUserTable: false, name: 'Settlement end time', other: 'date'}, // 结算结束时间
|
|
|
+ 'sendStartedAt': {isUserTable: false, name: 'Network connection start time', other: 'date'}, // 挂网开始时间
|
|
|
+ 'sentAt': {isUserTable: false, name: 'End time of network connection', other: 'date'} // 挂网结束时间
|
|
|
+ },
|
|
|
+ filterModel: {},
|
|
|
+ percentList: {
|
|
|
+ 'PERF_PERCENT': {},
|
|
|
+ 'CALC_PERCENT': {},
|
|
|
+ 'SENT_PERCENT': {}
|
|
|
}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ closeHandle (row) {
|
|
|
+ this.$confirm('Confirm to manually seal the current period?', 'Hint', { // '确定对当前期进行手动封期操作?', '提示'
|
|
|
+ confirmButtonText: 'confirm', // 确定
|
|
|
+ cancelButtonText: 'cancel', // 取消
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ return network.getData(`bonus/close-period/${row.PERIOD_NUM}`)
|
|
|
+ }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getData(this.currentPage, this.pageSize)
|
|
|
+ }).catch(response => {
|
|
|
+ })
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.getData(this.currentPage, this.pageSize)
|
|
|
- store.state.socket.onMessageCallback = this.onMessageCallback
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- tableData: null,
|
|
|
- loading: true,
|
|
|
- multipleSelection: [],
|
|
|
- currentPage: 1,
|
|
|
- totalPages: 1,
|
|
|
- totalCount: 1,
|
|
|
- pageSize: 10,
|
|
|
- tool: tool,
|
|
|
- permission: permission,
|
|
|
- filterTypes: {
|
|
|
- 'periodNum': {isUserTable: false, name: 'Number of periods'},//期数
|
|
|
- 'year': {isUserTable: false, name: 'Bonus Year'},//所在结算年
|
|
|
- 'month': {isUserTable: false, name: 'Bonus Month'},//所在结算月
|
|
|
- 'startTime': {isUserTable: false, name: 'Period start time', other: 'date'},//期数开始时间
|
|
|
- 'endTime': {isUserTable: false, name: 'Period end time', other: 'date'},//期数结束时间
|
|
|
- 'closedAt': {isUserTable: false, name: 'Closing time', other: 'date'},//封期时间
|
|
|
- 'perfStartedAt': {isUserTable: false, name: 'Start time of generating performance sheet', other: 'date'},//生成业绩单开始时间
|
|
|
- 'perfedAt': {isUserTable: false, name: 'End time of generating performance sheet', other: 'date'},//生成业绩单结束时间
|
|
|
- 'calStartedAt': {isUserTable: false, name: 'Settlement start time', other: 'date'},//结算开始时间
|
|
|
- 'calculatedAt': {isUserTable: false, name: 'Settlement end time', other: 'date'},//结算结束时间
|
|
|
- 'sendStartedAt': {isUserTable: false, name: 'Network connection start time', other: 'date'},//挂网开始时间
|
|
|
- 'sentAt': {isUserTable: false, name: 'End time of network connection', other: 'date'},//挂网结束时间
|
|
|
- },
|
|
|
- filterModel: {},
|
|
|
- percentList: {
|
|
|
- 'PERF_PERCENT': {},
|
|
|
- 'CALC_PERCENT': {},
|
|
|
- 'SENT_PERCENT': {},
|
|
|
- },
|
|
|
- }
|
|
|
+ calcHandle (row) {
|
|
|
+ this.$confirm('Confirm to perform settlement operation for the current period?', 'Hint', { // '确定对当前期进行结算操作?', '提示'
|
|
|
+ confirmButtonText: 'confirm', // 确定
|
|
|
+ cancelButtonText: 'cancel', // 取消
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ return network.getData(`bonus/calc-period/${row.PERIOD_NUM}`)
|
|
|
+ }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getData(this.currentPage, this.pageSize)
|
|
|
+ }).catch(response => {
|
|
|
+ })
|
|
|
},
|
|
|
- methods: {
|
|
|
- closeHandle(row) {
|
|
|
- this.$confirm('Confirm to manually seal the current period?', 'Hint', {//'确定对当前期进行手动封期操作?', '提示'
|
|
|
- confirmButtonText: 'confirm', // 确定
|
|
|
- cancelButtonText: 'cancel', // 取消
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- return network.getData(`bonus/close-period/${row.PERIOD_NUM}`)
|
|
|
- }).then(response => {
|
|
|
- this.$message({
|
|
|
- message: response,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.getData(this.currentPage, this.pageSize)
|
|
|
- }).catch(response => {
|
|
|
+ perfHandle (row) {
|
|
|
+ this.$confirm('Confirm to generate performance sheet for the current period?', 'Hint', { // '确定对当前期进行生成业绩单操作?', '提示'
|
|
|
+ confirmButtonText: 'confirm', // 确定
|
|
|
+ cancelButtonText: 'cancel', // 取消
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ return network.getData(`bonus/perf-period/${row.PERIOD_NUM}`)
|
|
|
+ }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
})
|
|
|
- },
|
|
|
- calcHandle(row) {
|
|
|
- this.$confirm('Confirm to perform settlement operation for the current period?', 'Hint', {//'确定对当前期进行结算操作?', '提示'
|
|
|
- confirmButtonText: 'confirm', // 确定
|
|
|
- cancelButtonText: 'cancel', // 取消
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- return network.getData(`bonus/calc-period/${row.PERIOD_NUM}`)
|
|
|
- }).then(response => {
|
|
|
- this.$message({
|
|
|
- message: response,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.getData(this.currentPage, this.pageSize)
|
|
|
- }).catch(response => {
|
|
|
+ this.getData(this.currentPage, this.pageSize)
|
|
|
+ }).catch(response => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ sentHandle (row) {
|
|
|
+ this.$confirm('Are you sure to connect the current period? Performance sheet and settlement cannot be generated after network connection', 'Hint', { // '确定对当前期进行挂网操作?挂网后无法生成业绩单和结算', '提示'
|
|
|
+ confirmButtonText: 'confirm', // 确定
|
|
|
+ cancelButtonText: 'cancel', // 取消
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ return network.getData(`bonus/send-period/${row.PERIOD_NUM}`)
|
|
|
+ }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
})
|
|
|
- },
|
|
|
- perfHandle(row) {
|
|
|
- this.$confirm('Confirm to generate performance sheet for the current period?', 'Hint', {//'确定对当前期进行生成业绩单操作?', '提示'
|
|
|
- confirmButtonText: 'confirm', // 确定
|
|
|
- cancelButtonText: 'cancel', // 取消
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- return network.getData(`bonus/perf-period/${row.PERIOD_NUM}`)
|
|
|
- }).then(response => {
|
|
|
- this.$message({
|
|
|
- message: response,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.getData(this.currentPage, this.pageSize)
|
|
|
- }).catch(response => {
|
|
|
+ this.getData(this.currentPage, this.pageSize)
|
|
|
+ }).catch(response => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ doAutoWithdraw () {
|
|
|
+ this.$confirm('全部提现?', 'Hint', {
|
|
|
+ confirmButtonText: 'confirm', // 确定
|
|
|
+ cancelButtonText: 'cancel', // 取消
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ return network.getData(`bonus/auto-withdraw`)
|
|
|
+ }).then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: response,
|
|
|
+ type: 'success'
|
|
|
})
|
|
|
- },
|
|
|
- sentHandle(row) {
|
|
|
- this.$confirm('Are you sure to connect the current period? Performance sheet and settlement cannot be generated after network connection', 'Hint', {//'确定对当前期进行挂网操作?挂网后无法生成业绩单和结算', '提示'
|
|
|
- confirmButtonText: 'confirm', // 确定
|
|
|
- cancelButtonText: 'cancel', // 取消
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- return network.getData(`bonus/send-period/${row.PERIOD_NUM}`)
|
|
|
- }).then(response => {
|
|
|
- this.$message({
|
|
|
- message: response,
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
+ this.getData(this.currentPage, this.pageSize)
|
|
|
+ }).catch(response => {
|
|
|
+ })
|
|
|
+ },
|
|
|
+ viewHandle (row) {
|
|
|
+ this.$router.push({path: `/bonus/period-detail/${row.PERIOD_NUM}`})
|
|
|
+ },
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ this.multipleSelection = val
|
|
|
+ },
|
|
|
+ handleCurrentChange (page) {
|
|
|
+ this.getData(page, this.pageSize)
|
|
|
+ },
|
|
|
+ handleSizeChange (pageSize) {
|
|
|
+ this.getData(this.currentPage, pageSize)
|
|
|
+ },
|
|
|
+ handleFilterUser (filterData) {
|
|
|
+ filterHelper.handleFilterUser(this, filterData)
|
|
|
+ },
|
|
|
+ handleFilter () {
|
|
|
+ this.getData()
|
|
|
+ },
|
|
|
+ getData (page, pageSize) {
|
|
|
+ let filterData = this.filterModel
|
|
|
+ let vueObj = this
|
|
|
+ network.getPageData(this, 'bonus/period', page, pageSize, filterData, function (response) {
|
|
|
+ vueObj.allData = response
|
|
|
+ }, null, ['PERF_PERCENT', 'CALC_PERCENT', 'SENT_PERCENT'])
|
|
|
+ },
|
|
|
+ onMessageCallback (data) {
|
|
|
+ if (data) {
|
|
|
+ if (data.other && data.other.MODEL === 'PERIOD' && data.other.ID) {
|
|
|
+ this.$set(this.percentList[data.other.FIELD], data.other.ID, data.percent)
|
|
|
+ }
|
|
|
+ if (data.other && data.other.MODEL === 'PERIOD' && data.percent === 100) {
|
|
|
this.getData(this.currentPage, this.pageSize)
|
|
|
- }).catch(response => {
|
|
|
- })
|
|
|
- },
|
|
|
- viewHandle(row) {
|
|
|
- this.$router.push({path: `/bonus/period-detail/${row.PERIOD_NUM}`})
|
|
|
- },
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.multipleSelection = val
|
|
|
- },
|
|
|
- handleCurrentChange(page) {
|
|
|
- this.getData(page, this.pageSize)
|
|
|
- },
|
|
|
- handleSizeChange(pageSize) {
|
|
|
- this.getData(this.currentPage, pageSize)
|
|
|
- },
|
|
|
- handleFilterUser(filterData) {
|
|
|
- filterHelper.handleFilterUser(this, filterData)
|
|
|
- },
|
|
|
- handleFilter() {
|
|
|
- this.getData()
|
|
|
- },
|
|
|
- getData(page, pageSize) {
|
|
|
- let filterData = this.filterModel
|
|
|
- let vueObj = this
|
|
|
- network.getPageData(this, 'bonus/period', page, pageSize, filterData, function (response) {
|
|
|
- vueObj.allData = response
|
|
|
- }, null, ['PERF_PERCENT', 'CALC_PERCENT', 'SENT_PERCENT'])
|
|
|
- },
|
|
|
- onMessageCallback(data) {
|
|
|
- if (data) {
|
|
|
- if (data.other && data.other.MODEL === 'PERIOD' && data.other.ID) {
|
|
|
- this.$set(this.percentList[data.other.FIELD], data.other.ID, data.percent)
|
|
|
- }
|
|
|
- if (data.other && data.other.MODEL === 'PERIOD' && data.percent === 100) {
|
|
|
- this.getData(this.currentPage, this.pageSize)
|
|
|
- }
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|