columns.ts 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. import { h } from "vue"
  2. import { createTooltip } from "/@/utils/tootip"
  3. import { ElTable, ElTableColumn, ElTag } from "element-plus"
  4. import { cg_order_type_options, statusList } from "/@/utils/status"
  5. import { basicStatusOptions } from "/@/views/invoiceInOut/productManager/config/columns"
  6. export const goodColumns = [
  7. {
  8. field: 'id',
  9. label: '商品ID',
  10. span: 6
  11. },
  12. {
  13. span: 6,
  14. label: '状态',
  15. render(_, { status }) {
  16. return h(ElTag, { size: 'small', type: statusList.find(item => item.value == status)?.type || 'warning' }, {
  17. default: () => statusList.find(item => item.value == status)?.label || '--'
  18. })
  19. }
  20. },
  21. {
  22. span: 6,
  23. field: 'apply_name',
  24. label: '创建人'
  25. },
  26. {
  27. span: 6,
  28. field: 'create_time',
  29. label: '创建时间'
  30. },
  31. {
  32. span: 12,
  33. field: 'seller_name',
  34. label: '销售方公司',
  35. render(_, { seller_code, seller_name }) {
  36. return createTooltip(seller_name, '销售方公司编号:' + seller_code, 300)
  37. }
  38. },
  39. {
  40. span: 12,
  41. field: 'buyer_name',
  42. label: '购买方公司',
  43. render(_, { buyer_code, buyer_name }) {
  44. return createTooltip(buyer_name, '购买方公司编号:' + buyer_code, 300)
  45. }
  46. },
  47. {
  48. span: 6,
  49. label: '商品来源',
  50. render(_, { good_source }) {
  51. return good_source == '1' ? '采销商品' : '非采销商品'
  52. }
  53. },
  54. {
  55. span: 6,
  56. label: '组合类型',
  57. render(_, { is_combind }) {
  58. return is_combind == '0' ? '非组合商品' : '组合商品'
  59. }
  60. },
  61. {
  62. span: 6,
  63. label: '商品类型',
  64. render(_, { good_type }) {
  65. return h(ElTag, { size: 'small' }, {
  66. default: () => cg_order_type_options.find(item => item.value == good_type)?.label || '--'
  67. })
  68. }
  69. },
  70. {
  71. span: 6,
  72. label: '进项成本状态',
  73. render(_, { basic_status }) {
  74. return h(ElTag, { size: 'small' }, {
  75. default: () => basicStatusOptions.find(item => item.value == basic_status)?.label || '--'
  76. })
  77. }
  78. },
  79. {
  80. span: 12,
  81. field: 'inv_good_name',
  82. label: '发票商品名称'
  83. },
  84. {
  85. span: 12,
  86. field: 'goodName',
  87. label: '订单商品名称'
  88. },
  89. {
  90. field: 'skuCode',
  91. label: '商品编号',
  92. span: 6
  93. },
  94. {
  95. span: 6,
  96. field: 'unit',
  97. label: '单位'
  98. },
  99. {
  100. span: 6,
  101. field: 'spec',
  102. label: '规格'
  103. },
  104. {
  105. span: 6,
  106. // field: 'unit_weight',
  107. label: '重量',
  108. render(_, { unit_weight }) {
  109. return unit_weight + 'g'
  110. }
  111. },
  112. {
  113. span: 6,
  114. label: '发票类型',
  115. render(_, { inv_type }) {
  116. return inv_type.includes('special') ? '专票' : '普票'
  117. }
  118. },
  119. {
  120. span: 6,
  121. field: 'subunit_price',
  122. label: '税前单价'
  123. },
  124. {
  125. span: 6,
  126. field: 'unit_price',
  127. label: '税后单价'
  128. },
  129. {
  130. span: 6,
  131. field: 'good_code',
  132. label: '商品代码'
  133. },
  134. {
  135. field: 'cat_name',
  136. label: '进项类目',
  137. span: 12,
  138. render(_, { cat_code, cat_name, short_name }) {
  139. return `${cat_code}-${cat_name}-${short_name}`
  140. }
  141. },
  142. {
  143. label: '进项税率',
  144. span: 6,
  145. render(_, { cat_tax }) {
  146. return cat_tax + '%'
  147. }
  148. },
  149. {
  150. span: 6,
  151. field: 'spectral',
  152. label: '分光'
  153. },
  154. ]
  155. export const goodHasChildColumns = [
  156. {
  157. span: 12,
  158. field: 'seller_name',
  159. label: '销售方公司'
  160. },
  161. {
  162. span: 12,
  163. field: 'buyer_name',
  164. label: '购买方公司'
  165. },
  166. {
  167. span: 12,
  168. field: 'goodName',
  169. label: '订单商品名称'
  170. },
  171. {
  172. span: 12,
  173. field: 'inv_good_name',
  174. label: '发票商品名称'
  175. },
  176. {
  177. span: 6,
  178. label: '商品类型',
  179. render(_, { good_type }) {
  180. return h(ElTag, { size: 'small' }, {
  181. default: () => cg_order_type_options.find(item => item.value == good_type)?.label || '--'
  182. })
  183. }
  184. },
  185. {
  186. span: 6,
  187. field: 'good_code',
  188. label: '商品代码'
  189. },
  190. {
  191. span: 6,
  192. field: 'spec',
  193. label: '规格'
  194. },
  195. {
  196. span: 6,
  197. field: 'unit',
  198. label: '单位'
  199. },
  200. {
  201. span: 6,
  202. field: 'unit_price',
  203. label: '税前单价'
  204. },
  205. {
  206. span: 6,
  207. field: 'subunit_price',
  208. label: '税后单价'
  209. },
  210. {
  211. span: 6,
  212. field: 'unit_weight',
  213. label: '重量'
  214. },
  215. {
  216. span: 6,
  217. field: 'spectral',
  218. label: '分光'
  219. },
  220. {
  221. field: 'cat_name',
  222. label: '进项类目',
  223. span: 24
  224. },
  225. {
  226. label: '子商品',
  227. span: 24,
  228. render(_, { ProductsCombind = [] }) {
  229. return h(ElTable, { size: 'small', data: ProductsCombind, border: true }, {
  230. default: () => [
  231. h(ElTableColumn, { label: '比例', prop: 'child_num', width: 100, showOverflowTooltip: true }),
  232. h(ElTableColumn, { label: '商品编号', showOverflowTooltip: true }, { default: (scope) => scope.row.products?.skuCode }),
  233. h(ElTableColumn, { label: '商品类型', showOverflowTooltip: true }, {
  234. default: (scope) =>
  235. h(ElTag, { size: 'small' }, { default: () => cg_order_type_options.find(item => item.value == scope.row.products?.good_type)?.label || '--' })
  236. }),
  237. h(ElTableColumn, { label: '商品名称' }, { default: (scope) => scope.row.products?.goodName }),
  238. ]
  239. })
  240. }
  241. }
  242. ]