gongchunyi
2 天以前 1677b6e8c20c3c8dd8297c08428538ca5e0029fc
src/views/inventoryManagement/issueManagement/index.vue
@@ -51,12 +51,22 @@
                             prop="inboundNum0"
                             width="90"
                             show-overflow-tooltip />
            <el-table-column label="状态"
                             align="center"
                             prop="isFrozen"
                             width="100">
              <template #default="scope">
                <el-tag :type="scope.row.isFrozen ? 'danger' : 'success'">
                  {{ scope.row.isFrozen ? '已冻结' : '正常' }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column fixed="right"
                             label="操作"
                             min-width="60"
                             align="center">
              <template #default="scope">
                <el-button :disabled="scope.row.inboundNum0 <= 0"
                <el-button :disabled="scope.row.inboundNum0 <= 0 || scope.row.isFrozen"
                           link
                           type="primary"
                           size="small"
@@ -131,13 +141,103 @@
            <el-table-column label="含税总价(元)"
                             prop="taxInclusiveTotalPrice"
                             width="150"></el-table-column>
            <el-table-column label="状态"
                             align="center"
                             prop="isFrozen"
                             width="100">
              <template #default="scope">
                <el-tag :type="scope.row.isFrozen ? 'danger' : 'success'">
                  {{ scope.row.isFrozen ? '已冻结' : '正常' }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column fixed="right"
                             label="操作"
                             min-width="60"
                             align="center">
              <template #default="scope">
                <el-button link
                           :disabled="scope.row.inboundNum0 <= 0"
                           :disabled="scope.row.inboundNum0 <= 0 || scope.row.isFrozen"
                           type="primary"
                           size="small"
                           @click="openForm(scope.row);">领用</el-button>
              </template>
            </el-table-column>
          </el-table>
          <pagination v-show="total > 0"
                      :total="total"
                      layout="total, sizes, prev, pager, next, jumper"
                      :page="page.current"
                      :limit="page.size"
                      @pagination="paginationChange" />
        </div>
      </el-tab-pane>
      <el-tab-pane label="生产出库"
                   name="product">
        <div class="search_form">
          <div>
            <span class="search_title ml10">产品大类:</span>
            <el-input v-model="searchForm.productCategory"
                      style="width: 240px"
                      placeholder="请输入"
                      clearable />
            <el-button type="primary"
                       @click="handleQuery"
                       style="margin-left: 10px">搜索</el-button>
          </div>
          <div>
            <el-button @click="handleOut">导出</el-button>
          </div>
        </div>
        <div class="table_list">
          <el-table :data="tableData"
                    border
                    v-loading="tableLoading"
                    @selection-change="handleSelectionChange"
                    :expand-row-keys="expandedRowKeys"
                    :row-key="row => row.id"
                    show-summary
                    style="width: 100%"
                    :summary-method="summarizeMainTable"
                    height="calc(100vh - 18.5em)">
            <el-table-column align="center"
                             type="selection"
                             width="55" />
            <el-table-column align="center"
                             label="序号"
                             type="index"
                             width="60" />
            <el-table-column label="产品大类"
                             prop="productCategory"
                             show-overflow-tooltip />
            <el-table-column label="规格型号"
                             prop="specificationModel"
                             show-overflow-tooltip />
            <el-table-column label="单位"
                             prop="unit"
                             width="70"
                             show-overflow-tooltip />
            <el-table-column label="剩余库存"
                             prop="inboundNum0"
                             width="90"
                             show-overflow-tooltip />
            <el-table-column label="状态"
                             align="center"
                             prop="isFrozen"
                             width="100">
              <template #default="scope">
                <el-tag :type="scope.row.isFrozen ? 'danger' : 'success'">
                  {{ scope.row.isFrozen ? '已冻结' : '正常' }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column fixed="right"
                             label="操作"
                             min-width="60"
                             align="center">
              <template #default="scope">
                <el-button link
                           :disabled="scope.row.inboundNum0 <= 0 || scope.row.isFrozen"
                           type="primary"
                           size="small"
                           @click="openForm(scope.row);">领用</el-button>
@@ -217,6 +317,7 @@
  import {
    getStockInPage,
    getStockInPageByProduction,
    getStockInPageByProductProduction,
  } from "@/api/inventoryManagement/stockIn.js";
  import {
    getStockManagePage,
@@ -287,7 +388,9 @@
    let apiCall;
    if (activeTab.value === "production") {
      apiCall = getStockInPageByProduction(params);
    } else {
    } else if (activeTab.value === "product") {
      apiCall = getStockInPageByProductProduction(params);
    }else {
      apiCall = getStockInPage(params);
    }
    apiCall
@@ -345,13 +448,17 @@
  const currentRowNum = ref(0);
  const salesLedgerProductId = ref(null);
const productModelId = ref(null);
  // 打开弹框
  const openForm = async row => {
    if (row.isFrozen) {
      return proxy.$modal.msgError("该产品已冻结,无法领用");
    }
    dialogFormVisible.value = true;
    currentRowId.value = row.id;
    currentRowNum.value = row.inboundNum0;
    salesLedgerProductId.value = row.salesLedgerProductId;
    productModelId.value = row.productModelId;
    form.value = {};
    // 初始化表单数据
    form.value = {
@@ -381,7 +488,7 @@
    }
    proxy.$refs["formRef"].validate(valid => {
      if (valid && currentRowId.value) {
        const typeMap = { production: 2, purchase: 1 };
        const typeMap = { production: 2, purchase: 1, product: 4 };
        const outData = {
          id: currentRowId.value, // 原始记录ID
          salesLedgerProductId: salesLedgerProductId.value,
@@ -389,6 +496,7 @@
          time: form.value.inboundTime, // 出库时间
          userId: form.value.nickName, // 操作人
          type: typeMap[activeTab.value], // 出库类型:采购1,生产2
          productModelId: productModelId.value,
        };
        console.log(outData);