Browse Source

森语-搬运工对账单-合计大写计算问题

jbb 2 years ago
parent
commit
008422202a
1 changed files with 10 additions and 0 deletions
  1. 10 0
      src/views/oa/modules/SyCarryModal.vue

+ 10 - 0
src/views/oa/modules/SyCarryModal.vue

@@ -436,6 +436,7 @@
     watch: {
       formState: {
         immediate: true,
+        deep:true,
         handler(newVal) {
           newVal.totalNum = newVal.totalNum.toString()
           if(newVal.totalNum!=='' && newVal.totalNum){
@@ -540,6 +541,9 @@
         newObj.id = ''
        this.syCarryBTable.dataSource.push(newObj)
        this.formState.totalNum =(Number(this.formState.totalNum) +Number(record.totalPrice)).toFixed(2)
+       if( this.formState.totalNum!=='' &&  this.formState.totalNum){
+            this.changeNumber( this.formState.totalNum)
+          }
        this.$forceUpdate()
       },
 
@@ -547,6 +551,9 @@
       deleteRow(record,index){
         this.syCarryBTable.dataSource.splice(index,1)
         this.formState.totalNum =(Number(this.formState.totalNum) -Number(record.totalPrice)).toFixed(2)
+        if( this.formState.totalNum!=='' &&  this.formState.totalNum){
+            this.changeNumber( this.formState.totalNum)
+          }
       },
       changeJhy(props){
         console.log(this.syCarryBTable.columns[7].options)
@@ -721,6 +728,9 @@
          Hj+= Number(item.totalPrice)
        })
        this.formState.totalNum = Hj.toFixed(2)
+       if( this.formState.totalNum!=='' &&  this.formState.totalNum){
+            this.changeNumber( this.formState.totalNum)
+        }
        this.$forceUpdate()
       },
       handleChangetotalPrice(){