Commit bb74b1fc by zhuzhequan

按钮加loading

parent 1b9a33d0
......@@ -135,7 +135,7 @@
>
</span>
<span v-if="statusCode === 2 || statusCode === 3" class="item">
<ElButton type="primary" dark @click="printManuscript"
<ElButton :loading="btnLoading" type="primary" dark @click="printManuscript"
>打印生产单</ElButton
>
</span>
......@@ -818,6 +818,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
subOrderNumber: '',
})
const tabsNav = ref<Tab[]>([])
const btnLoading = ref<Boolean>(false)
const statusCode = ref(2)
const selection = ref<OrderData[]>([])
......@@ -1059,6 +1060,7 @@ const printManuscript = async () => {
offset: window.innerHeight / 2,
})
}
const ids = selection.value.map((item) => item.id)
try {
await showConfirm('是否打印生产单', {
......@@ -1069,11 +1071,14 @@ const printManuscript = async () => {
} catch {
return
}
btnLoading.value = true
try {
const res = await printOrder(ids)
btnLoading.value = false
window.open(filePath + res.message)
} catch (e) {
showError(e)
btnLoading.value = false
}
}
// 导出生产单
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment