Procházet zdrojové kódy

订单管理列表页面

lxf před 1 rokem
rodič
revize
f6b71391a3

+ 7 - 2
src/components/byTable/index.vue

@@ -2,8 +2,13 @@
   <el-form :inline="true" :model="pagination" v-if="searchConfig && searchConfig.length > 0" @submit.native.prevent>
     <el-form-item v-for="(item, index) in searchConfig" :key="index" :label="item.label + ':'" :prop="item.prop">
       <el-input v-if="item.type === 'input'" v-model="pagination[item.prop]" :placeholder="'请输入' + item.label" @keyup.enter.native="searchFn" />
-      <el-select v-else-if="item.type === 'select'" v-model="pagination[item.prop]" :placeholder="'请选择' + item.label" @change="searchFn">
-        <el-option v-for="itemDict in useUserStore().allDict[item.dictKey]" :key="itemDict.dictKey" :label="itemDict.dictValue" :value="itemDict.dictKey" />
+      <el-select v-else-if="item.type === 'select'" v-model="pagination[item.prop]" :placeholder="'请选择' + item.label" clearable @change="searchFn">
+        <template v-if="item.dictKey">
+          <el-option v-for="itemDict in useUserStore().allDict[item.dictKey]" :key="itemDict.dictKey" :label="itemDict.dictValue" :value="itemDict.dictKey" />
+        </template>
+        <template v-else-if="item.data && item.data.length > 0">
+          <el-option v-for="itemDict in item.data" :key="itemDict.dictKey" :label="itemDict.dictValue" :value="itemDict.dictKey" />
+        </template>
       </el-select>
     </el-form-item>
     <el-form-item>

+ 221 - 47
src/views/group/order/management/index.vue

@@ -10,26 +10,25 @@
         highlight-current-row
         :action-list="[
           {
-            text: '添加产品',
-            action: () => clickModal(),
+            text: '操作日志',
+            action: () => viewLogs(),
           },
-          // {
-          //   text: '操作日志',
-          //   action: () => viewLogs(),
-          // },
         ]"
         @get-list="getList"
         @clickReset="clickReset">
-        <template #name="{ item }">
+        <template #code="{ item }">
           <div>
-            <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickName(item)">{{ item.name }}</a>
+            <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
           </div>
         </template>
+        <template #address="{ item }">
+          <div>{{ item.province }}, {{ item.city }}, {{ item.county }}, {{ item.detailedAddress }}</div>
+        </template>
       </byTable>
     </el-card>
 
     <el-dialog :title="modalTitle" v-if="openDialog" v-model="openDialog" width="90%">
-      <MakeSKU :rowData="rowData" :detailStatus="detailStatus" @clickCancel="clickCancel"></MakeSKU>
+      <!-- <MakeSKU :rowData="rowData" :detailStatus="detailStatus" @clickCancel="clickCancel"></MakeSKU> -->
     </el-dialog>
 
     <el-dialog title="操作日志" v-if="openLogs" v-model="openLogs" width="50%">
@@ -51,6 +50,7 @@
 <script setup>
 import byTable from "@/components/byTable/index";
 import MakeSKU from "@/components/makeProduct/index";
