Browse Source

完善旧件盘点

master
guoxing 10 months ago
parent
commit
036bc7579c
  1. 75
      yxt-as-ui/src/views/storage/oldpPartStocktaking/oldpPartStocktakingReportDetail.vue
  2. 10
      yxt-as-ui/src/views/storage/stocktaking/index.vue

75
yxt-as-ui/src/views/storage/oldpPartStocktaking/oldpPartStocktakingReportDetail.vue

@ -4,7 +4,7 @@
<div class="tab-header webtop">
<div>盘库报告</div>
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="settle()">下载pdf</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="downLoadPDF()">下载pdf</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
@ -43,7 +43,7 @@
<div class="title titleOne">
<div>总体盘点情况</div>
<el-button type="primary" size="mini" class="btntopblueline" @click="seleMaintenance()">明细下载</el-button>
<el-button type="primary" size="mini" class="btntopblueline" @click="downLoadDetail()">明细下载</el-button>
</div>
<div style="display: flex;flex-direction: row;align-items: center;
@ -192,6 +192,77 @@
this.formobj = {}
this.submitdisabled = false
this.$emit('doback')
},
downLoadPDF() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.downloadPDF({
sid: this.formobj.sid
}).then((res) => {
if (res.success) {
loading.close()
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()
}
}).catch(() => {
console.log(22222222);
loading.close()
})
},
downLoadDetail() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.downloadExcel({
sid: this.formobj.sid
}).then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '总体盘库明细' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
}
}
}

10
yxt-as-ui/src/views/storage/stocktaking/index.vue

@ -406,21 +406,15 @@
}).then((res) => {
if (res.success) {
this.financeList = res.data
console.log("aaaaaa", this.financeList);
}
})
var parpams = {
req2.getAllWarehouse({
orgPath: window.sessionStorage.getItem('defaultOrgPath'),
}
req2.getAllWarehouse(parpams).then(resp => {
}).then(resp => {
this.warehouseList = resp.data
})
},
methods: {
getWarehouseArea(sid) {

Loading…
Cancel
Save