Browse Source

移动端按周填报加任务和里程碑的选择

Lijy 1 year ago
parent
commit
dc51f173d2

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/main.js

@@ -20,14 +20,14 @@ Picker , Dialog , NumberKeyboard , Sticky , Skeleton ,
 Panel , Divider , List , pullRefresh , SwipeCell, Checkbox, 
 Search, Slider,Stepper,Tag, Calendar, Row, Col, RadioGroup, Radio, 
 Loading ,DropdownMenu, DropdownItem, Button, ActionSheet, PullRefresh,Tabbar,
-TabbarItem,Uploader,Collapse, CollapseItem,Empty} from 'vant';
+TabbarItem,Uploader,Collapse, CollapseItem,Empty,CheckboxGroup} from 'vant';
 
 Vue.use(Form).use(Toast).use(Grid).use(GridItem).use(DatetimePicker)
 .use(Picker).use(Dialog).use(NumberKeyboard).use(Sticky).use(Skeleton)
 .use(Panel).use(Divider).use(List).use(pullRefresh).use(SwipeCell)
 .use(Checkbox).use(Search).use(Slider).use(Stepper).use(Tag).use(Calendar).use(RadioGroup).use(Radio)
 .use(Row).use(Col).use(Loading).use(DropdownMenu).use(DropdownItem).use(Button).use(ActionSheet)
-.use(PullRefresh).use(Tabbar).use(TabbarItem).use(Popover).use(Uploader).use(Collapse).use(CollapseItem).use(Empty);
+.use(PullRefresh).use(Tabbar).use(TabbarItem).use(Popover).use(Uploader).use(Collapse).use(CollapseItem).use(Empty).use(CheckboxGroup);
 
 // rem
 import "amfe-flexible";

+ 53 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/weekEdit.vue

@@ -195,6 +195,21 @@
                             </div>
                         </van-popup>
 
+                        <!-- 任务里程碑 -->
+                        <van-field :label="'任务/里程碑'" :value="item.taskName" :disabled="item.state<=1" readonly 
+                            clickable v-if="user.company.packageProject == 1 && user.company.nonProjectSimple==0" 
+                            @click="clickTakKer(index, item)"
+                        />
+                        <van-popup v-model="item.showTaksDegree" position="bottom">
+                            <div class="chooseSomeone">
+                                <div class="chooseSomeoneFlex1">
+                                    <div class="chooseSomeoneItem" v-for="(sle,sleIndex) in item.newTaskList" :key="sleIndex" @click="selectTask(sle, index)">
+                                        {{ sle.taskName }}
+                                    </div>
+                                </div>
+                            </div>
+                        </van-popup>
+
                         <!-- 自定义数值 -->
                         <van-field v-if="user.timeType.customDataActive==1" type="number" v-model="item.customData" :label="user.timeType.customDataName" 
                             placeholder="请输入数字" ></van-field> 
@@ -1016,6 +1031,11 @@
                     //清空分组和阶段
                     domainItem.stage = null;
                     domainItem.groupId = null;
+                    // 清空自定义维度
+                    domainItem.weiduName = '';
+                    domainItem.wuduList = []
+                    domainItem.degreeId = ''
+                    domainItem.radioPickDegree = ''
                 }
 
                 this.showPickerUserddp = false;
@@ -1604,6 +1624,23 @@
                 var proId = this.currentForm.domains[this.clickIndex].projectId
                 this.dimension(proId)
             },
+            clickTakKer(i, item) {
+                const { state, taskList, groupId } = item
+                if(state < 1) return
+                this.clickIndex = i;
+                let taskListJson = JSON.parse(JSON.stringify(taskList))
+                this.currentForm.domains[this.clickIndex].newTaskList = taskListJson.filter(item => item.groupId == groupId);
+                this.currentForm.domains[this.clickIndex].showTaksDegree = true;
+                var proId = this.currentForm.domains[this.clickIndex].projectId
+                this.$forceUpdate();
+            },
+            selectTask(item, i) {
+                this.clickIndex = i;
+                this.currentForm.domains[this.clickIndex].taskId = item.taskId;
+                this.currentForm.domains[this.clickIndex].taskName = item.taskName;
+                this.currentForm.domains[this.clickIndex].showTaksDegree = false
+                this.$forceUpdate();
+            },
             //选择任务
             clickPickerTask(i) {
                 // if (!this.canEdit) return;
@@ -1762,12 +1799,15 @@
             },
 
 
-            getTaskList(projectId) {
+            getTaskList(projectId, index, flag = false, newClickIndex) {
                 //如果是专业版,需要列出任务列表
                 if (this.user.company.packageProject == 1) {
                     this.$axios.post("/task/getRecentTask", {projectId: projectId})
                         .then(res => {
                             if(res.code == "ok") {
+                                if(flag) {
+                                    this.clickIndex = newClickIndex
+                                }
                                 this.currentForm.domains[this.clickIndex].taskList = res.data;
                                 this.currentForm = this.currentForm;
                                 // this.$forceUpdate();
@@ -2639,7 +2679,7 @@
                     return
                 }
                 console.log(arrItem, '<=== 处理的数据')
-                const { timeType } = this.user
+                const { timeType, company } = this.user
                 let newArrItem = JSON.parse(JSON.stringify(arrItem))
                 const { domains } = newArrItem
                 for(let i in domains) {
@@ -2654,6 +2694,10 @@
                     if(groupId) {
                         this.choseTaskGroup({ id: groupId, name: groupName }, 0, true, i)
                     }
+
+                    if(company.packageProject == 1 && company.nonProjectSimple==0) {
+                        this.getTaskList(projectId, 0, true, i)
+                    }
                 }
             }
         },
@@ -2737,6 +2781,13 @@
     .chooseSomeoneBtn {
         width:100%;
     }
+    .chooseSomeoneItem {
+        padding: 10px 15px;
+        overflow: hidden;
+        text-overflow:ellipsis;
+        white-space: nowrap;
+        border-bottom: 1px solid #f6f6f6;
+    }
 }
 .currentState {
     position: absolute;