Parcourir la source

2022.8.11 移动端项目筛选

ggooalice il y a 2 ans
Parent
commit
bf1692ff86

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -363,7 +363,7 @@
                   <el-table-column prop="groupName" label="分组名称" min-width="100"></el-table-column>
                   <el-table-column prop="workingTime" label="工时(h)" min-width="50" align="right" header-align="center">
                     <template slot-scope="scope">
-                      <span style="margin-right:20px">{{scope.row.workingTime ? scope.row.workingTime.toFixed(1) + '(h)' : ''}}</span>
+                      <span style="margin-right:20px">{{scope.row.workingTime ? scope.row.workingTime.toFixed(1) : ''}}</span>
                     </template>
                   </el-table-column>
                 </el-table-column>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -830,7 +830,7 @@
                     url = this.port.project.listCost;
                 }else if(this.radio == '主项目'){
                     url = '/project/getTimeCostByMainProject'
-                    param.userId = this.user.id
+                    // param.userId = this.user.id
                 }else if (this.radio=='项目分类') {
                     url = '/project/getTimeCostByCategory';
                     // param.parentDeptId = this.parentDeptId;

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

@@ -11,7 +11,7 @@ import store from "./store/index";
 
 import "@/components/Vant";
 
-import { Form , Toast , Grid, GridItem , DatetimePicker ,
+import { Form , Toast , Grid, GridItem , DatetimePicker , Popover,
 Picker , Dialog , NumberKeyboard , Sticky , Skeleton ,
 Panel , Divider , List , pullRefresh , SwipeCell, Checkbox, 
 Search, Slider,Stepper,Tag, Calendar, Row, Col, RadioGroup, Radio, 
@@ -22,7 +22,7 @@ Vue.use(Form).use(Toast).use(Grid).use(GridItem).use(DatetimePicker)
 .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(PullRefresh).use(Tabbar).use(TabbarItem).use(Popover);
 
 // rem
 import "amfe-flexible";

+ 64 - 37
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/index.vue

@@ -14,6 +14,34 @@
                     </van-swipe-cell> 
                 </van-list>
             </van-pull-refresh> -->
+            <van-sticky offset-top="1.22667rem">
+            <van-cell>
+                <van-search
+                style="height:35px"
+                v-model="popoverValue"
+                show-action
+                :placeholder="'请输入' + (popoverType == '1' ? '项目名称' : '项目编号') + '关键词'"
+                @search="popoverSearch"
+                >
+                <template slot="left">
+                    <van-popover
+                    v-model="popoverShow"
+                    trigger="click"
+                    :actions="popoverActions"
+                    @select="popoverSelect"
+                    placement="bottom-start"
+                    >
+                    <template slot="reference">
+                        <span>{{popoverType == '1' ? '项目名称' : '项目编号'}}<van-icon name="arrow-down" size="10" style="margin-left:2px;" /></span>
+                    </template>
+                    </van-popover>
+                </template>
+                <template slot="action">
+                    <div @click="popoverSearch">搜索</div>
+                </template>
+                </van-search>
+            </van-cell>
+            </van-sticky>
             <van-pull-refresh v-model="isDownLoading" @refresh="onDownRefresh">
                 <van-list v-model="isUpLoading" :finished="upFinished" :immediate-check="false" :offset="100" finished-text="没有更多了" @load="onLoadList">
                     <van-swipe-cell v-for="(item,index) in list" :key="index">
@@ -39,11 +67,11 @@
                     placeholder="请选择" @click="clikls()"/>
                 </van-form>
             </van-dialog>
-            <van-popup v-model="showPickerUser" position="bottom">
+            <van-popup v-model="showPickerUser" position="bottom" ref="usersPopup">
                 <van-search v-model="userName" placeholder="输入员工姓名搜索" @search="onSearch"></van-search>
                 <div style="minHeight:300px;">
                 <van-checkbox class="userCheckbox" v-for="(item) in userList" :key="item.id" v-model="item.isChecked" >{{item.name}}</van-checkbox>
-                <van-button style="width:100%;" @click="refreshParticipate();showPickerUser=false">确定</van-button>
+                <van-button style="width:100%;position: -webkit-sticky;position: sticky;bottom: 0;" @click="refreshParticipate();showPickerUser=false">确定</van-button>
                 </div>
             </van-popup>
             <van-popup v-model="showPickerIncharger" position="bottom">
@@ -97,11 +125,35 @@
                 pageSize: 25, // 每页条数
                 pageIndex: 1, // 页码
                 dpp: false,
+
+                popoverValue: '',
+                popoverShow: false,
+                popoverType: '1',
+                popoverActions: [{text: '项目名称',type: '1'},{text: '项目编号',type: '2'}],
+                projectVue: null,
             };
         },
         created() {
         },
         methods: {
+            popoverSelect(action){
+                if(this.popoverType == action.type){
+                    return
+                }else{
+                    this.popoverType = action.type
+                    this.popoverValue = ''
+                    // this.isDownLoading = true
+                    this.list = []
+                    this.isUpLoading = true
+                    this.onDownRefresh()
+                }
+            },
+            popoverSearch(){
+                // this.isDownLoading = true
+                this.list = []
+                this.isUpLoading = true
+                this.onDownRefresh()
+            },
             fuxuan() {
                 console.log(this.ause)
             },
@@ -220,40 +272,15 @@
 
             // 获取项目
             getProject() {
-                // if (this.refreshing) {
-                //     this.list = [];
-                //     this.refreshing = false;
-                // }
-                // if(this.total == this.list.length && this.list.length != 0) {
-                //     this.loading = false;
-                //     this.finished = true;
-                //     return false;
-                // }
-                // this.$axios.post("/project/getProjectPage", {
-                //     pageIndex: this.page,
-                //     pageSize: this.size,
-                // })
-                // .then(res => {
-                //     if(res.code == "ok") {
-                //         this.loading = false;
-                //         if (this.list.length == 0) {
-                //             this.finished = true;
-                //         }
-                //         this.list = [];
-                //         for(var i in res.data.records) {
-                //             this.list.push(res.data.records[i])
-                //         }
-                //         this.total = res.data.total;
-                //         this.page++;
-                //     } else {
-                //         this.$toast.fail('获取失败:'+res.msg);
-                //     }
-                // }).catch(err=> {toast.clear();});
-
-                this.$axios.post("/project/getProjectPage", {
-                    pageIndex: this.pageIndex,
-                    pageSize: this.pageSize,
-                })
+                    let parameter = {
+                        pageIndex: this.pageIndex,
+                        pageSize: this.pageSize,
+                    }
+                    if(this.popoverValue){
+                        parameter.keyword = this.popoverValue
+                        parameter.searchField = this.popoverType
+                    }
+                this.$axios.post("/project/getProjectPage", parameter)
                 .then(res => {
                     if(res.code == "ok") {
                         this.isDownLoading = false
@@ -266,7 +293,7 @@
                             this.$toast('已全部加载完成');
                             return
                         } else {
-                            console.log(this.dpp)
+                            // console.log(this.dpp)
                             if(this.dpp) this.list = []
                             if(this.list.length == 0) {
                                 this.list = datas