risk-loss-event-form.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <template>
  2. <div>
  3. <sd-webflow
  4. ref="flow"
  5. :removed-tabs="['sdRelatedDoc']"
  6. @actionBtnClick="actionBtnClick"
  7. @saveproject="saveproject"
  8. @afterDispatch="afterDispatch"
  9. >
  10. <template v-slot:form="{ model, fields, FlowData }">
  11. <table>
  12. <tr>
  13. <td style="border: none">
  14. <audit-advanced-group
  15. :expand="Expand"
  16. :expand-str="'Expand'"
  17. :group-label="'基本信息'"
  18. tablestyle="''"
  19. @changedClick="changedClick"
  20. ></audit-advanced-group>
  21. </td>
  22. </tr>
  23. </table>
  24. <table v-show="Expand">
  25. <tr v-show="false">
  26. <!-- ID -->
  27. <sd-form-item-td name="id" />
  28. <!-- 随机ID -->
  29. <!-- <sd-form-item-td name="riskDutiesId" /> -->
  30. </tr>
  31. <tr>
  32. <!-- 发起日期 -->
  33. <sd-form-item-td name="happenTime" />
  34. <!-- 事件编号 -->
  35. <sd-form-item-td name="eventCode">
  36. <template v-slot:read-and-edit="{ editable }">
  37. <a-input
  38. v-if="editable"
  39. v-model="model.eventCode"
  40. placeholder="系统自动"
  41. read-only
  42. ></a-input>
  43. <span v-else>{{ model.eventCode }}</span>
  44. </template>
  45. </sd-form-item-td>
  46. </tr>
  47. <tr>
  48. <!-- 事件名称 -->
  49. <sd-form-item-td name="eventName" />
  50. <!-- 事件类型 -->
  51. <sd-form-item-td name="eventType" />
  52. </tr>
  53. <tr>
  54. <!-- 事件性质 -->
  55. <sd-form-item-td name="eventNature" />
  56. </tr>
  57. <tr>
  58. <!-- 事件描述 -->
  59. <sd-form-item-td name="eventDesc" :colspan="3">
  60. <a-textarea v-model="model.eventDesc" :rows="3" />
  61. </sd-form-item-td>
  62. </tr>
  63. <tr>
  64. <!-- 是否重大风险事件 -->
  65. <sd-form-item-td name="isMajorEvent" :input-props="{ defaultValue: '02' }" />
  66. <!-- 损失金额(万元) -->
  67. <sd-form-item-td name="lossAmount" />
  68. </tr>
  69. <tr>
  70. <!-- 责任单位/部门 -->
  71. <sd-form-item-td
  72. name="responsibleDeptOpt"
  73. :label="'责任单位/部门'"
  74. @change="changedept"
  75. />
  76. <!-- 事件责任人 -->
  77. <sd-form-item-td name="responsibleUserOpt" />
  78. </tr>
  79. <tr v-show="false"><sd-form-item-td name="responsibleDeptName"/></tr>
  80. <tr>
  81. <!-- 是否涉诉 -->
  82. <sd-form-item-td name="isLitigation" :input-props="{ defaultValue: '02' }" />
  83. <!-- 是否涉外 -->
  84. <sd-form-item-td name="isOutside" :input-props="{ defaultValue: '02' }" />
  85. </tr>
  86. <tr>
  87. <!-- 处置进展 -->
  88. <sd-form-item-td name="disposalProgress" />
  89. </tr>
  90. <tr>
  91. <!-- 当前情况描述 -->
  92. <sd-form-item-td name="situationDesc" :colspan="3">
  93. <a-textarea v-model="model.situationDesc" :rows="3" />
  94. </sd-form-item-td>
  95. </tr>
  96. <tr>
  97. <!-- 应对措施 -->
  98. <sd-form-item-td name="countermeasures" :colspan="3">
  99. <a-textarea v-model="model.countermeasures" :rows="3" />
  100. </sd-form-item-td>
  101. </tr>
  102. <tr>
  103. <!-- 填报单位 -->
  104. <sd-form-item-td name="fillingUnitName" :label="'填报单位'">{{
  105. model.fillingUnitName ? model.fillingUnitName : fillingUnitName
  106. }}</sd-form-item-td>
  107. <!-- 填报人员 -->
  108. <sd-form-item-td name="creatorName" />
  109. </tr>
  110. <tr>
  111. <!-- 填报日期 -->
  112. <sd-form-item-td name="creationTime" />
  113. </tr>
  114. <tr v-show="false">
  115. <sd-form-item-td name="fillingUnitId" />
  116. </tr>
  117. <tr v-show="initData(model)">
  118. <!-- 附件 -->
  119. <sd-form-item-td name="attachment" :colspan="3">
  120. <template v-slot:read-and-edit="{ editable }">
  121. <sd-attachment
  122. v-model="model.attachment"
  123. :group-id="JSON.parse(fields.attachment.value).value"
  124. :read-only="!editable"
  125. ></sd-attachment>
  126. </template>
  127. </sd-form-item-td>
  128. </tr>
  129. </table>
  130. <table>
  131. <tr
  132. ><td :colspan="4">
  133. <sd-form-item name="riskLossEvenItemList" :label="null">
  134. <template v-slot:read-and-edit="{ editable }">
  135. <audit-advanced-group
  136. :expand="glriskExpand"
  137. :expand-str="'glriskExpand'"
  138. :group-label="'关联风险事项'"
  139. @changedClick="changedClick"
  140. >
  141. <template>
  142. <template>
  143. <div :class="$style.wrapper">
  144. <div v-show="glriskExpand && editable" :class="$style.btnselect">
  145. <a-button type="link" :class="$style.batchselect" @click="fnopensel">
  146. <a-icon type="check-circle" :theme="'filled'" />
  147. 选择
  148. </a-button>
  149. </div>
  150. </div>
  151. </template>
  152. <xm-child-table
  153. ref="infoData"
  154. v-model="model.riskLossEvenItemList"
  155. :class="$style.deptPlanChild"
  156. :addbuttonvisiable="false"
  157. :label="null"
  158. :read-only="!editable"
  159. :fields="
  160. [
  161. {
  162. caption: '序号',
  163. name: 'sortNum',
  164. dataType: 'number',
  165. },
  166. ].concat(Array.from(fields.riskLossEvenItemList.attr.dync))
  167. "
  168. :columns="glriskcolumns"
  169. >
  170. <template v-slot:riskEventName="{ text }">
  171. {{ text }}
  172. </template>
  173. <template v-slot:riskEventCode="{ text }">
  174. {{ text }}
  175. </template>
  176. <template v-slot:riskCategoryPath="{ text }">
  177. {{ text }}
  178. </template>
  179. <template v-slot:riskVersion="{ text }">
  180. {{ text }}
  181. </template>
  182. </xm-child-table>
  183. </template>
  184. </audit-advanced-group>
  185. </template>
  186. </sd-form-item>
  187. </td>
  188. </tr>
  189. </table>
  190. <!-- 选择风险组件 -->
  191. <div v-show="false">
  192. <ic-measure-picker
  193. ref="riskeventsel"
  194. v-model="measureSelect"
  195. :version-id="versionId"
  196. :org-id="orgId"
  197. :org-name="orgName + '风险库'"
  198. :types="'FK'"
  199. :single="false"
  200. :read-only="false"
  201. @change="fnqd"
  202. ></ic-measure-picker>
  203. </div>
  204. </template>
  205. </sd-webflow>
  206. </div>
  207. </template>
  208. <script>
  209. import { Modal, message } from 'ant-design-vue'
  210. import { getUserInfo } from '@/common/store-mixin'
  211. import icMeasurePicker from '@product/iam/components/ic-picker/ic-measure-picker.vue'
  212. // import riskTasksService from '../risk-tasks-service'
  213. import auditAdvancedGroup from '../../components/audit-advanced-group.vue'
  214. import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  215. import riskService from '../risklib/risk-service'
  216. import riskTasksService from '../task/risk-tasks-service'
  217. import components from './_import-components/risk-loss-event-form-import'
  218. export default {
  219. name: 'RiskLossEventForm',
  220. metaInfo: {
  221. title: '风险损失事件',
  222. },
  223. components: {
  224. ...components,
  225. auditAdvancedGroup,
  226. icMeasurePicker,
  227. },
  228. mixins: [auditAdvancedGroupMixins],
  229. data() {
  230. return {
  231. Expand: true,
  232. glriskExpand: true,
  233. glriskcolumns: [
  234. {
  235. title: '序号',
  236. dataIndex: 'sortNum',
  237. width: '50px',
  238. customRender: (text, record, index) => `${index + 1}`,
  239. },
  240. { dataIndex: 'riskEventId', sdHidden: true },
  241. {
  242. dataIndex: 'riskEventName',
  243. title: '风险事项名称',
  244. width: '30%',
  245. },
  246. { dataIndex: 'riskEventCode', title: '风险事项编号', width: '30%' },
  247. {
  248. title: '风险分类',
  249. dataIndex: 'riskCategoryPath',
  250. },
  251. {
  252. title: '风险版本库编号',
  253. dataIndex: 'riskVersion',
  254. },
  255. ],
  256. orgId: null,
  257. versionId: null,
  258. orgName: '',
  259. flag: true,
  260. occurPossibility: [],
  261. riskImpactDegree: [],
  262. riskLevel: [],
  263. taskId: '',
  264. fxknprops: '',
  265. fxyxprops: '',
  266. fillingUnitName: '',
  267. fillingUnitId: '',
  268. responseCompletionStateoptions: [],
  269. measureSelect: [],
  270. measureSellist: [],
  271. initDept: [],
  272. }
  273. },
  274. created() {
  275. this.fillingUnitName = getUserInfo().deptName
  276. },
  277. methods: {
  278. initData(model) {
  279. if (this.flag) {
  280. riskService.getUserDept().then((res) => {
  281. this.fillingUnitName = res.data.name
  282. this.fillingUnitId = res.data.id
  283. this.initDept = res.data
  284. // const userInfo = getUserInfo()
  285. const userInfo = this.initDept
  286. let depId = model.fillingUnitId
  287. if (!depId) {
  288. depId = userInfo.id
  289. }
  290. this.orgName = model.fillingUnitName
  291. if (!this.orgName) {
  292. this.orgName = userInfo.name
  293. }
  294. // 获取机构ID
  295. riskTasksService.findIamOrgId(depId, 'riskLibraryVersion').then((res) => {
  296. if (res.data) {
  297. this.orgId = res.data.toString()
  298. this.fillingUnitId = res.data.toString()
  299. // 获取版本
  300. riskService.getversion(this.orgId).then((res) => {
  301. if (res.data.id) {
  302. this.versionId = res.data.id.toString()
  303. }
  304. })
  305. }
  306. })
  307. })
  308. this.measureSellist = model.riskLossEvenItemList
  309. this.flag = false
  310. }
  311. return true
  312. },
  313. changedept(value) {
  314. let deptname = ''
  315. if (value) {
  316. value.forEach((d) => {
  317. deptname += ',' + d.name
  318. })
  319. if (deptname !== '') deptname = deptname.substring(1, deptname.length)
  320. this.$refs.flow.setFieldValue('responsibleDeptName', deptname)
  321. }
  322. },
  323. fnopensel() {
  324. if (this.versionId) {
  325. this.$refs.riskeventsel.openPicker()
  326. } else {
  327. Modal.info({
  328. content: '请配置机构对应的风险库',
  329. })
  330. }
  331. },
  332. fnqd(data) {
  333. const ids = []
  334. let Events = []
  335. if (this.$refs.flow.getFieldValue('riskLossEvenItemList')) {
  336. Events = this.$refs.flow.getFieldValue('riskLossEvenItemList')
  337. }
  338. data.forEach((i) => {
  339. let id = i.id.toString()
  340. if (id.indexOf('1000') > -1) {
  341. id = id.substring(4, id.length)
  342. }
  343. ids.push(parseInt(id))
  344. })
  345. riskService.getFxlist(ids).then((data) => {
  346. if (data) {
  347. data.forEach((element) => {
  348. if (
  349. Events.findIndex(
  350. (i) => i.riskEventCode.toString() === element.eventCode.toString()
  351. ) === -1
  352. ) {
  353. const mmc = {}
  354. mmc.riskEventId = element.id
  355. mmc.lossEventId = null
  356. mmc.riskCategoryPath = element.riskCategoryPath
  357. mmc.riskEventName = element.eventName
  358. mmc.riskEventCode = element.eventCode
  359. mmc.riskVersion = element.versionCode
  360. Events.push(mmc)
  361. }
  362. })
  363. this.$refs.flow.setFieldValue('riskLossEvenItemList', Events)
  364. }
  365. })
  366. },
  367. actionBtnClick(evt, { button, FlowData }) {
  368. if (this.$refs.flow.getFieldValue('fillingUnitName') === undefined) {
  369. this.$refs.flow.setFieldValue('fillingUnitName', this.fillingUnitName)
  370. }
  371. if (this.$refs.flow.getFieldValue('fillingUnitId') === undefined) {
  372. this.$refs.flow.setFieldValue('fillingUnitId', this.fillingUnitId.toString())
  373. }
  374. this.$refs.flow.setFieldValue('title', this.$refs.flow.getFieldValue('eventName'))
  375. if (button.fakeId === 'save') {
  376. }
  377. },
  378. // 保存操作,记录标识位
  379. saveproject() {
  380. this.isSave = true
  381. },
  382. /**
  383. * 提交后事件
  384. */
  385. afterDispatch() {
  386. // 提交也认为是保存
  387. this.isSave = true
  388. },
  389. },
  390. }
  391. </script>
  392. <style module lang="scss">
  393. @use '@/common/design' as *;
  394. .btnselect {
  395. position: relative;
  396. top: 4px;
  397. right: 80px;
  398. float: right;
  399. .batchselect {
  400. z-index: 100;
  401. margin-left: 10px;
  402. }
  403. }
  404. </style>