gaoluyang
6 天以前 3fd8dcf10cb28c248d693750f3f52a66f5f980a4
src/views/inventoryManagement/issueManagement/index.vue
@@ -77,45 +77,6 @@
           :page="page.current" :limit="page.size" @pagination="paginationChange" />
       </div>
     </el-tab-pane>
      <el-tab-pane label="材料出库" name="manual">
        <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="code" width="130" show-overflow-tooltip />
            <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="itemType" show-overflow-tooltip />
                  <el-table-column label="剩余库存" prop="inboundNum0" width="90" show-overflow-tooltip />
            <el-table-column fixed="right" label="操作" width="100" align="center">
              <template #default="scope">
                <el-button link 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()" width="40%" @close="closeDia">
      <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
@@ -154,7 +115,6 @@
import {
   getStockInPage,
   getStockInPageByProduction,
   getStockInPageByCustom, getInPageByCustom
} from "@/api/inventoryManagement/stockIn.js";
import {
  getStockManagePage,
@@ -187,7 +147,7 @@
    nickName: '',
    userId: '',
    productCategory:'',
    timeStr: getCurrentDate(),
    timeStr: '',
  },
  form: {
    productrecordId: '',
@@ -225,8 +185,6 @@
  let apiCall
  if (activeTab.value === 'production') {
    apiCall = getStockInPageByProduction(params)
  } else if (activeTab.value === 'manual') {
    apiCall = getInPageByCustom(params)
  } else {
    apiCall = getStockInPage(params)
  }
@@ -312,14 +270,14 @@
  }
  proxy.$refs["formRef"].validate(valid => {
    if (valid && currentRowId.value) {
      const typeMap = { production: 2, purchase: 1, manual: 3 }
      const typeMap = { production: 2, purchase: 1 }
      const outData = {
        id: currentRowId.value, // 原始记录ID
        salesLedgerProductId: activeTab.value === 'manual' ? 0 : salesLedgerProductId.value,
        salesLedgerProductId: salesLedgerProductId.value,
        quantity: form.value.inboundQuantity, // 出库数量
        time: form.value.inboundTime, // 出库时间
        userId: form.value.nickName, // 操作人
        type: typeMap[activeTab.value] // 出库类型:采购1,生产2,自定义3
        type: typeMap[activeTab.value] // 出库类型:采购1,生产2
      }
      console.log(outData)
@@ -353,8 +311,6 @@
    let exportUrl = "/stockin/export"
    if (activeTab.value === 'production') {
      exportUrl = "/stockin/exportOne"
    } else if (activeTab.value === 'manual') {
      exportUrl = "/stockin/exportTwo"
    }
    proxy.download(exportUrl, {}, '入库台账.xlsx')
  }).catch(() => {
@@ -399,8 +355,7 @@
const getDialogTitle = () => {
  const titleMap = {
    production: '新增发货',
    purchase: '新增领用',
    manual: '新增领用'
    purchase: '新增领用'
  };
  return titleMap[activeTab.value] || '新增出库';
};
@@ -409,8 +364,7 @@
const getAvailableQuantityText = () => {
  const textMap = {
    production: '可发货数量',
    purchase: '可领用数量',
    manual: '可领用数量'
    purchase: '可领用数量'
  };
  return textMap[activeTab.value] || '可出库数量';
};
@@ -419,8 +373,7 @@
const getQuantityLabel = () => {
  const labelMap = {
    production: '发货数量:',
    purchase: '领用数量:',
    manual: '领用数量:'
    purchase: '领用数量:'
  };
  return labelMap[activeTab.value] || '出库数量:';
};
@@ -429,8 +382,7 @@
const getDateLabel = () => {
  const labelMap = {
    production: '发货日期:',
    purchase: '领用日期:',
    manual: '领用日期:'
    purchase: '领用日期:'
  };
  return labelMap[activeTab.value] || '出库日期:';
};
@@ -439,8 +391,7 @@
const getPersonLabel = () => {
  const labelMap = {
    production: '发货人:',
    purchase: '领用人:',
    manual: '领用人:'
    purchase: '领用人:'
  };
  return labelMap[activeTab.value] || '出库人:';
};