columns-config.ts 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  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. required: true,
  13. defaultData: [
  14. 'INV2410240908118985',
  15. 'INV2410281054597892'
  16. ]
  17. },
  18. {
  19. label: '类型',
  20. prop: 'type',
  21. minWidth: '100px',
  22. required: true,
  23. defaultData: [
  24. '入库',
  25. '入库红冲'
  26. ]
  27. },
  28. {
  29. label: '订单来源',
  30. prop: 'source',
  31. minWidth: '100px',
  32. required: true,
  33. defaultData: [
  34. '采销结算',
  35. '非采销结算'
  36. ],
  37. },
  38. {
  39. label: '订单购买方纳税号',
  40. prop: 'buyer_code',
  41. minWidth: '130px',
  42. required: true,
  43. defaultData: [
  44. '91110118MACEA1R94G',
  45. '91110118MACEA1R94G',
  46. ]
  47. },
  48. {
  49. label: '订单购买方公司名称',
  50. prop: 'buyer_name',
  51. minWidth: '150px',
  52. required: true,
  53. defaultData: [
  54. '北京锦兴弘昌科技有限公司',
  55. '北京锦兴弘昌科技有限公司'
  56. ],
  57. },
  58. {
  59. label: '订单销售方公司纳税号',
  60. prop: 'seller_code',
  61. minWidth: '160px',
  62. required: true,
  63. defaultData: [
  64. '91110113MA004JNJ28',
  65. '91110113MA004JNJ28'
  66. ],
  67. },
  68. {
  69. label: '订单销售方公司名称',
  70. prop: 'seller_name',
  71. minWidth: '160px',
  72. required: true,
  73. defaultData: [
  74. '北京万宇恒通国际科贸有限公司',
  75. '北京万宇恒通国际科贸有限公司'
  76. ]
  77. },
  78. {
  79. label: '订单编号',
  80. prop: 'orderCode',
  81. minWidth: '120px',
  82. required: true,
  83. defaultData: [
  84. 'FQR2408091410078906',
  85. 'FQR2408091408089205'
  86. ]
  87. },
  88. {
  89. label: '订单主单号',
  90. prop: 'cxCode',
  91. minWidth: '120px',
  92. defaultData: [
  93. 'QR2408091409232833',
  94. 'QR2408091407526489'
  95. ]
  96. },
  97. {
  98. label: '商品类型',
  99. prop: 'goodType',
  100. minWidth: '120px',
  101. required: true,
  102. defaultData: [
  103. '库存商品',
  104. '咨询商品'
  105. ],
  106. },
  107. {
  108. label: '商品编号',
  109. prop: 'goodNo',
  110. minWidth: '100px',
  111. required: true,
  112. defaultData: [
  113. 'SKU2402041456190398',
  114. 'SKU2403201007265803'
  115. ]
  116. },
  117. {
  118. label: '商品名称',
  119. prop: 'goodName',
  120. minWidth: '100px',
  121. required: true,
  122. defaultData: [
  123. '户外便携 幸福有约运动套装',
  124. '泰康开泰说系列-盛世泰康文件册'
  125. ],
  126. },
  127. {
  128. label: '订单单位',
  129. prop: 'unit',
  130. minWidth: '80px',
  131. required: true,
  132. defaultData: [
  133. '套',
  134. '个'
  135. ],
  136. },
  137. {
  138. label: '商品数量',
  139. prop: 'num',
  140. minWidth: '110px',
  141. required: true,
  142. defaultData: [
  143. '6',
  144. '6'
  145. ],
  146. },
  147. {
  148. label: '商品单价',
  149. prop: 'goodPrice',
  150. minWidth: '110px',
  151. required: true,
  152. defaultData: [
  153. '91.15',
  154. '91.15'
  155. ],
  156. },
  157. {
  158. label: '订单总金额',
  159. prop: 'totalPrice',
  160. minWidth: '110px',
  161. required: true,
  162. defaultData: [
  163. '273.45',
  164. '273.45',
  165. ]
  166. },
  167. {
  168. label: '税目',
  169. prop: 'cat_code',
  170. minWidth: '80px',
  171. required: true,
  172. defaultData: [
  173. '1060502040000000000',
  174. '1060105040000000000',
  175. ],
  176. },
  177. {
  178. label: '税目名称',
  179. prop: 'cat_name',
  180. minWidth: '100px',
  181. required: true,
  182. defaultData: [
  183. '工艺品',
  184. '纸制品'
  185. ],
  186. },
  187. {
  188. label: '订单税率',
  189. prop: 'tax',
  190. minWidth: '100px',
  191. required: true,
  192. defaultData: [
  193. '13%',
  194. '13%'
  195. ]
  196. },
  197. {
  198. label: '关联金额',
  199. prop: 'inv_fee',
  200. minWidth: '100px',
  201. required: true,
  202. defaultData: [
  203. '273',
  204. '2038.4'
  205. ],
  206. },
  207. {
  208. label: '购买方纳税号',
  209. prop: 'inv_buyer_code',
  210. minWidth: '130px',
  211. required: true,
  212. defaultData: [
  213. '91110118MACEA1R94G',
  214. '91110118MACEA1R94G'
  215. ],
  216. },
  217. {
  218. label: '购买方名称',
  219. prop: 'inv_buyer_name',
  220. minWidth: '170px',
  221. required: true,
  222. defaultData: [
  223. '北京锦兴弘昌科技有限公司',
  224. '北京锦兴弘昌科技有限公司'
  225. ],
  226. },
  227. {
  228. label: '发票号码',
  229. prop: 'inv_number',
  230. minWidth: '100px',
  231. required: true,
  232. defaultData: [
  233. '24112000000154116434',
  234. '24112000000154116434'
  235. ],
  236. },
  237. {
  238. label: '开票日期',
  239. prop: 'inv_open_date',
  240. minWidth: '100px',
  241. required: true,
  242. defaultData: [
  243. '2024-10-16',
  244. '2024-11-18'
  245. ],
  246. },
  247. {
  248. label: '发票类型',
  249. prop: 'inv_type',
  250. minWidth: '100px',
  251. required: true,
  252. defaultData: [
  253. '增值税专用发票',
  254. '增值税普通发票'
  255. ],
  256. },
  257. {
  258. label: '销售方公司纳税号',
  259. mapLabel: '发票销售方公司纳税号',
  260. prop: 'inv_seller_code',
  261. minWidth: '170px',
  262. required: true,
  263. defaultData: [
  264. '91110113MA004JNJ28',
  265. '91110113MA004JNJ28'
  266. ]
  267. },
  268. {
  269. label: '销售方公司',
  270. prop: 'inv_seller_name',
  271. minWidth: '130px',
  272. required: true,
  273. defaultData: [
  274. '北京万宇恒通国际科贸有限公司',
  275. '北京万宇恒通国际科贸有限公司'
  276. ]
  277. },
  278. {
  279. label: '发票明细ID',
  280. prop: 'inv_item_id',
  281. minWidth: '110px',
  282. defaultData: [
  283. '1280',
  284. '1281'
  285. ]
  286. },
  287. {
  288. label: '货物或应税劳务、服务名称',
  289. prop: 'inv_good_name',
  290. minWidth: '200px',
  291. required: true,
  292. defaultData: [
  293. '*印刷品*JXHC 品牌文创2024年简装本(橙色)',
  294. '*纸制品*JXHC泰康家族办公室手册'
  295. ]
  296. },
  297. {
  298. label: '类目编号',
  299. prop: 'inv_cat_code',
  300. minWidth: '90px',
  301. required: true,
  302. defaultData: [
  303. '1060408990000000000',
  304. '1060408990000000000'
  305. ]
  306. },
  307. {
  308. label: '规格型号',
  309. prop: 'inv_spec',
  310. minWidth: '110px',
  311. defaultData: [
  312. '',
  313. ''
  314. ],
  315. },
  316. {
  317. label: '单位',
  318. mapLabel: '发票商品单位',
  319. prop: 'inv_unit',
  320. minWidth: '100px',
  321. defaultData: [
  322. '套',
  323. '个'
  324. ],
  325. },
  326. {
  327. label: '数量',
  328. prop: 'inv_num',
  329. minWidth: '100px',
  330. defaultData: [
  331. '6',
  332. '6'
  333. ],
  334. },
  335. {
  336. label: '税前单价',
  337. prop: 'inv_subprice',
  338. minWidth: '100px',
  339. required: true,
  340. defaultData: [
  341. '91.150442477876',
  342. '11.858407079646'
  343. ],
  344. },
  345. {
  346. label: '税前总价',
  347. prop: 'inv_subtotal',
  348. minWidth: '100px',
  349. required: true,
  350. defaultData: [
  351. '273.45',
  352. '273.45'
  353. ],
  354. },
  355. {
  356. label: '税率',
  357. prop: 'inv_tax',
  358. minWidth: '80px',
  359. required: true,
  360. defaultData: [
  361. '273.45',
  362. '273.45'
  363. ],
  364. },
  365. {
  366. label: '税额',
  367. prop: 'inv_tax_total',
  368. minWidth: '80px',
  369. required: true,
  370. defaultData: [
  371. '13%',
  372. '13%'
  373. ]
  374. },
  375. {
  376. label: '税后单价',
  377. prop: 'inv_price',
  378. minWidth: '100px',
  379. required: true,
  380. defaultData: [
  381. '103',
  382. '103'
  383. ],
  384. },
  385. {
  386. label: '税后总额',
  387. prop: 'inv_total',
  388. minWidth: '100px',
  389. required: true,
  390. defaultData: [
  391. '309',
  392. '309'
  393. ],
  394. },
  395. {
  396. label: '类目编号状态',
  397. prop: 'cat_diff',
  398. minWidth: '100px',
  399. required: true,
  400. defaultData: [
  401. '一致',
  402. '不一致'
  403. ],
  404. },
  405. {
  406. label: '税率状态',
  407. prop: 'tax_diff',
  408. minWidth: '100px',
  409. required: true,
  410. defaultData: [
  411. '一致',
  412. '不一致'
  413. ],
  414. },
  415. {
  416. label: '备注',
  417. prop: 'remark',
  418. minWidth: '80px',
  419. defaultData: [
  420. '',
  421. '同意'
  422. ]
  423. },
  424. {
  425. label: '入账月份',
  426. prop: 'fz_date',
  427. minWidth: '80px',
  428. required: true,
  429. defaultData: [
  430. '2024-11',
  431. '2024-11'
  432. ]
  433. },
  434. {
  435. label: '关联商品ID',
  436. prop: 'relaGoodNo',
  437. minWidth: '120px',
  438. required: true,
  439. defaultData: [
  440. '10',
  441. '11'
  442. ]
  443. },
  444. {
  445. label: '操作数量',
  446. prop: 'relaGoodNum',
  447. minWidth: '100px',
  448. required: true,
  449. defaultData: [
  450. '6',
  451. '6'
  452. ]
  453. }
  454. ]
  455. const notOrderTemplate = new Array(3).fill(1).map((_, index) => (columns.slice(1).reduce((prev, current) => {
  456. const isRequired = index === 0
  457. let defaultValue = ''
  458. if (isRequired) {
  459. defaultValue = current.required ? '必填' : ''
  460. } else {
  461. defaultValue = current.defaultData[index - 1]
  462. }
  463. return { ...prev, [current.label]: defaultValue }
  464. }, {})))
  465. export const mapLabelToProp = columns.reduce((prev, current) => ({ ...prev, [current.label]: current.prop }), {})
  466. export const mapPropertyToLabel = columns.reduce((prev, current) => ({ ...prev, [current.prop]: current.label }), {})
  467. export const requiredProps = columns.filter(column => !!column.required).map(item => item.prop)
  468. export { columns, notOrderTemplate };