-
+
{{ 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 方法,用于打开弹窗