Parcourir la source

2022.10.9 移动端待办任务 项目详情

ggooalice il y a 2 ans
Parent
commit
ecd7d43b28

+ 63 - 0
fhKeeper/formulahousekeeper/timesheet/src/http.js

@@ -97,6 +97,69 @@ export default {
             }
         )
     },
+
+    WPGpost (url, data, response, exception) {
+        let user = sessionStorage.getItem('user') , token = "";
+        if(user != null){
+            token = JSON.parse(user).id
+        }
+        axios({
+            method: 'post',
+            url: handleUrl(url),
+            
+            // timeout: TIME_OUT_MS,
+            headers: {
+                //'Content-Type': 'application/json; charset=UTF-8'
+                'Content-type': ' application/x-www-form-urlencoded; charset=UTF-8',
+                'Token': token,
+                'app_id': '3bf356d5-bdba-48d4-b1f5-e91468beefa3',
+                'app_key': 'f2960f3bf3c5ca58ee0c6970c1242e87-1655272886142-371814'
+            },
+            data: {
+                'headers' : {
+                    'Authorization' : ''
+                },
+                'IT_TAB': {
+                    'PSPHI': '',
+                    'PROJK': '',
+                    'GJAHR': '',
+                    'MONAT': '',
+                    'ZUNAM': '',
+                    'ZID': '',
+                    'ZDEP': '',
+                    'DMBTR': '',
+                }
+            }
+        }).then(
+            (result) => {
+                response(handleResults(result))
+            }
+        ).catch(
+            (error) => {
+                if (exception) {
+                    var str = error + ''
+                    if(str.indexOf('504') != '-1' || str.indexOf('502') != '-1') {
+
+                        if (flgs == 0) {
+                            timer = setTimeout(() => {
+                                prompt()
+                            }, 100)
+                            flgs++
+                            clearTimeout(timer2)
+                            timer2 = setTimeout(() => {
+                                flgs = 0
+                            }, 12000)
+                        }
+                        // exception(false)
+                    } else {
+                        exception(error)
+                    }
+                } else {
+                    console.log(error, 3)
+                }
+            }
+        )
+    },
     /*
      * get 请求
      * @param url

+ 15 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/router/index.js

@@ -67,6 +67,21 @@ const router = new Router({
         },
         component: () => import("@/views/edit/weekEdit")
     },
+    {
+        path: "/task",
+        meta: {
+            title: "待办任务"
+        },
+        component: () => import("@/views/task/index")
+    },
+    {
+        path: "/projectInside",
+        name: "projectInside",
+        meta: {
+            title: "项目详情"
+        },
+        component: () => import("@/views/project/projectInside")
+    },
     {
         path: "/search", 
         meta: {

+ 9 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -77,6 +77,13 @@
                         this.routers.push({name: '按周填报',url: '/weekEdit',icon: 'records'})
                     // }
                 }
+                if(list[i].name == '待办任务') {
+                    this.routers.push({
+                        name: '待办任务',
+                        url: '/task',
+                        icon: 'todo-list-o'
+                    });
+                }
                 if(list[i].name == '项目报告审核') {
                     this.routers.push({name: '项目报告审核',url: '/review',icon: 'todo-list-o'})
                 }
@@ -102,6 +109,8 @@
                                 icon: 'todo-list-o',
                                 info: this.unreadNum
                             });
+
+            
             this.getMessage();
             this.bindIfNessary();
             if (localStorage.userInfo != null) {

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/index.vue

@@ -47,6 +47,7 @@
                     <van-swipe-cell v-for="(item,index) in list" :key="index">
                         <van-cell :border="false" :title="item.projectName" :value="item.projectCode"/>
                         <template slot="right" v-if="projectManagement || item.creatorId == user.id">
+                            <van-button square type="primary" text="查看" :to="{name:'projectInside',params:{project:JSON.stringify(item)}}"/>
                             <van-button square type="info" text="编辑" @click="openDialog(index)"/>
                             <van-button square type="danger" text="删除" @click="delPro(index)"/>
                         </template>
@@ -74,7 +75,7 @@
                     placeholder="请选择项目经理" @click="showPickerIncharger = true">
                         <template #input>
                             <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='form.inchargerName'></ww-open-data></span>
-                            <span v-else></span>
+                            <span v-else>{{form.inchargerName}}</span>
                         </template>
                     </van-field>
                     <!-- 研究中心 -->

+ 344 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/project/projectInside.vue

@@ -0,0 +1,344 @@
+<template>
+    <div>
+        <van-nav-bar title="项目详情" left-text="返回" @click-left="back" fixed left-arrow />
+        <div class="content">
+            <van-cell><div style="width:100%;text-align:center;font-size:120%">{{project.projectName}}</div></van-cell>
+            <van-tabs v-model="active" @change="activeChange">
+                <!-- 任务看板 -->
+                <van-tab title="任务看板">
+                    <van-cell title="任务分组" :value="inside.taskGroup.active?inside.taskGroup.active.name:''" @click="inside.taskGroup.show = true"></van-cell>
+                    <van-popup v-model="inside.taskGroup.show" position="bottom">
+                        <van-picker
+                        show-toolbar
+                        :columns="inside.taskGroup.list"
+                        @confirm="taskGroupChange"
+                        @cancel="inside.taskGroup.show = false;$forceUpdate();">
+                            <template #option="item">
+                                <span>{{item.name}}</span>
+                            </template>
+                        </van-picker>
+                    </van-popup>
+                    <van-cell title="任务列表" :value="inside.stages.active?inside.stages.active.stagesName:''" @click="inside.stages.show = true"></van-cell>
+                    <van-popup v-model="inside.stages.show" position="bottom">
+                        <van-picker
+                        show-toolbar
+                        :columns="inside.stages.list"
+                        @confirm="stagesChange"
+                        @cancel="inside.stages.show = false;$forceUpdate();">
+                            <template #option="item">
+                                <span>{{item.stagesName}}</span>
+                            </template>
+                        </van-picker>
+                    </van-popup>
+                    <div class="taskList">
+                        <van-cell v-for="item in inside.taskList" :key="item.id">
+                            <div style="line-height:0.8rem">任务名称:{{item.name}}</div>
+                            <div style="line-height:0.8rem">起止时间:
+                                <span v-if="item.startDate && item.endDate">{{(item.startDate ? item.startDate : ' - ') + '\u3000至\u3000' + (item.endDate ? item.endDate : ' - ')}}</span>
+                                <span v-else></span>
+                            </div>
+                        </van-cell>
+                    </div>
+                </van-tab>
+                <!-- 项目概览 -->
+                <van-tab title="项目概览">
+                    <!-- 基本信息 -->
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">项目分类:</van-col>
+                            <van-col span="17">{{projectDetail.categoryName}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">项目编号:</van-col>
+                            <van-col span="17">{{projectDetail.projectCode}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">项目描述:</van-col>
+                            <van-col span="17">{{projectDetail.projectDesc}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell v-if="user.timeType.projectWithDept == 1">
+                        <van-row>
+                            <van-col span="7">所属部门:</van-col>
+                            <van-col span="17">
+                                <span v-if="user.userNameNeedTranslate != 1">{{projectDetail.departmentName}}</span>
+                                <span v-else><ww-open-data type='departmentName' :openid='projectDetail.departmentName'></ww-open-data></span>
+                            </van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">状态:</van-col>
+                            <van-col span="17">{{projectDetail.status == null ? '-' : info.statusText[projectDetail.status]}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell v-if="user.company.packageEngineering == 0">
+                        <van-row>
+                            <van-col span="7">完成度:</van-col>
+                            <van-col span="17">{{projectDetail.progress}}%</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">合同金额:</van-col>
+                            <van-col span="17">¥{{projectDetail.contractAmount == null ? '-' : projectDetail.contractAmount.toFixed(2)}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">项目级别:</van-col>
+                            <van-col span="17">{{levelToText(projectDetail.level)}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">创建日期:</van-col>
+                            <van-col span="17">{{projectDetail.createDate}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">计划开始日期:</van-col>
+                            <van-col span="17">{{projectDetail.planStartDate == null ? '-' : projectDetail.planStartDate}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">计划结束日期:</van-col>
+                            <van-col span="17">{{projectDetail.planEndDate == null ? '-' : projectDetail.planEndDate}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">实际完成日期:</van-col>
+                            <van-col span="17">{{projectDetail.finishDate == null ? '-' : projectDetail.finishDate}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell v-if="user.timeType.outputValueStatus == 1">
+                        <van-row>
+                            <van-col span="7">项目产值:</van-col>
+                            <van-col span="17">¥{{projectDetail.outputValue == null ? '-' : projectDetail.outputValue.toFixed(2)}}</van-col>
+                        </van-row>
+                    </van-cell>
+
+                    <!-- 威派格 -->
+                <template v-if="user.companyId == 936">
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">合同编号:</van-col>
+                            <van-col span="17">{{projectDetail.projectSeparate.contractCode}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">质保开始时间:</van-col>
+                            <van-col span="17">{{projectDetail.projectSeparate.warrantyStartDate == null ? '-' : projectDetail.projectSeparate.warrantyStartDate}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">质保截至时间:</van-col>
+                            <van-col span="17">{{projectDetail.projectSeparate.warrantyEndDate == null ? '-' : projectDetail.projectSeparate.warrantyEndDate}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">自主项目类别:</van-col>
+                            <van-col span="17">{{projectDetail.projectSeparate.projectCategorySub}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">所属大区:</van-col>
+                            <van-col span="17">{{projectDetail.projectSeparate.region}}</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">所属BU:</van-col>
+                            <van-col span="17">{{projectDetail.projectSeparate.bu}}</van-col>
+                        </van-row>
+                    </van-cell>
+                </template>
+
+                    <!-- 长沙晶易科技 -->
+                <template v-if="user.companyId == 428">
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">项目分组:</van-col>
+                            <van-col span="17">{{projectDetail.projectSeparate.projectCategorySub ? projectDetail.projectSeparate.projectCategorySub : '-'}}</van-col>
+                        </van-row>
+                    </van-cell>
+                </template>
+
+                    <!-- 相关人员 -->
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">项目经理:</van-col>
+                            <van-col span="17">
+                                <span v-if="user.userNameNeedTranslate != 1">{{projectDetail.inchargerName}}</span>
+                                <span v-else><ww-open-data type='userName' :openid='projectDetail.inchargerName'></ww-open-data></span>
+                            </van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell>
+                        <van-row>
+                            <van-col span="7">日报审核人:</van-col>
+                            <van-col span="17" v-if="projectDetail.auditorList && projectDetail.auditorList.length != 0">
+                                <span v-for="item,index in projectDetail.auditorList" :key="item.id">
+                                    <span v-if="index != 0">,</span>
+                                    <span v-if="user.userNameNeedTranslate != 1">{{item.auditorName}}</span>
+                                    <span v-else><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data></span>
+                                </span>
+                            </van-col>
+                            <van-col span="17" v-else>-</van-col>
+                        </van-row>
+                    </van-cell>
+                    <van-cell v-if="projectDetail.isPublic == 0">
+                        <van-row>
+                            <van-col span="7">参与人:</van-col>
+                            <van-col span="17">
+                                <span v-for="item,index in projectDetail.participationList" :key="item.id">
+                                    <span v-if="index != 0">,</span>
+                                    <span v-if="user.userNameNeedTranslate != 1">{{item.name}}</span>
+                                    <span v-else><ww-open-data type='userName' :openid='item.name'></ww-open-data></span>
+                                </span>
+                            </van-col>
+                        </van-row>
+                    </van-cell>
+                </van-tab>
+            </van-tabs>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            user: JSON.parse(localStorage.userInfo),
+            project: JSON.parse(this.$route.params.project),
+            projectDetail: {},
+            
+            active: 0,
+            inside:{    // 任务看板
+                taskGroup:{     // 任务分组
+                    show: false,
+                    active: null,
+                    list: []
+                },
+                stages:{        // 任务列表
+                    show: false,
+                    active: null,
+                    list: []
+                },
+                taskList: []
+            },
+            info:{      // 项目概览
+                statusText: ['全部','进行中','已完成','撤销'],
+                levelList: [],
+                levelText: ['全部','正常','紧急','重要','重要且紧急'],
+            }
+        }
+    },
+    mounted() {
+        // console.log('project',this.project);
+        this.getProjectDetail()
+        this.getLevelList()
+        this.getTaskGroupList()
+    },
+    methods: {
+        back() {
+            history.back();
+        },
+        activeChange(name,title){
+            // console.log('activeChange',name,title);
+        },
+        // 任务看板
+        taskGroupChange(value,key){  // 任务分组
+            // console.log('taskGroupChange',value,key);
+            this.inside.taskGroup.active = value
+            this.inside.taskGroup.show = false
+
+            this.getStagesList()
+        },
+        stagesChange(value,key){     // 任务列表
+            // console.log('stagesChange',value,key);
+            this.inside.stages.active = value
+            this.inside.stages.show = false
+
+            this.inside.taskList = value.taskList
+        },
+
+        getTaskGroupList(){     // 任务分组列表
+            this.$axios.post("/task-group/list", {
+                projectId:this.project.id
+            }).then(res => {
+                if(res.code == "ok") {
+                    this.inside.taskGroup.list = res.data
+                    this.inside.taskGroup.active = res.data[0]
+                    this.getStagesList()
+                } else {
+                    this.$toast.fail('获取失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
+        },
+        getStagesList(){        // 任务列表
+            this.$axios.post("/stages/list", {
+                groupId: this.inside.taskGroup.active.id,
+                projectId: this.project.id,
+                order: 'seq',
+                isDesc: false
+            }).then(res => {
+                if(res.code == "ok") {
+                    this.inside.stages.list = res.data.list
+                    this.inside.stages.active = res.data.list[0]
+                    this.inside.taskList = res.data.list[0].taskList
+                } else {
+                    this.$toast.fail('获取失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
+        },
+
+        // 项目概览
+        getProjectDetail(){
+            this.$axios.post("/project/detail", {id: this.project.id})
+            .then(res => {
+                if(res.code == "ok") {
+                    this.projectDetail = res.data
+                } else {
+                    this.$toast.fail('获取失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
+        },
+        levelToText(lev){
+            if(this.user.timeType.projectLevelState == 1){
+                return this.info.levelList.filter(item => item.id == lev)[0].projectLevelName
+            }else{
+                return this.info.levelText[lev]
+            }
+        },
+        getLevelList(){     // 自定义项目级别
+            this.$axios.post("/project-level/list", {})
+            .then(res => {
+                if(res.code == "ok") {
+                    this.info.levelList = res.data
+                } else {
+                    this.$toast.fail('获取失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
+        }
+    },
+}
+</script>
+
+<style lang="less" scoped>
+.content{
+    margin-top: 46px;
+    overflow: auto;
+}
+</style>

+ 180 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/index.vue

@@ -0,0 +1,180 @@
+<template>
+  <div>
+    <van-nav-bar title="待办任务" left-text="返回" @click-left="back" fixed left-arrow />
+    <div class="content">
+
+    <van-sticky offset-top="1.22667rem">
+        <!-- 全部任务/我执行的/我创建的 -->
+        <van-tabs v-model="active" @click="activeClick" class="dateSelectCell">
+            <van-tab title="全部任务" :name="0"></van-tab>
+            <van-tab title="我执行的" :name="1"></van-tab>
+            <van-tab title="我创建的" :name="2"></van-tab>
+        </van-tabs>
+        <!-- 任务状态 -->
+        <van-cell title="任务状态" :value="select_state" @click="select_state_show = true" class="dateSelectCell"></van-cell>
+        <van-popup v-model="select_state_show" position="bottom">
+            <van-picker
+            show-toolbar
+            :columns="select_state_array"
+            @confirm="stateChange"
+            @cancel="select_state_show = false;$forceUpdate();"/>
+        </van-popup>
+        <!-- 任务类型 -->
+        <van-cell title="任务类型" :value="select_type" @click="select_type_show = true" class="dateSelectCell"></van-cell>
+        <van-popup v-model="select_type_show" position="bottom">
+            <van-picker
+            show-toolbar
+            :columns="select_type_array"
+            @confirm="typeChange"
+            @cancel="select_type_show = false;$forceUpdate();"/>
+        </van-popup>
+        <!-- 时间范围 -->
+        <van-cell class="dateSelectCell">
+            <template slot="title">
+                <van-popover
+                v-model="select_date_type_show"
+                trigger="click"
+                :actions="select_date_type_array"
+                @select="dateTypeChange"
+                placement="bottom-start">
+                    <template slot="reference">
+                        <span>{{select_date_type}}<van-icon name="arrow-down" size="10" style="margin-left:2px;" /></span>
+                    </template>
+                </van-popover>
+            </template>
+            <template slot="default">
+                <div style="width:100%;height:100%" @click="select_date_show = true">{{select_date.length == 0 ? '请选择日期区间' : select_date[0] + ' 至 ' + select_date[1]}}</div>
+            </template>
+            <template slot="extra">
+                <van-icon v-if="select_date.length != 0" name="close" style="line-height:0.64rem;position:relative;left:5px;" @click.stop="dateClear"/>
+            </template>
+        </van-cell>
+        <van-calendar v-model="select_date_show" type="range" @confirm="dateChange" />
+    </van-sticky>
+
+        <div class="taskList" v-if="taskList.length != 0">
+            <van-cell v-for="item in taskList" :key="item.id">
+                <div style="line-height:0.8rem">任务名称:{{item.name}}</div>
+                <div style="line-height:0.8rem">项目名称:{{item.projectName}}</div>
+                <div style="line-height:0.8rem">起止时间:
+                    <span v-if="item.startDate && item.endDate">{{(item.startDate ? item.startDate : ' - ') + '\u3000至\u3000' + (item.endDate ? item.endDate : ' - ')}}</span>
+                    <span v-else></span>
+                </div>
+            </van-cell>
+        </div>
+        <div v-else style="text-align:center;font-size:16px;font-weight:500;color:#999;width:100%;margin-top:16px">暂无数据</div>
+        
+
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            active: '0',
+            select_state: '进行中',
+            select_state_array: ['进行中','已完成'],
+            select_state_show: false,
+
+            select_type: '全部',
+            select_type_show: false,
+            select_type_array: ['全部','任务','里程碑','风险'],
+
+            select_date: [],
+            select_date_type: '开始时间',
+            select_date_type_array: [{text:'开始时间'},{text:'截止时间'}],
+            select_date_type_show: false,
+            select_date_show: false,
+
+            taskList: [],
+
+        }
+    },
+    mounted() {
+        this.getList()
+    },
+    methods: {
+        back() {
+            history.back();
+        },
+        formatDate(date) {
+            let mon = date.getMonth() + 1
+            return `${date.getFullYear()}-${mon<10?'0'+mon:mon}-${date.getDate()<10?'0'+date.getDate():date.getDate()}`;
+        },
+        activeClick(){  // 导航点击
+            // console.log(this.active);
+            this.getList()
+        },
+        stateChange(value,key){  // 任务状态筛选
+            this.select_state = value
+            this.select_state_show = false
+            this.getList()
+        },
+        typeChange(value,key){   // 任务类型筛选
+            // console.log(value,key);
+            this.select_type = value
+            this.select_type_show = false
+            this.getList()
+        },
+        dateTypeChange(action,index){   // 开始时间/截止时间 切换
+            // console.log(action,index);
+            this.select_date_type = action.text
+            if(this.select_date.length != 0){
+                this.getList()
+            }
+        },
+        dateChange(date){   // 时间区间筛选
+            const [start, end] = date;
+            this.select_date_show = false;
+            this.select_date = [this.formatDate(start),this.formatDate(end)];
+            // console.log(this.select_date,date);
+            this.getList()
+        },
+        dateClear(){
+            this.select_date = []
+            this.getList()
+        },
+
+        getList(){  // 获取任务列表
+            let parameter = {
+                viewId: this.active,
+                status: this.select_state == '进行中' ? 0 : 1,
+                pageIndex: 1,
+                pageSize: 999
+            }
+            if(this.select_type != '全部'){
+                if(this.select_type == '任务'){ parameter.type = 0 }
+                if(this.select_type == '里程碑'){ parameter.type = 1 }
+                if(this.select_type == '风险'){ parameter.type = 2 }
+            }
+            if(this.select_date.length != 0){
+                parameter.dateType = this.select_date_type == '开始时间' ? 0 : 1
+                parameter.startDate = this.select_date[0]
+                parameter.endDate = this.select_date[1]
+            }
+
+            this.$axios.post("/task/listByPage", parameter)
+            .then(res => {
+                if(res.code == "ok") {
+                    this.taskList = res.data.records
+                } else {
+                    this.$toast.fail('获取失败');
+                }
+            }).catch(err=> {this.$toast.clear();console.log(err)});
+        }
+
+    },
+}
+</script>
+
+<style lang="less" scoped>
+.content{
+    margin-top: 46px;
+    // overflow: auto;
+}
+// .dateSelectCell{
+//     height: 1.2rem;
+// }
+</style>