fabInQuaModal.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <!-- 面料 转入数量 成本分配统计表 -->
  3. <a-modal
  4. title="面料 - 转入数量"
  5. v-model="fabInQuaModVis"
  6. :confirmLoading="confirmLoading"
  7. width="86%"
  8. style="top:330px;left:100px;"
  9. :footer="null"
  10. >
  11. <!-- tabel -->
  12. <a-spin :spinning="confirmLoading">
  13. <a-table :loading="loading" bordered :columns="columns" :data-source="data" :pagination="false"> </a-table>
  14. <!-- 导出 打印 返回 -->
  15. <a-row style="marginTop:20px;">
  16. <a-col :md="24" :sm="12">
  17. <span style="float: right;" class="table-operator">
  18. <a-button type="primary" icon="download" @click="handleExportXls('成本分配-面料-转入数量')">导出</a-button>
  19. <a-button type="primary" @click="print" icon="printer" style="margin:0 10px;">打印</a-button>
  20. <a-button type="primary" @click="cancel" icon="rollback">取消</a-button>
  21. </span>
  22. </a-col>
  23. </a-row>
  24. </a-spin>
  25. </a-modal>
  26. </template>
  27. <script>
  28. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  29. import JEllipsis from '@/components/jeecg/JEllipsis'
  30. import moment from 'moment'
  31. import { downFile } from '@/api/manage'
  32. export default {
  33. name: 'FabInQuaModal', // 面料 转入数量 弹框
  34. mixins: [JeecgListMixin],
  35. components: { JEllipsis, moment },
  36. data() {
  37. return {
  38. // 面料 - 转入数量 表头
  39. columns: [
  40. {
  41. title: '存货名称',
  42. dataIndex: 'goodsName',
  43. width: 120,
  44. className: 'replacecolor'
  45. },
  46. {
  47. title: '颜色',
  48. dataIndex: 'color',
  49. width: 120,
  50. className: 'replacecolor'
  51. },
  52. {
  53. title: '计划单号',
  54. dataIndex: 'planCode',
  55. width: 120,
  56. className: 'replacecolor'
  57. },
  58. {
  59. title: '转入数量',
  60. dataIndex: 'number',
  61. width: 120,
  62. className: 'replacecolor'
  63. },
  64. {
  65. title: '单位成本',
  66. dataIndex: 'unitCost',
  67. width: 120,
  68. className: 'replacecolor'
  69. },
  70. {
  71. title: '总成本',
  72. dataIndex: 'cost',
  73. width: 120,
  74. className: 'replacecolor'
  75. }
  76. ],
  77. data: [],
  78. loading: false,
  79. confirmLoading: false,
  80. fabInQuaModVis: false
  81. }
  82. },
  83. // 接收父组件 方法
  84. props: {
  85. father: {
  86. type: Function,
  87. default: null
  88. }
  89. },
  90. methods: {
  91. // 导出
  92. handleExportXls(fileName) {
  93. console.log('需导出的fileName:', fileName)
  94. const params = this.dyeLossRateData
  95. console.log('导出参数', params)
  96. // downFile('/scas/dyeLoss/excel', params).then(data => {
  97. // console.log('888')
  98. // if (!data) {
  99. // this.$message.warning('文件下载失败')
  100. // return
  101. // }
  102. // if (typeof window.navigator.msSaveBlob !== 'undefined') {
  103. // window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
  104. // } else {
  105. // let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  106. // let link = document.createElement('a')
  107. // link.style.display = 'none'
  108. // link.href = url
  109. // link.setAttribute('download', fileName + '.xls')
  110. // document.body.appendChild(link)
  111. // link.click()
  112. // document.body.removeChild(link) // 下载完成移除元素
  113. // window.URL.revokeObjectURL(url) // 释放掉blob对象
  114. // }
  115. // })
  116. },
  117. // 打印
  118. print() {},
  119. cancel() {
  120. console.log('返回成本分配统计表')
  121. this.fabInQuaModVis = false
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="less" scoped>
  127. @import '~@assets/less/common.less';
  128. @import '~@assets/less/overwriter.less';
  129. /deep/ .ant-table-thead > tr > th {
  130. text-align: center;
  131. // font-weight: 700;
  132. }
  133. /deep/ .ant-table-tbody {
  134. text-align: center;
  135. }
  136. // /deep/ th.replacecolor {
  137. // background-color: #ccc;
  138. // }
  139. </style>