match-mixins.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. export default {
  2. data () {
  3. return {
  4. columns_product: [
  5. {
  6. type: 'index',
  7. label: '序号',
  8. width: 80
  9. },
  10. {
  11. prop: 'code',
  12. label: '物品编码'
  13. },
  14. {
  15. prop: 'name',
  16. label: '物品名称'
  17. },
  18. {
  19. prop: 'brandNum',
  20. label: '牌号'
  21. },
  22. {
  23. prop: 'modelType',
  24. label: '型号'
  25. },
  26. {
  27. prop: 'classificationCode',
  28. label: '物品类型',
  29. formatter: this.classificationCodeFormatter
  30. },
  31. {
  32. prop: 'categoryLevelPath',
  33. label: '分类'
  34. },
  35. {
  36. columnKey: 'action',
  37. label: '操作',
  38. width: 150,
  39. align: 'center',
  40. slot: 'action',
  41. fixed: 'right'
  42. }
  43. ],
  44. columns_mould: [
  45. {
  46. type: 'index',
  47. label: '序号',
  48. width: 50
  49. },
  50. {
  51. prop: 'code',
  52. label: '物品编码'
  53. },
  54. {
  55. prop: 'name',
  56. label: '物品名称'
  57. },
  58. {
  59. prop: 'brandNum',
  60. label: '牌号'
  61. },
  62. {
  63. prop: 'modelType',
  64. label: '型号'
  65. },
  66. {
  67. prop: 'shrinkageCoefficient',
  68. label: '收缩系数',
  69. formatter: this.shrinkFormatter
  70. },
  71. {
  72. prop: 'dieBodyModel',
  73. label: '大模体型号',
  74. formatter: this.modleFormatter
  75. },
  76. {
  77. prop: 'classificationCode',
  78. label: '物品类型',
  79. formatter: this.classificationCodeFormatter
  80. },
  81. {
  82. prop: 'categoryLevelPath',
  83. label: '分类'
  84. },
  85. {
  86. columnKey: 'action',
  87. label: '操作',
  88. width: 150,
  89. align: 'center',
  90. slot: 'action',
  91. fixed: 'right'
  92. }
  93. ],
  94. columns_part: [
  95. {
  96. type: 'index',
  97. label: '序号',
  98. width: 50
  99. },
  100. {
  101. prop: 'code',
  102. label: '物品编码'
  103. },
  104. {
  105. prop: 'name',
  106. label: '物品名称'
  107. },
  108. {
  109. prop: 'modelType',
  110. label: '型号'
  111. },
  112. {
  113. prop: 'classificationCode',
  114. label: '物品类型',
  115. formatter: this.classificationCodeFormatter
  116. },
  117. {
  118. prop: 'categoryLevelPath',
  119. label: '分类'
  120. },
  121. {
  122. columnKey: 'action',
  123. label: '操作',
  124. width: 150,
  125. align: 'center',
  126. slot: 'action',
  127. fixed: 'right'
  128. }
  129. ],
  130. columns_bom: [
  131. {
  132. type: 'index',
  133. label: '序号',
  134. width: 50
  135. },
  136. {
  137. prop: 'code',
  138. label: '物品编码'
  139. },
  140. {
  141. prop: 'name',
  142. label: '物品名称'
  143. },
  144. {
  145. prop: 'brandNum',
  146. label: '牌号'
  147. },
  148. {
  149. prop: 'classificationCode',
  150. label: '物品类型',
  151. formatter: this.classificationCodeFormatter
  152. },
  153. {
  154. prop: 'categoryLevelPath',
  155. label: '分类'
  156. },
  157. {
  158. label: '数量',
  159. columnKey: 'num',
  160. width: 120,
  161. slot: 'num'
  162. },
  163. {
  164. columnKey: 'action',
  165. label: '操作',
  166. width: 150,
  167. align: 'center',
  168. slot: 'action',
  169. fixed: 'right'
  170. }
  171. ],
  172. columns_facility: [
  173. {
  174. type: 'index',
  175. label: '序号',
  176. width: 50
  177. },
  178. {
  179. prop: 'code',
  180. label: '物品编码'
  181. },
  182. {
  183. prop: 'name',
  184. label: '物品名称'
  185. },
  186. {
  187. prop: 'classificationCode',
  188. label: '物品类型',
  189. formatter: this.classificationCodeFormatter
  190. },
  191. {
  192. prop: 'categoryLevelPath',
  193. label: '分类'
  194. },
  195. {
  196. columnKey: 'action',
  197. label: '操作',
  198. width: 150,
  199. align: 'center',
  200. slot: 'action',
  201. fixed: 'right'
  202. }
  203. ]
  204. };
  205. },
  206. methods: {
  207. // 物品类型格式化
  208. classificationCodeFormatter (row) {
  209. let itemName = '';
  210. this.typeList.map((item) => {
  211. if (item.code == row.type) {
  212. itemName = item.name;
  213. }
  214. });
  215. return itemName;
  216. },
  217. // 收缩系数格式化
  218. shrinkFormatter (row) {
  219. let shrink = '';
  220. let extendField = JSON.parse(row.extendField);
  221. if (extendField.hasOwnProperty('shrinkageCoefficient')) {
  222. shrink = extendField.shrinkageCoefficient;
  223. }
  224. return shrink;
  225. },
  226. modleFormatter (row) {
  227. let modle = '';
  228. let extendField = JSON.parse(row.extendField);
  229. if (extendField.hasOwnProperty('dieBodyModel')) {
  230. modle = extendField.dieBodyModel;
  231. }
  232. return modle;
  233. }
  234. }
  235. };