index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <!-- 降级使用列表 -->
  2. <template>
  3. <div class="ele-body">
  4. <el-card shadow="never" v-loading="loading">
  5. <order-search @search="reload" ref="searchRef"> </order-search>
  6. <ele-pro-table
  7. ref="table"
  8. :columns="columns"
  9. :datasource="datasource"
  10. :selection.sync="selection"
  11. :page-size="20"
  12. >
  13. <template v-slot:action="{ row }">
  14. <el-popconfirm
  15. class="ele-action"
  16. title="确定要删除吗?"
  17. v-if="row.status == 1"
  18. @confirm="remove(row)"
  19. >
  20. <template v-slot:reference>
  21. <el-link type="danger" :underline="false" icon="el-icon-delete">
  22. 删除
  23. </el-link>
  24. </template>
  25. </el-popconfirm>
  26. <el-link
  27. slot="reference"
  28. type="primary"
  29. :underline="false"
  30. icon="el-icon-edit"
  31. v-if="row.status == 0"
  32. @click="disposeList(row)"
  33. >
  34. 处置
  35. </el-link>
  36. </template>
  37. </ele-pro-table>
  38. </el-card>
  39. <SalesToProduction ref="salesToProductionRef" @success="reload" />
  40. </div>
  41. </template>
  42. <script>
  43. import OrderSearch from '../components/probationalGoods-search.vue';
  44. import SalesToProduction from '../components/salesToProduction.vue';
  45. import dictMixins from '@/mixins/dictMixins';
  46. import {
  47. getDowngradeuseList,
  48. deleteScrapProducts
  49. } from '@/api/unacceptedProduct/index';
  50. export default {
  51. components: {
  52. OrderSearch,
  53. SalesToProduction
  54. },
  55. mixins: [dictMixins],
  56. data() {
  57. return {
  58. loading: false,
  59. dialogVisible: false,
  60. current: null,
  61. selection: [],
  62. disposeType: '',
  63. releasParams: {
  64. teamId: '',
  65. id: ''
  66. }
  67. };
  68. },
  69. computed: {
  70. // 表格列配置
  71. columns() {
  72. return [
  73. {
  74. columnKey: 'index',
  75. label: '序号',
  76. type: 'index',
  77. width: 55,
  78. align: 'center',
  79. showOverflowTooltip: true,
  80. fixed: 'left'
  81. },
  82. {
  83. prop: 'code',
  84. label: '编码',
  85. align: 'center',
  86. width: 160,
  87. showOverflowTooltip: true
  88. },
  89. {
  90. prop: 'sampleCode',
  91. label: '样品编码',
  92. align: 'center',
  93. width: 160,
  94. showOverflowTooltip: true
  95. },
  96. {
  97. prop: 'categoryCode',
  98. label: '物品编码',
  99. align: 'center',
  100. width: 160,
  101. showOverflowTooltip: true
  102. },
  103. {
  104. prop: 'categoryName',
  105. label: '物品名称',
  106. align: 'center',
  107. width: 160,
  108. showOverflowTooltip: true
  109. },
  110. {
  111. prop: 'batchNo',
  112. label: '批次号',
  113. align: 'center',
  114. width: 100,
  115. showOverflowTooltip: true
  116. },
  117. {
  118. prop: 'specification',
  119. label: '规格',
  120. align: 'center',
  121. width: 100,
  122. showOverflowTooltip: true
  123. },
  124. {
  125. prop: 'brandNum',
  126. label: '牌号',
  127. align: 'center',
  128. width: 100,
  129. showOverflowTooltip: true
  130. },
  131. {
  132. prop: 'modelType',
  133. label: '型号',
  134. align: 'center',
  135. width: 160,
  136. showOverflowTooltip: true
  137. },
  138. {
  139. label: '机型',
  140. prop: 'modelKey',
  141. align: 'center',
  142. showOverflowTooltip: true
  143. },
  144. {
  145. label: '颜色',
  146. prop: 'colorKey',
  147. align: 'center',
  148. showOverflowTooltip: true
  149. },
  150. {
  151. prop: 'measureQuantity',
  152. label: '计量数量',
  153. align: 'center',
  154. width: 100,
  155. showOverflowTooltip: true
  156. },
  157. {
  158. prop: 'measureUnit',
  159. label: '计量单位',
  160. align: 'center',
  161. width: 100,
  162. showOverflowTooltip: true
  163. },
  164. {
  165. prop: 'weight',
  166. label: '重量',
  167. align: 'center',
  168. width: 100,
  169. showOverflowTooltip: true
  170. },
  171. {
  172. prop: 'weightUnit',
  173. label: '重量单位',
  174. align: 'center',
  175. width: 100,
  176. showOverflowTooltip: true
  177. },
  178. // {
  179. // prop: 'disposeTime',
  180. // label: '处置时间',
  181. // align: 'center',
  182. // width: 180,
  183. // showOverflowTooltip: true
  184. // },
  185. {
  186. prop: 'produceRoutingName',
  187. label: '工艺路线',
  188. align: 'center'
  189. },
  190. {
  191. prop: 'produceTaskName',
  192. label: '工序',
  193. align: 'center'
  194. },
  195. {
  196. prop: 'unqualifiedReason',
  197. label: '原因',
  198. align: 'center'
  199. },
  200. {
  201. prop: 'createTime',
  202. label: '创建时间',
  203. align: 'center',
  204. width: 160
  205. },
  206. // {
  207. // prop: 'reviewerName',
  208. // label: '创建人',
  209. // align: 'center'
  210. // },
  211. // {
  212. // prop: 'depotName',
  213. // label: '仓库名称',
  214. // align: 'center'
  215. // },
  216. // {
  217. // prop: 'status',
  218. // label: '状态',
  219. // align: 'center',
  220. // formatter: (row, column, cellValue) => {
  221. // return cellValue == 0 ? '未入库' : cellValue == 1 ? '已入库' : '';
  222. // }
  223. // }
  224. // {
  225. // columnKey: 'action',
  226. // label: '操作',
  227. // width: 150,
  228. // align: 'center',
  229. // resizable: false,
  230. // fixed: 'right',
  231. // slot: 'action',
  232. // showOverflowTooltip: true
  233. // }
  234. ];
  235. }
  236. },
  237. created() {},
  238. filters: {},
  239. methods: {
  240. /* 表格数据源 */
  241. datasource({ page, limit, where }) {
  242. return getDowngradeuseList({
  243. pageNum: page,
  244. size: limit,
  245. ...where
  246. });
  247. },
  248. remove(row) {
  249. let ids = row ? [row.id] : this.selection.map((item) => item.id);
  250. deleteScrapProducts(ids).then((res) => {
  251. this.$message.success('删除' + res);
  252. this.reload();
  253. });
  254. },
  255. open(type) {
  256. let isCode = true,
  257. isBatchNo = true;
  258. this.selection.forEach((item) => {
  259. this.selection.forEach((item1) => {
  260. if (item.productCodeNew != item1.productCodeNew) {
  261. isCode = false;
  262. }
  263. if (item.batchNo != item1.batchNo) {
  264. isBatchNo = false;
  265. }
  266. });
  267. });
  268. if (!isCode) {
  269. this.$message.error('产品编码不一致!');
  270. return;
  271. }
  272. if (!isBatchNo) {
  273. this.$message.error('批次号不一致!');
  274. return;
  275. }
  276. this.$refs.salesToProductionRef.open(this.selection, type);
  277. },
  278. async disposeList(row) {
  279. if (row && row.id) {
  280. this.current = row;
  281. this.dialogVisible = true;
  282. return;
  283. }
  284. let ids = this.current
  285. ? [this.current.id]
  286. : this.selection.map((item) => item.id);
  287. await dispose({
  288. id: ids,
  289. disposeType: Number(this.disposeType)
  290. });
  291. this.dialogVisible = false;
  292. this.current = null;
  293. this.$message.success('处置成功!');
  294. this.getList();
  295. },
  296. /* 刷新表格 */
  297. reload(where) {
  298. this.$nextTick(() => {
  299. this.$refs.table.reload({ page: 1, where });
  300. });
  301. }
  302. }
  303. };
  304. </script>
  305. <style lang="scss" scoped></style>