123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424 |
- <template>
- <div :class="$style.personalStatistics">
- <a-card :class="$style.conditions">
- <a-form-model
- ref="projectSearchForm"
- class="ant-advanced-search-form"
- :model="form"
- :rules="rules"
- v-bind="formItemLayout"
- >
- <a-row :gutter="24" :class="$style.antformitem">
- <a-col :span="8">
- <a-form-model-item label="审计机构" prop="unitNames">
- <AuditGroupPicker
- ref="unitNames"
- v-model="form.unitNames"
- :single="false"
- :read-only="false"
- :root-node="rootNode"
- />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="年度" prop="planYear">
- <a-date-picker
- v-model="form.planYear"
- mode="year"
- picker="YYYY"
- format="YYYY"
- :allow-clear="false"
- placeholder="选择年度"
- :input-read-only="true"
- :value="year"
- :open="endOpen"
- @panelChange="yearChange"
- @openChange="handleEndOpenChange"
- ></a-date-picker>
- </a-form-model-item>
- </a-col>
- </a-row>
- </a-form-model>
- </a-card>
- <a-card :class="$style.conditions2">
- <div>
- <p :class="$style.tableTitle"> 审计署 </p>
- <a-row :gutter="24" :class="$style.antformitem">
- <a-col :span="8">
- <div :class="$style.buttonContent">
- <a-button :loading="exportLoading" type="primary" @click="exportAuditGroup"
- >生成《单位及内部审计机构基本情况表》</a-button
- >
- </div>
- </a-col>
- </a-row>
- <a-row :gutter="24" :class="$style.antformitem">
- <a-col :span="8">
- <div :class="$style.buttonContent">
- <a-button :loading="exportLoading" type="primary" @click="exportAuditWork"
- >生成《单位内部审计业务情况表》</a-button
- >
- </div>
- </a-col>
- </a-row>
- </div>
- </a-card>
- <a-card :class="$style.conditions3">
- <p :class="$style.tableTitle"> 国资委 </p>
- <a-row :gutter="24" :class="$style.antformitem">
- <a-col :span="8">
- <div :class="$style.buttonContent">
- <a-button
- :loading="exportLoading"
- type="primary"
- @change="processReq"
- @click="handelExport"
- >生成《国资委报表》</a-button
- >
- </div>
- </a-col>
- </a-row>
- </a-card>
- </div>
- </template>
- <script>
- import moment from 'moment'
- import components from './_import-components/audit-enterprise-reports-import'
- import AuditGroupPicker from '@product/iam/components/picker/audit-group-picker.vue'
- import { message } from '@/common/one-ui'
- import download from '@/common/services/download'
- import axios from '@/common/services/axios-instance'
- import { getUserInfo } from '@/common/store-mixin'
- export default {
- name: 'AuditEnterpriseReports',
- metaInfo: {
- title: '企业上报报表',
- },
- components: {
- ...components,
- AuditGroupPicker,
- },
- data() {
- return {
- endOpen: false,
- year: null,
- exportLoading: false,
- reqData: {
- unitNames: '',
- planYear: '',
- },
- data: [],
- form: {
- unitNames: [],
- planYear: '',
- },
- rules: {
- unitNames: [{ required: true, message: '请选择审计机构', trigger: 'change' }],
- planYear: [{ required: true, message: '请选择统计时间', trigger: 'change' }],
- },
- formItemLayout: {
- labelCol: { span: 6 },
- wrapperCol: { span: 14 },
- },
- rootNode: {},
- }
- },
- created() {
- let userInfo = getUserInfo()
- const params = {
- orgId: userInfo.deptId,
- }
- axios({
- url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
- method: 'get',
- }).then((res) => {
- userInfo = res.data
- params.orgId = res.data.id
- axios({
- url: 'api/xcoa-mobile/v1/iamorg/findIamOrg',
- method: 'post',
- params,
- }).then((res) => {
- this.id = res.data.id
- const deptCode = res.data.orgId + ''
- const deptName = res.data.orgName
- this.rootNode = { code: deptCode, name: deptName, id: this.id }
- })
- })
- // this.initGroupPicker()
- // this.tableResize()
- },
- mounted() {
- // this.tableResize()
- this.initGroupPicker()
- this.initDatePicker()
- // 初始化审计类型数据字典信息
- // this.initDictionaryInfo()
- },
- methods: {
- yearChange(value) {
- debugger
- this.year = value
- this.form.planYear = value.format('YYYY')
- if (document.getElementsByClassName('ant-calendar-picker-container').length > 0) {
- document.getElementsByClassName('ant-calendar-picker-container')[0].style.display = 'none'
- }
- },
- handleEndOpenChange(open) {
- this.endOpen = open
- },
- // initGroupPicker() {
- // debugger
- // const userInfo = getUserInfo()
- // const userDeptValue = []
- // const userDept = {
- // code: userInfo.deptId + '',
- // name: JSON.parse(userInfo.attrs.deptLevMap).COMPANY,
- // text: JSON.parse(userInfo.attrs.deptLevMap).COMPANY,
- // id: userInfo.deptId,
- // type: 'Group',
- // }
- // userDeptValue.push(userDept)
- // this.form.unitNames = userDeptValue
- // },
- initGroupPicker() {
- let userInfo = getUserInfo()
- const params = {
- orgId: userInfo.deptId,
- }
- axios({
- url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
- method: 'get',
- }).then((res) => {
- userInfo = res.data
- params.orgId = res.data.id
- axios({
- url: 'api/xcoa-mobile/v1/iamorg/findIamOrg',
- method: 'post',
- params,
- }).then((res) => {
- const userDeptValue = []
- const userDept = {
- code: res.data.orgId + '',
- name: res.data.orgName,
- text: res.data.orgName,
- id: res.data.orgId,
- type: 'Group',
- }
- userDeptValue.push(userDept)
- this.form.unitNames = userDeptValue
- this.$refs.projectSearchForm.validate()
- })
- })
- },
- initDatePicker() {
- debugger
- // const datePick = []
- const time = moment(new Date())
- // datePick.push(time)
- this.form.planYear = time.format('YYYY')
- },
- initDictionaryInfo() {
- axios({
- url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_AUDIT_TYPE',
- method: 'get',
- }).then((res) => {
- if (res.status === 200) {
- this.auditTypeOptions = res.data
- }
- })
- },
- // tableResize() {
- // document
- // .getElementsByClassName('ant-table-empty')[0]
- // .getElementsByClassName('ant-table-tbody')[0]
- // .appendChild(document.getElementsByClassName('ant-table-placeholder')[0])
- // var width = document.getElementsByClassName('ant-table-tbody')[0].offsetWidth
- // document.getElementsByClassName('ant-table-placeholder')[0].style.width = `${width}%`
- // },
- // dataLoaded(res) {
- // if (res.data.length) {
- // res.data.forEach((item, index) => {
- // item.id = index + 1
- // })
- // } else {
- // this.tableResize()
- // }
- // return res
- // },
- processReq(req) {
- req.data = {
- maxResults: req.data.maxResults,
- startPosition: req.data.startPosition,
- unitIds: this.reqData.unitNames,
- planYear: this.reqData.planYear,
- }
- return req
- },
- handelExport() {
- debugger
- if (this.form.unitNames.length === 0 && this.form.planYear.length === 0) {
- this.exportGZW()
- } else {
- // 处理部门
- const arr = []
- this.form.unitNames.forEach((item) => {
- arr.push(`'${item.id}'`)
- })
- this.reqData.unitNames = arr.join(',')
- this.reqData.unitIds = arr.join(',')
- // 处理时间
- this.reqData.planYear = this.form.planYear + ''
- // this.reqData.dateEnd = this.form.timeRange[1].year() + ''
- this.exportGZW()
- }
- },
- exportAuditGroup() {
- if (this.form.unitNames.length === 0 && this.form.planYear.length === 0) {
- this.exportIamOrgExcel()
- } else {
- // 处理时间
- // this.reqData.dateStart = this.form.timeRange[0].year() + ''
- // this.reqData.dateEnd = this.form.timeRange[1].year() + ''
- // 处理部门
- const arr = []
- this.form.unitNames.forEach((item) => {
- arr.push(`'${item.id}'`)
- })
- this.reqData.unitNames = arr.join(',')
- this.reqData.unitIds = arr.join(',')
- // 处理时间
- this.reqData.planYear = this.form.planYear + ''
- this.exportIamOrgExcel()
- }
- },
- exportAuditWork() {
- if (this.form.unitNames.length === 0 && this.form.planYear.length === 0) {
- this.exportIamDwywExcel()
- } else {
- // 处理时间
- // this.reqData.dateStart = this.form.timeRange[0].year() + ''
- // this.reqData.dateEnd = this.form.timeRange[1].year() + ''
- // 处理部门
- const arr = []
- this.form.unitNames.forEach((item) => {
- arr.push(`'${item.id}'`)
- })
- this.reqData.unitNames = arr.join(',')
- this.reqData.unitIds = arr.join(',')
- // 处理时间
- this.reqData.planYear = this.form.planYear + ''
- this.exportIamDwywExcel()
- }
- },
- exportGZW() {
- axios({
- method: 'post',
- url: 'api/xcoa-mobile/v1/iam-auditWork-statistics/exportGZWExcel',
- responseType: 'blob',
- data: {
- unitIds: this.reqData.unitIds,
- planYear: this.reqData.planYear,
- },
- }).then((res) => {
- const url = URL.createObjectURL(res.data)
- download(url, '国资委报表.xls')
- })
- },
- exportIamOrgExcel() {
- axios({
- method: 'post',
- url: 'api/xcoa-mobile/v1/iam-audits-statistics/exportIamOrgExcel',
- responseType: 'blob',
- data: {
- unitIds: this.reqData.unitIds,
- planYear: this.reqData.planYear,
- },
- }).then((res) => {
- const url = URL.createObjectURL(res.data)
- download(url, '单位及内部审计机构基本情况表-审计署.xls')
- })
- },
- exportIamDwywExcel() {
- axios({
- method: 'post',
- url: 'api/xcoa-mobile/v1/iam-audits-statistics/exportIamDwywExcel',
- responseType: 'blob',
- data: {
- unitIds: this.reqData.unitIds,
- planYear: this.reqData.planYear,
- },
- }).then((res) => {
- const url = URL.createObjectURL(res.data)
- download(url, '单位内部审计业务情况表-审计署.xls')
- })
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- .personalStatistics {
- :global(.ant-table-body) {
- overflow-x: scroll !important;
- }
- :global(.ant-form-item) {
- margin: 0;
- }
- :global(.ant-table-empty) {
- :global(.ant-table-body) {
- overflow-x: scroll !important;
- }
- }
- .conditions {
- height: 100px;
- margin-bottom: 20px;
- }
- .conditions2 {
- height: 300px;
- margin-bottom: 20px;
- }
- .conditions3 {
- height: 200px;
- margin-bottom: 20px;
- }
- .buttonContent {
- margin-right: 500px;
- padding-top: 50px;
- text-align: right;
- button {
- margin: 0 4px;
- }
- }
- :global(.anticon-setting) {
- display: none;
- }
- .tableTitle {
- padding-top: 16px;
- margin: 0;
- font-size: 22px;
- font-weight: bold;
- color: #404040;
- background: white;
- }
- :global(.reporttablecardxm) {
- :global(.ant-table-body) {
- height: auto !important;
- min-height: auto !important;
- overflow: auto;
- }
- }
- :global(.ant-table-placeholder) {
- height: auto !important;
- }
- }
- </style>
|