From 8bd8a296d44d92c59b90b0f47944a0af236e6021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Thu, 18 Jan 2024 10:12:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E4=BD=8D=E5=AD=98=E5=82=A8=E7=AD=96?= =?UTF-8?q?=E7=95=A5=20=E6=B7=BB=E5=8A=A0=E6=93=8D=E4=BD=9C=E7=AC=A6?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouseStorageStrategy/AddForm.vue | 53 ++++++++++++++++--- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue index e6d430267..2dcd7642c 100644 --- a/src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue +++ b/src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue @@ -67,6 +67,18 @@ :key="index" /> + + + { // 下拉框列表集合 const options = reactive({ //范围下拉框列表 - rangeOptions1: formatRangeOptions('IN', 'NOT IN'), - rangeOptions2: formatRangeOptions('>', '<', '>=', '<='), + RangeOptions: formatRangeOptions('IN', 'NOT IN'), + // rangeOptions2: formatRangeOptions('>', '<', '>=', '<='), //仓库列表 warehouseTypeOptions: [ @@ -361,7 +378,7 @@ const getFormLocationList = async (queryParms) => { options.warehouseList = await getLocationList() } } -getFormLocationList() +getFormWarehouseList() // 获取溢流库位 const queryParms = { type: 'OVERFLOW' @@ -411,6 +428,11 @@ const open = async (type: string, strategyCode: string, id?: number) => { } if (data.condition) { formData.value.condition = JSON.parse(data.condition) + formData.value.condition.forEach((item, index) => { + if (item.Operator == 'IN' || item.Operator == 'NOT IN') { + item.Value = item.Value.split(',') + } + }) } if (data.configuration) { formData.value.configuration = JSON.parse(data.configuration) @@ -452,6 +474,23 @@ const submitForm = async () => { // 提交请求 formLoading.value = true try { + const arr = formData.value.condition.map(item=> { + let str = item.Value + if(isString(item.Value)){ + if(item.Value.indexOf(','>-1)){ + str = item.Value.split(',').join(',') + } + } + if ((item.Operator == 'IN' || item.Operator == 'NOT IN')&& Array.isArray(item.Value)) { + str = item.Value.join(',') + } + + return { + ParamCode:item.ParamCode, + Operator:item.Operator, + Value:str + } + }) let data = { id: formData.value.id, strategyCode: formData.value.strategyCode, //策略代码 @@ -460,7 +499,7 @@ const submitForm = async () => { priority: formData.value.priority, //优先级 status: formData.value.status ? 0 : 1, //状态 //规则条件集合 - condition: JSON.stringify(formData.value.condition), + condition: JSON.stringify(arr), configuration: JSON.stringify(formData.value.configuration) } if (formType.value === 'create') { @@ -490,7 +529,7 @@ const resetForm = () => { //规则条件集合 condition: [ // 仓库 - { ParamCode: 'LocationCode', Value: '' } + { ParamCode: 'WarehouseCode', Operator: 'IN', Value: '' } ], configuration: {