audit-deptdatawarrant-from.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <div :class="$style.wrapHeight">
  3. <div :class="$style.rowHeight">
  4. <audit-maintain-dept-tree
  5. ref="auditMattersCatalogTree"
  6. :key="treekey"
  7. show-line
  8. top-node-text="审计模型"
  9. :is-select-dep="true"
  10. @treeSelect="treeSelect"
  11. @checkedKeys="getcheckedKeys"
  12. ></audit-maintain-dept-tree>
  13. <div :class="$style.rightcard">
  14. <a-card :class="$style.acard">
  15. <div style="float: left;margin-top: 15px;color: red;">
  16. <p>请注意:修改完下列动态数据后,需要点击保存,保存成功后才能生效!</p></div
  17. >
  18. <!-- 按钮区域 -->
  19. <div :class="$style.btndiv">
  20. <a-button type="primary" @click="saveForm">保存</a-button>
  21. </div>
  22. <!-- 数据授权页面 -->
  23. <audit-datasq-form
  24. ref="datasq"
  25. :record-id="frameRecordId"
  26. :read-only="formreadonly"
  27. ></audit-datasq-form>
  28. </a-card>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import { getUserInfo } from '@/common/store-mixin'
  35. import axios from '@/common/services/axios-instance'
  36. import { Modal, Message } from 'ant-design-vue'
  37. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  38. import auditDatasqForm from './audit-datasq-form.vue'
  39. import auditMaintainDeptTree from './audit-maintain-dept-tree'
  40. import auditMaintainService from './audit-maintain-service'
  41. import components from './_import-components/audit-deptdatawarrant-from-import'
  42. export default {
  43. name: 'AuditDeptdatawarrantFrom',
  44. metaInfo: {
  45. title: '数据授权',
  46. },
  47. components: {
  48. ...components,
  49. auditDatasqForm,
  50. auditMaintainDeptTree,
  51. },
  52. data() {
  53. return {
  54. treekey: 0,
  55. checkedKeys: [],
  56. formkey: 0,
  57. formreadonly: false, // 审计框架信息页面页面是否只读
  58. frameRecordId: null, // 审计框架信息页面recordId null为新建否则为查看
  59. }
  60. },
  61. methods: {
  62. getcheckedKeys(node, checkedNodes) {
  63. // this.checkedKeys = checkedNodes.map((node) => node.key)
  64. this.checkedKeys = checkedNodes.map((oneNode) => {
  65. return oneNode.data.props.props.orgId
  66. })
  67. },
  68. saveForm() {
  69. const udata = []
  70. const pdata = []
  71. let flag = true
  72. this.$refs.datasq.unitdata.forEach((item) => {
  73. if (item.id) {
  74. udata.push(item)
  75. } else {
  76. let sl = null
  77. let el = null
  78. if (!item.empowerType) {
  79. flag = false
  80. }
  81. if (item.empowerType === '0') {
  82. if (item.startDate !== undefined) {
  83. const s = new Date(item.startDate)
  84. const e = new Date(item.endDate)
  85. sl = s.getTime()
  86. el = e.getTime()
  87. }
  88. }
  89. udata.push({
  90. docType: 'date',
  91. empowerType: item.empowerType,
  92. startDate: sl,
  93. endDate: el,
  94. unitCode: item.unitCode,
  95. unitName: item.unitName,
  96. unitId: item.unitId,
  97. })
  98. }
  99. })
  100. this.$refs.datasq.personaldata.forEach((item) => {
  101. if (item.id) {
  102. pdata.push(item)
  103. } else {
  104. if (!item.empowerType) {
  105. flag = false
  106. }
  107. let sl = null
  108. let el = null
  109. if (item.empowerType === '0') {
  110. if (item.startDate !== undefined) {
  111. const s = new Date(item.startDate)
  112. const e = new Date(item.endDate)
  113. sl = s.getTime()
  114. el = e.getTime()
  115. }
  116. }
  117. pdata.push({
  118. docType: 'date',
  119. empowerType: item.empowerType,
  120. startDate: sl,
  121. endDate: el,
  122. userName: item.userName,
  123. userId: item.userId,
  124. userUnit: item.userUnit,
  125. })
  126. }
  127. })
  128. if (!flag) {
  129. Modal.warning({
  130. title: '提示',
  131. content: '请完善授权单位和授权人员表格信息!',
  132. })
  133. return false
  134. }
  135. if (this.checkedKeys.length === 0) {
  136. Modal.warning({
  137. title: '提示',
  138. content: '请勾选需要授权的单位!',
  139. })
  140. return false
  141. }
  142. const selectedRow = []
  143. this.checkedKeys.forEach((i) => selectedRow.push({ id: i }))
  144. const params = {
  145. iamModelMaintainEntitys: selectedRow,
  146. iamLicenseUnitEntitys: udata,
  147. iamLicensePeopleEntitys: pdata,
  148. }
  149. auditMaintainService.saveIamModelMaintain(params).then((res) => {
  150. if (res) {
  151. Message.success('保存成功', 1)
  152. }
  153. })
  154. },
  155. handleTreeSelect(groupCode) {
  156. if (groupCode.length > 0) {
  157. this.treeId = `${groupCode[0]}`
  158. }
  159. },
  160. changeRecord(node) {
  161. if (node) {
  162. this.selectedNode = node
  163. }
  164. },
  165. treeSelect(selectkey, info) {
  166. // 如果点击的是根节点
  167. // this.frameRecordId = info.node.dataRef.id.toString()
  168. this.frameRecordId = info.node.dataRef.props.orgId
  169. this.formkey++
  170. },
  171. },
  172. }
  173. </script>
  174. <style module lang="scss">
  175. @use '@/common/design' as *;
  176. .wrap-height {
  177. height: 100%;
  178. .row-height {
  179. display: flex;
  180. flex: auto;
  181. height: 100%;
  182. .rightcard {
  183. flex: 1;
  184. width: calc(100% - 20%);
  185. height: 100%;
  186. .acard {
  187. min-height: 100%;
  188. }
  189. :global(.ant-card-body) {
  190. padding: 0 20px;
  191. }
  192. }
  193. }
  194. }
  195. // 按钮样式
  196. .btndiv {
  197. float: right;
  198. // margin-bottom: 10px;
  199. margin: 10px;
  200. button {
  201. margin-left: 10px;
  202. }
  203. }
  204. .btnicon {
  205. margin-left: 3px !important;
  206. font-size: 12px;
  207. }
  208. // 右侧悬浮框样式
  209. .right-user-div {
  210. position: absolute;
  211. top: 150px;
  212. right: 0;
  213. z-index: 6;
  214. width: 366px;
  215. overflow: hidden;
  216. white-space: nowrap;
  217. user-select: none;
  218. user-select: none;
  219. user-select: none;
  220. background: #fff;
  221. transition: all 0.1s ease-out;
  222. }
  223. .left-div {
  224. float: left;
  225. width: 40px;
  226. div {
  227. height: 40px;
  228. padding-top: 5px;
  229. padding-left: 10px;
  230. font-size: 20px;
  231. color: #1890ff;
  232. cursor: pointer;
  233. background: #d5d5d5;
  234. }
  235. .first-div {
  236. color: #fff;
  237. background: #1890ff;
  238. border-radius: 3px 0 0 0;
  239. }
  240. .last-div {
  241. background: #efefef;
  242. border-radius: 0 0 0 3px;
  243. }
  244. }
  245. .right-div {
  246. margin-left: 40px;
  247. border: 1px solid #dbdbdb;
  248. .right-top-div {
  249. height: 40px;
  250. margin: 0 10px;
  251. line-height: 40px;
  252. border-bottom: 1px solid #e1e1e1;
  253. .user-title {
  254. float: left;
  255. }
  256. .user-btn {
  257. float: right;
  258. margin-right: 10px;
  259. font-size: 12px;
  260. color: #999;
  261. span {
  262. margin-left: 8px;
  263. }
  264. }
  265. }
  266. .right-bottom-div {
  267. width: 320px;
  268. // height: 105px;
  269. margin: 10px 5px 10px 5px;
  270. white-space: normal;
  271. .user-icon {
  272. display: inline-block;
  273. padding: 0 10px 10px 10px;
  274. margin: 0 9px 10px 9px;
  275. font-size: 13px;
  276. vertical-align: top;
  277. cursor: pointer;
  278. border-radius: 5px;
  279. .user-icon-icon {
  280. position: relative;
  281. margin: 20px 10px 5px 10px;
  282. text-align: center;
  283. .nums {
  284. position: absolute;
  285. top: -5px;
  286. right: -6px;
  287. z-index: 22;
  288. width: 19px;
  289. height: 19px;
  290. font-size: 1px;
  291. color: #fff;
  292. background: #f1b55a;
  293. border-radius: 15px;
  294. }
  295. }
  296. .user-name {
  297. width: 5em;
  298. text-align: center;
  299. }
  300. }
  301. .user-icon:hover {
  302. background: #ededed;
  303. }
  304. }
  305. }
  306. </style>