diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 2e762d638..4271318da 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1060,7 +1060,8 @@ export default { 提示:'Tip', 凭证号:'voucher number', 采购价格审批人:'Purchasing price approver', - 供应商发货单号:'Supplier\'s invoice number' + 供应商发货单号:'Supplier\'s invoice number', + 加载中:'loading', }, diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 3e38361f5..f97feb5a9 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1060,7 +1060,8 @@ export default { 提示:'提示', 凭证号:'凭证号', 采购价格审批人:'采购价格审批人', - 供应商发货单号:'供应商发货单号' + 供应商发货单号:'供应商发货单号', + 加载中:'加载中', }, diff --git a/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue b/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue index 1151aaf81..75e35be3e 100644 --- a/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue +++ b/src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue @@ -15,7 +15,7 @@ - - + - + - + - + - -
-
规则条件
- - +
+
规则条件
+ + - - + - - - - + - - - - - - - - + - - - + - - - + - - - + - -
-
规则配置
- +
+
规则配置
+ - - - + + - - + @@ -335,12 +339,15 @@ v-model="formData.configuration.AreaCode" v-if="warehouseType == 'AreaCode'" placeholder="请选择库区" + key="请选择库区" clearable style="flex: 1" + filterable + :filter-method="filterMethodWarehouseList" > @@ -349,12 +356,15 @@ v-model="formData.configuration.LocationGroupCode" v-if="warehouseType == 'LocationGroupCode'" placeholder="请选择库位组" + key="请选择库位组" clearable style="flex: 1" + filterable + :filter-method="filterMethodWarehouseList" > @@ -364,12 +374,15 @@ v-model="formData.configuration.LocationCode" v-if="warehouseType == 'LocationCode'" placeholder="请选择库位" + key="请选择库位" clearable style="flex: 1" + filterable + :filter-method="filterMethodWarehouseList" > @@ -377,9 +390,9 @@ - - - + + - - - + + - - - + + - - - + + - - + + - - + +
- + {{ cur.label }} @@ -442,29 +455,29 @@ - - + +
- + {{ cur.label }}
- - - + + +
- + {{ cur.label }} @@ -472,14 +485,14 @@ - - + +
- + {{ cur.label }} @@ -518,9 +531,9 @@ const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formType = ref('') // 表单的类型:create - 新增;update - 修改 const formRef = ref() // 表单 Ref - const formStrategyCode = ref('') + // 仓库类型 const warehouseType = ref('WarehouseCode') @@ -615,6 +628,7 @@ const options = reactive({ ], //供应商列表 supplierList: [], + orignSupplierList: [], // 物料类型列表 itemTypeOptions: [ { value: 'ItemType', label: '物料类型' }, @@ -638,7 +652,8 @@ const options = reactive({ { value: 'LocationCode', label: '库位' } ], //仓库列表 - warehouseList: [] + warehouseList: [], + originWarehouseList: [] }) // 弹窗按钮 const Butttondata = ref([ @@ -658,12 +673,24 @@ const buttonBaseClick = (val, item) => { } // 获取供应商列表 const getFormSupplierList = async () => { - options.supplierList = await getSupplierList() + options.orignSupplierList = await getSupplierList() + options.supplierList = [...options.orignSupplierList] } // 获取客户列表 const getFormCustomerList = async () => { options.supplierList = await getCustomerList() + options.supplierList = [...options.orignSupplierList] } +const filterMethod = (query: string) => { + if (query) { + options.supplierList = options.orignSupplierList.filter((item) => { + return item.name.includes(query) + }) + } else { + options.supplierList = [] + } +} + // 选择客户还是承运商 const changeSupplierCustomer = (e) => { formData.value.condition[0].Value = '' @@ -684,21 +711,42 @@ const changeCalculation = () => { } // 获取仓库列表 const getFormWarehouseList = async () => { - options.warehouseList = await getWarehouseList() + options.originWarehouseList = await getWarehouseList() + options.warehouseList = [...options.originWarehouseList] + } // 获取库区列表 const getFormAreaList = async () => { - options.warehouseList = await getAreaList() + options.originWarehouseList = await getAreaList() + options.warehouseList = [...options.originWarehouseList] } // 获取库位组列表 const getFormLocationgrouList = async () => { - options.warehouseList = await getLocationgroupList() + options.originWarehouseList = await getLocationgroupList() + options.warehouseList = [...options.originWarehouseList] } // 获取库位列表 const getFormLocationList = async () => { - options.warehouseList = await getLocationList() + const loading = ElLoading.service({ + lock: true, + text: t('ts.加载中'), + background: 'rgba(0, 0, 0, 0.7)', + }) + options.originWarehouseList = await getLocationList() + options.warehouseList = [...options.originWarehouseList] + nextTick(()=>{ + loading.close() + }) +} +const filterMethodWarehouseList = (query: string) => { + if (query) { + options.warehouseList = options.originWarehouseList.filter((item) => { + return item.code.includes(query) + }) + } else { + options.warehouseList = [] + } } -getFormLocationList() // 选择仓库/库位/库位组/库区 const changeWarehouse = (e) => { formData.value.configuration.WarehouseCode = '' @@ -717,11 +765,14 @@ const changeWarehouse = (e) => { } /** 打开弹窗 */ const open = async (type: string, strategyCode: string, id?: number) => { + formStrategyCode.value = strategyCode dialogVisible.value = true dialogTitle.value = t('action.' + type) formType.value = type warehouseType.value = 'WarehouseCode' + getFormWarehouseList() + resetForm() // 修改时,设置数据 if (id) { @@ -798,6 +849,8 @@ const open = async (type: string, strategyCode: string, id?: number) => { defaultButtons.formCloseBtn(null) // 关闭 ] } + + } defineExpose({ open }) // 提供 open 方法,用于打开弹窗