liyong
2 天以前 847e6cc3ce61641b478c77b52565516745e1d860
src/views/inventoryManagement/issueManagement/index.vue
@@ -152,6 +152,76 @@
                      @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 fixed="right"
                             label="操作"
                             min-width="60"
                             align="center">
              <template #default="scope">
                <el-button link
                           :disabled="scope.row.inboundNum0 <= 0"
                           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-tabs>
    <el-dialog v-model="dialogFormVisible"
               :title="getDialogTitle()"
@@ -217,6 +287,7 @@
  import {
    getStockInPage,
    getStockInPageByProduction,
    getStockInPageByProductProduction,
  } from "@/api/inventoryManagement/stockIn.js";
  import {
    getStockManagePage,
@@ -287,7 +358,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 +418,14 @@
  const currentRowNum = ref(0);
  const salesLedgerProductId = ref(null);
const productModelId = ref(null);
  // 打开弹框
  const openForm = async row => {
    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 +455,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 +463,7 @@
          time: form.value.inboundTime, // 出库时间
          userId: form.value.nickName, // 操作人
          type: typeMap[activeTab.value], // 出库类型:采购1,生产2
          productModelId: productModelId.value,
        };
        console.log(outData);