ingRemQuaModal.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <!-- 辅料 余下数量 成本分配统计表-->
  3. <a-modal
  4. title="余下数量"
  5. v-model="ingRemQuaModVis"
  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: 'IngRemQuaModal', // 辅料 余下数量 弹框
  34. mixins: [JeecgListMixin],
  35. components: { JEllipsis, moment },
  36. data() {
  37. return {
  38. // 辅料 - 余下数量 表头
  39. columns: [
  40. {
  41. title: '存货名称',
  42. dataIndex: 'inventoryName',
  43. width: 120,
  44. className: 'replacecolor'
  45. },
  46. {
  47. title: '计划单号',
  48. dataIndex: 'planNum',
  49. width: 120,
  50. className: 'replacecolor'
  51. },
  52. {
  53. title: '使用数量',
  54. dataIndex: 'usageQuantity',
  55. width: 120,
  56. className: 'replacecolor'
  57. },
  58. {
  59. title: '单位成本',
  60. dataIndex: 'unitCost',
  61. width: 120,
  62. className: 'replacecolor'
  63. },
  64. {
  65. title: '总成本',
  66. dataIndex: 'totalCost',
  67. width: 120,
  68. className: 'replacecolor'
  69. }
  70. ],
  71. data: [{},{}],
  72. loading: false,
  73. confirmLoading: false,
  74. ingRemQuaModVis: false
  75. }
  76. },
  77. // 接收父组件 方法
  78. props: {
  79. father: {
  80. type: Function,
  81. default: null
  82. }
  83. },
  84. created() {},
  85. methods: {
  86. // 导出
  87. handleExportXls(fileName) {
  88. console.log('需导出的fileName:', fileName)
  89. const params = this.dyeLossRateData
  90. console.log('导出参数', params)
  91. // downFile('/scas/dyeLoss/excel', params).then(data => {
  92. // console.log('888')
  93. // if (!data) {
  94. // this.$message.warning('文件下载失败')
  95. // return
  96. // }
  97. // if (typeof window.navigator.msSaveBlob !== 'undefined') {
  98. // window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
  99. // } else {
  100. // let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  101. // let link = document.createElement('a')
  102. // link.style.display = 'none'
  103. // link.href = url
  104. // link.setAttribute('download', fileName + '.xls')
  105. // document.body.appendChild(link)
  106. // link.click()
  107. // document.body.removeChild(link) // 下载完成移除元素
  108. // window.URL.revokeObjectURL(url) // 释放掉blob对象
  109. // }
  110. // })
  111. },
  112. // 打印
  113. print() {},
  114. cancel() {
  115. console.log('返回成本分配统计表')
  116. this.ingRemQuaModVis = false
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="less" scoped>
  122. @import '~@assets/less/common.less';
  123. @import '~@assets/less/overwriter.less';
  124. /deep/ .ant-table-thead > tr > th {
  125. text-align: center;
  126. // font-weight: 700;
  127. }
  128. /deep/ .ant-table-tbody {
  129. text-align: center;
  130. }
  131. // /deep/ th.replacecolor {
  132. // background-color: #ccc;
  133. // }
  134. </style>