Browse Source

Merge branch 'mergeBranch' into orangeUrgent

qymljy 9 tháng trước cách đây
mục cha
commit
101816e259
1 tập tin đã thay đổi với 46 bổ sung14 xóa
  1. 46 14
      src/HDrpManagement/orderManage/details/tabs/confirmList.vue

+ 46 - 14
src/HDrpManagement/orderManage/details/tabs/confirmList.vue

@@ -297,7 +297,8 @@ export default {
       progressVisible:false,
       siteid:JSON.parse(sessionStorage.getItem('active_account')).siteid,
       jsDay:'',
-      jsYcDay:''
+      jsYcDay:'',
+      days:""
     }
   },
   methods:{
@@ -535,9 +536,6 @@ export default {
     },
     /*获取节假日数据*/
     async holiday(now,date,days,type,sa_orderitemsid){
-      console.log(now)
-      console.log(date)
-      console.log(days)
       let dateNow = new Date(now)
       let dateNow1 = new Date(date)
       let monthB = (dateNow.getMonth() + 1) > 10 ? dateNow.getMonth() + 1 : '0' + (dateNow.getMonth() + 1)
@@ -559,9 +557,7 @@ export default {
         }
       })
       this.jsDay = res.total
-      console.log(this.jsDay)
       if (this.jsDay >0){
-        console.log('进入了嘛')
         const dateAdd = this.addDaysToDate(date, this.jsDay)
         this.holidayE(now,dateAdd.toISOString().split('T')[0],Number(this.jsDay),type,sa_orderitemsid)
       }else {
@@ -574,7 +570,6 @@ export default {
       }
     },
     async holidayE(now,date,days,type,sa_orderitemsid){
-      console.log('进入了嘛22222')
       let dateNow = new Date(now)
       let dateNow1 = new Date(date)
       let monthB = (dateNow.getMonth() + 1) > 10 ? dateNow.getMonth() + 1 : '0' + (dateNow.getMonth() + 1)
@@ -595,17 +590,53 @@ export default {
           }
         }
       })
-      this.jsYcDay = res.total - this.jsDay
-      if (this.jsYcDay >0){
-        const dateAdd = this.addDaysToDate(date, this.jsYcDay)
+      this.days = res.total - this.jsDay
+      if (this.days >0){
+        this.jsYcDay = this.jsYcDay + this.days + this.jsDay
+        const dateAdd = this.addDaysToDate(date, this.days)
+        this.holidayS(now,dateAdd.toISOString().split('T')[0],Number(this.days),type,sa_orderitemsid)
+
+      }else {
         if (type == '单'){
-          this.dayChange(dateAdd.toISOString().split('T')[0],days,sa_orderitemsid)
+          this.dayChange(date,days,sa_orderitemsid)
         }else {
-          this.daysChange(dateAdd.toISOString().split('T')[0],this.value3)
+          this.daysChange(date,this.value3)
+        }
+      }
+    },
+    async holidayS(now,date,days,type,sa_orderitemsid){
+      let dateNow = new Date(now)
+      let dateNow1 = new Date(date)
+      let monthB = (dateNow.getMonth() + 1) > 10 ? dateNow.getMonth() + 1 : '0' + (dateNow.getMonth() + 1)
+      let dateB = dateNow.getDate() > 10 ? dateNow.getDate() : '0' +  dateNow.getDate()
+      let monthE = (dateNow1.getMonth() + 1) > 10 ? dateNow1.getMonth() + 1 : '0' + (dateNow1.getMonth() + 1)
+      let dateE = dateNow1.getDate() > 10 ? dateNow1.getDate() : '0' +  dateNow1.getDate()
+      const res = await this.$api.requested({
+        id:20221215165504,
+        content:{
+          isExport: 0,
+          isnext: "0",
+          pageNumber: 1,
+          pageSize: 100,
+          where:{
+            begindate: monthB + '-' + dateB,
+            condition: "",
+            enddate: monthE + '-' + dateE
+          }
         }
+      })
+      this.days = res.total - this.jsYcDay
+      if (this.days >0){
+        this.jsYcDay = this.jsYcDay + this.days
+        const dateAdd = this.addDaysToDate(date, this.days)
+        this.holidayS(now,dateAdd.toISOString().split('T')[0],Number(this.days),type,sa_orderitemsid)
+        // if (type == '单'){
+        //   this.dayChange(dateAdd.toISOString().split('T')[0],days,sa_orderitemsid)
+        // }else {
+        //   this.daysChange(dateAdd.toISOString().split('T')[0],this.value3)
+        // }
 
       }else {
-        console.log(date,'计算出来的日期')
         if (type == '单'){
           this.dayChange(date,days,sa_orderitemsid)
         }else {
@@ -634,7 +665,6 @@ export default {
           item.deliverydate = date
         }
       })
-      console.log(this.tableData,'22222')
       const res = await this.$api.requested({
         "id": 20221109093602,
         "content": {
@@ -648,6 +678,8 @@ export default {
       this.listData(this.param.content.pageNumber = 1)
     },
     setDeliveryDay(val,type,sa_orderitemsid){
+      this.jsYcDay = 0
+      this.jsDay = 0
       let nowDate = new Date()
       let year = nowDate.getFullYear()
       let month = (nowDate.getMonth() + 1) > 10 ? nowDate.getMonth() + 1 : '0' + (nowDate.getMonth() + 1)