浏览代码

完成考评目标,月/季度单位考评的评价指标项与非评价指标项页面的数据导入入口,与导出功能;

SunZehao 2 年之前
父节点
当前提交
78c2ff757e

二进制
src/assets/btnIcon/export.png


二进制
src/assets/btnIcon/import.png


+ 2 - 1
src/components/assessment/evaluationMonthPage.vue

@@ -16,11 +16,12 @@
             <div class="PeriodBtn">
                 <btns
                 :showImport="false"
-                :showSave="false"
                 :showExport="false"
+                :showSave="false"
                 :showAdd="$utils.havePurview('monthQuarter:oneLevel:add')"
                 :showDelete="$utils.havePurview('monthQuarter:oneLevel:delete')"
                 :disDelete="changeDateSelect.length === 0"
+                :disImport="true"
                 :disExport="true"
                 @handleAdd="handleAdd"
                 @handleDelete="handleDelete"

+ 2 - 1
src/components/assessment/evaluationQuarterPage.vue

@@ -16,11 +16,12 @@
             <div class="PeriodBtn">
                 <btns
                 :showImport="false"
-                :showSave="false"
                 :showExport="false"
+                :showSave="false"
                 :showAdd="$utils.havePurview('monthQuarter:oneLevel:add')"
                 :showDelete="$utils.havePurview('monthQuarter:oneLevel:delete')"
                 :disDelete="changeDateSelect.length === 0"
+                :disImport="true"
                 :disExport="true"
                 @handleAdd="handleAdd"
                 @handleDelete="handleDelete"

+ 145 - 10
src/components/assessment/evaluationStartFrom.vue

@@ -58,21 +58,26 @@
                         <img :src="editIcon" alt="">
                         <span>新增</span>
                     </div> -->
-                    <!-- <div class="tableBtn delete">
-                        <img :src="deleteIcon" alt="">
-                        <span>删除</span>
-                    </div> -->
+                    <div class="tableBtn import" @click="handleImport">
+                        <img :src="importIcon" alt="">
+                        <span>导入</span>
+                    </div>
+                    <div class="tableBtn export" @click="handleExport">
+                        <img :src="exportIcon" alt="">
+                        <span>导出</span>
+                    </div>
                 </div>
                 <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
                     <el-tab-pane label="考评指标项内容" name="first">
                         <el-table :data="quantifiedList" style="width: 100%" @select="rowClick" @select-all="rowClick">
                             <el-table-column type="selection" label="操作" align="center"></el-table-column>
                             <el-table-column type="index" label="序号" width="80" />
+                            <el-table-column label="单位名称" prop="organizationName" width="300" />
+                            <el-table-column label="指标分类" prop="typeName" />
                             <el-table-column label="业务阶段" prop="stageName" />
                             <el-table-column label="业务属性" prop="sectionName" />
-                            <el-table-column label="单位名称" prop="organizationName" width="300" />
+                            <el-table-column label="指标名称" prop="childName" />
                             <el-table-column label="填报部门"  prop="deptName" width="260" />
-                            <el-table-column label="指标分类" prop="typeName" />
                             <el-table-column label="目标值">
                                 <template #default="scope">
                                     <el-input-number v-model="scope.row.quantifiedValue"
@@ -205,17 +210,26 @@
                 </span>
             </template>
         </el-dialog>
+        <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
     </div>
 </template>
 
 <script>
