columns.js 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. import CONFIG from "@/config";
  2. export default function useColumns() {
  3. const TableColumns = [
  4. {
  5. item: { width: 100, key: "priceCode", title: "价格编码" },
  6. attr: {},
  7. },
  8. {
  9. item: { width: 100, key: "supplierName", title: "供应商" },
  10. attr: {},
  11. },
  12. {
  13. item: { width: 100, key: "puOrgName", title: "采购组织" },
  14. attr: {},
  15. },
  16. {
  17. item: { width: 100, key: "currencyName", title: "币种" },
  18. attr: {},
  19. },
  20. {
  21. item: { width: 100, key: "explainStr", title: "价格合理性说明" },
  22. attr: {},
  23. },
  24. {
  25. item: { width: 100, key: "buyerName", title: "采购员" },
  26. attr: {},
  27. },
  28. {
  29. item: { width: 100, key: "puDeptName", title: "采购部门" },
  30. attr: {},
  31. },
  32. {
  33. item: { width: 100, key: "createByName", title: "创建人" },
  34. attr: {},
  35. },
  36. {
  37. item: { key: "isEffective", title: "是否已推价格" },
  38. attr: {
  39. is: "el-dict-tag",
  40. dictName: "is_effective",
  41. },
  42. },
  43. {
  44. item: { width: 100, key: "approveTime", title: "单据申请日期" },
  45. attr: {},
  46. },
  47. {
  48. item: { width: 100, key: "file", title: "附件" },
  49. attr: { is: "el-file-preview" },
  50. },
  51. {
  52. item: { width: 100, key: "sourceType", title: "来源单据类型" },
  53. attr: {
  54. is: "el-dict-tag",
  55. dictName: "price_source",
  56. },
  57. },
  58. {
  59. item: { width: 100, key: "status", title: "单据状态" },
  60. attr: {
  61. is: "el-dict-tag",
  62. dictName: "sys_status",
  63. },
  64. },
  65. ];
  66. const TabColumns = [
  67. {
  68. item: {
  69. title: "物料信息表",
  70. width: 100,
  71. key: "priceApplyItems",
  72. },
  73. attr: {
  74. value: [],
  75. },
  76. TableColumns: [
  77. {
  78. item: { width: 100, key: "materialCode", title: "物料编码" },
  79. attr: {},
  80. },
  81. {
  82. item: { width: 100, key: "materialName", title: "物料名称" },
  83. attr: {},
  84. },
  85. { item: { width: 100, key: "specification", title: "规格" }, attr: {} },
  86. { item: { width: 100, key: "model", title: "型号" }, attr: {} },
  87. {
  88. item: { width: 100, key: "manufacturerName", title: "生产厂家" },
  89. attr: {},
  90. },
  91. {
  92. item: { width: 100, key: "unitName", title: "单位" },
  93. attr: {},
  94. },
  95. // {
  96. // item: { width: 100, key: "puUnitName", title: "采购单位" },
  97. // attr: {},
  98. // },
  99. // {
  100. // item: { width: 100, key: "conversionRate", title: "采购换算率" },
  101. // attr: {
  102. // is: "el-computed-input-v2",
  103. // formatter: (prop) => {
  104. // return prop == null ? 0 : (prop * 1);
  105. // },
  106. // },
  107. // },
  108. {
  109. item: { width: 100, key: "customerName", title: "客户" },
  110. attr: {},
  111. },
  112. {
  113. item: { width: 100, key: "taxPrice", title: "含税单价" },
  114. attr: {
  115. is: "el-computed-input-v2",
  116. formatter: (prop) => {
  117. return prop == null ? 0 : (prop * 1);
  118. },
  119. },
  120. },
  121. {
  122. item: { width: 100, key: "tax", title: "税率%" },
  123. attr: {
  124. is: "el-computed-input-v2",
  125. formatter: (prop) => {
  126. return prop == null ? 0 : (prop * 1);
  127. },
  128. },
  129. },
  130. {
  131. item: { width: 100, key: "price", title: "无税单价" },
  132. attr: {
  133. is: "el-computed-input-v2",
  134. formatter: (prop) => {
  135. return prop == null ? 0 : (prop * 1);
  136. },
  137. },
  138. },
  139. // {
  140. // item: { width: 100, key: "currencyName", title: "币种" },
  141. // attr: {},
  142. // },
  143. {
  144. item: { width: 100, key: "periodBegin", title: "价格有效期(起)" },
  145. attr: {},
  146. },
  147. {
  148. item: { width: 100, key: "periodEnd", title: "价格有效期(止)" },
  149. attr: {},
  150. },
  151. {
  152. item: { width: 100, key: "recentlyPrice", title: "最近价格" },
  153. attr: {},
  154. },
  155. {
  156. item: {
  157. width: 100,
  158. key: "recentlyPriceDate",
  159. title: "最近价格日期",
  160. },
  161. attr: {},
  162. },
  163. {
  164. item: { width: 100, key: "isApprovalFirst", title: "首次报批" },
  165. attr: {
  166. is: "el-dict-tag",
  167. dictName: "is_effective",
  168. },
  169. },
  170. {
  171. item: { width: 100, key: "isPriceAdjustmentName", title: "调价类型" },
  172. attr: {
  173. },
  174. },
  175. {
  176. item: { width: 100, key: "priceDiffer", title: "单价差" },
  177. attr: {
  178. is: "el-computed-input-v2",
  179. formatter: (prop) => {
  180. return prop == null ? 0 : (prop * 1);
  181. },
  182. },
  183. },
  184. {
  185. item: { width: 100, key: "increase", title: "涨幅(%)" },
  186. attr: {
  187. formatter: (prop) => {
  188. const { priceDiffer = 0, recentlyPrice = 0 } = prop;
  189. return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0%");
  190. },
  191. },
  192. },
  193. {
  194. item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
  195. attr: {
  196. // is: "el-computed-input-v2",
  197. formatter: (prop) => {
  198. return prop.yPurchaseQuantity
  199. },
  200. },
  201. },
  202. {
  203. item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
  204. attr: {
  205. formatter: (prop) => {
  206. const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
  207. return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
  208. },
  209. },
  210. },
  211. {
  212. item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
  213. attr: {
  214. is: "el-computed-input-v2",
  215. formatter: (prop) => {
  216. return prop == null ? 0 : (prop * 1);
  217. },
  218. },
  219. },
  220. {
  221. item: { width: 100, key: "priceType", title: "价格类型" },
  222. attr: {
  223. is: "el-dict-tag",
  224. dictName: "sys_price_type",
  225. },
  226. },
  227. {
  228. item: { width: 100, key: "isDistributionPrice", title: "配送价" },
  229. attr: {
  230. is: "el-dict-tag",
  231. dictName: "is_effective",
  232. },
  233. },
  234. {
  235. item: { width: 100, key: "isChannel", title: "是否渠道变更" },
  236. attr: {
  237. is: "el-dict-tag",
  238. dictName: "is_effective",
  239. },
  240. },
  241. {
  242. item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
  243. attr: {
  244. is: "el-dict-tag",
  245. dictName: "is_effective",
  246. },
  247. },
  248. {
  249. item: { width: 100, key: "supplierName", title: "供应商名称1" },
  250. attr: {},
  251. },
  252. {
  253. item: { width: 100, key: "bidPrice", title: "中标价1" },
  254. attr: {
  255. is: "el-computed-input-v2",
  256. formatter: (prop) => {
  257. return prop == null ? 0 : (prop * 1);
  258. },
  259. },
  260. },
  261. {
  262. item: { width: 100, key: "unitPrice", title: "单价1" },
  263. attr: {
  264. is: "el-computed-input-v2",
  265. formatter: (prop) => {
  266. return prop == null ? 0 : (prop * 1);
  267. },
  268. },
  269. },
  270. {
  271. item: { width: 100, key: "profit", title: "利润比1" },
  272. attr: {
  273. is: "el-computed-input-v2",
  274. formatter: (prop) => {
  275. return prop == null ? 0 : (prop * 1);
  276. },
  277. },
  278. },
  279. {
  280. item: { width: 100, key: "supplierName1", title: "供应商名称2" },
  281. attr: {},
  282. },
  283. {
  284. item: { width: 100, key: "bidPrice1", title: "中标价2" },
  285. attr: {
  286. is: "el-computed-input-v2",
  287. formatter: (prop) => {
  288. return prop == null ? 0 : (prop * 1);
  289. },
  290. },
  291. },
  292. {
  293. item: { width: 100, key: "unitPrice1", title: "单价2" },
  294. attr: {
  295. is: "el-computed-input-v2",
  296. formatter: (prop) => {
  297. return prop == null ? 0 : (prop * 1);
  298. },
  299. },
  300. },
  301. {
  302. item: { width: 100, key: "profit1", title: "利润比2" },
  303. attr: {
  304. is: "el-computed-input-v2",
  305. formatter: (prop) => {
  306. return prop == null ? 0 : (prop * 1);
  307. },
  308. },
  309. },
  310. {
  311. item: { width: 100, key: "supplierName2", title: "供应商名称3" },
  312. attr: {},
  313. },
  314. {
  315. item: { width: 100, key: "bidPrice2", title: "中标价3" },
  316. attr: {
  317. is: "el-computed-input-v2",
  318. formatter: (prop) => {
  319. return prop == null ? 0 : (prop * 1);
  320. },
  321. },
  322. },
  323. {
  324. item: { width: 100, key: "unitPrice2", title: "单价3" },
  325. attr: {
  326. is: "el-computed-input-v2",
  327. formatter: (prop) => {
  328. return prop == null ? 0 : (prop * 1);
  329. },
  330. },
  331. },
  332. {
  333. item: { width: 100, key: "profit2", title: "利润比3" },
  334. attr: {
  335. is: "el-computed-input-v2",
  336. formatter: (prop) => {
  337. return prop == null ? 0 : (prop * 1);
  338. },
  339. },
  340. },
  341. // {
  342. // item: { width: 100, key: "createByName", title: "创建人名称" },
  343. // attr: {},
  344. // },
  345. // {
  346. // item: { width: 100, key: "updateByName", title: "更新人名称" },
  347. // attr: {},
  348. // },
  349. ],
  350. },
  351. ];
  352. return { TableColumns, TabColumns };
  353. }