| | |
| | | :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"> |
| | |
| | | import { |
| | | getStockInPage, |
| | | getStockInPageByProduction, |
| | | getStockInPageByCustom, getInPageByCustom |
| | | } from "@/api/inventoryManagement/stockIn.js"; |
| | | import { |
| | | getStockManagePage, |
| | |
| | | nickName: '', |
| | | userId: '', |
| | | productCategory:'', |
| | | timeStr: getCurrentDate(), |
| | | timeStr: '', |
| | | }, |
| | | form: { |
| | | productrecordId: '', |
| | |
| | | let apiCall |
| | | if (activeTab.value === 'production') { |
| | | apiCall = getStockInPageByProduction(params) |
| | | } else if (activeTab.value === 'manual') { |
| | | apiCall = getInPageByCustom(params) |
| | | } else { |
| | | apiCall = getStockInPage(params) |
| | | } |
| | |
| | | } |
| | | 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) |
| | | |
| | |
| | | let exportUrl = "/stockin/export" |
| | | if (activeTab.value === 'production') { |
| | | exportUrl = "/stockin/exportOne" |
| | | } else if (activeTab.value === 'manual') { |
| | | exportUrl = "/stockin/exportTwo" |
| | | } |
| | | proxy.download(exportUrl, {}, '入库台账.xlsx') |
| | | }).catch(() => { |
| | |
| | | const getDialogTitle = () => { |
| | | const titleMap = { |
| | | production: '新增发货', |
| | | purchase: '新增领用', |
| | | manual: '新增领用' |
| | | purchase: '新增领用' |
| | | }; |
| | | return titleMap[activeTab.value] || '新增出库'; |
| | | }; |
| | |
| | | const getAvailableQuantityText = () => { |
| | | const textMap = { |
| | | production: '可发货数量', |
| | | purchase: '可领用数量', |
| | | manual: '可领用数量' |
| | | purchase: '可领用数量' |
| | | }; |
| | | return textMap[activeTab.value] || '可出库数量'; |
| | | }; |
| | |
| | | const getQuantityLabel = () => { |
| | | const labelMap = { |
| | | production: '发货数量:', |
| | | purchase: '领用数量:', |
| | | manual: '领用数量:' |
| | | purchase: '领用数量:' |
| | | }; |
| | | return labelMap[activeTab.value] || '出库数量:'; |
| | | }; |
| | |
| | | const getDateLabel = () => { |
| | | const labelMap = { |
| | | production: '发货日期:', |
| | | purchase: '领用日期:', |
| | | manual: '领用日期:' |
| | | purchase: '领用日期:' |
| | | }; |
| | | return labelMap[activeTab.value] || '出库日期:'; |
| | | }; |
| | |
| | | const getPersonLabel = () => { |
| | | const labelMap = { |
| | | production: '发货人:', |
| | | purchase: '领用人:', |
| | | manual: '领用人:' |
| | | purchase: '领用人:' |
| | | }; |
| | | return labelMap[activeTab.value] || '出库人:'; |
| | | }; |