Forráskód Böngészése

订单产品管理 table组件增加时间范围查询

lxf 1 éve
szülő
commit
5abcd8d223

+ 35 - 0
src/components/byTable/index.vue

@@ -10,6 +10,29 @@
           <el-option v-for="itemDict in item.data" :key="itemDict.dictKey" :label="itemDict.dictValue" :value="itemDict.dictKey" />
         </template>
       </el-select>
+      <template v-else-if="item.type === 'datetime'">
+        <el-row>
+          <el-col :span="11">
+            <el-date-picker
+              v-model="pagination[item.propList[0]]"
+              type="datetime"
+              placeholder="请选择起始时间"
+              value-format="YYYY-MM-DD HH:mm:ss"
+              style="width: 100%"
+              @change="searchFn" />
+          </el-col>
+          <el-col :span="2" style="text-align: center">-</el-col>
+          <el-col :span="11">
+            <el-date-picker
+              v-model="pagination[item.propList[1]]"
+              type="datetime"
+              placeholder="请选择起始时间"
+              value-format="YYYY-MM-DD HH:mm:ss"
+              style="width: 100%"
+              @change="searchFn" />
+          </el-col>
+        </el-row>
+      </template>
     </el-form-item>
     <el-form-item>
       <el-button @click="searchFn" class="searchBtn">搜索</el-button>
@@ -586,4 +609,16 @@ export default defineComponent({
 ::v-deep(.el-form-item) {
   margin-right: 16px !important;
 }
+::v-deep(.el-input__wrapper) {
+  position: relative;
+  .el-input__inner {
+    padding-right: 18px;
+  }
+  .el-input__suffix {
+    position: absolute;
+    right: 8px;
+    top: 50%;
+    transform: translateY(-50%);
+  }
+}
 </style>

+ 0 - 1
src/views/group/order/management/index.vue

@@ -340,7 +340,6 @@ const getList = async (req, status) => {
 };
 getList();
 const clickReset = () => {
-  treeCategory.value.setCurrentKey(null);
   getList("", true);
 };
 const clickAddOrder = () => {

+ 48 - 15
src/views/group/order/product-management/index.vue

@@ -10,14 +10,17 @@
         highlight-current-row
         @get-list="getList"
         @clickReset="clickReset">
-        <template #code="{ item }">
+        <template #orderCode="{ item }">
           <div>
-            <a style="color: #409eff; cursor: pointer; word-break: break-all" @click="clickCode(item)">{{ item.code }}</a>
+            <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>
@@ -40,7 +43,7 @@ const sourceList = ref({
     skuSpecName: "",
     bomSpecCode: "",
     bomSpecName: "",
-    orderCode: "PI1690269227623",
+    orderCode: "",
     orderWlnCode: "",
     orderStatus: "",
     beginTime: "",
@@ -86,6 +89,11 @@ const searchConfig = computed(() => {
       dictKey: "order_status",
       label: "订单状态",
     },
+    {
+      type: "datetime",
+      propList: ["beginTime", "endTime"],
+      label: "下单时间",
+    },
   ];
 });
 const config = computed(() => {
@@ -135,14 +143,14 @@ const config = computed(() => {
     {
       attrs: {
         label: "订单号",
-        slot: "code",
+        slot: "orderCode",
         width: 200,
       },
     },
     {
       attrs: {
         label: "万里牛单号",
-        prop: "wlnCode",
+        prop: "orderWlnCode",
         width: 160,
       },
     },
@@ -159,7 +167,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "结算状态",
-        prop: "settlementStatus",
+        prop: "orderSettlementStatus",
         width: 120,
       },
       render(val) {
@@ -175,19 +183,16 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "订单总金额 ¥",
-        prop: "totalAmount",
+        label: "小计 ¥",
+        slot: "subtotal",
         width: 120,
         align: "right",
       },
-      render(val) {
-        return proxy.moneyFormat(val);
-      },
     },
     {
       attrs: {
-        label: "产品总金额 ¥",
-        prop: "productTotalAmount",
+        label: "产品单价 ¥",
+        prop: "unitPrice",
         width: 120,
         align: "right",
       },
@@ -279,11 +284,39 @@ const getList = async (req, status) => {
 };
 getList();
 const clickReset = () => {
-  treeCategory.value.setCurrentKey(null);
   getList("", true);
 };
 const clickCode = (row) => {
-  console.log(row, "订单详情");
+  proxy.$router.replace({
+    path: "/addOrder",
+    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.packagingMaterialCost) {
+    money = Number(Math.round((money + row.packagingMaterialCost) * 100) / 100);
+  }
+  return money;
 };
 </script>
 

+ 0 - 1
src/views/group/product/groupSKU/index.vue

@@ -215,7 +215,6 @@ const getList = async (req, status) => {
 };
 getList();
 const clickReset = () => {
-  treeCategory.value.setCurrentKey(null);
   getList("", true);
 };
 const modalTitle = ref("添加SKU");

+ 0 - 1
src/views/group/product/management/index.vue

@@ -232,7 +232,6 @@ const getList = async (req, status) => {
 };
 getList();
 const clickReset = () => {
-  treeCategory.value.setCurrentKey(null);
   getList("", true);
 };
 const modalTitle = ref("添加SKU");