| | |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="批号" |
| | | prop="batchNo" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="单位" |
| | | prop="unit" |
| | | show-overflow-tooltip |
| | |
| | | type: String, |
| | | required: true, |
| | | default: '0' |
| | | }, |
| | | topParentProductId: { |
| | | type: [String, Number], |
| | | default: undefined |
| | | } |
| | | }) |
| | | |
| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | getStockOutPage({ ...searchForm.value, ...page, type: props.type }) |
| | | getStockOutPage({ ...searchForm.value, ...page, type: props.type, topParentProductId: props.topParentProductId }) |
| | | .then((res) => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records; |
| | |
| | | getList(); |
| | | fetchStockRecordTypeOptions(); |
| | | }); |
| | | |
| | | watch( |
| | | () => props.topParentProductId, |
| | | () => { |
| | | page.current = 1; |
| | | getList(); |
| | | } |
| | | ); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | |
| | | <!-- 在你的主页面中 --> |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-tabs v-model="activeTab" @tab-change="handleTabChange"> |
| | | <div v-loading="loading" element-loading-text="加载中..." style="min-height: 80vh;"> |
| | | <el-tabs v-model="activeTab" @tab-change="handleTabChange" v-if="!loading"> |
| | | <el-tab-pane v-for="tab in tabs" |
| | | :label="tab.label" |
| | | :name="tab.name" |
| | | :key="tab.name"> |
| | | <record :type="tab.type" v-if="activeTab === tab.name" /> |
| | | :label="tab.productName" |
| | | :name="tab.id" |
| | | :key="tab.id"> |
| | | <Record v-bind="{ type: tab.type, topParentProductId: activeTab }" v-if="tab.id === activeTab" /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue'; |
| | | import { productTreeList } from "@/api/basicData/product.js"; |
| | | import Record from "@/views/inventoryManagement/dispatchLog/Record.vue"; |
| | | const activeTab = ref('qualified') |
| | | const type = ref(0) |
| | | const tabs = computed(() => { |
| | | return [ |
| | | { |
| | | label: '合格出库', |
| | | name: 'qualified', |
| | | type: '0' |
| | | }, |
| | | { |
| | | label: '不合格出库', |
| | | name: 'unqualified', |
| | | type: '1' |
| | | } |
| | | ] |
| | | }) |
| | | const activeTab = ref(null) |
| | | const tabs = ref([]) |
| | | const loading = ref(false) |
| | | |
| | | const resolveTypeByName = (name) => { |
| | | return String(name || "").includes("不合格") ? "1" : "0"; |
| | | }; |
| | | |
| | | const handleTabChange = (tabName) => { |
| | | activeTab.value = tabName; |
| | | type.value = tabName === 'qualified' ? 0 : 1 |
| | | } |
| | | |
| | | const fetchProducts = async () => { |
| | | loading.value = true; |
| | | try { |
| | | const res = await productTreeList(); |
| | | tabs.value = res |
| | | .filter((item) => item.parentId === null) |
| | | .map(({ id, productName }) => ({ |
| | | id, |
| | | productName, |
| | | type: resolveTypeByName(productName), |
| | | })); |
| | | if (tabs.value.length > 0) { |
| | | activeTab.value = tabs.value[0].id; |
| | | } |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | } |
| | | |
| | | onMounted(() => { |
| | | fetchProducts(); |
| | | }) |
| | | </script> |
| | |
| | | <el-table-column label="规格型号" |
| | | prop="model" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="批号" |
| | | prop="batchNo" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="单位" |
| | | prop="unit" |
| | | show-overflow-tooltip/> |
| | |
| | | type: String, |
| | | required: true, |
| | | default: '0' |
| | | }, |
| | | topParentProductId: { |
| | | type: [String, Number], |
| | | default: undefined |
| | | } |
| | | }) |
| | | |
| | |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = {...page, type: props.type}; |
| | | const params = {...page, type: props.type, topParentProductId: props.topParentProductId}; |
| | | params.timeStr = searchForm.value.timeStr; |
| | | params.productName = searchForm.value.productName; |
| | | params.recordType = searchForm.value.recordType; |
| | |
| | | getList(); |
| | | fetchStockRecordTypeOptions(); |
| | | }); |
| | | |
| | | watch( |
| | | () => props.topParentProductId, |
| | | () => { |
| | | page.current = 1; |
| | | getList(); |
| | | } |
| | | ); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-tabs v-model="activeTab" @tab-change="handleTabChange"> |
| | | <div v-loading="loading" element-loading-text="加载中..." style="min-height: 80vh;"> |
| | | <el-tabs v-model="activeTab" @tab-change="handleTabChange" v-if="!loading"> |
| | | <el-tab-pane v-for="tab in tabs" |
| | | :label="tab.label" |
| | | :name="tab.name" |
| | | :key="tab.name"> |
| | | <record :type="tab.type" v-if="activeTab === tab.name" /> |
| | | :label="tab.productName" |
| | | :name="tab.id" |
| | | :key="tab.id"> |
| | | <Record v-bind="{ type: tab.type, topParentProductId: activeTab }" v-if="tab.id === activeTab" /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue'; |
| | | import { productTreeList } from "@/api/basicData/product.js"; |
| | | import Record from "@/views/inventoryManagement/receiptManagement/Record.vue"; |
| | | |
| | | const activeTab = ref('qualified') |
| | | const type = ref(0) |
| | | const tabs = ref([ |
| | | { |
| | | label: '合格入库', |
| | | name: 'qualified', |
| | | type: '0' |
| | | }, |
| | | { |
| | | label: '不合格入库', |
| | | name: 'unqualified', |
| | | type: '1' |
| | | } |
| | | ]) |
| | | const activeTab = ref(null) |
| | | const tabs = ref([]) |
| | | const loading = ref(false) |
| | | |
| | | const resolveTypeByName = (name) => { |
| | | return String(name || "").includes("不合格") ? "1" : "0"; |
| | | }; |
| | | |
| | | const handleTabChange = (tabName) => { |
| | | activeTab.value = tabName; |
| | | type.value = tabName === 'qualified' ? 0 : 1 |
| | | } |
| | | |
| | | const fetchProducts = async () => { |
| | | loading.value = true; |
| | | try { |
| | | const res = await productTreeList(); |
| | | tabs.value = res |
| | | .filter((item) => item.parentId === null) |
| | | .map(({ id, productName }) => ({ |
| | | id, |
| | | productName, |
| | | type: resolveTypeByName(productName), |
| | | })); |
| | | if (tabs.value.length > 0) { |
| | | activeTab.value = tabs.value[0].id; |
| | | } |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | } |
| | | |
| | | onMounted(() => { |
| | | fetchProducts(); |
| | | }) |
| | | </script> |
| | |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | label="批号" |
| | | prop="batchNo" |
| | | > |
| | | <el-input v-model="formState.batchNo" placeholder="请输入批号" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item |
| | | v-if="formState.type === 'qualified'" |
| | | label="库存预警数量" |
| | | prop="warnNum" |
| | |
| | | unit: "", |
| | | type: undefined, |
| | | qualitity: 0, |
| | | batchNo: "", |
| | | warnNum: 0, |
| | | remark: '', |
| | | }); |
| | |
| | | productModelId: undefined, |
| | | productName: "", |
| | | productModelName: "", |
| | | description: '', |
| | | unit: "", |
| | | type: undefined, |
| | | qualitity: 0, |
| | | batchNo: "", |
| | | warnNum: 0, |
| | | remark: '', |
| | | }; |
| | | isShow.value = false; |
| | | }; |
| | |
| | | <el-table-column align="center" label="序号" type="index" width="60" /> |
| | | <el-table-column label="产品大类" prop="productName" show-overflow-tooltip /> |
| | | <el-table-column label="规格型号" prop="model" show-overflow-tooltip /> |
| | | <el-table-column label="批号" prop="batchNo" show-overflow-tooltip /> |
| | | <el-table-column label="单位" prop="unit" show-overflow-tooltip /> |
| | | <el-table-column label="库存数量" prop="qualitity" show-overflow-tooltip /> |
| | | <el-table-column label="冻结数量" prop="lockedQuantity" show-overflow-tooltip /> |
| | |
| | | <el-table-column label="产品大类" prop="productName" show-overflow-tooltip /> |
| | | <el-table-column label="规格型号" prop="model" show-overflow-tooltip /> |
| | | <el-table-column label="单位" prop="unit" show-overflow-tooltip /> |
| | | <el-table-column label="批号" prop="batchNo" show-overflow-tooltip /> |
| | | <el-table-column label="合格库存数量" prop="qualifiedQuantity" show-overflow-tooltip /> |
| | | <el-table-column label="不合格库存数量" prop="unQualifiedQuantity" show-overflow-tooltip /> |
| | | <el-table-column label="合格冻结数量" prop="qualifiedLockedQuantity" show-overflow-tooltip /> |