123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 |
- <template>
- <audit-form-top-banner
- :handel-publish="publishflag ? handelPublish : null"
- :handel-save-form="saveflag ? saveForm : null"
- @handelSaveForm="saveForm"
- @handelPublish="handelPublish"
- >
- <sd-detail-form
- ref="docform"
- form-id="iamAuditEvidenceSheet"
- page-id="audit/evidence/iamAuditEvidenceSheet"
- :record-id="this.$route.query.record ? parseInt(this.$route.query.record) : null"
- :class="$style.form"
- :read-only="readOnly"
- @close="close(true)"
- @saved="saved"
- >
- <template v-slot="{ model, fields }">
- <table
- ><tr
- ><td style="border: none">
- <audit-advanced-group
- :expand="templateExpand"
- :expand-str="'templateExpand'"
- :group-label="'基本信息'"
- tablestyle="''"
- @changedClick="changedClick"
- ></audit-advanced-group> </td></tr
- ></table>
- <table v-show="templateExpand">
- <tr :class="$style.firstTr">
- <td class="ant-form-item-label ant-form-item-label"></td>
- <td></td>
- <td class="ant-form-item-label ant-form-item-label"></td>
- <td></td>
- </tr>
- <tr>
- <sd-form-item-td
- name="projectId"
- :colspan="3"
- :input-props="{ defaultValue: projectId }"
- :hidden="true"
- ></sd-form-item-td
- ></tr>
- <tr>
- <!-- 审计事项 -->
- <sd-form-item-td v-if="savecontent()" name="itemTitle" />
- <!-- 取证单编号 -->
- <sd-form-item-td name="itemCode">
- <template v-slot:read-and-edit="{ editable }">
- <a-input
- v-if="editable"
- v-model="model.itemCode"
- placeholder="系统自动"
- read-only
- ></a-input>
- <span v-else>{{ model.itemCode }}</span>
- </template>
- </sd-form-item-td>
- </tr>
- <tr>
- <!-- 被审计单位 -->
- <sd-form-item-td name="auditedUnitMember">
- <sd-group-picker v-model="auditedUnitMember" />
- </sd-form-item-td>
- <!-- 被审计人员 -->
- <sd-form-item-td name="linkmanName">
- <template v-slot:read-and-edit="{ editable }">
- <a-input
- v-if="editable"
- v-model="model.linkmanName"
- placeholder="系统自动"
- read-only
- ></a-input>
- <span v-else>{{ model.linkmanName }}</span>
- </template>
- </sd-form-item-td>
- </tr>
- <tr>
- <!-- 审计(调查)事项摘要 -->
- <sd-form-item-td name="itemDesc" :colspan="3">
- <a-textarea v-model="model.itemDesc" :rows="3" />
- </sd-form-item-td>
- </tr>
- <tr>
- <!-- 编制人员 -->
- <sd-form-item-td v-if="initparams(model)" name="creatorName" />
- <!-- 编制日期 -->
- <sd-form-item-td name="creationTime" />
- </tr>
- <tr>
- <!-- 附件 -->
- <sd-form-item-td name="attachment" :colspan="3">
- <template v-slot:read-and-edit>
- <sd-attachment
- v-model="model.attachment"
- :group-id="JSON.parse(fields.attachment.value).value"
- :read-only="readOnly"
- />
- </template>
- </sd-form-item-td>
- </tr>
- <tr>
- <sd-form-item-td name="docStatus" :hidden="true" :colspan="3" />
- </tr> </table
- ><table>
- <tr
- ><td :colspan="4">
- <sd-form-item name="iamAuditEvidenceEntity" :label="null">
- <template v-slot:read-and-edit="{ editable }">
- <audit-advanced-group
- :expand="expandC"
- :expand-str="'expandC'"
- :group-label="'审计证据'"
- @changedClick="changedClick"
- ><template>
- <xm-child-table
- ref="evidenceForm"
- v-model="model.iamAuditEvidenceEntity"
- :class="{ [$style.sjEvidence]: !readOnly }"
- :read-only="!editable"
- label=""
- :fields="
- [
- {
- caption: '序号',
- name: 'sortNum',
- dataType: 'number',
- attr: {},
- },
- ].concat(Array.from(fields.iamAuditEvidenceEntity.attr.dync))
- "
- :columns="childColumns"
- :width="1200"
- @change="projectIdChange"
- >
- <template v-slot:pageNum="{ field, text, record, value, index }">
- <a-input-number v-model="value[index].pageNum" :min="0"></a-input-number>
- </template>
- </xm-child-table>
- </template>
- </audit-advanced-group>
- </template> </sd-form-item
- ></td>
- </tr>
- </table>
- </template>
- </sd-detail-form>
- </audit-form-top-banner>
- </template>
- <script>
- import { Message } from 'ant-design-vue'
- import { getUserInfo } from '@/common/store-mixin'
- import axios from '@/common/services/axios-instance'
- import crossWindowWatcher from '@/common/services/cross-window-watcher'
- 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 components from './_import-components/audit-evidence-from-import'
- export default {
- name: 'AuditEvidenceFrom',
- metaInfo: {
- title: '审计取证表',
- },
- components: {
- ...components,
- auditAdvancedGroup,
- auditFormTopBanner,
- },
- mixins: [auditAdvancedGroupMixins],
- data() {
- return {
- isIni: false,
- message: '',
- templateExpand: true,
- expandC: true,
- readOnly: false,
- publishflag: true,
- saveflag: true,
- projectId: this.$root.$route.query.projectId,
- childColumns: [
- {
- title: '序号',
- dataIndex: 'sortNum',
- width: '80px',
- customRender: (text, record, index) => `${index + 1}`,
- },
- { dataIndex: 'id', sdHidden: true },
- { dataIndex: 'projectId', sdHidden: true },
- { dataIndex: 'evidenceTitle', title: '名称' },
- { dataIndex: 'evidenceCode', width: '180px' },
- { dataIndex: 'pageNum', width: '110px' },
- ],
- auditedUnitMember: [],
- linkmanName: '',
- flag: true,
- }
- },
- created() {},
- methods: {
- savecontent() {
- if (this.linkmanName !== '') {
- this.$refs.docform.setFieldValue('linkmanName', this.linkmanName)
- }
- if (this.auditedUnitMember.length > 0) {
- this.$refs.docform.setFieldValue('auditedUnitMember', this.auditedUnitMember)
- }
- return true
- },
- initparams(model) {
- if (this.isIni) return
- this.isIni = true
- const userInfo = getUserInfo()
- if (model.docStatus === '已结束' || model.creatorName !== userInfo.name) {
- this.readOnly = true
- this.saveflag = false
- this.publishflag = false
- } else if (model.docStatus === '已结束') {
- this.readOnly = false
- this.saveflag = true
- this.publishflag = false
- }
- if (model.docStatus === '已结束' && model.creatorName === userInfo.name) {
- this.readOnly = false
- this.saveflag = true
- this.publishflag = true
- }
- if (this.flag) {
- this.setAuditUnit(model)
- this.setLinkmanName(model)
- this.flag = false
- }
- return true
- },
- projectIdChange(data) {
- data.forEach((res) => {
- res.projectId = this.projectId
- })
- },
- // 被审计单位 被审计单位是一个的时候,直接默认显示;被审计单位是多个的时候,手动选择
- setAuditUnit(model) {
- const params = {
- projectId: this.projectId,
- }
- if (this.projectId) {
- const auditedUnitMember = model.auditedUnitMember
- if (
- auditedUnitMember === null ||
- auditedUnitMember === undefined ||
- auditedUnitMember === ''
- ) {
- axios({
- url: 'api/xcoa-mobile/v1/iamauditevidencesheet/findAuditUnit',
- method: 'post',
- params,
- }).then((res) => {
- this.auditedUnitMember = res.data
- })
- }
- } else {
- this.auditedUnitMember = model.auditedUnitMember
- }
- },
- // 经责类自动读取项目被审计人员
- setLinkmanName(model) {
- const params = {
- projectId: this.projectId,
- }
- const linkmanName = model.linkmanName
- if (linkmanName === null || linkmanName === '' || linkmanName === undefined) {
- if (this.projectId) {
- axios({
- url: 'api/xcoa-mobile/v1/iamauditevidencesheet/findLinkmanName',
- method: 'post',
- params,
- }).then((res) => {
- this.linkmanName = res.data
- })
- }
- } else {
- this.linkmanName = model.linkmanName
- }
- },
- close(flag) {
- crossWindowWatcher.notifyChange(this.$route.fullPath, flag)
- window.close()
- },
- // 保存
- saveForm() {
- this.message = '保存成功'
- this.$refs.docform.saveBtnClick()
- return true
- },
- handelPublish() {
- // 发布,保存
- this.message = '发布成功'
- this.$refs.docform.setFieldValue('docStatus', '已结束')
- this.$refs.docform.saveBtnClick()
- return true
- },
- saved() {
- Message.success(this.message).then(() => {
- this.close(true)
- }, 1)
- },
- },
- }
- </script>
- <style module lang="scss">
- @import '@/webflow/sd-flow-form.scss';
- .first-tr {
- td {
- background: #fff !important;
- border: none !important;
- }
- }
- .sj-evidence {
- :global(.ant-table-thead) {
- tr:first-child th:nth-child(3) {
- :global(.ant-table-header-column) div {
- :global(.ant-table-column-title)::before {
- position: relative;
- top: 5px;
- padding: 6px;
- font-size: 22px;
- color: #f55d5d;
- content: '*';
- }
- }
- }
- }
- }
- </style>
|