|
|
@ -369,9 +369,9 @@ |
|
|
|
:key="'库存事务Operator'+cur.value" |
|
|
|
/> |
|
|
|
</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="请选择库存事务" disabled v-model="item.Value" @blur="blurBusinessType"> |
|
|
|
<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" /> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
@ -392,7 +392,7 @@ |
|
|
|
:key="'业务类型Operator'+cur.value" |
|
|
|
/> |
|
|
|
</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="请选择业务类型" disabled v-model="item.Value" @blur="blurBusinessType"> |
|
|
|
<template #suffix> |
|
|
|
<el-button :disabled="formData.priority==0&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchBusinessType"> |
|
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
@ -751,7 +751,7 @@ const formData = ref({ |
|
|
|
// // 存储类型 |
|
|
|
// { ParamCode: 'StorageType', Operator: 'IN', Value: [] }, |
|
|
|
// 库存事务 // 业务类型 |
|
|
|
{ ParamCode: 'TransactionType', Operator: 'IN', Value: '' }, |
|
|
|
{ ParamCode: 'BusinessType', Operator: 'IN', Value: '' }, |
|
|
|
], |
|
|
|
configuration: { |
|
|
|
// 仓库代码 |
|
|
@ -1099,7 +1099,7 @@ const searchBusinessType = ()=>{ |
|
|
|
'请选择业务类型', |
|
|
|
Businesstype.allSchemas, |
|
|
|
BusinesstypeApi.getBusinesstypePage, |
|
|
|
'TransactionType', |
|
|
|
'BusinessType', |
|
|
|
'code', |
|
|
|
true, |
|
|
|
undefined, |
|
|
@ -1108,12 +1108,12 @@ const searchBusinessType = ()=>{ |
|
|
|
) |
|
|
|
} |
|
|
|
//事务类型 |
|
|
|
const searchTransactionType = ()=>{ |
|
|
|
const searchTransactiontype = ()=>{ |
|
|
|
searchTableRef.value.open( |
|
|
|
'请选择事务类型', |
|
|
|
Transactiontype.allSchemas, |
|
|
|
TransactiontypeApi.getTransactiontypePage, |
|
|
|
'TransactionType', |
|
|
|
'BusinessType', |
|
|
|
'code', |
|
|
|
true, |
|
|
|
undefined, |
|
|
@ -1121,21 +1121,22 @@ const searchTransactionType = ()=>{ |
|
|
|
undefined |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
// 失去焦点校验 |
|
|
|
const blurTransactionType = async ()=>{ |
|
|
|
let transactionType = formData.value.condition.find(item=>item['ParamCode']=='TransactionType') |
|
|
|
console.log('transactionType',transactionType) |
|
|
|
if(transactionType&&transactionType.Value){ |
|
|
|
const blurBusinessType = async ()=>{ |
|
|
|
let BusinessType = formData.value.condition.find(item=>item['ParamCode']=='BusinessType') |
|
|
|
console.log('BusinessType',BusinessType) |
|
|
|
if(BusinessType&&BusinessType.Value){ |
|
|
|
let verifyRes = await TransactiontypeApi.verifyTransactiontype({ |
|
|
|
code:transactionType.Value |
|
|
|
code:BusinessType.Value |
|
|
|
}) |
|
|
|
console.log('事务类型verifyRes',verifyRes) |
|
|
|
if(verifyRes&&verifyRes.length>0){ |
|
|
|
let verifyList = verifyRes.map(item=>(item['code'])) |
|
|
|
let codeList = transactionType.Value.split(',') |
|
|
|
transactionType.Value = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') |
|
|
|
let codeList = BusinessType.Value.split(',') |
|
|
|
BusinessType.Value = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',') |
|
|
|
}else{ |
|
|
|
transactionType.Value = '' |
|
|
|
BusinessType.Value = '' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1143,15 +1144,18 @@ const searchTableSuccess = (formField, searchField, val, type, row) => { |
|
|
|
// let searchTableTitle = warehouseType.value == 'WarehouseCode'?'请选择仓库':warehouseType.value == 'AreaCode'?'请选择库区':warehouseType.value == 'LocationGroupCode'?'请选择库位组':warehouseType.value == 'LocationCode'?'请选择库位':'' |
|
|
|
console.log('searchTableSuccess',formField, searchField, val, type, row) |
|
|
|
console.log(val.map(item=>(item['code'])).join(',')) |
|
|
|
// if(formField=='TransactionType'){ |
|
|
|
// let transactionType = formData.value.condition.find(item=>item['ParamCode']=='TransactionType') |
|
|
|
// if(transactionType){ |
|
|
|
// transactionType.Value = val.map(item=>(item['code'])).join(',') |
|
|
|
// if(formField=='BusinessType'){ |
|
|
|
// let BusinessType = formData.value.condition.find(item=>item['ParamCode']=='BusinessType') |
|
|
|
// if(BusinessType){ |
|
|
|
// BusinessType.Value = val.map(item=>(item['code'])).join(',') |
|
|
|
// } |
|
|
|
// return |
|
|
|
// }else |
|
|
|
if(formField=='TransactionType'){ |
|
|
|
let businessType = formData.value.condition.find(item=>item['ParamCode']=='TransactionType') |
|
|
|
if(formField=='BusinessType'){ |
|
|
|
console.log('condition',formData.value.condition) |
|
|
|
debugger |
|
|
|
let businessType = formData.value.condition.find(item=>item['ParamCode']=='BusinessType') |
|
|
|
console.log('businessType',businessType) |
|
|
|
if(businessType){ |
|
|
|
businessType.Value = val.map(item=>(item['code'])).join(',') |
|
|
|
} |
|
|
@ -1291,11 +1295,11 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
/** 提交表单 */ |
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
|
const submitForm = async () => { |
|
|
|
let TransactionType = formData.value.condition[2]['Value'] |
|
|
|
if(Array.isArray(TransactionType)){ |
|
|
|
TransactionType = TransactionType.join(',') |
|
|
|
let BusinessType = formData.value.condition[2]['Value'] |
|
|
|
if(Array.isArray(BusinessType)){ |
|
|
|
BusinessType = BusinessType.join(',') |
|
|
|
} |
|
|
|
if(TransactionType=='Repleinment'){ |
|
|
|
if(BusinessType=='Repleinment'){ |
|
|
|
//补料--物料和库位必填 |
|
|
|
let msg = '' |
|
|
|
let itemCodeType = formData.value.condition[1]['ParamCode'] |
|
|
@ -1323,7 +1327,7 @@ const submitForm = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
await blurWarehouse({module:'config',type:warehouseType.value}) |
|
|
|
// await blurTransactionType() |
|
|
|
// await blurBusinessType() |
|
|
|
if(warehouseType.value == 'WarehouseCode' && !formData.value.configuration.WarehouseCode){ |
|
|
|
// 仓库 |
|
|
|
message.error('请选择仓库') |
|
|
@ -1426,7 +1430,7 @@ const resetForm = () => { |
|
|
|
// // 存储类型 |
|
|
|
// { ParamCode: 'StorageType', Operator: 'IN', Value: [] }, |
|
|
|
// 库存事务 // 业务类型 |
|
|
|
{ ParamCode: 'TransactionType', Operator: 'IN', Value: '' }, |
|
|
|
{ ParamCode: 'BusinessType', Operator: 'IN', Value: '' }, |
|
|
|
], |
|
|
|
configuration: { |
|
|
|
// 仓库代码 |
|
|
|