index.vue 7.6 KB

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