columns-config.ts 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. const columns = [
  2. {
  3. type: "index",
  4. fixed: "left",
  5. label: "序号",
  6. width: "50"
  7. },
  8. {
  9. label: '业务编号',
  10. prop: 'invoiceCode',
  11. minWidth: '100px',
  12. defaultData: '',
  13. required: true
  14. },
  15. {
  16. label: '类型',
  17. prop: 'type',
  18. minWidth: '100px',
  19. defaultData: '',
  20. required: true
  21. },
  22. {
  23. label:'订单来源',
  24. prop: 'source',
  25. minWidth: '100px',
  26. defaultData: '',
  27. required: true
  28. },
  29. {
  30. label: '销售方公司纳税识别号',
  31. prop: 'seller_code',
  32. minWidth: '160px',
  33. defaultData: '',
  34. required: true
  35. },
  36. {
  37. label: '销售方公司',
  38. prop: 'seller_name',
  39. minWidth: '100px',
  40. defaultData: '',
  41. required: true
  42. },
  43. {
  44. label: '订单编号',
  45. prop: 'orderCode',
  46. minWidth: '120px',
  47. defaultData: '',
  48. required: true
  49. },
  50. {
  51. label: '订单主单号',
  52. prop: 'cxCode',
  53. minWidth: '120px',
  54. defaultData: '',
  55. required: true
  56. },
  57. {
  58. label: '商品编号',
  59. prop: 'goodNo',
  60. minWidth: '100px',
  61. defaultData: '',
  62. required: true
  63. },
  64. {
  65. label: '商品名称',
  66. prop: 'goodName',
  67. minWidth: '100px',
  68. defaultData: '',
  69. required: true
  70. },
  71. {
  72. label: '单位',
  73. prop: 'unit',
  74. minWidth: '80px',
  75. defaultData: '',
  76. required: true
  77. },
  78. {
  79. label: '商品数量',
  80. prop: 'num',
  81. minWidth: '110px',
  82. defaultData: '',
  83. required: true
  84. },
  85. {
  86. label:'商品单价',
  87. prop: 'goodPrice',
  88. minWidth: '110px',
  89. defaultData: '',
  90. required: true
  91. },
  92. {
  93. label: '订单总金额',
  94. prop: 'totalPrice',
  95. minWidth: '110px',
  96. defaultData: '',
  97. required: true
  98. },
  99. {
  100. label: '税目',
  101. prop: 'cat_code',
  102. minWidth: '80px',
  103. defaultData: '',
  104. required: true
  105. },
  106. {
  107. label: '税目名称',
  108. prop: 'cat_name',
  109. minWidth: '100px',
  110. defaultData: '',
  111. required: true
  112. },
  113. {
  114. label: '税率',
  115. prop: 'tax',
  116. minWidth: '100px',
  117. defaultData: '',
  118. required: true
  119. },
  120. {
  121. label: '关联金额',
  122. prop: 'inv_fee',
  123. minWidth: '100px',
  124. defaultData: '',
  125. required: true
  126. },
  127. {
  128. label: '购买方公司名称',
  129. prop: 'inv_buyer_name',
  130. minWidth: '130px',
  131. defaultData: '',
  132. required: true
  133. },
  134. {
  135. label: '购买方公司纳税识别号',
  136. prop: 'inv_buyer_code',
  137. minWidth: '170px',
  138. defaultData: '',
  139. required: true
  140. },
  141. {
  142. label: '发票号码',
  143. prop: 'inv_number',
  144. minWidth: '100px',
  145. defaultData: '',
  146. required: true
  147. },
  148. {
  149. label: '发票类型',
  150. prop: 'inv_type',
  151. minWidth: '100px',
  152. defaultData: '',
  153. required: true
  154. },
  155. {
  156. label: '发票销售方公司',
  157. prop: 'inv_seller_name',
  158. minWidth: '130px',
  159. defaultData: '',
  160. required: true
  161. },
  162. {
  163. label: '发票销售方公司纳税号',
  164. prop: 'inv_seller_code',
  165. minWidth: '170px',
  166. defaultData: '',
  167. required: true
  168. },
  169. {
  170. label: '发票明细ID',
  171. prop: 'inv_item_id',
  172. minWidth: '110px',
  173. defaultData: '',
  174. required: true
  175. },
  176. {
  177. label: '货物或应税劳务、服务名称',
  178. prop: 'inv_good_name',
  179. minWidth: '200px',
  180. defaultData: '',
  181. required: true
  182. },
  183. {
  184. label: '类目编号',
  185. prop: 'inv_cat_code',
  186. minWidth: '90px',
  187. defaultData: '',
  188. required: true
  189. },
  190. {
  191. label: '规格型号',
  192. prop: 'inv_spec',
  193. minWidth: '110px',
  194. defaultData: '',
  195. required: true
  196. },
  197. {
  198. label: '发票商品单位',
  199. prop: 'inv_unit',
  200. minWidth: '100px',
  201. defaultData: '',
  202. required: true
  203. },
  204. {
  205. label: '发票商品数量',
  206. prop: 'inv_num',
  207. minWidth: '100px',
  208. defaultData: '',
  209. required: true
  210. },
  211. {
  212. label: '税前单价',
  213. prop: 'inv_subprice',
  214. minWidth: '100px',
  215. defaultData: '',
  216. required: true
  217. },
  218. {
  219. label: '税前总价',
  220. prop: 'inv_subtotal',
  221. minWidth: '100px',
  222. defaultData: '',
  223. required: true
  224. },
  225. {
  226. label: '发票税率',
  227. prop: 'inv_tax',
  228. minWidth: '80px',
  229. defaultData: '',
  230. required: true
  231. },
  232. {
  233. label: '税后单价',
  234. prop: 'inv_price',
  235. minWidth: '100px',
  236. defaultData: '',
  237. required: true
  238. },
  239. {
  240. label: '税后总额',
  241. prop: 'inv_total',
  242. minWidth: '100px',
  243. defaultData: '',
  244. required: true
  245. },
  246. {
  247. label: '类目编号状态',
  248. prop: 'TODO34',
  249. minWidth: '100px',
  250. defaultData: '',
  251. required: false
  252. },
  253. {
  254. label: '税率状态',
  255. prop: 'TODO35',
  256. minWidth: '100px',
  257. defaultData: '',
  258. required: false
  259. },
  260. {
  261. label: '备注',
  262. prop: 'remark',
  263. minWidth: '80px',
  264. defaultData: '',
  265. required: true
  266. },
  267. {
  268. label: '关联商品ID',
  269. prop: 'relaGoodNo',
  270. minWidth: '120px',
  271. defaultData: '',
  272. required: true
  273. },
  274. {
  275. label: '操作数量',
  276. prop: 'relaGoodNum',
  277. minWidth: '100px',
  278. defaultData: '',
  279. required: true
  280. },
  281. {
  282. label: '子商品编号',
  283. prop: 'childCode',
  284. minWidth: '100px',
  285. defaultData: '',
  286. required: true
  287. },
  288. {
  289. label: '子商品操作数量',
  290. prop: 'childNum',
  291. minWidth: '120px',
  292. defaultData: '',
  293. required: true
  294. }
  295. ]
  296. const notOrderTemplate = [columns.slice(1).reduce((prev, current) => ({ ...prev, [current.label]: current.defaultData ? current.defaultData : '' }), {})]
  297. export const mapLabelToProp = columns.reduce((prev, current) => ({ ...prev, [current.label]: current.prop }), {})
  298. export const mapPropertyToLabel = columns.reduce((prev, current) => ({ ...prev, [current.prop]: current.label }), {})
  299. export const requiredProps = columns.filter(column => !!column.required).map(item => item.prop)
  300. export { columns, notOrderTemplate };