ggooalice %!s(int64=2) %!d(string=hai) anos
pai
achega
2383919e72

+ 5 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -3415,6 +3415,11 @@ a {
                         } else {
                             formData.append("customerId", this.addForm.customerId);
                         }
+                        if (this.addForm.contractAmount) {
+                            formData.append("contractAmount", this.addForm.contractAmount);
+                        } else {
+                            formData.append("contractAmount", 0);
+                        }
                         if (this.chosenLeaders != null && this.chosenLeaders.length > 0) {
                             formData.append("chosenLeaders", JSON.stringify(this.chosenLeaders));
                         }

+ 13 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -1009,6 +1009,10 @@
                                     this.$set(this.form.domains[0],'overtimeHours',t.allday.toFixed(0))
                                 }
                             }
+                            if(this.report.timeBasecostList.length != 0 && this.user.company.packageProject==1){
+                                this.form.domains[0].basecostId = this.report.timeBasecostList[0].id;
+                                this.form.domains[0].basecostName = this.report.timeBasecostList[0].name;
+                            }
                             this.canEdit = true;
                         }
                     } else {
@@ -1273,6 +1277,11 @@
                         this.$set(item,'overtimeHours',4)
                     }
                 }
+                if(this.report.timeBasecostList.length != 0 && this.user.company.packageProject==1){
+                    this.$set(item,'basecostId',this.report.timeBasecostList[0].id)
+                    this.$set(item,'basecostName',this.report.timeBasecostList[0].name)
+                }
+                
                 this.form.domains.push(item)
                 this.canEdit = true
                 this.$forceUpdate()
@@ -1479,6 +1488,9 @@
                     } else {
                         formData.append("overtimeHours", 0);
                     }
+                    if(this.form.domains[i].basecostId){
+                        formData.append("basecostId", this.form.domains[i].basecostId);
+                    }
                     
 
 
@@ -1647,7 +1659,7 @@
                 this.isWX = true;
             }
             this.getPeoject() // 获取项目
-            console.log('mounted');
+            // console.log('mounted');
             this.getReportBasecostList()
             //获取传递过来的日期
             var passDate = this.$route.query.date;

+ 54 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -71,6 +71,14 @@
                         <van-picker show-toolbar :columns="item.stages" value-key="stagesName" @confirm="choseStage" 
                             @cancel="item.showPickerStage = false;$forceUpdate();" />
                     </van-popup>
+                    <!-- 预算来源 -->
+                    <van-field  readonly  name="basecostId" v-if="user.company.packageProject==1&&reportBasecostList &&reportBasecostList.length>0" 
+                        :value="item.basecostName" label="预算来源" placeholder="请选择预算来源" 
+                    @click="clickPickCostId(index, item)" />
+                    <van-popup v-model="item.showPickerCostId" position="bottom">
+                        <van-picker show-toolbar :columns="reportBasecostList" value-key="name" @confirm="choseCostId" 
+                            @cancel="item.showPickerCostId = false;$forceUpdate();" />
+                    </van-popup>
                     <!-- 审核人 -->
                     <van-field  readonly  name="projectAuditorId" v-if="item.auditUserList != null && item.auditUserList.length > 0" clickable
                         :value="item.projectAuditorName" :label="user.companyId==781?'审核人':'项目审核人'" placeholder="请选择审核人" 
@@ -372,10 +380,43 @@
                 weekIndex: 5,
                 weekSwitchIndex: 1,
                 kaoqinText: false,
-                workTimeText: false
+                workTimeText: false,
+
+                reportBasecostList: []
             };
         },
         methods: {
+            // 预算来源
+            clickPickCostId(i, item) {
+                // if (!item.canEdit) return;
+                this.clickIndex = i;
+                item.showPickerCostId = true;
+                this.$forceUpdate();
+            },
+            choseCostId(value,index){
+                this.currentForm.domains[this.clickIndex].basecostId = value.id;
+                this.currentForm.domains[this.clickIndex].basecostName = value.name;
+                this.currentForm.domains[this.clickIndex].showPickerCostId = false;
+                this.$forceUpdate();
+            },
+            getReportBasecostList(){
+                this.$axios.post('/project-basecost-setting/getReportBasecostList',{
+                    companyId: this.user.companyId
+                }).then(res => {
+                    if(res.code == 'ok'){
+                        this.reportBasecostList = res.data
+                        if(this.reportBasecostList.length != 0 && this.user.company.packageProject == 1){
+                            this.currentForm.domains[0].basecostId = this.reportBasecostList[0].id;
+                            this.currentForm.domains[0].basecostName = this.reportBasecostList[0].name;
+                        }
+                    }else{
+                        this.$toast.fail('获取失败:'+res.msg);
+                    }
+                }).catch(err => {this.$toast.clear();})
+            },
+
+
+
             // 上周下周按钮切换
             SwitchLastorNext(e){
                 this.weekSwitchIndex += e
@@ -387,6 +428,10 @@
                 this.form[this.inbtn] = this.currentForm
                 this.inbtn = index
                 this.currentForm = this.form[this.inbtn]
+                if(this.reportBasecostList.length != 0 && this.user.company.packageProject == 1){
+                    this.currentForm.domains[0].basecostId = this.reportBasecostList[0].id;
+                    this.currentForm.domains[0].basecostName = this.reportBasecostList[0].name;
+                }
                 this.getKaoqin()
                 this.getWorkTime()
             },
@@ -489,6 +534,10 @@
                     this.form.push(formItem)
                 }
                 this.currentForm = this.form[0]
+                if(this.reportBasecostList.length != 0 && this.user.company.packageProject == 1){
+                    this.currentForm.domains[0].basecostId = this.reportBasecostList[0].id;
+                    this.currentForm.domains[0].basecostName = this.reportBasecostList[0].name;
+                }
                 this.getKaoqin()
                 this.getWorkTime()
             },
@@ -1509,6 +1558,9 @@
                         } else {
                             formData.append("overtimeHours", 0);
                         }
+                        if(this.form[formIndex].domains[i].basecostId){
+                            formData.append("basecostId", this.form[formIndex].domains[i].basecostId);
+                        }
                         
 
 
@@ -1688,6 +1740,7 @@
             // }
             
             this.getProject();
+            this.getReportBasecostList()
             // this.getReport();
             this.getTimeType();
             //初始化微信js-sdk参数