Browse Source

完善收货单--打印入库单

master
yunuo970428 4 weeks ago
parent
commit
88228386d3
  1. 9
      yxt-as-ui/src/api/storage/receivingGoods.js
  2. 44
      yxt-as-ui/src/views/storage/receivingGoods/index.vue

9
yxt-as-ui/src/api/storage/receivingGoods.js

@ -68,5 +68,14 @@ export default {
'Content-Type': 'application/json'
}
})
},
// 打印
printReceiptBillPdf: function(data) {
return request({
url: '/wms/apiadmin/inventory/WmsReceiptBill/printReceiptBillPdf',
method: 'post',
params: data,
headers: { 'Content-Type': 'application/json' }
})
}
}

44
yxt-as-ui/src/views/storage/receivingGoods/index.vue

@ -102,7 +102,7 @@
<!-- 上架单新增 -->
<upShelfAdd v-show="viewState == 5" ref="upShelfAdd" @doback="resetState" @reloadlist="loadList" />
<!-- 上架单详情 -->
<upShelfInfo v-show="viewState == 6" ref="upShelfInfo" @doback2="resetState2" @reloadlist="loadList" />
<upShelfInfo v-show="viewState == 6" ref="upShelfInfo" @doback="resetState2" @reloadlist="loadList" />
<el-dialog title="上架单列表" :visible.sync="dialogVisible" :before-close="handleClose">
<el-table :data="upShelfList" border style="width: 100%;margin-top: -30px;">
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod2" align="center" />
@ -129,6 +129,7 @@ import divInfo from './receivingGoodsInfo.vue'
import upShelfAdd from '../upShelf/upShelfAdd.vue'
import upShelfInfo from '../upShelf/upShelfInfo.vue'
import { typeValues } from '@/api/Common/dictcommons'
import { getStorage } from '@/utils/auth'
export default {
components: {
@ -340,21 +341,38 @@ export default {
this.loadList()
},
toPrint() {
for (var i = 0; i < this.selectionList.length; i++) {
if (this.selectionList[i].billState !== '已完成') {
this.$message({
type: 'warning',
message: '只能选择已完成的记录。',
showClose: true
if (this.sids.length === 1) {
if (this.selectionList[0].billState === '已完成') {
req.printReceiptBillPdf({ sid: this.sids[0] }).then((res) => {
if (res.success) {
var xhr = new XMLHttpRequest()
xhr.open('GET', process.env.VUE_APP_BASE_API + '/base/file/download?filePath=' + res.data + '&outFileName=' + '入库单', true)
xhr.setRequestHeader('token', getStorage())
xhr.responseType = 'blob'
xhr.onload = function(e) {
//
var blob = this.response
var filename = '入库单.pdf'
var a = document.createElement('a')
// blob.type="application/octet-stream";
// url
var url = URL.createObjectURL(blob)
a.href = url
a.download = filename
a.click()
// URL
window.URL.revokeObjectURL(url)
}
//
xhr.send()
}
})
return
} else {
this.$message({ type: 'warning', message: '请选择单据状态为已完成的记录进行操作', showClose: true })
}
} else {
this.$message({ showClose: true, type: 'warning', message: '请选择一条记录进行操作' })
}
this.$message({
type: 'warning',
message: '打印功能正在完善中。',
showClose: true
})
},
toAdd() {
if (this.selectionList.length !== 1) {

Loading…
Cancel
Save