|
|
|
@ -1,34 +1,56 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<ContentWrap>
|
|
|
|
<ContentWrap>
|
|
|
|
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
|
|
|
<el-form
|
|
|
|
<el-form-item label="配方编码" prop="recipeCode">
|
|
|
|
class="-mb-15px recipe-config-filter-form"
|
|
|
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
|
|
|
ref="queryFormRef"
|
|
|
|
|
|
|
|
:inline="true"
|
|
|
|
|
|
|
|
label-width="auto"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeConfig.searchRecipeCodeLabel')" prop="recipeCode">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="queryParams.recipeCode" placeholder="请输入配方编码" clearable @keyup.enter="handleQuery"
|
|
|
|
v-model="queryParams.recipeCode"
|
|
|
|
class="!w-240px" />
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.searchRecipeCodePlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="配方名称" prop="name">
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeConfig.searchNameLabel')" prop="name">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="queryParams.name" placeholder="请输入配方名称" clearable @keyup.enter="handleQuery"
|
|
|
|
v-model="queryParams.name"
|
|
|
|
class="!w-240px" />
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.searchNamePlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="产品名称" prop="productName">
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeConfig.searchProductNameLabel')" prop="productName">
|
|
|
|
<el-input
|
|
|
|
<el-input
|
|
|
|
v-model="queryParams.productName" placeholder="请输入产品名称" clearable @keyup.enter="handleQuery"
|
|
|
|
v-model="queryParams.productName"
|
|
|
|
class="!w-240px" />
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.searchProductNamePlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
@keyup.enter="handleQuery"
|
|
|
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
<el-form-item>
|
|
|
|
<el-button @click="handleQuery">
|
|
|
|
<el-button @click="handleQuery">
|
|
|
|
<Icon icon="ep:search" class="mr-5px" /> 查询
|
|
|
|
<Icon icon="ep:search" class="mr-5px" />
|
|
|
|
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.searchButtonText') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<el-button @click="resetQuery">
|
|
|
|
<el-button @click="resetQuery">
|
|
|
|
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
|
|
|
<Icon icon="ep:refresh" class="mr-5px" />
|
|
|
|
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.resetButtonText') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<el-button type="primary" plain @click="openDialog('create')">
|
|
|
|
<el-button type="primary" plain @click="openDialog('create')">
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
|
<Icon icon="ep:plus" class="mr-5px" />
|
|
|
|
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.createButtonText') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<el-button type="success" plain @click="handleExport" :loading="exportLoading">
|
|
|
|
<el-button type="success" plain @click="handleExport" :loading="exportLoading">
|
|
|
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
|
<Icon icon="ep:download" class="mr-5px" />
|
|
|
|
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.exportButtonText') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
@ -36,24 +58,67 @@ v-model="queryParams.productName" placeholder="请输入产品名称" clearable
|
|
|
|
|
|
|
|
|
|
|
|
<ContentWrap>
|
|
|
|
<ContentWrap>
|
|
|
|
<el-table
|
|
|
|
<el-table
|
|
|
|
ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" row-key="id"
|
|
|
|
ref="tableRef"
|
|
|
|
highlight-current-row @selection-change="handleSelectionChange" @row-click="handleRowClick">
|
|
|
|
v-loading="loading"
|
|
|
|
|
|
|
|
:data="list"
|
|
|
|
|
|
|
|
:stripe="true"
|
|
|
|
|
|
|
|
:show-overflow-tooltip="true"
|
|
|
|
|
|
|
|
row-key="id"
|
|
|
|
|
|
|
|
highlight-current-row
|
|
|
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
|
|
|
|
|
|
@row-click="handleRowClick"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-table-column type="selection" width="55" reserve-selection />
|
|
|
|
<el-table-column type="selection" width="55" reserve-selection />
|
|
|
|
<el-table-column label="配方编码" align="center" prop="recipeCode" />
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column label="配方名称" align="center" prop="name" />
|
|
|
|
:label="t('RecipeManagement.RecipeConfig.tableRecipeCodeColumn')"
|
|
|
|
<el-table-column label="配方类型" align="center" prop="recipeType">
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="recipeCode"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
:label="t('RecipeManagement.RecipeConfig.tableNameColumn')"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="name"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
:label="t('RecipeManagement.RecipeConfig.tableRecipeTypeColumn')"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="recipeType"
|
|
|
|
|
|
|
|
>
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
{{ getRecipeTypeLabel(scope.row.recipeType) }}
|
|
|
|
{{ getRecipeTypeLabel(scope.row.recipeType) }}
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="关联产品" align="center" prop="productName" />
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column label="关联设备" align="center" prop="machineName" />
|
|
|
|
:label="t('RecipeManagement.RecipeConfig.tableProductNameColumn')"
|
|
|
|
<el-table-column label="配方描述" align="center" prop="recipeDesc" />
|
|
|
|
align="center"
|
|
|
|
<el-table-column label="操作" align="center" width="240px" fixed="right">
|
|
|
|
prop="productName"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
:label="t('RecipeManagement.RecipeConfig.tableMachineNameColumn')"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="machineName"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
:label="t('RecipeManagement.RecipeConfig.tableRecipeDescColumn')"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="recipeDesc"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
:label="t('RecipeManagement.RecipeConfig.tableOperateColumn')"
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
width="240px"
|
|
|
|
|
|
|
|
fixed="right"
|
|
|
|
|
|
|
|
>
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<el-button link type="primary" @click.stop="openDetail(scope.row)">配置</el-button>
|
|
|
|
<el-button link type="primary" @click.stop="openDetail(scope.row)">
|
|
|
|
<el-button link type="primary" @click.stop="openDialog('update', scope.row)">编辑</el-button>
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.tableConfigAction') }}
|
|
|
|
<el-button link type="danger" @click.stop="handleDelete(scope.row)">删除</el-button>
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
<el-button link type="primary" @click.stop="openDialog('update', scope.row)">
|
|
|
|
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.tableEditAction') }}
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
<el-button link type="danger" @click.stop="handleDelete(scope.row)">
|
|
|
|
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.tableDeleteAction') }}
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
|
@ -68,54 +133,97 @@ ref="detailRef" :visible="detailVisible"
|
|
|
|
:recipe-code="detailMeta.recipeCode" :name="detailMeta.name" @config="handleDetailConfig" @close="closeDetail" />
|
|
|
|
:recipe-code="detailMeta.recipeCode" :name="detailMeta.name" @config="handleDetailConfig" @close="closeDetail" />
|
|
|
|
|
|
|
|
|
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="720px">
|
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="720px">
|
|
|
|
<el-form ref="dialogFormRef" :model="dialogForm" :rules="dialogRules" label-width="100px" v-loading="dialogLoading">
|
|
|
|
<el-form
|
|
|
|
<el-form-item label="配方编码" prop="recipeCode">
|
|
|
|
ref="dialogFormRef"
|
|
|
|
<el-input v-model="dialogForm.recipeCode" placeholder="请输入配方编码" clearable />
|
|
|
|
:model="dialogForm"
|
|
|
|
|
|
|
|
:rules="dialogRules"
|
|
|
|
|
|
|
|
class="recipe-config-dialog-form"
|
|
|
|
|
|
|
|
label-width="auto"
|
|
|
|
|
|
|
|
v-loading="dialogLoading"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeConfig.dialogRecipeCodeLabel')" prop="recipeCode">
|
|
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="dialogForm.recipeCode"
|
|
|
|
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.dialogRecipeCodePlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="配方名称" prop="name">
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeConfig.dialogNameLabel')" prop="name">
|
|
|
|
<el-input v-model="dialogForm.name" placeholder="请输入配方名称" clearable />
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="dialogForm.name"
|
|
|
|
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.dialogNamePlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="配方类型" prop="recipeType">
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeConfig.dialogRecipeTypeLabel')" prop="recipeType">
|
|
|
|
<el-select
|
|
|
|
<el-select
|
|
|
|
v-model="dialogForm.recipeType" placeholder="请选择配方类型" clearable filterable class="!w-full"
|
|
|
|
v-model="dialogForm.recipeType"
|
|
|
|
:loading="recipeTypeLoading">
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.dialogRecipeTypePlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
filterable
|
|
|
|
|
|
|
|
class="!w-full"
|
|
|
|
|
|
|
|
:loading="recipeTypeLoading"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-option v-for="item in recipeTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
<el-option v-for="item in recipeTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="关联产品" prop="productName">
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeConfig.dialogProductNameLabel')" prop="productName">
|
|
|
|
<el-select
|
|
|
|
<el-select
|
|
|
|
v-model="dialogForm.productName" placeholder="请选择关联产品" clearable filterable class="!w-full"
|
|
|
|
v-model="dialogForm.productName"
|
|
|
|
:loading="productLoading">
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.dialogProductNamePlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
filterable
|
|
|
|
|
|
|
|
class="!w-full"
|
|
|
|
|
|
|
|
:loading="productLoading"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-option v-for="item in productOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
<el-option v-for="item in productOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="关联设备" prop="machineName">
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeConfig.dialogMachineNameLabel')" prop="machineName">
|
|
|
|
<el-select
|
|
|
|
<el-select
|
|
|
|
v-model="dialogForm.machineName" placeholder="请选择关联设备" clearable filterable class="!w-full"
|
|
|
|
v-model="dialogForm.machineName"
|
|
|
|
:loading="deviceLoading">
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.dialogMachineNamePlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
filterable
|
|
|
|
|
|
|
|
class="!w-full"
|
|
|
|
|
|
|
|
:loading="deviceLoading"
|
|
|
|
|
|
|
|
>
|
|
|
|
<el-option v-for="item in deviceOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
<el-option v-for="item in deviceOptions" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="配方描述" prop="recipeDesc">
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeConfig.dialogRecipeDescLabel')" prop="recipeDesc">
|
|
|
|
<el-input v-model="dialogForm.recipeDesc" placeholder="请输入配方描述" clearable type="textarea" />
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="dialogForm.recipeDesc"
|
|
|
|
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.dialogRecipeDescPlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
type="textarea"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<template #footer>
|
|
|
|
<template #footer>
|
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
<el-button @click="dialogVisible = false">
|
|
|
|
<el-button type="primary" @click="submitDialog" :disabled="dialogLoading">保 存</el-button>
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.dialogCancelButton') }}
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
<el-button type="primary" @click="submitDialog" :disabled="dialogLoading">
|
|
|
|
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.dialogSaveButton') }}
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</Dialog>
|
|
|
|
</Dialog>
|
|
|
|
|
|
|
|
|
|
|
|
<Dialog title="配置" v-model="configVisible" width="920px">
|
|
|
|
<Dialog :title="t('RecipeManagement.RecipeConfig.configDialogTitle')" v-model="configVisible" width="920px">
|
|
|
|
<div v-loading="configLoading">
|
|
|
|
<div v-loading="configLoading">
|
|
|
|
<div class="formula-config-picklist">
|
|
|
|
<div class="formula-config-picklist">
|
|
|
|
<div class="formula-config-panel">
|
|
|
|
<div class="formula-config-panel">
|
|
|
|
<div class="formula-config-panel__header">
|
|
|
|
<div class="formula-config-panel__header">
|
|
|
|
<div>来源</div>
|
|
|
|
<div>{{ t('RecipeManagement.RecipeConfig.configSourceTitle') }}</div>
|
|
|
|
<div class="formula-config-panel__meta">{{ filteredSourceItems.length }}</div>
|
|
|
|
<div class="formula-config-panel__meta">{{ filteredSourceItems.length }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="formula-config-panel__filter">
|
|
|
|
<div class="formula-config-panel__filter">
|
|
|
|
<el-input v-model="sourceKeyword" placeholder="筛选" clearable />
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="sourceKeyword"
|
|
|
|
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.configFilterPlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-table
|
|
|
|
<el-table
|
|
|
|
class="formula-config-panel__table"
|
|
|
|
class="formula-config-panel__table"
|
|
|
|
@ -133,20 +241,24 @@ v-model="dialogForm.machineName" placeholder="请选择关联设备" clearable f
|
|
|
|
|
|
|
|
|
|
|
|
<div class="formula-config-actions">
|
|
|
|
<div class="formula-config-actions">
|
|
|
|
<el-button type="primary" :disabled="!sourceCheckedKeys.length" @click="addToTarget">
|
|
|
|
<el-button type="primary" :disabled="!sourceCheckedKeys.length" @click="addToTarget">
|
|
|
|
>>
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.configMoveToTargetButton') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<el-button :disabled="!targetCheckedKeys.length" @click="removeFromTarget">
|
|
|
|
<el-button :disabled="!targetCheckedKeys.length" @click="removeFromTarget">
|
|
|
|
<<
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.configMoveToSourceButton') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="formula-config-panel">
|
|
|
|
<div class="formula-config-panel">
|
|
|
|
<div class="formula-config-panel__header">
|
|
|
|
<div class="formula-config-panel__header">
|
|
|
|
<div>目标</div>
|
|
|
|
<div>{{ t('RecipeManagement.RecipeConfig.configTargetTitle') }}</div>
|
|
|
|
<div class="formula-config-panel__meta">{{ filteredTargetItems.length }}</div>
|
|
|
|
<div class="formula-config-panel__meta">{{ filteredTargetItems.length }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="formula-config-panel__filter">
|
|
|
|
<div class="formula-config-panel__filter">
|
|
|
|
<el-input v-model="targetKeyword" placeholder="筛选" clearable />
|
|
|
|
<el-input
|
|
|
|
|
|
|
|
v-model="targetKeyword"
|
|
|
|
|
|
|
|
:placeholder="t('RecipeManagement.RecipeConfig.configFilterPlaceholder')"
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-table
|
|
|
|
<el-table
|
|
|
|
class="formula-config-panel__table"
|
|
|
|
class="formula-config-panel__table"
|
|
|
|
@ -163,8 +275,12 @@ v-model="dialogForm.machineName" placeholder="请选择关联设备" clearable f
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<template #footer>
|
|
|
|
<template #footer>
|
|
|
|
<el-button @click="configVisible = false">取 消</el-button>
|
|
|
|
<el-button @click="configVisible = false">
|
|
|
|
<el-button type="primary" @click="submitConfig" :disabled="configLoading">保 存</el-button>
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.configCancelButton') }}
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
<el-button type="primary" @click="submitConfig" :disabled="configLoading">
|
|
|
|
|
|
|
|
{{ t('RecipeManagement.RecipeConfig.configSaveButton') }}
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</Dialog>
|
|
|
|
</Dialog>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -243,14 +359,14 @@ const handlePagination = () => {
|
|
|
|
|
|
|
|
|
|
|
|
const handleExport = async () => {
|
|
|
|
const handleExport = async () => {
|
|
|
|
if (!selectedIds.value.length) {
|
|
|
|
if (!selectedIds.value.length) {
|
|
|
|
message.error('请选择需要导出的数据')
|
|
|
|
message.error(t('RecipeManagement.RecipeConfig.exportNoSelectionMessage'))
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
await message.exportConfirm()
|
|
|
|
await message.exportConfirm()
|
|
|
|
exportLoading.value = true
|
|
|
|
exportLoading.value = true
|
|
|
|
const data = await RecipeConfigApi.exportRecipeConfig({ ids: selectedIds.value.join(',') })
|
|
|
|
const data = await RecipeConfigApi.exportRecipeConfig({ ids: selectedIds.value.join(',') })
|
|
|
|
download.excel(data, '配方配置.xls')
|
|
|
|
download.excel(data, t('RecipeManagement.RecipeConfig.exportFileName'))
|
|
|
|
} catch {
|
|
|
|
} catch {
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
exportLoading.value = false
|
|
|
|
exportLoading.value = false
|
|
|
|
@ -316,7 +432,11 @@ const ensureOptionsLoaded = async () => {
|
|
|
|
type DialogMode = 'create' | 'update'
|
|
|
|
type DialogMode = 'create' | 'update'
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
const dialogMode = ref<DialogMode>('create')
|
|
|
|
const dialogMode = ref<DialogMode>('create')
|
|
|
|
const dialogTitle = computed(() => (dialogMode.value === 'create' ? '新增配方配置' : '编辑配方配置'))
|
|
|
|
const dialogTitle = computed(() =>
|
|
|
|
|
|
|
|
dialogMode.value === 'create'
|
|
|
|
|
|
|
|
? t('RecipeManagement.RecipeConfig.dialogCreateTitle')
|
|
|
|
|
|
|
|
: t('RecipeManagement.RecipeConfig.dialogEditTitle')
|
|
|
|
|
|
|
|
)
|
|
|
|
const dialogFormRef = ref()
|
|
|
|
const dialogFormRef = ref()
|
|
|
|
const dialogLoading = ref(false)
|
|
|
|
const dialogLoading = ref(false)
|
|
|
|
const dialogForm = reactive({
|
|
|
|
const dialogForm = reactive({
|
|
|
|
@ -330,8 +450,20 @@ const dialogForm = reactive({
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const dialogRules = reactive({
|
|
|
|
const dialogRules = reactive({
|
|
|
|
recipeCode: [{ required: true, message: '配方编码不能为空', trigger: 'blur' }],
|
|
|
|
recipeCode: [
|
|
|
|
name: [{ required: true, message: '配方名称不能为空', trigger: 'blur' }]
|
|
|
|
{
|
|
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
|
|
message: t('RecipeManagement.RecipeConfig.validatorRecipeCodeRequired'),
|
|
|
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
name: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
|
|
message: t('RecipeManagement.RecipeConfig.validatorNameRequired'),
|
|
|
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const openDialog = async (mode: DialogMode, row?: RecipeConfigVO) => {
|
|
|
|
const openDialog = async (mode: DialogMode, row?: RecipeConfigVO) => {
|
|
|
|
@ -416,7 +548,7 @@ const handleDetailConfig = () => {
|
|
|
|
|
|
|
|
|
|
|
|
const handleRowClick = async (row: RecipeConfigVO, column: any) => {
|
|
|
|
const handleRowClick = async (row: RecipeConfigVO, column: any) => {
|
|
|
|
if (column?.type === 'selection') return
|
|
|
|
if (column?.type === 'selection') return
|
|
|
|
if (column?.label === '操作') return
|
|
|
|
if (column?.label === t('RecipeManagement.RecipeConfig.tableOperateColumn')) return
|
|
|
|
await openDetail(row)
|
|
|
|
await openDetail(row)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -445,7 +577,7 @@ const configDeviceLabel = computed(() => {
|
|
|
|
const name = detailMeta.machineName?.trim()
|
|
|
|
const name = detailMeta.machineName?.trim()
|
|
|
|
if (name) return name
|
|
|
|
if (name) return name
|
|
|
|
if (detailMeta.deviceId !== undefined && detailMeta.deviceId !== null) return String(detailMeta.deviceId)
|
|
|
|
if (detailMeta.deviceId !== undefined && detailMeta.deviceId !== null) return String(detailMeta.deviceId)
|
|
|
|
return '-'
|
|
|
|
return t('RecipeManagement.RecipeConfig.configDeviceLabelFallback')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const normalizeKey = (value: any): number | undefined => {
|
|
|
|
const normalizeKey = (value: any): number | undefined => {
|
|
|
|
@ -588,6 +720,14 @@ onMounted(() => {
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
.recipe-config-filter-form :deep(.el-form-item__label) {
|
|
|
|
|
|
|
|
min-width: 68px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.recipe-config-dialog-form :deep(.el-form-item__label) {
|
|
|
|
|
|
|
|
min-width: 100px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.formula-config-picklist {
|
|
|
|
.formula-config-picklist {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
|