index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <div>
  3. <el-card class="box-card">
  4. <byTable
  5. :source="sourceList.data"
  6. :pagination="sourceList.pagination"
  7. :config="config"
  8. :loading="loading"
  9. :searchConfig="searchConfig"
  10. highlight-current-row
  11. @get-list="getList"
  12. @clickReset="clickReset">
  13. <template #orderCode="{ item }">
  14. <div>
  15. <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.orderCode }}</a>
  16. </div>
  17. </template>
  18. <template #blueprint="{ item }">
  19. <div>图片</div>
  20. </template>
  21. <template #subtotal="{ item }">
  22. <div style="color: #409eff">{{ subtotal(item) }}</div>
  23. </template>
  24. <template #wlnCreateTime="{ item }">
  25. <div>{{ item.wlnCreateTime || item.createTime }}</div>
  26. </template>
  27. </byTable>
  28. </el-card>
  29. </div>
  30. </template>
  31. <script setup>
  32. import byTable from "/src/components/byTable/index";
  33. const { proxy } = getCurrentInstance();
  34. const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
  35. const sourceList = ref({
  36. data: [],
  37. pagination: {
  38. total: 0,
  39. pageNum: 1,
  40. pageSize: 10,
  41. departmentId: "",
  42. skuSpecCode: "",
  43. skuSpecName: "",
  44. bomSpecCode: "",
  45. bomSpecName: "",
  46. orderCode: "",
  47. orderWlnCode: "",
  48. orderStatus: "",
  49. beginTime: "",
  50. endTime: "",
  51. },
  52. });
  53. const loading = ref(false);
  54. const searchConfig = computed(() => {
  55. return [
  56. {
  57. type: "select",
  58. prop: "departmentId",
  59. data: departmentList.value,
  60. label: "事业部",
  61. },
  62. {
  63. type: "input",
  64. prop: "skuSpecCode",
  65. label: "SKU规格编码",
  66. },
  67. {
  68. type: "input",
  69. prop: "skuSpecName",
  70. label: "SKU规格名称",
  71. },
  72. {
  73. type: "input",
  74. prop: "bomSpecCode",
  75. label: "BOM规格编码",
  76. },
  77. {
  78. type: "input",
  79. prop: "bomSpecName",
  80. label: "BOM规格名称",
  81. },
  82. {
  83. type: "input",
  84. prop: "orderCode",
  85. label: "订单号",
  86. },
  87. {
  88. type: "input",
  89. prop: "orderWlnCode",
  90. label: "万里牛单号",
  91. },
  92. {
  93. type: "select",
  94. prop: "orderStatus",
  95. dictKey: "order_status",
  96. label: "订单状态",
  97. },
  98. {
  99. type: "datetime",
  100. propList: ["beginTime", "endTime"],
  101. label: "下单时间",
  102. },
  103. ];
  104. });
  105. const config = computed(() => {
  106. return [
  107. {
  108. attrs: {
  109. label: "设计图",
  110. slot: "blueprint",
  111. width: 80,
  112. },
  113. },
  114. {
  115. attrs: {
  116. label: "产品规格编码",
  117. prop: "skuSpecCode",
  118. width: 160,
  119. },
  120. },
  121. {
  122. attrs: {
  123. label: "产品规格名称",
  124. prop: "skuSpecName",
  125. width: 240,
  126. },
  127. },
  128. {
  129. attrs: {
  130. label: "BOM规格编码",
  131. prop: "bomSpecCode",
  132. width: 160,
  133. },
  134. },
  135. {
  136. attrs: {
  137. label: "BOM规格名称",
  138. prop: "bomSpecName",
  139. width: 260,
  140. },
  141. },
  142. {
  143. attrs: {
  144. label: "事业部",
  145. prop: "departmentName",
  146. width: 120,
  147. },
  148. },
  149. {
  150. attrs: {
  151. label: "订单号",
  152. slot: "orderCode",
  153. width: 200,
  154. },
  155. },
  156. {
  157. attrs: {
  158. label: "万里牛单号",
  159. prop: "orderWlnCode",
  160. width: 160,
  161. },
  162. },
  163. {
  164. attrs: {
  165. label: "订单状态",
  166. prop: "orderStatus",
  167. width: 120,
  168. },
  169. render(val) {
  170. return proxy.dictKeyValue(val, proxy.useUserStore().allDict["order_status"]);
  171. },
  172. },
  173. {
  174. attrs: {
  175. label: "结算状态",
  176. prop: "orderSettlementStatus",
  177. width: 120,
  178. },
  179. render(val) {
  180. return proxy.dictKeyValue(val, proxy.useUserStore().allDict["settlement_status"]);
  181. },
  182. },
  183. {
  184. attrs: {
  185. label: "数量",
  186. prop: "quantity",
  187. width: 80,
  188. },
  189. },
  190. {
  191. attrs: {
  192. label: "小计 ¥",
  193. slot: "subtotal",
  194. width: 120,
  195. align: "right",
  196. },
  197. },
  198. {
  199. attrs: {
  200. label: "产品单价 ¥",
  201. prop: "unitPrice",
  202. width: 120,
  203. align: "right",
  204. },
  205. render(val) {
  206. return proxy.moneyFormat(val);
  207. },
  208. },
  209. {
  210. attrs: {
  211. label: "定制加工费 ¥",
  212. prop: "customProcessingFee",
  213. width: 120,
  214. align: "right",
  215. },
  216. render(val) {
  217. return proxy.moneyFormat(val);
  218. },
  219. },
  220. {
  221. attrs: {
  222. label: "代发费 ¥",
  223. prop: "lssueFee",
  224. width: 120,
  225. align: "right",
  226. },
  227. render(val) {
  228. return proxy.moneyFormat(val);
  229. },
  230. },
  231. {
  232. attrs: {
  233. label: "快递包材费 ¥",
  234. prop: "deliveryMaterialsFee",
  235. width: 120,
  236. align: "right",
  237. },
  238. render(val) {
  239. return proxy.moneyFormat(val);
  240. },
  241. },
  242. {
  243. attrs: {
  244. label: "包装人工费 ¥",
  245. prop: "packingLabor",
  246. width: 120,
  247. align: "right",
  248. },
  249. render(val) {
  250. return proxy.moneyFormat(val);
  251. },
  252. },
  253. {
  254. attrs: {
  255. label: "包材费 ¥",
  256. prop: "packagingMaterialCost",
  257. width: 120,
  258. align: "right",
  259. },
  260. render(val) {
  261. return proxy.moneyFormat(val);
  262. },
  263. },
  264. {
  265. attrs: {
  266. label: "管理费 ¥",
  267. prop: "managementFee",
  268. width: 120,
  269. align: "right",
  270. },
  271. render(val) {
  272. return proxy.moneyFormat(val);
  273. },
  274. },
  275. {
  276. attrs: {
  277. label: "下单时间",
  278. slot: "wlnCreateTime",
  279. width: 160,
  280. },
  281. },
  282. ];
  283. });
  284. const getDemandData = () => {
  285. proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
  286. if (res.rows && res.rows.length > 0) {
  287. departmentList.value = departmentList.value.concat(
  288. res.rows.map((item) => {
  289. return {
  290. dictKey: item.id,
  291. dictValue: item.name,
  292. };
  293. })
  294. );
  295. }
  296. });
  297. };
  298. getDemandData();
  299. const getList = async (req, status) => {
  300. if (status) {
  301. sourceList.value.pagination = {
  302. pageNum: sourceList.value.pagination.pageNum,
  303. pageSize: sourceList.value.pagination.pageSize,
  304. };
  305. } else {
  306. sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
  307. }
  308. loading.value = true;
  309. proxy.post("/orderSku/page", sourceList.value.pagination).then((res) => {
  310. sourceList.value.data = res.rows;
  311. sourceList.value.pagination.total = res.total;
  312. setTimeout(() => {
  313. loading.value = false;
  314. }, 200);
  315. });
  316. };
  317. getList();
  318. const clickReset = () => {
  319. getList("", true);
  320. };
  321. const clickCode = (row) => {
  322. proxy.$router.replace({
  323. path: "/order-detail",
  324. query: {
  325. detailId: row.orderId,
  326. text: "订单详情",
  327. random: proxy.random(),
  328. },
  329. });
  330. };
  331. const subtotal = (row) => {
  332. let money = 0;
  333. if (row.unitPrice) {
  334. money = Number(Math.round((money + row.unitPrice) * 100) / 100);
  335. }
  336. if (row.customProcessingFee) {
  337. money = Number(Math.round((money + row.customProcessingFee) * 100) / 100);
  338. }
  339. if (row.lssueFee) {
  340. money = Number(Math.round((money + row.lssueFee) * 100) / 100);
  341. }
  342. if (row.deliveryMaterialsFee) {
  343. money = Number(Math.round((money + row.deliveryMaterialsFee) * 100) / 100);
  344. }
  345. if (row.packingLabor) {
  346. money = Number(Math.round((money + row.packingLabor) * 100) / 100);
  347. }
  348. if (row.managementFee) {
  349. money = Number(Math.round((money + row.managementFee) * 100) / 100);
  350. }
  351. if (row.packagingMaterialCost) {
  352. money = Number(Math.round((money + row.packagingMaterialCost) * 100) / 100);
  353. }
  354. return money;
  355. };
  356. </script>
  357. <style lang="scss" scoped>
  358. :deep(.el-dialog) {
  359. margin-top: 10px !important;
  360. margin-bottom: 10px !important;
  361. }
  362. </style>