123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987 |
- <template>
- <span>
- <audit-form-top-banner
- :handel-save-form="saveForm"
- :form-data="$route.query.mode"
- @handelSaveForm="saveForm"
- >
- <sd-detail-form
- ref="docform"
- page-id="risk/event/riskEvent"
- :record-id="this.$route.query.record ? parseInt(this.$route.query.record) : null"
- :read-only="$route.query.mode === 'VIEW'"
- :class="$style.form"
- @close="close(true)"
- @saved="saved"
- @sdFormReady="sdFormReady"
- >
- <template v-slot="{ model, fields }">
- <table
- ><tr
- ><td style="padding-left:5px;border:none">
- <audit-advanced-group
- :expand="expandA"
- :expand-str="'expandA'"
- :group-label="'基本信息'"
- tablestyle="''"
- @changedClick="changedClick"
- ></audit-advanced-group> </td></tr
- ></table>
- <table v-show="expandA">
- <colgroup>
- <col style="width: 15%;"/>
- <col style="width: 35%;"/>
- <col style="width: 15%;"/>
- <col style="width: 35%;"
- /></colgroup>
- <tr v-show="false"
- ><sd-form-item-td name="riskCategoryId"/> <sd-form-item-td name="auditOrgId"
- /></tr>
- <tr v-show="false"
- ><sd-form-item-td name="versionId" /><sd-form-item-td name="id" />
- </tr>
- <tr
- ><sd-form-item-td name="riskCategoryPath" :colspan="3" :label="'风险分类'">
- <a-input
- v-model="model.riskCategoryPath"
- style="width:calc(100% - 80px);"
- read-only
- />
- <span style="padding:5px">
- <a-button @click="showflpath">选择</a-button>
- </span>
- </sd-form-item-td></tr
- >
- <tr>
- <!-- 措施编号 -->
- <sd-form-item-td v-if="initParam(model)" name="eventCode" />
- <!-- 措施名称 -->
- <sd-form-item-td name="eventName"> </sd-form-item-td>
- </tr>
- <tr>
- <!-- 措施描述 -->
- <sd-form-item-td name="eventDesc" :colspan="3">
- <a-textarea v-model="model.eventDesc" :rows="3" />
- </sd-form-item-td>
- </tr>
- <tr>
- <sd-form-item-td
- name="riskSource"
- :input-props="{
- defaultValue: 'within',
- }"
- />
- <td class="ant-form-item-label ant-form-item-label">
- <label
- title="主管部门"
- :class="{
- ['ant-form-item-required']: $route.query.mode !== 'VIEW',
- }"
- >
- 主管部门
- </label>
- </td>
- <td class="ant-form-item-control-wrapper">
- <a-form-model
- v-if="$route.query.mode !== 'VIEW'"
- ref="recommendRuleForm"
- :rules="{
- competentDeptOpt: [
- {
- required: true,
- message: '请选择主管部门',
- trigger: ['change', 'blur'],
- },
- ],
- }"
- :model="model1"
- >
- <a-form-model-item prop="competentDeptOpt" :label="null">
- <sd-group-picker
- v-model="model1.competentDeptOpt"
- style="width:calc(100% - 120px)"
- @change="changecompetentDeptformodel"
- /><sd-group-picker
- v-show="false"
- v-model="model.competentDeptOpt"
- style="width:calc(100% - 120px)"
- @change="changecompetentDept"
- />
- <a-input v-show="false" v-model="model.competentDeptName" />
- <a-input v-show="false" v-model="model.competentDeptId" />
- <a-button
- type="primary"
- icon="plus"
- block
- style="width:110px;margin-left:5px;"
- @click="manualEntry('competentDeptOpt', 'docform')"
- >
- 手工添加
- </a-button>
- </a-form-model-item>
- </a-form-model>
- <div v-else>{{ model.competentDeptName }}</div>
- </td>
- <!-- <sd-form-item-td name="competentDeptOpt">
- <sd-group-picker
- v-model="model.competentDeptOpt"
- style="width:calc(100% - 120px)"
- @change="changecompetentDept"
- v-show="false"
- />
- <a-button
- type="primary"
- icon="plus"
- block
- @click="manualEntry('competentDeptOpt', 'docform')"
- style="width:110px;margin-left:5px;"
- >
- 手工添加
- </a-button>
- </sd-form-item-td> -->
- </tr>
- <tr
- ><sd-form-item-td name="riskReasonDesc" :colspan="3">
- <a-textarea v-model="model.riskReasonDesc" :rows="3" /> </sd-form-item-td
- ></tr>
- <tr>
- <sd-form-item-td
- name="riskLevel"
- component="a-select"
- :input-props="{
- disabled: true,
- }"
- />
- <sd-form-item-td
- name="status"
- component="a-select"
- :input-props="{
- disabled: true,
- defaultValue: 'enable',
- }"
- />
- </tr>
- <tr>
- <sd-form-item-td
- name="occurPossibility"
- component="a-select"
- :input-props="{
- disabled: true,
- }"
- />
- <sd-form-item-td
- name="riskImpactDegree"
- component="a-select"
- :input-props="{
- disabled: true,
- }"
- />
- </tr>
- <tr>
- <sd-form-item-td name="creationTime" />
- <sd-form-item-td name="creatorName" />
- </tr>
- <tr>
- <sd-form-item-td name="remark" :colspan="3">
- <a-textarea v-model="model.remark" :rows="3" />
- </sd-form-item-td>
- </tr> </table
- ><table>
- <tr
- ><td :colspan="4">
- <sd-form-item name="riskEventLawEntitys" :label="null">
- <template v-slot:read-and-edit="{ editable }">
- <audit-advanced-group
- :expand="expandC"
- :expand-str="'expandC'"
- :group-label="'相关法规制度'"
- @changedClick="changedClick"
- ><template>
- <template>
- <div :class="$style.wrapper">
- <div v-show="expandY && editable" :class="$style.btnselect">
- <a-button
- type="link"
- :class="$style.batchselect"
- @click="lawsRelSelect"
- >
- <a-icon type="check-circle" :theme="'filled'" />
- 选择
- </a-button>
- </div>
- </div>
- </template>
- <xm-child-table
- ref="docformlawlist"
- v-model="model.riskEventLawEntitys"
- :read-only="!editable"
- label=""
- :fields="
- [
- {
- caption: '序号',
- name: 'sortNum',
- dataType: 'number',
- attr: {},
- },
- ].concat(Array.from(fields.riskEventLawEntitys.attr.dync))
- "
- :columns="childlawlistColumns"
- :width="1200"
- :addfun="addfun"
- >
- </xm-child-table>
- </template>
- </audit-advanced-group>
- </template> </sd-form-item
- ></td>
- </tr>
- <tr
- ><td :colspan="4">
- <sd-form-item name="riskEventResultEntitys" :label="null">
- <template v-slot:read-and-edit="{ editable }">
- <audit-advanced-group
- :expand="expandY"
- :expand-str="'expandY'"
- :group-label="'关联风险评估结果'"
- @changedClick="changedClick"
- ><template>
- <xm-child-table
- ref="docformEventresult"
- v-model="model.riskEventResultEntitys"
- :read-only="true"
- label=""
- :fields="
- [
- {
- caption: '序号',
- name: 'sortNum',
- dataType: 'number',
- attr: {},
- },
- ].concat(Array.from(fields.riskEventResultEntitys.attr.dync))
- "
- :columns="childEventresultColumns"
- :width="1200"
- >
- <template v-slot:occurPossibility="{ field, text, index, value }">
- {{ text }}
- </template>
- <template v-slot:riskImpactDegree="{ field, text, index, value }">
- {{ text }}
- </template>
- <template v-slot:riskLevel="{ field, text, index, value }">
- {{ text }}
- </template>
- </xm-child-table></template
- >
- </audit-advanced-group>
- </template>
- </sd-form-item></td
- >
- </tr>
- <tr
- ><td :colspan="4">
- <sd-form-item name="riskEventCaseEntitys" :label="null">
- <template v-slot:read-and-edit="{ editable }">
- <audit-advanced-group
- :expand="expandX"
- :expand-str="'expandX'"
- :group-label="'关联风险案例'"
- @changedClick="changedClick"
- ><template>
- <xm-child-table
- ref="docformEventCase"
- v-model="model.riskEventCaseEntitys"
- :read-only="true"
- label=""
- :fields="
- [
- {
- caption: '序号',
- name: 'sortNum',
- dataType: 'number',
- attr: {},
- },
- ].concat(Array.from(fields.riskEventCaseEntitys.attr.dync))
- "
- :columns="childEventCaseColumns"
- :width="1200"
- >
- </xm-child-table>
- </template>
- </audit-advanced-group>
- </template> </sd-form-item
- ></td>
- </tr>
- <tr
- ><td :colspan="4">
- <sd-form-item name="riskEventLossEventEntitys" :label="null">
- <template v-slot:read-and-edit="{ editable }">
- <audit-advanced-group
- :expand="expandZ"
- :expand-str="'expandZ'"
- :group-label="'关联损失事件'"
- @changedClick="changedClick"
- ><template>
- <xm-child-table
- ref="docformEventLoss"
- v-model="model.riskEventLossEventEntitys"
- :read-only="true"
- label=""
- :fields="
- [
- {
- caption: '序号',
- name: 'sortNum',
- dataType: 'number',
- attr: {},
- },
- ].concat(Array.from(fields.riskEventLossEventEntitys.attr.dync))
- "
- :columns="childEventLossColumns"
- :width="1200"
- >
- </xm-child-table>
- </template>
- </audit-advanced-group>
- </template> </sd-form-item
- ></td>
- </tr>
- <tr
- ><td :colspan="4">
- <sd-form-item name="riskEventMeasureEntitys" :label="null">
- <template v-slot:read-and-edit="{ editable }">
- <audit-advanced-group
- :expand="expandW"
- :expand-str="'expandW'"
- :group-label="'关联内控措施'"
- @changedClick="changedClick"
- ><template>
- <xm-child-table
- ref="docformEventMeasure"
- v-model="model.riskEventMeasureEntitys"
- :read-only="true"
- label=""
- :fields="
- [
- {
- caption: '序号',
- name: 'sortNum',
- dataType: 'number',
- attr: {},
- },
- ].concat(Array.from(fields.riskEventMeasureEntitys.attr.dync))
- "
- :columns="childEventMeasureColumns"
- :width="1200"
- >
- <template v-slot:measureName="{ field, text, index, value }">
- <a :title="text" @click="openMeasure(value, index)">{{ text }}</a>
- </template>
- </xm-child-table>
- </template>
- </audit-advanced-group>
- </template>
- </sd-form-item></td
- >
- </tr>
- </table>
- <table>
- <tr>
- <td style="padding-left:5px;border:none">
- <audit-advanced-group
- :expand="change"
- :expand-str="'change'"
- :group-label="'风险事项_变更信息'"
- tablestyle="''"
- @changedClick="changedClick"
- ></audit-advanced-group>
- </td>
- </tr>
- </table>
- <table
- v-for="(bg, index) in fndeal(model.iamDetailFormModifyLogEntities)"
- v-show="change"
- :key="index"
- :class="$style.tablexm"
- >
- <colgroup>
- <col style="width: 20%;" />
- <col style="width: 30%;" />
- <col style="width: 20%;" />
- <col style="width: 30%;" />
- </colgroup>
- <tr>
- <td style="width:160px;text-align:right;vertical-align:top">{{ bg.creatorName }}</td
- ><td colspan="3"
- ><div
- style="
- width: 18px;margin-left:2px;
- font-size: 8px;
- color: #fff;
- text-align:center;
- background-color: lightgreen;
- border-radius: 100%;
- "
- >√</div
- ><div style="padding-left:10px;margin-left:9px;border-left:1px solid gray"
- >{{ bg.creationTime | sdDateFormat('YYYY-MM-DD HH:mm:ss') }}
- <table
- ><tr v-for="(x, index) in bg.xx" :key="index">
- <td style="width:150px">[{{ x.fieldDesc }}]</td
- ><td
- >{{ x.oldValue !== '' ? '"' : ''
- }}{{
- x.oldValue.indexOf('[') !== -1 ||
- x.oldValue.indexOf('{') !== -1 ||
- x.newValue.indexOf('[') !== -1 ||
- x.newValue.indexOf('{') !== -1
- ? ''
- : x.oldValue === 'null'
- ? ''
- : x.oldValue
- }}{{ x.oldValue !== '' ? '" 改为 ' : ''
- }}<span v-if="x.oldValue === ''" style="color:green">
- {{
- x.newValue.indexOf('[') !== -1 || x.newValue.indexOf('{') !== -1
- ? '修改动态表格数据'
- : x.newValue
- }}</span
- >
- <span v-else>{{
- x.newValue.indexOf('[') !== -1 || x.newValue.indexOf('{') !== -1
- ? '修改动态表格数据'
- : '"' + x.newValue + '"'
- }}</span>
- </td></tr
- ></table
- >
- </div></td
- >
- </tr>
- </table>
- </template>
- </sd-detail-form>
- </audit-form-top-banner>
- <audit-matters-select-modal
- :visible="visible"
- :org-id="null"
- :show-selection="showSelectionlaw"
- @listSelected="listSelected"
- ></audit-matters-select-modal>
- <!-- 发现分类树 -->
- <a-modal
- :visible="catvisible"
- title="请选择"
- width="700px"
- :destroy-on-close="true"
- @ok="handlecatOk"
- @cancel="handlecatCancel"
- >
- <risk-category-tree
- ref="riskCategorytree"
- show-line
- top-node-text="风险库"
- :is-select-dep="true"
- manager-type="view"
- :classstyle="true"
- :history="true"
- :hisv="this.$route.query.versionId ? this.$route.query.versionId : this.versionId"
- :hisorg="this.$route.query.versionId ? this.$route.query.orgId : this.orgId"
- :hisorgn="this.$route.query.orgName ? this.$route.query.orgName : this.orgName"
- @treeSelect="treeSelect"
- />
- </a-modal>
- <a-modal v-model="ModalVisible" title="手动录入" @ok="ModalHandleOk">
- <a-form-model ref="ModalForm" :model="ModalForm">
- <a-form-model-item label="主管部门" prop="orgName">
- <a-input v-model="ModalForm.orgName" />
- </a-form-model-item>
- </a-form-model>
- </a-modal>
- </span>
- </template>
- <script>
- import { Modal, Message } from 'ant-design-vue'
- import crossWindowWatcher from '@/common/services/cross-window-watcher'
- import debounce from 'lodash.debounce'
- import axios from '@/common/services/axios-instance'
- import riskDeptSgtxMixins from '@product/iam/components/risk-dept-sgtx-mixins.vue'
- import auditFormTopBanner from '../../../components/audit-form-top-banner'
- import auditAdvancedGroup from '../../../components/audit-advanced-group.vue'
- import auditAdvancedGroupMixins from '../../../components/audit-advanced-group-mixins'
- import auditMattersSelectModal from '../../../audit/matters/audit-matters-select-modal.vue'
- import RiskService from '../risk-service'
- import riskCategoryTree from '../category/risk-category-tree'
- import components from './_import-components/risk-event-form-import'
- export default {
- name: 'RiskEventForm',
- metaInfo: {
- title: '风险措施',
- },
- components: {
- ...components,
- auditFormTopBanner,
- auditAdvancedGroup,
- auditMattersSelectModal,
- riskCategoryTree,
- },
- mixins: [auditAdvancedGroupMixins, riskDeptSgtxMixins],
- data() {
- return {
- change: true,
- catvisible: false,
- visible: false,
- expandA: true,
- expandC: true,
- mode: null,
- childlawlistColumns: [
- {
- title: '序号',
- dataIndex: 'sortNum',
- width: '80px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- { dataIndex: 'id', sdHidden: true },
- { dataIndex: 'parentId', sdHidden: true },
- { dataIndex: 'title', width: '40%' },
- { dataIndex: 'docNum', width: '100px' },
- { dataIndex: 'clauses' },
- { dataIndex: 'versionId', sdHidden: true },
- ],
- expandY: true,
- childEventresultColumns: [
- {
- title: '序号',
- dataIndex: 'sortNum',
- width: '80px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- { dataIndex: 'id', sdHidden: true },
- { dataIndex: 'parentId', sdHidden: true },
- { dataIndex: 'year', width: '10%' },
- { dataIndex: 'estimateName', width: '10%' },
- {
- dataIndex: 'occurPossibility',
- width: '10%',
- scopedSlots: { customRender: 'occurPossibility' },
- },
- { dataIndex: 'riskImpactDegree', scopedSlots: { customRender: 'riskImpactDegree' } },
- { dataIndex: 'riskLevel', scopedSlots: { customRender: 'riskLevel' } },
- { dataIndex: 'riskTrend' },
- { dataIndex: 'versionId', sdHidden: true },
- ],
- expandX: true,
- childEventCaseColumns: [
- {
- title: '序号',
- dataIndex: 'sortNum',
- width: '80px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- { dataIndex: 'id', sdHidden: true },
- { dataIndex: 'parentId', sdHidden: true },
- { dataIndex: 'caseName', width: '30%' },
- { dataIndex: 'caseType' },
- { dataIndex: 'year' },
- { dataIndex: 'versionId', sdHidden: true },
- ],
- expandZ: true,
- childEventLossColumns: [
- {
- title: '序号',
- dataIndex: 'sortNum',
- width: '140px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- { dataIndex: 'id', sdHidden: true },
- { dataIndex: 'parentId', sdHidden: true },
- { dataIndex: 'year', width: '10%' },
- { dataIndex: 'lossEventName', width: '15%' },
- { dataIndex: 'lossEventType', width: '10%' },
- { dataIndex: 'lossEventNature' },
- { dataIndex: 'lossMoney', title: '损失金额(万元)' },
- { dataIndex: 'happenDate' },
- { dataIndex: 'involvedLitigation' },
- { dataIndex: 'versionId', sdHidden: true },
- ],
- expandW: true,
- childEventMeasureColumns: [
- {
- title: '序号',
- dataIndex: 'sortNum',
- width: '140px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- { dataIndex: 'id', sdHidden: true },
- { dataIndex: 'parentId', sdHidden: true },
- { dataIndex: 'mtxPrcPath', width: '30%' },
- { dataIndex: 'measureName' },
- { dataIndex: 'measureCode', defaultSortOrder: 'ascend' },
- { dataIndex: 'controlLevel', width: '10%' },
- { dataIndex: 'controlType', width: '10%' },
- { dataIndex: 'versionId', sdHidden: true },
- { dataIndex: 'sourceId', sdHidden: true },
- ],
- versionId: null,
- orgId: null,
- orgName: '',
- selectlist: [],
- catpath: '',
- catId: null,
- flag: false,
- sortNum: null,
- model1: {
- competentDeptOpt: null,
- },
- }
- },
- mounted() {
- if (this.$route.query.versionId) {
- this.versionId = parseInt(this.$route.query.versionId)
- this.orgId = this.$route.query.orgId
- }
- },
- // 图文列表参数变化更新数据
- // watch: {
- // model1() {
- // console.log("---变动")
- // setTimeout(()=>{
- // this.$refs.docform.setFieldValue("competentDeptOpt",this.model1.competentDeptOpt)
- // },500)
- // },
- // },
- methods: {
- openMeasure(record, index) {
- const url = '/mtx-measure-form?record=' + record[index].sourceId+'&mode=VIEW'
- // 新页面要打开的路由地址
- crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
- if (refreshFlag) {
- this.refresh()
- }
- })
- },
- changecompetentDept(value) {
- this.model1.competentDeptOpt = value
- },
- changecompetentDeptformodel() {
- this.$refs.docform.setFieldValue('competentDeptOpt', this.model1.competentDeptOpt)
- },
- initParam(model) {
- if (!this.flag) {
- if (this.$route.query.versionId) {
- this.getpath(this.$route.query.catalogId).then(() => {
- this.$refs.docform.riskCategoryPath = this.catpath
- model.riskCategoryPath = this.catpath
- this.riskCategorId = this.$route.query.catalogId
- })
- } else {
- this.getpath(model.riskCategoryId).then(() => {
- this.$refs.docform.riskCategoryPath = this.catpath
- model.riskCategoryPath = this.catpath
- })
- this.versionId = model.versionId + ''
- this.orgId = model.auditOrgId + ''
- }
- if (model.riskEventLawEntitys) {
- model.riskEventLawEntitys.forEach((i) => {
- if (i.clauses === null) {
- i.clauses = ''
- }
- })
- }
- // 处理主管部门高级字段
- const opt = model.competentDeptOpt
- const name = model.competentDeptName
- const id = model.competentDeptId
- if (name !== undefined && id !== undefined && name !== null && id !== null) {
- const names = name.split(',')
- const ids = id.split(',')
- names.forEach((n, index) => {
- if (ids[index].indexOf('_sd') > -1) {
- const no = {
- type: 'GROUP',
- code: ids[index],
- name: n,
- }
- opt.splice(index, 0, no)
- }
- })
- this.model1.competentDeptOpt = opt
- model.competentDeptOpt = opt
- }
- this.flag = true
- }
- return true
- },
- getpath(id) {
- return new Promise((resolve, reject) => {
- RiskService.findupcatinfo(id).then((res) => {
- this.catpath = res.data
- resolve(res.data)
- })
- })
- },
- getsortNum(id) {
- return new Promise((resolve, reject) => {
- RiskService.fngetsortNum(id).then((res) => {
- this.sortNum = res
- resolve(res)
- })
- })
- },
- showflpath() {
- this.catvisible = !this.catvisible
- if (this.catvisible) {
- setTimeout(() => {
- this.$refs.riskCategorytree.initDeptList('')
- }, 1000)
- }
- },
- treeSelect(select, info) {
- const id = info.selectedNodes[0].data.props.id
- this.catpath = ''
- this.catId = null
- if (info.selectedNodes[0].data.props.props) {
- if (info.selectedNodes[0].data.props.props.isEnd === '1') {
- if (id !== -1) {
- this.getpath(id)
- this.catId = id
- } else {
- this.catpath = this.$route.query.orgName + '内控矩阵'
- this.catId = -1
- }
- } else {
- Modal.info({
- content: '请选择末级分类节点',
- })
- }
- }
- },
- handlecatOk() {
- if (this.catpath !== '') {
- this.$refs.docform.setFieldValue('riskCategoryPath', this.catpath)
- this.$refs.docform.setFieldValue('riskCategoryId', this.catId)
- this.showflpath()
- // this.findType = this.findcat.text
- this.catpath = ''
- this.catId = null
- } else {
- Modal.warning({
- title: '提示',
- content: '请选择末级分类节点!',
- })
- return false
- }
- },
- handlecatCancel() {
- this.showflpath()
- },
- showSelectionlaw(record) {
- this.selectlist = this.$refs.docformlawlist.value
- if (this.selectlist.length === 0) {
- return true
- } else if (
- this.selectlist.findIndex(
- (i) => i.title + '-' + i.docNum === record.docTitle + '-' + record.dispatchWord
- ) > -1
- ) {
- return false
- } else {
- return true
- }
- },
- addfun(data) {
- if (!this.versionId) {
- this.versionId = this.$refs.docform.getFieldValue('versionId')
- this.orgId = this.$refs.docform.getFieldValue('auditOrgId')
- }
- data.versionId = this.versionId
- return data
- },
- // 页面加载完成后
- sdFormReady() {
- this.mode = this.$refs.docform.formData.mode
- if (!this.mode) {
- this.mode = this.$route.query.mode
- }
- },
- close(flag) {
- crossWindowWatcher.notifyChange(this.$route.fullPath, flag)
- window.close()
- },
- saved() {
- Message.success({ content: '保存成功!' }, 1).then(() => {
- debugger
- this.close(true)
- })
- },
- // 保存
- saveForm() {
- this.$refs.docform
- .validateFields()
- .then((res) => {
- this.$refs.recommendRuleForm.validate((valid) => {
- if (res && valid) {
- // 如果是新文档,则赋值
- // 校验编号唯一
- const eventCode = this.$refs.docform.getFieldValue('eventCode')
- const id = this.$refs.docform.getFieldValue('id')
- ? this.$refs.docform.getFieldValue('id')
- : -1
- const versionId = parseInt(this.versionId)
- const auditOrgId = parseInt(this.orgId)
- RiskService.checkMeasurecode(eventCode, id, versionId, auditOrgId).then((res) => {
- if (!res.data) {
- Message.info('编号重复请重新填写', 1)
- } else {
- let versionId = null
- if (this.$route.query.record === null || this.$route.query.record === undefined) {
- const catalogId = this.$route.query.catalogId
- const orgId = this.$route.query.orgId
- versionId = parseInt(this.$route.query.versionId)
- // 没有值才赋值,如果有值说明是手动选择的不需要赋值,否则会覆盖掉
- if (!this.$refs.docform.getFieldValue('riskCategoryId')) {
- this.$refs.docform.setFieldValue('riskCategoryId', parseInt(catalogId))
- }
- this.$refs.docform.setFieldValue('auditOrgId', parseInt(orgId))
- this.$refs.docform.setFieldValue('versionId', versionId)
- } else {
- versionId = this.$refs.docform.getFieldValue('versionId')
- }
- // 处理icMtxMeasureEventList 中的主管部门高级字段
- const competentDeptOpt = this.$refs.docform.getFieldValue('competentDeptOpt')
- let names = ''
- let ids = ''
- const nopt = []
- competentDeptOpt.forEach((o) => {
- names = names + o.name + ','
- ids = ids + o.code + ','
- if (o.code.indexOf('_sd') === -1) {
- nopt.push(o)
- }
- })
- if (names.substring(names.length - 1, names.length) === ',')
- names = names.substring(0, names.length - 1)
- if (ids.substring(ids.length - 1, ids.length) === ',')
- ids = ids.substring(0, ids.length - 1)
- this.$refs.docform.setFieldValue('competentDeptOpt', nopt)
- this.$refs.docform.setFieldValue('competentDeptName', names)
- this.$refs.docform.setFieldValue('competentDeptId', ids)
- // 轮询所有子表赋值versionId
- this.$refs.docform.saveBtnClick()
- }
- })
- } else {
- return false
- }
- })
- })
- .catch(() => {
- this.$refs.recommendRuleForm.validate((valid) => {})
- })
- },
- measureRelSelect() {},
- fndeal(obj) {
- const newobj = []
- if (obj !== undefined) {
- obj.forEach((item) => {
- if (
- [
- 'riskEventLawEntitys',
- 'riskEventLossEventEntitys',
- 'riskEventResultEntitys',
- 'riskEventMeasureEntitys',
- 'riskEventCaseEntitys',
- 'iamDetailFormModifyLogEntities',
- 'riskCategoryId',
- ].indexOf(item.fieldName) < 0
- ) {
- if (
- item.newValue !== '' &&
- item.oldValue !== null &&
- item.fieldDesc.indexOf('ID') === -1 &&
- item.fieldDesc !== '主管部门'
- ) {
- item.xt = item.creatorName + '_' + item.creationTime
- if (item.oldValue.trim() === null || item.oldValue.trim() === 'null')
- item.oldValue = ''
- const i = newobj.find((n) => n.xt === item.xt)
- if (i !== undefined) {
- i.xx.push({
- fieldDesc: item.fieldDesc,
- fieldName: item.fieldName,
- newValue: item.newValue,
- oldValue: item.oldValue,
- })
- } else {
- item.xx = [
- {
- fieldDesc: item.fieldDesc,
- fieldName: item.fieldName,
- newValue: item.newValue,
- oldValue: item.oldValue,
- },
- ]
- newobj.push(item)
- }
- }
- }
- })
- }
- return newobj
- },
- // 选择法律制度
- lawsRelSelect() {
- // 选择事项分类
- this.visible = true
- },
- listSelected(keys, keyinfos) {
- let iamAuditLaws = []
- if (this.$refs.docform.getFieldValue('riskEventLawEntitys')) {
- iamAuditLaws = this.$refs.docform.getFieldValue('riskEventLawEntitys')
- }
- keyinfos.forEach((element) => {
- const mmc = {}
- mmc.title = element.docTitle
- mmc.docNum = element.dispatchWord ? element.dispatchWord : ''
- mmc.versionId = this.versionId
- mmc.clauses = ''
- iamAuditLaws.push(mmc)
- })
- this.visible = false
- this.$refs.docform.setFieldValue('riskEventLawEntitys', iamAuditLaws)
- },
- },
- }
- </script>
- <style module lang="scss">
- @use '@/common/design' as *;
- @import '@/webflow/sd-flow-form.scss';
- .btnselect {
- position: relative;
- top: 4px;
- right: 200px;
- float: right;
- .batchselect {
- z-index: 100;
- margin-left: 10px;
- }
- }
- .tablexm tr td {
- border: none !important;
- }
- </style>
|