Browse Source

策略失去焦点加提示

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

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

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

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

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

Loading…
Cancel
Save