cpm-policy-check.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <sd-webflow ref="webflow" :validate-form="validForm">
  3. <template v-slot:form="{ model, FlowData }">
  4. <sd-form-by-builder ref="builderform" :form-data="initDaF(FlowData.processFormData)" :keep-hidden-cell="false" />
  5. </template>
  6. </sd-webflow>
  7. </template>
  8. <script>
  9. import moment from 'moment'
  10. import { getUserInfo } from '@/common/store-mixin'
  11. import components from './_import-components/cpm-policy-check-import'
  12. export default {
  13. name: 'CpmPolicyCheck',
  14. metaInfo: {
  15. title: 'CpmPolicyCheck',
  16. },
  17. components,
  18. data() {
  19. return {}
  20. },
  21. created() {
  22. // this.initData()
  23. setTimeout(() => {
  24. this.initData()
  25. }, 1000)
  26. },
  27. methods: {
  28. initDaF(array) {
  29. if (array) {
  30. array.attrFD.keepHiddenCell = false
  31. }
  32. return array
  33. },
  34. validForm() {
  35. this.$refs.webflow.setFieldValue('ZDJCSC', 'true')
  36. this.$refs.webflow.setFieldValue('FLHGBYJ', 'true')
  37. return new Promise((resolve, reject) => {
  38. resolve(true)
  39. })
  40. },
  41. changebj() {
  42. console.log('---change')
  43. },
  44. initData() {
  45. const FLOW_STEP_NAME= this.$refs.webflow.getFieldValue('FLOW_STEP_NAME')
  46. if(FLOW_STEP_NAME=== '法律合规部审查'){
  47. if(this.$refs.webflow.getFieldValue('LAW_EDIT_ID')==null){
  48. this.$refs.webflow.setFieldValue('LAW_EDIT_ID', getUserInfo().id)
  49. }
  50. if(this.$refs.webflow.getFieldValue('LAW_EDIT_CODE')==null){
  51. this.$refs.webflow.setFieldValue('LAW_EDIT_CODE', getUserInfo().account)
  52. }
  53. if(this.$refs.webflow.getFieldValue('LAW_EDIT_NAME').length<2){
  54. const users = []
  55. users.push({
  56. type: 'User',
  57. name: getUserInfo().name,
  58. text: getUserInfo().name,
  59. code: getUserInfo().account,
  60. id: getUserInfo().id ? getUserInfo().id : '',
  61. attrNames: [],
  62. })
  63. this.$refs.webflow.setFieldValue('LAW_EDIT_NAME', users)
  64. }
  65. if(this.$refs.webflow.getFieldValue('LAW_EDIT_TIME')==null){
  66. this.$refs.webflow.setFieldValue('LAW_EDIT_TIME', moment(new Date()))
  67. }
  68. }
  69. },
  70. },
  71. }
  72. </script>
  73. <style module lang="scss">
  74. @use '@/common/design' as *;
  75. </style>