|
@@ -80,6 +80,8 @@
|
|
|
<a-card :bordered="false" style=" marginTop:10px;">
|
|
|
<div class="table-operator">
|
|
|
<a-button type="primary" @click.stop="addShipDet" icon="plus">新增</a-button>
|
|
|
+
|
|
|
+ <a-button type="primary" icon="download" @click="handleExportXls('发运明细')">导出</a-button>
|
|
|
</div>
|
|
|
|
|
|
<!-- 子表 :row-key="record => record.id" :pagination="ipagination-->
|
|
@@ -223,6 +225,8 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
import moment from 'moment'
|
|
|
|
|
|
+import { downFile } from '@/api/manage'
|
|
|
+
|
|
|
import addShipDetDrawer from '@views/shipment-details/addShipDetDrawer.vue'
|
|
|
import detailsShipDetDrawer from '@views/shipment-details/detailsShipDetDrawer.vue'
|
|
|
import editShipDetDrawer from '@views/shipment-details/editShipDetDrawer.vue'
|
|
@@ -549,10 +553,37 @@ export default {
|
|
|
this.$refs.itemNumEleModal.editItemNumber.isTc = record.isTc
|
|
|
},
|
|
|
|
|
|
+ // 导出
|
|
|
+ handleExportXls(fileName) {
|
|
|
+ console.log('需导出的fileName:', fileName)
|
|
|
+ const params = this.shipmentListData
|
|
|
+ console.log('导出参数', params)
|
|
|
+ downFile('/shippingDetails/syShippingDetails/exportXls', params).then(data => {
|
|
|
+ console.log('888')
|
|
|
+ if (!data) {
|
|
|
+ this.$message.warning('文件下载失败')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
|
+ window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
|
|
|
+ } else {
|
|
|
+ let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ link.setAttribute('download', fileName + '.xls')
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link) // 下载完成移除元素
|
|
|
+ window.URL.revokeObjectURL(url) // 释放掉blob对象
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
// 编辑
|
|
|
edit(record) {
|
|
|
this.$refs.editShipDetDrawer.visible = true
|
|
|
-
|
|
|
+
|
|
|
shipmentQueryById({ id: record.id }).then(res => {
|
|
|
if (res.success) {
|
|
|
// console.log('编辑对象', res.result)
|
|
@@ -582,7 +613,7 @@ export default {
|
|
|
submitShipment({ id: record.id, type: '1' }).then(res => {
|
|
|
if (res.success) {
|
|
|
console.log('提交成功,单据状态改为【已提交】')
|
|
|
- this.shipmentListData.state == '1'
|
|
|
+ this.shipmentListData.state = '1'
|
|
|
this.getShipmentList() // 渲染 发运明细列表
|
|
|
this.$message.success('提交成功')
|
|
|
}
|
|
@@ -596,7 +627,7 @@ export default {
|
|
|
cancelSubmitShipment({ id: record.id, type: '2' }).then(res => {
|
|
|
if (res.success) {
|
|
|
console.log('取消提交成功,单据状态改为【仅保存】')
|
|
|
- this.shipmentListData.state == '0'
|
|
|
+ this.shipmentListData.state = '0'
|
|
|
this.getShipmentList() // 渲染 发运明细列表
|
|
|
this.$message.success('取消提交成功')
|
|
|
}
|
|
@@ -611,7 +642,7 @@ export default {
|
|
|
pushShipment({ id: record.id }).then(res => {
|
|
|
if (res.success) {
|
|
|
console.log('推送成功,推送状态【推送成功】')
|
|
|
- this.shipmentListData.pushState == '1'
|
|
|
+ this.shipmentListData.pushState = '1'
|
|
|
this.getShipmentList() // 渲染 发运明细列表
|
|
|
this.$message.success('推送成功')
|
|
|
}
|
|
@@ -626,7 +657,7 @@ export default {
|
|
|
rePushShipment({ id: record.id }).then(res => {
|
|
|
if (res.success) {
|
|
|
console.log('重新推送成功,推送状态【推送成功】')
|
|
|
- this.shipmentListData.pushState == '1'
|
|
|
+ this.shipmentListData.pushState = '1'
|
|
|
this.getShipmentList() // 渲染 发运明细列表
|
|
|
this.$message.success('重新推送成功')
|
|
|
}
|
|
@@ -675,7 +706,7 @@ export default {
|
|
|
this.queryParam.salesman = ''
|
|
|
this.queryParam.itemNumber = ''
|
|
|
this.queryParam.refer = ''
|
|
|
- this.queryParam.is = ''
|
|
|
+ this.queryParam.isTc = ''
|
|
|
this.getShipmentList() // 渲染 发运明细列表
|
|
|
},
|
|
|
|