|
|
@ -52,8 +52,22 @@ |
|
|
|
<el-row key="规则条件row"> |
|
|
|
<el-col :span="24" v-for="(item, index) in formData.condition" :key="'规则条件row'+index"> |
|
|
|
<!-- 受入地 --> |
|
|
|
<el-form-item key="受入地formItem" label="受入地" class="err-120" v-if="index==0"> |
|
|
|
<el-select key="受入地Operator" |
|
|
|
<el-form-item key="仓库和库区formItem" label="" label-width="0" v-if="index==0"> |
|
|
|
<el-select key="仓库和库区" |
|
|
|
v-model="item.ParamCode" |
|
|
|
placeholder="" |
|
|
|
style="width: 110px; margin-right: 10px" |
|
|
|
@change="changeWarehouseArea" |
|
|
|
:disabled="formData.name=='默认规则'&&formType=='update'" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
:label="cur.label" |
|
|
|
:value="cur.value" |
|
|
|
v-for="cur in options.warehouseAreaOptions" |
|
|
|
:key="'仓库和库区'+cur.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<el-select key="仓库和库区Operator" |
|
|
|
v-model="item.Operator" |
|
|
|
placeholder="请选择范围" |
|
|
|
style="width: 110px; margin-right: 10px" |
|
|
@ -64,10 +78,10 @@ |
|
|
|
:label="cur.label" |
|
|
|
:value="cur.value" |
|
|
|
v-for="cur in options.WarehouseCodeRangeOptions" |
|
|
|
:key="'受入地Operator'+cur.value" |
|
|
|
:key="'仓库和库区Operator'+cur.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<el-input key="受入地Value" style="flex:1" placeholder="请选择受入地" v-model="item.Value" @blur="blurWarehouseByCodes"> |
|
|
|
<el-input key="仓库和库区Value" style="flex:1" placeholder="请选择仓库或者库区" v-model="item.Value" @blur="blurWarehouseByCodes"> |
|
|
|
<template #suffix> |
|
|
|
<el-button :disabled="formData.name=='默认规则'&&formType=='update'" type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse"> |
|
|
|
<Icon icon="ep:search" class="mr-5px" /> |
|
|
@ -186,6 +200,10 @@ import { validateHanset } from '@/utils/validator' |
|
|
|
|
|
|
|
import * as WarehouseApi from '@/api/wms/warehouse' |
|
|
|
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data' |
|
|
|
|
|
|
|
import * as AreaApi from '@/api/wms/areabasic' |
|
|
|
import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data' |
|
|
|
|
|
|
|
import * as SupplierApi from '@/api/wms/supplier' |
|
|
|
import { Supplier } from '@/views/wms/basicDataManage/supplierManage/supplier/supplier.data' |
|
|
|
import * as DockApi from '@/api/wms/dock' |
|
|
@ -261,6 +279,11 @@ const formatRangeOptions = (...rest) => { |
|
|
|
} |
|
|
|
// 下拉框列表集合 |
|
|
|
const options = reactive({ |
|
|
|
// 仓库和库区下拉列表 |
|
|
|
warehouseAreaOptions: [ |
|
|
|
{value: 'WarehouseCode', label: '仓库' }, |
|
|
|
{value: 'Area', label: '库区' } |
|
|
|
], |
|
|
|
// 供应商范围下拉框列表 |
|
|
|
WarehouseCodeRangeOptions: formatRangeOptions('IN', 'NOT IN'), |
|
|
|
// 供应商范围下拉框列表 |
|
|
@ -438,6 +461,8 @@ const resetForm = () => { |
|
|
|
const searchTableRef = ref() |
|
|
|
// 仓库 |
|
|
|
const searchWarehouse = () => { |
|
|
|
console.log(WarehouseCodeOrArea.value) |
|
|
|
if (WarehouseCodeOrArea.value == 'WarehouseCode') { |
|
|
|
searchTableRef.value.open( |
|
|
|
'请选择仓库', |
|
|
|
Warehouse.allSchemas, |
|
|
@ -449,6 +474,20 @@ const searchWarehouse = ()=>{ |
|
|
|
undefined, |
|
|
|
undefined |
|
|
|
) |
|
|
|
} else if (WarehouseCodeOrArea.value == 'Area') { |
|
|
|
searchTableRef.value.open( |
|
|
|
'请选择库区', |
|
|
|
Area.allSchemas, |
|
|
|
AreaApi.getAreaPage, |
|
|
|
'Area', |
|
|
|
'code', |
|
|
|
true, |
|
|
|
undefined, |
|
|
|
undefined, |
|
|
|
undefined |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// 选择供应商 |
|
|
|
const searchSupplier = () => { |
|
|
@ -501,6 +540,11 @@ const searchTableSuccess = (formField, searchField, val, type, row) => { |
|
|
|
warehouseCodeObj.value.Value = val.map(item => (item['code'])).join(',') |
|
|
|
formData.value.configuration['DockCode']='' |
|
|
|
} |
|
|
|
}else if (formField=='Area') { |
|
|
|
let Area = formData.value.condition.find(item => item['ParamCode'] == 'Area') |
|
|
|
if(Area){ |
|
|
|
Area.Value = val.map(item=>(item['code'])).join(',') |
|
|
|
} |
|
|
|
} else if (formField=='SupplierCode') { |
|
|
|
let SupplierCode = formData.value.condition.find(item => item['ParamCode'] == 'SupplierCode') |
|
|
|
if(SupplierCode){ |
|
|
@ -530,14 +574,23 @@ const blurWarehouseByCodes = async ()=>{ |
|
|
|
].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='' |
|
|
|
} |
|
|
|
} |
|
|
|
// 供应商失去焦点 |
|
|
@ -602,6 +655,21 @@ const blurDockCode = async () => { |
|
|
|
const OperatorChange = (e, item) => { |
|
|
|
item.ScreenOperator = rangeOptions.find((item) =>item.value === e)?.screenValue |
|
|
|
} |
|
|
|
const WarehouseCodeOrArea = ref('WarehouseCode') |
|
|
|
// 选择客户还是承运商 |
|
|
|
const changeWarehouseArea = (e) => { |
|
|
|
formData.value.condition[0].Value = '' |
|
|
|
WarehouseCodeOrArea.value = e |
|
|
|
if (e == 'WarehouseCode') { |
|
|
|
formData.value.configuration.DockCode='' |
|
|
|
formData.value.configuration.Receiver='' |
|
|
|
formData.value.configuration.PhoneNumber='' |
|
|
|
} else if (e == 'Area') { |
|
|
|
// getFormSupplierList() |
|
|
|
} |
|
|
|
} |
|
|
|
// {value: 'WarehouseCode', label: '仓库' }, |
|
|
|
// {value: 'Area', label: '库区' } |
|
|
|
</script> |
|
|
|
<style scoped lang="scss"> |
|
|
|
.item { |
|
|
|