|
@@ -10,20 +10,35 @@
|
|
<a-tag color="orange">{{ detail&&detail.financialStatusDictValue }}</a-tag>
|
|
<a-tag color="orange">{{ detail&&detail.financialStatusDictValue }}</a-tag>
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
- <template slot="extra" v-if="$hasPermissions('B_purchasePrint')">
|
|
|
|
- <a-radio-group key="4" v-model="printerType">
|
|
|
|
|
|
+ <template slot="extra">
|
|
|
|
+ <a-radio-group key="5" v-model="printerType" v-if="$hasPermissions('B_purchasePrint')">
|
|
<a-radio value="NEEDLE">针式</a-radio>
|
|
<a-radio value="NEEDLE">针式</a-radio>
|
|
<a-radio value="INK">喷墨</a-radio>
|
|
<a-radio value="INK">喷墨</a-radio>
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
- <a-button key="3" id="purchaseOrderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
|
|
|
|
- <a-button key="2" type="primary" id="purchaseOrderDetail-print-btn" :disabled="localDataSource.length==0" @click="handlePrint('print')">快捷打印</a-button>
|
|
|
|
|
|
+ <a-button key="4" v-if="$hasPermissions('B_purchasePrint')" id="purchaseOrderDetail-preview-btn" :disabled="localDataSource.length==0" @click="handlePrint('preview')">打印预览</a-button>
|
|
<a-button
|
|
<a-button
|
|
- key="1"
|
|
|
|
|
|
+ key="3"
|
|
|
|
+ v-if="$hasPermissions('B_purchasePrint')"
|
|
|
|
+ type="primary"
|
|
|
|
+ id="purchaseOrderDetail-print-btn"
|
|
|
|
+ :disabled="localDataSource.length==0"
|
|
|
|
+ @click="handlePrint('print')">快捷打印</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ key="2"
|
|
|
|
+ v-if="$hasPermissions('B_purchasePrint')"
|
|
type="primary"
|
|
type="primary"
|
|
class="button-warning"
|
|
class="button-warning"
|
|
id="purchaseOrderDetail-export-btn"
|
|
id="purchaseOrderDetail-export-btn"
|
|
:disabled="localDataSource.length==0"
|
|
:disabled="localDataSource.length==0"
|
|
@click="handlePrint('export')">导出Excel</a-button>
|
|
@click="handlePrint('export')">导出Excel</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ key="1"
|
|
|
|
+ v-if="$hasPermissions('B_purchaseExportProduct') && (detail&&detail.billStatus=='FINISH')"
|
|
|
|
+ type="primary"
|
|
|
|
+ class="button-info"
|
|
|
|
+ id="purchaseOrderDetail-export-btn"
|
|
|
|
+ :disabled="localDataSource.length==0"
|
|
|
|
+ @click="handlePrint('exportProduct')">导出产品</a-button>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
<!-- 基础信息 -->
|
|
<!-- 基础信息 -->
|
|
@@ -145,7 +160,7 @@
|
|
<script>
|
|
<script>
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import { purchaseDetailBySn, purchaseDetailPrint, purchaseDetailExport } from '@/api/purchase'
|
|
|
|
|
|
+import { purchaseDetailBySn, purchaseDetailPrint, purchaseDetailExport, purchaseExportDetail } from '@/api/purchase'
|
|
import { purchaseDetailList } from '@/api/purchaseDetail'
|
|
import { purchaseDetailList } from '@/api/purchaseDetail'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect },
|
|
components: { STable, VSelect },
|
|
@@ -209,6 +224,10 @@ export default {
|
|
url = purchaseDetailExport
|
|
url = purchaseDetailExport
|
|
params = { sn: this.$route.params.sn }
|
|
params = { sn: this.$route.params.sn }
|
|
}
|
|
}
|
|
|
|
+ if (type == 'exportProduct') {
|
|
|
|
+ url = purchaseExportDetail
|
|
|
|
+ params = { sn: this.$route.params.sn }
|
|
|
|
+ }
|
|
url(params).then(res => {
|
|
url(params).then(res => {
|
|
_this.spinning = false
|
|
_this.spinning = false
|
|
if (res.type == 'application/json') {
|
|
if (res.type == 'application/json') {
|
|
@@ -222,8 +241,8 @@ export default {
|
|
})
|
|
})
|
|
reader.readAsText(res)
|
|
reader.readAsText(res)
|
|
} else {
|
|
} else {
|
|
- if (type == 'export') { // 导出
|
|
|
|
- this.download(res)
|
|
|
|
|
|
+ if (type == 'export' || type == 'exportProduct') { // 导出
|
|
|
|
+ this.download(res, type)
|
|
} else {
|
|
} else {
|
|
this.print(res, type)
|
|
this.print(res, type)
|
|
}
|
|
}
|
|
@@ -243,14 +262,19 @@ export default {
|
|
window.frames['printfpod'].print()
|
|
window.frames['printfpod'].print()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- download (data) {
|
|
|
|
|
|
+ download (data, type) {
|
|
if (!data) { return }
|
|
if (!data) { return }
|
|
const url = window.URL.createObjectURL(new Blob([data]))
|
|
const url = window.URL.createObjectURL(new Blob([data]))
|
|
const link = document.createElement('a')
|
|
const link = document.createElement('a')
|
|
link.style.display = 'none'
|
|
link.style.display = 'none'
|
|
link.href = url
|
|
link.href = url
|
|
const a = moment().format('YYYYMMDDHHmmss')
|
|
const a = moment().format('YYYYMMDDHHmmss')
|
|
- const fname = '采购' + a
|
|
|
|
|
|
+ let fname = ''
|
|
|
|
+ if (type == 'export') {
|
|
|
|
+ fname = '采购' + a
|
|
|
|
+ } else if (type == 'exportProduct') {
|
|
|
|
+ fname = '采购产品' + a
|
|
|
|
+ }
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
link.setAttribute('download', fname + '.xlsx')
|
|
document.body.appendChild(link)
|
|
document.body.appendChild(link)
|
|
link.click()
|
|
link.click()
|