-import {apiGetdeptresponDetail,apiGetindicatorsaveBatchDto, apiGetOrganizationRule, 
+import importDailog from '../importPage/importDailog.vue'
+import {apiGetdeptresponDetail,apiGetindicatorsaveBatchDto, apiGetOrganizationRule, apiPostIsdoAction,
 apiGetindicatorListAll, apiGetbinstageList, apiGetIndicatorTypeList} from '../../api/api'
+import ExcelJS from 'exceljs'
+import fileSave from 'file-saver'
 import addIcon from '../../assets/btnIcon/add.png'
 import saveIcon from '../../assets/btnIcon/save.png'
 import editIcon from '../../assets/btnIcon/edit.png'
 import deleteIcon from '../../assets/btnIcon/delete.png'
+import exportIcon from '../../assets/btnIcon/export.png'
+import importIcon from '../../assets/btnIcon/import.png'
 export default {
+    components: {
+        importDailog
+    },
     data() {
         return {
             dialogVisible: false,
@@ -237,6 +251,8 @@ export default {
             saveIcon: saveIcon,
             editIcon: editIcon,
             deleteIcon: deleteIcon,
+            exportIcon: exportIcon,
+            importIcon: importIcon,
             rowMsg: {},
             orgruleData: [],
             indicatorTypeData: [],
@@ -442,7 +458,114 @@ export default {
                     }
                 }
             })
-        }
+        },
+        examineAndApprove(type) {
+            let that = this
+            let actionCS = ''
+            if (type === 'agree') {
+                if (that.rowMsg.taskType === 'SIGN') {
+                    actionCS = 'signAgree'
+                } else if (that.rowMsg.taskType === 'NORMAL') {
+                    actionCS = 'agree'
+                }
+            } else {
+                if (that.rowMsg.taskType === 'SIGN') {
+                    actionCS = 'signReject'
+                } else if (that.rowMsg.taskType === 'NORMAL') {
+                    actionCS = 'reject'
+                }
+            }
+            let params = {
+                taskId: that.rowMsg.id, //任务ID
+                nodeId: that.rowMsg.nodeId, //节点ID
+                action: actionCS, //固定值
+                instanceId: that.rowMsg.instId, //流程实例ID
+                opinion: that.descMsg, //审批意见
+                iamCode: window.localStorage.getItem('code'), //认证后code值
+                taskName: that.rowMsg.name,
+                defKey: that.instanceChild.defKey,
+                bizKey: that.instanceChild.bizKey
+            }
+            apiPostIsdoAction(params).then(datas =>{
+                if (datas && datas.data) {
+                    if (datas.data.isOk) {
+                        that.$message({
+                            message: datas.data.data,
+                            type: 'success'
+                        })
+                        that.dialogVisible = false
+                        that.$emit('approveMsg', datas.data.isOk)
+                    } else {
+                        that.$message({
+                            message: datas.data.msg,
+                            type: 'error'
+                        })
+                    }
+                }
+            })
+        },
+        handleImport() {
+            this.$refs.importPage.upload.title = "考评目标信息导入"
+            this.$refs.importPage.upload.open = true
+            this.$refs.importPage.upload.url = '/predict/api/smpmc/standardPointManagementImport'
+            this.$refs.importPage.upload.urlName = 'standardPointManagementImport'
+            this.$refs.importPage.upload.proName = '考评目标信息模板.xlsx'
+        },
+        successImport(val) {
+            that.getDetails(that.rowMsg.id)
+        },
+        importLoading(val) {
+            
+        },
+        handleExport() {
+            let data = []  //接口返回数据
+            const workbook = new ExcelJS.Workbook()
+            const worksheet = workbook.addWorksheet('Sheet1')
+            //根据数据自己调整
+            let colums = []
+            colums = [
+                { header: '单位名称', key: 'organizationName', width: 26 },
+                { header: '指标分类', key: 'typeName', width: 18 },
+                { header: '业务阶段', key: 'stageName', width: 18 },
+                { header: '业务属性', key: 'sectionName', width: 18 },
+                { header: '指标名称', key: 'childName', width: 18 },
+                { header: '填报部门', key: 'deptName', width: 26 },
+            ]
+            if (this.activeName === 'first') {
+                colums.push(
+                    { header: '目标值', key: 'quantifiedValue', width: 18 },
+                    { header: '单位', key: 'unit', width: 18 },
+                    { header: '审核状态', key: 'state', width: 18 }
+                )
+                this.quantifiedList.forEach(item =>{
+                    if (item.updateMark) {
+                        data.push(item)
+                    }
+                })
+            } else {
+                colums.push(
+                    { header: '值', key: 'nonQuantifiedValue', width: 18 },
+                    { header: '审核状态', key: 'state', width: 18 }
+                )
+                this.nonQuantifiedList.forEach(item =>{
+                    if (item.updateMark) {
+                        data.push(item)
+                    }
+                })
+            }
+            worksheet.columns = colums
+            worksheet.getRow(1).font = {
+                size: 12,
+                bold: true
+            }
+            worksheet.addRows(data)
+
+            workbook.xlsx.writeBuffer().then(buffer => {
+                //这里为type
+                const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
+                fileSave(blob, `数据导出.xlsx`)
+            })
+        },
     }
 }
 </script>
