ggooalice 2 年之前
父節點
當前提交
69dc5b37b3

+ 7 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -729,7 +729,7 @@
             </div>
             <span slot="footer" class="dialog-footer">
                 <el-button @click="cancel(workForm.domains,true)" v-if="canCancelInDialog" style="float:left;">{{$t('btn.withdraw')}}</el-button>
-                <span style="margin-right:20px">合计工时:{{totalReportHours}}小时</span>
+                <span style="margin-right:20px" @click="test()">合计工时:{{totalReportHours}}小时</span>
                 <el-button @click="deleteReport"  v-if="workForm.domains[0].id != null && canEdit && reportCanDelete">{{$t('btn.delete')}}</el-button>
                 <el-button @click="dialogVisible = false">{{$t('btn.cancel')}}</el-button>
                 <el-button v-if="!isSubstitude" @click="submitReport(1)" :loading="submitingReport" :disabled="workForm.domains.length==0?true:(canEdit?false:true)">{{$t('btn.temporaryStorage')}}</el-button>
@@ -1948,7 +1948,11 @@
                                 }
                             }
                         }else{
-                            hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
+                            if(this.user.timeType.type == 2){
+                                hours += this.getHour(domains[i].startTime, domains[i].endTime)
+                            }else{
+                                hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
+                            }
                         }
                     }
                 }
@@ -1981,7 +1985,7 @@
         },
         methods: {
             test(){
-                // console.log('test',this.depData,this.data[0].membCount,this.reportList.length);
+                console.log('test',this.workForm.domains);
             },
             getHour(s1, s2) {
                 var reDate = /\d{4}-\d{1,2}-\d{1,2} /;

+ 17 - 10
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/details.vue

@@ -82,7 +82,7 @@
             <!-- 发票 -->
             <van-field label="发票" readonly>
                 <template #input
-                    >总费用: ¥{{ totalCost | numtosum }}</template
+                    >总费用: ¥{{ totalCost }}</template
                 >
             </van-field>
             <div class="invoice" v-if="invoiceList.length != 0">
@@ -142,7 +142,6 @@
                         label="费用金额(含税):"
                         v-model="item.amount"
                         type="number"
-                        @input="costCount"
                         :readonly="!canEdit"
                         required
                     ></van-field>
@@ -284,7 +283,6 @@ export default {
             createDateShow: false,
             typeShow: false,
             typeList: ['一般','差旅','外包'],
-            totalCost: 0,
 
             invoiceIndex: 0,
             in_projectShow: false,
@@ -298,6 +296,15 @@ export default {
             uploader: [[]],
         }
     },
+    computed: {
+        totalCost(){
+            let costnum = 0
+            for(let i in this.invoiceList){
+                costnum += (this.invoiceList[i].amount ? parseFloat(this.invoiceList[i].amount) : 0)
+            }
+            return costnum.toFixed(2)
+        }
+    },
     filters: {
         numtosum(value) {
             if (value == undefined || !value) return '0.00'
@@ -342,13 +349,13 @@ export default {
             let amo = amount / (1 + per)*per
             return amo.toFixed(2)
         },
-        costCount(){
-            let costnum = 0
-            for(let i in this.invoiceList){
-                costnum += this.invoiceList[i].amount*1
-            }
-            this.totalCost = costnum
-        },
+        // costCount(){
+        //     let costnum = 0
+        //     for(let i in this.invoiceList){
+        //         costnum += this.invoiceList[i].amount*1
+        //     }
+        //     this.totalCost = costnum
+        // },
 
         ownerIdChange(value,key){
             this.editForm.ownerId = value.id