|
@ -5,13 +5,12 @@ |
|
|
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;"> |
|
|
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;"> |
|
|
<!-- 规则 --> |
|
|
<!-- 规则 --> |
|
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="140px" label-position="left"> |
|
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="140px" label-position="left"> |
|
|
<el-row> |
|
|
|
|
|
<el-col :span="24"> |
|
|
|
|
|
<div class="item"> |
|
|
<div class="item"> |
|
|
<div class="title">规则</div> |
|
|
<div class="title">规则</div> |
|
|
|
|
|
<el-row> |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
<el-form-item label="代码" prop="code"> |
|
|
<el-form-item label="代码" prop="strategyCode"> |
|
|
<el-input v-model="formData.code" placeholder="请输入代码" clearable disabled /> |
|
|
<el-input v-model="formData.strategyCode" placeholder="请输入代码" clearable disabled /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
@ -34,12 +33,12 @@ |
|
|
<el-switch v-model="formData.status" /> |
|
|
<el-switch v-model="formData.status" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
|
|
|
<!-- 规则条件 --> |
|
|
<!-- 规则条件 --> |
|
|
<el-col :span="24"> |
|
|
|
|
|
<div class="item mt-20px"> |
|
|
<div class="item mt-20px"> |
|
|
<div class="title">规则条件</div> |
|
|
<div class="title">规则条件</div> |
|
|
|
|
|
<el-row> |
|
|
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index"> |
|
|
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index"> |
|
|
<!-- 供应商类型 --> |
|
|
<!-- 供应商类型 --> |
|
|
<el-form-item v-if="item.ParamCode == 'SupplierType'" label="供应商类型" class="flex-top err-120"> |
|
|
<el-form-item v-if="item.ParamCode == 'SupplierType'" label="供应商类型" class="flex-top err-120"> |
|
@ -65,12 +64,12 @@ |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
</div> |
|
|
</div> |
|
|
</el-col> |
|
|
|
|
|
<!-- 规则配置 --> |
|
|
<!-- 规则配置 --> |
|
|
<el-col :span="24"> |
|
|
|
|
|
<div class="item mt-20px"> |
|
|
<div class="item mt-20px"> |
|
|
<div class="title">规则配置</div> |
|
|
<div class="title">规则配置</div> |
|
|
|
|
|
<el-row> |
|
|
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index"> |
|
|
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index"> |
|
|
<!-- 按零件拆分 --> |
|
|
<!-- 按零件拆分 --> |
|
|
<el-form-item v-if="item.ParamCode == 'ByItem'" label="按零件拆分" :prop="'configuration.' + index + '.Value'" |
|
|
<el-form-item v-if="item.ParamCode == 'ByItem'" label="按零件拆分" :prop="'configuration.' + index + '.Value'" |
|
@ -110,9 +109,8 @@ |
|
|
<el-input-number v-model="item.Value" :min="0" /> |
|
|
<el-input-number v-model="item.Value" :min="0" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</div> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
</div> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</div> |
|
|
</div> |
|
|
<template #footer> |
|
|
<template #footer> |
|
@ -150,7 +148,6 @@ const formStrategyCode = ref('') |
|
|
const formData = ref({ |
|
|
const formData = ref({ |
|
|
id: '', |
|
|
id: '', |
|
|
strategyCode: formStrategyCode.value,//策略代码id |
|
|
strategyCode: formStrategyCode.value,//策略代码id |
|
|
code: formStrategyCode.value,//规则代码 |
|
|
|
|
|
name: '',//名称 |
|
|
name: '',//名称 |
|
|
description: '',//描述 |
|
|
description: '',//描述 |
|
|
priority: '',//优先级 |
|
|
priority: '',//优先级 |
|
@ -267,7 +264,6 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
let data = await RuleApi.getRule(id) |
|
|
let data = await RuleApi.getRule(id) |
|
|
formData.value.id = data.id |
|
|
formData.value.id = data.id |
|
|
formData.value.strategyCode = data.strategyCode |
|
|
formData.value.strategyCode = data.strategyCode |
|
|
formData.value.code = data.code |
|
|
|
|
|
formData.value.name = data.name |
|
|
formData.value.name = data.name |
|
|
formData.value.description = data.description |
|
|
formData.value.description = data.description |
|
|
formData.value.priority = data.priority |
|
|
formData.value.priority = data.priority |
|
@ -302,7 +298,6 @@ const submitForm = async () => { |
|
|
let data = { |
|
|
let data = { |
|
|
id: formData.value.id, |
|
|
id: formData.value.id, |
|
|
strategyCode: formData.value.strategyCode,//策略代码 |
|
|
strategyCode: formData.value.strategyCode,//策略代码 |
|
|
code: formData.value.code,//规则代码 |
|
|
|
|
|
name: formData.value.name,//名称 |
|
|
name: formData.value.name,//名称 |
|
|
description: formData.value.description,//描述 |
|
|
description: formData.value.description,//描述 |
|
|
priority: formData.value.priority,//优先级 |
|
|
priority: formData.value.priority,//优先级 |
|
@ -331,7 +326,6 @@ const resetForm = () => { |
|
|
formData.value = { |
|
|
formData.value = { |
|
|
id: '', |
|
|
id: '', |
|
|
strategyCode: formStrategyCode.value,//策略代码 |
|
|
strategyCode: formStrategyCode.value,//策略代码 |
|
|
code: formStrategyCode.value,//规则代码 |
|
|
|
|
|
name: '',//名称 |
|
|
name: '',//名称 |
|
|
description: '',//描述 |
|
|
description: '',//描述 |
|
|
priority: '',//优先级 |
|
|
priority: '',//优先级 |
|
@ -345,7 +339,7 @@ const resetForm = () => { |
|
|
], |
|
|
], |
|
|
configuration: [ |
|
|
configuration: [ |
|
|
// 按零件拆分 |
|
|
// 按零件拆分 |
|
|
{ ParamCode: 'ByItem', Value: false}, |
|
|
{ ParamCode: 'ByItem', Value: false }, |
|
|
// 按库位拆分 |
|
|
// 按库位拆分 |
|
|
{ ParamCode: 'ByLocation', Value: true }, |
|
|
{ ParamCode: 'ByLocation', Value: true }, |
|
|
// 按器具拆分 |
|
|
// 按器具拆分 |
|
|