audit-plan-list.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604
  1. <template>
  2. <div :class="$style.wrapHeight">
  3. <a-card :bordered="false">
  4. <a-tabs v-model="activeKey" type="line" @change="toggleTabs">
  5. <a-tab-pane key="1" tab="项目计划">
  6. <!-- 高级搜索区域 -->
  7. <audit-advanced-query
  8. :class="$style.advancedQuery"
  9. :expand="isShowAdvSearch"
  10. :search-data="SJXMAdvSearchForm"
  11. :ref-name="searchform"
  12. :search-style="{ height: '170px', left: '0px', top: '50px' }"
  13. :search-fun="advSJXMSearch"
  14. @searchedClick="searchedClick"
  15. >
  16. <template>
  17. <a-row>
  18. <a-col :span="8">
  19. <a-form-model-item label="项目名称" prop="projectTitle">
  20. <a-input v-model="SJXMAdvSearchForm.projectTitle" />
  21. </a-form-model-item>
  22. </a-col>
  23. <a-col :span="8">
  24. <a-form-model-item label="审计类型" prop="auditType">
  25. <sd-select
  26. v-model="SJXMAdvSearchForm.auditType"
  27. :allow-clear="true"
  28. :options="auditTypeOptions"
  29. />
  30. </a-form-model-item>
  31. </a-col>
  32. <a-col :span="8">
  33. <a-form-model-item label="审计方式" prop="auditMode">
  34. <sd-select
  35. v-model="SJXMAdvSearchForm.auditMode"
  36. :allow-clear="true"
  37. :options="auditModeOptions"
  38. />
  39. </a-form-model-item>
  40. </a-col>
  41. </a-row>
  42. <a-row>
  43. <a-col :span="8">
  44. <a-form-model-item label="项目负责人" prop="projectPrincipalName">
  45. <a-input v-model="SJXMAdvSearchForm.projectPrincipalName" />
  46. </a-form-model-item>
  47. </a-col>
  48. <a-col :span="8">
  49. <a-form-model-item label="被审计单位" prop="auditedUnitNames">
  50. <a-input v-model="SJXMAdvSearchForm.auditedUnitNames" />
  51. </a-form-model-item>
  52. </a-col>
  53. </a-row>
  54. </template>
  55. </audit-advanced-query>
  56. <sd-data-table-ex
  57. ref="SJXMDataTable"
  58. style="margin-top: 25px"
  59. :filter-expressions="SJXMTableExpressions"
  60. :columns="columns1"
  61. show-selection
  62. :process-req="processReq"
  63. form-id="iamAuditProject"
  64. :data-url="dataurl1"
  65. :actions="actions1"
  66. >
  67. <div slot="isLink" slot-scope="text, record">
  68. <a :title="text" @click="showProjectDetail(record)">{{ text }}</a>
  69. </div>
  70. </sd-data-table-ex>
  71. </a-tab-pane>
  72. <a-tab-pane key="2" tab="计划变更">
  73. <!-- 高级搜索区域 -->
  74. <audit-advanced-query
  75. :expand="isShowAdvSearch"
  76. :search-data="JHBGAdvSearchForm"
  77. :ref-name="searchform"
  78. style="z-index: 1000"
  79. :search-style="{ height: '170px', left: '0px', top: '50px' }"
  80. :search-fun="advJHBGSearch"
  81. @searchedClick="searchedClick"
  82. >
  83. <template>
  84. <a-row>
  85. <a-col :span="8">
  86. <a-form-model-item label="项目名称" prop="projectTitle">
  87. <a-input v-model="JHBGAdvSearchForm.projectTitle" />
  88. </a-form-model-item>
  89. </a-col>
  90. <a-col :span="8">
  91. <a-form-model-item label="变更类型" prop="changeType">
  92. <sd-select
  93. v-model="JHBGAdvSearchForm.changeType"
  94. :options="changeTypeOptions"
  95. :allow-clear="true"
  96. />
  97. </a-form-model-item>
  98. </a-col>
  99. <a-col :span="8">
  100. <a-form-model-item label="编制人员" prop="creatorName">
  101. <a-input v-model="JHBGAdvSearchForm.creatorName" />
  102. </a-form-model-item>
  103. </a-col>
  104. </a-row>
  105. <a-row>
  106. <a-col :span="8">
  107. <a-form-model-item :label="'年\u2003\u2003度'" prop="planYear">
  108. <a-input v-model="JHBGAdvSearchForm.planYear" />
  109. </a-form-model-item>
  110. </a-col>
  111. <!-- <a-col :span="8">
  112. <a-form-model-item label="当前状态" prop="flowState">
  113. <sd-select
  114. v-model="JHBGAdvSearchForm.flowState"
  115. :allow-clear="true"
  116. :options="flowStateOptions"
  117. />
  118. </a-form-model-item>
  119. </a-col> -->
  120. </a-row>
  121. </template>
  122. </audit-advanced-query>
  123. <sd-data-table-ex
  124. ref="JHBGDataTable"
  125. style="margin-top: 25px"
  126. :filter-expressions="JHBGTableExpressions"
  127. :columns="columns2"
  128. show-selection
  129. form-id="iamAuditProjectChange"
  130. :data-url="dataurl2"
  131. :actions="actions2"
  132. @selectedRowsChanged="selectedRowsChanged"
  133. >
  134. <div slot="isLink" slot-scope="text, record">
  135. <a class="part-time">
  136. <span>
  137. <a-spin v-if="pending.includes(record.id)">
  138. <a-icon slot="indicator" type="loading" :class="$style.submitStatus" />
  139. </a-spin>
  140. <a-icon
  141. v-if="batchSubmitSucceed.includes(record.id)"
  142. type="check-circle"
  143. :class="[$style.submitStatus, $style.success]"
  144. />
  145. <a-tooltip
  146. v-if="batchsubmitFailed.map((item) => item.id).includes(record.id)"
  147. :title="batchsubmitFailed.find((item) => item.id === record.id).message"
  148. >
  149. <a-icon type="close-circle" :class="[$style.submitStatus, $style.error]" />
  150. </a-tooltip>
  151. </span>
  152. </a>
  153. <a :title="text" @click="showFlowFormDetail(record)">{{ text }}</a>
  154. </div>
  155. </sd-data-table-ex>
  156. </a-tab-pane>
  157. <a-tab-pane key="3" tab="审计计划">
  158. <!-- 高级搜索区域 -->
  159. <audit-advanced-query
  160. :expand="isShowAdvSearch"
  161. :search-data="SJJHAdvSearchForm"
  162. :ref-name="searchform"
  163. style="z-index: 1000"
  164. :search-style="{ height: '170px', left: '0px', top: '50px' }"
  165. :search-fun="advSJJHSearch"
  166. @searchedClick="searchedClick"
  167. >
  168. <template>
  169. <a-row>
  170. <a-col :span="8">
  171. <a-form-model-item label="计划年度" prop="planYear">
  172. <a-input v-model="SJJHAdvSearchForm.planYear" />
  173. </a-form-model-item>
  174. </a-col>
  175. <a-col :span="8">
  176. <a-form-model-item label="审计机构" prop="unitName">
  177. <a-input v-model="SJJHAdvSearchForm.unitName" />
  178. </a-form-model-item>
  179. </a-col>
  180. <a-col :span="8">
  181. <a-form-model-item label="编制人员" prop="creatorName">
  182. <a-input v-model="SJJHAdvSearchForm.creatorName" />
  183. </a-form-model-item>
  184. </a-col>
  185. </a-row>
  186. <!-- <a-row>
  187. <a-col :span="8">
  188. <a-form-model-item label="当前状态" prop="flowState">
  189. <sd-select
  190. v-model="SJJHAdvSearchForm.flowState"
  191. :allow-clear="true"
  192. :options="flowStateOptions"
  193. />
  194. </a-form-model-item>
  195. </a-col>
  196. </a-row> -->
  197. </template>
  198. </audit-advanced-query>
  199. <sd-data-table-ex
  200. ref="SJJHDataTable"
  201. style="margin-top: 25px"
  202. :filter-expressions="SJJHTableExpressions"
  203. :columns="columns3"
  204. show-selection
  205. form-id="iamAuditPlan"
  206. :data-url="dataurl3"
  207. :actions="actions3"
  208. @selectedRowsChanged="selectedRowsChanged"
  209. >
  210. <div slot="isLink" slot-scope="text, record">
  211. <a :title="text" @click="showFlowFormDetail(record)">{{ text }}</a>
  212. </div>
  213. </sd-data-table-ex>
  214. </a-tab-pane>
  215. </a-tabs>
  216. <div :class="[$style.btns]">
  217. <a-select
  218. v-if="activeKey === '1'"
  219. v-model="searchYear"
  220. style="z-index: 100; width: 80px; margin-top: -30px; margin-right: 10px"
  221. @change="changeYearSelect"
  222. >
  223. <a-select-option v-for="year in yearArry" :key="year">
  224. {{ year }}
  225. </a-select-option>
  226. </a-select>
  227. <a-radio-group
  228. v-if="activeKey !== '1'"
  229. v-model="radioValue"
  230. allow-clear
  231. @change="radioOnChange"
  232. >
  233. <a-radio :value="1"> 全部 </a-radio>
  234. <a-radio :value="2"> 待处理 </a-radio>
  235. </a-radio-group>
  236. <a-input-search
  237. v-model="searchValue"
  238. style="width: 155px; vertical-align: bottom"
  239. placeholder="请输入搜索条件"
  240. allow-clear
  241. @search="onSearch"
  242. />
  243. <a-button title="高级搜索" :class="$style.advSearchBtn" @click="AdvSearchClick">
  244. <a-icon type="sd-audit-advancesearch" theme="filled" :class="$style.searchIcon" />
  245. </a-button>
  246. <a-button
  247. v-if="activeKey === '1' && isCreateProject"
  248. type="primary"
  249. :class="[$style.buttonSpacing]"
  250. @click="createProject"
  251. >新建项目
  252. </a-button>
  253. <a-button
  254. v-if="activeKey !== '2' && isApplicationAdmin"
  255. type="primary"
  256. :class="[$style.buttonSpacing]"
  257. @click="createAuditPlan"
  258. >新建审计计划
  259. </a-button>
  260. <a-button v-if="false" type="primary" :class="[$style.buttonSpacing]" @click="batchSubmit"
  261. >批量提交
  262. </a-button>
  263. <a-button
  264. v-if="activeKey === '2' || (activeKey === '3' && isApplicationAdmin)"
  265. :class="[$style.buttonSpacing]"
  266. :disabled="deleteButtonDisable"
  267. @click="linkToDelete"
  268. >删除
  269. </a-button>
  270. <a-button
  271. v-if="activeKey === '1'"
  272. :class="[$style.buttonSpacing]"
  273. :loading="exportLoading"
  274. @click="fnexport"
  275. >导出
  276. </a-button>
  277. <audit-advanced-export
  278. ref="export"
  279. :v-if="false"
  280. :class-style="[$style.buttonSpacing]"
  281. :exclebxh="false"
  282. table-id="SJXMDataTable"
  283. :expressions="SJXMTableExpressions"
  284. :config-id="13"
  285. />
  286. </div>
  287. <a-modal
  288. :destroy-on-close="true"
  289. title="填写意见"
  290. :body-style="{ overflow: 'auto' }"
  291. :width="600"
  292. :visible="showOpinionModal"
  293. :wrap-class-name="$style.opinionModel"
  294. @ok="handleOkSubmit"
  295. @cancel="handleCancelSubmit"
  296. >
  297. <sd-opinion-model
  298. ref="opinionModel"
  299. v-model="form.opinion"
  300. :group-id="form.groupId"
  301. :cyy-popup-container="cyyPopupContainer"
  302. />
  303. </a-modal>
  304. </a-card>
  305. </div>
  306. </template>
  307. <script>
  308. import moment from 'moment'
  309. import download from '@/common/services/download'
  310. import { Message, message, Modal } from 'ant-design-vue'
  311. import auditAdvancedQuery from '../../components/audit-advanced-query.vue'
  312. import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins'
  313. import auditAdvancedExport from '../../components/audit-advanced-export.vue'
  314. import AuditService from './audit-service'
  315. import components from './_import-components/audit-plan-list-import'
  316. import TableColumnTypes from '@/common/services/table-column-types'
  317. import sdOpinionModel from '@/webflow/sd-opinion-model.vue'
  318. import axios from '@/common/services/axios-instance'
  319. import errorUtil from '@/common/services/error-util'
  320. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  321. import storeMixin, { getUserInfo } from '@/common/store-mixin'
  322. import FlowService from '@/webflow/flow-service'
  323. export default {
  324. name: 'AuditPlanList',
  325. metaInfo: {
  326. title: '项目计划',
  327. },
  328. components: { ...components, auditAdvancedQuery, auditAdvancedExport, sdOpinionModel },
  329. mixins: [storeMixin, auditAdvancedQueryMixins],
  330. data() {
  331. return {
  332. exportLoading: false,
  333. activeKey: '1',
  334. searchYear: new Date().getFullYear().toString(),
  335. yearArry: [],
  336. radioValue: 1,
  337. searchValue: '',
  338. deleteButtonDisable: true,
  339. searchform: 'searchform',
  340. isShowAdvSearch: false,
  341. isCreateProject: true,
  342. SJXMAdvSearchForm: {
  343. projectTitle: '',
  344. projectCode: '',
  345. auditType: '',
  346. auditMode: '',
  347. projectPrincipalName: '',
  348. auditedUnitNames: '',
  349. },
  350. JHBGAdvSearchForm: {
  351. projectTitle: null,
  352. changeType: '',
  353. creatorName: '',
  354. planYear: '',
  355. flowState: '',
  356. },
  357. SJJHAdvSearchForm: {
  358. planYear: null,
  359. unitName: '',
  360. creatorName: '',
  361. flowState: '',
  362. },
  363. SJXMTableExpressions: [],
  364. JHBGTableExpressions: [],
  365. SJJHTableExpressions: [],
  366. pageId: 'audit/plan/iamAuditPlan',
  367. dataurl1: 'api/xcoa-mobile/v1/iamauditproject/all-list',
  368. dataurl2: 'api/xcoa-mobile/v1/iamauditprojectchange/all-list',
  369. dataurl3: 'api/xcoa-mobile/v1/iamauditplan/all-list',
  370. columns1: [
  371. {
  372. title: '序号',
  373. customRender: (text, record, index) => `${index + 1}`,
  374. width: '80px',
  375. },
  376. {
  377. title: '项目名称',
  378. dataIndex: 'projectTitle',
  379. width: '30%',
  380. scopedSlots: { customRender: 'isLink' },
  381. },
  382. {
  383. title: '项目编号',
  384. dataIndex: 'projectCode',
  385. defaultSortOrder: 'descend',
  386. sortDirections: 'descend',
  387. width: '10%',
  388. },
  389. {
  390. title: '审计类型',
  391. dataIndex: 'auditType',
  392. width: '120px',
  393. sorter: true,
  394. },
  395. // {
  396. // title: '项目负责人',
  397. // dataIndex: 'projectPrincipalName',
  398. // sorter: true,
  399. // width: '260px',
  400. // },
  401. {
  402. title: '项目来源',
  403. dataIndex: 'isPlanIn',
  404. sorter: true,
  405. width: '80px',
  406. },
  407. {
  408. title: '审计方式',
  409. dataIndex: 'auditMode',
  410. sorter: true,
  411. width: '80px',
  412. sdHidden: true,
  413. },
  414. {
  415. title: '被审计单位',
  416. dataIndex: 'auditedUnitNames',
  417. width: '15%',
  418. },
  419. {
  420. title: '操作',
  421. dataIndex: 'opt',
  422. aligen: 'center',
  423. width: '120px',
  424. customRender: (text, record, index) => {
  425. if (
  426. record.operateCloumnPermission &&
  427. (record.flowState === '结束' || record.flowState === null)
  428. ) {
  429. // 只有我发起变更操作或者发起后流程结束的项目才有此操作
  430. if (record.itemStatus === '01') {
  431. // 只有未启动的项目才可以进行编辑
  432. return (
  433. <span>
  434. <a vOn:click={(evt) => this.editProject(record.id)}>编辑</a>{' '}
  435. <a vOn:click={(evt) => this.cancelProject(record.id)}>取消</a>
  436. </span>
  437. )
  438. } else if (record.itemStatus !== '06') {
  439. return (
  440. <span>
  441. <a vOn:click={(evt) => this.cancelProject(record.id)}>取消</a>
  442. </span>
  443. )
  444. }
  445. } else {
  446. return <span>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;</span>
  447. }
  448. },
  449. },
  450. ],
  451. actions1: [],
  452. columns2: [
  453. {
  454. title: '序号',
  455. customRender: (text, record, index) => `${index + 1}`,
  456. width: '80px',
  457. },
  458. {
  459. title: '项目名称',
  460. width: '25%',
  461. dataIndex: 'projectTitle',
  462. scopedSlots: { customRender: 'isLink' },
  463. },
  464. {
  465. title: '项目编号',
  466. dataIndex: 'projectCode',
  467. width: '10%',
  468. },
  469. {
  470. title: '变更类型',
  471. dataIndex: 'changeType',
  472. sorter: true,
  473. width: '120px',
  474. },
  475. {
  476. title: '编制人员',
  477. dataIndex: 'creatorName',
  478. sorter: true,
  479. width: '120px',
  480. },
  481. {
  482. title: '编制日期',
  483. dataIndex: 'creationTime',
  484. sorter: true,
  485. sdRender: TableColumnTypes.date,
  486. },
  487. {
  488. title: '当前状态',
  489. sorter: true,
  490. dataIndex: 'flowState',
  491. },
  492. {
  493. title: '当前处理人',
  494. dataIndex: 'creatorName',
  495. },
  496. ],
  497. actions2: [],
  498. columns3: [
  499. {
  500. title: '序号',
  501. customRender: (text, record, index) => `${index + 1}`,
  502. width: '80px',
  503. },
  504. {
  505. title: '计划年度',
  506. dataIndex: 'planYear',
  507. sorter: true,
  508. scopedSlots: { customRender: 'isLink' },
  509. },
  510. {
  511. title: '审计机构',
  512. sorter: true,
  513. dataIndex: 'unitName',
  514. },
  515. {
  516. title: '编制人员',
  517. dataIndex: 'creatorName',
  518. },
  519. {
  520. title: '编制日期',
  521. dataIndex: 'creationTime',
  522. sdRender: TableColumnTypes.date,
  523. },
  524. {
  525. title: '当前状态',
  526. sorter: true,
  527. dataIndex: 'flowState',
  528. },
  529. {
  530. title: '结束发布标记',
  531. hidden: true,
  532. sorter: true,
  533. dataIndex: 'endType',
  534. sdHidden: true,
  535. },
  536. {
  537. title: '当前处理人',
  538. dataIndex: 'currentUser',
  539. },
  540. ],
  541. actions3: [],
  542. formId: 'iamAuditProject',
  543. tableId: 'SJXMDataTable',
  544. itemStatusOptions: [],
  545. auditTypeOptions: [],
  546. auditModeOptions: [],
  547. changeTypeOptions: [],
  548. showOpinionModal: false,
  549. pending: [],
  550. batchSubmitSucceed: [],
  551. batchsubmitFailed: [],
  552. form: {
  553. opinion: '',
  554. groupId: '',
  555. },
  556. isApplicationAdmin: false, // 是否为审计计划管理员
  557. flowStateOptions: [
  558. {
  559. id: '起草',
  560. name: '起草',
  561. },
  562. {
  563. id: '审计部领导审批',
  564. name: '审计部领导审批',
  565. },
  566. {
  567. id: '结束',
  568. name: '结束',
  569. },
  570. ],
  571. }
  572. },
  573. mounted() {
  574. // 初始化年份下拉框
  575. this.initYearSelect()
  576. // 初始化数据字典信息
  577. this.initDictionaryInfo()
  578. // 初始化权限
  579. this.initJurisdiction()
  580. },
  581. methods: {
  582. // 初始化年份下拉框
  583. initYearSelect() {
  584. AuditService.getPlanYear().then((res) => {
  585. this.yearArry = []
  586. // 获取计划年度
  587. if (res.data != null && res.data !== '') {
  588. let flag = true
  589. res.data.forEach((e) => {
  590. this.yearArry.push(e)
  591. if (e === this.searchYear) {
  592. flag = false
  593. }
  594. })
  595. this.yearArry = this.yearArry.sort().reverse()
  596. if (flag === true) {
  597. const arry = res.data.filter((e) => e < this.searchYear).reverse()
  598. if (arry.length > 0) {
  599. this.searchYear = arry[0]
  600. } else {
  601. this.searchYear = this.yearArry[this.yearArry.length - 1]
  602. }
  603. this.changeYearSelect(this.searchYear)
  604. }
  605. } else {
  606. // 如果没有已经发布的计划,则显示当前年份
  607. this.isCreateProject = false
  608. this.yearArry.push(this.searchYear)
  609. }
  610. })
  611. },
  612. initDictionaryInfo() {
  613. axios({
  614. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_AUDIT_METHOD',
  615. method: 'get',
  616. }).then((res) => {
  617. if (res.status === 200) {
  618. this.auditModeOptions = res.data
  619. }
  620. })
  621. axios({
  622. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_AUDIT_TYPE',
  623. method: 'get',
  624. }).then((res) => {
  625. if (res.status === 200) {
  626. this.auditTypeOptions = res.data
  627. }
  628. })
  629. axios({
  630. url: 'api/xcoa-mobile/v1/iam-law/dictionary?key=PRODUCT_IAM_CHANGE_TYPE',
  631. method: 'get',
  632. }).then((res) => {
  633. if (res.status === 200) {
  634. this.changeTypeOptions = res.data
  635. }
  636. })
  637. },
  638. // 初始化权限
  639. initJurisdiction() {
  640. // 校验权限(检查为审计计划管理员、审计人员)
  641. AuditService.checkPermission().then((res) => {
  642. this.isApplicationAdmin = res.data.isHasPermission // 删除按钮权限(拥有计划管理员角色)
  643. })
  644. },
  645. // 创建审计计划
  646. createAuditPlan() {
  647. const url = '/sd-flow-guide?code=PRODUCT_IAM_SJJH' // 新页面要打开的路由地址
  648. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  649. if (refreshFlag) {
  650. // 这里写或者调刷新的方法
  651. this.refreshDataTable()
  652. }
  653. })
  654. },
  655. // 编辑项目
  656. editProject(id) {
  657. // 校验项目是否已启动
  658. AuditService.checkProjectIsStart(id).then((res) => {
  659. if (res.data) {
  660. Modal.warning({
  661. title: '提示',
  662. content: '该项目已启动!',
  663. })
  664. return null
  665. } else {
  666. const url =
  667. `/sd-flow-guide?code=PRODUCT_IAM_SJJHBG&oper=edit&projectId=${id}&planYear=` +
  668. this.searchYear // 新页面要打开的路由地址
  669. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  670. if (refreshFlag) {
  671. // 这里写或者调刷新的方法
  672. this.refreshDataTable()
  673. }
  674. })
  675. }
  676. })
  677. },
  678. // 批量提交
  679. batchSubmit() {
  680. this.showOpinionModal = true
  681. this.getGroupCode()
  682. },
  683. // 取消项目
  684. cancelProject(id) {
  685. const url =
  686. `/sd-flow-guide?code=PRODUCT_IAM_SJJHBG&oper=cancel&projectId=${id}&planYear=` +
  687. this.searchYear // 新页面要打开的路由地址
  688. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  689. if (refreshFlag) {
  690. // 这里写或者调刷新的方法
  691. this.refreshDataTable()
  692. }
  693. })
  694. },
  695. // 创建项目
  696. createProject() {
  697. // 判断能不能新建项目
  698. if (this.searchYear !== undefined) {
  699. // AuditService.existYearPlan('', this.searchYear, '').then((res) => {
  700. // if (res.data &&res.data === true) {
  701. AuditService.getPlanByPlanYear(this.searchYear).then((res) => {
  702. if (res.data) {
  703. const url =
  704. '/sd-flow-guide?code=PRODUCT_IAM_SJJHBG&oper=create&planYear=' + this.searchYear // 新页面要打开的路由地址
  705. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  706. if (refreshFlag) {
  707. // 这里写或者调刷新的方法
  708. this.refreshDataTable()
  709. }
  710. })
  711. } else {
  712. Modal.warning({
  713. title: '提示',
  714. content: '请先维护本单位审计计划并发布',
  715. })
  716. }
  717. })
  718. } else {
  719. Modal.warning({
  720. title: '提示',
  721. content: '请先选择计划年度!',
  722. })
  723. }
  724. },
  725. refreshDataTable() {
  726. if (this.activeKey === '1') {
  727. this.tableId = 'SJXMDataTable'
  728. }
  729. if (this.activeKey === '2') {
  730. this.tableId = 'JHBGDataTable'
  731. }
  732. if (this.activeKey === '3') {
  733. this.tableId = 'SJJHDataTable'
  734. }
  735. if (this.$refs[`${this.tableId}`]) {
  736. this.$refs[`${this.tableId}`].clearSelection()
  737. this.$refs[`${this.tableId}`].refresh()
  738. }
  739. },
  740. toggleTabs(key) {
  741. this.activeKey = key
  742. if (this.activeKey === '1') {
  743. this.tableId = 'SJXMDataTable'
  744. this.SJXMTableExpressions = []
  745. }
  746. if (this.activeKey === '2') {
  747. this.tableId = 'JHBGDataTable'
  748. this.JHBGTableExpressions = []
  749. if (this.radioValue === 1) {
  750. this.JHBGTableExpressions.push({
  751. dataType: 'boolean',
  752. name: 'stateFlag',
  753. booleanValue: true,
  754. })
  755. } else if (this.radioValue === 2) {
  756. this.JHBGTableExpressions.push({
  757. dataType: 'boolean',
  758. name: 'stateFlag',
  759. booleanValue: false,
  760. })
  761. }
  762. }
  763. if (this.activeKey === '3') {
  764. this.tableId = 'SJJHDataTable'
  765. this.SJJHTableExpressions = []
  766. if (this.radioValue === 1) {
  767. this.SJJHTableExpressions.push({
  768. dataType: 'boolean',
  769. name: 'stateFlag',
  770. booleanValue: true,
  771. })
  772. } else if (this.radioValue === 2) {
  773. this.SJJHTableExpressions.push({
  774. dataType: 'boolean',
  775. name: 'stateFlag',
  776. booleanValue: false,
  777. })
  778. }
  779. }
  780. this.deleteButtonDisable = true
  781. if (this.$refs[`${this.tableId}`]) {
  782. this.$refs[`${this.tableId}`].clearSelection()
  783. }
  784. },
  785. linkToDelete() {
  786. if (this.activeKey === '1') {
  787. this.tableId = 'SJXMDataTable'
  788. this.formId = 'iamAuditProject'
  789. }
  790. if (this.activeKey === '2') {
  791. this.tableId = 'JHBGDataTable'
  792. this.formId = 'iamAuditProjectChange'
  793. }
  794. if (this.activeKey === '3') {
  795. this.tableId = 'SJJHDataTable'
  796. this.formId = 'iamAuditPlan'
  797. }
  798. const selectedRowKeys = this.$refs[`${this.tableId}`].getSelectedRowKeys()
  799. if (selectedRowKeys.length === 0) {
  800. Modal.info({
  801. content: '请选择需要删除的数据!',
  802. })
  803. return
  804. }
  805. if (this.activeKey === '2') {
  806. // 计划变更删除
  807. if (this.checkStateDelete('0', '只能删除起草状态的计划变更!')) {
  808. this.deleteMethod(selectedRowKeys)
  809. }
  810. } else if (this.activeKey === '3') {
  811. // 计划删除
  812. // 删除是否为本单位校验
  813. if (this.checkDeptDelete()) {
  814. // 删除是否为起草状态校验
  815. if (this.checkStateDelete('0,5', '只能删除起草、结束状态的审计计划')) {
  816. AuditService.beforeDeleteCheck(selectedRowKeys).then((res) => {
  817. // 删除前校验
  818. if (res.data) {
  819. Modal.warning({
  820. title: '提示',
  821. content: '该计划存在已启动/已取消/已关闭/已归档项目,请先删除该项目!',
  822. })
  823. return null
  824. } else {
  825. this.deleteMethod(selectedRowKeys)
  826. }
  827. })
  828. }
  829. }
  830. } else {
  831. this.deleteMethod(selectedRowKeys)
  832. }
  833. },
  834. // 删除记录
  835. deleteMethod(selectedRowKeys) {
  836. let url
  837. if (this.activeKey === '2') {
  838. url = 'api/xcoa-mobile/v1/iamauditprojectchange/deleteProjectChange'
  839. } else {
  840. url = 'api/xcoa-mobile/v1/page/' + this.formId
  841. }
  842. return new Promise((resolve) => {
  843. Modal.confirm({
  844. title: '您确定删除这项内容吗?',
  845. content: '删除这条数据后,就无法恢复初始的状态。',
  846. cancelText: '取消',
  847. okText: '删除',
  848. okType: 'danger',
  849. onOk: () => {
  850. axios({
  851. url: url,
  852. method: 'delete',
  853. params: {
  854. ids: selectedRowKeys.join(','),
  855. },
  856. })
  857. .then(() => {
  858. const msg = '删除成功'
  859. message.success(msg)
  860. this.$refs[`${this.tableId}`].clearSelection()
  861. this.$refs[`${this.tableId}`].refresh()
  862. })
  863. .catch((err) => {
  864. const msg = errorUtil.getMessage(err) || '删除失败'
  865. message.error(msg)
  866. })
  867. .finally(resolve)
  868. },
  869. onCancel: () => {
  870. resolve()
  871. },
  872. })
  873. })
  874. },
  875. // 删除是否为本单位校验
  876. checkDeptDelete() {
  877. let temp = false
  878. const selectedRows = this.$refs[`${this.tableId}`].getSelectedRows()
  879. selectedRows.some((item) => {
  880. if (!item.hasOperateAuthority) {
  881. temp = true
  882. return true
  883. }
  884. })
  885. if (temp) {
  886. Modal.warning({
  887. title: '提示',
  888. content: '只能删除本单位的审计计划!',
  889. })
  890. return false
  891. }
  892. return true
  893. },
  894. // 删除是否为起草状态校验
  895. checkStateDelete(state, message) {
  896. let temp = false
  897. const selectedRows = this.$refs[`${this.tableId}`].getSelectedRows()
  898. selectedRows.some((item) => {
  899. // if (item.flowState !== '起草') {
  900. if (!state.includes(item.endType)) {
  901. temp = true
  902. return true
  903. }
  904. })
  905. if (temp) {
  906. Modal.warning({
  907. title: '提示',
  908. content: message,
  909. })
  910. return false
  911. }
  912. return true
  913. },
  914. AdvSearchClick() {
  915. this.isShowAdvSearch = !this.isShowAdvSearch
  916. },
  917. searchedClick() {
  918. this.isShowAdvSearch = !this.isShowAdvSearch
  919. },
  920. changeYearSelect(value) {
  921. if (this.activeKey === '1') {
  922. this.SJXMTableExpressions = []
  923. if (value) {
  924. // 计划年度
  925. this.SJXMTableExpressions.push({
  926. dataType: 'str',
  927. name: 'planYear',
  928. op: 'like',
  929. stringValue: `${value}`,
  930. })
  931. // 项目状态不是'取消'
  932. // this.SJXMTableExpressions.push({
  933. // dataType: 'str',
  934. // name: 'itemStatus',
  935. // op: 'ne',
  936. // stringValue: '06',
  937. // })
  938. }
  939. }
  940. },
  941. onSearch(value) {
  942. if (this.activeKey === '1') {
  943. this.SJXMTableExpressions = []
  944. if (value) {
  945. const expressions = []
  946. // 项目名称
  947. expressions.push({
  948. dataType: 'str',
  949. name: 'projectTitle',
  950. op: 'like',
  951. stringValue: `%${value}%`,
  952. })
  953. // 项目编号
  954. expressions.push({
  955. dataType: 'str',
  956. name: 'projectCode',
  957. op: 'like',
  958. stringValue: `%${value}%`,
  959. })
  960. // 审计类型
  961. // expressions.push({
  962. // dataType: 'str',
  963. // name: 'auditType',
  964. // op: 'like',
  965. // stringValue: `%${value}%`,
  966. // })
  967. // 项目负责人
  968. expressions.push({
  969. dataType: 'str',
  970. name: 'projectPrincipalName',
  971. op: 'like',
  972. stringValue: `%${value}%`,
  973. })
  974. // 审计方式
  975. // expressions.push({
  976. // dataType: 'str',
  977. // name: 'auditMode',
  978. // op: 'like',
  979. // stringValue: `%${value}%`,
  980. // })
  981. // 被审计单位
  982. expressions.push({
  983. dataType: 'str',
  984. name: 'auditedUnitNames',
  985. op: 'like',
  986. stringValue: `%${value}%`,
  987. })
  988. this.SJXMTableExpressions.push({
  989. dataType: 'exps',
  990. op: 'or',
  991. expressionsValue: expressions,
  992. })
  993. }
  994. }
  995. if (this.activeKey === '2') {
  996. this.JHBGTableExpressions = []
  997. if (this.radioValue === 1) {
  998. this.JHBGTableExpressions.push({
  999. dataType: 'boolean',
  1000. name: 'stateFlag',
  1001. booleanValue: true,
  1002. })
  1003. } else if (this.radioValue === 2) {
  1004. this.JHBGTableExpressions.push({
  1005. dataType: 'boolean',
  1006. name: 'stateFlag',
  1007. booleanValue: false,
  1008. })
  1009. }
  1010. if (value) {
  1011. const expressions = []
  1012. // 项目名称
  1013. expressions.push({
  1014. dataType: 'str',
  1015. name: 'projectTitle',
  1016. op: 'like',
  1017. stringValue: `%${value}%`,
  1018. })
  1019. // 项目编号
  1020. expressions.push({
  1021. dataType: 'str',
  1022. name: 'projectCode',
  1023. op: 'like',
  1024. stringValue: `%${value}%`,
  1025. })
  1026. // 变更类型
  1027. expressions.push({
  1028. dataType: 'str',
  1029. name: 'changeType',
  1030. op: 'like',
  1031. stringValue: `%${value}%`,
  1032. })
  1033. // 编制人员
  1034. expressions.push({
  1035. dataType: 'str',
  1036. name: 'creatorName',
  1037. op: 'like',
  1038. stringValue: `%${value}%`,
  1039. })
  1040. // 编制日期
  1041. expressions.push({
  1042. dataType: 'long',
  1043. name: 'creationTime',
  1044. op: 'eq',
  1045. longValue: moment(moment(value, 'YYYY-MM-DD HH:mm:SS')).valueOf(),
  1046. })
  1047. // 当前状态
  1048. // expressions.push({
  1049. // dataType: 'str',
  1050. // name: 'flowState',
  1051. // op: 'like',
  1052. // stringValue: `%${value}%`,
  1053. // })
  1054. // 当前处理人
  1055. expressions.push({
  1056. dataType: 'str',
  1057. name: 'currentUser',
  1058. op: 'like',
  1059. stringValue: `%${value}%`,
  1060. })
  1061. this.JHBGTableExpressions.push({
  1062. dataType: 'exps',
  1063. op: 'or',
  1064. expressionsValue: expressions,
  1065. })
  1066. }
  1067. }
  1068. if (this.activeKey === '3') {
  1069. this.SJJHTableExpressions = []
  1070. if (this.radioValue === 1) {
  1071. this.SJJHTableExpressions.push({
  1072. dataType: 'boolean',
  1073. name: 'stateFlag',
  1074. booleanValue: true,
  1075. })
  1076. } else if (this.radioValue === 2) {
  1077. this.SJJHTableExpressions.push({
  1078. dataType: 'boolean',
  1079. name: 'stateFlag',
  1080. booleanValue: false,
  1081. })
  1082. }
  1083. if (value) {
  1084. const expressions = []
  1085. // 计划年度
  1086. expressions.push({
  1087. dataType: 'str',
  1088. name: 'planYear',
  1089. op: 'eq',
  1090. stringValue: value,
  1091. })
  1092. // 审计机构
  1093. expressions.push({
  1094. dataType: 'str',
  1095. name: 'unitName',
  1096. op: 'like',
  1097. stringValue: `%${value}%`,
  1098. })
  1099. // 编制人员
  1100. expressions.push({
  1101. dataType: 'str',
  1102. name: 'creatorName',
  1103. op: 'like',
  1104. stringValue: `%${value}%`,
  1105. })
  1106. // 编制日期
  1107. expressions.push({
  1108. dataType: 'long',
  1109. name: 'creationTime',
  1110. op: 'eq',
  1111. longValue: moment(moment(value, 'YYYY-MM-DD HH:mm:SS')).valueOf(),
  1112. })
  1113. // 当前状态
  1114. // expressions.push({
  1115. // dataType: 'str',
  1116. // name: 'flowState',
  1117. // op: 'like',
  1118. // stringValue: `%${value}%`,
  1119. // })
  1120. // 当前处理人
  1121. // expressions.push({
  1122. // dataType: 'str',
  1123. // name: 'currentUser',
  1124. // op: 'like',
  1125. // stringValue: `%${value}%`,
  1126. // })
  1127. this.SJJHTableExpressions.push({
  1128. dataType: 'exps',
  1129. op: 'or',
  1130. expressionsValue: expressions,
  1131. })
  1132. }
  1133. }
  1134. this.$refs[`${this.tableId}`].clearSelection()
  1135. },
  1136. advSJXMSearch() {
  1137. this.SJXMTableExpressions = []
  1138. // 计划年度
  1139. this.SJXMTableExpressions.push({
  1140. dataType: 'str',
  1141. name: 'planYear',
  1142. op: 'like',
  1143. stringValue: `${this.searchYear}`,
  1144. })
  1145. // 项目状态不是'取消'
  1146. // this.SJXMTableExpressions.push({
  1147. // dataType: 'str',
  1148. // name: 'itemStatus',
  1149. // op: 'ne',
  1150. // stringValue: '06',
  1151. // })
  1152. // 项目名称
  1153. if (this.SJXMAdvSearchForm.projectTitle) {
  1154. this.SJXMTableExpressions.push({
  1155. dataType: 'str',
  1156. name: 'projectTitle',
  1157. op: 'like',
  1158. stringValue: `${this.SJXMAdvSearchForm.projectTitle}`,
  1159. })
  1160. }
  1161. // 项目编号
  1162. if (this.SJXMAdvSearchForm.projectCode) {
  1163. this.SJXMTableExpressions.push({
  1164. dataType: 'str',
  1165. name: 'projectCode',
  1166. op: 'like',
  1167. stringValue: `${this.SJXMAdvSearchForm.projectCode}`,
  1168. })
  1169. }
  1170. // 审计类型
  1171. if (this.SJXMAdvSearchForm.auditType[0]) {
  1172. this.SJXMTableExpressions.push({
  1173. dataType: 'str',
  1174. name: 'auditType',
  1175. op: 'like',
  1176. stringValue: `${this.SJXMAdvSearchForm.auditType[0].id}`,
  1177. })
  1178. }
  1179. // 审计方式
  1180. if (this.SJXMAdvSearchForm.auditMode[0]) {
  1181. this.SJXMTableExpressions.push({
  1182. dataType: 'str',
  1183. name: 'auditMode',
  1184. op: 'like',
  1185. stringValue: `${this.SJXMAdvSearchForm.auditMode[0].id}`,
  1186. })
  1187. }
  1188. // 项目负责人
  1189. if (this.SJXMAdvSearchForm.projectPrincipalName) {
  1190. this.SJXMTableExpressions.push({
  1191. dataType: 'str',
  1192. name: 'projectPrincipalName',
  1193. op: 'like',
  1194. stringValue: `${this.SJXMAdvSearchForm.projectPrincipalName}`,
  1195. })
  1196. }
  1197. // 被审计单位
  1198. if (this.SJXMAdvSearchForm.auditedUnitNames) {
  1199. this.SJXMTableExpressions.push({
  1200. dataType: 'str',
  1201. name: 'auditedUnitNames',
  1202. op: 'like',
  1203. stringValue: `${this.SJXMAdvSearchForm.auditedUnitNames}`,
  1204. })
  1205. }
  1206. this.$refs[`${this.tableId}`].clearSelection()
  1207. },
  1208. advJHBGSearch() {
  1209. this.JHBGTableExpressions = []
  1210. if (this.radioValue === 1) {
  1211. this.JHBGTableExpressions.push({
  1212. dataType: 'boolean',
  1213. name: 'stateFlag',
  1214. booleanValue: true,
  1215. })
  1216. } else if (this.radioValue === 2) {
  1217. this.JHBGTableExpressions.push({
  1218. dataType: 'boolean',
  1219. name: 'stateFlag',
  1220. booleanValue: false,
  1221. })
  1222. }
  1223. // 项目名称
  1224. if (this.JHBGAdvSearchForm.projectTitle) {
  1225. this.JHBGTableExpressions.push({
  1226. dataType: 'str',
  1227. name: 'projectTitle',
  1228. op: 'like',
  1229. stringValue: `${this.JHBGAdvSearchForm.projectTitle}`,
  1230. })
  1231. }
  1232. // 变更类型
  1233. if (this.JHBGAdvSearchForm.changeType[0]) {
  1234. this.JHBGTableExpressions.push({
  1235. dataType: 'str',
  1236. name: 'changeType',
  1237. op: 'like',
  1238. stringValue: `${this.JHBGAdvSearchForm.changeType[0].id}`,
  1239. })
  1240. }
  1241. // 编制人员
  1242. if (this.JHBGAdvSearchForm.creatorName) {
  1243. this.JHBGTableExpressions.push({
  1244. dataType: 'str',
  1245. name: 'creatorName',
  1246. op: 'like',
  1247. stringValue: `${this.JHBGAdvSearchForm.creatorName}`,
  1248. })
  1249. }
  1250. // 年度
  1251. if (this.JHBGAdvSearchForm.planYear) {
  1252. this.JHBGTableExpressions.push({
  1253. dataType: 'str',
  1254. name: 'planYear',
  1255. op: 'like',
  1256. stringValue: `${this.JHBGAdvSearchForm.planYear}`,
  1257. })
  1258. }
  1259. // 当前状态
  1260. // if (this.JHBGAdvSearchForm.flowState[0]) {
  1261. // this.JHBGTableExpressions.push({
  1262. // dataType: 'str',
  1263. // name: 'flowState',
  1264. // op: 'like',
  1265. // stringValue: `${this.JHBGAdvSearchForm.flowState[0].id}`,
  1266. // })
  1267. // }
  1268. this.$refs[`${this.tableId}`].clearSelection()
  1269. },
  1270. advSJJHSearch() {
  1271. this.SJJHTableExpressions = []
  1272. if (this.radioValue === 1) {
  1273. this.SJJHTableExpressions.push({
  1274. dataType: 'boolean',
  1275. name: 'stateFlag',
  1276. booleanValue: true,
  1277. })
  1278. } else if (this.radioValue === 2) {
  1279. this.SJJHTableExpressions.push({
  1280. dataType: 'boolean',
  1281. name: 'stateFlag',
  1282. booleanValue: false,
  1283. })
  1284. }
  1285. // 计划年度
  1286. if (this.SJJHAdvSearchForm.planYear) {
  1287. this.SJJHTableExpressions.push({
  1288. dataType: 'str',
  1289. name: 'planYear',
  1290. op: 'like',
  1291. stringValue: this.SJJHAdvSearchForm.planYear,
  1292. })
  1293. }
  1294. // 审计机构
  1295. if (this.SJJHAdvSearchForm.unitName) {
  1296. this.SJJHTableExpressions.push({
  1297. dataType: 'str',
  1298. name: 'unitName',
  1299. op: 'like',
  1300. stringValue: `${this.SJJHAdvSearchForm.unitName}`,
  1301. })
  1302. }
  1303. // 编制人员
  1304. if (this.SJJHAdvSearchForm.creatorName) {
  1305. this.SJJHTableExpressions.push({
  1306. dataType: 'str',
  1307. name: 'creatorName',
  1308. op: 'like',
  1309. stringValue: `${this.SJJHAdvSearchForm.creatorName}`,
  1310. })
  1311. }
  1312. // 当前状态
  1313. // if (this.SJJHAdvSearchForm.flowState[0]) {
  1314. // this.SJJHTableExpressions.push({
  1315. // dataType: 'str',
  1316. // name: 'flowState',
  1317. // op: 'like',
  1318. // stringValue: `${this.SJJHAdvSearchForm.flowState[0].id}`,
  1319. // })
  1320. // }
  1321. this.$refs[`${this.tableId}`].clearSelection()
  1322. },
  1323. showProjectDetail(record) {
  1324. var url = '/audit-project-detail?record=' + record.id
  1325. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  1326. if (refreshFlag) {
  1327. // 这里写或者调刷新的方法
  1328. this.refreshDataTable()
  1329. }
  1330. })
  1331. },
  1332. showFlowFormDetail(record) {
  1333. if (
  1334. (this.activeKey === '2' && (record.flowState === '起草') | (record.flowState === '开始')) ||
  1335. (this.activeKey === '3' &&
  1336. (record.flowState === '起草') | (record.flowState === '开始') &&
  1337. record.hasOperateAuthority)
  1338. ) {
  1339. const url = '/sd-webflow/pages/draft/' + record.instId // 编辑面要打开的路由地址
  1340. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  1341. if (refreshFlag) {
  1342. // 这里写或者调刷新的方法
  1343. this.refreshDataTable()
  1344. }
  1345. })
  1346. } else {
  1347. window.open('#/sd-webflow/done-pages/' + record.instId)
  1348. }
  1349. },
  1350. radioOnChange(e) {
  1351. if (this.selectedType !== e.target.value) {
  1352. if (this.activeKey === '2') {
  1353. this.JHBGTableExpressions = []
  1354. this.selectedType = e.target.value
  1355. if (e.target.value === 1) {
  1356. this.JHBGTableExpressions.push({
  1357. dataType: 'boolean',
  1358. name: 'stateFlag',
  1359. booleanValue: true,
  1360. })
  1361. } else if (e.target.value === 2) {
  1362. const userInfo = getUserInfo()
  1363. this.JHBGTableExpressions.push({
  1364. dataType: 'boolean',
  1365. name: 'stateFlag',
  1366. booleanValue: false,
  1367. })
  1368. this.JHBGTableExpressions.push({
  1369. dataType: 'str',
  1370. name: 'currentUser',
  1371. op: 'like',
  1372. stringValue: `%${userInfo.name}%`,
  1373. })
  1374. }
  1375. } else {
  1376. this.SJJHTableExpressions = []
  1377. this.selectedType = e.target.value
  1378. if (e.target.value === 1) {
  1379. this.SJJHTableExpressions.push({
  1380. dataType: 'boolean',
  1381. name: 'stateFlag',
  1382. booleanValue: true,
  1383. })
  1384. } else if (e.target.value === 2) {
  1385. this.SJJHTableExpressions.push({
  1386. dataType: 'boolean',
  1387. name: 'stateFlag',
  1388. booleanValue: false,
  1389. })
  1390. }
  1391. }
  1392. }
  1393. this.$refs[`${this.tableId}`].clearSelection()
  1394. },
  1395. // 标题格式化
  1396. formatterTitle(val, length) {
  1397. var resultArry = []
  1398. let title = ''
  1399. let result = ''
  1400. if (val === undefined || val === '' || val === '[]') {
  1401. resultArry.push(title)
  1402. resultArry.push(result)
  1403. return resultArry
  1404. } else {
  1405. try {
  1406. JSON.parse(val).forEach((e) => {
  1407. result += e.name + ','
  1408. })
  1409. } catch (e) {
  1410. result = val
  1411. }
  1412. if (result.lastIndexOf(',') > 0) {
  1413. result = result.substr(0, result.length - 1)
  1414. }
  1415. title = result
  1416. if (result.length > length) {
  1417. result = result.substr(0, length) + '...'
  1418. }
  1419. resultArry.push(title)
  1420. resultArry.push(result)
  1421. return resultArry
  1422. }
  1423. },
  1424. getGroupCode() {
  1425. // 获取groupId
  1426. FlowService.getGroupCode().then((res) => {
  1427. if (res.status === 200) {
  1428. if (res.data) {
  1429. this.form.groupId = res.data.toString()
  1430. } else {
  1431. Message.error('获取groupId失败')
  1432. }
  1433. } else {
  1434. Message.error(res.statusText)
  1435. }
  1436. })
  1437. },
  1438. handleOkSubmit() {
  1439. this.showOpinionModal = false
  1440. this.pending = []
  1441. this.batchSubmitSucceed = []
  1442. this.batchsubmitFailed = []
  1443. const selectedRows = this.$refs.JHBGDataTable.getSelectedRows()
  1444. selectedRows.forEach((record) => {
  1445. const id = record.id
  1446. this.pending.push(id)
  1447. const params = {
  1448. id,
  1449. opinion: this.form.opinion,
  1450. attachment: this.form.groupId,
  1451. }
  1452. const srcTrustId = record.srcTrustId
  1453. AuditService.projectChangeBatchSubmit(params, srcTrustId).then((res) => {
  1454. // 批量提交
  1455. if (res.code === '1') {
  1456. this.batchSubmitSucceed.push(id)
  1457. } else {
  1458. this.batchsubmitFailed.push({ id: id, ...res })
  1459. }
  1460. const index = this.pending.findIndex((item) => item === id)
  1461. this.pending.splice(index, 1)
  1462. // 所有的都处理完刷新列表
  1463. if (
  1464. this.batchSubmitSucceed.length + this.batchsubmitFailed.length ===
  1465. selectedRows.length
  1466. ) {
  1467. this.$refs.JHBGDataTable.refresh()
  1468. this.$refs.JHBGDataTable.clearSelection()
  1469. }
  1470. })
  1471. })
  1472. },
  1473. handleCancelSubmit() {
  1474. this.showOpinionModal = false
  1475. this.form.opinion = ''
  1476. this.form.groupId = ''
  1477. },
  1478. cyyPopupContainer() {
  1479. return document.body
  1480. },
  1481. processReq(req) {
  1482. const url = req.url
  1483. const arr = req.data.expressions
  1484. if (url === 'api/xcoa-mobile/v1/iamauditproject/all-list') {
  1485. arr.push({
  1486. dataType: 'str',
  1487. name: 'planYear',
  1488. op: 'like',
  1489. stringValue: `${this.searchYear}`,
  1490. })
  1491. // arr.push({
  1492. // dataType: 'str',
  1493. // name: 'itemStatus',
  1494. // op: 'ne',
  1495. // stringValue: '06',
  1496. // })
  1497. }
  1498. return req
  1499. },
  1500. selectedRowsChanged(row) {
  1501. if (row.length > 0) {
  1502. this.deleteButtonDisable = false
  1503. } else {
  1504. this.deleteButtonDisable = true
  1505. }
  1506. },
  1507. // 导出
  1508. fnexport() {
  1509. this.exportLoading = true
  1510. // 计划年度
  1511. // this.SJXMTableExpressions.push({
  1512. // dataType: 'str',
  1513. // name: 'planYear',
  1514. // op: 'like',
  1515. // stringValue: `%${this.searchYear}%`,
  1516. // })
  1517. // 项目状态不是'取消'
  1518. // this.SJXMTableExpressions.push({
  1519. // dataType: 'str',
  1520. // name: 'itemStatus',
  1521. // op: 'ne',
  1522. // stringValue: '06',
  1523. // })
  1524. // this.$refs.export.exportdata()
  1525. const conditions = { configId: '13', year: this.searchYear }
  1526. axios({
  1527. url: 'api/xcoa-mobile/v1/iamauditproject/exportPaper',
  1528. method: 'post',
  1529. data: conditions,
  1530. responseType: 'blob',
  1531. }).then((res) => {
  1532. if (res.status === 200) {
  1533. const url = URL.createObjectURL(res.data)
  1534. const filename = res.headers['content-disposition']
  1535. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  1536. download(url, decodeURI(fname))
  1537. }
  1538. })
  1539. setTimeout(() => {
  1540. this.exportLoading = false
  1541. }, 1000)
  1542. },
  1543. },
  1544. }
  1545. </script>
  1546. <style module lang="scss">
  1547. @use '@/common/design' as *;
  1548. .wrap-height {
  1549. :global(.ant-col-offset-10) {
  1550. margin-left: 0;
  1551. }
  1552. }
  1553. .btns {
  1554. position: absolute;
  1555. top: 15px;
  1556. right: 15px;
  1557. z-index: 100;
  1558. }
  1559. .buttonSpacing {
  1560. margin-left: 5px;
  1561. }
  1562. .advancedQuery {
  1563. :global(.ant-col .ant-form-item-label) {
  1564. width: 30% !important;
  1565. }
  1566. :global(.ant-col .ant-form-item-control-wrapper) {
  1567. width: 60% !important;
  1568. }
  1569. }
  1570. .advSearchBtn {
  1571. width: 35px;
  1572. padding: 0;
  1573. margin-left: -5px;
  1574. border-radius: 0 5px 5px 0;
  1575. }
  1576. .search-icon {
  1577. margin-left: 1px !important;
  1578. font-size: 12px;
  1579. }
  1580. .wrap-height {
  1581. .success {
  1582. color: $alert-success-icon-color;
  1583. }
  1584. .error {
  1585. color: $alert-error-icon-color;
  1586. }
  1587. :global(.part-time) {
  1588. padding-right: 5px !important;
  1589. }
  1590. }
  1591. </style>