index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <order-search @search="reload" ref="searchRef"> </order-search>
  5. <ele-pro-table
  6. ref="table"
  7. :columns="columns"
  8. :datasource="datasource"
  9. >
  10. <!-- 操作列 -->
  11. <template v-slot:toolbar>
  12. <el-button type="success" @click="open()">新建</el-button>
  13. </template>
  14. <template v-slot:action="{ row }">
  15. <el-link
  16. type="primary"
  17. :underline="false"
  18. icon="el-icon-truck"
  19. v-if="row.status == 0"
  20. @click="open(row)"
  21. >
  22. 编辑
  23. </el-link>
  24. <el-popconfirm
  25. class="ele-action"
  26. title="确定要删除吗?"
  27. v-if="row.status == 0"
  28. @confirm="remove(row)"
  29. >
  30. <template v-slot:reference>
  31. <el-link type="danger" :underline="false" icon="el-icon-delete">
  32. 删除
  33. </el-link>
  34. </template>
  35. </el-popconfirm>
  36. <el-link
  37. type="primary"
  38. :underline="false"
  39. icon="el-icon-edit"
  40. @click="detail(row)"
  41. >
  42. 处置
  43. </el-link>
  44. </template>
  45. </ele-pro-table>
  46. </el-card>
  47. <Create ref="create" @refresh="reload" />
  48. </div>
  49. </template>
  50. <script>
  51. import OrderSearch from './components/order-search.vue';
  52. import dictMixins from '@/mixins/dictMixins';
  53. import { unacceptedProductStatus } from '@/utils/util';
  54. import Create from './components/create';
  55. import { getList,deleteUnacceptedProduct } from '@/api/unacceptedProduct/index';
  56. export default {
  57. components: {
  58. OrderSearch,
  59. Create
  60. },
  61. mixins: [dictMixins],
  62. data() {
  63. return {
  64. visible: false,
  65. loading: false,
  66. releasParams: {
  67. teamId: '',
  68. id: ''
  69. },
  70. current: null
  71. };
  72. },
  73. computed: {
  74. // 表格列配置
  75. columns() {
  76. return [
  77. {
  78. columnKey: 'index',
  79. label: '序号',
  80. type: 'index',
  81. width: 55,
  82. align: 'center',
  83. showOverflowTooltip: true,
  84. fixed: 'left'
  85. },
  86. {
  87. prop: 'code',
  88. label: '编码',
  89. align: 'center'
  90. },
  91. {
  92. prop: 'unqualifiedSourceCode',
  93. label: '来源编码',
  94. align: 'center'
  95. },
  96. {
  97. prop: 'batchNo',
  98. label: '批次号',
  99. align: 'center'
  100. },
  101. {
  102. prop: 'unqualifiedQuantity',
  103. label: '数量',
  104. align: 'center'
  105. },
  106. {
  107. prop: 'produceRoutingName',
  108. label: '工艺路线',
  109. align: 'center'
  110. },
  111. {
  112. prop: 'produceTaskName',
  113. label: '工序',
  114. align: 'center'
  115. },
  116. {
  117. prop: 'createTime',
  118. label: '创建时间',
  119. align: 'center'
  120. },
  121. {
  122. prop: 'reviewerName',
  123. label: '创建人',
  124. align: 'center'
  125. },
  126. // {
  127. // prop: 'slottingType',
  128. // label: '状态',
  129. // align: 'center',
  130. // slot: 'SlottingType'
  131. // },
  132. {
  133. prop: 'status',
  134. label: '状态',
  135. align: 'center',
  136. formatter: (row, column, cellValue) => {
  137. return unacceptedProductStatus(cellValue);
  138. }
  139. },
  140. {
  141. columnKey: 'action',
  142. label: '操作',
  143. width: 240,
  144. align: 'center',
  145. resizable: false,
  146. fixed: 'right',
  147. slot: 'action',
  148. showOverflowTooltip: true
  149. }
  150. ];
  151. }
  152. },
  153. created() {
  154. },
  155. filters: {
  156. },
  157. methods: {
  158. //处置
  159. detail(row) {
  160. this.$router.push({
  161. path: '/unacceptedProduct/detailList',
  162. query: {
  163. id: row.id
  164. }
  165. });
  166. },
  167. /* 表格数据源 */
  168. datasource({ page, limit, where }) {
  169. return getList({
  170. pageNum: page,
  171. size: limit,
  172. ...where
  173. });
  174. },
  175. open(row) {
  176. this.$refs.create.open(row?JSON.parse(JSON.stringify(row)):'');
  177. },
  178. remove(row) {
  179. deleteUnacceptedProduct(row.id).then((res) => {
  180. this.$message.success('删除'+res);
  181. this.reload();
  182. });
  183. },
  184. // // 下达
  185. // toRelease(row) {
  186. // this.current = row;
  187. // this.visible = true;
  188. // },
  189. // // 下达
  190. // confirm(row) {
  191. // this.$confirm('确认下发选中的任务吗?', '提示', {
  192. // confirmButtonText: '确定',
  193. // cancleButtonText: '取消',
  194. // type: 'warning'
  195. // })
  196. // .then(async () => {
  197. // const res = await issuedPutMeshWorkOrder({
  198. // id: [row.id],
  199. // status: 1
  200. // });
  201. // this.$message.success('任务下发成功!');
  202. // this.reload();
  203. // })
  204. // .catch(() => {});
  205. // },
  206. /* 刷新表格 */
  207. reload(where) {
  208. this.$nextTick(() => {
  209. this.$refs.table.reload({ page: 1, where });
  210. });
  211. }
  212. }
  213. };
  214. </script>
  215. <style lang="scss" scoped></style>