浏览代码

Merge branch 'master' of http://139.196.39.194:9021/chenc/sen-yu-new-web

fenghaifu 2 年之前
父节点
当前提交
75c4508601

+ 5 - 1
src/api/document/advance-packingList.js

@@ -34,8 +34,12 @@ const batchSubmit = params => getAction('/spapl/syPreAssembledPackingList/submit
 //批量推送
 const batchPush = params => getAction('/spapl/syPreAssembledPackingList/pushBatch', params)
 
+//批量取消推送
+const batchCanelSubmit = params => getAction('/spapl/syPreAssembledPackingList/cancelSubmitBatch', params)
+
+
 //推送
 const push = params => getAction('/spapl/syPreAssembledPackingList/push', params)
 
 
-export { getadPaList, deleteAdPaList, itemByMainId, editById, addAdvPac, shipList, queryShippingDetails, submit, cancelSubmit,batchSubmit ,batchPush,push}
+export { getadPaList, deleteAdPaList, itemByMainId, editById, addAdvPac, shipList, queryShippingDetails, submit, cancelSubmit,batchSubmit ,batchPush,push,batchCanelSubmit}

+ 10 - 1
src/api/document/packing-list/packinglist-clothes.js

@@ -30,5 +30,14 @@ const SubmitList = params => getAction('/splt/syPackingListTailoring/submit', pa
 //取消提交
 const cancelSubmitList = params => getAction('/splt/syPackingListTailoring/cancelSubmit', params)
 
-export {spltList,orderSpltList,deleteSpltList,batchDelete,orderSpltListId,editSpltList,addSpltList,spltListId,SubmitList,cancelSubmitList}
+//批量提交
+const bitchSubmitList = params => getAction('/splt/syPackingListTailoring/submitBatch', params)
+
+//批量取消提交
+const bitchCancelSubmitList = params => getAction('/splt/syPackingListTailoring/cancelSubmitBatch', params)
+
+
+
+
+export {spltList,orderSpltList,deleteSpltList,batchDelete,orderSpltListId,editSpltList,addSpltList,spltListId,SubmitList,cancelSubmitList,bitchSubmitList,bitchCancelSubmitList}
 

+ 56 - 24
src/views/advance-packingList/adPaList-clothes.vue

@@ -93,6 +93,7 @@
           <a-button type="primary" icon="import">导入</a-button>
         </a-upload>
         <a-button type="primary" @click="batchSubmit" icon="plus">批量提交</a-button>
+        <a-button type="primary" @click="batchCanelSubmit" icon="plus">批量取消提交</a-button>
         <a-button type="primary" @click="batchPush" icon="plus">批量推送</a-button>
       </div>
 
@@ -139,11 +140,11 @@
                 <a @click="edit(record)">编辑</a>
               </a-menu-item>
 
-              <a-menu-item>
+              <!-- <a-menu-item>
                 <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
                   <a href="javascript:void(0);" style="color:green;">提交</a>
                 </a-popconfirm>
-              </a-menu-item>
+              </a-menu-item> -->
 
               <a-menu-item>
                 <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
@@ -178,11 +179,11 @@
                 <a @click="details(record)">详情</a>
               </a-menu-item>
 
-              <a-menu-item>
+              <!-- <a-menu-item>
                 <a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancelSubmit(record)">
                   <a href="javascript:void(0);" style="color:red;">取消提交</a>
                 </a-popconfirm>
-              </a-menu-item>
+              </a-menu-item> -->
 
               <a-menu-item>
                 <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
@@ -229,7 +230,7 @@ import moment from 'moment'
 import addAdpackingDrawer from '@views/advance-packingList/addAdpackingDrawer.vue'
 import detailsAdpackingDrawer from '@views/advance-packingList/detailsAdpackingDrawer.vue'
 
-import { getadPaList, itemByMainId, submit, cancelSubmit, deleteAdPaList,batchSubmit,batchPush,push} from '@api/document/advance-packingList.js'
+import { getadPaList, itemByMainId, submit, cancelSubmit, deleteAdPaList,batchSubmit,batchPush,push,batchCanelSubmit} from '@api/document/advance-packingList.js'
 
 export default {
   productName: 'AdPaListClothes', // 预装箱单-成衣
@@ -645,20 +646,25 @@ export default {
         })
       })
     },
-    // 取消提交
-    cancelSubmit(record){
-      var that = this;
-      this.$nextTick(() => {
-        cancelSubmit({ id: record.id }).then(res => {
-          if (res.success) {
-            record.status=0;
-            that.$message.success('取消提交成功');
-          }else{
-            that.$message.error(res.message);
-          }
-        })
-      })
-    },
+    // // 取消提交
+    // cancelSubmit(record){
+    //   var that = this;
+    //   this.$nextTick(() => {
+    //     if(record.isReference == 2){
+    //       that.$message.error('不可取消提交!');
+    //     }else {
+    //       cancelSubmit({ id: record.id }).then(res => {
+    //       if (res.success) {
+    //         record.status=0;
+    //         that.$message.success('取消提交成功');
+    //       }else{
+    //         that.$message.error(res.message);
+    //       }
+    //      })
+    //     }
+        
+    //   })
+    // },
 
     //批量提交
     batchSubmit(){
@@ -667,25 +673,51 @@ export default {
             var tickRow = this.selectedRows[i]
             if(tickRow.status === '1'){
                var clo = i+1
-               this.$message.error("勾选的第"+clo+"行数据是已提交!");
+               this.$message.error("部分数据是已提交,请勿重复提交!");
                 return
              }
           }
           var ids = this.selectedRowKeys.toString()
           batchSubmit({ id: ids }).then(res => {
             if (res.success) {
-              this.selectedRows.map(item=>{
-               item.status = 1
-              })
+              this.getadPaListClothes()
               this.$message.success('批量提交成功');
+              this.selectedRowKeys = []
             }else {
              this.$message.error(res.message);
             }
           })
-          this.selectedRowKeys = []
         })
        },
