浏览代码

打印完成添加loading框

panxuejun 1 年之前
父节点
当前提交
198a6c4faa

+ 4 - 2
src/renderer/components/views/receiveDeliveryNote.vue

@@ -27,7 +27,7 @@
         </a-form-model-item>
       </a-form-model>
       <div class="table-operator">
-        <a-button type="primary" @click="createAndPrint"  style="width: 120px;height:40px" size="large">
+        <a-button type="primary" @click="createAndPrint"  style="width: 120px;height:40px" size="large" :loading="loading">
           创建并打印
         </a-button>
 <!--        <a-button type="primary" @click="print" style="height:60px;width: 100px;margin-left: 480px" size="large">-->
@@ -150,6 +150,7 @@ export default {
       columns,
       selectedRowKeys: [],
       selectedRows: [],
+      loading: false,
       rowSelection: {
         onChange: (selectedRowKeys, selectedRows) => {
           this.selectedRowKeys = selectedRowKeys;
@@ -243,7 +244,7 @@ export default {
         this.$message.info('请选择交货单打印!', 2);
         return;
       }
-
+      self.loading = true
       var video = self.video;
       var canvas = self.canvas;
       // Get access to the camera!
@@ -295,6 +296,7 @@ export default {
           // })
           self.axios.post('/Print/createAndPrintReceiveDeliveryNote.action',formData,config)
                   .then(function (res) {
+                    self.loading = false
                     console.log(res)
                     if (res.data.code === "success") {
                       const msg = res.data.data

+ 4 - 2
src/renderer/components/views/sendDeliveryNote.vue

@@ -13,7 +13,7 @@
                 </a-form-model-item>
             </a-form-model>
             <div class="table-operator">
-                <a-button type="primary" @click="print" size="large">
+                <a-button type="primary" @click="print" size="large" :loading="loading">
                     打印交货单
                 </a-button>
             </div>
@@ -88,6 +88,7 @@ export default {
         return {
             searchModel: {deliveryNote: undefined},
             list: [],
+            loading: false,
             columns,
             selectedRowKeys: [],
             rowSelection: {
@@ -157,7 +158,7 @@ export default {
                 this.$message.info('请选择交货单打印!', 2);
                 return;
             }
-
+            self.loading = true
             var video = self.video;
             var canvas = self.canvas;
             // Get access to the camera!
@@ -195,6 +196,7 @@ export default {
                 };
                 self.axios.post('/Print/printSendDeliveryNote.action',data,config)
                     .then(function (res) {
+                      self.loading = false
                         console.log(res)
                         if (res.data.code === "success") {
                             const msg = res.data.data