unqualified.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <!-- 不合格品台账 -->
  2. <template>
  3. <div>
  4. <template v-if="!inboundVisible">
  5. <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
  6. <el-form-item label="物料名称">
  7. <el-input
  8. v-model="dataForm.productName"
  9. placeholder="请输入物料名称"
  10. clearable
  11. />
  12. </el-form-item>
  13. <el-form-item label="生产批次号">
  14. <el-input
  15. v-model="dataForm.batchNumber"
  16. placeholder="请输入批次号"
  17. clearable
  18. />
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button @click="search()">查询</el-button>
  22. </el-form-item>
  23. </el-form>
  24. <el-table
  25. :data="dataList"
  26. border
  27. v-loading="dataListLoading"
  28. style="width: 100%"
  29. >
  30. <el-table-column
  31. label="序号"
  32. type="index"
  33. width="50"
  34. align="center"
  35. ></el-table-column>
  36. <el-table-column
  37. prop="disqualificationCode"
  38. header-align="center"
  39. align="center"
  40. min-width="120"
  41. :show-tooltip-when-overflow="true"
  42. label="不合格品编码"
  43. >
  44. </el-table-column>
  45. <el-table-column
  46. prop="invoicesCode"
  47. header-align="center"
  48. align="center"
  49. min-width="120"
  50. :show-tooltip-when-overflow="true"
  51. label="审理编码"
  52. >
  53. </el-table-column>
  54. <el-table-column
  55. prop="orderCode"
  56. header-align="center"
  57. align="center"
  58. min-width="120"
  59. :show-tooltip-when-overflow="true"
  60. label="任务单编码"
  61. >
  62. </el-table-column>
  63. <el-table-column
  64. prop="batchNumber"
  65. header-align="center"
  66. align="center"
  67. min-width="120"
  68. :show-tooltip-when-overflow="true"
  69. label="批次号"
  70. >
  71. </el-table-column>
  72. <el-table-column
  73. prop="productName"
  74. header-align="center"
  75. align="center"
  76. min-width="120"
  77. :show-tooltip-when-overflow="true"
  78. label="物料名称"
  79. >
  80. </el-table-column>
  81. <el-table-column
  82. prop="damageCnt"
  83. header-align="center"
  84. align="center"
  85. min-width="100"
  86. :show-tooltip-when-overflow="true"
  87. label="不合格数量"
  88. >
  89. </el-table-column>
  90. <el-table-column
  91. prop="stateStr"
  92. header-align="center"
  93. align="center"
  94. min-width="120"
  95. :show-tooltip-when-overflow="true"
  96. label="处理状态"
  97. >
  98. </el-table-column>
  99. <el-table-column
  100. fixed="right"
  101. header-align="center"
  102. align="center"
  103. width="150"
  104. label="操作"
  105. >
  106. <template slot-scope="scope">
  107. <el-button
  108. v-if="isAuth('wh:in:inbound')"
  109. type="text"
  110. size="small"
  111. @click="inboundHandle(scope.row)"
  112. >入库</el-button
  113. >
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. <el-pagination
  118. @size-change="sizeChangeHandle"
  119. @current-change="currentChangeHandle"
  120. :current-page="pageIndex"
  121. :page-sizes="[10, 20, 50, 100]"
  122. :page-size="pageSize"
  123. :total="totalPage"
  124. layout="total, sizes, prev, pager, next, jumper"
  125. >
  126. </el-pagination>
  127. </template>
  128. <stock-order-inbound ref="inbound" v-if="inboundVisible" @onChose="onChose"/>
  129. </div>
  130. </template>
  131. <script>
  132. import {getUnqList} from '@/api/quality'
  133. import StockOrderInbound from '../warehouse/stock-order-inbound'
  134. export default {
  135. name: 'quality-unqualified',
  136. components: {StockOrderInbound},
  137. data () {
  138. return {
  139. inboundVisible: false,
  140. dataForm: {},
  141. dataList: [],
  142. pageIndex: 1,
  143. pageSize: 10,
  144. totalPage: 0,
  145. dataListLoading: false
  146. }
  147. },
  148. mounted () {},
  149. created () {
  150. this.search()
  151. },
  152. methods: {
  153. onChose () {
  154. this.inboundVisible = false
  155. },
  156. search () {
  157. this.pageIndex = 1
  158. this.getDataList()
  159. },
  160. // 每页数
  161. sizeChangeHandle (val) {
  162. this.pageSize = val
  163. this.pageIndex = 1
  164. this.getDataList()
  165. },
  166. // 当前页
  167. currentChangeHandle (val) {
  168. this.pageIndex = val
  169. this.getDataList()
  170. },
  171. getDataList () {
  172. this.dataListLoading = true
  173. let param = {
  174. current: this.pageIndex,
  175. size: this.pageSize,
  176. batchNumber: this.dataForm.batchNumber,
  177. productName: this.dataForm.productName
  178. }
  179. getUnqList(param).then(({ data }) => {
  180. if (data && data.code === '200') {
  181. this.dataList = data.data.records
  182. this.totalPage = Number(data.data.total)
  183. this.dataList.forEach(item => {
  184. item.stateStr = item.state === '1' ? '待入库' : item.state === '2' ? '已入库' : ''
  185. })
  186. } else {
  187. this.dataList = []
  188. this.totalPage = 0
  189. }
  190. this.dataListLoading = false
  191. })
  192. },
  193. inboundHandle (item) {
  194. item.sourceCategory = '4'
  195. item.cnt = item.damageCnt
  196. this.inboundVisible = true
  197. this.$nextTick(() => {
  198. this.$refs.inbound.init(0, false, item)
  199. })
  200. }
  201. }
  202. }
  203. </script>
  204. <style lang="scss" scoped>
  205. </style>