yangfeng
2024-01-03 0e5fbe824f2cc0991465a74a2838ff2ee4c21d81
src/views/sales/salesDetails/index.vue
@@ -198,7 +198,7 @@
      { label: "销售单价", prop: "salePrice", price: true },
      { label: "成本单价", prop: "cost" },
      { label: "毛利", prop: "profit" },
      { label: "毛利率(%)", prop: "margin",},
      { label: "毛利率(%)", prop: "margin" },
      { label: "价税合计", prop: "total", price: true }
    ]
    // 库存信息
@@ -233,23 +233,23 @@
        },
        {
          label: "采购单名称",
          prop: "purchaseName",
        prop: "purchaseName"
        },
        {
          label: "供应商名称",
          prop: "supplierName",
        prop: "supplierName"
        },
        {
          label: "采购数量",
          prop: "amount",
        prop: "amount"
        },
        {
          label: "状态",
          prop: "status",
          isCallMethod: true,
          getCallMethod: this.getpurchaseStatus,
        },
      ];
        getCallMethod: this.getpurchaseStatus
      }
    ]
    return {
      tableList: {},
      searchOptions: [],
@@ -311,12 +311,23 @@
      productColumn: productColumn,
      showProductCol: ["产品编号", "产品名称", "数量", "单位",  "销售单价","成本单价", "毛利", "毛利率(%)","价税合计"],
      inventoryColumn: inventoryColumn,
      showInventoryCol: ["产品编号", "产品名称", "订单数量", "发货单", "承运商", "运单号","仓库", "在库数量", "可用库存", "单位"],
      showInventoryCol: [
        "产品编号",
        "产品名称",
        "订单数量",
        "发货单",
        "承运商",
        "运单号",
        "仓库",
        "在库数量",
        "可用库存",
        "单位"
      ],
      makeColumn: makeColumn,
      showMakeCol: ["生产订单", "产品名称", "订单状态", "工单编号", "工单状态", "计划开始时间", "计划结束时间"],
      // 采购
      purchaseColumn: purchaseColumn,
      showPurchaseCol: ['采购单号','采购单名称',"供应商名称", "采购数量", "状态"],
      showPurchaseCol: ["采购单号", "采购单名称", "供应商名称", "采购数量", "状态"],
      selectRow: {},
      projectList: [],
      projectListShow: false,
@@ -328,7 +339,7 @@
        projectId: [{ required: true, message: "请选择项目", trigger: "change" }]
      },
      purchaseStatusList: getDataByType("purchaseStatus"),
      loading:false,
      loading: false
    }
  },
  created() {
@@ -348,11 +359,11 @@
      if (val) {
        for (let i in this.purchaseStatusList) {
          if (this.purchaseStatusList[i].id == val) {
            return this.purchaseStatusList[i].name;
            return this.purchaseStatusList[i].name
          }
        }
      } else {
        return "--";
        return "--"
      }
    },
    setTable() {
@@ -479,10 +490,12 @@
      } else {
        if(row.number){
          this.loading = true
          await getProductInventoryInfo(row.number).then((res) => {
          await getProductInventoryInfo(row.number)
            .then((res) => {
            this.productTableList.tableInfomation = res.data?.length > 0 ? res.data : []
            this.loading = false
          }).catch(() => {
            })
            .catch(() => {
            this.productTableList.tableInfomation = []
            this.loading = false
          })
@@ -493,14 +506,16 @@
    async getProductOrderInfo(number) {
      if(number){
        this.loading = true
        await getProductOrderInfo(number).then((res) => {
        await getProductOrderInfo(number)
          .then((res) => {
          if(this.TabsIndex == 3){
            this.productTableList.tableInfomation = (res.data&&res.data.purchaseInfo) ? res.data.purchaseInfo : []
              this.productTableList.tableInfomation = res.data && res.data.purchaseInfo ? res.data.purchaseInfo : []
          }else{
            this.productTableList.tableInfomation = (res.data&&res.data.makeInfo) ? res.data.makeInfo : []
              this.productTableList.tableInfomation = res.data && res.data.makeInfo ? res.data.makeInfo : []
          }
          this.loading = false
        }).catch(() => {
          })
          .catch(() => {
          this.productTableList.tableInfomation = []
          this.loading = false
        })
@@ -529,7 +544,7 @@
    },
    // 查看 编辑
    handleClick(row, title) {
      let params = JSON.parse(JSON.stringify(row));
      let params = JSON.parse(JSON.stringify(row))
      this.editConfig.title = title
      this.editConfig.infomation = {
        ...params,
@@ -646,7 +661,11 @@
        this.tableBottomColumn = this.inventoryColumn
        this.showBottomCol = this.showInventoryCol
        this.setBottomList()
        if (this.selectRow.status == 1) {
          this.productTableList.tableInfomation = []
        } else {
        this.getProductInventoryInfo(this.selectRow)
        }
      } else if (this.TabsIndex == 2) {
        // 制造信息列表
        this.tableBottomColumn = this.makeColumn
@@ -671,7 +690,11 @@
      if (this.TabsIndex == 0) {
        this.getProductInventoryInfo(this.selectRow)
      } else if (this.TabsIndex == 1) {
        if (this.selectRow.status == 1) {
          this.productTableList.tableInfomation = []
        } else {
        this.getProductInventoryInfo(this.selectRow)
        }
      } else if (this.TabsIndex == 2) {
        this.getProductOrderInfo(this.selectRow.number)
      }else if(this.TabsIndex == 3) {