|
@ -132,7 +132,12 @@ |
|
|
:key="cur.value" |
|
|
:key="cur.value" |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-input v-model="item.Value" placeholder="请输入物品,多个物品以逗号分隔" clearable style="flex: 1" /> |
|
|
<el-input |
|
|
|
|
|
v-model="item.Value" |
|
|
|
|
|
placeholder="请输入物品,多个物品以逗号分隔" |
|
|
|
|
|
clearable |
|
|
|
|
|
style="flex: 1" |
|
|
|
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
@ -146,7 +151,10 @@ |
|
|
<!-- 检验方式 --> |
|
|
<!-- 检验方式 --> |
|
|
<el-form-item label="检验方式" class="flex-top"> |
|
|
<el-form-item label="检验方式" class="flex-top"> |
|
|
<div class="checkbox"> |
|
|
<div class="checkbox"> |
|
|
<el-radio-group v-model="formData.configuration.InspectType" @change="changeInspectType"> |
|
|
<el-radio-group |
|
|
|
|
|
v-model="formData.configuration.InspectType" |
|
|
|
|
|
@change="changeInspectType" |
|
|
|
|
|
> |
|
|
<el-radio |
|
|
<el-radio |
|
|
:label="cur.value" |
|
|
:label="cur.value" |
|
|
v-for="cur in getStrDictOptions(DICT_TYPE.INSPECT_TYPE)" |
|
|
v-for="cur in getStrDictOptions(DICT_TYPE.INSPECT_TYPE)" |
|
@ -292,9 +300,18 @@ const formData = ref({ |
|
|
|
|
|
|
|
|
// 验证规则 |
|
|
// 验证规则 |
|
|
const rules = ref({ |
|
|
const rules = ref({ |
|
|
strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], |
|
|
strategyCode: [ |
|
|
name: [{ required: true, message: '请输入名字', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], |
|
|
{ required: true, message: '请输入代码', trigger: 'blur' }, |
|
|
description: [{ required: true, message: '请输入描述', trigger: 'blur' },{ max: 50, message: '不得超过50个字符', trigger: 'blur' }], |
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|
|
|
|
|
], |
|
|
|
|
|
name: [ |
|
|
|
|
|
{ required: true, message: '请输入名字', trigger: 'blur' }, |
|
|
|
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|
|
|
|
|
], |
|
|
|
|
|
description: [ |
|
|
|
|
|
{ required: true, message: '请输入描述', trigger: 'blur' }, |
|
|
|
|
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|
|
|
|
|
], |
|
|
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], |
|
|
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], |
|
|
configurationRules: [{ required: true, message: '抽奖规则请填写完全', trigger: 'blur' }] |
|
|
configurationRules: [{ required: true, message: '抽奖规则请填写完全', trigger: 'blur' }] |
|
|
}) |
|
|
}) |
|
@ -364,14 +381,16 @@ const changeSupplierType = (e) => { |
|
|
} |
|
|
} |
|
|
getFormSupplierList() |
|
|
getFormSupplierList() |
|
|
// 改变检验方式的时候 |
|
|
// 改变检验方式的时候 |
|
|
function changeInspectType(e){ |
|
|
function changeInspectType(e) { |
|
|
if (e == 'SAMPLING') { |
|
|
if (e == 'SAMPLING') { |
|
|
formData.value.configuration.SampleMethod='QTY' |
|
|
formData.value.configuration.SampleMethod = 'QTY' |
|
|
formData.value.configuration.AqlList=[{ |
|
|
formData.value.configuration.AqlList = [ |
|
|
FloorQty: 1, |
|
|
{ |
|
|
CeilingQty: 2, |
|
|
FloorQty: 1, |
|
|
SampleValue: 1 |
|
|
CeilingQty: 2, |
|
|
}] |
|
|
SampleValue: 1 |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
// 改变抽检方式的时候 |
|
|
// 改变抽检方式的时候 |
|
@ -404,7 +423,7 @@ const open = async (type: string, strategyCode: string, id?: number) => { |
|
|
formData.value.status = data.status == 0 ? true : false |
|
|
formData.value.status = data.status == 0 ? true : false |
|
|
if (formData.value.priority == 0) { |
|
|
if (formData.value.priority == 0) { |
|
|
Butttondata.value = [ |
|
|
Butttondata.value = [ |
|
|
defaultButtons.formSaveBtn({disabled:true}), // 保存 |
|
|
defaultButtons.formSaveBtn({ disabled: true }), // 保存 |
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
defaultButtons.formCloseBtn(null) // 关闭 |
|
|
] |
|
|
] |
|
|
} else { |
|
|
} else { |
|
@ -436,21 +455,35 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
/** 提交表单 */ |
|
|
/** 提交表单 */ |
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
|
|
|
const hasSameData = (array) => { |
|
|
|
|
|
for (let k = 0; k < array.length; k++) { |
|
|
|
|
|
for (let n = k + 1; n < array.length; n++) { |
|
|
|
|
|
if(array[k].FloorQty <= array[n].FloorQty && array[n].FloorQty<=array[k].CeilingQty){ |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
const submitForm = async () => { |
|
|
const submitForm = async () => { |
|
|
// 校验表单 |
|
|
// 校验表单 |
|
|
inputNumberBlur() |
|
|
inputNumberBlur() |
|
|
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){ |
|
|
if (formData.value.priority == 0) { |
|
|
message.error('优先级不可以为0') |
|
|
message.error('优先级不可以为0') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
if (hasSameData(formData.value.configuration.AqlList)) { |
|
|
|
|
|
message.error('抽检规则数据范围重叠,请重新填写') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
// 提交请求 |
|
|
// 提交请求 |
|
|
formLoading.value = true |
|
|
formLoading.value = true |
|
|
if(formData.value.configuration.InspectType != 'SAMPLING'){ |
|
|
if (formData.value.configuration.InspectType != 'SAMPLING') { |
|
|
formData.value.configuration.SampleMethod= '' |
|
|
formData.value.configuration.SampleMethod = '' |
|
|
formData.value.configuration.AqlList=[] |
|
|
formData.value.configuration.AqlList = [] |
|
|
} |
|
|
} |
|
|
try { |
|
|
try { |
|
|
let data = { |
|
|
let data = { |
|
|