yusheng 11 месяцев назад
Родитель
Сommit
40872ba719

+ 23 - 15
src/views/saleManage/saleOrder/index.vue

@@ -60,10 +60,7 @@
                   type="primary"
                   icon="el-icon-plus"
                   class="ele-btn-icon"
-                v-if="$hasPermission('eom:saleManage:invoiceAll')"
-
                   @click="invoiceAll"
-               
                   :disabled="selection?.length === 0"
                 >
                   批量发货
@@ -662,19 +659,30 @@
         }
       },
 
-      invoiceAll(){
+      invoiceAll() {
         let partaIds = this.selection.map((item) => item.partaId);
-          if (new Set(partaIds).size != 1) {
-            return this.$message.warning('请选择相同客户的订单!');
-          }
-          if (
-            this.selection.filter((item) => item.needProduce == 4)?.length &&
-            this.selection.filter((item) => item.needProduce == 4)?.length !=
-              this.selection.length
-          ) {
-            return this.$message.warning('不定向订单不能与其它类型的订单一起创建发货单!');
-          }
-        this.$refs.invoiceDialogRef.open('add', {}, this.selection.map((item) => item.id));
+        if (new Set(partaIds).size != 1) {
+          return this.$message.warning('请选择相同客户的订单!');
+        }
+        let saleTypeS = this.selection.map((item) => item.saleType);
+        if (new Set(saleTypeS).size != 1) {
+          return this.$message.warning('请选择相同销售类型的订单!');
+        }
+        
+        if (
+          this.selection.filter((item) => item.needProduce == 4)?.length &&
+          this.selection.filter((item) => item.needProduce == 4)?.length !=
+            this.selection.length
+        ) {
+          return this.$message.warning(
+            '不定向订单不能与其它类型的订单一起创建发货单!'
+          );
+        }
+        this.$refs.invoiceDialogRef.open(
+          'add',
+          {},
+          this.selection.map((item) => item.id)
+        );
       },
       //点击左边分类
       handleNodeClick(data, node) {

+ 7 - 1
src/views/saleManage/saleOrder/invoice/components/orderListDialog.vue

@@ -294,12 +294,18 @@
           if (new Set(partaIds).size != 1) {
             return this.$message.warning('请选择相同客户的订单!');
           }
+          let saleTypeS = this.selection.map((item) => item.saleType);
+          if (new Set(saleTypeS).size != 1) {
+            return this.$message.warning('请选择相同销售类型的订单!');
+          }
           if (
             this.selection.filter((item) => item.needProduce == 4)?.length &&
             this.selection.filter((item) => item.needProduce == 4)?.length !=
               this.selection.length
           ) {
-            return this.$message.warning('不定向订单不能与其它类型的订单一起创建发货单!');
+            return this.$message.warning(
+              '不定向订单不能与其它类型的订单一起创建发货单!'
+            );
           }
         }
         this.$emit(

+ 2 - 12
src/views/saleManage/saleOrder/invoice/index.vue

@@ -520,22 +520,12 @@
               businessName: res.contactName,
               businessType: '销售发货单'
             }
-            // callBackMethodType : '1',
-            // callBackMethod : 'proTargetPlanApproveApiImpl.updatePlanApprovalStatus',
-            // pcHandle : '/bpm/handleTask/components/project-manage/plan-manage/submit.vue',
-            // pcView : '/bpm/handleTask/components/project-manage/plan-manage/detailDialog.vue',
-            // miniHandle : '',
-            // miniView : '',
+
           };
 
           this.$refs.processSubmitDialogRef.init(params);
         });
-        // submit({
-        //   businessId: res.id
-        // }).then((res) => {
-        //   this.$message.success('提交成功!');
-        //   this.reload();
-        // });
+      
       },
       //查看详情
       openorderDetail(row, type, index) {