From bceb6d737981a7f891bbdae2c2d9a3068b97f514 Mon Sep 17 00:00:00 2001 From: kkk-ops <1050738955@qq.com> Date: Sun, 1 Feb 2026 22:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E6=96=B9=E4=BF=9D=E5=AD=98bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/recipePoint/index.ts | 12 ++++++- src/locales/zh-CN.ts | 3 +- src/views/erp/product/product/index.vue | 3 +- src/views/erp/stock/stock/index.vue | 29 ++++++++++++++--- .../components/RecipeDetailList.vue | 16 ++++++---- src/views/mes/dvrepair/DvRepairForm.vue | 31 +++++++++++++++--- src/views/mold/moldrepair/MoldRepairForm.vue | 32 ++++++++++++++++--- 7 files changed, 102 insertions(+), 24 deletions(-) diff --git a/src/api/iot/recipePoint/index.ts b/src/api/iot/recipePoint/index.ts index b5318f34..e1fed218 100644 --- a/src/api/iot/recipePoint/index.ts +++ b/src/api/iot/recipePoint/index.ts @@ -1,6 +1,7 @@ import request from '@/config/axios' export interface RecipePointVO { + id: number recipeId?: number | string name?: string refer?: string @@ -18,6 +19,15 @@ export const RecipePointApi = { }, getRecipePointList: async (recipeId: number) => { return await request.get({ url: `/iot/recipe-point/list?id=`+ recipeId }) - } + }, + createRecipePoint: async (data: RecipePointVO) => { + return await request.post({ url: `/iot/recipe-point/create`, data }) + }, + updateRecipePoint: async (data: RecipePointVO) => { + return await request.post({ url: `/iot/recipe-point/update`, data }) + }, + deleteRecipePoint: async (id: number) => { + return await request.delete({ url: `/iot/recipe-point/delete?id=` + id }) + }, } diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index d225c86e..9e88f36f 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -55,7 +55,8 @@ export default { operate: '操作', copy: '复制', copySuccess: '复制成功', - copyError: '复制失败' + copyError: '复制失败', + code:'编码保存后自动生成' }, lock: { lockScreen: '锁定屏幕', diff --git a/src/views/erp/product/product/index.vue b/src/views/erp/product/product/index.vue index adee6a47..a0c8afeb 100644 --- a/src/views/erp/product/product/index.vue +++ b/src/views/erp/product/product/index.vue @@ -132,7 +132,7 @@ import { ProductApi, ProductVO } from '@/api/erp/product/product' import { ProductCategoryApi, ProductCategoryVO } from '@/api/erp/product/category' import ProductForm from './ProductForm.vue' import { DICT_TYPE } from '@/utils/dict' -import { defaultProps, handleTree } from '@/utils/tree' +import { handleTree } from '@/utils/tree' import BomForm from "@/views/mes/bom/BomForm.vue"; /** ERP 产品列表 */ @@ -228,7 +228,6 @@ onMounted(async () => { } // 排序 parentList.value.sort((a, b) => a.sort - b.sort); - console.log(parentList.value) }) /** tab 切换 */ diff --git a/src/views/erp/stock/stock/index.vue b/src/views/erp/stock/stock/index.vue index ff03f29f..11bc5697 100644 --- a/src/views/erp/stock/stock/index.vue +++ b/src/views/erp/stock/stock/index.vue @@ -69,15 +69,23 @@ - + + + + - @@ -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([]) // 产品列表 const warehouseList = ref([]) // 仓库列表 -const categoryList = ref([]) // 仓库列表 +const categoryList = ref([]) // 产品分类列表 +const parentList = ref([]) /** 查询列表 */ 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 切换 */ diff --git a/src/views/formula/formulaConfig/components/RecipeDetailList.vue b/src/views/formula/formulaConfig/components/RecipeDetailList.vue index 7e82bba4..7b44f74c 100644 --- a/src/views/formula/formulaConfig/components/RecipeDetailList.vue +++ b/src/views/formula/formulaConfig/components/RecipeDetailList.vue @@ -85,7 +85,7 @@ @@ -212,6 +212,7 @@ import { RecipeConfigApi, RecipePointDetailVO } from '@/api/iot/recipeConfig' import { RecipePointApi, RecipePointVO } from '@/api/iot/recipePoint' import { getStrDictOptions } from '@/utils/dict' +import { ProductUnitApi, ProductUnitVO } from '@/api/erp/product/unit' defineOptions({ name: 'RecipeDetailList' }) @@ -240,6 +241,7 @@ const queryParams = reactive({ pageSize: 10 }) +const unitList = ref([]) // 产品单位列表 const manualLoading = ref(false) const manualList = ref([]) const manualTotal = ref(0) @@ -301,7 +303,7 @@ const manualRules = reactive({ }) const dataTypeDictOptions = computed(() => getStrDictOptions('iot_device_data_type')) -const unitDictOptions = computed(() => getStrDictOptions('iot_device_attribute_unit')) +// const unitDictOptions = computed(() => getStrDictOptions('iot_device_attribute_unit')) const normalizeDetail = (item: any): RecipePointDetailVO => { return { @@ -323,6 +325,8 @@ const getList = async () => { }) list.value = (data.list ?? []).map(normalizeDetail) total.value = data.total + // 产品单位 + unitList.value = await ProductUnitApi.getProductUnitSimpleList() } finally { loading.value = false } diff --git a/src/views/mes/dvrepair/DvRepairForm.vue b/src/views/mes/dvrepair/DvRepairForm.vue index 8a6cf9f6..45b214d0 100644 --- a/src/views/mes/dvrepair/DvRepairForm.vue +++ b/src/views/mes/dvrepair/DvRepairForm.vue @@ -4,10 +4,31 @@ - + + + + + + +
+ +
+
+
@@ -180,6 +201,7 @@ const formData = ref({ confirmBy: undefined, status: undefined, remark: undefined, + isCode: undefined }) const lineMode = computed(() => { @@ -558,6 +580,7 @@ const resetForm = () => { confirmBy: undefined, status: undefined, remark: undefined, + isCode: true } deviceOptionsLoaded.value = false componentOptions.value = [] diff --git a/src/views/mold/moldrepair/MoldRepairForm.vue b/src/views/mold/moldrepair/MoldRepairForm.vue index 4fabeb68..5abe09a0 100644 --- a/src/views/mold/moldrepair/MoldRepairForm.vue +++ b/src/views/mold/moldrepair/MoldRepairForm.vue @@ -4,11 +4,31 @@ - + + + + + + +
+ +
+
+
@@ -162,6 +182,7 @@ const formData = ref({ confirmBy: undefined, status: undefined, remark: undefined, + isCode: undefined }) const moldLoading = ref(false) @@ -412,6 +433,7 @@ const resetForm = () => { confirmBy: undefined, status: undefined, remark: undefined, + isCode: true } moldOptionsLoaded.value = false formRef.value?.resetFields()