yangfeng
2023-09-27 ecd4e0f81c47fcb4ae41e7b4377f49b8a326c0d9
src/views/operate/inventoryAdjustment/inventoryAdjustmentHistory.vue
@@ -1,12 +1,7 @@
<template>
  <div class="rightContent">
    <div class="top">
      <SearchCommonView
        :show-add="false"
        :placeholder="'请输入单号/产品'"
        :amount-view="false"
        @searchClick="getList"
      />
      <SearchCommonView :show-add="false" :placeholder="'请输入单号'" :amount-view="false" @searchClick="getList" />
    </div>
    <div class="list-view">
      <div class="table">
@@ -21,7 +16,7 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getAllList } from "@/api/overview/overview"
import { historyInventoryAdjustment } from "@/api/operate/inventoryAdjustment"
export default {
  name: "InventoryAdjustmentHistory",
@@ -34,11 +29,15 @@
      tableList: {},
      showcol: ["状态"],
      searchOptions: [],
      keyword: ""
      keyword: "",
      locationId: 0,
      productId: ""
    }
  },
  created() {
    this.setTable()
    this.locationId = this.$route.params.locationId
    this.productId = this.$route.params.productId
    this.getData()
  },
  methods: {
@@ -65,8 +64,7 @@
          label: "日期",
          prop: "operationDate",
          isShowColumn: true,
          default: true,
          date: true
          default: true
        },
        {
          label: "单号",
@@ -129,18 +127,22 @@
    },
    // 请求数据
    async getData() {
      await getAllList({
        number: this.keyword,
      await historyInventoryAdjustment({
        locationId: this.locationId,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize,
        sourceNumber: this.keyword
        productId: this.productId
      }).then((res) => {
        if (res.code === 200) {
          const list = res.data.map((item) => {
            let product = item.details[0].product
            return {
              ...item,
              from: item.fromLocation.name,
              to: item.toLocation.name
              to: item.toLocation.name,
              productName: product.name,
              amount: product.amount,
              unit: product.unit
            }
          })
          this.tableList.tableInfomation = list || []