|
|
|
|
@ -69,15 +69,23 @@
|
|
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-tabs v-model="activeName" @tab-click="handleTabClick">
|
|
|
|
|
<!-- <el-tabs v-model="activeName" @tab-click="handleTabClick">
|
|
|
|
|
<el-tab-pane label="产品" name="2" />
|
|
|
|
|
<el-tab-pane label="原料" name="1" />
|
|
|
|
|
<el-tab-pane label="备件" name="5" />
|
|
|
|
|
<el-tab-pane label="工具" name="3" />
|
|
|
|
|
<el-tab-pane label="耗材" name="4" />
|
|
|
|
|
<el-tab-pane label="其他" name="0" />
|
|
|
|
|
</el-tabs> -->
|
|
|
|
|
<el-tabs v-model="activeName" @tab-click="handleTabClick">
|
|
|
|
|
<!-- 使用 v-for 动态生成 el-tab-pane -->
|
|
|
|
|
<el-tab-pane
|
|
|
|
|
v-for="item in parentList"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:name="item.id.toString()"
|
|
|
|
|
/>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
<el-table-column label="编码" align="left" sortable prop="barCode" />
|
|
|
|
|
<el-table-column label="名称" align="left" sortable prop="productName" />
|
|
|
|
|
@ -110,7 +118,7 @@ import { ProductApi, ProductVO } from '@/api/erp/product/product'
|
|
|
|
|
import { WarehouseApi, WarehouseVO } from '@/api/erp/stock/warehouse'
|
|
|
|
|
import { erpCountTableColumnFormatter } from '@/utils'
|
|
|
|
|
import { ProductCategoryApi, ProductCategoryVO } from '@/api/erp/product/category'
|
|
|
|
|
|
|
|
|
|
import { handleTree } from '@/utils/tree'
|
|
|
|
|
/** ERP 产品库存列表 */
|
|
|
|
|
defineOptions({ name: 'ErpStock' })
|
|
|
|
|
|
|
|
|
|
@ -131,7 +139,8 @@ const queryFormRef = ref() // 搜索的表单
|
|
|
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
|
const warehouseList = ref<WarehouseVO[]>([]) // 仓库列表
|
|
|
|
|
const categoryList = ref<ProductCategoryVO[]>([]) // 仓库列表
|
|
|
|
|
const categoryList = ref<ProductCategoryVO[]>([]) // 产品分类列表
|
|
|
|
|
const parentList = ref<ProductCategoryVO[]>([])
|
|
|
|
|
|
|
|
|
|
/** 查询列表 */
|
|
|
|
|
const getList = async () => {
|
|
|
|
|
@ -198,7 +207,17 @@ onMounted(async () => {
|
|
|
|
|
// 加载产品、仓库列表
|
|
|
|
|
productList.value = await ProductApi.getProductSimpleList()
|
|
|
|
|
warehouseList.value = await WarehouseApi.getWarehouseSimpleList()
|
|
|
|
|
categoryList.value = await ProductCategoryApi.getProductCategorySimpleList()
|
|
|
|
|
// 产品分类
|
|
|
|
|
const categoryData = await ProductCategoryApi.getProductCategorySimpleList()
|
|
|
|
|
categoryList.value = handleTree(categoryData, 'id', 'parentId')
|
|
|
|
|
// 获取顶层分类
|
|
|
|
|
for (let i = 0; i < categoryData.length; i++) {
|
|
|
|
|
if (categoryData[i].parentId === 0) {
|
|
|
|
|
parentList.value.push(categoryData[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 排序
|
|
|
|
|
parentList.value.sort((a, b) => a.sort - b.sort);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
/** tab 切换 */
|
|
|
|
|
|