Browse Source

策略失去焦点加提示

intex
zhang_li 2 days ago
parent
commit
b61aed7899
  1. 210
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue
  2. 11
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue

210
src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

@ -82,10 +82,13 @@
:key="'仓库和库区Operator'+cur.value"
/>
</el-select>
<el-input key="仓库和库区Value" style="flex:1" placeholder="请选择仓库或者库区" v-model="item.Value" @blur="blurWarehouseByCodes(item.ParamCode)" :disabled="formData.priority==0&&formType=='update'"/>
<el-button type="info" plain @click="searchWarehouse" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" />
</el-button>
<el-input key="仓库和库区Value" style="flex:1" placeholder="请选择仓库或者库区" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:WarehouseCodeOrArea})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 供应商代码 -->
<el-form-item key="供应商代码formItem"
@ -107,10 +110,13 @@
:key="'供应商代码Operator'+cur.value"
/>
</el-select>
<el-input key="供应商代码Value" style="flex:1" placeholder="请选择供应商代码" v-model="item.Value" @blur="blurSupplierCode" :disabled="formData.priority==0&&formType=='update'"/>
<el-button type="info" plain @click="searchSupplier" :disabled="formData.priority==0&&formType=='update'">
<Icon icon="ep:search" />
</el-button>
<el-input key="供应商代码Value" style="flex:1" placeholder="请选择供应商代码" v-model="item.Value" @blur="blurWarehouse({module:'condition',type:'SupplierCode'})" :disabled="formData.priority==0&&formType=='update'">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchSupplier">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
@ -145,10 +151,13 @@
</el-form-item>
<!-- 月台 -->
<el-form-item key="月台formItem" :label="t('ts.月台').replace('ts.','')" prop="configuration.DockCode">
<el-input key="月台Value" style="flex:1" placeholder="请选择月台" v-model="formData.configuration.DockCode" @blur="blurDockCode"/>
<el-button type="info" plain @click="searchDockCode">
<Icon icon="ep:search" />
</el-button>
<el-input key="月台Value" style="flex:1" placeholder="请选择月台" v-model="formData.configuration.DockCode" @blur="blurDockCode">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click.stop="searchDockCode">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
</el-form-item>
<!-- 收货人 -->
<el-form-item key="收货人formItem" :label="t('ts.收货人').replace('ts.','')" prop="Receiver">
@ -561,110 +570,93 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
formData.value.configuration.PhoneNumber = val[0].contactPhone
}
}
//
const blurWarehouseByCodes = async (formField) => {
if (formField == 'WarehouseCode') {
let WarehouseCode = formData.value.condition.find(item=>item['ParamCode']=='WarehouseCode')
if(WarehouseCode&&WarehouseCode.Value){
let verifyRes = await WarehouseApi.getWarehouseByCodes({
codes:WarehouseCode.Value
})
console.log('事务类型verifyRes',verifyRes)
if (verifyRes && verifyRes.length > 0) {
const arr1 = WarehouseCode.Value.split(',')
if (arr1.length != verifyRes.length) {
const arr2 = verifyRes.map((item) => item.code)
const str = [
...arr1.filter((item) => !arr2.includes(item)),
...arr2.filter((item) => !arr1.includes(item))
].join(',')
message.alert('代码' + str + '没有找到对应数据')
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
return
}
} else {
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
message.alert('暂无数据')
}
}else{
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
}
} else {
let AreaCode = formData.value.condition.find(item=>item['ParamCode']=='AreaCode')
if(AreaCode&&AreaCode.Value){
let verifyRes = await AreaApi.getAreabasicByCodes({
codes:AreaCode.Value
})
console.log('事务类型verifyRes',verifyRes)
if (verifyRes && verifyRes.length > 0) {
const arr1 = AreaCode.Value.split(',')
if (arr1.length != verifyRes.length) {
const arr2 = verifyRes.map((item) => item.code)
const str = [
...arr1.filter((item) => !arr2.includes(item)),
...arr2.filter((item) => !arr1.includes(item))
].join(',')
message.alert('代码' + str + '没有找到对应数据')
AreaCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
return
}
} else {
AreaCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
message.alert('暂无数据')
}
}else{
WarehouseCode.Value = ''
// formData.value.configuration.DockCode=''
// formData.value.configuration.Receiver=''
// formData.value.configuration.PhoneNumber=''
const blurWarehouse = async ({module='config',type})=>{
//
let warehouseValue = formData.value.configuration[WarehouseCodeOrArea.value]
let conditionObj = null
if(module=='condition'){
//
conditionObj = formData.value.condition.find(item=>item['ParamCode']==type)
if(conditionObj){
warehouseValue = conditionObj['Value']
}
// { value: 'WarehouseCode', label: '' },
// { value: 'AreaCode', label: '' },
// { value: 'LocationGroupCode', label: '' },
// { value: 'LocationCode', label: '' }
}
}
//
const blurSupplierCode = async () => {
let SupplierCode = formData.value.condition.find(item => item['ParamCode'] == 'SupplierCode')
console.log(77,SupplierCode)
if(SupplierCode&&SupplierCode.Value){
let verifyRes = await SupplierApi.getSupplierListByCodes({
codes:SupplierCode.Value
if(!warehouseValue){
return
}
let verifyRes = []
console.log(222,warehouseValue)
if(module=='condition'&&type=='WarehouseCode' || module=='config'&&warehouseType.value == 'WarehouseCode'){
//
verifyRes = await WarehouseApi.verifyWarehouse({
code:warehouseValue
})
console.log('事务类型verifyRes',verifyRes)
if (verifyRes && verifyRes.length > 0) {
const arr1 = SupplierCode.Value.split(',')
if (arr1.length != verifyRes.length) {
const arr2 = verifyRes.map((item) => item.code)
const str = [
...arr1.filter((item) => !arr2.includes(item)),
...arr2.filter((item) => !arr1.includes(item))
].join(',')
console.log('仓库verifyRes',verifyRes)
}else if(module=='condition'&&type=='AreaCode' || module=='config'&&warehouseType.value == 'AreaCode'){
//
verifyRes = await AreaApi.verifyAreaList({
code:warehouseValue
})
console.log('库区verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationGroupCode' || module=='config'&&warehouseType.value == 'LocationGroupCode'){
//
verifyRes = await LocationgroupApi.verifyLocationgroup({
code:warehouseValue
})
console.log('库位组verifyRes',verifyRes)
}else if(module=='condition'&&type=='LocationCode' || module=='config'&&warehouseType.value == 'LocationCode'){
//
verifyRes = await LocationApi.verifyLocation({
code:warehouseValue
})
console.log('库位verifyRes',verifyRes)
}else if(module=='condition'&&type=='SupplierCode' || module=='config'&&warehouseType.value == 'SupplierCode'){
//
verifyRes = await SupplierApi.getSupplierListByCodes({
code:warehouseValue
})
console.log('库位verifyRes',verifyRes)
}
if(verifyRes&&verifyRes.length>0){
let verifyList = verifyRes.map(item=>(item['code']))
if(module=='condition'){
//
let codeList = warehouseValue.split(',')
conditionObj['Value'] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
const str = codeList.filter(item => verifyList.indexOf(item) == -1).join(',')
if (str) {
message.alert('代码' + str + '没有找到对应数据')
SupplierCode.Value = ''
return
}
} else {
SupplierCode.Value = ''
message.alert('暂无数据')
}else{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}
}else{
SupplierCode.Value = ''
if(module=='condition'){
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}
if(module!='condition'){
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
}
//
const blurDockCode = async () => {
if (formData.value.configuration.DockCode) {
@ -689,9 +681,11 @@ const blurDockCode = async () => {
})
console.log('事务类型verifyRes',verifyRes)
if (verifyRes.list && verifyRes.list.length > 0) {
let codeList = formData.value.configuration.DockCode.split(',')
formData.value.configuration.DockCode= codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
} else {
message.alert('代码' + formData.value.configuration.DockCode + '没有找到对应数据')
formData.value.configuration.DockCode = ''
message.alert('暂无数据')
}
}

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

@ -1077,17 +1077,24 @@ const blurWarehouse = async ({module='config',type})=>{
//
let codeList = warehouseValue.split(',')
conditionObj['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{
//
let codeList = formData.value.configuration[warehouseType.value].split(',')
formData.value.configuration[warehouseType.value] = codeList.filter(item=>verifyList.indexOf(item)>-1).join(',')
}
}else{
if(module=='condition'){
//
conditionObj['Value'] = ''
message.alert('代码' + conditionObj['Value'] + '没有找到对应数据')
//
conditionObj['Value'] = ''
}else{
message.alert('代码' + formData.value.configuration[warehouseType.value] + '没有找到对应数据')
formData.value.configuration[warehouseType.value] = ''
}
}

Loading…
Cancel
Save