|
@@ -6,6 +6,13 @@
|
|
<a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
|
|
<a href="javascript:;" @click="handleBack"><a-icon type="left"></a-icon> 返回列表</a>
|
|
</template>
|
|
</template>
|
|
<template slot="extra" v-if="$hasPermissions('B_dispatchPrint')">
|
|
<template slot="extra" v-if="$hasPermissions('B_dispatchPrint')">
|
|
|
|
+ <a-button
|
|
|
|
+ key="3"
|
|
|
|
+ type="primary"
|
|
|
|
+ class="button-warning"
|
|
|
|
+ id="purchaseOrderDetail-export-btn"
|
|
|
|
+ :disabled="localDataSource.length==0"
|
|
|
|
+ @click="openExcelModal=true">导出Excel</a-button>
|
|
<a-button
|
|
<a-button
|
|
key="2"
|
|
key="2"
|
|
type="primary"
|
|
type="primary"
|
|
@@ -79,6 +86,8 @@
|
|
</a-spin>
|
|
</a-spin>
|
|
<!-- 分类打印 -->
|
|
<!-- 分类打印 -->
|
|
<choose-type-modal :openModal="openModal" :outBizSubSn="outBizSubSn" @ok="handleOk" @close="openModal=false" />
|
|
<choose-type-modal :openModal="openModal" :outBizSubSn="outBizSubSn" @ok="handleOk" @close="openModal=false" />
|
|
|
|
+ <!-- 导出Excel -->
|
|
|
|
+ <export-excel-modal :openModal="openExcelModal" :itemData="detailData" @ok="handleExcelOk" @close="openExcelModal=false" />
|
|
<!-- 打印 -->
|
|
<!-- 打印 -->
|
|
<div id="print"></div>
|
|
<div id="print"></div>
|
|
</div>
|
|
</div>
|
|
@@ -87,10 +96,12 @@
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
import chooseTypeModal from './chooseTypeModal.vue'
|
|
import chooseTypeModal from './chooseTypeModal.vue'
|
|
-import { dispatchDetaillList, dispatchFindBySn, dispatchDetailPrint } from '@/api/dispatch'
|
|
|
|
|
|
+import exportExcelModal from './exportExcelModal.vue'
|
|
|
|
+import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
|
+import { dispatchDetaillList, dispatchFindBySn, dispatchDetailPrint, dispatchDetailExcel } from '@/api/dispatch'
|
|
export default {
|
|
export default {
|
|
name: 'SalesDetail',
|
|
name: 'SalesDetail',
|
|
- components: { STable, VSelect, chooseTypeModal },
|
|
|
|
|
|
+ components: { STable, VSelect, chooseTypeModal, exportExcelModal },
|
|
props: {
|
|
props: {
|
|
outBizSubSn: { // 有值则为弹框,无值则为页面
|
|
outBizSubSn: { // 有值则为弹框,无值则为页面
|
|
type: [Number, String],
|
|
type: [Number, String],
|
|
@@ -146,7 +157,8 @@ export default {
|
|
detailData: null, // 详情数据
|
|
detailData: null, // 详情数据
|
|
openModal: false,
|
|
openModal: false,
|
|
localDataSource: [],
|
|
localDataSource: [],
|
|
- nowPrintType: '' // 当前打印类型
|
|
|
|
|
|
+ nowPrintType: '', // 当前打印类型
|
|
|
|
+ openExcelModal: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -164,6 +176,18 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 导出Excel
|
|
|
|
+ handleExcelOk(priceType){
|
|
|
|
+ const _this = this
|
|
|
|
+ const params = {
|
|
|
|
+ dispatchBillSn: this.outBizSubSn || this.$route.params.sn,
|
|
|
|
+ printType: priceType
|
|
|
|
+ }
|
|
|
|
+ this.spinning = true
|
|
|
|
+ hdExportExcel(dispatchDetailExcel, params, '产品导出', function () {
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 分类选择
|
|
// 分类选择
|
|
handleOk (obj) {
|
|
handleOk (obj) {
|
|
this.requestFun(obj)
|
|
this.requestFun(obj)
|
|
@@ -214,6 +238,7 @@ export default {
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
if (!this.$store.state.app.isNewTab || this.outBizSubSn) { // 页签刷新 或 为弹框时调用
|
|
if (!this.$store.state.app.isNewTab || this.outBizSubSn) { // 页签刷新 或 为弹框时调用
|
|
|
|
+ console.log(222)
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
this.getDetail()
|
|
this.getDetail()
|
|
}
|
|
}
|
|
@@ -221,6 +246,7 @@ export default {
|
|
activated () {
|
|
activated () {
|
|
// 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
|
|
// 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
|
|
if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
|
|
if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
|
|
|
|
+ console.log(111)
|
|
this.$refs.table.refresh(true)
|
|
this.$refs.table.refresh(true)
|
|
this.getDetail()
|
|
this.getDetail()
|
|
}
|
|
}
|