|
|
@ -4,145 +4,142 @@ |
|
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible"> |
|
|
|
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;"> |
|
|
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px" label-position="left"> |
|
|
|
<el-row> |
|
|
|
<!-- 规则 --> |
|
|
|
<el-col :span="24"> |
|
|
|
<div class="item"> |
|
|
|
<div class="title">规则</div> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="代码" prop="code"> |
|
|
|
<el-input v-model="formData.code" placeholder="请输入代码" clearable disabled /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="名称" prop="name"> |
|
|
|
<el-input v-model="formData.name" placeholder="请输入名称" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="描述" prop="description"> |
|
|
|
<el-input v-model="formData.description" placeholder="请输入描述" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="优先级" prop="priority"> |
|
|
|
<el-input-number v-model="formData.priority" :min="1" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="状态" prop="status"> |
|
|
|
<el-switch v-model="formData.status" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<!-- 规则条件 --> |
|
|
|
<el-col :span="24"> |
|
|
|
<div class="item mt-20px"> |
|
|
|
<div class="title">规则条件</div> |
|
|
|
<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-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> |
|
|
|
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierTypeRangeOptions" |
|
|
|
:key="cur.value" /> |
|
|
|
</el-select> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择供应商类型" style="flex: 1;" clearable |
|
|
|
@change="changeSupplierType"> |
|
|
|
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value" |
|
|
|
:label="dict.label" :value="dict.value" /> |
|
|
|
</el-select> |
|
|
|
<!-- </div> --> |
|
|
|
</el-form-item> |
|
|
|
<!-- 供应商 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'SupplierCode'" label="供应商" class="err-120"> |
|
|
|
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;margin-right: 10px;"> |
|
|
|
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierRangeOptions" |
|
|
|
:key="cur.value" /> |
|
|
|
</el-select> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择供应商" style="flex: 1;" clearable> |
|
|
|
<el-option v-for="cur in options.supplierList" :key="cur.id" :label="cur.name" :value="cur.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<!-- 星期几 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'Weekday'" label="星期几" class="flex-top err-120"> |
|
|
|
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> |
|
|
|
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.weekRangeOptions" |
|
|
|
:key="cur.value" /> |
|
|
|
</el-select> |
|
|
|
<div class="checkbox"> |
|
|
|
<el-checkbox-group v-model="item.Value" @change="change"> |
|
|
|
<el-checkbox :label="cur.label" v-for="cur in options.weekOptions" :key="cur.value" /> |
|
|
|
</el-checkbox-group> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<!-- 规则配置 --> |
|
|
|
<el-col :span="24"> |
|
|
|
<div class="item mt-20px"> |
|
|
|
<div class="title">规则配置</div> |
|
|
|
<!-- 规则 --> |
|
|
|
<div class="item"> |
|
|
|
<div class="title">规则</div> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="代码" prop="strategyCode"> |
|
|
|
<el-input v-model="formData.strategyCode" placeholder="请输入代码" clearable disabled /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="名称" prop="name"> |
|
|
|
<el-input v-model="formData.name" placeholder="请输入名称" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="描述" prop="description"> |
|
|
|
<el-input v-model="formData.description" placeholder="请输入描述" clearable /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="优先级" prop="priority"> |
|
|
|
<el-input-number v-model="formData.priority" :min="1" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="状态" prop="status"> |
|
|
|
<el-switch v-model="formData.status" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
<!-- 规则条件 --> |
|
|
|
<div class="item mt-20px"> |
|
|
|
<div class="title">规则条件</div> |
|
|
|
<el-row> |
|
|
|
<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-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> |
|
|
|
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierTypeRangeOptions" |
|
|
|
:key="cur.value" /> |
|
|
|
</el-select> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择供应商类型" style="flex: 1;" clearable |
|
|
|
@change="changeSupplierType"> |
|
|
|
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value" |
|
|
|
:label="dict.label" :value="dict.value" /> |
|
|
|
</el-select> |
|
|
|
<!-- </div> --> |
|
|
|
</el-form-item> |
|
|
|
<!-- 供应商 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'SupplierCode'" label="供应商" class="err-120"> |
|
|
|
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;margin-right: 10px;"> |
|
|
|
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierRangeOptions" |
|
|
|
:key="cur.value" /> |
|
|
|
</el-select> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择供应商" style="flex: 1;" clearable> |
|
|
|
<el-option v-for="cur in options.supplierList" :key="cur.id" :label="cur.name" :value="cur.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<!-- 星期几 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'Weekday'" label="星期几" class="flex-top err-120"> |
|
|
|
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> |
|
|
|
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.weekRangeOptions" |
|
|
|
:key="cur.value" /> |
|
|
|
</el-select> |
|
|
|
<div class="checkbox"> |
|
|
|
<el-checkbox-group v-model="item.Value" @change="change"> |
|
|
|
<el-checkbox :label="cur.label" v-for="cur in options.weekOptions" :key="cur.value" /> |
|
|
|
</el-checkbox-group> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
<!-- 规则配置 --> |
|
|
|
<div class="item mt-20px"> |
|
|
|
<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 == 'BeginTime'" label="开始时间" |
|
|
|
:prop="'configuration.' + index + '.Value'" :rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择开始时间', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-time-select v-model="item.Value" start="00:00" end="23:59" step="00:15" placeholder="请选择开始时间" |
|
|
|
style="width: 100%;" /> |
|
|
|
</el-form-item> |
|
|
|
<!-- 结束时间 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'EndTime'" label="结束时间" |
|
|
|
:prop="'configuration.' + index + '.Value'" :rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择结束时间', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-time-select v-model="item.Value" start="00:00" end="23:59" step="00:15" placeholder="请选择结束时间" |
|
|
|
style="width: 100%;" /> |
|
|
|
</el-form-item> |
|
|
|
<!-- 仓库 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'WarehouseCode'" label="仓库" |
|
|
|
:prop="'configuration.' + index + '.Value'" :rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择仓库', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择仓库" clearable> |
|
|
|
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<!-- 月台 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'DockCode'" label="月台" |
|
|
|
:prop="'configuration.' + index + '.Value'" :rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择月台', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择月台" clearable> |
|
|
|
<el-option v-for="cur in options.dockList" :key="cur.id" :label="cur.name" :value="cur.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<!-- 在途库位 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'OnTheWayLocationCode'" label="在途库位" |
|
|
|
:prop="'configuration.' + index + '.Value'" :rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择在途库位', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择在途库位" clearable> |
|
|
|
<el-option v-for="cur in options.locationList" :key="cur.id" :label="cur.name" :value="cur.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
</el-row> |
|
|
|
<el-form-item v-if="item.ParamCode == 'BeginTime'" label="开始时间" :prop="'configuration.' + index + '.Value'" |
|
|
|
:rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择开始时间', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-time-select v-model="item.Value" start="00:00" end="23:59" step="00:15" placeholder="请选择开始时间" |
|
|
|
style="width: 100%;" /> |
|
|
|
</el-form-item> |
|
|
|
<!-- 结束时间 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'EndTime'" label="结束时间" |
|
|
|
:prop="'configuration.' + index + '.Value'" :rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择结束时间', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-time-select v-model="item.Value" start="00:00" end="23:59" step="00:15" placeholder="请选择结束时间" |
|
|
|
style="width: 100%;" /> |
|
|
|
</el-form-item> |
|
|
|
<!-- 仓库 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'WarehouseCode'" label="仓库" |
|
|
|
:prop="'configuration.' + index + '.Value'" :rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择仓库', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择仓库" clearable> |
|
|
|
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<!-- 月台 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'DockCode'" label="月台" |
|
|
|
:prop="'configuration.' + index + '.Value'" :rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择月台', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择月台" clearable> |
|
|
|
<el-option v-for="cur in options.dockList" :key="cur.id" :label="cur.name" :value="cur.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<!-- 在途库位 --> |
|
|
|
<el-form-item v-else-if="item.ParamCode == 'OnTheWayLocationCode'" label="在途库位" |
|
|
|
:prop="'configuration.' + index + '.Value'" :rules="{ |
|
|
|
required: true, |
|
|
|
message: '请选择在途库位', |
|
|
|
trigger: 'change', |
|
|
|
}"> |
|
|
|
<el-select v-model="item.Value" placeholder="请选择在途库位" clearable> |
|
|
|
<el-option v-for="cur in options.locationList" :key="cur.id" :label="cur.name" :value="cur.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<template #footer> |
|
|
@ -180,7 +177,6 @@ const formStrategyCode = ref('') |
|
|
|
const formData = ref({ |
|
|
|
id: '', |
|
|
|
strategyCode: formStrategyCode.value,//策略代码id |
|
|
|
code: formStrategyCode.value,//规则代码 |
|
|
|
name: '',//名称 |
|
|
|
description: '',//描述 |
|
|
|
priority: '',//优先级 |
|
|
@ -305,7 +301,6 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
|
let data = await RuleApi.getRule(id) |
|
|
|
formData.value.id = data.id |
|
|
|
formData.value.strategyCode = data.strategyCode |
|
|
|
formData.value.code = data.code |
|
|
|
formData.value.name = data.name |
|
|
|
formData.value.description = data.description |
|
|
|
formData.value.priority = data.priority |
|
|
@ -340,7 +335,6 @@ const submitForm = async () => { |
|
|
|
let data = { |
|
|
|
id: formData.value.id, |
|
|
|
strategyCode: formData.value.strategyCode,//策略代码 |
|
|
|
code: formData.value.code,//规则代码 |
|
|
|
name: formData.value.name,//名称 |
|
|
|
description: formData.value.description,//描述 |
|
|
|
priority: formData.value.priority,//优先级 |
|
|
@ -369,7 +363,6 @@ const resetForm = () => { |
|
|
|
formData.value = { |
|
|
|
id: '', |
|
|
|
strategyCode: formStrategyCode.value,//策略代码 |
|
|
|
code: formStrategyCode.value,//规则代码 |
|
|
|
name: '',//名称 |
|
|
|
description: '',//描述 |
|
|
|
priority: '',//优先级 |
|
|
|