Prechádzať zdrojové kódy

2022.8.4 octopus报表配置

ggooalice 2 rokov pred
rodič
commit
234e53ca80

+ 81 - 14
fhKeeper/formulahousekeeper/octopus/src/views/customer/list.vue

@@ -62,8 +62,9 @@
                     <el-button size="mini"  @click="editClick('B', scope.row)">修改有效期</el-button>
                     <el-button size="mini"  @click="editClick('F', scope.row)" :disabled="!(scope.row.dingdingCorpid || scope.row.wxCorpid)">考勤同步</el-button>
                     <el-button size="mini"  @click="editClick('C', scope.row)">修改版本</el-button>
-                    <el-button size="mini"  @click="editClick('D', scope.row)" v-if="!scope.row.setMeal">设为已签约</el-button>
+                    <el-button size="mini"  @click="editClick('D', scope.row)" :disabled="scope.row.setMeal">设为已签约</el-button>
                     <el-button size="mini"  @click="editClick('G', scope.row)">其他设置</el-button>
+                    <el-button size="mini"  @click="editClick('H', scope.row)">报表配置</el-button>
                     <el-button size="mini"  @click="editClick('E', scope.row)" v-loading="dingdingSync" v-if="scope.row.dingdingCorpid">同步钉钉人员</el-button>
                 </template>
             </el-table-column>
@@ -209,6 +210,18 @@
                 <el-button type="primary" @click="ConfirmG()">确 定</el-button>
             </span>
         </el-dialog>
+        <!-- 报表配置 -->
+        <el-dialog v-if="editDialogH" :visible.sync="editDialogH" title="报表配置">
+            <el-form label-width="50px" style="">
+                <el-form-item v-for="item in reportFormList" :key="item.id" style="width:33%;display:inline-block;">
+                    <el-checkbox v-model="item.owned">{{item.reportFormName}}</el-checkbox>
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="editDialogH = false">取 消</el-button>
+                <el-button type="primary" @click="ConfirmH()">确 定</el-button>
+            </span>
+        </el-dialog>
     </section>
 </template>
 <script>
@@ -224,6 +237,7 @@
                 editDialogD: false,
                 editDialogF: false,
                 editDialogG: false,
+                editDialogH: false,
 
 
 
@@ -233,6 +247,8 @@
                 // 修改有效期
                 expirationNewDate: null,
 
+                reportFormList: [],
+
 
 
                 keyword:null,
@@ -262,8 +278,8 @@
                 this.dialogData = JSON.parse(JSON.stringify(obj))
                 console.log("data",this.dialogData);
                 if(i == 'A'){ this.editDialogA = true, this.addStaffCountMaxNum = 0 }
-                if(i == 'B'){ this.editDialogB = true, this.expirationNewDate = this.dialogData.expirationDate }
-                if(i == 'C'){ this.editDialogC = true,
+                else if(i == 'B'){ this.editDialogB = true, this.expirationNewDate = this.dialogData.expirationDate }
+                else if(i == 'C'){ this.editDialogC = true,
                     this.dialogData.packageWorktime = this.dialogData.packageWorktime ? true : false,
                     this.dialogData.packageProject = this.dialogData.packageProject ? true : false,
                     this.dialogData.packageContract = this.dialogData.packageContract ? true : false,
@@ -276,12 +292,12 @@
                     this.dialogData.packageFinance = this.dialogData.packageFinance ? true : false,
                     this.dialogData.packageProvider = this.dialogData.packageProvider ? true : false
                 }
-                if(i == 'D'){ this.editDialogD = true }
-                if (i=='E') {
+                else if(i == 'D'){ this.editDialogD = true }
+                else if (i=='E') {
                     //同步钉钉的组织架构人员
                     this.startSyncDDMembs(obj);
                 }
-                if(i == 'F'){
+                else if(i == 'F'){
                     // 考勤同步
                     this.editDialogF = true
                     this.http.post('/time-type/get',{
@@ -307,7 +323,7 @@
                     
 
                 }
-                if(i == 'G'){
+                else if(i == 'G'){
                     // 其他设置
                     this.editDialogG = true
                     this.http.post('/time-type/get',{
@@ -336,6 +352,10 @@
                     })
                     
                 }
+                else if(i == 'H'){
+                    this.editDialogH = true
+                    this.getReoprtFormList(obj)
+                }
                 
             },
 
@@ -366,6 +386,28 @@
                     });
                 });
             },
+            getReoprtFormList(row){
+                this.http.post('/company-report/list',{
+                    companyId: row.id
+                },res => {
+                    if(res.code == 'ok'){
+                        this.reportFormList = res.data
+                        for(let i in this.reportFormList){
+                            this.reportFormList[i].owned = this.reportFormList[i].owned ? true : false
+                        }
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
 
             // 增加人数上限
             ConfirmA(){
@@ -395,8 +437,6 @@
                     });
                 });
             },
-
-
             // 修改有效期
             ConfirmB(){
                 this.listLoading = true;
@@ -425,8 +465,6 @@
                     });
                 });
             },
-
-
             // 修改版本
             ConfirmC(){
                 this.listLoading = true;
@@ -469,8 +507,6 @@
                     });
                 });
             },
-
-
             // 设为已签约
             ConfirmD(){
                 this.listLoading = true;
@@ -499,7 +535,6 @@
                     });
                 });
             },
-
             // 考勤同步
             ConfirmF(){
                 let parameter = {
@@ -571,6 +606,38 @@
                     })
                 })
             },
+            // 报表配置
+            ConfirmH(){
+                let ids = ''
+                for(let i in this.reportFormList){
+                    if(this.reportFormList[i].owned){
+                        ids += this.reportFormList[i].id + ','
+                    }
+                }
+                if(ids){ids = ids.substring(0,ids.length - 1)}
+                this.http.post('/company-report/update',{
+                    companyId: this.dialogData.id,
+                    formIds: ids
+                },res => {
+                    if(res.code == 'ok'){
+                        this.editDialogH = false
+                        this.$message({
+                            message: '更新成功',
+                            type: 'success'
+                        })
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },