Browse Source

发料失去焦点校验提示

intex
zhang_li 3 days ago
parent
commit
0ef262eda7
  1. 46
      src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue
  2. 4
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue

46
src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue

@ -341,7 +341,7 @@
:key="'生产线Operator'+cur.value" :key="'生产线Operator'+cur.value"
/> />
</el-select> </el-select>
<el-input key="生产线Value" style="flex:1" placeholder="请选择生产线" disabled v-model="item.Value" @blur="blurTransactionType"> <el-input key="生产线Value" style="flex:1" placeholder="请选择生产线" v-model="item.Value" @blur="blurProductionline">
<template #suffix> <template #suffix>
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchTransactionType"> <el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchTransactionType">
<Icon icon="ep:search" class="mr-5px" /> <Icon icon="ep:search" class="mr-5px" />
@ -955,8 +955,13 @@ const blurWarehouse = async ()=>{
if(verifyRes&&verifyRes.length>0){ if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code'])) let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',') let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') formData.value.configuration[warehouseType.value] = codeList.filter(item => verifyList.indexOf(item) > -1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{ }else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = '' formData.value.configuration[warehouseType.value] = ''
} }
}else if(warehouseType.value == 'AreaCode'){ }else if(warehouseType.value == 'AreaCode'){
@ -968,7 +973,12 @@ const blurWarehouse = async ()=>{
if(verifyRes&&verifyRes.length>0){ if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code'])) let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',') let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') formData.value.configuration[warehouseType.value] = codeList.filter(item => verifyList.indexOf(item) > -1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
message.alert('代码' + str + '没有找到对应数据')
}
}else{ }else{
formData.value.configuration[warehouseType.value] = '' formData.value.configuration[warehouseType.value] = ''
} }
@ -982,7 +992,12 @@ const blurWarehouse = async ()=>{
let verifyList = verifyRes.map(item=>(item['code'])) let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',') let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{ }else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = '' formData.value.configuration[warehouseType.value] = ''
} }
@ -995,8 +1010,13 @@ const blurWarehouse = async ()=>{
if(verifyRes&&verifyRes.length>0){ if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code'])) let verifyList = verifyRes.map(item=>(item['code']))
let codeList = formData.value.configuration[warehouseType.value].split(',') let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') formData.value.configuration[warehouseType.value] = codeList.filter(item => verifyList.indexOf(item) > -1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{ }else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = '' formData.value.configuration[warehouseType.value] = ''
} }
} }
@ -1041,18 +1061,24 @@ const searchTransactionType = ()=>{
) )
} }
// //
const blurTransactionType = async ()=>{ const blurProductionline= async ()=>{
let transactionType = formData.value.condition.find(item=>item['ParamCode']=='TransactionType') let transactionType = formData.value.condition.find(item => item['ParamCode'] == 'Productionline')
console.log(transactionType)
if(transactionType&&transactionType.Value){ if(transactionType&&transactionType.Value){
let verifyRes = await TransactiontypeApi.verifyTransactiontype({ let verifyRes = await ProductionlineApi.getProductionlineByCodes({
code:transactionType.Value codes:transactionType.Value
}) })
console.log('事务类型verifyRes',verifyRes) console.log('事务类型verifyRes',verifyRes)
if(verifyRes&&verifyRes.length>0){ if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code'])) let verifyList = verifyRes.map(item=>(item['code']))
let codeList = transactionType.Value.split(',') let codeList = transactionType.Value.split(',')
transactionType.Value = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') transactionType.Value = codeList.filter(item => verifyList.indexOf(item) > -1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
}else{ }else{
message.alert('代码' + transactionType.Value + '没有找到对应数据')
transactionType.Value = '' transactionType.Value = ''
} }
} }
@ -1258,7 +1284,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
await blurWarehouse() await blurWarehouse()
await blurTransactionType() await blurProductionline()
console.log('规则条件',formData.value.condition) console.log('规则条件',formData.value.condition)
// //

4
src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue

@ -1085,6 +1085,10 @@ const blurWarehouse = async ({module='config',type})=>{
// //
let codeList = formData.value.configuration[warehouseType.value].split(',') let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
}
} }

Loading…
Cancel
Save