Browse Source

更换业务类型BusinessType

intex
yufei_wang 2 weeks ago
parent
commit
89de50185d
  1. 58
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue

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

@ -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: {
//

Loading…
Cancel
Save