Commit ef4c3276 authored by yaya's avatar yaya

feat:财务管理按钮操作

parent c8c64429
......@@ -104,3 +104,11 @@ export function findSystemBillExpenditureDetail(data) {
data
})
}
export function finishSettlement(data) {
return request({
url: '/sysFinance/finishSettlement',
method: 'post',
data
})
}
......@@ -42,7 +42,7 @@
<script>
import { MessageBox } from 'element-ui'
import { requestIdentify } from '@/api/business/order'
import { finishSettlement } from '@/api/business/order'
import { uploadPath } from '@/api/business/storage'
import { getToken } from '@/utils/auth'
export default {
......@@ -63,7 +63,7 @@ export default {
return {
uploadPath,
finishForm: {
remark: ''
images: []
},
itemImages: []
}
......@@ -83,23 +83,28 @@ export default {
* 取消
*/
handleCancelValue() {
if (this.distributionOrderId) {
const params = { ...this.cancelForm, distributionOrderId: this.distributionOrderId, identifyOrderId: this.identifyOrderId, approved: 0 }
if (!this.finishForm.images || this.finishForm.images.length === 0) {
this.$message.error('请上传凭证')
return
}
if (this.fianceItem.billId) {
const params = { billId: this.fianceItem.billId, voucher: this.finishForm.images[0] }
this.$refs.cancel.validate((valid) => {
if (valid) {
requestIdentify(params)
finishSettlement(params)
.then(response => {
this.$notify.success({
message: '操作成功'
})
this.cancelForm = {}
this.$emit('refreshItem', this.distributionOrderId)
this.$emit('refreshItem', this.fianceItem.billId)
})
.catch(response => {
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定',
type: 'error'
})
this.$emit('refreshItem', this.fianceItem.billId)
})
}
})
......
......@@ -94,8 +94,8 @@
<el-table-column align="center" label="银行卡账号" width="200" prop="bankCardId" />
<el-table-column align="center" label="真实姓名" prop="realName" />
<el-table-column align="center" label="查看凭证" prop="voucher" >
<template slot-scope="scope">
<span class="tooltip-span">{{ `${scope.row.voucher ? `查看凭证` : '-'}` }}</span>
<template slot-scope="scope" >
<div class="tooltip-span" style="color: #1890ff" @click="handlePreview(scope.row.voucher)">{{ `${scope.row.voucher ? `查看凭证` : '-'}` }}</div>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="300" fixed="right">
......@@ -111,6 +111,7 @@
@click="handleToLoad(scope.row)">下载账单
</el-button>
<el-button
:disabled="scope.row.state === 1"
type="primary"
size="mini"
@click="handleToFinish(scope.row)">完成结款
......@@ -135,7 +136,13 @@
v-if="showFinishFinanceDialog"
:show-finish-finance-dialog="showFinishFinanceDialog"
:fiance-item="fianceItem"
@cancelDialog="showFinishFinanceDialog = false"/>
@cancelDialog="showFinishFinanceDialog = false"
@refreshItem="handleFinishSuccess"/>
<CheckLargeImageDialog
:show-large-dialog="showLargeDialog"
:image-url="imageUrl"
@closeLargeDialog="showLargeDialog = false"
/>
</div>
</template>
......@@ -145,10 +152,12 @@ import Pagination from '@/components/Pagination'
import { findUserBill } from '@/api/business/order'
import LoadFinanceDialog from './components/LoadFinanceDialog'
import FinishFinanceDialog from './components/FinishFinanceDialog'
import CheckLargeImageDialog from '../goods/components/CheckLargeImageDialog'
export default {
name: 'FinanceList',
components: {
CheckLargeImageDialog,
FinishFinanceDialog,
LoadFinanceDialog,
Pagination,
......@@ -173,7 +182,9 @@ export default {
total: 0,
showLoadFinanceDialog: false,
fianceItem: {},
showFinishFinanceDialog: false
showFinishFinanceDialog: false,
imageUrl: '',
showLargeDialog: false
}
},
created() {
......@@ -181,7 +192,12 @@ export default {
},
methods: {
handlePreview(voucher) {
if (voucher) {
this.imageUrl = voucher
this.showLargeDialog = true
}
},
/**
* 跳转账单明细
*/
......@@ -226,8 +242,18 @@ export default {
* 下载账单
*/
handleToLoad(row) {
if (row.totalWaitEntryAmount && Number(row.totalWaitEntryAmount) > 0) {
this.$confirm('该藏家仍有部分收入未入账,请等全部入账后再进行操作', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
})
} else {
this.showLoadFinanceDialog = true
this.fianceItem = row
}
},
/**
* 完成结款
......@@ -235,6 +261,16 @@ export default {
handleToFinish(row) {
this.showFinishFinanceDialog = true
this.fianceItem = row
},
handleFinishSuccess(billId) {
this.list = this.list.filter((item) => {
if (item.billId === billId) {
item.state = 1
return item
}
return item
})
this.showFinishFinanceDialog = false
}
}
}
......
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