Browse Source

下架策略:规则配置-4个多选

hella_online_20240815
wangyufei 1 month ago
parent
commit
1d80c177d3
  1. 139
      src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue

139
src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue

@ -310,7 +310,6 @@
v-model="warehouseType"
placeholder=""
style="width: 110px; margin-right: 10px"
@change="changeWarehouse"
>
<el-option
:label="cur.label"
@ -319,7 +318,45 @@
:key="'仓库'+cur.value"
/>
</el-select>
<el-select
<!-- 仓库 -->
<el-input style="flex:1" v-show="warehouseType == 'WarehouseCode'" placeholder="请选择仓库" v-model="formData.configuration.WarehouseCode">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库区 -->
<el-input style="flex:1" v-show="warehouseType == 'AreaCode'" placeholder="请选择库区" v-model="formData.configuration.AreaCode">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库位组 -->
<el-input style="flex:1" v-show="warehouseType == 'LocationGroupCode'" placeholder="请选择库位组" v-model="formData.configuration.LocationGroupCode">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- 库位 -->
<el-input style="flex:1" v-show="warehouseType == 'LocationCode'" placeholder="请选择库位" v-model="formData.configuration.LocationCode">
<template #suffix>
<el-button type="text" plain style="color:var(--el-button-text-color)" @click="searchWarehouse">
<Icon icon="ep:search" class="mr-5px" />
</el-button>
</template>
</el-input>
<!-- <el-select
v-model="formData.configuration.WarehouseCode"
v-if="warehouseType == 'WarehouseCode'"
placeholder="请选择仓库"
@ -387,7 +424,7 @@
:label="cur.code"
:value="cur.code"
/>
</el-select>
</el-select> -->
</el-form-item>
</el-col>
<!-- 数量排序方向 -->
@ -560,6 +597,10 @@
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
<SearchTable
ref="searchTableRef"
@searchTableSuccess="searchTableSuccess"
/>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -571,7 +612,15 @@ import { getAreaList } from '@/api/wms/areabasic'
import { getLocationgroupList } from '@/api/wms/locationgroup'
import { getLocationList } from '@/api/wms/location'
import * as RuleApi from '@/api/wms/rule'
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 LocationgroupApi from '@/api/wms/locationgroup'
import { Locationgroup } from '@/views/wms/basicDataManage/factoryModeling/locationgroup/locationgroup.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import { isString } from '@/utils/is'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
@ -836,7 +885,81 @@ const filterMethodWarehouseList = (query: string) => {
options.warehouseList = options.originWarehouseList
}
}
getFormWarehouseList()
const searchTableRef = ref()
const searchWarehouse = ()=>{
if(warehouseType.value == 'WarehouseCode'){
//
searchTableRef.value.open(
'请选择仓库',
Warehouse.allSchemas,
WarehouseApi.getWarehousePage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(warehouseType.value == 'AreaCode'){
searchTableRef.value.open(
'请选择库区',
Area.allSchemas,
AreaApi.getAreaPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(warehouseType.value == 'LocationGroupCode'){
searchTableRef.value.open(
'请选择库位组',
Locationgroup.allSchemas,
LocationgroupApi.getLocationgroupPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}else if(warehouseType.value == 'LocationCode'){
searchTableRef.value.open(
'请选择库位',
Location.allSchemas,
LocationApi.getLocationPage,
'WarehouseCode',
'code',
true,
undefined,
undefined,
undefined
)
}
}
const searchTableSuccess = (formField, searchField, val, type, row) => {
// let searchTableTitle = warehouseType.value == 'WarehouseCode'?'':warehouseType.value == 'AreaCode'?'':warehouseType.value == 'LocationGroupCode'?'':warehouseType.value == 'LocationCode'?'':''
console.log('searchTableSuccess',formField, searchField, val, type, row)
console.log(val.map(item=>(item['code'])).join(','))
formData.value.configuration[warehouseType.value] = val.map(item=>(item['code'])).join(',')
let fields = ['WarehouseCode','AreaCode','LocationGroupCode','LocationCode']
fields.forEach(item=>{
if(item!=warehouseType.value){
formData.value.configuration[item] = ''
}
})
}
// getFormWarehouseList()
// ///
const changeWarehouse = (e) => {
formData.value.configuration.WarehouseCode = ''
@ -906,25 +1029,25 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.configuration.WarehouseCode
) {
warehouseType.value = 'WarehouseCode'
getFormWarehouseList()
// getFormWarehouseList()
} else if (
'AreaCode' in formData.value.configuration &&
formData.value.configuration.AreaCode
) {
warehouseType.value = 'AreaCode'
getFormAreaList()
// getFormAreaList()
} else if (
'LocationGroupCode' in formData.value.configuration &&
formData.value.configuration.LocationGroupCode
) {
warehouseType.value = 'LocationGroupCode'
getFormLocationgrouList()
// getFormLocationgrouList()
} else if (
'LocationCode' in formData.value.configuration &&
formData.value.configuration.LocationCode
) {
warehouseType.value = 'LocationCode'
getFormLocationList()
// getFormLocationList()
}
} finally {
formLoading.value = false

Loading…
Cancel
Save