audit-evidence-from.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <audit-form-top-banner
  3. :handel-publish="publishflag ? handelPublish : null"
  4. :handel-save-form="saveflag ? saveForm : null"
  5. @handelSaveForm="saveForm"
  6. @handelPublish="handelPublish"
  7. >
  8. <sd-detail-form
  9. ref="docform"
  10. form-id="iamAuditEvidenceSheet"
  11. page-id="audit/evidence/iamAuditEvidenceSheet"
  12. :record-id="this.$route.query.record ? parseInt(this.$route.query.record) : null"
  13. :class="$style.form"
  14. :read-only="readOnly"
  15. @close="close(true)"
  16. @saved="saved"
  17. >
  18. <template v-slot="{ model, fields }">
  19. <table
  20. ><tr
  21. ><td style="border: none">
  22. <audit-advanced-group
  23. :expand="templateExpand"
  24. :expand-str="'templateExpand'"
  25. :group-label="'基本信息'"
  26. tablestyle="''"
  27. @changedClick="changedClick"
  28. ></audit-advanced-group> </td></tr
  29. ></table>
  30. <table v-show="templateExpand">
  31. <tr :class="$style.firstTr">
  32. <td class="ant-form-item-label ant-form-item-label"></td>
  33. <td></td>
  34. <td class="ant-form-item-label ant-form-item-label"></td>
  35. <td></td>
  36. </tr>
  37. <tr>
  38. <sd-form-item-td
  39. name="projectId"
  40. :colspan="3"
  41. :input-props="{ defaultValue: projectId }"
  42. :hidden="true"
  43. ></sd-form-item-td
  44. ></tr>
  45. <tr>
  46. <!-- 审计事项 -->
  47. <sd-form-item-td v-if="savecontent()" name="itemTitle" />
  48. <!-- 取证单编号 -->
  49. <sd-form-item-td name="itemCode">
  50. <template v-slot:read-and-edit="{ editable }">
  51. <a-input
  52. v-if="editable"
  53. v-model="model.itemCode"
  54. placeholder="系统自动"
  55. read-only
  56. ></a-input>
  57. <span v-else>{{ model.itemCode }}</span>
  58. </template>
  59. </sd-form-item-td>
  60. </tr>
  61. <tr>
  62. <!-- 被审计单位 -->
  63. <sd-form-item-td name="auditedUnitMember">
  64. <sd-group-picker v-model="auditedUnitMember" />
  65. </sd-form-item-td>
  66. <!-- 被审计人员 -->
  67. <sd-form-item-td name="linkmanName">
  68. <template v-slot:read-and-edit="{ editable }">
  69. <a-input
  70. v-if="editable"
  71. v-model="model.linkmanName"
  72. placeholder="系统自动"
  73. read-only
  74. ></a-input>
  75. <span v-else>{{ model.linkmanName }}</span>
  76. </template>
  77. </sd-form-item-td>
  78. </tr>
  79. <tr>
  80. <!-- 审计(调查)事项摘要 -->
  81. <sd-form-item-td name="itemDesc" :colspan="3">
  82. <a-textarea v-model="model.itemDesc" :rows="3" />
  83. </sd-form-item-td>
  84. </tr>
  85. <tr>
  86. <!-- 编制人员 -->
  87. <sd-form-item-td v-if="initparams(model)" name="creatorName" />
  88. <!-- 编制日期 -->
  89. <sd-form-item-td name="creationTime" />
  90. </tr>
  91. <tr>
  92. <!-- 附件 -->
  93. <sd-form-item-td name="attachment" :colspan="3">
  94. <template v-slot:read-and-edit>
  95. <sd-attachment
  96. v-model="model.attachment"
  97. :group-id="JSON.parse(fields.attachment.value).value"
  98. :read-only="readOnly"
  99. />
  100. </template>
  101. </sd-form-item-td>
  102. </tr>
  103. <tr>
  104. <sd-form-item-td name="docStatus" :hidden="true" :colspan="3" />
  105. </tr> </table
  106. ><table>
  107. <tr
  108. ><td :colspan="4">
  109. <sd-form-item name="iamAuditEvidenceEntity" :label="null">
  110. <template v-slot:read-and-edit="{ editable }">
  111. <audit-advanced-group
  112. :expand="expandC"
  113. :expand-str="'expandC'"
  114. :group-label="'审计证据'"
  115. @changedClick="changedClick"
  116. ><template>
  117. <xm-child-table
  118. ref="evidenceForm"
  119. v-model="model.iamAuditEvidenceEntity"
  120. :class="{ [$style.sjEvidence]: !readOnly }"
  121. :read-only="!editable"
  122. label=""
  123. :fields="
  124. [
  125. {
  126. caption: '序号',
  127. name: 'sortNum',
  128. dataType: 'number',
  129. attr: {},
  130. },
  131. ].concat(Array.from(fields.iamAuditEvidenceEntity.attr.dync))
  132. "
  133. :columns="childColumns"
  134. :width="1200"
  135. @change="projectIdChange"
  136. >
  137. <template v-slot:pageNum="{ field, text, record, value, index }">
  138. <a-input-number v-model="value[index].pageNum" :min="0"></a-input-number>
  139. </template>
  140. </xm-child-table>
  141. </template>
  142. </audit-advanced-group>
  143. </template> </sd-form-item
  144. ></td>
  145. </tr>
  146. </table>
  147. </template>
  148. </sd-detail-form>
  149. </audit-form-top-banner>
  150. </template>
  151. <script>
  152. import { Message } from 'ant-design-vue'
  153. import { getUserInfo } from '@/common/store-mixin'
  154. import axios from '@/common/services/axios-instance'
  155. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  156. import auditFormTopBanner from '../../components/audit-form-top-banner'
  157. import auditAdvancedGroup from '../../components/audit-advanced-group.vue'
  158. import auditAdvancedGroupMixins from '../../components/audit-advanced-group-mixins'
  159. import components from './_import-components/audit-evidence-from-import'
  160. export default {
  161. name: 'AuditEvidenceFrom',
  162. metaInfo: {
  163. title: '审计取证表',
  164. },
  165. components: {
  166. ...components,
  167. auditAdvancedGroup,
  168. auditFormTopBanner,
  169. },
  170. mixins: [auditAdvancedGroupMixins],
  171. data() {
  172. return {
  173. isIni: false,
  174. message: '',
  175. templateExpand: true,
  176. expandC: true,
  177. readOnly: false,
  178. publishflag: true,
  179. saveflag: true,
  180. projectId: this.$root.$route.query.projectId,
  181. childColumns: [
  182. {
  183. title: '序号',
  184. dataIndex: 'sortNum',
  185. width: '80px',
  186. customRender: (text, record, index) => `${index + 1}`,
  187. },
  188. { dataIndex: 'id', sdHidden: true },
  189. { dataIndex: 'projectId', sdHidden: true },
  190. { dataIndex: 'evidenceTitle', title: '名称' },
  191. { dataIndex: 'evidenceCode', width: '180px' },
  192. { dataIndex: 'pageNum', width: '110px' },
  193. ],
  194. auditedUnitMember: [],
  195. linkmanName: '',
  196. flag: true,
  197. }
  198. },
  199. created() {},
  200. methods: {
  201. savecontent() {
  202. if (this.linkmanName !== '') {
  203. this.$refs.docform.setFieldValue('linkmanName', this.linkmanName)
  204. }
  205. if (this.auditedUnitMember.length > 0) {
  206. this.$refs.docform.setFieldValue('auditedUnitMember', this.auditedUnitMember)
  207. }
  208. return true
  209. },
  210. initparams(model) {
  211. if (this.isIni) return
  212. this.isIni = true
  213. const userInfo = getUserInfo()
  214. if (model.docStatus === '已结束' || model.creatorName !== userInfo.name) {
  215. this.readOnly = true
  216. this.saveflag = false
  217. this.publishflag = false
  218. } else if (model.docStatus === '已结束') {
  219. this.readOnly = false
  220. this.saveflag = true
  221. this.publishflag = false
  222. }
  223. if (model.docStatus === '已结束' && model.creatorName === userInfo.name) {
  224. this.readOnly = false
  225. this.saveflag = true
  226. this.publishflag = true
  227. }
  228. if (this.flag) {
  229. this.setAuditUnit(model)
  230. this.setLinkmanName(model)
  231. this.flag = false
  232. }
  233. return true
  234. },
  235. projectIdChange(data) {
  236. data.forEach((res) => {
  237. res.projectId = this.projectId
  238. })
  239. },
  240. // 被审计单位 被审计单位是一个的时候,直接默认显示;被审计单位是多个的时候,手动选择
  241. setAuditUnit(model) {
  242. const params = {
  243. projectId: this.projectId,
  244. }
  245. if (this.projectId) {
  246. const auditedUnitMember = model.auditedUnitMember
  247. if (
  248. auditedUnitMember === null ||
  249. auditedUnitMember === undefined ||
  250. auditedUnitMember === ''
  251. ) {
  252. axios({
  253. url: 'api/xcoa-mobile/v1/iamauditevidencesheet/findAuditUnit',
  254. method: 'post',
  255. params,
  256. }).then((res) => {
  257. this.auditedUnitMember = res.data
  258. })
  259. }
  260. } else {
  261. this.auditedUnitMember = model.auditedUnitMember
  262. }
  263. },
  264. // 经责类自动读取项目被审计人员
  265. setLinkmanName(model) {
  266. const params = {
  267. projectId: this.projectId,
  268. }
  269. const linkmanName = model.linkmanName
  270. if (linkmanName === null || linkmanName === '' || linkmanName === undefined) {
  271. if (this.projectId) {
  272. axios({
  273. url: 'api/xcoa-mobile/v1/iamauditevidencesheet/findLinkmanName',
  274. method: 'post',
  275. params,
  276. }).then((res) => {
  277. this.linkmanName = res.data
  278. })
  279. }
  280. } else {
  281. this.linkmanName = model.linkmanName
  282. }
  283. },
  284. close(flag) {
  285. crossWindowWatcher.notifyChange(this.$route.fullPath, flag)
  286. window.close()
  287. },
  288. // 保存
  289. saveForm() {
  290. this.message = '保存成功'
  291. this.$refs.docform.saveBtnClick()
  292. return true
  293. },
  294. handelPublish() {
  295. // 发布,保存
  296. this.message = '发布成功'
  297. this.$refs.docform.setFieldValue('docStatus', '已结束')
  298. this.$refs.docform.saveBtnClick()
  299. return true
  300. },
  301. saved() {
  302. Message.success(this.message).then(() => {
  303. this.close(true)
  304. }, 1)
  305. },
  306. },
  307. }
  308. </script>
  309. <style module lang="scss">
  310. @import '@/webflow/sd-flow-form.scss';
  311. .first-tr {
  312. td {
  313. background: #fff !important;
  314. border: none !important;
  315. }
  316. }
  317. .sj-evidence {
  318. :global(.ant-table-thead) {
  319. tr:first-child th:nth-child(3) {
  320. :global(.ant-table-header-column) div {
  321. :global(.ant-table-column-title)::before {
  322. position: relative;
  323. top: 5px;
  324. padding: 6px;
  325. font-size: 22px;
  326. color: #f55d5d;
  327. content: '*';
  328. }
  329. }
  330. }
  331. }
  332. }
  333. </style>