filesDialog.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!--
  2. 上传文件的弹窗
  3. -->
  4. <template>
  5. <el-dialog
  6. title="上传文件"
  7. :visible.sync="dialog.uploadFiles"
  8. width="500px">
  9. <div class='max-height: 500px; overflow-y: auto;'>
  10. <upload-files
  11. :readOnly="read"
  12. :keysArr="keysArr"
  13. :firmDataType="firmDataType"
  14. @change="changeItem"
  15. max="2"/>
  16. </div>
  17. </el-dialog>
  18. </template>
  19. <script>
  20. import uploadFiles from "@/components/ledger/lib/uploadFiles";
  21. export default {
  22. components: {
  23. uploadFiles
  24. },
  25. props: {
  26. dialog: {
  27. type: Object,
  28. default: function () {
  29. return {
  30. uploadFiles: false
  31. };
  32. }
  33. },
  34. keysArr: {
  35. type: Array,
  36. default: function () {
  37. return []
  38. }
  39. },
  40. read: {
  41. type: Boolean,
  42. default: false
  43. },
  44. firmDataType: {
  45. type: String
  46. },
  47. infoType: {
  48. type: String
  49. },
  50. information: {
  51. type: Object
  52. }
  53. },
  54. data() {
  55. return {};
  56. },
  57. created() {
  58. },
  59. computed: {
  60. },
  61. mounted() {
  62. },
  63. methods: {
  64. changeItem(file) {
  65. if (this.firmDataType === 'dialog') {
  66. let info = this.infoType;
  67. switch (info) {
  68. case 'archive':
  69. this.information.archive.Archive = file
  70. this.$emit("changeFile", this.information, this.firmDataType)
  71. break
  72. case 'checkReport':
  73. this.information.checkReport.CheckReport = file
  74. this.$emit("changeFile", this.information, this.firmDataType)
  75. break
  76. case 'insuranceFile':
  77. this.information.insuranceFile.InsuranceFile = file
  78. this.$emit("changeFile", this.information, this.firmDataType)
  79. break
  80. }
  81. } else {
  82. this.$emit("changeFile", file, this.firmDataType)
  83. }
  84. },
  85. deepCopy(obj) {
  86. return JSON.parse((JSON.stringify(obj)))
  87. }
  88. },
  89. };
  90. </script>
  91. <style>
  92. </style>