Commit 4733364e authored by yaya's avatar yaya

feat:添加导出功能

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