소스 검색

绩效导出

wyh 1 년 전
부모
커밋
dd5d3689a4

+ 4 - 1
itdmWeb/src/api/api.js

@@ -118,6 +118,8 @@ const getYeWU = (params)=>getAction("flowpath/itdmRunFlowPath/queryById",params)
 const getFirNextZrr = (params)=>getAction("/flowpath/itdmRunFlowPathStep/AddSelectNextStepUser",params);
 // 下一步的时候选择操作人的下拉列表
 const getNextZrr = (params)=>getAction("/flowpath/itdmRunFlowPathStep/selectNextStepUser",params);
+// 绩效导出
+const getExportJx = (params)=>downFile("/jixiaoPersonPrice/jixiaoPersonPrice/exportXlsByTime",params);
 
 
 //日志管理
@@ -308,7 +310,8 @@ export {
   getYeWU,
   jixiaoPersonPrice,
   getFirNextZrr,
-  getNextZrr
+  getNextZrr,
+  getExportJx
 }
 
 

+ 12 - 2
itdmWeb/src/views/module-iTDM/flowpath/ItdmRunFlowPathList.vue

@@ -53,6 +53,7 @@
     <!-- 操作按钮区域 -->
     <div class='table-operator'>
       <a-button @click='handleAdd' type='primary' icon='plus'>新增</a-button>
+      <a-button @click='exportJX' type='primary' icon='download'>绩效导出</a-button>
       <!-- <a-button type='primary' icon='download' @click="handleExportXls('运行流程表')">导出</a-button>
       <a-upload name='file' :showUploadList='false' :multiple='false' :headers='tokenHeader' :action='importExcelUrl'
                 @change='handleImportExcel'>
@@ -157,6 +158,8 @@
 
     <!-- 选择下一步责任人 -->
     <itdm-next-modal ref='nextChoose' @ok='modalFormOk' :fatherMethod="loadData"></itdm-next-modal>
+    <!-- 导出绩效 -->
+    <itdm-export-modal ref='exportJx' @ok='modalFormOk' :fatherMethod="loadData"></itdm-export-modal>
 
 
 
@@ -176,13 +179,15 @@ import ItdmRunFlowPathShenhel from './modules/ItdmRunFlowPathShenhel.vue'
 import ItdmRunFlowPathShenhel1 from './modules/ItdmRunFlowPathShenhel1.vue'
 import { deleteAction, getAction,downFile,getFileAccessHttpUrl } from '@/api/manage'
 import ItdmNextModal from './modules/ItdmNextModal.vue'
+import ItdmExportModal from './modules/ItdmExportModal.vue'
 
 export default {
   name: 'ItdmRunFlowPathList',
   mixins: [JeecgListMixin, mixinDevice],
   components: {
     ItdmRunFlowPathModal,ItdmRunFlowPathShenhel,ItdmRunFlowPathShenhel1,
-    ItdmNextModal
+    ItdmNextModal,
+    ItdmExportModal
   },
   data() {
     return {
@@ -354,6 +359,7 @@ export default {
     // },
     // 17写的
     tongguo: function(record) {
+      console.log(666,record)
       this.$refs.nextChoose.next(record);
       // let that = this
       // var data = { 'runFlowPath': record.id }
@@ -391,7 +397,11 @@ export default {
       fieldList.push({ type: 'string', value: 'dqSetp', text: '当前步骤id', dictCode: 'xxx,xxx,xxx' })
       fieldList.push({ type: 'string', value: 'status', text: '状态', dictCode: '' })
       this.superFieldList = fieldList
-    }
+    },
+    // 绩效导出
+    exportJX() {
+      this.$refs.exportJx.next();
+    },
   }
 }
 </script>

+ 109 - 0
itdmWeb/src/views/module-iTDM/flowpath/modules/ItdmExportModal.vue

@@ -0,0 +1,109 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <a-form-model ref="form" :model="model" :rules="validatorRules">
+      <a-row>
+        <a-col :span="24">
+          <a-form-model-item label="时间选择" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dataTime">
+            <a-range-picker v-model="model.dataTime" @change="onChange" />
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+    </a-form-model>
+  </a-modal>
+</template>
+
+<script>
+
+import { getExportJx } from '@/api/api'
+import { getFileAccessHttpUrl } from '@/api/manage'
+
+export default{
+    props: {
+      fatherMethod: {
+        type: Function,
+        default: null
+      }
+    },
+    data() {
+        return {
+            model:{},
+            title:'绩效导出',
+            width:800,
+            visible: false,
+            disableSubmit: false,
+            labelCol: {
+            xs: { span: 24 },
+            sm: { span: 5 },
+            },
+            wrapperCol: {
+            xs: { span: 24 },
+            sm: { span: 16 },
+            },
+            validatorRules: {
+                dataTime: [
+                    { required: true, message: '请选择时间!'},
+                ],
+            },
+            // 传输参数
+            exportModel: {},
+        }
+    },
+    methods: {
+      next () {
+        this.visible=true
+      },
+      // 监听时间选择的值
+      onChange(date, dateString) {
+        console.log(date, dateString);
+        this.exportModel.beginDate = dateString[0]
+        this.exportModel.endDate = dateString[1]
+        console.log(this.exportModel)
+      },
+      handleOk () {
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            getExportJx(this.exportModel).then((res) =>{
+              // 导出绩效
+              let url = window.URL.createObjectURL(new Blob([res],{type: 'application/vnd.ms-excel'}))
+              let link = document.createElement('a')
+              link.style.display = 'none'
+              link.href = url
+              link.setAttribute('download', '绩效导出表.xls')
+              document.body.appendChild(link)
+              link.click()
+              document.body.removeChild(link); //下载完成移除元素
+              window.URL.revokeObjectURL(url); //释放掉blob对象
+              // dundun写的
+              // const blob = new Blob([res])
+              // const url = window.URL.createObjectURL(blob)
+              // let a = document.createElement('a')
+              // a.setAttribute('href', url)
+              // a.setAttribute('download', `绩效单.xls`)
+              // a.click()
+            })
+          }
+        })
+
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+        this.model= {}
+        this.$refs.form.resetFields()
+      }
+
+    }
+}
+</script>