Переглянути джерело

托书批量提交批量取消提交

jbb 2 роки тому
батько
коміт
4e4969e6df
1 змінених файлів з 19 додано та 19 видалено
  1. 19 19
      src/views/book/book-list.vue

+ 19 - 19
src/views/book/book-list.vue

@@ -76,8 +76,8 @@
     <a-card :bordered="false" style="marginTop:10px;">
       <div class="table-operator">
         <a-button type="primary" @click="addBookDrawer" icon="plus">新增</a-button>
-        <!-- <a-button type="primary" @click="batchSubmit()"  icon="plus">批量提交</a-button>
-        <a-button type="primary" @click="batchCanaleSubmit()" icon="plus">批量取消提交</a-button> -->
+        <a-button type="primary" @click="batchSubmit()"  icon="plus">批量提交</a-button>
+        <a-button type="primary" @click="batchCanaleSubmit()" icon="plus">批量取消提交</a-button>
       </div>
 
       <!-- 子表 -->
@@ -117,7 +117,7 @@
           <a-dropdown>
             <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
             <a-menu slot="overlay" v-if="record.theDocumentsState == '0'">
-              <a-menu-item><a @click="submit(record)">提交</a></a-menu-item>
+              <!-- <a-menu-item><a @click="submit(record)">提交</a></a-menu-item> -->
               <a-menu-item><a @click="edit(record,'2')">详情</a></a-menu-item>
               <a-menu-item><a @click="edit(record,'1')">编辑</a></a-menu-item>
               <a-menu-item><a @click="print(record)">打印</a></a-menu-item>
@@ -128,7 +128,7 @@
               >
             </a-menu>
              <a-menu slot="overlay" v-if="record.theDocumentsState == '1'">
-              <a-menu-item><a @click="canaleSubmit(record)">取消提交</a></a-menu-item>
+              <!-- <a-menu-item><a @click="canaleSubmit(record)">取消提交</a></a-menu-item> -->
               <a-menu-item><a @click="edit(record,'2')">详情</a></a-menu-item>
             </a-menu>
           </a-dropdown>
@@ -355,21 +355,21 @@ export default {
       })
     },
     // //批量提交
-    // batchSubmit(){
-    //   this.$nextTick(() => {
-    //     submitPackingList({ id: this.selectedRowKeys, type: '1' }).then(res => {
-    //       if (res.success) {
-    //       //  record.theDocumentsState = '1'
-    //        this.getBookList()
-    //        this.$message.success('提交成功')
-    //        this.selectedRowKeys = []
-    //       }else {
-    //          this.$message.error(res.message);
-    //       }
-    //     })
-    //   })
+    batchSubmit(){
+      this.$nextTick(() => {
+        submitPackingList({ ids: this.selectedRowKeys, type: '1' }).then(res => {
+          if (res.success) {
+          //  record.theDocumentsState = '1'
+           this.getBookList()
+           this.$message.success('提交成功')
+           this.selectedRowKeys = []
+          }else {
+             this.$message.error(res.message);
+          }
+        })
+      })
 
-    // },
+    },
     //取消提交
     canaleSubmit(record) {
       this.$nextTick(() => {
@@ -386,7 +386,7 @@ export default {
     },
     batchCanaleSubmit(){
       this.$nextTick(() => {
-        submitPackingList({ id: this.selectedRowKeys, type: '2' }).then(res => {
+        submitPackingList({ ids: this.selectedRowKeys, type: '2' }).then(res => {
           if (res.success) {
            this.$message.success('取消提交成功')
           //  record.theDocumentsState = '0'