drawerAssembly.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <!-- 采购需求新增修改弹出框 -->
  2. <template>
  3. <div id="marsk" v-if="showTab" class="marsk" style="width: 100%">
  4. <iframe ref="reviewIframe" :src="url" frameborder="0" :style="minHeight"></iframe>
  5. </div>
  6. </template>
  7. <script>
  8. import {getCookie, formatDate, dgTree, formatNum, formatNum2} from '@/utils/util.js'
  9. import { cookieUserName, proPath, cookieUserId, FileX } from '@/config/config.js'
  10. import {checdemandYears, kTel, checkComplexText, checkNumber, checkcntNumber, checkInteger} from '@/utils/validator.js'
  11. import store from '@/store/index.js'
  12. export default {
  13. props: ['purshowFlag', 'formKey', 'reviewData'],
  14. data () {
  15. return {
  16. showTab: false,
  17. formkeyUrl:[
  18. {formKey: 'demand_approval', url: '/purchmanagement.html#/demandIframe'}, // 需求
  19. {formKey: 'plan_approval', url: '/purchmanagement.html#/planIframe'}, // 计划
  20. {formKey: 'order_approval', url: '/purchmanagement.html#/orderIframe'}, // 立项
  21. {formKey: 'comsuming_approval', url: '/purchmanagement.html#/comsumingIframe'}, // 领用
  22. {formKey: 'post_approval', url: '/purchmanagement.html#/postIframe'}, // 售后
  23. {formKey: 'pay_approval', url: '/purchmanagement.html#/payIframe'}, // 付款
  24. {formKey: 'bill_approval', url: '/purchmanagement.html#/billIframe'}, // 结算
  25. {formKey: 'contract_approval', url: '/purchmanagement.html#/contractIframe'}, // 合同
  26. {formKey: 'remove_approval', url: '/purchmanagement.html#/removeIframe'} // 移库
  27. ],
  28. planUrl: ['demand_approval', 'plan_approval', 'order_approval', 'contract_approval'],
  29. deliverUrl: ['comsuming_approval', 'post_approval', 'pay_approval', 'bill_approval', 'remove_approval'],
  30. minHeight: '',
  31. url: ''
  32. }
  33. },
  34. computed: {
  35. divHeight: function () {
  36. return window.innerHeight - 0
  37. }
  38. },
  39. // 时间过滤器
  40. filters: {
  41. formatDateFilter: function (iDate, sFormat = 'yyyy-MM-dd HH:mm:ss') {
  42. if (!iDate) { return ''; }
  43. let dDate = new Date(iDate);
  44. let year = dDate.getFullYear();// 年
  45. let month = dDate.getMonth() + 1;// 月
  46. if (month < 10) { month = '0' + month; }
  47. let date = dDate.getDate();// 日
  48. if (date < 10) { date = '0' + date; }
  49. let hour = dDate.getHours();// 时
  50. if (hour < 10) { hour = '0' + hour; }
  51. let minute = dDate.getMinutes();// 分
  52. if (minute < 10) { minute = '0' + minute; }
  53. let second = dDate.getSeconds();// 秒
  54. if (second < 10) { second = '0' + second; }
  55. let millisecond = dDate.getMilliseconds();// 毫秒
  56. if (sFormat.indexOf('yyyy') >= 0) { sFormat = sFormat.replace('yyyy', year + ''); }
  57. if (sFormat.indexOf('MM') >= 0) { sFormat = sFormat.replace('MM', month + ''); }
  58. if (sFormat.indexOf('dd') >= 0) { sFormat = sFormat.replace('dd', date + ''); }
  59. if (sFormat.indexOf('HH') >= 0) { sFormat = sFormat.replace('HH', hour + ''); }
  60. if (sFormat.indexOf('mm') >= 0) { sFormat = sFormat.replace('mm', minute + ''); }
  61. if (sFormat.indexOf('ss') >= 0) { sFormat = sFormat.replace('ss', second + ''); }
  62. if (sFormat.indexOf('SSS') >= 0) { sFormat = sFormat.replace('SSS', millisecond + ''); }
  63. return sFormat;
  64. }
  65. },
  66. mounted () {
  67. // 获取公司信息
  68. let _this = this
  69. this.minHeight = 'width: 100%;height: 100%;border: 0px;min-height: ' + window.innerHeight + 'px'
  70. window.addEventListener('message', event => {
  71. // 根据上面制定的结构来解析iframe内部发回来的数据
  72. _this.showTab = false
  73. const data = event.data
  74. if (data.refresh) {
  75. _this.$emit('refreshData')
  76. }
  77. });
  78. },
  79. methods: {
  80. // 查看附件信息
  81. fullScreenEvent () {
  82. let that = this;
  83. that.showall = !that.showall;
  84. let main = document.querySelector('.read-Content1');
  85. if (that.showall) {
  86. if (document.exitFullscreen) {
  87. document.exitFullscreen()
  88. } else if (document.mozCancelFullScreen) {
  89. document.mozCancelFullScreen()
  90. } else if (document.webkitCancelFullScreen) {
  91. document.webkitCancelFullScreen()
  92. } else if (document.msExitFullscreen) {
  93. document.msExitFullscreen()
  94. }
  95. } else {
  96. if (main.requestFullscreen) {
  97. main.requestFullscreen()
  98. } else if (main.mozRequestFullScreen) {
  99. main.mozRequestFullScreen()
  100. } else if (main.webkitRequestFullScreen) {
  101. main.webkitRequestFullScreen()
  102. } else if (main.msRequestFullscreen) {
  103. main.msRequestFullscreen()
  104. }
  105. }
  106. }
  107. },
  108. watch: {
  109. purshowFlag (arg) {
  110. let _this = this
  111. // console.log('haha', _this.formKey, _this.formkeyUrl)
  112. // 不同环境跳转的链接不同
  113. let planBefore = ''
  114. let deliverBefore = ''
  115. if (window.top.location.host === 'prod-icore.steerinfo.com' || window.top.location.host === 'portal.steerinfo.com' || window.top.location.host === 'icore.steerinfo.com') {
  116. // 正式环境地址
  117. planBefore = 'https://prod-ioms-pumplan.steerinfo.com/views'
  118. deliverBefore = 'https://prod-ioms-pumdeliver.steerinfo.com/views'
  119. } else {
  120. // 测试环境地址
  121. planBefore = 'https://deve-ioms-pumplan.steerinfo.com/views'
  122. deliverBefore = 'https://deve-ioms-pumdeliver.steerinfo.com/views'
  123. }
  124. _this.formkeyUrl.forEach(res => {
  125. if (res.formKey === _this.formKey) {
  126. if (_this.planUrl.includes(_this.formKey)) {
  127. _this.url = planBefore + res.url
  128. } else {
  129. _this.url = deliverBefore + res.url
  130. }
  131. }
  132. })
  133. this.showTab = true
  134. this.$nextTick(() => {
  135. setTimeout(()=> {
  136. this.$refs.reviewIframe.contentWindow.postMessage(_this.reviewData, '*')
  137. },1000)
  138. })
  139. }
  140. }
  141. }
  142. </script>
  143. <style scoped>
  144. .marsk {
  145. position: fixed;
  146. top: 0;
  147. right: 0;
  148. z-index: 100;
  149. }
  150. .tb-row {
  151. height: 100%;
  152. margin-bottom: 10px!important;
  153. }
  154. @keyframes fadeInRight {
  155. 0% {
  156. opacity: 0;
  157. -webkit-transform: stranslateX(20%);
  158. transform: stranslateX(20%,0);
  159. }
  160. 100% {
  161. opacity:1;
  162. -webkit-transform: stranslateX(0%,0);
  163. transform: stranslateX(0%,0);
  164. }
  165. }
  166. @-webkit-keyframes fadeInRight {
  167. 0% {
  168. opacity:0;
  169. -webkit-transform: stranslateX(20%,0);
  170. transform: stranslateX(20%,0);
  171. }
  172. 100% {
  173. opacity:1;
  174. -webkit-transform: stranslateX(0%,0);
  175. transform: stranslateX(0%,0);
  176. }
  177. }
  178. .read-Content1 {
  179. width: 1200px;
  180. height: 100%;
  181. position:fixed;
  182. z-index: 299;
  183. right: 0px;
  184. box-shadow: #333333 0px 0px 8px;
  185. background-color: #ffffff;
  186. overflow: hidden;
  187. /* overflow: auto; */
  188. -webkit-animation:'fadeInRight' 0.3s 1;
  189. border-radius: 4px 4px 0 0;
  190. /* padding-bottom: 28px; */
  191. }
  192. .add-title {
  193. font-weight: 700;
  194. font-style: normal;
  195. font-size: 16px;
  196. overflow: hidden;
  197. float: left;
  198. }
  199. .add-title2 {
  200. margin-top: 15px;
  201. font-weight: 700;
  202. font-style: normal;
  203. font-size: 16px;
  204. overflow: hidden;
  205. }
  206. .el-table th.gutter{
  207. display: table-cell!important;
  208. }
  209. .li-box {
  210. float: left;
  211. margin-right: 50px;
  212. min-width: 110px;
  213. }
  214. .li-box-title {
  215. font-size: 14px;
  216. color: #666666;
  217. letter-spacing: 0;
  218. line-height: 22px;
  219. }
  220. .li-box-text {
  221. font-size: 14px;
  222. color: #333333;
  223. font-weight: 400;
  224. letter-spacing: 0;
  225. line-height: 22px;
  226. margin-top: 4px;
  227. }
  228. </style>