iam-audit-dsc-main.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <template>
  2. <a-layout :class="$style.mainDiv">
  3. <a-layout-header :class="$style.header">
  4. <div :class="$style.title"> 决策支持中心 </div>
  5. <div :class="$style.rightDiv">
  6. <div :class="$style.year">
  7. <a-date-picker
  8. v-model="planYear"
  9. :class="$style.yearSelect"
  10. allow-clear
  11. mode="year"
  12. picker="YYYY"
  13. format="YYYY"
  14. :input-read-only="true"
  15. :open="yearOpen"
  16. placeholder="选择年份"
  17. @panelChange="panelChange"
  18. @openChange="openChange"
  19. />
  20. </div>
  21. <div :class="$style.group">
  22. <div v-show="auditOrg.length === 0" :class="$style.holder" @click="holderClick"
  23. >审计机构
  24. </div>
  25. <a-form-model-item :label="null" prop="auditOrg">
  26. <!-- <sd-group-picker v-model="auditOrg" :single="true" :root-node="rootNode" /> -->
  27. <audit-group-picker
  28. v-model="auditOrg"
  29. :single="true"
  30. :read-only="false"
  31. :root-node="rootNode"
  32. />
  33. </a-form-model-item>
  34. </div>
  35. <!--
  36. 需求确认去掉关闭按钮
  37. <div :class="$style.close" @click="closeWindow">
  38. <a-icon type="close"></a-icon>
  39. </div> -->
  40. </div>
  41. </a-layout-header>
  42. <a-layout-content :class="$style.contentDiv">
  43. <!-- 上部div -->
  44. <iam-audit-dsc-top-div
  45. :class="$style.topDiv"
  46. :unid-id="auditOrg"
  47. :plan-year="planYear"
  48. ></iam-audit-dsc-top-div>
  49. <!-- 中部div -->
  50. <iam-audit-dsc-center-div
  51. :unid-id="auditOrg"
  52. :plan-year="planYear"
  53. :class="$style.centerDiv"
  54. ></iam-audit-dsc-center-div>
  55. <!-- 底部div -->
  56. <iam-audit-dsc-bottom-div
  57. :key="key"
  58. :unid-id="auditOrg"
  59. :plan-year="planYear"
  60. :class="$style.bottomDiv"
  61. ></iam-audit-dsc-bottom-div>
  62. </a-layout-content>
  63. </a-layout>
  64. </template>
  65. <script>
  66. import auditGroupPicker from '@product/iam/components/picker/audit-group-picker.vue'
  67. import axios from '@/common/services/axios-instance'
  68. import { getUserInfo } from '@/common/store-mixin'
  69. import iamAuditDscService from './components/iam-audit-dsc-service'
  70. import components from './_import-components/iam-audit-dsc-main-import'
  71. export default {
  72. name: 'IamAuditDscMain',
  73. metaInfo: {
  74. title: '决策支持中心',
  75. },
  76. components: {
  77. auditGroupPicker,
  78. ...components,
  79. },
  80. data() {
  81. return {
  82. yearOpen: false,
  83. key: 0,
  84. auditOrg: [],
  85. options: [],
  86. planYear: undefined,
  87. rootNode: {},
  88. }
  89. },
  90. watch: {
  91. // 监听数据,更新之后需要刷新图标
  92. planYear() {
  93. this.key++
  94. },
  95. auditOrg() {
  96. this.key++
  97. },
  98. },
  99. created() {
  100. // this.options = []
  101. // let curYear = new Date().getFullYear() - 5
  102. // for (let i = 0; i < 10; i++) {
  103. // this.options.push({
  104. // value: curYear + '',
  105. // label: curYear,
  106. // })
  107. // curYear++
  108. // }
  109. let userInfo = getUserInfo()
  110. const params = {
  111. orgId: userInfo.deptId,
  112. }
  113. // iamAuditDscService.getUserInfo(params).then((res) => {
  114. // this.id = res.data
  115. // const deptCode = userInfo.deptId.toString()
  116. // const deptName = userInfo.deptName
  117. // this.rootNode = { code: deptCode, name: deptName, id: this.id }
  118. // })
  119. axios({
  120. url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup',
  121. method: 'get',
  122. }).then((res) => {
  123. userInfo = res.data
  124. params.orgId = res.data.id
  125. axios({
  126. url: 'api/xcoa-mobile/v1/iamorg/findIamOrgId',
  127. method: 'post',
  128. params,
  129. }).then((res) => {
  130. this.id = res.data
  131. const deptCode = userInfo.id.toString()
  132. const deptName = userInfo.name
  133. this.rootNode = { code: deptCode, name: deptName, id: this.id }
  134. // bug22421 默认统计机构设置到本机构及一下
  135. const currNoe = {
  136. id: userInfo.id,
  137. // oldId: 0,
  138. text: deptName,
  139. name: deptName,
  140. title: deptName,
  141. code: deptCode,
  142. leaf: false,
  143. isleaf: false,
  144. props: {},
  145. children: [],
  146. differentDisplay: false,
  147. expandable: true,
  148. type: 'Group',
  149. }
  150. this.auditOrg.push(currNoe)
  151. })
  152. })
  153. // 22738 年份默认为当年
  154. this.planYear = new Date().getFullYear().toString()
  155. },
  156. methods: {
  157. /**
  158. * 关闭当前窗口
  159. */
  160. closeWindow() {
  161. window.opener = window
  162. const win = window.open('', '_self')
  163. win.close()
  164. },
  165. holderClick() {
  166. document.querySelector('.group_iam-audit-dsc-main_product .ant-select').click()
  167. },
  168. /**
  169. * 打开或关闭年度选择
  170. */
  171. openChange(open) {
  172. this.yearOpen = open
  173. },
  174. /**
  175. * 年份选择时,关闭弹窗
  176. */
  177. panelChange(value) {
  178. this.planYear = value.format('YYYY')
  179. this.yearOpen = !this.yearOpen
  180. },
  181. },
  182. }
  183. </script>
  184. <style module lang="scss">
  185. @use '@/common/design' as *;
  186. $header-height: 60px;
  187. .main-div {
  188. min-height: 100%;
  189. .header {
  190. display: flex;
  191. height: 60px;
  192. padding: 0 30px;
  193. font-size: 25px;
  194. line-height: 60px;
  195. color: #fff;
  196. background: #1489fc;
  197. .title {
  198. float: left;
  199. width: 50%;
  200. }
  201. .right-div {
  202. display: flex;
  203. justify-content: flex-end;
  204. width: 50%;
  205. :global(.ant-form-item-control) {
  206. :global(.ant-select) {
  207. width: 200px;
  208. margin-top: 11px;
  209. vertical-align: baseline;
  210. cursor: pointer;
  211. }
  212. :global(.ant-select-selection--multiple) {
  213. cursor: pointer;
  214. }
  215. :global(.ant-select-search__field) {
  216. display: none;
  217. }
  218. }
  219. .year {
  220. margin-right: 15px;
  221. .year-select {
  222. display: block;
  223. width: 120px;
  224. margin-top: 15px;
  225. :global(.ant-calendar-picker-input) {
  226. cursor: pointer;
  227. }
  228. }
  229. }
  230. .group {
  231. position: relative;
  232. .holder {
  233. position: absolute;
  234. left: 10px;
  235. z-index: 1;
  236. font-size: 16px;
  237. color: #bfbfbf;
  238. cursor: pointer;
  239. }
  240. :global(.ant-select-selection) {
  241. overflow-y: hidden;
  242. }
  243. }
  244. .close {
  245. margin-left: 15px;
  246. font-size: 22px;
  247. cursor: pointer;
  248. }
  249. }
  250. }
  251. .content-div {
  252. margin: 20px;
  253. }
  254. .top-div {
  255. background: transparent;
  256. }
  257. .center-div {
  258. margin-top: 20px;
  259. }
  260. .bottom-div {
  261. margin-top: 20px;
  262. }
  263. }
  264. </style>