Pārlūkot izejas kodu

isSapReportState

quwangxin 2 gadi atpakaļ
vecāks
revīzija
f6dac746ed

+ 1 - 0
src/views/produceOrder/components/report/Extrusion.vue

@@ -515,6 +515,7 @@
               }
               fun({
                 checkState: 1,
+                isSapReportState: 1,
                 workReport: this.workReport,
                 workReportCategoryList: [this.categoryMsg],
                 workReportDeviceList

+ 31 - 26
src/views/produceOrder/components/report/Warehousing.vue

@@ -39,7 +39,7 @@
             type="datetime"
             format="yyyy-MM-dd HH:mm:ss"
             placeholder="请选择"
-			:disabled="formData.dateType==2"
+            :disabled="formData.dateType == 2"
           ></el-date-picker
         ></el-form-item>
       </div>
@@ -129,20 +129,20 @@
         type: Object,
         default: () => ({})
       },
-		formData: {
-		  type: Object,
-		  default: () => ({})
-		},
-		firstInfo:{
-		  type: Object,
-		  default: () => ({})
-		},
-		currentInfo:{
-			type: Object,
-			default: () => ({}) 
-		}
+      formData: {
+        type: Object,
+        default: () => ({})
+      },
+      firstInfo: {
+        type: Object,
+        default: () => ({})
+      },
+      currentInfo: {
+        type: Object,
+        default: () => ({})
+      }
     },
-    data () {
+    data() {
       return {
         workReport: {
           executorId: '',
@@ -174,27 +174,31 @@
     watch: {
       taskInfo: {
         immediate: true,
-        handler () {
+        handler() {
           if (this.taskInfo.code) {
             this.getReportCount();
           }
         }
       },
-	  formData: {
-	    immediate: true,
-	    handler () {
-	  		if (this.formData.dateType==2) {
-	  			this.$set(this.workReport,'executeTime',this.formData.appointTime);
-	  		}
-	    }
-	  }
+      formData: {
+        immediate: true,
+        handler() {
+          if (this.formData.dateType == 2) {
+            this.$set(
+              this.workReport,
+              'executeTime',
+              this.formData.appointTime
+            );
+          }
+        }
+      }
     },
-    created () {
+    created() {
       this.workReport.executorId = this.$store.state.user.info?.userId;
       this.workReport.executorJobNum = this.$store.state.user.info?.jobNumber;
     },
     methods: {
-      async getReportCount () {
+      async getReportCount() {
         const res = await reportCount({
           taskCode: this.taskInfo.code,
           lastTaskCode: this.taskInfo.lastTaskCode,
@@ -203,7 +207,7 @@
 
         this.countMsg = res;
       },
-      report (fun) {
+      report(fun) {
         this.$refs.formRef.validate((value) => {
           if (value) {
             this.$confirm('是否确定要报工?', '提示').then(() => {
@@ -217,6 +221,7 @@
               this.workReport.productInfo.standardNum = this.categoryMsg.number;
               fun({
                 checkState: 3,
+                isSapReportState: 3,
                 workReport: this.workReport,
                 workReportCategoryList: [this.categoryMsg]
               }).then((res) => {

+ 12 - 12
src/views/produceOrder/report.vue

@@ -123,8 +123,8 @@
         :key="activeName + isUpdate"
         :infoData="infoData"
         :formData="formData"
-		:firstInfo="tabList[0]"
-		:currentInfo="tabList[activeName]"
+        :firstInfo="tabList[0]"
+        :currentInfo="tabList[activeName]"
         :taskInfo="{
           ...tabList[activeName],
           lastTaskCode:
@@ -163,7 +163,7 @@
       Furnace,
       Warehousing
     },
-    data () {
+    data() {
       return {
         infoData: {},
         isUpdate: true,
@@ -196,7 +196,7 @@
       };
     },
     computed: {
-      componentName () {
+      componentName() {
         const { name } = this.tabList[this.activeName];
 
         if (name.includes('半加')) {
@@ -207,12 +207,12 @@
         );
       }
     },
-    created () {
+    created() {
       this.init();
       this.getInfoData();
     },
     methods: {
-      handleReport () {
+      handleReport() {
         this.$refs.reportRef.report(async (data) => {
           // data.workReportCategoryList = data.workReportCategoryList || [
           //   {
@@ -231,7 +231,7 @@
           }
 
           const params = {
-            isSapReportState: 0,
+            isSapReportState: 2, //sap报工状态(0:不调用SAP接口报工;1:投料;2:报工;3:入库)
             lastTaskCode:
               this.tabList[
                 this.activeName > 0 ? this.activeName - 1 : this.activeName
@@ -246,15 +246,15 @@
           });
         });
       },
-      async init () {
+      async init() {
         await this.getDetail();
         await this._getTaskListById();
       },
-      async getDetail () {
+      async getDetail() {
         const res = await getById(this.$route.query.id);
         this.infoData = res;
       },
-      async _getTaskListById () {
+      async _getTaskListById() {
         // 获取工序
         const res1 = await getTaskListById(this.infoData.produceVersionId);
 
@@ -262,11 +262,11 @@
         this.tabList.push({
           name: '入库',
           code: '999999',
-		  sortNum:99
+          sortNum: 99
         });
         this.activeName = '0';
       },
-      async getInfoData () {
+      async getInfoData() {
         const res = await getInfo();
         if (typeof res != 'string') {
           this.formData = res;