ソースを参照

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

17613754660 3 年 前
コミット
4300b88b28

+ 207 - 13
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -6,7 +6,7 @@
                 <!-- <el-form-item label="财务核算成本 | 月份选择" style="margin-top:5px;"> -->
                 <el-form-item label="月份选择" style="margin-top:5px;">
                 <el-date-picker size="small" v-model="date" :editable="false" format="yyyy-MM" value-format="yyyy-MM" @change="changeMonth" :clearable="false" type="month" placeholder="选择月份" style="margin-right: 20px"></el-date-picker>
-                <el-link type="primary" :underline="false" @click="audits()">待审核</el-link>
+                <el-link type="primary" :underline="false" @click="audits()">{{revaelse}}</el-link>
             </el-form-item>
             <!-- <el-radio-group v-model="radio" @change="switchList" style="margin-left:160px;margin-top:5px;"> -->
             <el-radio-group v-model="radio" @change="switchList" style="margin-left:80px;margin-top:5px;">
@@ -38,17 +38,49 @@
         </el-col>
 
         <!-- 财务报表审核 -->
-        <el-dialog :title="shenhe" :visible.sync="importVisible" width="650px" :before-close="handleClose">
+        <el-dialog :title="shenhe" :visible.sync="importVisible" width="1100px" :before-close="handleClose">
             <div>
-                 <el-radio-group v-model="tabPosition" style="margin-bottom: 20px;">
-                    <el-radio-button label="1">待审核</el-radio-button>
-                    <el-radio-button label="2">以驳回</el-radio-button>
+                 <el-radio-group v-model="tabPosition" style="margin-bottom: 20px;" @change="operationalData()">
+                    <el-radio-button label="1">已通过</el-radio-button>
+                    <el-radio-button label="0">待审核</el-radio-button>
+                    <el-radio-button label="2">已驳回</el-radio-button>
+                    <el-radio-button label="-1">已撤销</el-radio-button>
                 </el-radio-group>
                 
-                <el-table :data="tableData" style="width: 100%" :height="400">
-                    <el-table-column prop="date" label="日期"></el-table-column>
-                    <el-table-column prop="date" label="操作人"></el-table-column>
-                    <el-table-column prop="date" label="操作"></el-table-column>
+                <el-table :data="reviewLis" style="width: 100%" :height="400">
+                    <el-table-column prop="userName" label="操作人"></el-table-column>
+                    <el-table-column prop="ymonth" label="所属月份"></el-table-column>
+                    <el-table-column prop="fileName" label="文件名">
+                        <template slot-scope="scope">
+                            <div>
+                                <el-link type="primary" @click="downloadByA({name:scope.row.fileName,url:scope.row.serverName})"> {{scope.row.fileName}}</el-link>
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="recoverReport" label="是否覆盖日报成本" width="150">
+                        <template slot-scope="scope">
+                            <div>
+                                {{scope.row.recoverReport == 1? '是' : '否'}}
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="recoverMonthcost" label="是否覆盖人员月成本" width="150">
+                        <template slot-scope="scope">
+                            <div>
+                                {{scope.row.recoverMonthcost == 1? '是' : '否'}}
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="indate" label="上传时间"></el-table-column>
+                    <el-table-column prop="date" label="操作" v-if="(tabPosition == 1 || tabPosition == 0) && (reviewerRuleForm.auditorId == user.id || user.role == 1 || user.role == 2)">
+                        <template slot-scope="scope">
+                            <div>
+                                <el-button type="primary" size="small" v-if="tabPosition == 0" @click="operationList(0, scope.row.id)">通过</el-button>
+                                <el-button type="warning" size="small" v-if="tabPosition == 0" @click="operationList(1, scope.row.id)">驳回</el-button>
+                                <el-button type="warning" size="small" v-if="tabPosition == 1" @click="operationList(2, scope.row.id)">撤销</el-button>
+                            </div>
+                        </template>
+                    </el-table-column>
                 </el-table>
             </div>
         </el-dialog>
@@ -374,12 +406,15 @@ import { error } from 'dingtalk-jsapi';
                 totalPercent:0,
                 importVisible: false,
                 shenhe: '',
-                tabPosition: '1',
+                tabPosition: '0',
                 reviewerVisible: false,
                 reviewerRuleForm: {
                     auditorId: ''
                 },
