Commit ef4c3276 authored by yaya's avatar yaya

feat:财务管理按钮操作

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