质保单上传整体结构

This commit is contained in:
砂糖
2025-08-02 13:38:04 +08:00
parent 8f900ceed9
commit d3656ef18b
12 changed files with 508 additions and 77 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="upload-file">
<div class="upload-file" v-loading="loading" element-loading-text="正在获取文件">
<el-upload
multiple
:action="uploadFileUrl"
@@ -61,7 +61,7 @@ export default {
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["doc", "xls", "ppt", "txt", "pdf"],
default: () => ["doc", "xls", "ppt", "txt", "pdf", 'png', 'jpg', 'jpeg', 'bmp', 'webp'],
},
// 是否显示提示
isShowTip: {
@@ -79,6 +79,7 @@ export default {
Authorization: "Bearer " + getToken(),
},
fileList: [],
loading: false,
};
},
watch: {
@@ -91,11 +92,15 @@ export default {
if (Array.isArray(val)) {
list = val;
} else {
this.loading = true;
await listByIds(val).then(res => {
list = res.data.map(oss => {
oss = { name: oss.originalName, url: oss.url, ossId: oss.ossId };
return oss;
});
}).finally(() => {
this.loading = false;
})
}
// 然后将数组转为对象数组

View File

@@ -78,7 +78,6 @@ export default {
this.bomInfo = res.rows;
})
}
console.log(this.bomInfo, bomId, bomMap)
}
}
}

View File

@@ -0,0 +1,75 @@
<template>
<el-tree
:data="treeData"
:props="treeProps"
node-key="warehouseId"
highlight-current
@node-click="handleNodeClick"
:expand-on-click-node="false"
:default-expand-all="true"
class="stock-tree"
/>
</template>
<script>
import { listWarehouse } from '@/api/wms/warehouse';
export default {
name: "WarehouseTree",
props: {
treeProps: {
type: Object,
default: () => ({
children: 'children',
label: 'warehouseName',
isLeaf: () => false
})
}
},
data() {
return {
treeData: []
};
},
created() {
this.getWarehouseTree();
},
methods: {
getWarehouseTree() {
listWarehouse().then(response => {
this.treeData = this.handleTree(response.data, 'warehouseId', 'parentId');
});
},
handleTree(data, id, parentId) {
const cloneData = JSON.parse(JSON.stringify(data));
return cloneData.filter(father => {
const branchArr = cloneData.filter(child => father[id] === child[parentId]);
if (branchArr.length > 0) father.children = branchArr;
return father[parentId] === 0 || father[parentId] === null;
});
},
handleNodeClick(node) {
this.$emit('node-click', node);
}
}
};
</script>
<style scoped>
.stock-tree-card {
height: 100%;
border: none;
box-shadow: none;
}
.stock-tree-title {
font-weight: bold;
font-size: 16px;
padding: 8px 0;
}
.stock-tree {
min-height: 500px;
max-height: 80vh;
overflow-y: auto;
}
</style>

View File

@@ -7,3 +7,5 @@ export { default as UserSelect } from './UserSelect/index.vue';
export { default as WarehouseSelect } from './WarehouseSelect/index.vue';
export { default as ProductInfo } from './Renderer/ProductInfo.vue';
export { default as RawMaterialInfo } from './Renderer/RawMaterialInfo.vue';
export { default as BomInfoMini } from './Renderer/BomInfoMini.vue';
export { default as WarehouseTree } from './WarehouseTree/index.vue';