+import { ElMessage, ElMessageBox } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const sourceList = ref({
@@ -59,26 +59,56 @@ const sourceList = ref({
     total: 0,
     pageNum: 1,
     pageSize: 10,
+    departmentName: "",
+    code: "",
+    wlnCode: "",
+    status: "",
+    settlementStatus: "",
   },
 });
+const settlementStatus = ref([
+  {
+    dictKey: 1,
+    dictValue: "未结算",
+  },
+  {
+    dictKey: 2,
+    dictValue: "已对账",
+  },
+  {
+    dictKey: 3,
+    dictValue: "已结算",
+  },
+]);
 const loading = ref(false);
 const searchConfig = computed(() => {
   return [
     {
       type: "input",
-      prop: "name",
-      label: "品名",
+      prop: "code",
+      label: "订单号",
     },
     {
       type: "input",
-      prop: "code",
-      label: "品号",
+      prop: "wlnCode",
+      label: "万里牛单号",
+    },
+    {
+      type: "input",
+      prop: "departmentName",
+      label: "事业部名称",
     },
     {
       type: "select",
-      prop: "brand",
-      dictKey: "sku_brand",
-      label: "品牌",
+      prop: "status",
+      dictKey: "order_status",
+      label: "订单状态",
+    },
+    {
+      type: "select",
+      prop: "settlementStatus",
+      label: "结算状态",
+      data: settlementStatus.value,
     },
   ];
 });
@@ -86,56 +116,180 @@ const config = computed(() => {
   return [
     {
       attrs: {
-        label: "群组品号",
-        prop: "code",
-        width: 180,
+        label: "事业部",
+        prop: "departmentName",
+        width: 120,
+      },
+    },
+    {
+      attrs: {
+        label: "订单号",
+        slot: "code",
+        width: 200,
+      },
+    },
+    {
+      attrs: {
+        label: "万里牛单号",
+        prop: "wlnCode",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "快递单号",
+        prop: "expressDeliveryCode",
+        width: 140,
+      },
+    },
+    {
+      attrs: {
+        label: "订单状态",
+        prop: "status",
+        width: 120,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["order_status"]);
+      },
+    },
+    {
+      attrs: {
+        label: "结算状态",
+        prop: "settlementStatus",
+        width: 120,
+      },
+      render(val) {
+        return proxy.dictKeyValue(val, settlementStatus.value);
+      },
+    },
+    {
+      attrs: {
+        label: "税率",
+        prop: "taxRate",
+        width: 80,
+      },
+      render(val) {
+        return val + "%";
+      },
+    },
+    {
+      attrs: {
+        label: "订单总金额 ¥",
+        prop: "totalAmount",
+        width: 120,
+        align: "right",
+      },
+      render(val) {
+        return proxy.moneyFormat(val);
+      },
+    },
+    {
+      attrs: {
+        label: "产品总金额 ¥",
+        prop: "productTotalAmount",
+        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: "群组品名",
-        slot: "name",
-        "min-width": 240,
+        label: "快递包材费 ¥",
+        prop: "deliveryMaterialsFee",
+        width: 120,
+        align: "right",
+      },
+      render(val) {
+        return proxy.moneyFormat(val);
       },
     },
     {
       attrs: {
-        label: "产品来源",
-        prop: "source",
+        label: "包装人工费 ¥",
+        prop: "packingLabor",
         width: 120,
+        align: "right",
       },
       render(val) {
-        return val == 1 ? "MES" : "万里牛";
+        return proxy.moneyFormat(val);
       },
     },
     {
       attrs: {
-        label: "品牌",
-        prop: "brand",
+        label: "包材费 ¥",
+        prop: "packagingMaterialCost",
         width: 120,
+        align: "right",
       },
       render(val) {
-        return proxy.dictKeyValue(val, proxy.useUserStore().allDict["sku_brand"]);
+        return proxy.moneyFormat(val);
       },
     },
     {
       attrs: {
-        label: "型号",
-        prop: "modelNumber",
+        label: "交期",
+        prop: "deliveryTime",
+        width: 160,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
+        label: "发货时间",
+        prop: "shippingTime",
+        width: 160,
+        align: "center",
+      },
+    },
+    {
+      attrs: {
+        label: "收货人",
+        prop: "consignee",
         width: 140,
       },
     },
     {
       attrs: {
-        label: "材质",
-        prop: "material",
+        label: "收货人电话",
+        prop: "consigneeNumber",
         width: 140,
       },
     },
     {
       attrs: {
+        label: "收货人地址",
+        slot: "address",
+        width: 220,
+      },
+    },
+    {
+      attrs: {
         label: "操作",
-        width: 80,
+        width: 120,
         align: "center",
         fixed: "right",
       },
@@ -143,13 +297,24 @@ const config = computed(() => {
         return [
           {
             attrs: {
-              label: "编辑",
+              label: "税率",
               type: "primary",
               text: true,
             },
             el: "button",
             click() {
-              clickUpdate(row);
+              ElMessage("暂无税率功能");
+            },
+          },
+          {
+            attrs: {
+              label: "删除",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickDelete(row);
             },
           },
         ];
@@ -180,33 +345,42 @@ const clickReset = () => {
   treeCategory.value.setCurrentKey(null);
   getList("", true);
 };
-const modalTitle = ref("添加SKU");
+const modalTitle = ref("添加订单");
 const openDialog = ref(false);
 const rowData = ref({});
 const detailStatus = ref(false);
 const clickModal = () => {
-  modalTitle.value = "添加SKU";
+  modalTitle.value = "添加订单";
   rowData.value = {};
   detailStatus.value = false;
   openDialog.value = true;
 };
 const clickUpdate = (row) => {
-  modalTitle.value = "编辑SKU";
+  modalTitle.value = "编辑订单";
   rowData.value = row;
   detailStatus.value = false;
   openDialog.value = true;
 };
+const clickDelete = (row) => {
+  ElMessageBox.confirm("你是否确认此操作", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  }).then(() => {
+    proxy.post("/orderInfo/delete", { id: row.id }).then(() => {
+      ElMessage({ message: "删除成功", type: "success" });
+      getList();
+    });
+  });
+};
 const clickCancel = (status) => {
   openDialog.value = false;
   if (status) {
     getList();
   }
 };
-const openFile = (path) => {
-  window.open(path);
-};
-const clickName = (row) => {
-  modalTitle.value = "SKU详情";
+const clickCode = (row) => {
+  modalTitle.value = "订单详情";
   rowData.value = row;
   detailStatus.value = true;
   openDialog.value = true;
@@ -239,14 +413,14 @@ const configLogs = computed(() => {
     {
       attrs: {
         label: "操作人",
-        prop: "operator",
+        prop: "userName",
         align: "center",
       },
     },
     {
       attrs: {
-        label: "SKU品号",
-        prop: "code",
+        label: "订单号",
+        prop: "orderCode",
         align: "center",
       },
     },
@@ -272,7 +446,7 @@ const viewLogs = () => {
 const getLogsList = async (req) => {
   logsList.value.pagination = { ...logsList.value.pagination, ...req };
   loadingLogs.value = true;
-  proxy.post("/bomOperatingLog/page", logsList.value.pagination).then((res) => {
+  proxy.post("/orderOperatingLog/page", logsList.value.pagination).then((res) => {
     logsList.value.data = res.rows;
     logsList.value.pagination.total = res.total;
     setTimeout(() => {