12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604 |
- <template>
- <div :class="$style.wrapHeight">
- <a-card :bordered="false">
- <a-tabs v-model="activeKey" type="line" @change="toggleTabs">
- <a-tab-pane key="1" tab="项目计划">
- <!-- 高级搜索区域 -->
- <audit-advanced-query
- :class="$style.advancedQuery"
- :expand="isShowAdvSearch"
- :search-data="SJXMAdvSearchForm"
- :ref-name="searchform"
- :search-style="{ height: '170px', left: '0px', top: '50px' }"
- :search-fun="advSJXMSearch"
- @searchedClick="searchedClick"
- >
- <template>
- <a-row>
- <a-col :span="8">
- <a-form-model-item label="项目名称" prop="projectTitle">
- <a-input v-model="SJXMAdvSearchForm.projectTitle" />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="审计类型" prop="auditType">
- <sd-select
- v-model="SJXMAdvSearchForm.auditType"
- :allow-clear="true"
- :options="auditTypeOptions"
- />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="审计方式" prop="auditMode">
- <sd-select
- v-model="SJXMAdvSearchForm.auditMode"
- :allow-clear="true"
- :options="auditModeOptions"
- />
- </a-form-model-item>
- </a-col>
- </a-row>
- <a-row>
- <a-col :span="8">
- <a-form-model-item label="项目负责人" prop="projectPrincipalName">
- <a-input v-model="SJXMAdvSearchForm.projectPrincipalName" />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="被审计单位" prop="auditedUnitNames">
- <a-input v-model="SJXMAdvSearchForm.auditedUnitNames" />
- </a-form-model-item>
- </a-col>
- </a-row>
- </template>
- </audit-advanced-query>
- <sd-data-table-ex
- ref="SJXMDataTable"
- style="margin-top: 25px"
- :filter-expressions="SJXMTableExpressions"
- :columns="columns1"
- show-selection
- :process-req="processReq"
- form-id="iamAuditProject"
- :data-url="dataurl1"
- :actions="actions1"
- >
- <div slot="isLink" slot-scope="text, record">
- <a :title="text" @click="showProjectDetail(record)">{{ text }}</a>
- </div>
- </sd-data-table-ex>
- </a-tab-pane>
- <a-tab-pane key="2" tab="计划变更">
- <!-- 高级搜索区域 -->
- <audit-advanced-query
- :expand="isShowAdvSearch"
- :search-data="JHBGAdvSearchForm"
- :ref-name="searchform"
- style="z-index: 1000"
- :search-style="{ height: '170px', left: '0px', top: '50px' }"
- :search-fun="advJHBGSearch"
- @searchedClick="searchedClick"
- >
- <template>
- <a-row>
- <a-col :span="8">
- <a-form-model-item label="项目名称" prop="projectTitle">
- <a-input v-model="JHBGAdvSearchForm.projectTitle" />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="变更类型" prop="changeType">
- <sd-select
- v-model="JHBGAdvSearchForm.changeType"
- :options="changeTypeOptions"
- :allow-clear="true"
- />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="编制人员" prop="creatorName">
- <a-input v-model="JHBGAdvSearchForm.creatorName" />
- </a-form-model-item>
- </a-col>
- </a-row>
- <a-row>
- <a-col :span="8">
- <a-form-model-item :label="'年\u2003\u2003度'" prop="planYear">
- <a-input v-model="JHBGAdvSearchForm.planYear" />
- </a-form-model-item>
- </a-col>
- <!-- <a-col :span="8">
- <a-form-model-item label="当前状态" prop="flowState">
- <sd-select
- v-model="JHBGAdvSearchForm.flowState"
- :allow-clear="true"
- :options="flowStateOptions"
- />
- </a-form-model-item>
- </a-col> -->
- </a-row>
- </template>
- </audit-advanced-query>
- <sd-data-table-ex
- ref="JHBGDataTable"
- style="margin-top: 25px"
- :filter-expressions="JHBGTableExpressions"
- :columns="columns2"
- show-selection
- form-id="iamAuditProjectChange"
- :data-url="dataurl2"
- :actions="actions2"
- @selectedRowsChanged="selectedRowsChanged"
- >
- <div slot="isLink" slot-scope="text, record">
- <a class="part-time">
- <span>
- <a-spin v-if="pending.includes(record.id)">
- <a-icon slot="indicator" type="loading" :class="$style.submitStatus" />
- </a-spin>
- <a-icon
- v-if="batchSubmitSucceed.includes(record.id)"
- type="check-circle"
- :class="[$style.submitStatus, $style.success]"
- />
- <a-tooltip
- v-if="batchsubmitFailed.map((item) => item.id).includes(record.id)"
- :title="batchsubmitFailed.find((item) => item.id === record.id).message"
- >
- <a-icon type="close-circle" :class="[$style.submitStatus, $style.error]" />
- </a-tooltip>
- </span>
- </a>
- <a :title="text" @click="showFlowFormDetail(record)">{{ text }}</a>
- </div>
- </sd-data-table-ex>
- </a-tab-pane>
- <a-tab-pane key="3" tab="审计计划">
- <!-- 高级搜索区域 -->
- <audit-advanced-query
- :expand="isShowAdvSearch"
- :search-data="SJJHAdvSearchForm"
- :ref-name="searchform"
- style="z-index: 1000"
- :search-style="{ height: '170px', left: '0px', top: '50px' }"
- :search-fun="advSJJHSearch"
- @searchedClick="searchedClick"
- >
- <template>
- <a-row>
- <a-col :span="8">
- <a-form-model-item label="计划年度" prop="planYear">
- <a-input v-model="SJJHAdvSearchForm.planYear" />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="审计机构" prop="unitName">
- <a-input v-model="SJJHAdvSearchForm.unitName" />
- </a-form-model-item>
- </a-col>
- <a-col :span="8">
- <a-form-model-item label="编制人员" prop="creatorName">
- <a-input v-model="SJJHAdvSearchForm.creatorName" />
- </a-form-model-item>
- </a-col>
- </a-row>
- <!-- <a-row>
- <a-col :span="8">
- <a-form-model-item label="当前状态" prop="flowState">
- <sd-select
- v-model="SJJHAdvSearchForm.flowState"
- :allow-clear="true"
- :options="flowStateOptions"
- />
- </a-form-model-item>
- </a-col>
- </a-row> -->
- </template>
- </audit-advanced-query>
- <sd-data-table-ex
- ref="SJJHDataTable"
- style="margin-top: 25px"
- :filter-expressions="SJJHTableExpressions"
- :columns="columns3"
- show-selection
- form-id="iamAuditPlan"
- :data-url="dataurl3"
- :actions="actions3"
- @selectedRowsChanged="selectedRowsChanged"
- >
- <div slot="isLink" slot-scope="text, record">
- <a :title="text" @click="showFlowFormDetail(record)">{{ text }}</a>
- </div>
- </sd-data-table-ex>
- </a-tab-pane>
- </a-tabs>
- <div :class="[$style.btns]">
- <a-select
- v-if="activeKey === '1'"
- v-model="searchYear"
- style="z-index: 100; width: 80px; margin-top: -30px; margin-right: 10px"
- @change="changeYearSelect"
- >
- <a-select-option v-for="year in yearArry" :key="year">
- {{ year }}
- </a-select-option>
- </a-select>
- <a-radio-group
- v-if="activeKey !== '1'"
- v-model="radioValue"
- allow-clear
- @change="radioOnChange"
- >
- <a-radio :value="1"> 全部 </a-radio>
- <a-radio :value="2"> 待处理 </a-radio>
- </a-radio-group>
- <a-input-search
- v-model="searchValue"
- style="width: 155px; vertical-align: bottom"
- placeholder="请输入搜索条件"
- allow-clear
- @search="onSearch"
- />
- <a-button title="高级搜索" :class="$style.advSearchBtn" @click="AdvSearchClick">
- <a-icon type="sd-audit-advancesearch" theme="filled" :class="$style.searchIcon" />
- </a-button>
- <a-button
- v-if="activeKey === '1' && isCreateProject"
- type="primary"
- :class="[$style.buttonSpacing]"
- @click="createProject"
- >新建项目
- </a-button>
- <a-button
- v-if="activeKey !== '2' && isApplicationAdmin"
- type="primary"
- :class="[$style.buttonSpacing]"
- @click="createAuditPlan"
- >新建审计计划
- </a-button>
- <a-button v-if="false" type="primary" :class="[$style.buttonSpacing]" @click="batchSubmit"
- >批量提交
- </a-button>
- <a-button
- v-if="activeKey === '2' || (activeKey === '3' && isApplicationAdmin)"
- :class="[$style.buttonSpacing]"
- :disabled="deleteButtonDisable"
- @click="linkToDelete"
- >删除
- </a-button>
- <a-button
- v-if="activeKey === '1'"
- :class="[$style.buttonSpacing]"
- :loading="exportLoading"
- @click="fnexport"
- >导出
- </a-button>
- <audit-advanced-export
- ref="export"
- :v-if="false"
- :class-style="[$style.buttonSpacing]"
- :exclebxh="false"
- table-id="SJXMDataTable"
- :expressions="SJXMTableExpressions"
- :config-id="13"
- />
- </div>
- <a-modal
- :destroy-on-close="true"
- title="填写意见"
- :body-style="{ overflow: 'auto' }"
- :width="600"
- :visible="showOpinionModal"
- :wrap-class-name="$style.opinionModel"
- @ok="handleOkSubmit"
- @cancel="handleCancelSubmit"
- >
- <sd-opinion-model
- ref="opinionModel"
- v-model="form.opinion"
- :group-id="form.groupId"
- :cyy-popup-container="cyyPopupContainer"
- />
- </a-modal>
- </a-card>
- </div>
- </template>
- <script>
- import moment from 'moment'
- import download from '@/common/services/download'
- import { Message, message, Modal } from 'ant-design-vue'
- import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
- import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
- import auditAdvancedExport from '../../components/audit-advanced-export.vue'
- import AuditService from './audit-service'
- import components from './_import-components/audit-plan-list-import'
- import TableColumnTypes from '@/common/services/table-column-types'
- import sdOpinionModel from '@/webflow/sd-opinion-model.vue'
- import axios from '@/common/services/axios-instance'
- import errorUtil from '@/common/services/error-util'
- import crossWindowWatcher from '@/common/services/cross-window-watcher'
- import storeMixin, { getUserInfo } from '@/common/store-mixin'
- import FlowService from '@/webflow/flow-service'
- export default {
- name: 'AuditPlanList',
- metaInfo: {
- title: '项目计划',
- },
- components: { ...components, auditAdvancedQuery, auditAdvancedExport, sdOpinionModel },
- mixins: [storeMixin, auditAdvancedQueryMixins],
- data() {
- return {
- exportLoading: false,
- activeKey: '1',
- searchYear: new Date().getFullYear().toString(),
- yearArry: [],
- radioValue: 1,
- searchValue: '',
- deleteButtonDisable: true,
- searchform: 'searchform',
- isShowAdvSearch: false,
- isCreateProject: true,
- SJXMAdvSearchForm: {
- projectTitle: '',
- projectCode: '',
- auditType: '',
- auditMode: '',
- projectPrincipalName: '',
- auditedUnitNames: '',
- },
- JHBGAdvSearchForm: {
- projectTitle: null,
- changeType: '',
- creatorName: '',
- planYear: '',
- flowState: '',
- },
- SJJHAdvSearchForm: {
- planYear: null,
- unitName: '',
- creatorName: '',
- flowState: '',
- },
- SJXMTableExpressions: [],
- JHBGTableExpressions: [],
- SJJHTableExpressions: [],
- pageId: 'audit/plan/iamAuditPlan',
- dataurl1: 'api/xcoa-mobile/v1/iamauditproject/all-list',
- dataurl2: 'api/xcoa-mobile/v1/iamauditprojectchange/all-list',
- dataurl3: 'api/xcoa-mobile/v1/iamauditplan/all-list',
- columns1: [
- {
- title: '序号',
- customRender: (text, record, index) => `${index + 1}`,
- width: '80px',
- },
- {
- title: '项目名称',
- dataIndex: 'projectTitle',
- width: '30%',
- scopedSlots: { customRender: 'isLink' },
- },
- {
- title: '项目编号',
- dataIndex: 'projectCode',
- defaultSortOrder: 'descend',
- sortDirections: 'descend',
- width: '10%',
- },
- {
- title: '审计类型',
- dataIndex: 'auditType',
- width: '120px',
- sorter: true,
- },
- // {
- // title: '项目负责人',
- // dataIndex: 'projectPrincipalName',
- // sorter: true,
- // width: '260px',
- // },
- {
- title: '项目来源',
- dataIndex: 'isPlanIn',
- sorter: true,
- width: '80px',
- },
- {
- title: '审计方式',
- dataIndex: 'auditMode',
- sorter: true,
- width: '80px',
- sdHidden: true,
- },
- {
- title: '被审计单位',
- dataIndex: 'auditedUnitNames',
- width: '15%',
- },
- {
- title: '操作',
- dataIndex: 'opt',
- aligen: 'center',
- width: '120px',
- customRender: (text, record, index) => {
- if (
- record.operateCloumnPermission &&
- (record.flowState === '结束' || record.flowState === null)
- ) {
- // 只有我发起变更操作或者发起后流程结束的项目才有此操作
- if (record.itemStatus === '01') {
- // 只有未启动的项目才可以进行编辑
- return (
- <span>
- <a vOn:click={(evt) => this.editProject(record.id)}>编辑</a>{' '}
- <a vOn:click={(evt) => this.cancelProject(record.id)}>取消</a>
- </span>
- )
- } else if (record.itemStatus !== '06') {
- return (
- <span>
- <a vOn:click={(evt) => this.cancelProject(record.id)}>取消</a>
- </span>
- )
- }
- } else {
- return <span> - </span>
- }
- },
- },
- ],
- actions1: [],
- columns2: [
- {
- title: '序号',
- customRender: (text, record, index) => `${index + 1}`,
- width: '80px',
- },
- {
- title: '项目名称',
- width: '25%',
- dataIndex: 'projectTitle',
- scopedSlots: { customRender: 'isLink' },
- },
- {
- title: '项目编号',
- dataIndex: 'projectCode',
- width: '10%',
- },
- {
- title: '变更类型',
- dataIndex: 'changeType',
- sorter: true,
- width: '120px',
- },
- {
- title: '编制人员',
- dataIndex: 'creatorName',
- sorter: true,
- width: '120px',
- },
- {
- title: '编制日期',
- dataIndex: 'creationTime',
- sorter: true,
- sdRender: TableColumnTypes.date,
- },
- {
- title: '当前状态',
- sorter: true,
- dataIndex: 'flowState',
- },
- {
- title: '当前处理人',
- dataIndex: 'creatorName',
- },
- ],
- actions2: [],
- columns3: [
- {
- title: '序号',
- customRender: (text, record, index) => `${index + 1}`,
- width: '80px',
- },
- {
- title: '计划年度',
- dataIndex: 'planYear',
- sorter: true,
- scopedSlots: { customRender: 'isLink' },
- },
- {
- title: '审计机构',
- sorter: true,
- dataIndex: 'unitName',
- },
- {
- title: '编制人员',
- dataIndex: 'creatorName',
- },
- {
- title: '编制日期',
- dataIndex: 'creationTime',
- sdRender: TableColumnTypes.date,
- },
- {
- title: '当前状态',
- sorter: true,
- dataIndex: 'flowState',
- },
- {
- title: '结束发布标记',
- hidden: true,
- sorter: true,
- dataIndex: 'endType',
- sdHidden: true,
- },
- {
- title: '当前处理人',
- dataIndex: 'currentUser',
- },
- ],
- actions3: [],
- formId: 'iamAuditProject',
- tableId: 'SJXMDataTable',
- itemStatusOptions: [],
- auditTypeOptions: [],
- auditModeOptions: [],
- changeTypeOptions: [],
- showOpinionModal: false,
- pending: [],
- batchSubmitSucceed: [],
- batchsubmitFailed: [],
- form: {
- opinion: '',
- groupId: '',
- },
- isApplicationAdmin: false, // 是否为审计计划管理员
- flowStateOptions: [
- {
- id: '起草',
- name: '起草',
- },
- {
- id: '审计部领导审批',
- name: '审计部领导审批',
- },
- {
- id: '结束',
- name: '结束',
- },
- ],
- }
- },
- mounted() {
- // 初始化年份下拉框
- this.initYearSelect()
- // 初始化数据字典信息
- this.initDictionaryInfo()
- // 初始化权限
- this.initJurisdiction()
- },
- methods: {
- // 初始化年份下拉框
- initYearSelect() {
- AuditService.getPlanYear().then((res) => {
- this.yearArry = []
- // 获取计划年度
- if (res.data != null && res.data !== '') {
- let flag = true
- res.data.forEach((e) => {
- this.yearArry.push(e)
- if (e === this.searchYear) {
- flag = false
- }
- })
- this.yearArry = this.yearArry.sort().reverse()
- if (flag === true) {
- const arry = res.data.filter((e) => e < this.searchYear).reverse()
- if (arry.length > 0) {
- this.searchYear = arry[0]
- } else {
- this.searchYear = this.yearArry[this.yearArry.length - 1]
- }
- this.changeYearSelect(this.searchYear)
- }
- } else {
- // 如果没有已经发布的计划,则显示当前年份
- this.isCreateProject = false
- this.yearArry.push(this.searchYear)
- }
- })
- },
- initDictionaryInfo() {
- axios({
- url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_AUDIT_METHOD',
- method: 'get',
- }).then((res) => {
- if (res.status === 200) {
- this.auditModeOptions = res.data
- }
- })
- 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
- }
- })
- axios({
- url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_CHANGE_TYPE',
- method: 'get',
- }).then((res) => {
- if (res.status === 200) {
- this.changeTypeOptions = res.data
- }
- })
- },
- // 初始化权限
- initJurisdiction() {
- // 校验权限(检查为审计计划管理员、审计人员)
- AuditService.checkPermission().then((res) => {
- this.isApplicationAdmin = res.data.isHasPermission // 删除按钮权限(拥有计划管理员角色)
- })
- },
- // 创建审计计划
- createAuditPlan() {
- const url = '/sd-flow-guide?code=PRODUCT_IAM_SJJH' // 新页面要打开的路由地址
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refreshDataTable()
- }
- })
- },
- // 编辑项目
- editProject(id) {
- // 校验项目是否已启动
- AuditService.checkProjectIsStart(id).then((res) => {
- if (res.data) {
- Modal.warning({
- title: '提示',
- content: '该项目已启动!',
- })
- return null
- } else {
- const url =
- `/sd-flow-guide?code=PRODUCT_IAM_SJJHBG&oper=edit&projectId=${id}&planYear=` +
- this.searchYear // 新页面要打开的路由地址
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refreshDataTable()
- }
- })
- }
- })
- },
- // 批量提交
- batchSubmit() {
- this.showOpinionModal = true
- this.getGroupCode()
- },
- // 取消项目
- cancelProject(id) {
- const url =
- `/sd-flow-guide?code=PRODUCT_IAM_SJJHBG&oper=cancel&projectId=${id}&planYear=` +
- this.searchYear // 新页面要打开的路由地址
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refreshDataTable()
- }
- })
- },
- // 创建项目
- createProject() {
- // 判断能不能新建项目
- if (this.searchYear !== undefined) {
- // AuditService.existYearPlan('', this.searchYear, '').then((res) => {
- // if (res.data &&res.data === true) {
- AuditService.getPlanByPlanYear(this.searchYear).then((res) => {
- if (res.data) {
- const url =
- '/sd-flow-guide?code=PRODUCT_IAM_SJJHBG&oper=create&planYear=' + this.searchYear // 新页面要打开的路由地址
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refreshDataTable()
- }
- })
- } else {
- Modal.warning({
- title: '提示',
- content: '请先维护本单位审计计划并发布',
- })
- }
- })
- } else {
- Modal.warning({
- title: '提示',
- content: '请先选择计划年度!',
- })
- }
- },
- refreshDataTable() {
- if (this.activeKey === '1') {
- this.tableId = 'SJXMDataTable'
- }
- if (this.activeKey === '2') {
- this.tableId = 'JHBGDataTable'
- }
- if (this.activeKey === '3') {
- this.tableId = 'SJJHDataTable'
- }
- if (this.$refs[`${this.tableId}`]) {
- this.$refs[`${this.tableId}`].clearSelection()
- this.$refs[`${this.tableId}`].refresh()
- }
- },
- toggleTabs(key) {
- this.activeKey = key
- if (this.activeKey === '1') {
- this.tableId = 'SJXMDataTable'
- this.SJXMTableExpressions = []
- }
- if (this.activeKey === '2') {
- this.tableId = 'JHBGDataTable'
- this.JHBGTableExpressions = []
- if (this.radioValue === 1) {
- this.JHBGTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: true,
- })
- } else if (this.radioValue === 2) {
- this.JHBGTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: false,
- })
- }
- }
- if (this.activeKey === '3') {
- this.tableId = 'SJJHDataTable'
- this.SJJHTableExpressions = []
- if (this.radioValue === 1) {
- this.SJJHTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: true,
- })
- } else if (this.radioValue === 2) {
- this.SJJHTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: false,
- })
- }
- }
- this.deleteButtonDisable = true
- if (this.$refs[`${this.tableId}`]) {
- this.$refs[`${this.tableId}`].clearSelection()
- }
- },
- linkToDelete() {
- if (this.activeKey === '1') {
- this.tableId = 'SJXMDataTable'
- this.formId = 'iamAuditProject'
- }
- if (this.activeKey === '2') {
- this.tableId = 'JHBGDataTable'
- this.formId = 'iamAuditProjectChange'
- }
- if (this.activeKey === '3') {
- this.tableId = 'SJJHDataTable'
- this.formId = 'iamAuditPlan'
- }
- const selectedRowKeys = this.$refs[`${this.tableId}`].getSelectedRowKeys()
- if (selectedRowKeys.length === 0) {
- Modal.info({
- content: '请选择需要删除的数据!',
- })
- return
- }
- if (this.activeKey === '2') {
- // 计划变更删除
- if (this.checkStateDelete('0', '只能删除起草状态的计划变更!')) {
- this.deleteMethod(selectedRowKeys)
- }
- } else if (this.activeKey === '3') {
- // 计划删除
- // 删除是否为本单位校验
- if (this.checkDeptDelete()) {
- // 删除是否为起草状态校验
- if (this.checkStateDelete('0,5', '只能删除起草、结束状态的审计计划')) {
- AuditService.beforeDeleteCheck(selectedRowKeys).then((res) => {
- // 删除前校验
- if (res.data) {
- Modal.warning({
- title: '提示',
- content: '该计划存在已启动/已取消/已关闭/已归档项目,请先删除该项目!',
- })
- return null
- } else {
- this.deleteMethod(selectedRowKeys)
- }
- })
- }
- }
- } else {
- this.deleteMethod(selectedRowKeys)
- }
- },
- // 删除记录
- deleteMethod(selectedRowKeys) {
- let url
- if (this.activeKey === '2') {
- url = 'api/xcoa-mobile/v1/iamauditprojectchange/deleteProjectChange'
- } else {
- url = 'api/xcoa-mobile/v1/page/' + this.formId
- }
- return new Promise((resolve) => {
- Modal.confirm({
- title: '您确定删除这项内容吗?',
- content: '删除这条数据后,就无法恢复初始的状态。',
- cancelText: '取消',
- okText: '删除',
- okType: 'danger',
- onOk: () => {
- axios({
- url: url,
- method: 'delete',
- params: {
- ids: selectedRowKeys.join(','),
- },
- })
- .then(() => {
- const msg = '删除成功'
- message.success(msg)
- this.$refs[`${this.tableId}`].clearSelection()
- this.$refs[`${this.tableId}`].refresh()
- })
- .catch((err) => {
- const msg = errorUtil.getMessage(err) || '删除失败'
- message.error(msg)
- })
- .finally(resolve)
- },
- onCancel: () => {
- resolve()
- },
- })
- })
- },
- // 删除是否为本单位校验
- checkDeptDelete() {
- let temp = false
- const selectedRows = this.$refs[`${this.tableId}`].getSelectedRows()
- selectedRows.some((item) => {
- if (!item.hasOperateAuthority) {
- temp = true
- return true
- }
- })
- if (temp) {
- Modal.warning({
- title: '提示',
- content: '只能删除本单位的审计计划!',
- })
- return false
- }
- return true
- },
- // 删除是否为起草状态校验
- checkStateDelete(state, message) {
- let temp = false
- const selectedRows = this.$refs[`${this.tableId}`].getSelectedRows()
- selectedRows.some((item) => {
- // if (item.flowState !== '起草') {
- if (!state.includes(item.endType)) {
- temp = true
- return true
- }
- })
- if (temp) {
- Modal.warning({
- title: '提示',
- content: message,
- })
- return false
- }
- return true
- },
- AdvSearchClick() {
- this.isShowAdvSearch = !this.isShowAdvSearch
- },
- searchedClick() {
- this.isShowAdvSearch = !this.isShowAdvSearch
- },
- changeYearSelect(value) {
- if (this.activeKey === '1') {
- this.SJXMTableExpressions = []
- if (value) {
- // 计划年度
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'planYear',
- op: 'like',
- stringValue: `${value}`,
- })
- // 项目状态不是'取消'
- // this.SJXMTableExpressions.push({
- // dataType: 'str',
- // name: 'itemStatus',
- // op: 'ne',
- // stringValue: '06',
- // })
- }
- }
- },
- onSearch(value) {
- if (this.activeKey === '1') {
- this.SJXMTableExpressions = []
- if (value) {
- const expressions = []
- // 项目名称
- expressions.push({
- dataType: 'str',
- name: 'projectTitle',
- op: 'like',
- stringValue: `%${value}%`,
- })
- // 项目编号
- expressions.push({
- dataType: 'str',
- name: 'projectCode',
- op: 'like',
- stringValue: `%${value}%`,
- })
- // 审计类型
- // expressions.push({
- // dataType: 'str',
- // name: 'auditType',
- // op: 'like',
- // stringValue: `%${value}%`,
- // })
- // 项目负责人
- expressions.push({
- dataType: 'str',
- name: 'projectPrincipalName',
- op: 'like',
- stringValue: `%${value}%`,
- })
- // 审计方式
- // expressions.push({
- // dataType: 'str',
- // name: 'auditMode',
- // op: 'like',
- // stringValue: `%${value}%`,
- // })
- // 被审计单位
- expressions.push({
- dataType: 'str',
- name: 'auditedUnitNames',
- op: 'like',
- stringValue: `%${value}%`,
- })
- this.SJXMTableExpressions.push({
- dataType: 'exps',
- op: 'or',
- expressionsValue: expressions,
- })
- }
- }
- if (this.activeKey === '2') {
- this.JHBGTableExpressions = []
- if (this.radioValue === 1) {
- this.JHBGTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: true,
- })
- } else if (this.radioValue === 2) {
- this.JHBGTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: false,
- })
- }
- if (value) {
- const expressions = []
- // 项目名称
- expressions.push({
- dataType: 'str',
- name: 'projectTitle',
- op: 'like',
- stringValue: `%${value}%`,
- })
- // 项目编号
- expressions.push({
- dataType: 'str',
- name: 'projectCode',
- op: 'like',
- stringValue: `%${value}%`,
- })
- // 变更类型
- expressions.push({
- dataType: 'str',
- name: 'changeType',
- op: 'like',
- stringValue: `%${value}%`,
- })
- // 编制人员
- expressions.push({
- dataType: 'str',
- name: 'creatorName',
- op: 'like',
- stringValue: `%${value}%`,
- })
- // 编制日期
- expressions.push({
- dataType: 'long',
- name: 'creationTime',
- op: 'eq',
- longValue: moment(moment(value, 'YYYY-MM-DD HH:mm:SS')).valueOf(),
- })
- // 当前状态
- // expressions.push({
- // dataType: 'str',
- // name: 'flowState',
- // op: 'like',
- // stringValue: `%${value}%`,
- // })
- // 当前处理人
- expressions.push({
- dataType: 'str',
- name: 'currentUser',
- op: 'like',
- stringValue: `%${value}%`,
- })
- this.JHBGTableExpressions.push({
- dataType: 'exps',
- op: 'or',
- expressionsValue: expressions,
- })
- }
- }
- if (this.activeKey === '3') {
- this.SJJHTableExpressions = []
- if (this.radioValue === 1) {
- this.SJJHTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: true,
- })
- } else if (this.radioValue === 2) {
- this.SJJHTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: false,
- })
- }
- if (value) {
- const expressions = []
- // 计划年度
- expressions.push({
- dataType: 'str',
- name: 'planYear',
- op: 'eq',
- stringValue: value,
- })
- // 审计机构
- expressions.push({
- dataType: 'str',
- name: 'unitName',
- op: 'like',
- stringValue: `%${value}%`,
- })
- // 编制人员
- expressions.push({
- dataType: 'str',
- name: 'creatorName',
- op: 'like',
- stringValue: `%${value}%`,
- })
- // 编制日期
- expressions.push({
- dataType: 'long',
- name: 'creationTime',
- op: 'eq',
- longValue: moment(moment(value, 'YYYY-MM-DD HH:mm:SS')).valueOf(),
- })
- // 当前状态
- // expressions.push({
- // dataType: 'str',
- // name: 'flowState',
- // op: 'like',
- // stringValue: `%${value}%`,
- // })
- // 当前处理人
- // expressions.push({
- // dataType: 'str',
- // name: 'currentUser',
- // op: 'like',
- // stringValue: `%${value}%`,
- // })
- this.SJJHTableExpressions.push({
- dataType: 'exps',
- op: 'or',
- expressionsValue: expressions,
- })
- }
- }
- this.$refs[`${this.tableId}`].clearSelection()
- },
- advSJXMSearch() {
- this.SJXMTableExpressions = []
- // 计划年度
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'planYear',
- op: 'like',
- stringValue: `${this.searchYear}`,
- })
- // 项目状态不是'取消'
- // this.SJXMTableExpressions.push({
- // dataType: 'str',
- // name: 'itemStatus',
- // op: 'ne',
- // stringValue: '06',
- // })
- // 项目名称
- if (this.SJXMAdvSearchForm.projectTitle) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'projectTitle',
- op: 'like',
- stringValue: `${this.SJXMAdvSearchForm.projectTitle}`,
- })
- }
- // 项目编号
- if (this.SJXMAdvSearchForm.projectCode) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'projectCode',
- op: 'like',
- stringValue: `${this.SJXMAdvSearchForm.projectCode}`,
- })
- }
- // 审计类型
- if (this.SJXMAdvSearchForm.auditType[0]) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'auditType',
- op: 'like',
- stringValue: `${this.SJXMAdvSearchForm.auditType[0].id}`,
- })
- }
- // 审计方式
- if (this.SJXMAdvSearchForm.auditMode[0]) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'auditMode',
- op: 'like',
- stringValue: `${this.SJXMAdvSearchForm.auditMode[0].id}`,
- })
- }
- // 项目负责人
- if (this.SJXMAdvSearchForm.projectPrincipalName) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'projectPrincipalName',
- op: 'like',
- stringValue: `${this.SJXMAdvSearchForm.projectPrincipalName}`,
- })
- }
- // 被审计单位
- if (this.SJXMAdvSearchForm.auditedUnitNames) {
- this.SJXMTableExpressions.push({
- dataType: 'str',
- name: 'auditedUnitNames',
- op: 'like',
- stringValue: `${this.SJXMAdvSearchForm.auditedUnitNames}`,
- })
- }
- this.$refs[`${this.tableId}`].clearSelection()
- },
- advJHBGSearch() {
- this.JHBGTableExpressions = []
- if (this.radioValue === 1) {
- this.JHBGTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: true,
- })
- } else if (this.radioValue === 2) {
- this.JHBGTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: false,
- })
- }
- // 项目名称
- if (this.JHBGAdvSearchForm.projectTitle) {
- this.JHBGTableExpressions.push({
- dataType: 'str',
- name: 'projectTitle',
- op: 'like',
- stringValue: `${this.JHBGAdvSearchForm.projectTitle}`,
- })
- }
- // 变更类型
- if (this.JHBGAdvSearchForm.changeType[0]) {
- this.JHBGTableExpressions.push({
- dataType: 'str',
- name: 'changeType',
- op: 'like',
- stringValue: `${this.JHBGAdvSearchForm.changeType[0].id}`,
- })
- }
- // 编制人员
- if (this.JHBGAdvSearchForm.creatorName) {
- this.JHBGTableExpressions.push({
- dataType: 'str',
- name: 'creatorName',
- op: 'like',
- stringValue: `${this.JHBGAdvSearchForm.creatorName}`,
- })
- }
- // 年度
- if (this.JHBGAdvSearchForm.planYear) {
- this.JHBGTableExpressions.push({
- dataType: 'str',
- name: 'planYear',
- op: 'like',
- stringValue: `${this.JHBGAdvSearchForm.planYear}`,
- })
- }
- // 当前状态
- // if (this.JHBGAdvSearchForm.flowState[0]) {
- // this.JHBGTableExpressions.push({
- // dataType: 'str',
- // name: 'flowState',
- // op: 'like',
- // stringValue: `${this.JHBGAdvSearchForm.flowState[0].id}`,
- // })
- // }
- this.$refs[`${this.tableId}`].clearSelection()
- },
- advSJJHSearch() {
- this.SJJHTableExpressions = []
- if (this.radioValue === 1) {
- this.SJJHTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: true,
- })
- } else if (this.radioValue === 2) {
- this.SJJHTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: false,
- })
- }
- // 计划年度
- if (this.SJJHAdvSearchForm.planYear) {
- this.SJJHTableExpressions.push({
- dataType: 'str',
- name: 'planYear',
- op: 'like',
- stringValue: this.SJJHAdvSearchForm.planYear,
- })
- }
- // 审计机构
- if (this.SJJHAdvSearchForm.unitName) {
- this.SJJHTableExpressions.push({
- dataType: 'str',
- name: 'unitName',
- op: 'like',
- stringValue: `${this.SJJHAdvSearchForm.unitName}`,
- })
- }
- // 编制人员
- if (this.SJJHAdvSearchForm.creatorName) {
- this.SJJHTableExpressions.push({
- dataType: 'str',
- name: 'creatorName',
- op: 'like',
- stringValue: `${this.SJJHAdvSearchForm.creatorName}`,
- })
- }
- // 当前状态
- // if (this.SJJHAdvSearchForm.flowState[0]) {
- // this.SJJHTableExpressions.push({
- // dataType: 'str',
- // name: 'flowState',
- // op: 'like',
- // stringValue: `${this.SJJHAdvSearchForm.flowState[0].id}`,
- // })
- // }
- this.$refs[`${this.tableId}`].clearSelection()
- },
- showProjectDetail(record) {
- var url = '/audit-project-detail?record=' + record.id
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refreshDataTable()
- }
- })
- },
- showFlowFormDetail(record) {
- if (
- (this.activeKey === '2' && (record.flowState === '起草') | (record.flowState === '开始')) ||
- (this.activeKey === '3' &&
- (record.flowState === '起草') | (record.flowState === '开始') &&
- record.hasOperateAuthority)
- ) {
- const url = '/sd-webflow/pages/draft/' + record.instId // 编辑面要打开的路由地址
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- // 这里写或者调刷新的方法
- this.refreshDataTable()
- }
- })
- } else {
- window.open('#/sd-webflow/done-pages/' + record.instId)
- }
- },
- radioOnChange(e) {
- if (this.selectedType !== e.target.value) {
- if (this.activeKey === '2') {
- this.JHBGTableExpressions = []
- this.selectedType = e.target.value
- if (e.target.value === 1) {
- this.JHBGTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: true,
- })
- } else if (e.target.value === 2) {
- const userInfo = getUserInfo()
- this.JHBGTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: false,
- })
- this.JHBGTableExpressions.push({
- dataType: 'str',
- name: 'currentUser',
- op: 'like',
- stringValue: `%${userInfo.name}%`,
- })
- }
- } else {
- this.SJJHTableExpressions = []
- this.selectedType = e.target.value
- if (e.target.value === 1) {
- this.SJJHTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: true,
- })
- } else if (e.target.value === 2) {
- this.SJJHTableExpressions.push({
- dataType: 'boolean',
- name: 'stateFlag',
- booleanValue: false,
- })
- }
- }
- }
- this.$refs[`${this.tableId}`].clearSelection()
- },
- // 标题格式化
- formatterTitle(val, length) {
- var resultArry = []
- let title = ''
- let result = ''
- if (val === undefined || val === '' || val === '[]') {
- resultArry.push(title)
- resultArry.push(result)
- return resultArry
- } else {
- try {
- JSON.parse(val).forEach((e) => {
- result += e.name + ','
- })
- } catch (e) {
- result = val
- }
- if (result.lastIndexOf(',') > 0) {
- result = result.substr(0, result.length - 1)
- }
- title = result
- if (result.length > length) {
- result = result.substr(0, length) + '...'
- }
- resultArry.push(title)
- resultArry.push(result)
- return resultArry
- }
- },
- getGroupCode() {
- // 获取groupId
- FlowService.getGroupCode().then((res) => {
- if (res.status === 200) {
- if (res.data) {
- this.form.groupId = res.data.toString()
- } else {
- Message.error('获取groupId失败')
- }
- } else {
- Message.error(res.statusText)
- }
- })
- },
- handleOkSubmit() {
- this.showOpinionModal = false
- this.pending = []
- this.batchSubmitSucceed = []
- this.batchsubmitFailed = []
- const selectedRows = this.$refs.JHBGDataTable.getSelectedRows()
- selectedRows.forEach((record) => {
- const id = record.id
- this.pending.push(id)
- const params = {
- id,
- opinion: this.form.opinion,
- attachment: this.form.groupId,
- }
- const srcTrustId = record.srcTrustId
- AuditService.projectChangeBatchSubmit(params, srcTrustId).then((res) => {
- // 批量提交
- if (res.code === '1') {
- this.batchSubmitSucceed.push(id)
- } else {
- this.batchsubmitFailed.push({ id: id, ...res })
- }
- const index = this.pending.findIndex((item) => item === id)
- this.pending.splice(index, 1)
- // 所有的都处理完刷新列表
- if (
- this.batchSubmitSucceed.length + this.batchsubmitFailed.length ===
- selectedRows.length
- ) {
- this.$refs.JHBGDataTable.refresh()
- this.$refs.JHBGDataTable.clearSelection()
- }
- })
- })
- },
- handleCancelSubmit() {
- this.showOpinionModal = false
- this.form.opinion = ''
- this.form.groupId = ''
- },
- cyyPopupContainer() {
- return document.body
- },
- processReq(req) {
- const url = req.url
- const arr = req.data.expressions
- if (url === 'api/xcoa-mobile/v1/iamauditproject/all-list') {
- arr.push({
- dataType: 'str',
- name: 'planYear',
- op: 'like',
- stringValue: `${this.searchYear}`,
- })
- // arr.push({
- // dataType: 'str',
- // name: 'itemStatus',
- // op: 'ne',
- // stringValue: '06',
- // })
- }
- return req
- },
- selectedRowsChanged(row) {
- if (row.length > 0) {
- this.deleteButtonDisable = false
- } else {
- this.deleteButtonDisable = true
- }
- },
- // 导出
- fnexport() {
- this.exportLoading = true
- // 计划年度
- // this.SJXMTableExpressions.push({
- // dataType: 'str',
- // name: 'planYear',
- // op: 'like',
- // stringValue: `%${this.searchYear}%`,
- // })
- // 项目状态不是'取消'
- // this.SJXMTableExpressions.push({
- // dataType: 'str',
- // name: 'itemStatus',
- // op: 'ne',
- // stringValue: '06',
- // })
- // this.$refs.export.exportdata()
- const conditions = { configId: '13', year: this.searchYear }
- axios({
- url: 'api/xcoa-mobile/v1/iamauditproject/exportPaper',
- method: 'post',
- data: conditions,
- responseType: 'blob',
- }).then((res) => {
- if (res.status === 200) {
- const url = URL.createObjectURL(res.data)
- const filename = res.headers['content-disposition']
- const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
- download(url, decodeURI(fname))
- }
- })
- setTimeout(() => {
- this.exportLoading = false
- }, 1000)
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- .wrap-height {
- :global(.ant-col-offset-10) {
- margin-left: 0;
- }
- }
- .btns {
- position: absolute;
- top: 15px;
- right: 15px;
- z-index: 100;
- }
- .buttonSpacing {
- margin-left: 5px;
- }
- .advancedQuery {
- :global(.ant-col .ant-form-item-label) {
- width: 30% !important;
- }
- :global(.ant-col .ant-form-item-control-wrapper) {
- width: 60% !important;
- }
- }
- .advSearchBtn {
- width: 35px;
- padding: 0;
- margin-left: -5px;
- border-radius: 0 5px 5px 0;
- }
- .search-icon {
- margin-left: 1px !important;
- font-size: 12px;
- }
- .wrap-height {
- .success {
- color: $alert-success-icon-color;
- }
- .error {
- color: $alert-error-icon-color;
- }
- :global(.part-time) {
- padding-right: 5px !important;
- }
- }
- </style>
|