|
@ -1,16 +1,27 @@ |
|
|
|
|
|
|
|
|
<!-- 供应商送货策略弹出层 --> |
|
|
<!-- 采购计划策略弹出层 --> |
|
|
<template> |
|
|
<template> |
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 800px;"> |
|
|
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 800px"> |
|
|
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;"> |
|
|
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto"> |
|
|
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px" label-position="left"> |
|
|
<el-form |
|
|
|
|
|
ref="formRef" |
|
|
|
|
|
:model="formData" |
|
|
|
|
|
:rules="rules" |
|
|
|
|
|
label-width="120px" |
|
|
|
|
|
label-position="left" |
|
|
|
|
|
> |
|
|
<!-- 规则 --> |
|
|
<!-- 规则 --> |
|
|
<div class="item"> |
|
|
<div class="item"> |
|
|
<div class="title">规则</div> |
|
|
<div class="title">规则</div> |
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
<el-form-item label="代码" prop="strategyCode"> |
|
|
<el-form-item label="代码" prop="strategyCode"> |
|
|
<el-input v-model="formData.strategyCode" 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"> |
|
@ -41,36 +52,95 @@ |
|
|
<el-row> |
|
|
<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 |
|
|
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> |
|
|
v-if="item.ParamCode == 'SupplierType'" |
|
|
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierTypeRangeOptions" |
|
|
label="供应商类型" |
|
|
:key="cur.value" /> |
|
|
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> |
|
|
<el-select v-model="item.Value" placeholder="请选择供应商类型" style="flex: 1;" clearable |
|
|
<el-select |
|
|
@change="changeSupplierType"> |
|
|
v-model="item.Value" |
|
|
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value" |
|
|
placeholder="请选择供应商类型" |
|
|
:label="dict.label" :value="dict.value" /> |
|
|
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> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 供应商 --> |
|
|
<!-- 供应商 --> |
|
|
<el-form-item v-else-if="item.ParamCode == 'SupplierCode'" label="供应商" class="err-120"> |
|
|
<el-form-item |
|
|
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;margin-right: 10px;"> |
|
|
v-else-if="item.ParamCode == 'SupplierCode'" |
|
|
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierRangeOptions" |
|
|
label="供应商" |
|
|
:key="cur.value" /> |
|
|
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> |
|
|
<el-select v-model="item.Value" placeholder="请选择供应商" style="flex: 1;" clearable> |
|
|
<el-select |
|
|
<el-option v-for="cur in options.supplierList" :key="cur.id" :label="cur.name" :value="cur.id" /> |
|
|
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-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 星期几 --> |
|
|
<!-- 星期几 --> |
|
|
<el-form-item v-else-if="item.ParamCode == 'Weekday'" label="星期几" class="flex-top err-120"> |
|
|
<el-form-item |
|
|
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> |
|
|
v-else-if="item.ParamCode == 'Weekday'" |
|
|
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.weekRangeOptions" |
|
|
label="星期几" |
|
|
:key="cur.value" /> |
|
|
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> |
|
|
</el-select> |
|
|
<div class="checkbox"> |
|
|
<div class="checkbox"> |
|
|
<el-checkbox-group v-model="item.Value"> |
|
|
<el-checkbox-group v-model="item.Value"> |
|
|
<el-checkbox :label="cur.label" v-for="cur in options.weekOptions" :key="cur.value" /> |
|
|
<el-checkbox |
|
|
|
|
|
:label="cur.label" |
|
|
|
|
|
v-for="cur in options.weekOptions" |
|
|
|
|
|
:key="cur.value" |
|
|
|
|
|
/> |
|
|
</el-checkbox-group> |
|
|
</el-checkbox-group> |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -84,33 +154,80 @@ |
|
|
<!-- 开始时间 --> |
|
|
<!-- 开始时间 --> |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
<!-- 开始时间 --> |
|
|
<!-- 开始时间 --> |
|
|
<el-form-item label="开始时间" prop="BeginTime"> |
|
|
<el-form-item label="开始时间" prop="BeginTime"> |
|
|
<el-time-select v-model="formData.configuration.BeginTime" start="00:00" end="23:59" step="00:15" placeholder="请选择开始时间" |
|
|
<el-time-select |
|
|
style="width: 100%;" /> |
|
|
v-model="formData.configuration.BeginTime" |
|
|
|
|
|
start="00:00" |
|
|
|
|
|
end="23:59" |
|
|
|
|
|
step="00:15" |
|
|
|
|
|
placeholder="请选择开始时间" |
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 结束时间 --> |
|
|
<!-- 结束时间 --> |
|
|
<el-form-item label="结束时间" prop="EndTime"> |
|
|
<el-form-item label="结束时间" prop="EndTime"> |
|
|
<el-time-select v-model="formData.configuration.EndTime" start="00:00" end="23:59" step="00:15" placeholder="请选择结束时间" |
|
|
<el-time-select |
|
|
style="width: 100%;" /> |
|
|
v-model="formData.configuration.EndTime" |
|
|
|
|
|
start="00:00" |
|
|
|
|
|
end="23:59" |
|
|
|
|
|
step="00:15" |
|
|
|
|
|
placeholder="请选择结束时间" |
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 仓库 --> |
|
|
<!-- 仓库 --> |
|
|
<el-form-item label="仓库" prop="WarehouseCode"> |
|
|
<el-form-item label="仓库" prop="WarehouseCode"> |
|
|
<el-select v-model="formData.configuration.WarehouseCode" |
|
|
<el-select |
|
|
:placeholder="`请选择${formData.configuration.WarehouseCode == 'WarehouseCode' ? '仓库' : formData.configuration.WarehouseCode== 'AreaCode' ? '库区' : formData.configuration.WarehouseCode == 'LocationGroupCode' ? '库位组' : formData.configuration.WarehouseCode == 'LocationCode' ? '库位' : ''}`" |
|
|
v-model="formData.configuration.WarehouseCode" |
|
|
clearable> |
|
|
:placeholder="`请选择${ |
|
|
<el-option v-for="cur in options.warehouseList" :key="cur.code" :label="cur.name" :value="cur.code" /> |
|
|
formData.configuration.WarehouseCode == 'WarehouseCode' |
|
|
|
|
|
? '仓库' |
|
|
|
|
|
: formData.configuration.WarehouseCode == 'AreaCode' |
|
|
|
|
|
? '库区' |
|
|
|
|
|
: formData.configuration.WarehouseCode == 'LocationGroupCode' |
|
|
|
|
|
? '库位组' |
|
|
|
|
|
: formData.configuration.WarehouseCode == 'LocationCode' |
|
|
|
|
|
? '库位' |
|
|
|
|
|
: '' |
|
|
|
|
|
}`" |
|
|
|
|
|
clearable |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="cur in options.warehouseList" |
|
|
|
|
|
:key="cur.code" |
|
|
|
|
|
:label="cur.name" |
|
|
|
|
|
:value="cur.code" |
|
|
|
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 月台 --> |
|
|
<!-- 月台 --> |
|
|
<el-form-item label="月台" prop="DockCode" > |
|
|
<el-form-item label="月台" prop="DockCode"> |
|
|
<el-select v-model="formData.configuration.DockCode" placeholder="请选择月台" clearable> |
|
|
<el-select |
|
|
<el-option v-for="cur in options.dockList" :key="cur.code" :label="cur.name" :value="cur.code" /> |
|
|
v-model="formData.configuration.DockCode" |
|
|
|
|
|
placeholder="请选择月台" |
|
|
|
|
|
clearable |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="cur in options.dockList" |
|
|
|
|
|
:key="cur.code" |
|
|
|
|
|
:label="cur.name" |
|
|
|
|
|
:value="cur.code" |
|
|
|
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- 在途库位 --> |
|
|
<!-- 在途库位 --> |
|
|
<el-form-item label="在途库位" prop="OnTheWayLocationCode" > |
|
|
<el-form-item label="在途库位" prop="OnTheWayLocationCode"> |
|
|
<el-select v-model="formData.configuration.OnTheWayLocationCode" placeholder="请选择在途库位" clearable> |
|
|
<el-select |
|
|
<el-option v-for="cur in options.locationList" :key="cur.code" :label="cur.name" :value="cur.code" /> |
|
|
v-model="formData.configuration.OnTheWayLocationCode" |
|
|
|
|
|
placeholder="请选择在途库位" |
|
|
|
|
|
clearable |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="cur in options.locationList" |
|
|
|
|
|
:key="cur.code" |
|
|
|
|
|
:label="cur.name" |
|
|
|
|
|
:value="cur.code" |
|
|
|
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
@ -134,8 +251,6 @@ import { getDockList } from '@/api/wms/dock' |
|
|
import { getLocationList } from '@/api/wms/location' |
|
|
import { getLocationList } from '@/api/wms/location' |
|
|
import * as RuleApi from '@/api/wms/rule' |
|
|
import * as RuleApi from '@/api/wms/rule' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
|
|
|
|
|
@ -149,31 +264,31 @@ const formStrategyCode = ref('') |
|
|
// form表单数据 |
|
|
// form表单数据 |
|
|
const formData = ref({ |
|
|
const formData = ref({ |
|
|
id: '', |
|
|
id: '', |
|
|
strategyCode: formStrategyCode.value,//策略代码id |
|
|
strategyCode: formStrategyCode.value, //策略代码id |
|
|
name: '',//名称 |
|
|
name: '', //名称 |
|
|
description: '',//描述 |
|
|
description: '', //描述 |
|
|
priority: '',//优先级 |
|
|
priority: '', //优先级 |
|
|
status: true,//状态 |
|
|
status: true, //状态 |
|
|
//规则条件集合 |
|
|
//规则条件集合 |
|
|
condition: [ |
|
|
condition: [ |
|
|
// 供应商类型 |
|
|
// 供应商类型 |
|
|
{ ParamCode: 'SupplierType', Operator: "==", Value: "" }, |
|
|
{ ParamCode: 'SupplierType', Operator: '==', Value: '' }, |
|
|
// 供应商 |
|
|
// 供应商 |
|
|
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }, |
|
|
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' }, |
|
|
// 星期几 |
|
|
// 星期几 |
|
|
{ ParamCode: 'Weekday', Operator: "IN", Value: [] } |
|
|
{ ParamCode: 'Weekday', Operator: 'IN', Value: [] } |
|
|
], |
|
|
], |
|
|
configuration: { |
|
|
configuration: { |
|
|
// 开始时间 |
|
|
// 开始时间 |
|
|
BeginTime:"", |
|
|
BeginTime: '', |
|
|
// 结束时间 |
|
|
// 结束时间 |
|
|
EndTime:"", |
|
|
EndTime: '', |
|
|
// 仓库代码 |
|
|
// 仓库代码 |
|
|
WarehouseCode:"", |
|
|
WarehouseCode: '', |
|
|
// 月台代码 |
|
|
// 月台代码 |
|
|
DockCode:"", |
|
|
DockCode: '', |
|
|
// 在途库位代码 |
|
|
// 在途库位代码 |
|
|
OnTheWayLocationCode:"", |
|
|
OnTheWayLocationCode: '' |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
@ -182,7 +297,7 @@ const rules = ref({ |
|
|
strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }], |
|
|
strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }], |
|
|
name: [{ required: true, message: '请输入名字', trigger: 'blur' }], |
|
|
name: [{ required: true, message: '请输入名字', trigger: 'blur' }], |
|
|
description: [{ required: true, message: '请输入描述', trigger: 'blur' }], |
|
|
description: [{ required: true, message: '请输入描述', trigger: 'blur' }], |
|
|
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], |
|
|
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }] |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 所有的范围类型 |
|
|
// 所有的范围类型 |
|
@ -196,11 +311,11 @@ const rangeOptions = [ |
|
|
{ value: 'IN', label: '包含' }, |
|
|
{ value: 'IN', label: '包含' }, |
|
|
{ value: 'NOT IN', label: '不包含' }, |
|
|
{ value: 'NOT IN', label: '不包含' }, |
|
|
{ value: 'NULL', label: '为空' }, |
|
|
{ value: 'NULL', label: '为空' }, |
|
|
{ value: 'NOT NULL', label: '不为空' }, |
|
|
{ value: 'NOT NULL', label: '不为空' } |
|
|
] |
|
|
] |
|
|
const formatRangeOptions = (...rest) => { |
|
|
const formatRangeOptions = (...rest) => { |
|
|
// 交集 |
|
|
// 交集 |
|
|
let result = rangeOptions.filter(aItem => rest.some(bItem => aItem.value === bItem)); |
|
|
let result = rangeOptions.filter((aItem) => rest.some((bItem) => aItem.value === bItem)) |
|
|
return result |
|
|
return result |
|
|
} |
|
|
} |
|
|
// 下拉框列表集合 |
|
|
// 下拉框列表集合 |
|
@ -216,21 +331,47 @@ const options = reactive({ |
|
|
// 星期几范围下拉框列表 |
|
|
// 星期几范围下拉框列表 |
|
|
weekRangeOptions: formatRangeOptions('IN', 'NOT IN'), |
|
|
weekRangeOptions: formatRangeOptions('IN', 'NOT IN'), |
|
|
//星期几列表 |
|
|
//星期几列表 |
|
|
weekOptions: [{ value: 1, label: '星期一' }, { value: 2, label: '星期二' }, { value: 3, label: '星期三' }, { value: 4, label: '星期四' }, { value: 5, label: '星期五' }, { value: 6, label: '星期六' }, { value: 7, label: '星期日' }], |
|
|
weekOptions: [ |
|
|
|
|
|
{ value: 1, label: '星期一' }, |
|
|
|
|
|
{ value: 2, label: '星期二' }, |
|
|
|
|
|
{ value: 3, label: '星期三' }, |
|
|
|
|
|
{ value: 4, label: '星期四' }, |
|
|
|
|
|
{ value: 5, label: '星期五' }, |
|
|
|
|
|
{ value: 6, label: '星期六' }, |
|
|
|
|
|
{ value: 7, label: '星期日' } |
|
|
|
|
|
], |
|
|
//仓库列表 |
|
|
//仓库列表 |
|
|
warehouseList: [], |
|
|
warehouseList: [], |
|
|
//月台列表 |
|
|
//月台列表 |
|
|
dockList: [], |
|
|
dockList: [], |
|
|
//在途库位列表 |
|
|
//在途库位列表 |
|
|
locationList: [], |
|
|
locationList: [] |
|
|
}) |
|
|
}) |
|
|
|
|
|
// 弹窗按钮 |
|
|
|
|
|
const Butttondata = ref([ |
|
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
|
|
]) |
|
|
|
|
|
// 按钮事件 |
|
|
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
|
|
// 保存 |
|
|
|
|
|
if (val == 'save') { |
|
|
|
|
|
submitForm() |
|
|
|
|
|
} |
|
|
|
|
|
// 关闭 |
|
|
|
|
|
else if (val == 'close') { |
|
|
|
|
|
dialogVisible.value = false |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 获取供应商列表的参数 |
|
|
// 获取供应商列表的参数 |
|
|
const querySupplierParams = ref({ |
|
|
const querySupplierParams = ref({ |
|
|
type: '' |
|
|
type: '' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 获取供应商列表 |
|
|
// 获取供应商列表 |
|
|
const getFormSupplierList = async () => { |
|
|
const getFormSupplierList = async () => { |
|
|
options.supplierList = await getSupplierList(querySupplierParams.value); |
|
|
options.supplierList = await getSupplierList(querySupplierParams.value) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 选择供应商类型 |
|
|
// 选择供应商类型 |
|
@ -242,16 +383,15 @@ const changeSupplierType = (e) => { |
|
|
|
|
|
|
|
|
// 获取仓库列表 |
|
|
// 获取仓库列表 |
|
|
const getFormWarehouseList = async () => { |
|
|
const getFormWarehouseList = async () => { |
|
|
options.warehouseList = await getWarehouseList(); |
|
|
options.warehouseList = await getWarehouseList() |
|
|
} |
|
|
} |
|
|
// 获取月台列表 |
|
|
// 获取月台列表 |
|
|
const getFormDockList = async () => { |
|
|
const getFormDockList = async () => { |
|
|
options.dockList = await getDockList(); |
|
|
options.dockList = await getDockList() |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// 获取库位列表 |
|
|
// 获取库位列表 |
|
|
const getFormLocationList = async () => { |
|
|
const getFormLocationList = async () => { |
|
|
options.locationList = await getLocationList({ type: 'TRANSPORT' }); |
|
|
options.locationList = await getLocationList({ type: 'TRANSPORT' }) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getFormSupplierList() |
|
|
getFormSupplierList() |
|
@ -269,6 +409,7 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
// 修改时,设置数据 |
|
|
// 修改时,设置数据 |
|
|
if (id) { |
|
|
if (id) { |
|
|
formLoading.value = true |
|
|
formLoading.value = true |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
let data = await RuleApi.getRule(id) |
|
|
let data = await RuleApi.getRule(id) |
|
|
formData.value.id = data.id |
|
|
formData.value.id = data.id |
|
@ -277,19 +418,32 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
formData.value.description = data.description |
|
|
formData.value.description = data.description |
|
|
formData.value.priority = data.priority |
|
|
formData.value.priority = data.priority |
|
|
formData.value.status = data.status == 0 ? true : false |
|
|
formData.value.status = data.status == 0 ? true : false |
|
|
|
|
|
if (formData.value.priority == 0) { |
|
|
|
|
|
Butttondata.value = [ |
|
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
|
|
] |
|
|
|
|
|
} else { |
|
|
|
|
|
Butttondata.value = [ |
|
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
if (data.condition) { |
|
|
if (data.condition) { |
|
|
formData.value.condition = JSON.parse(data.condition) |
|
|
formData.value.condition = JSON.parse(data.condition) |
|
|
} |
|
|
} |
|
|
if (data.configuration) { |
|
|
if (data.configuration) { |
|
|
formData.value.configuration = JSON.parse(data.configuration) |
|
|
formData.value.configuration = JSON.parse(data.configuration) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
querySupplierParams.value.type = formData.value?.condition[0]?.Value || '' |
|
|
querySupplierParams.value.type = formData.value?.condition[0]?.Value || '' |
|
|
getFormSupplierList() |
|
|
getFormSupplierList() |
|
|
|
|
|
|
|
|
} finally { |
|
|
} finally { |
|
|
formLoading.value = false |
|
|
formLoading.value = false |
|
|
} |
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
Butttondata.value = [ |
|
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
|
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
|
|
|
] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
@ -301,16 +455,21 @@ const submitForm = async () => { |
|
|
if (!formRef) return |
|
|
if (!formRef) return |
|
|
const valid = await formRef.value.validate() |
|
|
const valid = await formRef.value.validate() |
|
|
if (!valid) return |
|
|
if (!valid) return |
|
|
|
|
|
|
|
|
|
|
|
if(formData.value.priority == 0){ |
|
|
|
|
|
message.error('优先级不可以为0') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
// 提交请求 |
|
|
// 提交请求 |
|
|
formLoading.value = true |
|
|
formLoading.value = true |
|
|
try { |
|
|
try { |
|
|
let data = { |
|
|
let data = { |
|
|
id: formData.value.id, |
|
|
id: formData.value.id, |
|
|
strategyCode: formData.value.strategyCode,//策略代码 |
|
|
strategyCode: formData.value.strategyCode, //策略代码 |
|
|
name: formData.value.name,//名称 |
|
|
name: formData.value.name, //名称 |
|
|
description: formData.value.description,//描述 |
|
|
description: formData.value.description, //描述 |
|
|
priority: formData.value.priority,//优先级 |
|
|
priority: formData.value.priority, //优先级 |
|
|
status: formData.value.status ? 0 : 1,//状态 |
|
|
status: formData.value.status ? 0 : 1, //状态 |
|
|
//规则条件集合 |
|
|
//规则条件集合 |
|
|
condition: JSON.stringify(formData.value.condition), |
|
|
condition: JSON.stringify(formData.value.condition), |
|
|
configuration: JSON.stringify(formData.value.configuration) |
|
|
configuration: JSON.stringify(formData.value.configuration) |
|
@ -334,52 +493,34 @@ const submitForm = async () => { |
|
|
const resetForm = () => { |
|
|
const resetForm = () => { |
|
|
formData.value = { |
|
|
formData.value = { |
|
|
id: '', |
|
|
id: '', |
|
|
strategyCode: formStrategyCode.value,//策略代码 |
|
|
strategyCode: formStrategyCode.value, //策略代码 |
|
|
name: '',//名称 |
|
|
name: '', //名称 |
|
|
description: '',//描述 |
|
|
description: '', //描述 |
|
|
priority: '',//优先级 |
|
|
priority: '', //优先级 |
|
|
status: true,//状态 |
|
|
status: true, //状态 |
|
|
//规则条件集合 |
|
|
//规则条件集合 |
|
|
condition: [ |
|
|
condition: [ |
|
|
// 供应商类型 |
|
|
// 供应商类型 |
|
|
{ ParamCode: 'SupplierType', Operator: "==", Value: "" }, |
|
|
{ ParamCode: 'SupplierType', Operator: '==', Value: '' }, |
|
|
// 供应商 |
|
|
// 供应商 |
|
|
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }, |
|
|
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' }, |
|
|
// 星期几 |
|
|
// 星期几 |
|
|
{ ParamCode: 'Weekday', Operator: "IN", Value: [] } |
|
|
{ ParamCode: 'Weekday', Operator: 'IN', Value: [] } |
|
|
], |
|
|
], |
|
|
configuration: { |
|
|
configuration: { |
|
|
// 开始时间 |
|
|
// 开始时间 |
|
|
BeginTime:"", |
|
|
BeginTime: '', |
|
|
// 结束时间 |
|
|
// 结束时间 |
|
|
EndTime:"", |
|
|
EndTime: '', |
|
|
// 仓库代码 |
|
|
// 仓库代码 |
|
|
WarehouseCode:"", |
|
|
WarehouseCode: '', |
|
|
// 月台代码 |
|
|
// 月台代码 |
|
|
DockCode:"", |
|
|
DockCode: '', |
|
|
// 在途库位代码 |
|
|
// 在途库位代码 |
|
|
OnTheWayLocationCode:"", |
|
|
OnTheWayLocationCode: '' |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 弹窗按钮 |
|
|
|
|
|
const Butttondata = [ |
|
|
|
|
|
defaultButtons.formSaveBtn(null), // 保存 |
|
|
|
|
|
defaultButtons.formCloseBtn(null), // 关闭 |
|
|
|
|
|
] |
|
|
|
|
|
// 按钮事件 |
|
|
|
|
|
const buttonBaseClick = (val, item) => { |
|
|
|
|
|
// 保存 |
|
|
|
|
|
if (val == 'save') { |
|
|
|
|
|
submitForm() |
|
|
|
|
|
} |
|
|
|
|
|
// 关闭 |
|
|
|
|
|
else if (val == 'close') { |
|
|
|
|
|
dialogVisible.value = false |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
|
.item { |
|
|
.item { |
|
|