|
|
@@ -5,13 +5,16 @@ |
|
|
|
--> |
|
|
|
<template> |
|
|
|
<div class="main-box"> |
|
|
|
<!-- :request-api="userManageClothApi.getList" --> |
|
|
|
<TreeFilter |
|
|
|
ref="treeFilter" |
|
|
|
label="clothSetName" |
|
|
|
id="clothSetId" |
|
|
|
width="300px" |
|
|
|
:show-all="true" |
|
|
|
:request-api="userManageClothApi.getList" |
|
|
|
:show-all="false" |
|
|
|
:isData="true" |
|
|
|
:data="treeData" |
|
|
|
:default-value="clothSetId" |
|
|
|
@change="changeTreeFilter" |
|
|
|
> |
|
|
|
<template v-slot:header> |
|
|
@@ -35,7 +38,7 @@ |
|
|
|
<ProTable ref="proTable" title="服装库管理" :columns="columns" rowKey="clothId" :data="tableData.clothes"> |
|
|
|
<!-- 表格 header 按钮 --> |
|
|
|
<template #tableHeader="scope"> |
|
|
|
<s-button suffix="服装" @click="onOpen(FormOptEnum.ADD, { clothSetId: clothSetId }, treeFilter.treeAllData)" /> |
|
|
|
<s-button suffix="服装" @click="onOpen(FormOptEnum.ADD, { clothSetId: clothSetId }, treeData)" /> |
|
|
|
<s-button |
|
|
|
type="danger" |
|
|
|
:opt="FormOptEnum.DELETE" |
|
|
@@ -87,6 +90,8 @@ const treeFilter = ref<any>({}); |
|
|
|
const userStore = useUserStore(); |
|
|
|
const { accessToken } = userStore; |
|
|
|
const tableData = ref<any>([]) |
|
|
|
// 初始化数据 |
|
|
|
const treeData = ref<any>([]); |
|
|
|
// 表格配置项 |
|
|
|
const columns: ColumnProps<SysUserCloth.list>[] = [ |
|
|
|
{ type: "selection", fixed: "left", width: 50 }, |
|
|
@@ -171,14 +176,17 @@ function changeTreeFilter(val: number | string) { |
|
|
|
} |
|
|
|
// 获取列表 |
|
|
|
const getList = (clothSetId:any)=>{ |
|
|
|
// if(!clothSetId) return false |
|
|
|
if(!clothSetId) return false |
|
|
|
userManageClothApi.page({clothSetId:clothSetId}).then((resp:any)=>{ |
|
|
|
if(resp.code == 200){ |
|
|
|
tableData.value = resp.data |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
onMounted(() => { |
|
|
|
onMounted(async () => { |
|
|
|
const { data }:any = await userManageClothApi.getList({}); |
|
|
|
treeData.value = data; |
|
|
|
clothSetId.value = data[0].clothSetId.toString() |
|
|
|
getList(clothSetId.value) |
|
|
|
}) |
|
|
|
</script> |
|
|
|