+   //批量取消提交
+   batchCanelSubmit(){
+     this.$nextTick(() => {
+       for(var i =0;i<this.selectedRows.length;i++){
+            var tickRow = this.selectedRows[i]
+            if(tickRow.status === '0'){
+               this.$message.error("含有未提交数据,请重新选择!");
+                return
+             }
+          }
+            batchCanelSubmit({ ids:ids }).then(res => {
+            if (res.success) {
+              this.getadPaListClothes()
+              this.selectedRowKeys = []
+              this.$message.success('批量提交成功');
+            }else if(res.code == 111){
+              for(var i=0;i<this.selectedRows.length;i++){
+                if(res.result.indexOf(this.selectedRows[i].id) !== -1){
+                   this.$message.error(res.message+'(所选第'+(i+1) +'行数据)');
+                   return
+                }
+              }
+            }else {
+                   this.$message.error(res.message);
+            }
+          })
+        })
 
+   },
     //批量推送
     batchPush(){
       this.$nextTick(() => {

+ 49 - 4
src/views/packing-list/clothes-list.vue

@@ -89,6 +89,8 @@
       <div class="table-operator">
         <a-button type="primary" @click="openClothesAdd" icon="plus">新增</a-button>
         <a-button type="primary" @click="push" icon="export">推送</a-button>
+        <a-button type="primary" @click="bitchSubmit" icon="export">批量提交</a-button>
+        <a-button type="primary" @click="bitchCanelSubmit" icon="export">批量取消提交</a-button>
         <a-upload  name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"  @change="handleImportExcel" >
           <a-button type="primary" icon="import">导入</a-button>
         </a-upload>
@@ -163,7 +165,7 @@
           <a-dropdown>
             <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
             <a-menu slot="overlay" v-if="record.status == '0' || record.status == null">
-              <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="details(record)">详情</a></a-menu-item>
               <a-menu-item><a @click="edit(record)">编辑</a></a-menu-item>
               <a-menu-item>
@@ -179,11 +181,11 @@
                 <a @click="details(record)">详情</a>
               </a-menu-item>
 
-              <a-menu-item>
+              <!-- <a-menu-item>
                 <a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancelSubmit(record)">
                   <a href="javascript:void(0);" style="color:red;">取消提交</a>
                 </a-popconfirm>
-              </a-menu-item>
+              </a-menu-item> -->
               <!-- <a-menu-item>
                 <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
                   <a href="javascript:void(0);" style="color:green;">推送</a>
@@ -212,7 +214,7 @@ import JEllipsis from '@/components/jeecg/JEllipsis'
 import clothesAddDrawer from '@views/packing-list/packinglist-clothes/clothesAddDrawer.vue'
 import detailsClothesDrawer from '@views/packing-list/packinglist-clothes/detailsClothesDrawer.vue'
 import editClothesDrawer from '@views/packing-list/packinglist-clothes/editClothesDrawer.vue'
-import { spltList,deleteSpltList,spltListId,SubmitList,cancelSubmitList} from '@api/document/packing-list/packinglist-clothes'
+import { spltList,deleteSpltList,spltListId,SubmitList,cancelSubmitList,bitchSubmitList,bitchCancelSubmitList} from '@api/document/packing-list/packinglist-clothes'
 
 
 export default {
@@ -525,6 +527,49 @@ export default {
     },
     // 推送
     push() {},
+
+    //批量提交
+    bitchSubmit(){
+       for(var i =0;i<this.selectedRows.length;i++){
+            var tickRow = this.selectedRows[i]
+            if(tickRow.status === '1'){
+               this.$message.error("部分数据是已提交,请勿重复提交!");
+                return
+             }
+       }
+      var ids = this.selectedRowKeys.toString()
+       bitchSubmitList({ids : ids}).then(res =>{
+        if (res.success) {
+            this.getSpltList()
+            this.selectedRowKeys = []
+            this.$message.success('提交成功');
+          }else{
+            this.$message.error(res.message);
+          }
+     })
+    },
+
+    //批量取消提交
+    bitchCanelSubmit(){
+      for(var i =0;i<this.selectedRows.length;i++){
+            var tickRow = this.selectedRows[i]
+            if(tickRow.status === '0'){
+               this.$message.error("含未提交数据,请重新选择!");
+                return
+             }
+       }
+      var ids = this.selectedRowKeys.toString()
+       bitchCancelSubmitList({ids : ids}).then(res =>{
+        if (res.success) {
+            this.getSpltList()
+            this.selectedRowKeys = []
+            this.$message.success('取消提交成功');
+          }else{
+            this.$message.error(res.message);
+          }
+     })
+
+    },
     // 导入
     importData() {},
     // 新增