yangfeng
2023-11-08 4e0a7bafec1785ce7158733762d2904e3fba7d57
产品信息库存信息制造信息接口联调
2个文件已修改
96 ■■■■ 已修改文件
src/api/sales/salesDetails.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sales/salesDetails/index.vue 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sales/salesDetails.js
@@ -32,3 +32,17 @@
    data
  })
}
// 获取产品/库存信息
export function getProductInventoryInfo(number) {
  return request({
    url: `/api/salesDetails/getProductInventoryInfo/${number}`,
    method: "get"
  })
}
// 获取制造信息
export function getProductOrderInfo(number) {
  return request({
    url: `/api/product/getProductOrderInfo/${number}`,
    method: "get"
  })
}
src/views/sales/salesDetails/index.vue
@@ -119,7 +119,12 @@
<script>
import AddSalesDetailsDialog from "@/views/sales/salesDetails/AddSalesDetailsDialog"
import { getSalesDetailsList, getDelSalesDetails } from "@/api/sales/salesDetails"
import {
  getSalesDetailsList,
  getDelSalesDetails,
  getProductInventoryInfo,
  getProductOrderInfo
} from "@/api/sales/salesDetails"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
import DetailSpecification from "@/views/sales/salesDetails/DetailSpecification"
import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan"
@@ -153,35 +158,35 @@
  data() {
    // 产品信息
    const productColumn = [
      { label: "产品编号", prop: "number", default: true },
      { label: "产品名称", prop: "client_name" },
      { label: "数量", prop: "signTime" },
      { label: "单位", prop: "member_name" },
      { label: "发货单", prop: "outboundStatus" },
      { label: "承运商", prop: "receiveTotalAmount", price: true },
      { label: "运单号", prop: "total", price: true },
      { label: "销售单价", prop: "taxUnitPrice", isProductPrice: true },
      { label: "价税合计", prop: "priceTax", isProductTotal: true }
      { label: "产品编号", prop: "Id", default: true },
      { label: "产品名称", prop: "Name" },
      { label: "数量", prop: "Amount" },
      { label: "单位", prop: "Unit" },
      { label: "发货单", prop: "shipOrder" },
      { label: "承运商", prop: "carrier" },
      { label: "运单号", prop: "waybillNumber" },
      { label: "销售单价", prop: "SalePrice", price: true },
      { label: "价税合计", prop: "Valorem", price: true }
    ]
    // 库存信息
    const inventoryColumn = [
      { label: "产品编号", prop: "number", default: true },
      { label: "产品名称", prop: "client_name" },
      { label: "订单数量", prop: "signTime" },
      { label: "仓库", prop: "member_name" },
      { label: "在库数量", prop: "outboundStatus" },
      { label: "可用库存", prop: "receiveTotalAmount", price: true },
      { label: "单位", prop: "total", price: true }
      { label: "产品编号", prop: "Id", default: true },
      { label: "产品名称", prop: "Name" },
      { label: "订单数量", prop: "OrderAmount" },
      { label: "仓库", prop: "Warehouse" },
      { label: "在库数量", prop: "Amount" },
      { label: "可用库存", prop: "AvailableNumber" },
      { label: "单位", prop: "Unit" }
    ]
    // 制造信息
    const makeColumn = [
      { label: "生产订单", prop: "number", default: true },
      { label: "产品名称", prop: "client_name" },
      { label: "订单状态", prop: "signTime" },
      { label: "工单编号", prop: "member_name" },
      { label: "工单状态", prop: "outboundStatus" },
      { label: "计划开始时间", prop: "receiveTotalAmount", price: true },
      { label: "计划结束时间", prop: "total", price: true }
      { label: "生产订单", prop: "OrderId", default: true },
      { label: "产品名称", prop: "ProductName" },
      { label: "订单状态", prop: "OrderStatus" },
      { label: "工单编号", prop: "WorkOrderId" },
      { label: "工单状态", prop: "WorkOrderStatus" },
      { label: "计划开始时间", prop: "StartTime" },
      { label: "计划结束时间", prop: "EndTime" }
    ]
    return {
      tableList: {},
@@ -368,8 +373,8 @@
              this.pagerOptions.totalCount = res.data.count
              if (res.data.count > 0) {
                this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {}
                // let row = this.tableList.tableInfomation[0];
                // this.getPointinspectionRecord(row.id);
                let row = this.tableList.tableInfomation[0]
                this.getProductInventoryInfo(row.number)
              }
            } else {
              this.tableList.tableInfomation = []
@@ -384,6 +389,20 @@
          this.tableList.tableInfomation = []
          this.loading = false
        })
    },
    // 获取产品/库存信息
    async getProductInventoryInfo(number) {
      await getProductInventoryInfo(number).then((res) => {
        console.log(res)
        this.productTableList.tableInfomation = res.data
      })
    },
    // 获取制造信息
    async getProductOrderInfo(number) {
      await getProductOrderInfo(number).then((res) => {
        console.log(res)
        this.productTableList.tableInfomation = res.data
      })
    },
    // 搜索
    onFilterSearch(searchText) {
@@ -493,6 +512,7 @@
        this.tableBottomColumn = this.productColumn
        this.showBottomCol = this.showProductCol
        this.setBottomList()
        this.getProductInventoryInfo(this.selectRow.number)
      } else if (this.TabsIndex == 1) {
        this.isClickProduct = false
        this.isClickInventory = true
@@ -501,6 +521,7 @@
        this.tableBottomColumn = this.inventoryColumn
        this.showBottomCol = this.showInventoryCol
        this.setBottomList()
        this.getProductInventoryInfo(this.selectRow.number)
      } else if (this.TabsIndex == 2) {
        this.isClickProduct = false
        this.isClickInventory = false
@@ -509,6 +530,7 @@
        this.tableBottomColumn = this.makeColumn
        this.showBottomCol = this.showMakeCol
        this.setBottomList()
        this.getProductOrderInfo(this.selectRow.number)
      }
    },
    // 状态
@@ -519,7 +541,13 @@
    tableRowClick(row, column, event) {
      console.log(row, column, event)
      this.selectRow = row
      // this.getPointinspectionRecord(row.id);
      if (this.TabsIndex == 0) {
        this.getProductInventoryInfo(this.selectRow.number)
      } else if (this.TabsIndex == 1) {
        this.getProductInventoryInfo(this.selectRow.number)
      } else if (this.TabsIndex == 2) {
        this.getProductOrderInfo(this.selectRow.number)
      }
    }
  }
}