|
@@ -1,9 +1,14 @@
|
|
<template>
|
|
<template>
|
|
<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="120"
|
|
<template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="120"
|
|
:options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
|
|
:options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
|
|
- :operation="operation" :exportList="exportList">
|
|
|
|
-
|
|
|
|
- <div slot="moreSearch">
|
|
|
|
|
|
+ :operation="operation()" :exportList="tabIndex==1?exportList1:exportList2">
|
|
|
|
+ <div slot="moreSearch" style="margin-bottom: 10px;">
|
|
|
|
+ <el-radio-group v-model="tabIndex" size="mini" @change="changeType">
|
|
|
|
+ <el-radio-button label="1">汇总</el-radio-button>
|
|
|
|
+ <el-radio-button label="2">明细</el-radio-button>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="moreSearch" v-if="tabIndex == 2">
|
|
<el-radio-group v-model="status" size="mini" @change="changeType">
|
|
<el-radio-group v-model="status" size="mini" @change="changeType">
|
|
<el-radio-button label="">全部</el-radio-button>
|
|
<el-radio-button label="">全部</el-radio-button>
|
|
<el-radio-button label="WAIT">待结算</el-radio-button>
|
|
<el-radio-button label="WAIT">待结算</el-radio-button>
|
|
@@ -112,6 +117,7 @@
|
|
<th class="bold" align="center">单价</th>
|
|
<th class="bold" align="center">单价</th>
|
|
<th class="bold" align="center">订单金额</th>
|
|
<th class="bold" align="center">订单金额</th>
|
|
<th class="bold" align="center">销售类型</th>
|
|
<th class="bold" align="center">销售类型</th>
|
|
|
|
+ <th class="bold" align="center">手续费</th>
|
|
<th class="bold" align="center">师傅分账金额</th>
|
|
<th class="bold" align="center">师傅分账金额</th>
|
|
<th class="bold" align="center">商户分账金额</th>
|
|
<th class="bold" align="center">商户分账金额</th>
|
|
</tr>
|
|
</tr>
|
|
@@ -124,6 +130,7 @@
|
|
<td align="center">{{item.goodsAmount}}</td>
|
|
<td align="center">{{item.goodsAmount}}</td>
|
|
<td align="center">{{item.totalAmount}}</td>
|
|
<td align="center">{{item.totalAmount}}</td>
|
|
<td align="center">{{item.settlementType == 'OWN'?'自有':item.settlementType == 'OUT'?'外购':''}}</td>
|
|
<td align="center">{{item.settlementType == 'OWN'?'自有':item.settlementType == 'OUT'?'外购':''}}</td>
|
|
|
|
+ <td align="center">{{(item.websitProceAmount*100 + item.workerProceAmount*100)/100}}</td>
|
|
<td align="center">{{item.workerAmount}}</td>
|
|
<td align="center">{{item.workerAmount}}</td>
|
|
<td align="center">{{item.websitAmount}}</td>
|
|
<td align="center">{{item.websitAmount}}</td>
|
|
</tr>
|
|
</tr>
|
|
@@ -133,6 +140,7 @@
|
|
<tr>
|
|
<tr>
|
|
<td align="center">总计</td><td></td><td></td><td></td>
|
|
<td align="center">总计</td><td></td><td></td><td></td>
|
|
<td align="center">{{totalAmount}}</td><td></td>
|
|
<td align="center">{{totalAmount}}</td><td></td>
|
|
|
|
+ <td align="center">{{commissionAmount}}</td>
|
|
<td align="center">{{workerAmount}}</td>
|
|
<td align="center">{{workerAmount}}</td>
|
|
<td align="center">{{websitAmount}}</td>
|
|
<td align="center">{{websitAmount}}</td>
|
|
</tr>
|
|
</tr>
|
|
@@ -151,38 +159,16 @@
|
|
<script>
|
|
<script>
|
|
import TemplatePage from '@/components/template/template-page-1.vue'
|
|
import TemplatePage from '@/components/template/template-page-1.vue'
|
|
import import_mixin from '@/components/template/import_mixin.js'
|
|
import import_mixin from '@/components/template/import_mixin.js'
|
|
|
|
+import operation_mixin from '@/components/template/operation_mixin.js'
|
|
import ImageUpload from '@/components/file-upload'
|
|
import ImageUpload from '@/components/file-upload'
|
|
import { downloadFiles } from '@/utils/util'
|
|
import { downloadFiles } from '@/utils/util'
|
|
import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
|
|
import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
|
|
-import { listPageV2,pageExport, getDetail, refund, settleAccounts, withdraw } from "@/api/auxiliaryFittings/settleAccount";
|
|
|
|
|
|
+import { listPageV1,listPageV2,pageExport1, pageExport2, getDetail, refund, settleAccounts, withdraw } from "@/api/auxiliaryFittings/settleAccountWeixinPay";
|
|
export default {
|
|
export default {
|
|
components: { TemplatePage, ImageUpload },
|
|
components: { TemplatePage, ImageUpload },
|
|
- mixins: [import_mixin],
|
|
|
|
|
|
+ mixins: [import_mixin,operation_mixin],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- // 事件组合
|
|
|
|
- optionsEvensGroup: [
|
|
|
|
- [
|
|
|
|
- [
|
|
|
|
- {
|
|
|
|
- name: '批量结算',
|
|
|
|
- click: ()=>{
|
|
|
|
- this.batchSettleAccounts()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- ],
|
|
|
|
- [
|
|
|
|
- [
|
|
|
|
- {
|
|
|
|
- name: '批量提现',
|
|
|
|
- click: ()=>{
|
|
|
|
- this.batchWithdraw()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ]
|
|
|
|
- ],
|
|
|
|
- ],
|
|
|
|
// 表格属性
|
|
// 表格属性
|
|
tableAttributes: {
|
|
tableAttributes: {
|
|
// 启用勾选列
|
|
// 启用勾选列
|
|
@@ -202,9 +188,38 @@ export default {
|
|
totalAmount: 0,
|
|
totalAmount: 0,
|
|
workerAmount: 0,
|
|
workerAmount: 0,
|
|
websitAmount: 0,
|
|
websitAmount: 0,
|
|
|
|
+ commissionAmount: 0,
|
|
|
|
+ tabIndex: 1,
|
|
|
|
+ workerId: '',
|
|
|
|
+ websitId: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
|
|
+ // 事件组合
|
|
|
|
+ optionsEvensGroup() {
|
|
|
|
+ return [
|
|
|
|
+ [
|
|
|
|
+ [
|
|
|
|
+ this.optionsEvensAuth("bulkSettlement", {
|
|
|
|
+ isRole: this.tabIndex== 2,
|
|
|
|
+ click: () => {
|
|
|
|
+ this.batchSettleAccounts()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ ],
|
|
|
|
+ ],
|
|
|
|
+ [
|
|
|
|
+ [
|
|
|
|
+ this.optionsEvensAuth("bulkWithdrawal", {
|
|
|
|
+ isRole: this.tabIndex== 2,
|
|
|
|
+ click: () => {
|
|
|
|
+ this.batchWithdraw()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ ],
|
|
|
|
+ ]
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
// 更多参数
|
|
// 更多参数
|
|
moreParameters() {
|
|
moreParameters() {
|
|
return []
|
|
return []
|
|
@@ -213,22 +228,29 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 切换状态
|
|
// 切换状态
|
|
changeType(val) {
|
|
changeType(val) {
|
|
|
|
+ this.workerId = ''
|
|
|
|
+ this.websitId = ''
|
|
this.$refs.pageRef.refreshList()
|
|
this.$refs.pageRef.refreshList()
|
|
},
|
|
},
|
|
// 列表请求函数
|
|
// 列表请求函数
|
|
getList(p) {
|
|
getList(p) {
|
|
try {
|
|
try {
|
|
var pam = JSON.parse(JSON.stringify(p))
|
|
var pam = JSON.parse(JSON.stringify(p))
|
|
- if (this.status) {
|
|
|
|
- pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
|
|
|
|
|
|
+ pam.params.push({ "param": "a.pay_type", "compare": "=", "value": 'WECHAT' })
|
|
|
|
+ if (this.status && this.tabIndex==2) {
|
|
|
|
+ pam.params.push({ "param": "a.status", "compare": "=", "value": this.status })
|
|
}
|
|
}
|
|
- return listPageV2(pam)
|
|
|
|
|
|
+ if(this.workerId){
|
|
|
|
+ pam.params.push({ "param": "a.websit_id", "compare": "=", "value": this.websitId },{ "param": "a.worker_id", "compare": "=", "value": this.workerId })
|
|
|
|
+ }
|
|
|
|
+ return this.tabIndex==1?listPageV1(pam):listPageV2(pam)
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.log(error)
|
|
console.log(error)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 列表导出函数
|
|
// 列表导出函数
|
|
- exportList: pageExport,
|
|
|
|
|
|
+ exportList1: pageExport1,
|
|
|
|
+ exportList2: pageExport2,
|
|
// 表格列解析渲染数据更改
|
|
// 表格列解析渲染数据更改
|
|
columnParsing(item, defaultData) {
|
|
columnParsing(item, defaultData) {
|
|
return defaultData
|
|
return defaultData
|
|
@@ -237,58 +259,92 @@ export default {
|
|
selectionChange(data) {
|
|
selectionChange(data) {
|
|
this.recordSelected = data
|
|
this.recordSelected = data
|
|
},
|
|
},
|
|
- openForm() {
|
|
|
|
- this.formDialog = true;
|
|
|
|
- },
|
|
|
|
- formCancel() {
|
|
|
|
- this.$refs.formRef.$refs.inlineForm.clearValidate()
|
|
|
|
- this.$data.formData = this.$options.data().formData
|
|
|
|
- this.formDialog = false
|
|
|
|
- },
|
|
|
|
- // 表格操作列
|
|
|
|
- operation(h, { row, index, column }) {
|
|
|
|
- return (
|
|
|
|
- <div class='operation-btns'>
|
|
|
|
- <el-button type="text" onClick={() => {
|
|
|
|
- this.totalAmount = 0
|
|
|
|
- this.workerAmount = 0
|
|
|
|
- this.websitAmount = 0
|
|
|
|
- getDetail({ id: row.settlementOrderId }).then(res => {
|
|
|
|
- Object.assign(this.formData, res.data)
|
|
|
|
- res.data.settlementOrderItemList.forEach(item=>{
|
|
|
|
- this.totalAmount += (item.totalAmount*100 + this.totalAmount*100)/100
|
|
|
|
- this.workerAmount = (item.workerAmount*100 + this.workerAmount*100)/100
|
|
|
|
- this.websitAmount += (item.websitAmount*100 + this.websitAmount*100)/100
|
|
|
|
- })
|
|
|
|
- this.formDialogType = 1
|
|
|
|
- this.openForm()
|
|
|
|
- })
|
|
|
|
- }}>查看</el-button>
|
|
|
|
- {row.totalAmount > 0? <el-button type="text" onClick={() => {
|
|
|
|
- this.$confirm('请确认是否退款, 是否继续?', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- refund({ id: row.settlementOrderId }).then(res => {
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- this.$message({ type: 'success', message: '退款成功!' })
|
|
|
|
- this.$refs.pageRef.refreshList()
|
|
|
|
- } else {
|
|
|
|
- this.$message.error(res.msg);
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- });
|
|
|
|
- }}>退款</el-button>:null}
|
|
|
|
- {row.status == 'WAIT'? <el-button type="text" onClick={() => {
|
|
|
|
- this.settleAccounts(row.settlementOrderId)
|
|
|
|
- }}>结算</el-button>:null}
|
|
|
|
- {row.status == 'WAIT_ING'? <el-button type="text" onClick={() => {
|
|
|
|
- this.withdraw(row.settlementOrderId)
|
|
|
|
- }}>提现</el-button>:null}
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
- },
|
|
|
|
|
|
+ openForm() {
|
|
|
|
+ this.formDialog = true;
|
|
|
|
+ },
|
|
|
|
+ formCancel() {
|
|
|
|
+ this.$refs.formRef.$refs.inlineForm.clearValidate()
|
|
|
|
+ this.$data.formData = this.$options.data().formData
|
|
|
|
+ this.formDialog = false
|
|
|
|
+ },
|
|
|
|
+ // 表格操作列
|
|
|
|
+ operation() {
|
|
|
|
+ return this.operationBtn({
|
|
|
|
+ detail: {
|
|
|
|
+ btnType: 'text',
|
|
|
|
+ name: ({ row, index, column }) => {
|
|
|
|
+ return this.tabIndex==1?'查看明细':'详情'
|
|
|
|
+ },
|
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
|
+ if(this.tabIndex==1){
|
|
|
|
+ this.workerId = row.workerId
|
|
|
|
+ this.websitId = row.websitId
|
|
|
|
+ this.tabIndex = 2
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ }else{
|
|
|
|
+ this.totalAmount = 0
|
|
|
|
+ this.workerAmount = 0
|
|
|
|
+ this.websitAmount = 0
|
|
|
|
+ this.commissionAmount = 0
|
|
|
|
+ getDetail({ id: row.settlementOrderId }).then(res => {
|
|
|
|
+ Object.assign(this.formData, res.data)
|
|
|
|
+ res.data.settlementOrderItemList.forEach(item=>{
|
|
|
|
+ this.totalAmount += (item.totalAmount*100 + this.totalAmount*100)/100
|
|
|
|
+ this.workerAmount = (item.workerAmount*100 + this.workerAmount*100)/100
|
|
|
|
+ this.websitAmount += (item.websitAmount*100 + this.websitAmount*100)/100
|
|
|
|
+ this.commissionAmount += (item.websitProceAmount*100 + item.workerProceAmount*100 + this.commissionAmount*100)/100
|
|
|
|
+ })
|
|
|
|
+ this.formDialogType = 1
|
|
|
|
+ this.openForm()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ refund: {
|
|
|
|
+ btnType: 'text',
|
|
|
|
+ prompt: '确认是否退款?',
|
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
|
+ return row.totalAmount > 0 && this.tabIndex==2
|
|
|
|
+ },
|
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
|
+ refund({ id: row.settlementOrderId }).then(res => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$message({ type: 'success', message: '退款成功!' })
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.msg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ settlement: {
|
|
|
|
+ btnType: 'text',
|
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
|
+ return row.status == 'WAIT' || this.tabIndex==1
|
|
|
|
+ },
|
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
|
+ if(this.tabIndex==1){
|
|
|
|
+ this.status = 'WAIT'
|
|
|
|
+ this.workerId = row.workerId
|
|
|
|
+ this.websitId = row.websitId
|
|
|
|
+ this.tabIndex = 2
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ }else{
|
|
|
|
+ this.settleAccounts(row.settlementOrderId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ withdraw: {
|
|
|
|
+ btnType: 'text',
|
|
|
|
+ conditions: ({ row, index, column }) => {
|
|
|
|
+ return row.status == 'WAIT_ING' && this.tabIndex==2
|
|
|
|
+ },
|
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
|
+ this.withdraw(row.settlementOrderId)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ },
|
|
batchSettleAccounts(){
|
|
batchSettleAccounts(){
|
|
if(this.recordSelected.length == 0){
|
|
if(this.recordSelected.length == 0){
|
|
return this.$message.warning('请至少勾选一条数据!');
|
|
return this.$message.warning('请至少勾选一条数据!');
|