配方保存bug

main
kkk-ops 3 days ago
parent aca1b216d5
commit bceb6d7379

@ -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 })
},
}

@ -55,7 +55,8 @@ export default {
operate: '操作',
copy: '复制',
copySuccess: '复制成功',
copyError: '复制失败'
copyError: '复制失败',
code:'编码保存后自动生成'
},
lock: {
lockScreen: '锁定屏幕',

@ -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 切换 */

@ -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 切换 */

@ -85,7 +85,7 @@
<el-table-column
:label="t('RecipeManagement.RecipeConfig.manualTableDataUnitColumn')"
align="center"
prop="dataUnit"
prop="dataUnitName"
/>
<el-table-column
:label="t('RecipeManagement.RecipeConfig.manualTableRemarkColumn')"
@ -180,10 +180,10 @@
class="!w-full"
>
<el-option
v-for="dict in unitDictOptions"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="unit in unitList"
:key="unit.id"
:label="unit.name"
:value="unit.id"
/>
</el-select>
</el-form-item>
@ -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<ProductUnitVO[]>([]) //
const manualLoading = ref(false)
const manualList = ref<RecipePointVO[]>([])
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
}

@ -4,10 +4,31 @@
<el-row>
<el-col :span="8">
<el-form-item :label="t('EquipmentManagement.DvRepair.repairCode')" prop="repairCode">
<template #label>
<span>
{{ t('EquipmentManagement.DvRepair.repairCode') }}
<el-tooltip :content="t('EquipmentManagement.DvRepair.repairCode')" placement="top">
<Icon icon="ep:question-filled" />
</el-tooltip>
</span>
</template>
<el-row :gutter="10" style="width: 100%;">
<el-col :xs="24" :sm="18" :md="16" :lg="14" :xl="12">
<el-input
:disabled="formData.isCode == true || formType === 'update'"
v-model="formData.repairCode"
:placeholder="t('EquipmentManagement.DvRepair.placeholderRepairCode')"
:disabled="isRepairMode" />
:placeholder="t('common.code')"
/>
</el-col>
<el-col :xs="24" :sm="6" :md="4" :lg="3" :xl="2">
<div>
<el-switch
v-model="formData.isCode"
:disabled="formType === 'update'"
/>
</div>
</el-col>
</el-row>
</el-form-item>
</el-col>
<el-col :span="8">
@ -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 = []

@ -4,11 +4,31 @@
<el-row>
<el-col :span="8">
<el-form-item :label="t('MoldManagement.MoldRepair.repairCode')" prop="repairCode">
<template #label>
<span>
{{ t('MoldManagement.MoldRepair.repairCode') }}
<el-tooltip :content="t('MoldManagement.MoldRepair.repairCode')" placement="top">
<Icon icon="ep:question-filled" />
</el-tooltip>
</span>
</template>
<el-row :gutter="10" style="width: 100%;">
<el-col :xs="24" :sm="18" :md="16" :lg="14" :xl="12">
<el-input
:disabled="formData.isCode == true || formType === 'update'"
v-model="formData.repairCode"
:placeholder="t('MoldManagement.MoldRepair.placeholderRepairCode')"
:disabled="isRepairMode"
:placeholder="t('common.code')"
/>
</el-col>
<el-col :xs="24" :sm="6" :md="4" :lg="3" :xl="2">
<div>
<el-switch
v-model="formData.isCode"
:disabled="formType === 'update'"
/>
</div>
</el-col>
</el-row>
</el-form-item>
</el-col>
<el-col :span="8">
@ -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()

Loading…
Cancel
Save