ingInQuaModal.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <!-- 辅料 转入数量 成本分配统计表 -->
  3. <a-modal
  4. title="转入数量"
  5. v-model="ingInQuaModVis"
  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: 'IngInQuaModal', // 辅料 转入数量 弹框
  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: 'planCode',
  49. width: 120,
  50. className: 'replacecolor'
  51. },
  52. {
  53. title: '转入数量',
  54. dataIndex: 'number',
  55. width: 120,
  56. className: 'replacecolor',
  57. customRender: (text, record, index) => {
  58. var re = Number(text).toFixed(2)
  59. return re
  60. }
  61. },
  62. {
  63. title: '单位成本',
  64. dataIndex: 'unitCost',
  65. width: 120,
  66. className: 'replacecolor',
  67. customRender: (text, record, index) => {
  68. var re = Number(text).toFixed(3)
  69. return re
  70. }
  71. },
  72. {
  73. title: '总成本',
  74. dataIndex: 'cost',
  75. width: 120,
  76. className: 'replacecolor',
  77. customRender: (text, record, index) => {
  78. var re = Number(text).toFixed(2)
  79. return re
  80. }
  81. }
  82. ],
  83. data: [],
  84. loading: false, // 表格加载
  85. // orderDataform: this.$form.createForm(this),
  86. confirmLoading: false,
  87. ingInQuaModVis: false
  88. }
  89. },
  90. // 接收父组件 方法
  91. props: {
  92. father: {
  93. type: Function,
  94. default: null
  95. }
  96. },
  97. methods: {
  98. // 导出
  99. handleExportXls(fileName) {
  100. console.log('需导出的fileName:', fileName)
  101. const params = this.dyeLossRateData
  102. console.log('导出参数', params)
  103. // downFile('/scas/dyeLoss/excel', params).then(data => {
  104. // console.log('888')
  105. // if (!data) {
  106. // this.$message.warning('文件下载失败')
  107. // return
  108. // }
  109. // if (typeof window.navigator.msSaveBlob !== 'undefined') {
  110. // window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls')
  111. // } else {
  112. // let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  113. // let link = document.createElement('a')
  114. // link.style.display = 'none'
  115. // link.href = url
  116. // link.setAttribute('download', fileName + '.xls')
  117. // document.body.appendChild(link)
  118. // link.click()
  119. // document.body.removeChild(link) // 下载完成移除元素
  120. // window.URL.revokeObjectURL(url) // 释放掉blob对象
  121. // }
  122. // })
  123. },
  124. // 打印
  125. print() {},
  126. cancel() {
  127. console.log('返回成本分配统计表')
  128. this.ingInQuaModVis = false
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="less" scoped>
  134. @import '~@assets/less/common.less';
  135. @import '~@assets/less/overwriter.less';
  136. /deep/ .ant-table-thead > tr > th {
  137. text-align: center;
  138. // font-weight: 700;
  139. }
  140. /deep/ .ant-table-tbody {
  141. text-align: center;
  142. }
  143. // /deep/ th.replacecolor {
  144. // background-color: #ccc;
  145. // }
  146. </style>