View.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <el-dialog
  3. title="补单信息"
  4. width="1200px"
  5. :append-to-body="true"
  6. :visible.sync="isVisible"
  7. class="tenant-view"
  8. >
  9. <div>
  10. <!-- 列表数据 -->
  11. <el-table
  12. :key="tableKey"
  13. ref="table"
  14. v-loading="loading"
  15. :data="tableData.records"
  16. border
  17. fit
  18. style="width: 100%;"
  19. >
  20. <!-- 序号 -->
  21. <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
  22. <template slot-scope="scope">
  23. <div>
  24. {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
  25. </div>
  26. </template>
  27. </el-table-column>
  28. <el-table-column prop="furnaceBatchNo" label='产品名称' :show-overflow-tooltip="true" width="150px"></el-table-column>
  29. <el-table-column prop="meterialCode" label='产品唯一码' :show-overflow-tooltip="true" width="200px"></el-table-column>
  30. <el-table-column prop="factory" label='质检结果' :show-overflow-tooltip="true" width="150px"></el-table-column>
  31. <el-table-column prop="meterialBatchNo" label='数量' :show-overflow-tooltip="true" width="150px"></el-table-column>
  32. <el-table-column prop="factoryDate" label='质检人' :show-overflow-tooltip="true" width="150px"></el-table-column>
  33. <el-table-column prop="batchStand" label='补单单号' :show-overflow-tooltip="true" width="150px"></el-table-column>
  34. <el-table-column prop="createUser" label='所属订单号' :show-overflow-tooltip="true" width="150px"></el-table-column>
  35. <el-table-column prop="createTime" label='所属计划' :show-overflow-tooltip="true" width="150px"></el-table-column>
  36. <el-table-column prop="usedNum" label='生成单据时间' :show-overflow-tooltip="true" width="150px"></el-table-column>
  37. <el-table-column prop="lastNum" label='生成人' :show-overflow-tooltip="true" width="150px"></el-table-column>
  38. <el-table-column prop="lastNum" label='处理时间' :show-overflow-tooltip="true" width="150px"></el-table-column>
  39. <el-table-column prop="lastNum" label='处理人' :show-overflow-tooltip="true" width="150px"></el-table-column>
  40. </el-table>
  41. <!-- 分页组件 -->
  42. <pagination
  43. v-show="tableData.total > 0"
  44. :limit.sync="queryParams.size"
  45. :page.sync="queryParams.current"
  46. :total="Number(tableData.total)"
  47. @pagination="fetch"
  48. />
  49. </div>
  50. </el-dialog>
  51. </template>
  52. <script>
  53. // 【分页】组件
  54. import Pagination from "@/components/Pagination"
  55. // 【原材料接收管理】-API
  56. import ReceiveApi from "@/api/prepareProductMgr/receive"
  57. // 【共通-工具】
  58. import { initQueryParams } from '@/utils/commons'
  59. export default {
  60. name: 'TenantView',
  61. components: { Pagination },
  62. props: {
  63. dialogVisible: {
  64. type: Boolean,
  65. default: false
  66. }
  67. },
  68. data () {
  69. return {
  70. screenWidth: 0,
  71. width: this.initWidth(),
  72. tenant: {},
  73. tableKey: 0,
  74. queryParams: initQueryParams({}),
  75. selection: [],
  76. loading: false,
  77. tableData: {
  78. total: 0
  79. },
  80. }
  81. },
  82. computed: {
  83. isVisible: {
  84. get () {
  85. return this.dialogVisible
  86. },
  87. set () {
  88. this.close()
  89. }
  90. }
  91. },
  92. mounted () {
  93. window.onresize = () => {
  94. return (() => {
  95. this.width = this.initWidth()
  96. })()
  97. }
  98. },
  99. methods: {
  100. initWidth () {
  101. this.screenWidth = document.body.clientWidth
  102. if (this.screenWidth < 550) {
  103. return '95%'
  104. } else if (this.screenWidth < 990) {
  105. return '580px'
  106. } else if (this.screenWidth < 1400) {
  107. return '600px'
  108. } else {
  109. return '650px'
  110. }
  111. },
  112. // 接收来自其他组件的-函数
  113. setTenant (val) {
  114. this.tenant = { ...val }
  115. // 获取列表数据
  116. this.fetch();
  117. },
  118. // 分页列表
  119. fetch (params = {}) {
  120. this.loading = true
  121. if (this.queryParams.timeRange) {
  122. this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
  123. this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
  124. }
  125. //
  126. this.queryParams.current = params.current ? params.current : this.queryParams.current
  127. this.queryParams.size = params.size ? params.size : this.queryParams.size
  128. // 搜索条件添加-材料的id
  129. this.queryParams.model.meterialId = this.tenant.id;
  130. ReceiveApi.page(this.queryParams).then(response => {
  131. const res = response.data
  132. if (res.isSuccess) {
  133. this.tableData = res.data
  134. }
  135. // eslint-disable-next-line no-return-assign
  136. }).finally(() => this.loading = false)
  137. },
  138. close () {
  139. this.$emit('close')
  140. }
  141. }
  142. }
  143. </script>
  144. <style lang="scss" scoped>
  145. .tenant-view {
  146. .img-wrapper {
  147. text-align: center;
  148. margin-top: -1.5rem;
  149. margin-bottom: 10px;
  150. img {
  151. width: 4rem;
  152. border-radius: 50%;
  153. }
  154. }
  155. .view-item {
  156. margin: 7px;
  157. i {
  158. font-size: 0.97rem;
  159. }
  160. span {
  161. margin-left: 5px;
  162. }
  163. }
  164. }
  165. </style>