monitoring.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <!-- 生产监控管理 -->
  2. <template>
  3. <div class="production">
  4. <template v-if="!detailsVisible">
  5. <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryPage()">
  6. <el-form-item label="合同号">
  7. <el-input v-model="dataForm.orderCode" placeholder="合同号" clearable/>
  8. </el-form-item>
  9. <el-form-item label="产品名称">
  10. <el-input v-model="dataForm.productName" placeholder="产品名称" clearable/>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button @click="queryPage()">查询</el-button>
  14. <el-button v-if="false" type="primary" disabled @click="createNewProduct()">创建新产品</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <el-table
  18. :data="dataList"
  19. border
  20. v-loading="dataListLoading"
  21. style="width: 100%;">
  22. <el-table-column
  23. label="序号"
  24. type="index"
  25. width="50"
  26. align="center">
  27. </el-table-column>
  28. <el-table-column
  29. prop="prodCode"
  30. header-align="center"
  31. align="center"
  32. min-width="100"
  33. :show-tooltip-when-overflow="true"
  34. label="产品编号">
  35. </el-table-column>
  36. <el-table-column
  37. prop="productName"
  38. header-align="center"
  39. align="center"
  40. min-width="160"
  41. :show-tooltip-when-overflow="true"
  42. label="产品名称">
  43. </el-table-column>
  44. <el-table-column
  45. prop="progressBar"
  46. header-align="center"
  47. align="center"
  48. min-width="100"
  49. label="生产进度">
  50. <template slot-scope="scope">
  51. <el-progress :percentage="scope.row.progressBar?Number(scope.row.progressBar):0"></el-progress>
  52. </template>
  53. </el-table-column>
  54. <el-table-column
  55. prop="contactDate"
  56. header-align="center"
  57. align="center"
  58. min-width="160"
  59. label="交期时间">
  60. </el-table-column>
  61. <el-table-column
  62. prop="orderCode"
  63. header-align="center"
  64. align="center"
  65. min-width="120"
  66. :show-tooltip-when-overflow="true"
  67. label="合同号">
  68. </el-table-column>
  69. <el-table-column
  70. prop="customerName"
  71. header-align="center"
  72. align="center"
  73. min-width="160"
  74. :show-tooltip-when-overflow="true"
  75. label="客户名称">
  76. </el-table-column>
  77. <el-table-column
  78. fixed="right"
  79. header-align="center"
  80. align="center"
  81. width="150"
  82. label="操作">
  83. <template slot-scope="scope">
  84. <el-button v-if="isAuth('prod:monitoring:info')" type="text" size="small" @click="detail(scope.row.id, scope.row.prodCode, true)">查看</el-button>
  85. </template>
  86. </el-table-column>
  87. </el-table>
  88. <el-pagination
  89. @size-change="sizeChangeHandle"
  90. @current-change="currentChangeHandle"
  91. :current-page="pageIndex"
  92. :page-sizes="[10, 20, 50, 100]"
  93. :page-size="pageSize"
  94. :total="totalPage"
  95. layout="total, sizes, prev, pager, next, jumper">
  96. </el-pagination>
  97. </template>
  98. <!-- 弹窗, 查看 -->
  99. <detail v-if="detailsVisible" ref="details" @close="closeDialogEvent" @refreshDataList="getDataList" @onChose="onChose"/>
  100. </div>
  101. </template>
  102. <script>
  103. import Detail from './monitoring-details'
  104. import { getMonitoringList } from '@/api/production'
  105. export default {
  106. name: 'monitoring',
  107. components: {Detail},
  108. data () {
  109. return {
  110. detailsVisible: false,
  111. dataForm: {},
  112. dataList: [],
  113. pageIndex: 1,
  114. pageSize: 10,
  115. totalPage: 0,
  116. dataListLoading: false,
  117. dataListSelections: [],
  118. // 状态:1:待排产,2:生产中,3:生产完成
  119. optionsState: [
  120. {
  121. code: '1',
  122. value: '待排产'
  123. },
  124. {
  125. code: '2',
  126. value: '生产中'
  127. },
  128. {
  129. code: '3',
  130. value: '生产完成'
  131. }
  132. ]
  133. }
  134. },
  135. created () {
  136. this.getDataList()
  137. },
  138. methods: {
  139. onChose () {
  140. this.detailsVisible = false
  141. },
  142. // 查询
  143. queryPage () {
  144. this.pageIndex = 1
  145. this.getDataList()
  146. },
  147. // 获取数据列表
  148. getDataList () {
  149. this.dataListLoading = true
  150. let params = {
  151. 'current': this.pageIndex,
  152. 'size': this.pageSize,
  153. 'productName': this.dataForm.productName ? this.dataForm.productName : null,
  154. 'orderCode': this.dataForm.orderCode ? this.dataForm.orderCode : null
  155. }
  156. getMonitoringList(params).then(({data}) => {
  157. if (data && data.code === '200') {
  158. this.dataList = data.data.records
  159. this.totalPage = Number(data.data.total)
  160. } else {
  161. this.dataList = []
  162. this.totalPage = 0
  163. }
  164. console.log('monitor')
  165. this.dataListLoading = false
  166. })
  167. },
  168. // 每页数
  169. sizeChangeHandle (val) {
  170. this.pageSize = val
  171. this.pageIndex = 1
  172. this.getDataList()
  173. },
  174. // 当前页
  175. currentChangeHandle (val) {
  176. this.pageIndex = val
  177. this.getDataList()
  178. },
  179. // 多选
  180. selectionChangeHandle (val) {
  181. this.dataListSelections = val
  182. },
  183. // 新增 / 修改
  184. detail (id, prodCode, disable) {
  185. this.detailsVisible = true
  186. this.$nextTick(() => {
  187. this.$refs.details.init(id, prodCode, disable)
  188. })
  189. },
  190. // 创建新产品
  191. createNewProduct () {
  192. this.$message.warning('功能暂未开放')
  193. },
  194. closeDialogEvent () {
  195. this.detailsVisible = false
  196. }
  197. }
  198. }
  199. </script>
  200. <style scoped>
  201. </style>