123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365 |
- <template>
- <div>
- <el-card class="box-card">
- <byTable
- :source="sourceList.data"
- :pagination="sourceList.pagination"
- :config="config"
- :loading="loading"
- :searchConfig="searchConfig"
- highlight-current-row
- @get-list="getList"
- @clickReset="clickReset">
- <template #orderCode="{ item }">
- <div>
- <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.orderCode }}</a>
- </div>
- </template>
- <template #blueprint="{ item }">
- <div>图片</div>
- </template>
- <template #subtotal="{ item }">
- <div style="color: #409eff">{{ subtotal(item) }}</div>
- </template>
- <template #wlnCreateTime="{ item }">
- <div>{{ item.wlnCreateTime || item.createTime }}</div>
- </template>
- </byTable>
- </el-card>
- </div>
- </template>
- <script setup>
- import byTable from "/src/components/byTable/index";
- const { proxy } = getCurrentInstance();
- const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 0,
- pageNum: 1,
- pageSize: 10,
- departmentId: "",
- skuSpecCode: "",
- skuSpecName: "",
- bomSpecCode: "",
- bomSpecName: "",
- orderCode: "",
- orderWlnCode: "",
- orderStatus: "",
- beginTime: "",
- endTime: "",
- },
- });
- const loading = ref(false);
- const searchConfig = computed(() => {
- return [
- {
- type: "select",
- prop: "departmentId",
- data: departmentList.value,
- label: "事业部",
- },
- {
- type: "input",
- prop: "skuSpecCode",
- label: "SKU规格编码",
- },
- {
- type: "input",
- prop: "skuSpecName",
- label: "SKU规格名称",
- },
- {
- type: "input",
- prop: "bomSpecCode",
- label: "BOM规格编码",
- },
- {
- type: "input",
- prop: "bomSpecName",
- label: "BOM规格名称",
- },
- {
- type: "input",
- prop: "orderCode",
- label: "订单号",
- },
- {
- type: "input",
- prop: "orderWlnCode",
- label: "万里牛单号",
- },
- {
- type: "select",
- prop: "orderStatus",
- dictKey: "order_status",
- label: "订单状态",
- },
- {
- type: "datetime",
- propList: ["beginTime", "endTime"],
- label: "下单时间",
- },
- ];
- });
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "设计图",
- slot: "blueprint",
- width: 80,
- },
- },
- {
- attrs: {
- label: "产品规格编码",
- prop: "skuSpecCode",
- width: 160,
- },
- },
- {
- attrs: {
- label: "产品规格名称",
- prop: "skuSpecName",
- width: 240,
- },
- },
- {
- attrs: {
- label: "BOM规格编码",
- prop: "bomSpecCode",
- width: 160,
- },
- },
- {
- attrs: {
- label: "BOM规格名称",
- prop: "bomSpecName",
- width: 260,
- },
- },
- {
- attrs: {
- label: "事业部",
- prop: "departmentName",
- width: 120,
- },
- },
- {
- attrs: {
- label: "订单号",
- slot: "orderCode",
- width: 200,
- },
- },
- {
- attrs: {
- label: "万里牛单号",
- prop: "orderWlnCode",
- width: 160,
- },
- },
- {
- attrs: {
- label: "订单状态",
- prop: "orderStatus",
- width: 120,
- },
- render(val) {
- return proxy.dictKeyValue(val, proxy.useUserStore().allDict["order_status"]);
- },
- },
- {
- attrs: {
- label: "结算状态",
- prop: "orderSettlementStatus",
- width: 120,
- },
- render(val) {
- return proxy.dictKeyValue(val, proxy.useUserStore().allDict["settlement_status"]);
- },
- },
- {
- attrs: {
- label: "数量",
- prop: "quantity",
- width: 80,
- },
- },
- {
- attrs: {
- label: "小计 ¥",
- slot: "subtotal",
- width: 120,
- align: "right",
- },
- },
- {
- attrs: {
- label: "产品单价 ¥",
- prop: "unitPrice",
- width: 120,
- align: "right",
- },
- render(val) {
- return proxy.moneyFormat(val);
- },
- },
- {
- attrs: {
- label: "定制加工费 ¥",
- prop: "customProcessingFee",
- width: 120,
- align: "right",
- },
- render(val) {
- return proxy.moneyFormat(val);
- },
- },
- {
- attrs: {
- label: "代发费 ¥",
- prop: "lssueFee",
- width: 120,
- align: "right",
- },
- render(val) {
- return proxy.moneyFormat(val);
- },
- },
- {
- attrs: {
- label: "快递包材费 ¥",
- prop: "deliveryMaterialsFee",
- width: 120,
- align: "right",
- },
- render(val) {
- return proxy.moneyFormat(val);
- },
- },
- {
- attrs: {
- label: "包装人工费 ¥",
- prop: "packingLabor",
- width: 120,
- align: "right",
- },
- render(val) {
- return proxy.moneyFormat(val);
- },
- },
- {
- attrs: {
- label: "包材费 ¥",
- prop: "packagingMaterialCost",
- width: 120,
- align: "right",
- },
- render(val) {
- return proxy.moneyFormat(val);
- },
- },
- {
- attrs: {
- label: "管理费 ¥",
- prop: "managementFee",
- width: 120,
- align: "right",
- },
- render(val) {
- return proxy.moneyFormat(val);
- },
- },
- {
- attrs: {
- label: "下单时间",
- slot: "wlnCreateTime",
- width: 160,
- },
- },
- ];
- });
- const getDemandData = () => {
- proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
- if (res.rows && res.rows.length > 0) {
- departmentList.value = departmentList.value.concat(
- res.rows.map((item) => {
- return {
- dictKey: item.id,
- dictValue: item.name,
- };
- })
- );
- }
- });
- };
- getDemandData();
- const getList = async (req, status) => {
- if (status) {
- sourceList.value.pagination = {
- pageNum: sourceList.value.pagination.pageNum,
- pageSize: sourceList.value.pagination.pageSize,
- };
- } else {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- }
- loading.value = true;
- proxy.post("/orderSku/page", sourceList.value.pagination).then((res) => {
- sourceList.value.data = res.rows;
- sourceList.value.pagination.total = res.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getList();
- const clickReset = () => {
- getList("", true);
- };
- const clickCode = (row) => {
- proxy.$router.replace({
- path: "/order-detail",
- query: {
- detailId: row.orderId,
- text: "订单详情",
- random: proxy.random(),
- },
- });
- };
- const subtotal = (row) => {
- let money = 0;
- if (row.unitPrice) {
- money = Number(Math.round((money + row.unitPrice) * 100) / 100);
- }
- if (row.customProcessingFee) {
- money = Number(Math.round((money + row.customProcessingFee) * 100) / 100);
- }
- if (row.lssueFee) {
- money = Number(Math.round((money + row.lssueFee) * 100) / 100);
- }
- if (row.deliveryMaterialsFee) {
- money = Number(Math.round((money + row.deliveryMaterialsFee) * 100) / 100);
- }
- if (row.packingLabor) {
- money = Number(Math.round((money + row.packingLabor) * 100) / 100);
- }
- if (row.managementFee) {
- money = Number(Math.round((money + row.managementFee) * 100) / 100);
- }
- if (row.packagingMaterialCost) {
- money = Number(Math.round((money + row.packagingMaterialCost) * 100) / 100);
- }
- return money;
- };
- </script>
- <style lang="scss" scoped>
- :deep(.el-dialog) {
- margin-top: 10px !important;
- margin-bottom: 10px !important;
- }
- </style>
|