瀏覽代碼

新增工厂排产判断

695593266@qq.com 2 月之前
父節點
當前提交
7148b41b95
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      src/views/productionPlan/index.vue

+ 10 - 1
src/views/productionPlan/index.vue

@@ -1397,7 +1397,16 @@
       },
 
       productionSchedulingSuccess(data) {
-        // data.productionPlanIds = this.selection.map((i) => i.id);
+        const missingBom = this.selection.filter((item) => !item.bomCategoryId);
+        if (this.selection.length > 0 && missingBom.length > 0) {
+          const codes = missingBom
+            .map((item) => item.code)
+            .filter((c) => c != null && c !== '')
+            .join('、');
+          return this.$message.warning(
+            `计划编码【${codes || '未知'}】没有定义BOM,请先添加BOM!`
+          );
+        }
         this.$refs.newFactoryProductionSchedulingRef.open({
           selectedPlans: this.selection,
           allPlans: this.allPlanTableData