diff --git a/src/apis/material/materialInfo.ts b/src/apis/material/materialInfo.ts
index fef57d3..7ba84f5 100644
--- a/src/apis/material/materialInfo.ts
+++ b/src/apis/material/materialInfo.ts
@@ -87,3 +87,26 @@ export function uploadMaterialPhotos(data: FormData) {
export function catchPhoto(data: FormData) {
return http.post(`${BASE_URL}/import/catch`, data)
}
+
+/* 批次导入结果类型 */
+export interface BatchImportResp {
+ importKey: string
+ totalRows: number
+ validRows: number
+ duplicateRows: number
+}
+
+/** @desc 下载批次导入模板 */
+export function downloadBatchImportTemplate() {
+ return http.download(`${BASE_URL}/batch/import/template`)
+}
+
+/** @desc 解析批次导入数据 */
+export function parseBatchImport(data: FormData) {
+ return http.post(`${BASE_URL}/batch/import/parse`, data)
+}
+
+/** @desc 批次导入 */
+export function batchImport(data: any) {
+ return http.post(`${BASE_URL}/batch/import`, data)
+}
diff --git a/src/apis/weightManage/weightManage.ts b/src/apis/weightManage/weightManage.ts
index 98eb56f..f78aa46 100644
--- a/src/apis/weightManage/weightManage.ts
+++ b/src/apis/weightManage/weightManage.ts
@@ -9,6 +9,7 @@ export interface WeighManageResp {
materialSpec: string
unitWeight: number
photoUrl: string
+ batch: string
materialProcess: string
matchResult: string
downFloatRatio: string
diff --git a/src/views/material/BatchImport.vue b/src/views/material/BatchImport.vue
new file mode 100644
index 0000000..5dbdf54
--- /dev/null
+++ b/src/views/material/BatchImport.vue
@@ -0,0 +1,163 @@
+
+
+
+
+ 请按照模板要求填写数据,填写完毕后,请先上传并进行解析。
+
+
+
+ 下载模板
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/material/MaterialInfoAddModal.vue b/src/views/material/MaterialInfoAddModal.vue
index a20bc98..01eff50 100644
--- a/src/views/material/MaterialInfoAddModal.vue
+++ b/src/views/material/MaterialInfoAddModal.vue
@@ -78,6 +78,19 @@ const columns: ColumnItem[] = reactive([
allowSearch: true,
},
},
+ {
+ label: '物料流程编码',
+ field: 'materialProcess',
+ type: 'input',
+ span: 24,
+ required: true,
+ },
+ {
+ label: '批次',
+ field: 'batch',
+ type: 'input',
+ span: 24,
+ },
{
label: '灯光等级',
field: 'lightLevel',
@@ -90,13 +103,6 @@ const columns: ColumnItem[] = reactive([
},
span: 24,
},
- {
- label: '物料流程编码',
- field: 'materialProcess',
- type: 'input',
- span: 24,
- required: true,
- },
{
label: '物料直径',
field: 'materialSpec',
@@ -120,7 +126,7 @@ const columns: ColumnItem[] = reactive([
type: 'image',
savePath: 'material/',
span: 24,
- // required: true,
+ required: true,
},
])
diff --git a/src/views/material/index.vue b/src/views/material/index.vue
index f7c8fe6..c9dc496 100644
--- a/src/views/material/index.vue
+++ b/src/views/material/index.vue
@@ -44,7 +44,11 @@
- 照片批量导入
+ 照片导入
+
+
+
+ 批次导入
@@ -77,6 +81,7 @@
+
@@ -84,6 +89,7 @@
import MaterialInfoAddModal from './MaterialInfoAddModal.vue'
import MaterialInfoImportDrawer from './MaterialInfoImportDrawer.vue'
import PhotosImport from '@/views/material/PhotosImport.vue';
+import BatchImport from '@/views/material/BatchImport.vue';
import { type MaterialInfoQuery, type MaterialInfoResp, deleteMaterialInfo, exportMaterialInfo, listMaterialInfo } from '@/apis/material/materialInfo'
import type { TableInstanceColumns } from '@/components/GiTable/type'
import { useDownload, useTable } from '@/hooks'
@@ -121,8 +127,9 @@ const columns = ref([
{ title: '物料编码', dataIndex: 'encoding', slotName: 'encoding' },
{ title: '物料单位重量(g)', dataIndex: 'unitWeight', slotName: 'unitWeight' },
{ title: '物料品类', dataIndex: 'typeName' },
- { title: '物料直径', dataIndex: 'materialSpec', slotName: 'materialSpec' },
- { title: '物料颜色', dataIndex: 'color', slotName: 'color' },
+ { title: '批次', dataIndex: 'batch' },
+ { title: '物料直径', dataIndex: 'materialSpec', slotName: 'materialSpec', show: false },
+ { title: '物料颜色', dataIndex: 'color', slotName: 'color', show: false },
{ title: '物料流程', dataIndex: 'materialProcess', slotName: 'materialProcess' },
{ title: '灯光等级', dataIndex: 'lightLevel', slotName: 'lightLevel' },
{ title: '物料照片', dataIndex: 'photoUrl', slotName: 'photoUrl', width: 120, align: 'center' },
@@ -196,6 +203,12 @@ const PhotosImportRef = ref>()
const onPhotosImport = () => {
PhotosImportRef.value?.onOpen()
}
+
+const BatchImportRef = ref>()
+const onBatchImport = () => {
+ BatchImportRef.value?.onOpen()
+}
+
+
\ No newline at end of file
diff --git a/src/views/weightManage/index.vue b/src/views/weightManage/index.vue
index 10a09eb..67ff5a3 100644
--- a/src/views/weightManage/index.vue
+++ b/src/views/weightManage/index.vue
@@ -32,13 +32,13 @@
@@ -134,6 +134,10 @@
+