quwangxin 2 سال پیش
والد
کامیت
f7bc4c0c38

+ 25 - 0
src/views/produceOrder/components/report/Common.vue

@@ -275,6 +275,27 @@
             this.getReportCount();
           }
         }
+      },
+      infoData: {
+        immediate: true,
+        handler () {
+          if (this.infoData.id) {
+            // 设备
+            this.workReportDeviceList = Object.assign(
+              {},
+              this.workReportDeviceList,
+              {
+                code: this.infoData.deviceCode,
+                name: this.infoData.deviceName,
+                rootCategoryLevelId: this.infoData.rootCategoryLevelId,
+                path: this.infoData.path[0]?.pathName,
+                model: this.infoData.model,
+                sourceCategoryId: this.infoData.sourceCategoryId,
+                specification: this.infoData.specification
+              }
+            );
+          }
+        }
       }
     },
     methods: {
@@ -304,6 +325,10 @@
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            if (!this.workReportDeviceList.code) {
+              return this.$message.error('请选择设备');
+            }
+
             this.$confirm('是否确定要报工?', '提示').then(() => {
               this.categoryMsg = Object.assign(this.categoryMsg, {
                 brandNum: this.infoData.brandNo,

+ 10 - 5
src/views/produceOrder/components/report/Extrusion.vue

@@ -375,11 +375,12 @@
               this.workReportDeviceList,
               {
                 code: this.infoData.deviceCode,
-                name: this.infoData.deviceName
-                // path: this.infoData.,
-                // model: this.infoData.,
-                // rootCategoryLevelId: this.infoData.,
-                // specification: this.infoData.
+                name: this.infoData.deviceName,
+                rootCategoryLevelId: this.infoData.rootCategoryLevelId,
+                path: this.infoData.path[0]?.pathName,
+                model: this.infoData.model,
+                sourceCategoryId: this.infoData.sourceCategoryId,
+                specification: this.infoData.specification
               }
             );
           }
@@ -447,6 +448,10 @@
       report (fun) {
         this.$refs.formRef.validate((value, error) => {
           if (value) {
+            if (!this.workReportDeviceList.code) {
+              return this.$message.error('请选择设备');
+            }
+
             this.$confirm('是否确定要报工?', '提示').then(() => {
               const workReportDeviceList = [];
               if (this.workReportDeviceList.code) {

+ 25 - 0
src/views/produceOrder/components/report/Furnace.vue

@@ -146,6 +146,27 @@
             this.getReportCount();
           }
         }
+      },
+      infoData: {
+        immediate: true,
+        handler () {
+          if (this.infoData.id) {
+            // 设备
+            this.workReportDeviceList = Object.assign(
+              {},
+              this.workReportDeviceList,
+              {
+                code: this.infoData.deviceCode,
+                name: this.infoData.deviceName,
+                rootCategoryLevelId: this.infoData.rootCategoryLevelId,
+                path: this.infoData.path[0]?.pathName,
+                model: this.infoData.model,
+                sourceCategoryId: this.infoData.sourceCategoryId,
+                specification: this.infoData.specification
+              }
+            );
+          }
+        }
       }
     },
     created () {
@@ -180,6 +201,10 @@
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            if (!this.workReportDeviceList.code) {
+              return this.$message.error('请选择设备');
+            }
+
             this.$confirm('是否确定要报工?', '提示').then(() => {
               this.categoryMsg = Object.assign(this.categoryMsg, {
                 brandNum: this.infoData.brandNo,

+ 24 - 0
src/views/produceOrder/components/report/HalfAdded.vue

@@ -297,6 +297,27 @@
             this.getReportCount();
           }
         }
+      },
+      infoData: {
+        immediate: true,
+        handler () {
+          if (this.infoData.id) {
+            // 设备
+            this.workReportDeviceList = Object.assign(
+              {},
+              this.workReportDeviceList,
+              {
+                code: this.infoData.deviceCode,
+                name: this.infoData.deviceName,
+                rootCategoryLevelId: this.infoData.rootCategoryLevelId,
+                path: this.infoData.path[0]?.pathName,
+                model: this.infoData.model,
+                sourceCategoryId: this.infoData.sourceCategoryId,
+                specification: this.infoData.specification
+              }
+            );
+          }
+        }
       }
     },
     created () {
@@ -345,6 +366,9 @@
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            if (!this.workReportDeviceList.code) {
+              return this.$message.error('请选择设备');
+            }
             this.$confirm('是否确定要报工?', '提示').then(() => {
               this.categoryMsg = Object.assign(this.categoryMsg, {
                 brandNum: this.infoData.brandNo,

+ 24 - 0
src/views/produceOrder/components/report/Heating.vue

@@ -306,6 +306,27 @@
             this.getReportCount();
           }
         }
+      },
+      infoData: {
+        immediate: true,
+        handler () {
+          if (this.infoData.id) {
+            // 设备
+            this.workReportDeviceList = Object.assign(
+              {},
+              this.workReportDeviceList,
+              {
+                code: this.infoData.deviceCode,
+                name: this.infoData.deviceName,
+                rootCategoryLevelId: this.infoData.rootCategoryLevelId,
+                path: this.infoData.path[0]?.pathName,
+                model: this.infoData.model,
+                sourceCategoryId: this.infoData.sourceCategoryId,
+                specification: this.infoData.specification
+              }
+            );
+          }
+        }
       }
     },
     created () {
@@ -354,6 +375,9 @@
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            if (!this.workReportDeviceList.code) {
+              return this.$message.error('请选择设备');
+            }
             this.$confirm('是否确定要报工?', '提示').then(() => {
               this.categoryMsg = Object.assign(this.categoryMsg, {
                 brandNum: this.infoData.brandNo,

+ 24 - 0
src/views/produceOrder/components/report/Sinter.vue

@@ -130,6 +130,27 @@
             this.getReportCount();
           }
         }
+      },
+      infoData: {
+        immediate: true,
+        handler () {
+          if (this.infoData.id) {
+            // 设备
+            this.workReportDeviceList = Object.assign(
+              {},
+              this.workReportDeviceList,
+              {
+                code: this.infoData.deviceCode,
+                name: this.infoData.deviceName,
+                rootCategoryLevelId: this.infoData.rootCategoryLevelId,
+                path: this.infoData.path[0]?.pathName,
+                model: this.infoData.model,
+                sourceCategoryId: this.infoData.sourceCategoryId,
+                specification: this.infoData.specification
+              }
+            );
+          }
+        }
       }
     },
     methods: {
@@ -155,6 +176,9 @@
       report (fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
+            if (!this.workReportDeviceList.code) {
+              return this.$message.error('请选择设备');
+            }
             this.$confirm('是否确定要报工?', '提示').then(() => {
               fun({
                 checkState: 1,