|
@ -264,6 +264,7 @@ import * as RuleApi from '@/api/wms/rule' |
|
|
import { isString } from '@/utils/is' |
|
|
import { isString } from '@/utils/is' |
|
|
|
|
|
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' |
|
|
|
|
|
import { json } from 'stream/consumers' |
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化 |
|
|
const { t } = useI18n() // 国际化 |
|
|
const message = useMessage() // 消息弹窗 |
|
|
const message = useMessage() // 消息弹窗 |
|
@ -450,6 +451,10 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
/** 提交表单 */ |
|
|
/** 提交表单 */ |
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
|
|
|
const hasSameData = (array)=>{ |
|
|
|
|
|
const set = new Set(array.map(JSON.stringify)) |
|
|
|
|
|
return set.size !== array.length |
|
|
|
|
|
} |
|
|
const submitForm = async () => { |
|
|
const submitForm = async () => { |
|
|
// 校验表单 |
|
|
// 校验表单 |
|
|
inputBlur() |
|
|
inputBlur() |
|
@ -460,6 +465,10 @@ const submitForm = async () => { |
|
|
message.error('优先级不可以为0') |
|
|
message.error('优先级不可以为0') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if (hasSameData( formData.value.configuration.ManagementPrecision)) { |
|
|
|
|
|
message.error('规则配置数据重复,请重新填写') |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
// 提交请求 |
|
|
// 提交请求 |
|
|
formLoading.value = true |
|
|
formLoading.value = true |
|
|
try { |
|
|
try { |
|
@ -480,6 +489,7 @@ const submitForm = async () => { |
|
|
Value:str |
|
|
Value:str |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
let data = { |
|
|
let data = { |
|
|
id: formData.value.id, |
|
|
id: formData.value.id, |
|
|
strategyCode: formData.value.strategyCode, //策略代码 |
|
|
strategyCode: formData.value.strategyCode, //策略代码 |
|
|