risk-event-form.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  1. <template>
  2. <span>
  3. <audit-form-top-banner
  4. :handel-save-form="saveForm"
  5. :form-data="$route.query.mode"
  6. @handelSaveForm="saveForm"
  7. >
  8. <sd-detail-form
  9. ref="docform"
  10. page-id="risk/event/riskEvent"
  11. :record-id="this.$route.query.record ? parseInt(this.$route.query.record) : null"
  12. :read-only="$route.query.mode === 'VIEW'"
  13. :class="$style.form"
  14. @close="close(true)"
  15. @saved="saved"
  16. @sdFormReady="sdFormReady"
  17. >
  18. <template v-slot="{ model, fields }">
  19. <table
  20. ><tr
  21. ><td style="padding-left:5px;border:none">
  22. <audit-advanced-group
  23. :expand="expandA"
  24. :expand-str="'expandA'"
  25. :group-label="'基本信息'"
  26. tablestyle="''"
  27. @changedClick="changedClick"
  28. ></audit-advanced-group> </td></tr
  29. ></table>
  30. <table v-show="expandA">
  31. <colgroup>
  32. <col style="width: 15%;"/>
  33. <col style="width: 35%;"/>
  34. <col style="width: 15%;"/>
  35. <col style="width: 35%;"
  36. /></colgroup>
  37. <tr v-show="false"
  38. ><sd-form-item-td name="riskCategoryId"/> <sd-form-item-td name="auditOrgId"
  39. /></tr>
  40. <tr v-show="false"
  41. ><sd-form-item-td name="versionId" /><sd-form-item-td name="id" />
  42. </tr>
  43. <tr
  44. ><sd-form-item-td name="riskCategoryPath" :colspan="3" :label="'风险分类'">
  45. <a-input
  46. v-model="model.riskCategoryPath"
  47. style="width:calc(100% - 80px);"
  48. read-only
  49. />
  50. <span style="padding:5px">
  51. <a-button @click="showflpath">选择</a-button>
  52. </span>
  53. </sd-form-item-td></tr
  54. >
  55. <tr>
  56. <!-- 措施编号 -->
  57. <sd-form-item-td v-if="initParam(model)" name="eventCode" />
  58. <!-- 措施名称 -->
  59. <sd-form-item-td name="eventName"> </sd-form-item-td>
  60. </tr>
  61. <tr>
  62. <!-- 措施描述 -->
  63. <sd-form-item-td name="eventDesc" :colspan="3">
  64. <a-textarea v-model="model.eventDesc" :rows="3" />
  65. </sd-form-item-td>
  66. </tr>
  67. <tr>
  68. <sd-form-item-td
  69. name="riskSource"
  70. :input-props="{
  71. defaultValue: 'within',
  72. }"
  73. />
  74. <td class="ant-form-item-label ant-form-item-label">
  75. <label
  76. title="主管部门"
  77. :class="{
  78. ['ant-form-item-required']: $route.query.mode !== 'VIEW',
  79. }"
  80. >
  81. 主管部门
  82. </label>
  83. </td>
  84. <td class="ant-form-item-control-wrapper">
  85. <a-form-model
  86. v-if="$route.query.mode !== 'VIEW'"
  87. ref="recommendRuleForm"
  88. :rules="{
  89. competentDeptOpt: [
  90. {
  91. required: true,
  92. message: '请选择主管部门',
  93. trigger: ['change', 'blur'],
  94. },
  95. ],
  96. }"
  97. :model="model1"
  98. >
  99. <a-form-model-item prop="competentDeptOpt" :label="null">
  100. <sd-group-picker
  101. v-model="model1.competentDeptOpt"
  102. style="width:calc(100% - 120px)"
  103. @change="changecompetentDeptformodel"
  104. /><sd-group-picker
  105. v-show="false"
  106. v-model="model.competentDeptOpt"
  107. style="width:calc(100% - 120px)"
  108. @change="changecompetentDept"
  109. />
  110. <a-input v-show="false" v-model="model.competentDeptName" />
  111. <a-input v-show="false" v-model="model.competentDeptId" />
  112. <a-button
  113. type="primary"
  114. icon="plus"
  115. block
  116. style="width:110px;margin-left:5px;"
  117. @click="manualEntry('competentDeptOpt', 'docform')"
  118. >
  119. 手工添加
  120. </a-button>
  121. </a-form-model-item>
  122. </a-form-model>
  123. <div v-else>{{ model.competentDeptName }}</div>
  124. </td>
  125. <!-- <sd-form-item-td name="competentDeptOpt">
  126. <sd-group-picker
  127. v-model="model.competentDeptOpt"
  128. style="width:calc(100% - 120px)"
  129. @change="changecompetentDept"
  130. v-show="false"
  131. />
  132. <a-button
  133. type="primary"
  134. icon="plus"
  135. block
  136. @click="manualEntry('competentDeptOpt', 'docform')"
  137. style="width:110px;margin-left:5px;"
  138. >
  139. 手工添加
  140. </a-button>
  141. </sd-form-item-td> -->
  142. </tr>
  143. <tr
  144. ><sd-form-item-td name="riskReasonDesc" :colspan="3">
  145. <a-textarea v-model="model.riskReasonDesc" :rows="3" /> </sd-form-item-td
  146. ></tr>
  147. <tr>
  148. <sd-form-item-td
  149. name="riskLevel"
  150. component="a-select"
  151. :input-props="{
  152. disabled: true,
  153. }"
  154. />
  155. <sd-form-item-td
  156. name="status"
  157. component="a-select"
  158. :input-props="{
  159. disabled: true,
  160. defaultValue: 'enable',
  161. }"
  162. />
  163. </tr>
  164. <tr>
  165. <sd-form-item-td
  166. name="occurPossibility"
  167. component="a-select"
  168. :input-props="{
  169. disabled: true,
  170. }"
  171. />
  172. <sd-form-item-td
  173. name="riskImpactDegree"
  174. component="a-select"
  175. :input-props="{
  176. disabled: true,
  177. }"
  178. />
  179. </tr>
  180. <tr>
  181. <sd-form-item-td name="creationTime" />
  182. <sd-form-item-td name="creatorName" />
  183. </tr>
  184. <tr>
  185. <sd-form-item-td name="remark" :colspan="3">
  186. <a-textarea v-model="model.remark" :rows="3" />
  187. </sd-form-item-td>
  188. </tr> </table
  189. ><table>
  190. <tr
  191. ><td :colspan="4">
  192. <sd-form-item name="riskEventLawEntitys" :label="null">
  193. <template v-slot:read-and-edit="{ editable }">
  194. <audit-advanced-group
  195. :expand="expandC"
  196. :expand-str="'expandC'"
  197. :group-label="'相关法规制度'"
  198. @changedClick="changedClick"
  199. ><template>
  200. <template>
  201. <div :class="$style.wrapper">
  202. <div v-show="expandY && editable" :class="$style.btnselect">
  203. <a-button
  204. type="link"
  205. :class="$style.batchselect"
  206. @click="lawsRelSelect"
  207. >
  208. <a-icon type="check-circle" :theme="'filled'" />
  209. 选择
  210. </a-button>
  211. </div>
  212. </div>
  213. </template>
  214. <xm-child-table
  215. ref="docformlawlist"
  216. v-model="model.riskEventLawEntitys"
  217. :read-only="!editable"
  218. label=""
  219. :fields="
  220. [
  221. {
  222. caption: '序号',
  223. name: 'sortNum',
  224. dataType: 'number',
  225. attr: {},
  226. },
  227. ].concat(Array.from(fields.riskEventLawEntitys.attr.dync))
  228. "
  229. :columns="childlawlistColumns"
  230. :width="1200"
  231. :addfun="addfun"
  232. >
  233. </xm-child-table>
  234. </template>
  235. </audit-advanced-group>
  236. </template> </sd-form-item
  237. ></td>
  238. </tr>
  239. <tr
  240. ><td :colspan="4">
  241. <sd-form-item name="riskEventResultEntitys" :label="null">
  242. <template v-slot:read-and-edit="{ editable }">
  243. <audit-advanced-group
  244. :expand="expandY"
  245. :expand-str="'expandY'"
  246. :group-label="'关联风险评估结果'"
  247. @changedClick="changedClick"
  248. ><template>
  249. <xm-child-table
  250. ref="docformEventresult"
  251. v-model="model.riskEventResultEntitys"
  252. :read-only="true"
  253. label=""
  254. :fields="
  255. [
  256. {
  257. caption: '序号',
  258. name: 'sortNum',
  259. dataType: 'number',
  260. attr: {},
  261. },
  262. ].concat(Array.from(fields.riskEventResultEntitys.attr.dync))
  263. "
  264. :columns="childEventresultColumns"
  265. :width="1200"
  266. >
  267. <template v-slot:occurPossibility="{ field, text, index, value }">
  268. {{ text }}
  269. </template>
  270. <template v-slot:riskImpactDegree="{ field, text, index, value }">
  271. {{ text }}
  272. </template>
  273. <template v-slot:riskLevel="{ field, text, index, value }">
  274. {{ text }}
  275. </template>
  276. </xm-child-table></template
  277. >
  278. </audit-advanced-group>
  279. </template>
  280. </sd-form-item></td
  281. >
  282. </tr>
  283. <tr
  284. ><td :colspan="4">
  285. <sd-form-item name="riskEventCaseEntitys" :label="null">
  286. <template v-slot:read-and-edit="{ editable }">
  287. <audit-advanced-group
  288. :expand="expandX"
  289. :expand-str="'expandX'"
  290. :group-label="'关联风险案例'"
  291. @changedClick="changedClick"
  292. ><template>
  293. <xm-child-table
  294. ref="docformEventCase"
  295. v-model="model.riskEventCaseEntitys"
  296. :read-only="true"
  297. label=""
  298. :fields="
  299. [
  300. {
  301. caption: '序号',
  302. name: 'sortNum',
  303. dataType: 'number',
  304. attr: {},
  305. },
  306. ].concat(Array.from(fields.riskEventCaseEntitys.attr.dync))
  307. "
  308. :columns="childEventCaseColumns"
  309. :width="1200"
  310. >
  311. </xm-child-table>
  312. </template>
  313. </audit-advanced-group>
  314. </template> </sd-form-item
  315. ></td>
  316. </tr>
  317. <tr
  318. ><td :colspan="4">
  319. <sd-form-item name="riskEventLossEventEntitys" :label="null">
  320. <template v-slot:read-and-edit="{ editable }">
  321. <audit-advanced-group
  322. :expand="expandZ"
  323. :expand-str="'expandZ'"
  324. :group-label="'关联损失事件'"
  325. @changedClick="changedClick"
  326. ><template>
  327. <xm-child-table
  328. ref="docformEventLoss"
  329. v-model="model.riskEventLossEventEntitys"
  330. :read-only="true"
  331. label=""
  332. :fields="
  333. [
  334. {
  335. caption: '序号',
  336. name: 'sortNum',
  337. dataType: 'number',
  338. attr: {},
  339. },
  340. ].concat(Array.from(fields.riskEventLossEventEntitys.attr.dync))
  341. "
  342. :columns="childEventLossColumns"
  343. :width="1200"
  344. >
  345. </xm-child-table>
  346. </template>
  347. </audit-advanced-group>
  348. </template> </sd-form-item
  349. ></td>
  350. </tr>
  351. <tr
  352. ><td :colspan="4">
  353. <sd-form-item name="riskEventMeasureEntitys" :label="null">
  354. <template v-slot:read-and-edit="{ editable }">
  355. <audit-advanced-group
  356. :expand="expandW"
  357. :expand-str="'expandW'"
  358. :group-label="'关联内控措施'"
  359. @changedClick="changedClick"
  360. ><template>
  361. <xm-child-table
  362. ref="docformEventMeasure"
  363. v-model="model.riskEventMeasureEntitys"
  364. :read-only="true"
  365. label=""
  366. :fields="
  367. [
  368. {
  369. caption: '序号',
  370. name: 'sortNum',
  371. dataType: 'number',
  372. attr: {},
  373. },
  374. ].concat(Array.from(fields.riskEventMeasureEntitys.attr.dync))
  375. "
  376. :columns="childEventMeasureColumns"
  377. :width="1200"
  378. >
  379. <template v-slot:measureName="{ field, text, index, value }">
  380. <a :title="text" @click="openMeasure(value, index)">{{ text }}</a>
  381. </template>
  382. </xm-child-table>
  383. </template>
  384. </audit-advanced-group>
  385. </template>
  386. </sd-form-item></td
  387. >
  388. </tr>
  389. </table>
  390. <table>
  391. <tr>
  392. <td style="padding-left:5px;border:none">
  393. <audit-advanced-group
  394. :expand="change"
  395. :expand-str="'change'"
  396. :group-label="'风险事项_变更信息'"
  397. tablestyle="''"
  398. @changedClick="changedClick"
  399. ></audit-advanced-group>
  400. </td>
  401. </tr>
  402. </table>
  403. <table
  404. v-for="(bg, index) in fndeal(model.iamDetailFormModifyLogEntities)"
  405. v-show="change"
  406. :key="index"
  407. :class="$style.tablexm"
  408. >
  409. <colgroup>
  410. <col style="width: 20%;" />
  411. <col style="width: 30%;" />
  412. <col style="width: 20%;" />
  413. <col style="width: 30%;" />
  414. </colgroup>
  415. <tr>
  416. <td style="width:160px;text-align:right;vertical-align:top">{{ bg.creatorName }}</td
  417. ><td colspan="3"
  418. ><div
  419. style="
  420. width: 18px;margin-left:2px;
  421. font-size: 8px;
  422. color: #fff;
  423. text-align:center;
  424. background-color: lightgreen;
  425. border-radius: 100%;
  426. "
  427. >√</div
  428. ><div style="padding-left:10px;margin-left:9px;border-left:1px solid gray"
  429. >{{ bg.creationTime | sdDateFormat('YYYY-MM-DD HH:mm:ss') }}
  430. <table
  431. ><tr v-for="(x, index) in bg.xx" :key="index">
  432. <td style="width:150px">[{{ x.fieldDesc }}]</td
  433. ><td
  434. >{{ x.oldValue !== '' ? '"' : ''
  435. }}{{
  436. x.oldValue.indexOf('[') !== -1 ||
  437. x.oldValue.indexOf('{') !== -1 ||
  438. x.newValue.indexOf('[') !== -1 ||
  439. x.newValue.indexOf('{') !== -1
  440. ? ''
  441. : x.oldValue === 'null'
  442. ? ''
  443. : x.oldValue
  444. }}{{ x.oldValue !== '' ? '" 改为 ' : ''
  445. }}<span v-if="x.oldValue === ''" style="color:green">
  446. {{
  447. x.newValue.indexOf('[') !== -1 || x.newValue.indexOf('{') !== -1
  448. ? '修改动态表格数据'
  449. : x.newValue
  450. }}</span
  451. >
  452. <span v-else>{{
  453. x.newValue.indexOf('[') !== -1 || x.newValue.indexOf('{') !== -1
  454. ? '修改动态表格数据'
  455. : '"' + x.newValue + '"'
  456. }}</span>
  457. </td></tr
  458. ></table
  459. >
  460. </div></td
  461. >
  462. </tr>
  463. </table>
  464. </template>
  465. </sd-detail-form>
  466. </audit-form-top-banner>
  467. <audit-matters-select-modal
  468. :visible="visible"
  469. :org-id="null"
  470. :show-selection="showSelectionlaw"
  471. @listSelected="listSelected"
  472. ></audit-matters-select-modal>
  473. <!-- 发现分类树 -->
  474. <a-modal
  475. :visible="catvisible"
  476. title="请选择"
  477. width="700px"
  478. :destroy-on-close="true"
  479. @ok="handlecatOk"
  480. @cancel="handlecatCancel"
  481. >
  482. <risk-category-tree
  483. ref="riskCategorytree"
  484. show-line
  485. top-node-text="风险库"
  486. :is-select-dep="true"
  487. manager-type="view"
  488. :classstyle="true"
  489. :history="true"
  490. :hisv="this.$route.query.versionId ? this.$route.query.versionId : this.versionId"
  491. :hisorg="this.$route.query.versionId ? this.$route.query.orgId : this.orgId"
  492. :hisorgn="this.$route.query.orgName ? this.$route.query.orgName : this.orgName"
  493. @treeSelect="treeSelect"
  494. />
  495. </a-modal>
  496. <a-modal v-model="ModalVisible" title="手动录入" @ok="ModalHandleOk">
  497. <a-form-model ref="ModalForm" :model="ModalForm">
  498. <a-form-model-item label="主管部门" prop="orgName">
  499. <a-input v-model="ModalForm.orgName" />
  500. </a-form-model-item>
  501. </a-form-model>
  502. </a-modal>
  503. </span>
  504. </template>
  505. <script>
  506. import { Modal, Message } from 'ant-design-vue'
  507. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  508. import debounce from 'lodash.debounce'
  509. import axios from '@/common/services/axios-instance'
  510. import riskDeptSgtxMixins from '@product/iam/components/risk-dept-sgtx-mixins.vue'
  511. import auditFormTopBanner from '../../../components/audit-form-top-banner'
  512. import auditAdvancedGroup from '../../../components/audit-advanced-group.vue'
  513. import auditAdvancedGroupMixins from '../../../components/audit-advanced-group-mixins'
  514. import auditMattersSelectModal from '../../../audit/matters/audit-matters-select-modal.vue'
  515. import RiskService from '../risk-service'
  516. import riskCategoryTree from '../category/risk-category-tree'
  517. import components from './_import-components/risk-event-form-import'
  518. export default {
  519. name: 'RiskEventForm',
  520. metaInfo: {
  521. title: '风险措施',
  522. },
  523. components: {
  524. ...components,
  525. auditFormTopBanner,
  526. auditAdvancedGroup,
  527. auditMattersSelectModal,
  528. riskCategoryTree,
  529. },
  530. mixins: [auditAdvancedGroupMixins, riskDeptSgtxMixins],
  531. data() {
  532. return {
  533. change: true,
  534. catvisible: false,
  535. visible: false,
  536. expandA: true,
  537. expandC: true,
  538. mode: null,
  539. childlawlistColumns: [
  540. {
  541. title: '序号',
  542. dataIndex: 'sortNum',
  543. width: '80px',
  544. customRender: (text, record, index) => `${index + 1}`,
  545. },
  546. { dataIndex: 'id', sdHidden: true },
  547. { dataIndex: 'parentId', sdHidden: true },
  548. { dataIndex: 'title', width: '40%' },
  549. { dataIndex: 'docNum', width: '100px' },
  550. { dataIndex: 'clauses' },
  551. { dataIndex: 'versionId', sdHidden: true },
  552. ],
  553. expandY: true,
  554. childEventresultColumns: [
  555. {
  556. title: '序号',
  557. dataIndex: 'sortNum',
  558. width: '80px',
  559. customRender: (text, record, index) => `${index + 1}`,
  560. },
  561. { dataIndex: 'id', sdHidden: true },
  562. { dataIndex: 'parentId', sdHidden: true },
  563. { dataIndex: 'year', width: '10%' },
  564. { dataIndex: 'estimateName', width: '10%' },
  565. {
  566. dataIndex: 'occurPossibility',
  567. width: '10%',
  568. scopedSlots: { customRender: 'occurPossibility' },
  569. },
  570. { dataIndex: 'riskImpactDegree', scopedSlots: { customRender: 'riskImpactDegree' } },
  571. { dataIndex: 'riskLevel', scopedSlots: { customRender: 'riskLevel' } },
  572. { dataIndex: 'riskTrend' },
  573. { dataIndex: 'versionId', sdHidden: true },
  574. ],
  575. expandX: true,
  576. childEventCaseColumns: [
  577. {
  578. title: '序号',
  579. dataIndex: 'sortNum',
  580. width: '80px',
  581. customRender: (text, record, index) => `${index + 1}`,
  582. },
  583. { dataIndex: 'id', sdHidden: true },
  584. { dataIndex: 'parentId', sdHidden: true },
  585. { dataIndex: 'caseName', width: '30%' },
  586. { dataIndex: 'caseType' },
  587. { dataIndex: 'year' },
  588. { dataIndex: 'versionId', sdHidden: true },
  589. ],
  590. expandZ: true,
  591. childEventLossColumns: [
  592. {
  593. title: '序号',
  594. dataIndex: 'sortNum',
  595. width: '140px',
  596. customRender: (text, record, index) => `${index + 1}`,
  597. },
  598. { dataIndex: 'id', sdHidden: true },
  599. { dataIndex: 'parentId', sdHidden: true },
  600. { dataIndex: 'year', width: '10%' },
  601. { dataIndex: 'lossEventName', width: '15%' },
  602. { dataIndex: 'lossEventType', width: '10%' },
  603. { dataIndex: 'lossEventNature' },
  604. { dataIndex: 'lossMoney', title: '损失金额(万元)' },
  605. { dataIndex: 'happenDate' },
  606. { dataIndex: 'involvedLitigation' },
  607. { dataIndex: 'versionId', sdHidden: true },
  608. ],
  609. expandW: true,
  610. childEventMeasureColumns: [
  611. {
  612. title: '序号',
  613. dataIndex: 'sortNum',
  614. width: '140px',
  615. customRender: (text, record, index) => `${index + 1}`,
  616. },
  617. { dataIndex: 'id', sdHidden: true },
  618. { dataIndex: 'parentId', sdHidden: true },
  619. { dataIndex: 'mtxPrcPath', width: '30%' },
  620. { dataIndex: 'measureName' },
  621. { dataIndex: 'measureCode', defaultSortOrder: 'ascend' },
  622. { dataIndex: 'controlLevel', width: '10%' },
  623. { dataIndex: 'controlType', width: '10%' },
  624. { dataIndex: 'versionId', sdHidden: true },
  625. { dataIndex: 'sourceId', sdHidden: true },
  626. ],
  627. versionId: null,
  628. orgId: null,
  629. orgName: '',
  630. selectlist: [],
  631. catpath: '',
  632. catId: null,
  633. flag: false,
  634. sortNum: null,
  635. model1: {
  636. competentDeptOpt: null,
  637. },
  638. }
  639. },
  640. mounted() {
  641. if (this.$route.query.versionId) {
  642. this.versionId = parseInt(this.$route.query.versionId)
  643. this.orgId = this.$route.query.orgId
  644. }
  645. },
  646. // 图文列表参数变化更新数据
  647. // watch: {
  648. // model1() {
  649. // console.log("---变动")
  650. // setTimeout(()=>{
  651. // this.$refs.docform.setFieldValue("competentDeptOpt",this.model1.competentDeptOpt)
  652. // },500)
  653. // },
  654. // },
  655. methods: {
  656. openMeasure(record, index) {
  657. const url = '/mtx-measure-form?record=' + record[index].sourceId+'&mode=VIEW'
  658. // 新页面要打开的路由地址
  659. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  660. if (refreshFlag) {
  661. this.refresh()
  662. }
  663. })
  664. },
  665. changecompetentDept(value) {
  666. this.model1.competentDeptOpt = value
  667. },
  668. changecompetentDeptformodel() {
  669. this.$refs.docform.setFieldValue('competentDeptOpt', this.model1.competentDeptOpt)
  670. },
  671. initParam(model) {
  672. if (!this.flag) {
  673. if (this.$route.query.versionId) {
  674. this.getpath(this.$route.query.catalogId).then(() => {
  675. this.$refs.docform.riskCategoryPath = this.catpath
  676. model.riskCategoryPath = this.catpath
  677. this.riskCategorId = this.$route.query.catalogId
  678. })
  679. } else {
  680. this.getpath(model.riskCategoryId).then(() => {
  681. this.$refs.docform.riskCategoryPath = this.catpath
  682. model.riskCategoryPath = this.catpath
  683. })
  684. this.versionId = model.versionId + ''
  685. this.orgId = model.auditOrgId + ''
  686. }
  687. if (model.riskEventLawEntitys) {
  688. model.riskEventLawEntitys.forEach((i) => {
  689. if (i.clauses === null) {
  690. i.clauses = ''
  691. }
  692. })
  693. }
  694. // 处理主管部门高级字段
  695. const opt = model.competentDeptOpt
  696. const name = model.competentDeptName
  697. const id = model.competentDeptId
  698. if (name !== undefined && id !== undefined && name !== null && id !== null) {
  699. const names = name.split(',')
  700. const ids = id.split(',')
  701. names.forEach((n, index) => {
  702. if (ids[index].indexOf('_sd') > -1) {
  703. const no = {
  704. type: 'GROUP',
  705. code: ids[index],
  706. name: n,
  707. }
  708. opt.splice(index, 0, no)
  709. }
  710. })
  711. this.model1.competentDeptOpt = opt
  712. model.competentDeptOpt = opt
  713. }
  714. this.flag = true
  715. }
  716. return true
  717. },
  718. getpath(id) {
  719. return new Promise((resolve, reject) => {
  720. RiskService.findupcatinfo(id).then((res) => {
  721. this.catpath = res.data
  722. resolve(res.data)
  723. })
  724. })
  725. },
  726. getsortNum(id) {
  727. return new Promise((resolve, reject) => {
  728. RiskService.fngetsortNum(id).then((res) => {
  729. this.sortNum = res
  730. resolve(res)
  731. })
  732. })
  733. },
  734. showflpath() {
  735. this.catvisible = !this.catvisible
  736. if (this.catvisible) {
  737. setTimeout(() => {
  738. this.$refs.riskCategorytree.initDeptList('')
  739. }, 1000)
  740. }
  741. },
  742. treeSelect(select, info) {
  743. const id = info.selectedNodes[0].data.props.id
  744. this.catpath = ''
  745. this.catId = null
  746. if (info.selectedNodes[0].data.props.props) {
  747. if (info.selectedNodes[0].data.props.props.isEnd === '1') {
  748. if (id !== -1) {
  749. this.getpath(id)
  750. this.catId = id
  751. } else {
  752. this.catpath = this.$route.query.orgName + '内控矩阵'
  753. this.catId = -1
  754. }
  755. } else {
  756. Modal.info({
  757. content: '请选择末级分类节点',
  758. })
  759. }
  760. }
  761. },
  762. handlecatOk() {
  763. if (this.catpath !== '') {
  764. this.$refs.docform.setFieldValue('riskCategoryPath', this.catpath)
  765. this.$refs.docform.setFieldValue('riskCategoryId', this.catId)
  766. this.showflpath()
  767. // this.findType = this.findcat.text
  768. this.catpath = ''
  769. this.catId = null
  770. } else {
  771. Modal.warning({
  772. title: '提示',
  773. content: '请选择末级分类节点!',
  774. })
  775. return false
  776. }
  777. },
  778. handlecatCancel() {
  779. this.showflpath()
  780. },
  781. showSelectionlaw(record) {
  782. this.selectlist = this.$refs.docformlawlist.value
  783. if (this.selectlist.length === 0) {
  784. return true
  785. } else if (
  786. this.selectlist.findIndex(
  787. (i) => i.title + '-' + i.docNum === record.docTitle + '-' + record.dispatchWord
  788. ) > -1
  789. ) {
  790. return false
  791. } else {
  792. return true
  793. }
  794. },
  795. addfun(data) {
  796. if (!this.versionId) {
  797. this.versionId = this.$refs.docform.getFieldValue('versionId')
  798. this.orgId = this.$refs.docform.getFieldValue('auditOrgId')
  799. }
  800. data.versionId = this.versionId
  801. return data
  802. },
  803. // 页面加载完成后
  804. sdFormReady() {
  805. this.mode = this.$refs.docform.formData.mode
  806. if (!this.mode) {
  807. this.mode = this.$route.query.mode
  808. }
  809. },
  810. close(flag) {
  811. crossWindowWatcher.notifyChange(this.$route.fullPath, flag)
  812. window.close()
  813. },
  814. saved() {
  815. Message.success({ content: '保存成功!' }, 1).then(() => {
  816. debugger
  817. this.close(true)
  818. })
  819. },
  820. // 保存
  821. saveForm() {
  822. this.$refs.docform
  823. .validateFields()
  824. .then((res) => {
  825. this.$refs.recommendRuleForm.validate((valid) => {
  826. if (res && valid) {
  827. // 如果是新文档,则赋值
  828. // 校验编号唯一
  829. const eventCode = this.$refs.docform.getFieldValue('eventCode')
  830. const id = this.$refs.docform.getFieldValue('id')
  831. ? this.$refs.docform.getFieldValue('id')
  832. : -1
  833. const versionId = parseInt(this.versionId)
  834. const auditOrgId = parseInt(this.orgId)
  835. RiskService.checkMeasurecode(eventCode, id, versionId, auditOrgId).then((res) => {
  836. if (!res.data) {
  837. Message.info('编号重复请重新填写', 1)
  838. } else {
  839. let versionId = null
  840. if (this.$route.query.record === null || this.$route.query.record === undefined) {
  841. const catalogId = this.$route.query.catalogId
  842. const orgId = this.$route.query.orgId
  843. versionId = parseInt(this.$route.query.versionId)
  844. // 没有值才赋值,如果有值说明是手动选择的不需要赋值,否则会覆盖掉
  845. if (!this.$refs.docform.getFieldValue('riskCategoryId')) {
  846. this.$refs.docform.setFieldValue('riskCategoryId', parseInt(catalogId))
  847. }
  848. this.$refs.docform.setFieldValue('auditOrgId', parseInt(orgId))
  849. this.$refs.docform.setFieldValue('versionId', versionId)
  850. } else {
  851. versionId = this.$refs.docform.getFieldValue('versionId')
  852. }
  853. // 处理icMtxMeasureEventList 中的主管部门高级字段
  854. const competentDeptOpt = this.$refs.docform.getFieldValue('competentDeptOpt')
  855. let names = ''
  856. let ids = ''
  857. const nopt = []
  858. competentDeptOpt.forEach((o) => {
  859. names = names + o.name + ','
  860. ids = ids + o.code + ','
  861. if (o.code.indexOf('_sd') === -1) {
  862. nopt.push(o)
  863. }
  864. })
  865. if (names.substring(names.length - 1, names.length) === ',')
  866. names = names.substring(0, names.length - 1)
  867. if (ids.substring(ids.length - 1, ids.length) === ',')
  868. ids = ids.substring(0, ids.length - 1)
  869. this.$refs.docform.setFieldValue('competentDeptOpt', nopt)
  870. this.$refs.docform.setFieldValue('competentDeptName', names)
  871. this.$refs.docform.setFieldValue('competentDeptId', ids)
  872. // 轮询所有子表赋值versionId
  873. this.$refs.docform.saveBtnClick()
  874. }
  875. })
  876. } else {
  877. return false
  878. }
  879. })
  880. })
  881. .catch(() => {
  882. this.$refs.recommendRuleForm.validate((valid) => {})
  883. })
  884. },
  885. measureRelSelect() {},
  886. fndeal(obj) {
  887. const newobj = []
  888. if (obj !== undefined) {
  889. obj.forEach((item) => {
  890. if (
  891. [
  892. 'riskEventLawEntitys',
  893. 'riskEventLossEventEntitys',
  894. 'riskEventResultEntitys',
  895. 'riskEventMeasureEntitys',
  896. 'riskEventCaseEntitys',
  897. 'iamDetailFormModifyLogEntities',
  898. 'riskCategoryId',
  899. ].indexOf(item.fieldName) < 0
  900. ) {
  901. if (
  902. item.newValue !== '' &&
  903. item.oldValue !== null &&
  904. item.fieldDesc.indexOf('ID') === -1 &&
  905. item.fieldDesc !== '主管部门'
  906. ) {
  907. item.xt = item.creatorName + '_' + item.creationTime
  908. if (item.oldValue.trim() === null || item.oldValue.trim() === 'null')
  909. item.oldValue = ''
  910. const i = newobj.find((n) => n.xt === item.xt)
  911. if (i !== undefined) {
  912. i.xx.push({
  913. fieldDesc: item.fieldDesc,
  914. fieldName: item.fieldName,
  915. newValue: item.newValue,
  916. oldValue: item.oldValue,
  917. })
  918. } else {
  919. item.xx = [
  920. {
  921. fieldDesc: item.fieldDesc,
  922. fieldName: item.fieldName,
  923. newValue: item.newValue,
  924. oldValue: item.oldValue,
  925. },
  926. ]
  927. newobj.push(item)
  928. }
  929. }
  930. }
  931. })
  932. }
  933. return newobj
  934. },
  935. // 选择法律制度
  936. lawsRelSelect() {
  937. // 选择事项分类
  938. this.visible = true
  939. },
  940. listSelected(keys, keyinfos) {
  941. let iamAuditLaws = []
  942. if (this.$refs.docform.getFieldValue('riskEventLawEntitys')) {
  943. iamAuditLaws = this.$refs.docform.getFieldValue('riskEventLawEntitys')
  944. }
  945. keyinfos.forEach((element) => {
  946. const mmc = {}
  947. mmc.title = element.docTitle
  948. mmc.docNum = element.dispatchWord ? element.dispatchWord : ''
  949. mmc.versionId = this.versionId
  950. mmc.clauses = ''
  951. iamAuditLaws.push(mmc)
  952. })
  953. this.visible = false
  954. this.$refs.docform.setFieldValue('riskEventLawEntitys', iamAuditLaws)
  955. },
  956. },
  957. }
  958. </script>
  959. <style module lang="scss">
  960. @use '@/common/design' as *;
  961. @import '@/webflow/sd-flow-form.scss';
  962. .btnselect {
  963. position: relative;
  964. top: 4px;
  965. right: 200px;
  966. float: right;
  967. .batchselect {
  968. z-index: 100;
  969. margin-left: 10px;
  970. }
  971. }
  972. .tablexm tr td {
  973. border: none !important;
  974. }
  975. </style>