Commit 4733364e authored by yaya's avatar yaya

feat:添加导出功能

parent 9a4a8904
...@@ -112,3 +112,10 @@ export function exportOrderBillDetail(data) { ...@@ -112,3 +112,10 @@ export function exportOrderBillDetail(data) {
data data
}) })
} }
export function exportUserBillDetail(data) {
return request({
url: '/sysFinance/exportUserBillDetail',
method: 'post',
data
})
}
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
</template> </template>
<script> <script>
import { MessageBox } from 'element-ui' import { Loading, MessageBox } from 'element-ui'
import { requestIdentify } from '@/api/business/order' import { exportUserBillDetail } from '@/api/business/order'
export default { export default {
name: 'LoadFinanceDialog', name: 'LoadFinanceDialog',
props: { props: {
...@@ -50,6 +50,7 @@ export default { ...@@ -50,6 +50,7 @@ export default {
}, },
data() { data() {
return { return {
loadingInstance: {},
loadForm: { loadForm: {
remark: '' remark: ''
} }
...@@ -63,19 +64,36 @@ export default { ...@@ -63,19 +64,36 @@ export default {
* 取消 * 取消
*/ */
handleCancelValue() { handleCancelValue() {
if (this.distributionOrderId) { if (this.fianceItem) {
const params = { ...this.cancelForm, distributionOrderId: this.distributionOrderId, identifyOrderId: this.identifyOrderId, approved: 0 } const options = {
lock: true,
text: '正在下载...',
spinner: 'el-icon-loading'
}
this.loadingInstance = Loading.service(options)
const params = { userId: this.fianceItem.userId, accountPeriod: this.fianceItem.accountPeriod }
this.$refs.cancel.validate((valid) => { this.$refs.cancel.validate((valid) => {
if (valid) { if (valid) {
requestIdentify(params) exportUserBillDetail(params)
.then(response => { .then(response => {
this.$notify.success({ this.$notify.success({
message: '操作成功' message: '操作成功'
}) })
setTimeout(() => {
if (this.loadingInstance) {
this.loadingInstance.close()
}
if (response && response.data) {
window.open(response.data.data)
}
}, 5000)
this.cancelForm = {} this.cancelForm = {}
this.handleCancelConsignDialog() this.handleCancelConsignDialog()
}) })
.catch(response => { .catch(response => {
if (this.loadingInstance) {
this.loadingInstance.close()
}
MessageBox.alert('业务错误:' + response.data.errmsg, '警告', { MessageBox.alert('业务错误:' + response.data.errmsg, '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'error' type: 'error'
......
...@@ -149,6 +149,7 @@ import Line2Hidden from '@/components/line2Hidden' ...@@ -149,6 +149,7 @@ import Line2Hidden from '@/components/line2Hidden'
import Pagination from '@/components/Pagination' import Pagination from '@/components/Pagination'
import { findOrderBillDetail, requestLogisticsList, exportOrderBillDetail } from '@/api/business/order' import { findOrderBillDetail, requestLogisticsList, exportOrderBillDetail } from '@/api/business/order'
import { MessageBox } from 'element-ui' import { MessageBox } from 'element-ui'
import { Loading } from 'element-ui'
export default { export default {
name: 'OrderDetail', name: 'OrderDetail',
...@@ -159,6 +160,7 @@ export default { ...@@ -159,6 +160,7 @@ export default {
data() { data() {
return { return {
itemKey: 0, itemKey: 0,
loadingInstance: {},
options: [{ options: [{
value: 1, value: 1,
label: '待付款' label: '待付款'
...@@ -222,9 +224,26 @@ export default { ...@@ -222,9 +224,26 @@ export default {
this.getList() this.getList()
}, },
handleExport() { handleExport() {
const options = {
lock: true,
text: '正在导出...',
spinner: 'el-icon-loading'
}
this.loadingInstance = Loading.service(options)
exportOrderBillDetail(this.listQuery).then(response => { exportOrderBillDetail(this.listQuery).then(response => {
setTimeout(() => {
if (this.loadingInstance) {
this.loadingInstance.close()
}
if (response && response.data) {
window.open(response.data.data)
}
}, 5000)
}).catch((e) => { }).catch((e) => {
console.log('===报错=', e) console.log('===报错=', e)
if (this.loadingInstance) {
this.loadingInstance.close()
}
MessageBox.alert('业务错误:' + e.data.errmsg, '警告', { MessageBox.alert('业务错误:' + e.data.errmsg, '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'error' type: 'error'
......
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