in-bound-check.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <!-- 入库检验 -->
  2. <template>
  3. <div class="check">
  4. <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryPage()">
  5. <el-form-item label="零件(物品)名称">
  6. <el-input v-model="dataForm.materialName" placeholder="零件(物品)名称" clearable/>
  7. </el-form-item>
  8. <el-form-item>
  9. <el-button @click="queryPage()">查询</el-button>
  10. </el-form-item>
  11. </el-form>
  12. <el-table
  13. :data="dataList"
  14. border
  15. v-loading="dataListLoading"
  16. style="width: 100%;">
  17. <el-table-column
  18. label="序号"
  19. type="index"
  20. width="50"
  21. align="center">
  22. </el-table-column>
  23. <el-table-column
  24. prop="inspectionCode"
  25. header-align="center"
  26. align="center"
  27. min-width="220"
  28. label="检验单编码">
  29. </el-table-column>
  30. <el-table-column
  31. prop="materialName"
  32. header-align="center"
  33. align="center"
  34. width="120"
  35. :show-tooltip-when-overflow="true"
  36. label="物品名称">
  37. </el-table-column>
  38. <el-table-column
  39. prop="materialTypeName"
  40. header-align="center"
  41. align="center"
  42. label="类别">
  43. </el-table-column>
  44. <el-table-column
  45. prop="specifications"
  46. header-align="center"
  47. align="center"
  48. width="120"
  49. :show-tooltip-when-overflow="true"
  50. label="规格">
  51. </el-table-column>
  52. <el-table-column
  53. prop="batchNumber"
  54. header-align="center"
  55. align="center"
  56. label="批次号">
  57. </el-table-column>
  58. <el-table-column
  59. prop="cnt"
  60. header-align="center"
  61. align="center"
  62. label="实际数量">
  63. </el-table-column>
  64. <el-table-column
  65. prop="qualifiedCnt"
  66. header-align="center"
  67. align="center"
  68. label="合格数量">
  69. </el-table-column>
  70. <el-table-column
  71. prop="unitName"
  72. header-align="center"
  73. align="center"
  74. label="单位">
  75. </el-table-column>
  76. <el-table-column
  77. prop="conclusion"
  78. header-align="center"
  79. align="center"
  80. label="检验结论">
  81. </el-table-column>
  82. <el-table-column
  83. prop="creatorName"
  84. header-align="center"
  85. align="center"
  86. label="检验员">
  87. </el-table-column>
  88. <el-table-column
  89. prop="applicant"
  90. header-align="center"
  91. align="center"
  92. label="申请人">
  93. </el-table-column>
  94. <el-table-column
  95. prop="state"
  96. header-align="center"
  97. align="center"
  98. :formatter="formatState"
  99. label="状态">
  100. </el-table-column>
  101. <el-table-column
  102. prop="notes"
  103. header-align="center"
  104. align="center"
  105. width="160"
  106. :show-tooltip-when-overflow="true"
  107. label="备注">
  108. </el-table-column>
  109. <el-table-column
  110. fixed="right"
  111. header-align="center"
  112. align="center"
  113. width="150"
  114. label="操作">
  115. <template slot-scope="scope">
  116. <el-button v-if="isAuth('quality:inspection:info')" type="text" size="small" @click="details(scope.row.inspectionId)">查看</el-button>
  117. <el-button v-if="isAuth('quality:inspection:update') && scope.row.state === '0'" type="text" size="small" @click="addOrUpdateHandle(scope.row.inspectionId)">处理</el-button>
  118. <el-button v-if="isAuth('quality:inspection:info:report') && scope.row.state === '1'" type="text" size="small" @click="exportPdf(scope.row.inspectionId)">导出</el-button>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <el-pagination
  123. @size-change="sizeChangeHandle"
  124. @current-change="currentChangeHandle"
  125. :current-page="pageIndex"
  126. :page-sizes="[10, 20, 50, 100]"
  127. :page-size="pageSize"
  128. :total="totalPage"
  129. layout="total, sizes, prev, pager, next, jumper">
  130. </el-pagination>
  131. <!-- 弹窗, 新增 / 修改 -->
  132. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  133. <export v-if="exportPageVisible" ref="exportPage"/>
  134. <detail v-if="detailVisible" ref="details"/>
  135. </div>
  136. </template>
  137. <script>
  138. import AddOrUpdate from './ibc-add-or-update'
  139. import Export from './ibc-export'
  140. import Detail from './ibc-detail'
  141. import { getInBoundCheckList } from '@/api/check'
  142. export default {
  143. name: 'in-bound-check',
  144. components: {AddOrUpdate, Export, Detail},
  145. data () {
  146. return {
  147. exportPageVisible: false,
  148. addOrUpdateVisible: false,
  149. detailVisible: false,
  150. dataForm: {},
  151. dataList: [],
  152. pageIndex: 1,
  153. pageSize: 10,
  154. totalPage: 0,
  155. dataListLoading: false,
  156. dataListSelections: [],
  157. optionsState: [
  158. {
  159. code: '0', value: '未处理'
  160. },
  161. {
  162. code: '1', value: '处理'
  163. }
  164. ]
  165. }
  166. },
  167. created () {
  168. this.getDataList()
  169. },
  170. methods: {
  171. // 查询
  172. queryPage () {
  173. this.pageIndex = 1
  174. this.getDataList()
  175. },
  176. // 获取数据列表
  177. getDataList () {
  178. this.dataListLoading = true
  179. let params = {
  180. 'current': this.pageIndex,
  181. 'size': this.pageSize,
  182. 'materialName': this.dataForm.materialName ? this.dataForm.materialName : null
  183. }
  184. getInBoundCheckList(params).then(({data}) => {
  185. if (data && data.code === '200') {
  186. this.dataList = data.data.records
  187. this.totalPage = Number(data.data.total)
  188. } else {
  189. this.dataList = []
  190. this.totalPage = 0
  191. }
  192. this.dataListLoading = false
  193. })
  194. },
  195. // 每页数
  196. sizeChangeHandle (val) {
  197. this.pageSize = val
  198. this.pageIndex = 1
  199. this.getDataList()
  200. },
  201. // 当前页
  202. currentChangeHandle (val) {
  203. this.pageIndex = val
  204. this.getDataList()
  205. },
  206. // 多选
  207. selectionChangeHandle (val) {
  208. this.dataListSelections = val
  209. },
  210. // 新增 / 修改
  211. addOrUpdateHandle (id) {
  212. this.addOrUpdateVisible = true
  213. this.$nextTick(() => {
  214. this.$refs.addOrUpdate.init(id)
  215. })
  216. },
  217. exportPdf (id) {
  218. this.exportPageVisible = true
  219. this.$nextTick(() => {
  220. this.$refs.exportPage.init(id)
  221. })
  222. },
  223. details (id) {
  224. this.detailVisible = true
  225. this.$nextTick(() => {
  226. this.$refs.details.init(id)
  227. })
  228. },
  229. // 转换属性“状态”
  230. formatState (row) {
  231. if (!row.state) return ''
  232. const item1 = this.optionsState.find((item) => item.code === row.state.toString())
  233. return item1 ? item1.value : ''
  234. }
  235. }
  236. }
  237. </script>
  238. <style scoped>
  239. </style>