|
@ -67,6 +67,18 @@ |
|
|
:key="index" |
|
|
:key="index" |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
|
|
|
<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.RangeOptions" |
|
|
|
|
|
:key="cur.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
<el-select |
|
|
<el-select |
|
|
v-model="item.Value" |
|
|
v-model="item.Value" |
|
|
:placeholder="`请选择${ |
|
|
:placeholder="`请选择${ |
|
@ -82,6 +94,8 @@ |
|
|
}`" |
|
|
}`" |
|
|
clearable |
|
|
clearable |
|
|
style="flex: 1" |
|
|
style="flex: 1" |
|
|
|
|
|
multiple |
|
|
|
|
|
collapse-tags |
|
|
> |
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="cur in options.warehouseList" |
|
|
v-for="cur in options.warehouseList" |
|
@ -223,6 +237,7 @@ import { getAreaList } from '@/api/wms/areabasic' |
|
|
import { getLocationgroupList } from '@/api/wms/locationgroup' |
|
|
import { getLocationgroupList } from '@/api/wms/locationgroup' |
|
|
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' |
|
|
|
|
|
import { isString } from '@/utils/is' |
|
|
|
|
|
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
|
|
|
|
|
@ -246,8 +261,10 @@ const formData = ref({ |
|
|
status: true, //状态 |
|
|
status: true, //状态 |
|
|
//规则条件集合 |
|
|
//规则条件集合 |
|
|
condition: [ |
|
|
condition: [ |
|
|
// 仓库 |
|
|
{ ParamCode: 'WarehouseCode', Operator: 'IN', Value: '' }, |
|
|
{ ParamCode: 'LocationCode', Value: '' } |
|
|
{ ParamCode: 'AreaCode', Operator: 'IN', Value: '' }, |
|
|
|
|
|
{ ParamCode: 'LocationGroupCode', Operator: 'IN', Value: '' }, |
|
|
|
|
|
{ ParamCode: 'LocationCode', Operator: 'IN', Value: '' } |
|
|
], |
|
|
], |
|
|
configuration: { |
|
|
configuration: { |
|
|
// 默认库存状态 |
|
|
// 默认库存状态 |
|
@ -310,8 +327,8 @@ const formatRangeOptions = (...rest) => { |
|
|
// 下拉框列表集合 |
|
|
// 下拉框列表集合 |
|
|
const options = reactive({ |
|
|
const options = reactive({ |
|
|
//范围下拉框列表 |
|
|
//范围下拉框列表 |
|
|
rangeOptions1: formatRangeOptions('IN', 'NOT IN'), |
|
|
RangeOptions: formatRangeOptions('IN', 'NOT IN'), |
|
|
rangeOptions2: formatRangeOptions('>', '<', '>=', '<='), |
|
|
// rangeOptions2: formatRangeOptions('>', '<', '>=', '<='), |
|
|
|
|
|
|
|
|
//仓库列表 |
|
|
//仓库列表 |
|
|
warehouseTypeOptions: [ |
|
|
warehouseTypeOptions: [ |
|
@ -361,7 +378,7 @@ const getFormLocationList = async (queryParms) => { |
|
|
options.warehouseList = await getLocationList() |
|
|
options.warehouseList = await getLocationList() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
getFormLocationList() |
|
|
getFormWarehouseList() |
|
|
// 获取溢流库位 |
|
|
// 获取溢流库位 |
|
|
const queryParms = { |
|
|
const queryParms = { |
|
|
type: 'OVERFLOW' |
|
|
type: 'OVERFLOW' |
|
@ -411,6 +428,11 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
} |
|
|
} |
|
|
if (data.condition) { |
|
|
if (data.condition) { |
|
|
formData.value.condition = JSON.parse(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) { |
|
|
if (data.configuration) { |
|
|
formData.value.configuration = JSON.parse(data.configuration) |
|
|
formData.value.configuration = JSON.parse(data.configuration) |
|
@ -452,6 +474,23 @@ const submitForm = async () => { |
|
|
// 提交请求 |
|
|
// 提交请求 |
|
|
formLoading.value = true |
|
|
formLoading.value = true |
|
|
try { |
|
|
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 = { |
|
|
let data = { |
|
|
id: formData.value.id, |
|
|
id: formData.value.id, |
|
|
strategyCode: formData.value.strategyCode, //策略代码 |
|
|
strategyCode: formData.value.strategyCode, //策略代码 |
|
@ -460,7 +499,7 @@ const submitForm = async () => { |
|
|
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(arr), |
|
|
configuration: JSON.stringify(formData.value.configuration) |
|
|
configuration: JSON.stringify(formData.value.configuration) |
|
|
} |
|
|
} |
|
|
if (formType.value === 'create') { |
|
|
if (formType.value === 'create') { |
|
@ -490,7 +529,7 @@ const resetForm = () => { |
|
|
//规则条件集合 |
|
|
//规则条件集合 |
|
|
condition: [ |
|
|
condition: [ |
|
|
// 仓库 |
|
|
// 仓库 |
|
|
{ ParamCode: 'LocationCode', Value: '' } |
|
|
{ ParamCode: 'WarehouseCode', Operator: 'IN', Value: '' } |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
configuration: { |
|
|
configuration: { |
|
|