cde5522c592b6b0971192fbd607e08ba3fbe5767.svn-base 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <el-container :style="{'height':testHeight1+'px'}">
  3. <el-main>
  4. <div class="signature_wrapper" v-if="signatureList.length">
  5. <div v-for="(sig,index) in signatureList" :key="index">
  6. <div>
  7. {{sig.label}}
  8. <img :src="hostUrl + sig.filePath" alt="" v-if="sig.filePath">
  9. <p v-else>暂无签字</p>
  10. </div>
  11. </div>
  12. </div>
  13. <div class="signature_wrapper" v-else>
  14. 暂无签字
  15. </div>
  16. </el-main>
  17. </el-container>
  18. </template>
  19. <script>
  20. import request from '@util/gw_ajax_request.js'
  21. import {hostUrl} from '@util/global_variable.js'
  22. export default {
  23. props: {
  24. currentObjectRgstrId: {},
  25. labelList: {
  26. type: Array,
  27. default: () => (['组长','组员','被检查单位负责人'])
  28. }
  29. },
  30. data() {
  31. return {
  32. testHeight: (window.innerHeight * 0.5 - 114) / 6,
  33. testHeight1: window.innerHeight * 0.5,
  34. signatureList: []
  35. }
  36. },
  37. computed: {
  38. orgId() {
  39. return localStorage.getItem('currentOrgId') ? localStorage.getItem('currentOrgId') : ''
  40. },
  41. bizId() {
  42. return `${this.currentObjectRgstrId}${this.orgId}`
  43. },
  44. hostUrl() {
  45. return hostUrl
  46. }
  47. },
  48. mounted() {
  49. this.getSignaturePics()
  50. },
  51. methods: {
  52. getSignaturePics() {
  53. let _this = this
  54. let signatureOne = new Promise(function (resolve, reject) {
  55. request.post('/file/findPageInfo', {
  56. bizId: _this.bizId,
  57. bizType: 'liableSignature1'
  58. }).then(function (res) {
  59. if (res.success) {
  60. if (res.data.list.length) {
  61. resolve(res.data.list)
  62. } else {
  63. resolve({})
  64. }
  65. }
  66. })
  67. })
  68. let signatureTwo = new Promise(function (resolve, reject) {
  69. request.post('/file/findPageInfo', {
  70. bizId: _this.bizId,
  71. bizType: 'liableSignature2'
  72. }).then(function (res) {
  73. if (res.success) {
  74. if (res.data.list.length) {
  75. resolve(res.data.list)
  76. } else {
  77. resolve({})
  78. }
  79. }
  80. })
  81. })
  82. let signatureThree = new Promise(function (resolve, reject) {
  83. request.post('/file/findPageInfo', {
  84. bizId: _this.bizId,
  85. bizType: 'liableSignature3'
  86. }).then(function (res) {
  87. if (res.success) {
  88. if (res.data.list.length) {
  89. resolve(res.data.list)
  90. } else {
  91. resolve({})
  92. }
  93. }
  94. })
  95. })
  96. // 根据传进来的labellist的长度进行数据请求
  97. let signatureArr = [signatureOne, signatureTwo,signatureThree]
  98. if (_this.labelList && _this.labelList.length) {
  99. signatureArr.length = _this.labelList.length
  100. }
  101. Promise.all(signatureArr).then(function (result) {
  102. if (result.length) {
  103. result.forEach((ele, index) => {
  104. _this.signatureList = _this.signatureList.concat(ele)
  105. })
  106. _this.signatureList.forEach((ele, index) => {
  107. ele['label'] = _this.labelList[index]
  108. })
  109. }
  110. console.log(_this.signatureList)
  111. })
  112. }
  113. },
  114. }
  115. </script>
  116. <style lang="scss" scoped>
  117. .signature_wrapper {
  118. min-height: 300px;
  119. display: flex;
  120. justify-content: space-between;
  121. > div {
  122. width: 30%;
  123. font-size: 18px;
  124. font-weight: bold;
  125. text-align: center;
  126. img {
  127. width: 100%;
  128. vertical-align: text-top;
  129. }
  130. p {
  131. font-weight: normal;
  132. margin-top: 30px;
  133. }
  134. }
  135. }
  136. </style>