songshankun
2023-11-03 cf6a4b874aed82592eea78294715c7c688f9b248
src/views/reportForm/inboundOutboundDetail/index.vue
@@ -4,7 +4,7 @@
      <SearchCommonView
        :add-title="'新建'"
        :showAdd="false"
        :placeholder="'请输入参考'"
        :placeholder="'请根据单号、产品、业务类型进行搜索'"
        :amount-view="false"
        @addCommonClick="addBtnClick"
        @searchClick="getList"
@@ -31,7 +31,7 @@
<script>
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import { getHistory } from "@/api/reportForm/inventoryRwport"
import { getProductOperatonList } from "@/api/product/product"
// import { getProductOperatonList } from "@/api/product/product"
import AddOverviewDialog from "@/views/overview/AddOverviewDialog"
@@ -118,6 +118,12 @@
          default: true
        },
        {
          label: "业务类型",
          prop: "baseOperationType",
          isShowColumn: true,
          default: true
        },
        {
          label: "从",
          prop: "fromLocation",
          isShowColumn: true,
@@ -181,23 +187,46 @@
          }
        })
      } else {
        await getProductOperatonList({
          productId: this.params.id,
        // await getProductOperatonList({
        //   productId: this.params.id,
        //   page: this.pagerOptions.currPage,
        //   pageSize: this.pagerOptions.pageSize
        // }).then((res) => {
        //   if (res.code === 200) {
        //     const list = res.data.map((item) => {
        //       return {
        //         ...item,
        //         fromLocation: item.fromLocation.name,
        //         toLocation: item.toLocation.name,
        //         productName: this.params.name,
        //         amount: item.details[0].product.amount,
        //         unit: item.details[0].product.unit
        //       }
        //     })
        //     this.tableList.tableInfomation = list || []
        //     this.pagerOptions.totalCount = res.total
        //   }
        // })
        await getHistory({
          page: this.pagerOptions.currPage,
          pageSize: this.pagerOptions.pageSize
        }).then((res) => {
          if (res.code === 200) {
            const list = res.data.map((item) => {
              return {
                ...item,
                fromLocation: item.fromLocation.name,
                toLocation: item.toLocation.name,
                productName: this.params.name,
                amount: item.details[0].product.amount,
                unit: item.details[0].product.unit
            // let arr=[]
            res.data.map((item)=>{
              if(item.baseOperationType===1){
                item.baseOperationType="收货"
              }else if(item.baseOperationType===2){
                item.baseOperationType="交货"
              }else if(item.baseOperationType===3){
                item.baseOperationType="内部调拨"
              }else if(item.baseOperationType===4){
                item.baseOperationType="报废"
              }else if(item.baseOperationType===5){
                item.baseOperationType="库存盘点"
              }
            })
            this.tableList.tableInfomation = list || []
            this.tableList.tableInfomation = res.data
            this.pagerOptions.totalCount = res.total
          }
        })
@@ -206,6 +235,15 @@
    // 搜索
    getList(val) {
      console.log(val)
      // getHistory({
      //     page: this.pagerOptions.currPage,
      //     pageSize: this.pagerOptions.pageSize
      // }).then((res) => {
      //   if (res.code === 200) {
      //     this.tableList.tableInfomation = res.data
      //     this.pagerOptions.totalCount = res.total
      //   }
      // })
    },
    // 行点击
    tableRowClick(row) {