Compare commits
No commits in common. "609d31b5f5857212d34677da1d0ecbee02122b1a" and "e126df1c805b736e0af6aefac06de1577869aad8" have entirely different histories.
609d31b5f5
...
e126df1c80
@ -59,7 +59,6 @@
|
|||||||
<div class="opaBox">
|
<div class="opaBox">
|
||||||
<el-button type="primary" @click="handleAdd"><el-icon><Plus /></el-icon> 新增</el-button>
|
<el-button type="primary" @click="handleAdd"><el-icon><Plus /></el-icon> 新增</el-button>
|
||||||
<el-button type="primary" v-if="role" :disabled="!chooseList.length" @click="lte_stock = 0, showStock = true">设置预警库存</el-button>
|
<el-button type="primary" v-if="role" :disabled="!chooseList.length" @click="lte_stock = 0, showStock = true">设置预警库存</el-button>
|
||||||
<el-button type="warning" @click="handleExport" :loading="exportLoading"><span class="iconfont icon-daochu"></span> 导出</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<el-table :data="tableList" style="width: 100%" border v-loading="loading" @select="select"
|
<el-table :data="tableList" style="width: 100%" border v-loading="loading" @select="select"
|
||||||
ref="multipleTable" @select-all="selectAll">
|
ref="multipleTable" @select-all="selectAll">
|
||||||
@ -280,8 +279,7 @@ export default {
|
|||||||
chooseList: [],
|
chooseList: [],
|
||||||
lte_stock: 0,
|
lte_stock: 0,
|
||||||
showStock: false,
|
showStock: false,
|
||||||
showUpdate: false,
|
showUpdate: false
|
||||||
exportLoading: false
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function handleSearch() {
|
function handleSearch() {
|
||||||
@ -308,44 +306,6 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleExport = () => {
|
|
||||||
data.exportLoading = true
|
|
||||||
let params = {
|
|
||||||
page: data.page,
|
|
||||||
pageSize: data.pageSize,
|
|
||||||
service_id: data.service_id,
|
|
||||||
...data.filter,
|
|
||||||
brand_ids: data.brandIds.join(','),
|
|
||||||
goods_ids: data.goodsIds.join(','),
|
|
||||||
export: 1
|
|
||||||
}
|
|
||||||
get(`/api/goods-skus`, params, 'blob').then((res) => {
|
|
||||||
downLoadXls(res)
|
|
||||||
ElMessage({ type: "success", message: "导出成功!" })
|
|
||||||
data.exportLoading = false
|
|
||||||
}).catch(() => {
|
|
||||||
data.exportLoading = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function downLoadXls(response) {
|
|
||||||
const content = response
|
|
||||||
const blob = new Blob([content])
|
|
||||||
const fileName = `商品规格.xlsx`
|
|
||||||
if ('download' in document.createElement('a')) {
|
|
||||||
const elink = document.createElement('a')
|
|
||||||
elink.download = fileName
|
|
||||||
elink.style.display = 'none'
|
|
||||||
elink.href = URL.createObjectURL(blob)
|
|
||||||
document.body.appendChild(elink)
|
|
||||||
elink.click()
|
|
||||||
URL.revokeObjectURL(elink.href)
|
|
||||||
document.body.removeChild(elink)
|
|
||||||
} else {
|
|
||||||
navigator.msSaveBlob(blob, fileName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleCurrentChange(e) {
|
function handleCurrentChange(e) {
|
||||||
data.page = e
|
data.page = e
|
||||||
fetchData()
|
fetchData()
|
||||||
@ -499,7 +459,6 @@ export default {
|
|||||||
handleSearch,
|
handleSearch,
|
||||||
handleCurrentChange,
|
handleCurrentChange,
|
||||||
handleSizeChange,
|
handleSizeChange,
|
||||||
handleExport,
|
|
||||||
fetchData,
|
fetchData,
|
||||||
handleAdd,
|
handleAdd,
|
||||||
handleEdit,
|
handleEdit,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user