Parcourir la source

张丁 测试新的流程

zhangding il y a 3 ans
Parent
commit
95d7860d1b
1 fichiers modifiés avec 43 ajouts et 14 suppressions
  1. 43 14
      ui/src/views/invoice/bookingworkticket/index.vue

+ 43 - 14
ui/src/views/invoice/bookingworkticket/index.vue

@@ -146,11 +146,6 @@
               icon="el-icon-download"
               @click="handleDownload(scope.row)"
             >{{$t('下载申请单')}}</el-button>
-          <el-button
-            type="text"
-            size="mini"
-            @click="addAprrove(scope.row)"
-          >{{ $t('预约开票申请') }}</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -596,10 +591,7 @@ export default {
     },
     addAprrove(row) {
       this.reset();
-      const id = row.bookingticketId || this.ids
-      getBookingworkticket(id).then(response => {
-        this.ruleForm=response.data.tInvoiceWorkcontentList
-      });
+  
       var rows = row ? [row] : this.bookingworkticketList.map(item => {
         return item
       })
@@ -626,11 +618,7 @@ export default {
             this.approveForm.isSpecial = 1
           }
         this.approveForm.userSupId=row.bookingworkticket.userMg;
-        // this.approveForm.userSupId=10000;
-        // this.approveForm.devSupId=10081;
-        // this.approveForm.devEngineerId=10082;
-        // this.approveForm.managerconId=10084;
-        // this.$refs.addApprove.init(rows)
+    
         addInvoice(this.approveForm).then(response => {
           this.msgSuccess(this.$t('预约成功'));
           // this.visible = false;
@@ -691,6 +679,22 @@ export default {
         this.flag = false
       }
     },
+    //时间
+    getNowFormatDate() {
+        var date = new Date();
+        var seperator1 = "-";
+        var year = date.getFullYear();
+        var month = date.getMonth() + 1;
+        var strDate = date.getDate();
+        if (month >= 1 && month <= 9) {
+            month = "0" + month;
+        }
+        if (strDate >= 0 && strDate <= 9) {
+            strDate = "0" + strDate;
+        }
+        var currentdate = year + seperator1 + month + seperator1 + strDate;
+        return currentdate;
+    },
     // 重置方法
     resetForm1() {
       this.ruleForm = [{}]
@@ -865,6 +869,31 @@ export default {
             this.form.tInvoiceWorkcontentList=this.ruleForm
             this.form.floorLocation=this.form.floorLocation.join(',')
             addBookingworkticket(this.form).then(response => {
+              console.log(this.form)
+              console.log(this.ruleForm)
+            this.approveForm.invoiceId=response.data
+            var nowTime = this.getNowFormatDate()
+       
+             //判断是否涉及 动火 和当日
+            if ( this.form.workStartTime &&  this.form.workStartTime ===  nowTime){
+              this.approveForm.isToday = 1;
+            }else{
+                   this.approveForm.isToday = 0;
+            }
+            for(let i=0;i<this.ruleForm.length;i++){
+               if( this.ruleForm[i].workType===1||this.ruleForm[i].workType===2||
+               this.ruleForm[i].workType===3||this.ruleForm[i].workType===15){
+              this.approveForm.isSpecial = 1
+            }else{
+                this.approveForm.isSpecial = 0
+            }
+            }
+             this.approveForm.userSupId=this.form.userMg
+
+             addInvoice(this.approveForm).then(response => {
+          this.msgSuccess(this.$t('预约成功'));
+                 this.msgSuccess("已提交申请");
+           })
 
            this.msgSuccess("新增成功");
               this.open = false;