columns.tsx 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. import { ref } from "vue";
  2. import dayjs from "dayjs";
  3. import { send_status_list, inv_status_list } from "/@/utils/status";
  4. export function useColumns() {
  5. const columns = ref([
  6. {
  7. type: "selection",
  8. reserveSelection: true
  9. },
  10. {
  11. label: "销售订单编号",
  12. prop: "sequenceNo",
  13. minWidth: 160,
  14. showOverflowTooltip: true
  15. },
  16. {
  17. label: "所属平台",
  18. prop: "department",
  19. minWidth: 160,
  20. showOverflowTooltip: true
  21. },
  22. {
  23. label: "商品编码",
  24. prop: "goodNo",
  25. minWidth: 160,
  26. showOverflowTooltip: true
  27. },
  28. {
  29. label: "商品名称",
  30. prop: "goodName",
  31. minWidth: 160,
  32. showOverflowTooltip: true
  33. },
  34. {
  35. label: "企业客户编号",
  36. prop: "companyNo",
  37. minWidth: 160,
  38. showOverflowTooltip: true
  39. },
  40. {
  41. label: "企业客户名称",
  42. prop: "companyName",
  43. minWidth: 160,
  44. showOverflowTooltip: true
  45. },
  46. {
  47. label: "订单总金额",
  48. prop: "totalPrice",
  49. minWidth: 110,
  50. showOverflowTooltip: true
  51. },
  52. {
  53. label: "退货数量",
  54. prop: "th_fee",
  55. width: 110,
  56. showOverflowTooltip: true
  57. },
  58. {
  59. label: "退货金额",
  60. prop: "th_fee",
  61. width: 110,
  62. showOverflowTooltip: true
  63. },
  64. {
  65. label: "发货状态",
  66. prop: "sendStatus",
  67. minWidth: 110,
  68. showOverflowTooltip: true,
  69. cellRenderer: ({ row, props }) => (
  70. <el-tag
  71. size={props.size}
  72. type={
  73. (
  74. send_status_list.find(
  75. item => item.value == row.sendStatus + ""
  76. ) || {}
  77. ).type || "info"
  78. }
  79. effect="plain"
  80. >
  81. {(
  82. send_status_list.find(item => item.value == row.sendStatus + "") ||
  83. {}
  84. ).label || "--"}
  85. </el-tag>
  86. )
  87. },
  88. {
  89. label: "发票已核销",
  90. prop: "ainv_fee",
  91. minWidth: 110,
  92. showOverflowTooltip: true
  93. },
  94. {
  95. label: "发票核销中",
  96. prop: "inv_fee",
  97. minWidth: 110,
  98. showOverflowTooltip: true
  99. },
  100. {
  101. label: "发票未核销",
  102. prop: "winv_fee",
  103. minWidth: 110,
  104. showOverflowTooltip: true
  105. },
  106. {
  107. label: "发票核销状态",
  108. prop: "inv_type",
  109. minWidth: 110,
  110. showOverflowTooltip: true,
  111. cellRenderer: ({ row, props }) => (
  112. <el-tag
  113. size={props.size}
  114. type={
  115. (
  116. inv_status_list.find(item => item.value == row.inv_status + "") ||
  117. {}
  118. ).type || "info"
  119. }
  120. effect="plain"
  121. >
  122. {(
  123. inv_status_list.find(item => item.value == row.inv_status + "") ||
  124. {}
  125. ).label || "--"}
  126. </el-tag>
  127. )
  128. },
  129. {
  130. label: "业务员",
  131. prop: "ownerName",
  132. minWidth: 80,
  133. showOverflowTooltip: true
  134. },
  135. {
  136. label: "创建时间",
  137. minWidth: 145,
  138. prop: "createTime",
  139. showOverflowTooltip: true,
  140. formatter: ({ addtime }) => dayjs(addtime).format("YYYY-MM-DD HH:mm:ss")
  141. }
  142. ]);
  143. return {
  144. columns
  145. };
  146. }
  147. export const order_detail_columns = [
  148. {
  149. field: "sequenceNo",
  150. label: "确认单编号"
  151. },
  152. {
  153. field: "ownerName",
  154. label: "销售员"
  155. },
  156. {
  157. field: "department",
  158. label: "平台名称"
  159. },
  160. {
  161. field: "companyName",
  162. label: "业务公司名称"
  163. },
  164. {
  165. field: "customerName",
  166. label: "客户名称"
  167. },
  168. {
  169. field: "goodNum",
  170. label: "商品数量"
  171. },
  172. {
  173. field: "goodPrice",
  174. label: "商品单价"
  175. },
  176. {
  177. field: "goodName",
  178. label: "商品名称"
  179. },
  180. {
  181. field: "inv_fee",
  182. label: "开票中"
  183. },
  184. {
  185. field: "ainv_fee",
  186. label: "已开票"
  187. },
  188. {
  189. field: "winv_fee",
  190. label: "未开票"
  191. }
  192. ];
  193. /**
  194. * @invoice_addr 公司注册地址
  195. * @invoice_people 法人
  196. * @invoice_mobile 联系方式
  197. * @invoice_code 纳税识别号
  198. * @invoice_bank 开户行
  199. * @invoice_bankNo 开户账户
  200. */
  201. export const convertInvoiceTitle = (title: Record<string, string>) => {
  202. const {
  203. company_address,
  204. contector,
  205. mobile,
  206. company_license,
  207. bank_name,
  208. bankNo
  209. } = title;
  210. return {
  211. invoice_addr: company_address,
  212. invoice_people: contector,
  213. invoice_mobile: mobile,
  214. invoice_code: company_license,
  215. invoice_bank: bank_name,
  216. invoice_bankNo: bankNo
  217. };
  218. };
  219. export const invoice_columns = [
  220. {
  221. label: "联系方式",
  222. field: "invoice_mobile"
  223. },
  224. {
  225. label: "纳税识别号",
  226. field: "invoice_code"
  227. },
  228. {
  229. label: "开户行",
  230. field: "invoice_bank"
  231. },
  232. {
  233. label: "开户账户",
  234. field: "invoice_bankNo"
  235. },
  236. {
  237. label: "公司注册地址",
  238. field: "invoice_addr"
  239. }
  240. ];