Commit bb74b1fc by zhuzhequan

按钮加loading

parent 1b9a33d0
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
> >
</span> </span>
<span v-if="statusCode === 2 || statusCode === 3" class="item"> <span v-if="statusCode === 2 || statusCode === 3" class="item">
<ElButton type="primary" dark @click="printManuscript" <ElButton :loading="btnLoading" type="primary" dark @click="printManuscript"
>打印生产单</ElButton >打印生产单</ElButton
> >
</span> </span>
...@@ -818,6 +818,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({ ...@@ -818,6 +818,7 @@ const [searchForm, resetSearchForm] = useValue<SearchForm>({
subOrderNumber: '', subOrderNumber: '',
}) })
const tabsNav = ref<Tab[]>([]) const tabsNav = ref<Tab[]>([])
const btnLoading = ref<Boolean>(false)
const statusCode = ref(2) const statusCode = ref(2)
const selection = ref<OrderData[]>([]) const selection = ref<OrderData[]>([])
...@@ -1059,6 +1060,7 @@ const printManuscript = async () => { ...@@ -1059,6 +1060,7 @@ const printManuscript = async () => {
offset: window.innerHeight / 2, offset: window.innerHeight / 2,
}) })
} }
const ids = selection.value.map((item) => item.id) const ids = selection.value.map((item) => item.id)
try { try {
await showConfirm('是否打印生产单', { await showConfirm('是否打印生产单', {
...@@ -1069,11 +1071,14 @@ const printManuscript = async () => { ...@@ -1069,11 +1071,14 @@ const printManuscript = async () => {
} catch { } catch {
return return
} }
btnLoading.value = true
try { try {
const res = await printOrder(ids) const res = await printOrder(ids)
btnLoading.value = false
window.open(filePath + res.message) window.open(filePath + res.message)
} catch (e) { } catch (e) {
showError(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