Lijy 3 år sedan
förälder
incheckning
c210d8f8d0

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -4,8 +4,8 @@ var path = require('path')
 // var ip = '192.168.2.36'
 
  
-// var ip = '47.100.37.243'
-var ip = '192.168.2.105'
+var ip = '47.100.37.243'
+// var ip = '192.168.2.105'
 
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet/src/main.js

@@ -115,6 +115,7 @@ router.beforeEach((to, from, next) => {
                     }
 
                     if (user.role == 1 || user.role == 2) {
+                        console.log(filterRouter, 12345, '看看')
                         getRoutes = filterRouter;
                     } else {
                         var modules = userModules.filter(u=>u.role == user.role)[0].modules;

+ 8 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -104,10 +104,10 @@
                                 </span>
                             </span>
                             <div class="checkbtn">
-                                <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && item1.state == 0" type="primary" :loading="logining" size="small" @click="approve(item1.id, item1)">通过</el-button>
-                                <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && item1.state == 0" type="danger" :loading="logining" size="small" @click="showDenyDialog(item1.id,0, item1)">驳回</el-button>
+                                <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && (item1.state == 0 || item1.state == -1)" type="primary" :loading="logining" size="small" @click="approve(item1.id, item1)">通过</el-button>
+                                <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && (item1.state == 0 || item1.state == -1)" type="danger" :loading="logining" size="small" @click="showDenyDialog(item1.id,0, item1)">驳回</el-button>
                                 <!--自己可以撤回待审核状态的报告 -->
-                                <el-button v-if="(user.id == item1.id) && item1.state == 0" type="normal" :loading="logining" size="small" @click="cancel(item1)">撤回</el-button>
+                                <el-button v-if="(user.id == item1.id) && (item1.state == 0 || item1.state == -1)" type="normal" :loading="logining" size="small" @click="cancel(item1)">撤回</el-button>
                                 <el-button v-if="(user.role == 1 || user.role == 2 || user.id == item1.data[0].inchargerId) && item1.state == 1" type="normal" :loading="logining" size="small" @click="showDenyDialog(item1.id,1, item1)">撤销</el-button>
                                 <el-button v-if="item1.state >= 2 && user.id == item1.id" type="primary" size="small" @click="isSubstitude=false; fillInReport(index1,0)">编辑日报</el-button>
                             </div>
@@ -1224,6 +1224,10 @@
             },
             //添加工时
             addNewWorktime(index, item) {
+                console.log(item)
+                if(item.worktimeList == null ) {
+                    item.worktimeList = []
+                }
                 item.worktimeList.push({});
             },
 
@@ -2370,6 +2374,7 @@
 
             // 打开日报填写
             fillInReport(i, isBatch) {
+                console.log(i, 123)
                 if(i != 1) {
                     this.falsss = false 
                 } else {

+ 2 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue

@@ -227,7 +227,8 @@
             //获取待审核的数据列表
             getList() {
                 this.listLoading = true;
-                
+                console.log(this.port.report.importReportList)
+                console.log(this.search)
                 this.http.post(this.port.report.importReportList, this.search,
                 res => {
                     this.listLoading = false;
@@ -336,7 +337,6 @@
             // 未通过日报
             deny() {
                 this.logining = true;
-                
                 this.http.post( this.port.report.deny, this.denyForm,
                 res => {
                     this.logining = false;

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

@@ -10,6 +10,13 @@ const router = new Router({
         path: "/",
         redirect: "/login"
     },
+    {
+        path: "/audit",
+        meta: {
+            title: "导入日报审核"
+        },
+        component: () => import("@/views/audit/audit")
+    },
     {
         path: "/login",
         component: () => import("@/views/login/index"),

+ 164 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/audit/audit.vue

@@ -0,0 +1,164 @@
+<template>
+    <div class="body">
+        <van-nav-bar title="导入日报审核" left-text="返回" @click-left="back" fixed left-arrow/>
+        <div style="height: 46px"></div>
+        <div class="lis" v-for="item in list" :key="item.id">
+            <div class="lis_til">
+                <p>{{item.name}}</p>
+                <p style="color: #C03131">待审核</p>
+            </div>
+            <div class="lis_con" v-for="items in item.data" :key="items.id">
+                <div>工作日期: {{item.dateStr}}</div>
+                <div>项目: {{items.project}}</div>
+                <div>工作时长: {{items.time}}h</div>
+            </div>
+            <div class="lis_boot">
+                <div style="background: #1989FA" @click="approve(item, item.id)">通过</div>
+                <div style="background: #C03131" @click="showDenyDialog(item)">驳回</div>
+            </div>
+        </div>
+        <van-popup v-model="denyReasonDialog" position="bottom" closeable >
+            <van-cell>请输入原因</van-cell>
+            <van-field class="form_input"
+                v-model="denyForm.reason" name="reason" type="textarea" :placeholder="'请输入您决定'+(denyForm.i==0?'驳回':'撤销')+'的原因'"
+                rows="3" autosize  />
+            <van-button style="width:100%;" type="info" @click="deny()">提交</van-button>
+        </van-popup>
+    </div>
+</template>
+
+<script>
+export default {
+    data() {
+        return {
+            search: {
+                date: null,
+                projectId: null
+            },
+            list: [],
+            denyReasonDialog: false,
+            denyForm: {
+                id: null,
+                i: null,
+                date: null,
+                reportIds: '',
+                reason: ''
+            }
+        }
+    },
+    created() {},
+    mounted() {
+        this.obtain()
+    },
+    methods: {
+        // 返回
+        back() {
+            history.back();
+        },
+        // 获取日报
+        obtain() {
+            const toast = this.$toast.loading({
+                forbidClick: true,
+                duration: 0
+            });
+            this.$axios.get('/report/listImportByState', this.search)
+            .then(res => {
+                toast.clear();
+                this.list = res.data
+            }).catch(err=> {
+                toast.clear();
+                alert('err=' + err);
+            });
+        },
+        // 通过日报
+        approve(item, id) {
+            const toast = this.$toast.loading({
+                forbidClick: true,
+                duration: 0
+            });
+            var ids = '';
+            var data = item.data;
+            data.forEach(element => {
+                ids +=(element.id+',');
+            });
+            this.$axios.get('/report/approve', {params:{id: id, reportIds: ids}})
+            .then(res => {
+                this.obtain()
+                toast.clear();
+                this.$toast.success('审核成功');
+            }).catch(err=> {
+                toast.clear();
+                alert('err=' + err);
+            });
+        },
+        // 驳回
+        showDenyDialog(item) {
+            this.denyReasonDialog = true
+            var ids = '';
+            var data = item.data;
+            data.forEach(element => {
+                if (element.id != null && element.id != '') {
+                    ids +=(element.id+',');
+                }
+            });
+            this.denyForm = {id: item.id ,i:0, date: item.dateStr, reportIds: ids, reason:null};
+        },
+        // 驳回提交
+        deny() {
+            const toast = this.$toast.loading({
+                forbidClick: true,
+                duration: 0 
+            });
+            this.$axios.post('/report/deny', this.denyForm)
+            .then(res => {
+                this.obtain()
+                toast.clear();
+                this.$toast.success('提交成功');
+                this.denyReasonDialog = false
+            }).catch(err=> {
+                toast.clear();
+                alert('err=' + err);
+            });
+        }
+    }
+}
+</script>
+
+<style lang="less" scoped>
+    .lis {
+        background: #fff;
+        padding: 10px;
+        box-sizing: border-box;
+        color: #333333;
+        margin-bottom: 30px;
+        font-size: 14px;
+        .lis_til {
+            display: flex;
+            justify-content: space-between;
+            padding: 0 6px 10px 6px;
+            border-bottom: 1px solid #ebedf0;
+        }
+        .lis_con {
+            padding: 0 6px;
+            border-bottom: 1px solid #ebedf0;
+            div {
+                line-height: 30px;
+            }
+        }
+        .lis_boot {
+            padding: 10px 6px 0 6px;
+            display: flex;
+            align-items: flex-end;
+            justify-content: flex-end;
+            div {
+                width: 40px;
+                line-height: 28px;
+                text-align: center;
+                margin-left: 20px;
+                color: #fff;
+                font-size: 12px;
+                border-radius: 2px;
+            }
+        }
+    }
+</style>

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

@@ -112,6 +112,12 @@
                         url: '/project',
                         icon: 'label-o'
                     });
+                    // 自己加的
+                // this.routers.push({
+                //         name: '导入日报审核',
+                //         url: '/audit',
+                //         icon: 'label-o'
+                //     });
             } else {
                 if (this.user.manageDeptId != 0 && this.user.company.packageEngineering == 1) {
                     this.routers.push(
@@ -129,6 +135,21 @@
                     });
                 }
             }
+            if(this.user.role == 1 || this.user.role == 2) {
+                this.routers.push({
+                    name: '导入日报审核',
+                    url: '/audit',
+                    icon: 'label-o'
+                });
+            } else {
+                if(this.user.role == 6 && this.user.timeType.needDeptAudit == 1) {
+                    this.routers.push({
+                        name: '导入日报审核',
+                        url: '/audit',
+                        icon: 'label-o'
+                    });
+                }
+            }
             this.routers.push({
                                 name: '消息记录',
                                 url: '/msg',

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

@@ -183,6 +183,7 @@
             },
 
             showDenyDialog(id,i,date, item) {
+                console.log(id, i, date, item)
                 this.denyReasonDialog = true;
                 var ids = '';
                 var data = item.data;
@@ -192,6 +193,7 @@
                     }
                 });
                 this.denyForm = {id: id ,i:i, date: date, reportIds: ids, reason:null};
+                console.log(this.denyForm)
             },
 
             deny() {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/vue.config.js

@@ -4,7 +4,7 @@ const path = require('path');
 const themePath = path.resolve(__dirname,'src/assets/style/theme.less');
 
 // var ip = '127.0.0.1'
-// var ip = '192.168.2.34'
+// var ip = '192.168.2.105'
 var ip = '47.100.37.243'
 // var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
 // for (var i in ifaces) {