feat(inventory): 添加成品库存管理功能支持
- 在导入组件中新增 isFinishedProduct 属性以区分成品和半成品
- 修改库存导入接口路径,根据产品类型传递参数标识
- 更新模板下载接口,传入产品类型参数
- 调整记录表格中的来源列,直接使用 recordTypeName 字段显示
- 在导出库存数据时增加产品类型参数过滤
- 为合格库存页面添加成品类型参数配置
- 在记录页面的导出功能中集成产品类型参数传递
| | |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="来源" |
| | | prop="recordType" |
| | | prop="recordTypeName" |
| | | show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{ getRecordType(scope.row.recordType) }} |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | |
| | | required: true, |
| | | default: 'qualified', |
| | | }, |
| | | |
| | | isFinishedProduct: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | }); |
| | | |
| | | const emit = defineEmits(['update:visible', 'uploadSuccess']); |
| | |
| | | // 设置上传的请求头部 |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // 上传的地址 |
| | | url: import.meta.env.VITE_APP_BASE_API + "/stockInventory/importStockInventory", |
| | | url: import.meta.env.VITE_APP_BASE_API + "/stockInventory/importStockInventory?productType=" + (props.isFinishedProduct ? 1 : 0), |
| | | }); |
| | | |
| | | const submitFileForm = () => { |
| | |
| | | }; |
| | | |
| | | const downloadTemplate = () => { |
| | | proxy.download("/stockInventory/downloadStockInventory", {}, "库存导入模板.xlsx"); |
| | | proxy.download("/stockInventory/downloadStockInventory", { productType: props.isFinishedProduct ? 1 : 0 }, "库存导入模板.xlsx"); |
| | | } |
| | | |
| | | const closeModal = () => { |
| | |
| | | <import-stock-inventory v-if="isShowImportModal" |
| | | v-model:visible="isShowImportModal" |
| | | type="qualified" |
| | | :is-finished-product="false" |
| | | @uploadSuccess="handleQuery" /> |
| | | <!-- 冻结/解冻库存--> |
| | | <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal" |
| | |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | proxy.download("/stockInventory/exportStockInventory", {}, '合格库存信息.xlsx') |
| | | proxy.download("/stockInventory/exportStockInventory", {productType: 0}, '合格库存信息.xlsx') |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已取消") |
| | | }) |
| | |
| | | <!-- 导入库存--> |
| | | <import-stock-inventory v-if="isShowImportModal" |
| | | v-model:visible="isShowImportModal" |
| | | :is-finished-product="props.isFinishedProduct" |
| | | @uploadSuccess="handleQuery" /> |
| | | <!-- 冻结/解冻库存--> |
| | | <frozen-and-thaw-stock-inventory v-if="isShowFrozenAndThawModal" |
| | |
| | | type: 'warning', |
| | | } |
| | | ).then(() => { |
| | | proxy.download("/stockInventory/exportStockInventory", {topParentProductId: props.productId}, '库存信息.xlsx') |
| | | proxy.download("/stockInventory/exportStockInventory", {topParentProductId: props.productId, productType: props.isFinishedProduct ? 1 : 0}, '库存信息.xlsx') |
| | | }).catch(() => { |
| | | proxy.$modal.msg("已取消") |
| | | }) |