Bladeren bron

2022.6.28 预算来源

ggooalice 2 jaren geleden
bovenliggende
commit
a8b679a4a4
1 gewijzigde bestanden met toevoegingen van 39 en 2 verwijderingen
  1. 39 2
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

+ 39 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -66,6 +66,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="请选择审核人" 
@@ -324,6 +332,7 @@
                 showPickerStage: false,
                 showPickerTaskGroup: false,
                 showPickerSubProject: false,
+                showPickerCostId: false,
                 isDraft:0,
                 showWorkStartTime:false,
                 showWorkEndTime:false,
@@ -389,7 +398,8 @@
                 projectss: [],
                 proads: [],
                 userName: '',
-                flgLg: true
+                flgLg: true,
+                reportBasecostList: []
             };
         },
 
@@ -398,6 +408,18 @@
         },
 
         methods: {
+            // 获取预算来源
+            getReportBasecostList(){
+                this.$axios.post('/project-basecost-setting/getReportBasecostList',{
+                    companyId: this.user.companyId
+                }).then(res => {
+                    if(res.code == 'ok'){
+                        this.reportBasecostList = res.data
+                    }else{
+                        this.$toast.fail('获取失败:'+res.msg);
+                    }
+                }).catch(err => {this.$toast.clear();})
+            },
             //获取项目审核人
             getProjectAuditorList(domainItem) {
                 this.$axios.post("/project-auditor/getList", {projectId: domainItem.projectId})
@@ -997,6 +1019,12 @@
                 item.showPickerSubProject = true;
                 this.$forceUpdate();
             },
+            clickPickCostId(i, item) {
+                if (!this.canEdit) return;
+                this.clickIndex = i;
+                item.showPickerCostId = true;
+                this.$forceUpdate();
+            },
             clickPickTaskGroup(i, item) {
                 if (!this.canEdit) return;
                 this.clickIndex = i;
@@ -1105,6 +1133,12 @@
                 this.$forceUpdate();
 
             },
+            choseCostId(value,index){
+                this.form.domains[this.clickIndex].basecostId = value.id;
+                this.form.domains[this.clickIndex].basecostName = value.name;
+                this.form.domains[this.clickIndex].showPickerCostId = false;
+                this.$forceUpdate();
+            },
 
             getGroupStages(domain, index) {
                 this.$axios.post("/stages/getProjectStagesByGroup", {groupId: domain.groupId})
@@ -1561,15 +1595,18 @@
                 this.isWX = true;
             }
             this.getPeoject() // 获取项目
+            console.log('mounted');
+            this.getReportBasecostList()
             //获取传递过来的日期
             var passDate = this.$route.query.date;
             if (passDate != null) {
                 this.form.createDate = this.$route.query.date;
             }
             
-            this.getProject();
+            // this.getProject();
             this.getReport();
             this.getTimeType();
+            
             //初始化微信js-sdk参数
             if (this.isCorpWX) {
                 this.initWxConfig();