ggooalice 2 rokov pred
rodič
commit
7396735251

+ 11 - 1
fhKeeper/formulahousekeeper/octopus/src/routes.js

@@ -45,7 +45,7 @@ import simpleReport from './views/simplereport/list';
 
 // 研究中心
 // import research from './views/research/list';
-
+import migrateData from './views/migrateData/migrateData'
 // 角色权限
 import quanx from './views/quanx/quanx'
 
@@ -163,6 +163,16 @@ export const allRouters = [//组织架构
             { path: '/reviewImport', component: reviewImport, name: '操作记录' },
         ]
     },
+    {
+        path: '/',
+        component: Home,
+        name: '待办任务',
+        iconCls: 'iconfont firerock-iconshenhe',
+        leaf: true,
+        children: [
+            { path: '/migrateData', component: migrateData, name: '数据迁移' },
+        ]
+    },
     //成本统计
     // {
     //     path: '/',

+ 158 - 0
fhKeeper/formulahousekeeper/octopus/src/views/migrateData/migrateData.vue

@@ -0,0 +1,158 @@
+@<template>
+  <section>
+    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+        <el-form :inline="true">
+            <el-form-item label="数据迁移" style="margin-left:20px"></el-form-item>
+        </el-form>
+    </el-col>
+    <el-col :span="24" style="padding:25px">
+        <el-form style="width:500px;margin:0 auto" label-position="left" label-width="100px">
+            <el-form-item label="当前公司" style="margin-top:40px">
+                <el-input v-model="nowCompanyId" placeholder="请输入" clearable style="width:250px"></el-input>
+            </el-form-item>
+            <el-form-item label="当前公司超管" style="margin-top:40px">
+                <el-input v-model="nowCompanyCg" placeholder="请输入" clearable style="width:250px"></el-input>
+            </el-form-item>
+            <el-form-item label="目标公司" style="margin-top:40px">
+                <el-input v-model="toCompanyId" placeholder="请输入" clearable style="width:250px"></el-input>
+            </el-form-item>
+            <el-form-item label="目标公司超管" style="margin-top:40px">
+                <el-input v-model="toCompanyCg" placeholder="请输入" clearable style="width:250px"></el-input>
+            </el-form-item>
+        </el-form>
+        <div style="width:500px;margin:100px auto">
+            <div style="width:350px;text-align:center">
+                <el-button type="primary" @click="submit" style="margin:0 auto">立即迁移</el-button>
+            </div>
+        </div>
+    </el-col>
+  </section>
+</template>
+
+<script>
+export default {
+    data(){
+        return{
+            list:[],
+            nowCompanyId: '',
+            toCompanyId: '',
+            nowCompanyCg: '',
+            toCompanyCg: ''
+        }
+    },
+    mounted(){
+        // this.getList()
+    },
+    methods:{
+        getList() {
+                this.http.post('/company/getList', {
+                    pageIndex: 1,
+                    pageSize: 9999,
+                    companyName: '',
+                    isMeal: 0
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.list = res.data.records;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+        submit() {
+            this.nowCompanyId = this.nowCompanyId.trim()
+            this.nowCompanyCg = this.nowCompanyCg.trim()
+            this.toCompanyId = this.toCompanyId.trim()
+            this.toCompanyCg = this.toCompanyCg.trim()
+            if(this.nowCompanyId == ''){
+                this.$message({
+                    message: '当前公司未输入!',
+                    type: 'warning'
+                })
+                return
+            }else if(this.toCompanyId == ''){
+                this.$message({
+                    message: '目标公司未输入!',
+                    type: 'warning'
+                })
+                return
+            }else if(this.nowCompanyCg == ''){
+                this.$message({
+                    message: '当前公司超管未输入!',
+                    type: 'warning'
+                })
+                return
+            }else if(this.toCompanyCg == ''){
+                this.$message({
+                    message: '目标公司超管未输入!',
+                    type: 'warning'
+                })
+                return
+            }else if(this.nowCompanyId == this.toCompanyId){
+                this.$message({
+                    message: '当前公司与目标公司相同!',
+                    type: 'warning'
+                })
+                return
+            }
+            this.$confirm('确认进行数据迁移吗?','提示',{
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(()=>{
+                this.http.post('/company/dataMigration',{
+                    oldCompanyId: this.nowCompanyId,
+                    targetCompanyId: this.toCompanyId,
+                    oldUserName: this.nowCompanyCg,
+                    targetUserName: this.toCompanyCg
+                },res => {
+                    if(res.code == 'ok'){
+                        this.$message({
+                            message: '数据迁移成功',
+                            type: 'success'
+                        })
+                        this.nowCompanyId = null
+                        this.toCompanyId = null
+                        this.getList()
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            }).catch(()=>{
+                this.$message({
+                    message: '已取消操作',
+                    type: 'info'
+                })
+            })
+            
+        }
+    }
+}
+</script>
+
+<style scoped>
+.sidebars {
+  height: 100%;
+  position: absolute;
+  border-right: 1px solid #E6E6E6;
+  z-index: 2;
+  top: 0;
+}
+</style>

+ 25 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/centerManage/centerManage.vue

@@ -8,6 +8,7 @@
                 <el-link icon="el-icon-circle-plus-outline" type="primary" :underline="false" class="tanjia" @click="addNewSubProject()">添加{{user.timeType.customDegreeName}}</el-link>
                 <el-link type="primary" :underline="false" @click="batchDelete" class="tanjia">批量删除{{user.timeType.customDegreeName}}</el-link> -->
                 <el-link type="primary" :underline="false" @click="batchDelete" class="tanjia">批量删除</el-link>
+                <el-link type="primary" :underline="false" @click="outoCenterRatio" class="tanjia">数据导出</el-link>
                 <el-link type="primary" :underline="false" @click="intoCenterRatio" class="tanjia">批量导入</el-link>
                 <el-link icon="el-icon-circle-plus-outline" type="primary" :underline="false" class="tanjia" @click="addNewSubProject()">新增</el-link>
 
@@ -140,6 +141,30 @@
             intoCenterRatio(){
                 this.intoCenterDialog=true;
             },
+            outoCenterRatio(){
+                this.http.post('/report-extra-degree/exportData',{},
+                res => {
+                    if(res.code == 'ok'){
+                        let filePath = res.data;
+                        let fileName = filePath.split('/upload/')[1]
+                        const a = document.createElement('a'); // 创建a标签
+                        a.setAttribute('download', fileName);// download属性
+                        a.setAttribute('href', filePath);// href链接
+                        a.click(); //自执行点击事件
+                        a.remove();
+                    }else{
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
             batchImportData(item) {
                 //首先判断文件类型
                 let str = item.file.name.split(".");

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

@@ -1162,7 +1162,11 @@ export default {
       let budget = this.budgetFilter(row.curcostList,eid)
       let already = this.AlreadyFilter(row.realcostList,eid)
       let ret = (already / budget)*100
-      return ret.toFixed(0)
+      if(budget == 0){
+        return "NaN"
+      }else{
+        return ret.toFixed(0)
+      }
     },
 
     

+ 10 - 9
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -74,15 +74,16 @@
                 <div :style="'height:'+tableHeight+'px;width:1px;background:#eee;margin-right:10px;margin-left:10px;'" ></div>
                 <div class="allDaily" style="float:left;flex-grow:1">
                     <!--系统管理员和部门负责人 -->
-                    <div class="report_title" >
-                        
-                        <span>工作日报 ({{curDate}})</span>
-                        <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept">| {{depData != null ?depData.label:""}}
-                        <span v-if="targetUid == null">
-                         - 已填写
-                        <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.length}}</span></el-link>人,
-                        未填写<el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(depData == null?data[0].membCount:(depData.isUser == 1?1:depData.membCount))-reportList.length | numbers}}</span></el-link>人
-                        </span>
+                    <div class="report_title" style="display:flex;justify-content: space-between;">
+                        <span>
+                            <span>工作日报 ({{curDate}})</span>
+                            <span v-if="permissions.reportsCompany||user.manageDeptId != 0 || permissions.reportsDept">| {{depData != null ?depData.label:""}}
+                            <span v-if="targetUid == null">
+                            - 已填写
+                            <el-link :underline="false" @click="showMembList(1)"><span style="margin-left:5px;margin-right:5px;color:green;">{{reportList.length}}</span></el-link>人,
+                            未填写<el-link :underline="false" @click="showMembList(0)"><span style="margin-left:5px;margin-right:5px;color:red;">{{(depData == null?data[0].membCount:(depData.isUser == 1?1:depData.membCount))-reportList.length | numbers}}</span></el-link>人
+                            </span>
+                            </span>
                         </span>
                         <span style="float:right;">
                             <el-link type="primary" style="margin-right:10px;" :underline="false" @click="isSubstitude=false;fillInReport(-1,0)">填写日报</el-link>