86ec7497d45cbf813dc0049f3b29b2274dd844cf.svn-base 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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: 'signature1'
  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. // 根据传进来的labellist的长度进行数据请求
  69. let signatureArr = [signatureOne]
  70. if (_this.labelList && _this.labelList.length) {
  71. signatureArr.length = _this.labelList.length
  72. }
  73. Promise.all(signatureArr).then(function (result) {
  74. if (result.length) {
  75. result.forEach((ele, index) => {
  76. _this.signatureList = _this.signatureList.concat(ele)
  77. })
  78. _this.signatureList.forEach((ele, index) => {
  79. ele['label'] = _this.labelList[index]
  80. })
  81. }
  82. console.log(_this.signatureList)
  83. })
  84. }
  85. },
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .signature_wrapper {
  90. min-height: 300px;
  91. display: flex;
  92. justify-content: space-between;
  93. > div {
  94. width: 100%;
  95. font-size: 18px;
  96. font-weight: bold;
  97. text-align: center;
  98. img {
  99. width: 100%;
  100. vertical-align: text-top;
  101. }
  102. p {
  103. font-weight: normal;
  104. margin-top: 30px;
  105. }
  106. }
  107. }
  108. </style>