123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498 |
- <template>
- <div :class="$style.auditProRectify">
- <a-card :class="$style.conditions">
- <a-form-model
- ref="advancedSearchForm"
- 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="timeRange">
- <AuditRangePicker :time-range.sync="form.timeRange" />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="审计机构" prop="unitNames">
- <AuditGroupPicker
- ref="unitNames"
- v-model="form.unitNames"
- :single="true"
- :read-only="false"
- :root-node="rootNode"
- />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="整改单位" prop="rectifyUnits">
- <sd-group-picker
- ref="rectifyUnits"
- v-model="form.rectifyUnits"
- :single="false"
- :read-only="false"
- /> </a-form-model-item
- ></a-col>
- </a-row>
- </a-form-model>
- <div :class="$style.buttonContent">
- <a-button @click="handleReset">重置</a-button>
- <a-button type="primary" @click="handleAction('serach')">查询</a-button>
- <a-button :loading="exportLoading" type="primary" @click="handleAction('export')"
- >导出</a-button
- >
- </div>
- </a-card>
- <p :class="$style.tableTitle"> 整改情况统计(按整改单位查询) </p>
- <a-card class="reporttablecardxm">
- <div id="hj" style="display: none">
- <sd-data-table-hj
- ref="dataTablesum"
- :key="dataKeysum"
- :process-req="processReqsum"
- :columns="columnssum"
- :projectlist="true"
- :defultpagination-pagesize="50"
- data-url="api/xcoa-mobile/v1/iam-statistics/getUnitRectifyStatusList"
- @dataLoaded1="dataLoadedsum"
- @rowClick="rowClick"
- >
- <template slot="number" slot-scope="text, record">
- {{ text ? text : '0' }}
- </template>
- </sd-data-table-hj>
- </div>
- <sd-data-table
- ref="dataTable"
- :key="dataKey"
- :process-req="processReq"
- :columns="columns"
- :projectlist="true"
- :defultpagination-pagesize="50"
- data-url="api/xcoa-mobile/v1/iam-statistics/getUnitRectifyStatusList"
- @fnonloadsum="fnonloadsum"
- @dataLoaded="dataLoaded"
- @rowClick="rowClick"
- >
- <template slot="number" slot-scope="text, record">
- {{ text ? text : '0' }}
- </template>
- </sd-data-table>
- </a-card>
- </div>
- </template>
- <script>
- import AuditRangePicker from '../../components/picker/audit-range-picker.vue'
- import AuditGroupPicker from '../../components/picker/audit-group-picker.vue'
- import StatisticsService from './statistics-service'
- import components from './_import-components/audit-project-rectification-unit-import'
- import { message } from '@/common/one-ui'
- import axios from '@/common/services/axios-instance'
- import { getUserInfo } from '@/common/store-mixin'
- import download from '@/common/services/download'
- export default {
- name: 'AuditProjectRectificationUnit',
- metaInfo: {
- title: '整改情况统计',
- },
- components: {
- ...components,
- AuditRangePicker,
- AuditGroupPicker,
- },
- data() {
- return {
- exportLoading: false,
- dataKey: 0,
- dataKeysum: 0,
- form: {
- rectifyUnits: [],
- unitNames: [],
- timeRange: [],
- },
- rules: {
- timeRange: [{ required: true, message: '请选择统计时间', trigger: 'change' }],
- unitNames: [{ required: true, message: '请选择审计机构', trigger: 'change' }],
- },
- columns: [
- {
- title: '序号',
- dataIndex: 'id',
- width: '66px',
- },
- {
- title: '整改单位',
- dataIndex: 'RESP_UNIT_NAME',
- width: '100px',
- },
- {
- title: '需要整改问题(条)',
- dataIndex: 'NUM',
- width: '160px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '已整改',
- dataIndex: 'DONE',
- width: '80px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '整改中',
- dataIndex: 'DOING',
- width: '80px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '未整改',
- dataIndex: 'TODO',
- width: '80px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '超期未整改',
- dataIndex: 'EXPIRE',
- width: '115px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '风险接受',
- dataIndex: 'RISK',
- width: '100px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '整改完成率',
- dataIndex: 'PERCENT',
- width: '115px',
- },
- {
- title: '实际整改完成率',
- dataIndex: 'REAL_PERCENT',
- width: '115px',
- },
- ],
- columnssum: [
- {
- title: '整改单位',
- dataIndex: 'RESP_UNIT_NAME',
- width: '100px',
- colspan: 2,
- },
- {
- title: '需要整改问题(条)',
- dataIndex: 'NUM',
- width: '160px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '已整改',
- dataIndex: 'DONE',
- width: '80px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '整改中',
- dataIndex: 'DOING',
- width: '80px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '未整改',
- dataIndex: 'TODO',
- width: '80px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '超期未整改',
- dataIndex: 'EXPIRE',
- width: '115px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '风险接受',
- dataIndex: 'RISK',
- width: '100px',
- scopedSlots: { customRender: 'number' },
- sdClickable: true,
- },
- {
- title: '整改完成率',
- dataIndex: 'PERCENT',
- width: '115px',
- },
- {
- title: '实际整改完成率',
- dataIndex: 'REAL_PERCENT',
- width: '115px',
- },
- ],
- reqData: {
- dateStart: '3000',
- dateEnd: '',
- unitNames: '',
- rectifyUnits: '',
- },
- data: [],
- formItemLayout: {
- labelCol: { span: 6 },
- wrapperCol: { span: 14 },
- },
- hj: {},
- hjarr: [],
- 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/findIamOrgId',
- method: 'post',
- params,
- }).then((res) => {
- this.id = res.data
- const deptCode = userInfo.id.toString()
- const deptName = userInfo.name
- this.rootNode = { code: deptCode, name: deptName, id: this.id }
- })
- })
- },
- mounted() {
- const ym =
- 'questionTotal;doneTotal;doingTotal;todoTotal;expireTotal;riskTotal;percentTotal;realPercentTotal'
- const arrym = ym.split(';')
- const data = ['', 'DONE', 'DOING', 'TODO', 'EXPIRE', 'RISK', '', '']
- arrym.forEach((a, index) => {
- this.hjarr.push({
- title: a,
- dataIndex: data[index],
- })
- })
- },
- methods: {
- processReq(req, pagination) {
- req.data = {
- maxResults: req.data.maxResults,
- startPosition: req.data.startPosition,
- dateStart: this.reqData.dateStart,
- dateEnd: this.reqData.dateEnd,
- unitIds: this.reqData.unitNames,
- rectifyUnits: this.reqData.rectifyUnits,
- }
- return req
- },
- dataLoaded(res) {
- if (res.data.length) {
- res.data.forEach((item, index) => {
- item.id = index + 1
- })
- this.hjarr.forEach((item) => {
- this.hj[item.title] = res.respData[item.title]
- })
- return res
- }
- },
- processReqsum(req, pagination) {
- req.data = {
- maxResults: req.data.maxResults,
- startPosition: req.data.startPosition,
- dateStart: this.reqData.dateStart,
- dateEnd: this.reqData.dateEnd,
- unitIds: this.reqData.unitNames,
- rectifyUnits: this.reqData.rectifyUnits,
- }
- return req
- },
- dataLoadedsum(res) {
- if (res.data.length) {
- res.data.splice(0, res.data.length)
- const obj = {}
- this.columns.forEach((item, index) => {
- if (index > 1) {
- obj[item.dataIndex] = res.respData[this.hjarr[index - 2].title]
- }
- })
- obj.id = 1
- obj.RESP_UNIT_NAME = '总计'
- res.data.push(obj)
- return res
- }
- },
- fnonloadsum() {
- setTimeout(() => {
- if (
- document
- .getElementById('hj')
- .getElementsByClassName('ant-table-tbody')[0]
- .getElementsByTagName('tr').length > 0
- ) {
- const obj = document
- .getElementById('hj')
- .getElementsByClassName('ant-table-tbody')[0].firstChild
- obj.firstChild.colSpan = 2
- obj.classList.add('childsum')
- document.getElementsByClassName('ant-table-tbody')[1].appendChild(obj)
- }
- }, 500)
- },
- handleReset() {
- this.$refs.advancedSearchForm.resetFields()
- },
- handleAction(type) {
- this.$refs.advancedSearchForm.validate((valid, values) => {
- if (valid) {
- // 处理时间
- 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(',')
- // 处理整改部门
- const arr2 = []
- this.form.rectifyUnits.forEach((item) => {
- arr2.push(`'${item.name}'`)
- })
- this.reqData.rectifyUnits = arr2.join(',')
- // 调用方法
- switch (type) {
- case 'serach':
- this.handleSearch()
- break
- case 'export':
- this.reqData.unitIds = arr.join(',')
- this.handleExport()
- break
- }
- }
- })
- },
- handleSearch() {
- this.reqData.startPosition = 0
- this.dataKey++
- this.dataKeysum++
- },
- handleExport() {
- if (this.$refs.dataTable.data.length === 0) {
- message.warning('未查询出可导出数据', 1)
- return
- }
- this.exportLoading = true
- StatisticsService.exportUnitRectifyList(this.reqData).then((data) => {
- const url = URL.createObjectURL(data)
- download(url, '整改情况统计表.xls')
- this.exportLoading = false
- })
- },
- rowClick(record, { rowIndex, column }) {
- const param = {
- dateStart: this.reqData.dateStart,
- dateEnd: this.reqData.dateEnd,
- unitIds: this.reqData.unitNames,
- }
- if (record) {
- if (record.RESP_UNIT_NAME !== '总计') {
- param.rectifyUnits = "'" + record.RESP_UNIT_NAME + "'"
- }
- }
- console.log(column)
- if (column.dataIndex === 'DONE') {
- // 已整改
- param.rectStatus = '03'
- } else if (column.dataIndex === 'DOING') {
- // 整改中
- param.rectStatus = '02'
- } else if (column.dataIndex === 'TODO') {
- // 未整改
- param.rectStatus = '01'
- } else if (column.dataIndex === 'EXPIRE') {
- // 超期未整改
- param.isTrue = 1
- } else if (column.dataIndex === 'RISK') {
- // 风险接受
- param.rectStatus = '04'
- }
- param.rectUnitFlag = 'true'
- const url = '#/audit-statistics-find-list?params=' + encodeURIComponent(JSON.stringify(param))
- window.open(url)
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- .auditProRectify {
- :global(.ant-table-body) {
- overflow-x: scroll !important;
- }
- :global(.ant-table-empty) {
- :global(.ant-table-body) {
- overflow-x: scroll !important;
- }
- }
- .conditions {
- margin-bottom: 20px;
- }
- .buttonContent {
- 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;
- text-align: center;
- 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>
|