-                people: []
+                people: [],
+                revaelse: '',
+                reviewLis: [],
+                ovReviewLis: []
             };
         },
         methods: {
@@ -933,6 +968,7 @@ import { error } from 'dingtalk-jsapi';
                 //改变月份
                 this.getList();
                 this.assignToProject();
+                this.getMonths()
             },
             // 批量导入人员
             importFinance(item) {
@@ -953,14 +989,24 @@ import { error } from 'dingtalk-jsapi';
                     formData.append("syncUserCost", this.importParam.syncUserCost);
                     formData.append("syncHistoryReport", this.importParam.syncHistoryReport);
                     this.isUploading = true;
-                    this.http.uploadFile('/finance/importData', formData,
+                    let urls = ''
+                    if(this.user.timeType.financeAudit == '1') {
+                        urls = '/finance-import/submitImport'
+                    } else {
+                        urls = '/finance/importData'
+                    }
+                    // this.http.uploadFile('/finance/importData', formData,
+                    this.http.uploadFile(urls, formData,
                     res => {
+                        console.log(this.user.timeType.financeAudit, '看看数据')
                         this.$refs.upload.clearFiles();
                         this.listLoading = false;
                         this.isUploading = false;
                         if (res.code == "ok") {
+                            let tis = ''
+                            this.user.timeType.financeAudit == '1' ? tis = '导入成功,请等待审核' : tis = '导入成功'
                             this.$message({
-                                message: "导入成功",
+                                message: tis,
                                 type: "success"
                             });
                             this.importDialog = false;
@@ -983,6 +1029,28 @@ import { error } from 'dingtalk-jsapi';
                     });
                 }
             },
+            // 导入提交审核
+            // submitReview(formData) {
+            //     this.http.uploadFile(' /finance-import/submitImport', formData,
+            //     res => {
+            //         if (res.code == "ok") {
+            //             console.log(res.data, '来的数据')
+            //         } else {
+            //             this.$message({
+            //                 message: res.msg,
+            //                 type: "error"
+            //             });
+            //         }
+            //     },
+            //     error => {
+            //         this.$refs.upload.clearFiles();
+            //         this.listLoading = false;
+            //         this.$message({
+            //             message: error,
+            //             type: "error"
+            //         });
+            //     });
+            // },
 
             
             //获取项目列表
@@ -1014,6 +1082,131 @@ import { error } from 'dingtalk-jsapi';
                     });
                 });
             },
+            // 获取当月的审核状态
+            getMonths() {
+                this.http.post('/finance-import/getStatus', {
+                    companyId: this.user.companyId,
+                    yearMonth: this.date
+                },
+                res => {
+                    this.listLoading = false;
+                    if (res.code == "ok") {
+                        console.log(res.data, '审核状态')
+                        if(res.data) {
+                            if(res.data.state == '0') {
+                                this.revaelse = '待审核'
+                                this.tabPosition = '0'
+                            } else if(res.data.state == '1') {
+                                this.revaelse = '审核记录'
+                                this.tabPosition = '1'
+                            }else if (res.data.state == '2') {
+                                this.revaelse = '已驳回'
+                                this.tabPosition = '2'
+                            } else if (res.data.state == '3') {
+                                this.revaelse = '已撤销'
+                                this.tabPosition = '-1'
+                            }
+                            this.getReviewList()
+                        } else {
+                            this.revaelse = ''
+                        }
+                        
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.listLoading = false;
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            // 获取审核列表
+            getReviewList() {
+                this.http.post('/finance-import/list', {
+                    companyId: this.user.companyId,
+                },
+                res => {
+                    if (res.code == "ok") {
+                       console.log(res.data, '拿到的数据')
+                       this.ovReviewLis = res.data
+                       if(this.tabPosition == 0) {
+                           this.reviewLis = res.data.pendingList
+                       } else if(this.tabPosition == 1) {
+                           this.reviewLis = res.data.passList
+                       } else if(this.tabPosition == 2) {
+                           this.reviewLis = res.data.rejectList
+                       } else {
+                           this.reviewLis = res.data.cancelList
+                       }
+                       console.log(this.reviewLis, '数据')
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            // 操作数据
+            operationalData () {
+                var sss = this.ovReviewLis
+                if(this.tabPosition == 0) {
+                    this.reviewLis = sss.pendingList
+                } else if(this.tabPosition == 1) {
+                    this.reviewLis = sss.passList
+                } else if(this.tabPosition == 2) {
+                    this.reviewLis = sss.rejectList
+                } else {
+                    this.reviewLis = sss.cancelList
+                }
+                console.log(this.reviewLis, '数据')
+            },
+            // 审核操作
+            operationList(zhi, id) {
+                let urls
+                if(zhi == 0) {
+                    urls = '/finance-import/agree'
+                } else if(zhi == 1){
+                    urls = '/finance-import/deny'
+                } else {
+                    urls = '/finance-import/cancel'
+                }
+                this.http.post(urls, {
+                    id: id,
+                },
+                res => {
+                    if (res.code == "ok") {
+                       this.$message({
+                            message: '操作成功',
+                            type: "success"
+                        });
+                        this.getReviewList()
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            }
 
         },
         created() {
@@ -1034,6 +1227,7 @@ import { error } from 'dingtalk-jsapi';
             // this.getProjects();
             this.addreviewer();
             this.arrter()
+            this.getMonths()
         },
         updated() {
             this.$nextTick(() => {

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

@@ -1010,11 +1010,12 @@
                 </p>
             </div>
             <el-button style="margin: 0 auto;" @click="pre">上一步</el-button>
-            
+            <div style="display: inline-block;width: 80%;text-align: center;" v-if="active==0">
+                <el-link type="primary" @click="toView()">查看工时导入记录</el-link>
+            </div>
             <el-button style="float:right;" @click="next" :disabled="importWxParam.date==null" v-if="active<2">下一步</el-button>
             <el-link v-if="active==1" style="float:right;margin-right:350px;margin-top:10px;" 
                 type="primary" @click="downloadCheckInExcel">下载员工工时统计模板.xlsx</el-link>
-            
         </el-dialog>
 
         <!--基于企业微信考勤数据的工时导入 -->