@@ -501,10 +624,10 @@ export default {
                     }
                     .detaTableBtns{
                         display: flex;
-                        width: 200px;
+                        width: 250px;
                         position: relative;
                         top: 32px;
-                        left: 80vw;
+                        left: 85vw;
                         z-index: 11111;
                         .tableBtn {
                             display: flex;
@@ -542,6 +665,18 @@ export default {
                                 color: #F65177;
                             }
                         }
+                        .export{
+                            cursor: pointer;
+                            span{
+                                color: #2baa8a;
+                            }
+                        }
+                        .import{
+                            cursor: pointer;
+                            span{
+                                color: #ce1e78;
+                            }
+                        }
                     }
                     .el-tabs{
                         .el-tabs__header{

+ 8 - 2
src/components/assessment/evaluationStartPage.vue

@@ -21,10 +21,10 @@
                 :showAdd="$utils.havePurview('evalStart:oneLevel:add')"
                 :showDelete="$utils.havePurview('evalStart:oneLevel:delete')"
                 :disDelete="changeDateSelect.length === 0"
+                :disImport="true"
                 :disExport="true"
                 @handleAdd="handleAdd"
                 @handleDelete="handleDelete"
-                @handleExport="handleExport"
                 ></btns>
             </div>
             <div class="evaluationStartTableData">
@@ -157,7 +157,8 @@
                 </div>
             </el-dialog>
         </div>
-        <start-from-list ref="startFromDetail"></start-from-list>
+        <!-- @approveMsg="approveMsg" -->
+        <start-from-list ref="startFromDetail" ></start-from-list>
     </div>
 </template>
 
@@ -410,6 +411,11 @@ export default {
         rowClick(selection, row) {
             this.changeDateSelect = selection
         },
+        approveMsg(val) {
+            if (val) {
+                this.getevaluStartList()
+            }
+        },
         handleAdd() {
             this.dialogVisible = true
             this.title = '新建表单填报'

+ 97 - 3
src/components/assessment/monthQuarterFrom.vue

@@ -62,6 +62,14 @@
                         <img :src="deleteIcon" alt="">
                         <span>删除</span>
                     </div> -->
+                    <div class="tableBtn import" @click="handleImport">
+                        <img :src="importIcon" alt="">
+                        <span>导入</span>
+                    </div>
+                    <div class="tableBtn export" @click="handleExport">
+                        <img :src="exportIcon" alt="">
+                        <span>导出</span>
+                    </div>
                 </div>
                 <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
                     <el-tab-pane label="考评指标项内容" name="first">
@@ -212,17 +220,26 @@
                 </span>
             </template>
         </el-dialog>
+        <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
     </div>
 </template>
 
 <script>
+import importDailog from '../importPage/importDailog.vue'
 import {apiGetOrgEvalInfoList,apiGetOrgEvaInfoBatchDto, apiGetOrganizationRule, 
 apiGetindicatorListAll, apiGetbinstageList, apiGetIndicatorTypeList} from '../../api/api'
+import ExcelJS from 'exceljs'
+import fileSave from 'file-saver'
 import addIcon from '../../assets/btnIcon/add.png'
 import saveIcon from '../../assets/btnIcon/save.png'
 import editIcon from '../../assets/btnIcon/edit.png'
 import deleteIcon from '../../assets/btnIcon/delete.png'
+import exportIcon from '../../assets/btnIcon/export.png'
+import importIcon from '../../assets/btnIcon/import.png'
 export default {
+    components: {
+        importDailog
+    },
     data() {
         return {
             dialogVisible: false,
@@ -244,6 +261,8 @@ export default {
             saveIcon: saveIcon,
             editIcon: editIcon,
             deleteIcon: deleteIcon,
+            exportIcon: exportIcon,
+            importIcon: importIcon,
             rowMsg: {},
             statusData: []
         }
@@ -442,7 +461,70 @@ export default {
                     }
                 }
             })
-        }
+        },
+        handleImport() {
+            this.$refs.importPage.upload.title = "月/季度单位信息导入"
+            this.$refs.importPage.upload.open = true
+            this.$refs.importPage.upload.url = '/predict/api/smpmc/standardPointManagementImport'
+            this.$refs.importPage.upload.urlName = 'standardPointManagementImport'
+            this.$refs.importPage.upload.proName = '月/季度单位信息模板.xlsx'
+        },
+        successImport(val) {
+            that.getDetails(that.rowMsg.id)
+        },
+        importLoading(val) {
+            
+        },
+        handleExport() {
+            let data = []  //接口返回数据
+            const workbook = new ExcelJS.Workbook()
+            const worksheet = workbook.addWorksheet('Sheet1')
+            //根据数据自己调整
+            let colums = []
+            colums = [
+                { header: '单位名称', key: 'organizationName', width: 26 },
+                { header: '指标分类', key: 'typeName', width: 18 },
+                { header: '业务阶段', key: 'stageName', width: 18 },
+                { header: '业务属性', key: 'sectionName', width: 18 },
+                { header: '指标名称', key: 'childName', width: 18 },
+                { header: '填报部门', key: 'deptName', width: 26 },
+                { header: '指标项', key: 'optionName', width: 26 },
+            ]
+            if (this.activeName === 'first') {
+                colums.push(
+                    { header: '目标值', key: 'quantifiedValue', width: 18 },
+                    { header: '单位', key: 'unit', width: 18 },
+                    { header: '审核状态', key: 'state', width: 18 }
+                )
+                this.quantifiedList.forEach(item =>{
+                    if (item.updateMark) {
+                        data.push(item)
+                    }
+                })
+            } else {
+                colums.push(
+                    { header: '值', key: 'nonQuantifiedValue', width: 18 },
+                    { header: '审核状态', key: 'state', width: 18 }
+                )
+                this.nonQuantifiedList.forEach(item =>{
+                    if (item.updateMark) {
+                        data.push(item)
+                    }
+                })
+            }
+            worksheet.columns = colums
+            worksheet.getRow(1).font = {
+                size: 12,
+                bold: true
+            }
+            worksheet.addRows(data)
+
+            workbook.xlsx.writeBuffer().then(buffer => {
+                //这里为type
+                const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
+                fileSave(blob, `数据导出.xlsx`)
+            })
+        },
     }
 }
 </script>
@@ -501,10 +583,10 @@ export default {
                     }
                     .detaTableBtns{
                         display: flex;
-                        width: 500px;
+                        width: 250px;
                         position: relative;
                         top: 32px;
-                        left: 90vw;
+                        left: 85vw;
                         z-index: 11111;
                         .tableBtn {
                             display: flex;
@@ -542,6 +624,18 @@ export default {
                                 color: #F65177;
                             }
                         }
+                        .import{
+                            cursor: pointer;
+                            span{
+                                color: #ce1e78;
+                            }
+                        }
+                        .export{
+                            cursor: pointer;
+                            span{
+                                color: #2baa8a;
+                            }
+                        }
                     }
                     .el-tabs{
                         .el-tabs__header{