陈薪名 1 year ago
parent
commit
9b3d3098b5
  1. 523
      src/views/wms/strategy/downShelfStrategy/AddForm copy.vue
  2. 6
      src/views/wms/strategy/downShelfStrategy/AddForm.vue
  3. 2
      src/views/wms/strategy/downShelfStrategy/index.vue
  4. 2
      src/views/wms/strategy/purchaseReceiptStrategy/AddForm.vue
  5. 6
      src/views/wms/strategy/supplieDeliveryStrategy/AddForm.vue
  6. 2
      src/views/wms/strategy/upShelfStrategy/AddForm.vue
  7. 2
      src/views/wms/strategy/upShelfStrategy/index.vue
  8. 350
      src/views/wms/strategy/warehouseStorageStrategy/AddForm copy.vue
  9. 447
      src/views/wms/strategy/warehouseStorageStrategy/AddForm.vue
  10. 85
      src/views/wms/strategy/warehouseStorageStrategy/index.vue

523
src/views/wms/strategy/downShelfStrategy/AddForm copy.vue

@ -1,523 +0,0 @@
<!-- 下架策略弹窗 -->
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;">
<!-- 规则 -->
<div class="item">
<div class="title">规则</div>
<el-form ref="formRef1" :model="formData" :rules="rules" label-width="120px" label-position="left">
<el-row gutter="10">
<el-col :span="24">
<el-form-item label="代码" prop="code">
<el-input v-model="formData.code" placeholder="请输入代码" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="描述" prop="describe">
<el-input v-model="formData.describe" placeholder="请输入描述" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="优先级" prop="priority">
<el-input-number v-model="formData.priority" :min="1" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-switch v-model="formData.status" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 规则条件 -->
<div class="item mt-20px">
<div class="title">规则条件</div>
<el-form ref="formRef2" :model="formData" :rules="rules" label-width="120px" label-position="left">
<el-row gutter="10">
<!-- 选择供应商和客户 -->
<el-col :span="24">
<el-form-item label="" label-width="0" prop="supplier" class="err-240">
<el-select v-model="formData.type" placeholder="" style="width: 110px;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.typeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.supplierTypeRange" placeholder="请选择范围"
style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.supplier" placeholder="请选择供应商" style="flex: 1;" clearable>
<el-option v-for="item in options.supplierList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 选择物品类型 -->
<el-col :span="24">
<el-form-item label="" label-width="0" prop="item" class="err-240">
<el-select v-model="formData.itemType" placeholder="" style="width: 110px;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.itemTypeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.itemTypeRange" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.item" placeholder="请选择物品" style="flex: 1;" clearable>
<el-option v-for="item in options.itemList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 选择重量体积还是面积 -->
<el-col :span="24">
<el-form-item label="" label-width="0" prop="calculation" class="err-240">
<el-select v-model="formData.calculationType" placeholder="" style="width: 110px;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.calculationTypeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.calculationTypeRange" placeholder="请选择范围"
style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.calculation" placeholder="请选择物品" style="flex: 1;" clearable>
<el-option v-for="item in options.calculationList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 库存状态 -->
<el-col :span="24">
<el-form-item label="库存状态" prop="inventoryStatus" class="err-120">
<el-select v-model="formData.inventoryStatusRange" placeholder="请选择范围"
style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.inventoryStatus" placeholder="请选择库存状态" style="flex: 1;" clearable>
<el-option v-for="item in options.inventoryStatusList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 存储类型 -->
<el-col :span="24">
<el-form-item label="存储状态" prop="storageType" class="err-120">
<el-select v-model="formData.storageTypeRange" placeholder="请选择范围"
style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.storageType" placeholder="请选择存储状态" style="flex: 1;" clearable>
<el-option v-for="item in options.storageTypeList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 库存事务 -->
<el-col :span="24">
<el-form-item label="库存事务" prop="inventoryAffair" class="err-120">
<el-select v-model="formData.inventoryAffairRange" placeholder="请选择范围"
style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.inventoryAffair" placeholder="请选择库存事务" style="flex: 1;" clearable>
<el-option v-for="item in options.inventoryAffairList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 规则配置 -->
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-form ref="formRef3" :model="formData" :rules="rules" label-width="120px" label-position="left">
<el-row gutter="10">
<!-- 仓库 库区 库位组 库位 -->
<el-col :span="24">
<el-form-item label="" label-width="0" prop="warehouse" class="err-120">
<el-select v-model="formData.warehouseType" style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.warehouseTypeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.warehouse" placeholder="请选择库位" style="flex: 1;" clearable>
<el-option v-for="item in options.warehouseTypeList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 数量排序方向 -->
<el-col :span="24">
<el-form-item label="数量排序方向" class="flex-top" prop="quantitySort">
<div class="checkbox">
<el-radio-group v-model="formData.quantitySort">
<el-radio :label="item.value" v-for="item in options.sortOptions" :key="item.value">{{
item.label }}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 巷道排序方向 -->
<el-col :span="24">
<el-form-item label="巷道排序方向" class="flex-top" prop="roadwaySort">
<div class="checkbox">
<el-radio-group v-model="formData.roadwaySort">
<el-radio :label="item.value" v-for="item in options.sortOptions" :key="item.value">{{ item.label
}}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 货架排序方向 -->
<el-col :span="24">
<el-form-item label="货架排序方向" class="flex-top" prop="goodsDhelvesSort">
<div class="checkbox">
<el-radio-group v-model="formData.goodsDhelvesSort">
<el-radio :label="item.value" v-for="item in options.sortOptions" :key="item.value">{{ item.label
}}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 行排序方向 -->
<el-col :span="24">
<el-form-item label="行排序方向" class="flex-top" prop="rowSort">
<div class="checkbox">
<el-radio-group v-model="formData.rowSort">
<el-radio :label="item.value" v-for="item in options.sortOptions" :key="item.value">{{ item.label
}}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 列排序方向 -->
<el-col :span="24">
<el-form-item label="列排序方向" class="flex-top" prop="columnSort">
<div class="checkbox">
<el-radio-group v-model="formData.columnSort">
<el-radio :label="item.value" v-for="item in options.sortOptions" :key="item.value">{{ item.label
}}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 优先整包 -->
<el-col :span="24">
<el-form-item label="优先整包" prop="firstPackage">
<el-switch v-model="formData.firstPackage" />
</el-form-item>
</el-col>
<!-- 发料包装类型 -->
<el-col :span="24">
<el-form-item label="发料包装类型" class="flex-top" prop="packagingType">
<div class="checkbox">
<el-radio-group v-model="formData.packagingType">
<el-radio :label="item.value" v-for="item in options.packagingTypeOptions" :key="item.value">{{
item.label
}}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 多次发料 -->
<el-col :span="7">
<el-form-item label="多次发料" prop="manyTimesGoods">
<el-switch v-model="formData.manyTimesGoods" />
</el-form-item>
</el-col>
<!-- 拆分次数 -->
<el-col :span="8">
<el-form-item label="拆分次数" prop="splitsNumber" label-width="70px">
<el-input-number v-model="formData.splitsNumber" :min="0" controls-position="right" />
</el-form-item>
</el-col>
<!-- 时间间隔 -->
<el-col :span="9">
<el-form-item label="时间间隔" prop="timeInterval" label-width="70px">
<el-input-number v-model="formData.timeInterval" :min="0" style="flex:1;margin-right:10px" controls-position="right" />小时
</el-form-item>
</el-col>
<!-- 使用整理库位 -->
<el-col :span="24">
<el-form-item label="使用整理库位" prop="useArrangePlace">
<el-switch v-model="formData.useArrangePlace" />
</el-form-item>
</el-col>
<!-- 使用在途库位 -->
<el-col :span="24">
<el-form-item label="使用在途库位" prop="useWayPlace">
<el-switch v-model="formData.useWayPlace" />
</el-form-item>
</el-col>
<!-- 生成接收任务 -->
<el-col :span="24">
<el-form-item label="生成接收任务" prop="receiveTask">
<el-switch v-model="formData.receiveTask" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<template #footer>
<!-- 按钮-->
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'DownShelfStrategyAddForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formRef1 = ref() // Ref
const formRef2 = ref() // Ref
const formRef3 = ref() // Ref
// form
const formData = ref({
code: '',//
name: '',//
describe: '',//
priority: '',//
status: false,//
//
type: 1,//
supplierTypeRange: 1,//
supplier: '',//
//
itemType: 1,//
itemTypeRange: 1, //
item: '',//
//
calculationType: 1,//
calculationTypeRange: 1, //
calculation: '',//
//
inventoryStatusRange: 1, //
inventoryStatus: '',//
//
storageTypeRange: 1, //
storageType: '',//
//
inventoryAffairRange: 1, //
inventoryAffair: '',//
//
warehouseType: 1,/////
warehouse: '',/////
quantitySort: 1,//
roadwaySort: 1,//
goodsDhelvesSort: 1,//
rowSort: 1,//
columnSort: 1,//
firstPackage: false,//
packagingType: 1,//
manyTimesGoods: false,//
splitsNumber: 1,//
timeInterval: 1,//
useArrangePlace: false,//使
useWayPlace: false,//使
receiveTask: false,//
})
//
const rules = ref({
code: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
describe: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
supplier: [{ required: true, message: '请选择供应商', trigger: 'blur' }],
item: [{ required: true, message: '请选择物品', trigger: 'blur' }],
calculation: [{ required: true, message: '请选择', trigger: 'blur' }],
inventoryStatus: [{ required: true, message: '请选择库存状态', trigger: 'blur' }],
storageType: [{ required: true, message: '请选择存储类型', trigger: 'blur' }],
inventoryAffair: [{ required: true, message: '请选择库存事务', trigger: 'blur' }],
warehouse: [{ required: true, message: '请选择仓库', trigger: 'blur' }],
})
//
const options = reactive({
//
typeOptions: [{ value: 1, label: '供应商' }, { value: 2, label: '客户' }],
//
rangeOptions: [{ value: 1, label: '包含' }, { value: 2, label: '大于', }],
//
supplierList: [{ value: 1, label: '供应商1' }, { value: 2, label: '供应商2' }, { value: 3, label: '供应商3' }],
//
itemTypeOptions: [{ value: 1, label: '物品分类' }, { value: 2, label: '物品分组' }, { value: 3, label: '物品' }, { value: 4, label: '项目' }, { value: 5, label: 'ABC类' }],
//
itemList: [{ value: 1, label: '物品1' }, { value: 2, label: '物品2' }, { value: 3, label: '物品3' }],
//
calculationTypeOptions: [{ value: 1, label: '重量' }, { value: 2, label: '体积' }, { value: 3, label: '面积' }],
//
calculationList: [{ value: 1, label: '重量1' }, { value: 2, label: '重量2' }, { value: 3, label: '重量3' }],
//
inventoryStatusList: [{ value: 1, label: '库存状态1' }, { value: 2, label: '库存状态2' }, { value: 3, label: '库存状态3' }],
//
storageTypeList: [{ value: 1, label: '存储状态1' }, { value: 2, label: '存储状态2' }, { value: 3, label: '存储状态3' }],
//
inventoryAffairList: [{ value: 1, label: '库存事务1' }, { value: 2, label: '库存事务2' }, { value: 3, label: '库存事务3' }],
//
warehouseTypeOptions: [{ value: 1, label: '仓库' }, { value: 2, label: '库区' }, { value: 3, label: '库位组' }, { value: 4, label: '库位' }],
//
warehouseTypeList: [{ value: 1, label: '仓库1' }, { value: 2, label: '仓库2' }, { value: 3, label: '仓库3' }],
//
sortOptions: [{ value: 1, label: '从小到大' }, { value: 2, label: '从大到小' }],
//
packagingTypeOptions: [{ value: 1, label: '包装' }, { value: 2, label: '容器' }, { value: 3, label: '单件' }],
})
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef1 || !formRef2 || !formRef3) return
const valid2 = formRef2.value.validate()
const valid1 = formRef1.value.validate()
const valid3 = await formRef3.value.validate()
if (!valid1 || !valid2 || !valid3) return
//
formLoading.value = true
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
code: '',
name: '',
describe: '',
priority: '',
status: false,
//
type: 1,//
supplierTypeRange: 1,//
supplier: '',//
//
itemType: 1,//
itemTypeRange: 1, //
item: '',//
//
calculationType: 1,//
calculationTypeRange: 1, //
calculation: '',//
//
inventoryStatusRange: 1, //
inventoryStatus: '',//
//
storageTypeRange: 1, //
storageType: '',//
//
inventoryAffairRange: 1, //
inventoryAffair: '',//
//
warehouseType: 1,/////
warehouse: '',/////
quantitySort: 1,//
roadwaySort: 1,//
goodsDhelvesSort: 1,//
rowSort: 1,//
columnSort: 1,//
firstPackage: false,//
packagingType: 1,//
manyTimesGoods: false,//
splitsNumber: 1,//
timeInterval: 1,//
useArrangePlace: false,//使
useWayPlace: false,//使
receiveTask: false,//
}
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
submitForm()
}
//
else if (val == 'close') {
dialogVisible.value = false
}
}
</script>
<style scoped lang="scss">
.item {
border: 1px solid #dedede;
border-radius: 4px;
padding: 30px 30px 5px;
position: relative;
.title {
position: absolute;
background: white;
padding: 0px 10px;
position: absolute;
top: 0px;
height: 30px;
line-height: 30px;
margin-top: -15px;
}
}
.checkbox {
background: #f5f5f5;
flex: 1;
padding: 0px 15px;
border-radius: 2px;
}
::v-deep .flex-top .el-form-item__content {
align-items: flex-start !important;
}
::v-deep .err-240 .el-form-item__error {
padding-left: 240px !important;
}
::v-deep .err-120 .el-form-item__error {
padding-left: 120px !important;
}
</style>

6
src/views/wms/strategy/downShelfStrategy/AddForm.vue

@ -1,4 +1,4 @@
<!-- 架策略弹窗 --> <!-- 架策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;"> <div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;">
@ -146,7 +146,7 @@
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions" <el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions"
:key="index" /> :key="index" />
</el-select> </el-select>
<el-select v-model="item.Value" placeholder="请选择仓库" clearable style="flex: 1;"> <el-select v-model="item.Value" :placeholder="`请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" /> <el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -365,8 +365,8 @@ const options = reactive({
itemTypeOptions: [{ value: 'ItemType', label: '物品类型' }, { value: 'ItemGroup', label: '物品分组' }, { value: 'ItemCode', label: '物品' }, { value: 'Project', label: '项目' }, { value: 'AbcClass', label: 'ABC类' }], itemTypeOptions: [{ value: 'ItemType', label: '物品类型' }, { value: 'ItemGroup', label: '物品分组' }, { value: 'ItemCode', label: '物品' }, { value: 'Project', label: '项目' }, { value: 'AbcClass', label: 'ABC类' }],
// //
calculationTypeOptions: [{ value: 'Weight', label: '重量' }, { value: 'Volume', label: '体积' }, { value: 'Area', label: '面积' }], calculationTypeOptions: [{ value: 'Weight', label: '重量' }, { value: 'Volume', label: '体积' }, { value: 'Area', label: '面积' }],
warehouseTypeOptions: [{ value: 'WarehouseCode', label: '仓库' }, { value: 'AreaCode', label: '库区' }, { value: 'LocationGroupCode', label: '库位组' }, { value: 'LocationCode', label: '库位' }],
// //
warehouseTypeOptions: [{ value: 'WarehouseCode', label: '仓库' }, { value: 'AreaCode', label: '库区' }, { value: 'LocationGroupCode', label: '库位组' }, { value: 'LocationCode', label: '库位' }],
warehouseList: [], warehouseList: [],
// //
sortOptions: [{ value: 'ASC', label: '从小到大' }, { value: 'DESC', label: '从大到小' }], sortOptions: [{ value: 'ASC', label: '从小到大' }, { value: 'DESC', label: '从大到小' }],

2
src/views/wms/strategy/downShelfStrategy/index.vue

@ -1,5 +1,5 @@
<!-- 供应商送货策略 --> <!-- 下架策略 -->
<template> <template>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" /> <TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" />

2
src/views/wms/strategy/purchaseReceiptStrategy/AddForm.vue

@ -1,5 +1,5 @@
<!-- 供应商送货策略弹出层 --> <!-- 采购收货任务拆分策略弹出层 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;"> <div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;">

6
src/views/wms/strategy/supplieDeliveryStrategy/AddForm.vue

@ -107,10 +107,12 @@
<el-form-item v-else-if="item.ParamCode == 'WarehouseCode'" label="仓库" <el-form-item v-else-if="item.ParamCode == 'WarehouseCode'" label="仓库"
:prop="'configuration.' + index + '.Value'" :rules="{ :prop="'configuration.' + index + '.Value'" :rules="{
required: true, required: true,
message: '请选择仓库', message: `请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`,
trigger: 'change', trigger: 'change',
}"> }">
<el-select v-model="item.Value" placeholder="请选择仓库" clearable> <el-select v-model="item.Value"
:placeholder="`请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`"
clearable>
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" /> <el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>

2
src/views/wms/strategy/upShelfStrategy/AddForm.vue

@ -147,7 +147,7 @@
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions" <el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions"
:key="index" /> :key="index" />
</el-select> </el-select>
<el-select v-model="item.Value" placeholder="请选择仓库" clearable style="flex: 1;"> <el-select v-model="item.Value" :placeholder="`请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" /> <el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>

2
src/views/wms/strategy/upShelfStrategy/index.vue

@ -1,5 +1,5 @@
<!-- 供应商送货策略 --> <!-- 上架策略 -->
<template> <template>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" /> <TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" />

350
src/views/wms/strategy/warehouseStorageStrategy/AddForm copy.vue

@ -0,0 +1,350 @@
<!-- 库位存储策略弹窗 -->
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;">
<!-- 规则 -->
<div class="item">
<div class="title">规则</div>
<el-form ref="formRef1" :model="formData" :rules="rules" label-width="130px" label-position="left">
<el-row>
<el-col :span="24">
<el-form-item label="代码" prop="code">
<el-input v-model="formData.code" placeholder="请输入代码" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="描述" prop="describe">
<el-input v-model="formData.describe" placeholder="请输入描述" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="优先级" prop="priority">
<el-input-number v-model="formData.priority" :min="1" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-switch v-model="formData.status" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 规则条件 -->
<div class="item mt-20px">
<div class="title">规则条件</div>
<el-form ref="formRef2" :model="formData" :rules="rules" label-width="130px" label-position="left">
<el-row>
<!-- 仓库 库区 库位组 库位 -->
<el-col :span="24">
<el-form-item label="" label-width="0" prop="warehouse" class="err-260">
<el-select v-model="formData.warehouseType" style="width: 120px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.warehouseTypeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.warehouseTypeRange" placeholder="请选择范围"
style="width: 120px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.warehouse" placeholder="请选择库位" style="flex: 1;" clearable>
<el-option v-for="item in options.warehouseTypeList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 规则配置 -->
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-form ref="formRef3" :model="formData" :rules="rules" label-width="130px" label-position="left">
<el-row>
<!-- 默认库存状态 -->
<el-col :span="24">
<el-form-item label="默认库存状态" class="flex-top" prop="defaultInventoryStatus">
<div class="checkbox">
<el-radio-group v-model="formData.defaultInventoryStatus">
<el-radio :label="item.value" v-for="item in options.defaultInventoryStatusOptions"
:key="item.value">{{
item.label }}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 溢流库位 -->
<el-col :span="24">
<el-form-item label="溢流库位" prop="overflowWarehouse">
<el-select v-model="formData.overflowWarehouse" placeholder="请选择溢流库位" clearable>
<el-option v-for="item in options.overflowWarehouseList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 允许负库存 -->
<el-col :span="12">
<el-form-item label="允许负库存" prop="allowNegativeInventory">
<el-switch v-model="formData.allowNegativeInventory" />
</el-form-item>
</el-col>
<!-- 保留零库存 -->
<el-col :span="12">
<el-form-item label="保留零库存" prop="reserveZeroInventory">
<el-switch v-model="formData.reserveZeroInventory" />
</el-form-item>
</el-col>
<!-- 允许领料 -->
<el-col :span="12">
<el-form-item label="允许领料" prop="allowPicking">
<el-switch v-model="formData.allowPicking" />
</el-form-item>
</el-col>
<!-- 允许过量领料 -->
<el-col :span="12">
<el-form-item label="允许过量领料" prop="allowExcessPicking">
<el-switch v-model="formData.allowExcessPicking" />
</el-form-item>
</el-col>
<!-- 允许整包存储 -->
<el-col :span="12">
<el-form-item label="允许整包存储" prop="allowPackageStorage">
<el-switch v-model="formData.allowPackageStorage" />
</el-form-item>
</el-col>
<!-- 允许散量存储 -->
<el-col :span="12">
<el-form-item label="允许散量存储" prop="allowDispersionStorage">
<el-switch v-model="formData.allowDispersionStorage" />
</el-form-item>
</el-col>
<!-- 允许出库 -->
<el-col :span="12">
<el-form-item label="允许出库" prop="allowOutbound">
<el-switch v-model="formData.allowOutbound" />
</el-form-item>
</el-col>
<!-- 允许入库 -->
<el-col :span="12">
<el-form-item label="允许入库" prop="allowInbound">
<el-switch v-model="formData.allowInbound" />
</el-form-item>
</el-col>
<!-- 允许退货到供应商 -->
<el-col :span="12">
<el-form-item label="允许退货到供应商" prop="allowReturn">
<el-switch v-model="formData.allowReturn" />
</el-form-item>
</el-col>
<!-- 允许接收客户退货 -->
<el-col :span="12">
<el-form-item label="允许接收客户退货" prop="allowReceiveReturn">
<el-switch v-model="formData.allowReceiveReturn" />
</el-form-item>
</el-col>
<!-- 允许拆箱 -->
<el-col :span="12">
<el-form-item label="允许拆箱" prop="allowOpenBox">
<el-switch v-model="formData.allowUnpacking" />
</el-form-item>
</el-col>
<!-- 允许拆托 -->
<el-col :span="12">
<el-form-item label="允许拆托" prop="allowOpenHolder">
<el-switch v-model="formData.allowOpenHolder" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<template #footer>
<!-- 按钮-->
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'WarehouseStorageStrategyAddForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formRef1 = ref() // Ref
const formRef2 = ref() // Ref
const formRef3 = ref() // Ref
// form
const formData = ref({
code: '',//
name: '',//
describe: '',//
priority: '',//
status: false,//
//
warehouseType: 1,/////
warehouseTypeRange: 1,//
warehouse: '',/////
defaultInventoryStatus: 1,//
overflowWarehouse: '',//
allowNegativeInventory: false,//
reserveZeroInventory: false,//
allowPicking: false,//
allowExcessPicking: false,//
allowPackageStorage: false,//
allowDispersionStorage: false,//
allowOutbound: false,//
allowInbound: false,//
allowReturn: false,//退
allowReceiveReturn: false,//退
allowOpenBox: false,//
allowOpenHolder: false,//
})
//
const rules = ref({
code: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
describe: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
warehouse: [{ required: true, message: '请选择仓库', trigger: 'blur' }],
overflowWarehouse: [{ required: true, message: '请选择溢流库位', trigger: 'blur' }],
})
//
const options = reactive({
//
rangeOptions: [{ value: 1, label: '包含' }, { value: 2, label: '大于', }],
//
warehouseTypeOptions: [{ value: 1, label: '仓库' }, { value: 2, label: '库区' }, { value: 3, label: '库位组' }, { value: 4, label: '库位' }],
//
warehouseTypeList: [{ value: 1, label: '仓库1' }, { value: 2, label: '仓库2' }, { value: 3, label: '仓库3' }],
//
defaultInventoryStatusOptions: [{ value: 1, label: '合格' }, { value: 2, label: '待检' }, { value: 3, label: '不合格' }, { value: 4, label: '隔离' }, { value: 5, label: '报废' }],
//
overflowWarehouseList: [{ value: 1, label: '溢流库存1' }, { value: 2, label: '溢流库存2' }],
})
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef1 || !formRef2 || !formRef3) return
const valid2 = formRef2.value.validate()
const valid1 = formRef1.value.validate()
const valid3 = await formRef3.value.validate()
if (!valid1 || !valid2 || !valid3) return
//
formLoading.value = true
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
code: '',
name: '',
describe: '',
priority: '',
status: false,
//
warehouseType: 1,/////
warehouseTypeRange: 1,//
warehouse: '',/////
defaultInventoryStatus: 1,//
overflowWarehouse: '',//
allowNegativeInventory: false,//
reserveZeroInventory: false,//
allowPicking: false,//
allowExcessPicking: false,//
allowPackageStorage: false,//
allowDispersionStorage: false,//
allowOutbound: false,//
allowInbound: false,//
allowReturn: false,//退
allowReceiveReturn: false,//退
allowOpenBox: false,//
allowOpenHolder: false,//
}
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
submitForm()
}
//
else if (val == 'close') {
dialogVisible.value = false
}
}
</script>
<style scoped lang="scss">
.item {
border: 1px solid #dedede;
border-radius: 4px;
padding: 30px 30px 5px;
position: relative;
.title {
position: absolute;
background: white;
padding: 0px 10px;
position: absolute;
top: 0px;
height: 30px;
line-height: 30px;
margin-top: -15px;
}
}
.checkbox {
background: #f5f5f5;
flex: 1;
padding: 0px 15px;
border-radius: 2px;
}
::v-deep .flex-top .el-form-item__content {
align-items: flex-start !important;
}
::v-deep .err-260 .el-form-item__error {
padding-left: 260px !important;
}
::v-deep .err-130 .el-form-item__error {
padding-left: 130px !important;
}
</style>

447
src/views/wms/strategy/warehouseStorageStrategy/AddForm.vue

@ -1,15 +1,15 @@
<!-- 库位存储策略弹窗 --> <!-- 库位存储策略弹窗弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;"> <div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;">
<el-form ref="formRef" :model="formData" :rules="rules" label-width="130px" label-position="left">
<!-- 规则 --> <!-- 规则 -->
<div class="item"> <div class="item">
<div class="title">规则</div> <div class="title">规则</div>
<el-form ref="formRef1" :model="formData" :rules="rules" label-width="130px" label-position="left"> <el-row gutter="10">
<el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="代码" prop="code"> <el-form-item label="代码" prop="strategyCode">
<el-input v-model="formData.code" placeholder="请输入代码" clearable /> <el-input v-model="formData.strategyCode" placeholder="请输入代码" clearable disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -18,8 +18,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="描述" prop="describe"> <el-form-item label="描述" prop="description">
<el-input v-model="formData.describe" placeholder="请输入描述" clearable /> <el-input v-model="formData.description" placeholder="请输入描述" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -33,136 +33,105 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
<!-- 规则条件 --> <!-- 规则条件 -->
<div class="item mt-20px"> <div class="item mt-20px">
<div class="title">规则条件</div> <div class="title">规则条件</div>
<el-form ref="formRef2" :model="formData" :rules="rules" label-width="130px" label-position="left"> <el-row gutter="10">
<el-row> <el-col :span="24" v-for="(item, index) in formData.condition" :key="index">
<!-- 仓库 库区 库位组 库位 --> <!-- 仓库 库区 库位组 库位 -->
<el-col :span="24"> <el-form-item label="" label-width="0" class="err-130" v-if="index == 0">
<el-form-item label="" label-width="0" prop="warehouse" class="err-260"> <el-select v-model="item.ParamCode" placeholder="" style="width: 120px;margin-right: 10px;"
<el-select v-model="formData.warehouseType" style="width: 120px;;margin-right: 10px;"> @change="changeWarehouse">
<el-option :label="item.label" :value="item.value" v-for="item in options.warehouseTypeOptions" <el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions"
:key="item.value" /> :key="index" />
</el-select>
<el-select v-model="formData.warehouseTypeRange" placeholder="请选择范围"
style="width: 120px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select> </el-select>
<el-select v-model="formData.warehouse" placeholder="请选择库位" style="flex: 1;" clearable> <el-select v-model="item.Value" :placeholder="`请选择${item.ParamCode == 'WarehouseCode'?'仓库': item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`" clearable style="flex: 1;">
<el-option v-for="item in options.warehouseTypeList" :key="item.value" :label="item.label" <el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
:value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
<!-- 规则配置 --> <!-- 规则配置 -->
<div class="item mt-20px"> <div class="item mt-20px">
<div class="title">规则配置</div> <div class="title">规则配置</div>
<el-form ref="formRef3" :model="formData" :rules="rules" label-width="130px" label-position="left"> <el-row gutter="10">
<el-row> <el-col :span="index == 0 || index == 1 ? 24 : 12" v-for="(item, index) in formData.configuration"
:key="index">
<!-- 默认库存状态 --> <!-- 默认库存状态 -->
<el-col :span="24"> <el-form-item label="默认库存状态" class="flex-top" v-if="index == 0">
<el-form-item label="默认库存状态" class="flex-top" prop="defaultInventoryStatus">
<div class="checkbox"> <div class="checkbox">
<el-radio-group v-model="formData.defaultInventoryStatus"> <el-radio-group v-model="item.Value">
<el-radio :label="item.value" v-for="item in options.defaultInventoryStatusOptions" <el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.INVENTORY_STATUS)"
:key="item.value">{{ :key="cur.value">{{ cur.label }}</el-radio>
item.label }}</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
</el-form-item> </el-form-item>
</el-col>
<!-- 溢流库位 --> <!-- 溢流库位 -->
<el-col :span="24"> <el-form-item label="溢流库位" v-else-if="index == 1">
<el-form-item label="溢流库位" prop="overflowWarehouse"> <el-select v-model="item.Value" placeholder="请选择溢流库位" clearable>
<el-select v-model="formData.overflowWarehouse" placeholder="请选择溢流库位" clearable> <el-option v-for="cur in options.overflowWarehouseList" :key="cur.id" :label="cur.name"
<el-option v-for="item in options.overflowWarehouseList" :key="item.value" :label="item.label" :value="cur.id" />
:value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col>
<!-- 允许负库存 --> <!-- 允许负库存 -->
<el-col :span="12"> <el-form-item label="允许负库存" v-else-if="index == 2">
<el-form-item label="允许负库存" prop="allowNegativeInventory"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowNegativeInventory" />
</el-form-item> </el-form-item>
</el-col>
<!-- 保留零库存 --> <!-- 保留零库存 -->
<el-col :span="12"> <el-form-item label="保留零库存" v-else-if="index == 3">
<el-form-item label="保留零库存" prop="reserveZeroInventory"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.reserveZeroInventory" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许领料 --> <!-- 允许领料 -->
<el-col :span="12"> <el-form-item label="允许领料" v-else-if="index == 4">
<el-form-item label="允许领料" prop="allowPicking"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowPicking" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许过量领料 --> <!-- 允许过量领料 -->
<el-col :span="12"> <el-form-item label="允许过量领料" v-else-if="index == 5">
<el-form-item label="允许过量领料" prop="allowExcessPicking"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowExcessPicking" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许整包存储 --> <!-- 允许整包存储 -->
<el-col :span="12"> <el-form-item label="允许整包存储" v-else-if="index == 6">
<el-form-item label="允许整包存储" prop="allowPackageStorage"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowPackageStorage" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许散量存储 --> <!-- 允许散量存储 -->
<el-col :span="12"> <el-form-item label="允许散量存储" v-else-if="index == 7">
<el-form-item label="允许散量存储" prop="allowDispersionStorage"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowDispersionStorage" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许出库 --> <!-- 允许出库 -->
<el-col :span="12"> <el-form-item label="允许出库" v-else-if="index == 8">
<el-form-item label="允许出库" prop="allowOutbound"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowOutbound" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许入库 --> <!-- 允许入库 -->
<el-col :span="12"> <el-form-item label="允许入库" v-else-if="index == 9">
<el-form-item label="允许入库" prop="allowInbound"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowInbound" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许退货到供应商 --> <!-- 允许退货到供应商 -->
<el-col :span="12"> <el-form-item label="允许退货到供应商" v-else-if="index == 10">
<el-form-item label="允许退货到供应商" prop="allowReturn"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowReturn" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许接收客户退货 --> <!-- 允许接收客户退货 -->
<el-col :span="12"> <el-form-item label="允许接收客户退货" v-else-if="index == 11">
<el-form-item label="允许接收客户退货" prop="allowReceiveReturn"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowReceiveReturn" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许拆箱 --> <!-- 允许拆箱 -->
<el-col :span="12"> <el-form-item label="允许拆箱" v-else-if="index == 12">
<el-form-item label="允许拆箱" prop="allowOpenBox"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowUnpacking" />
</el-form-item> </el-form-item>
</el-col>
<!-- 允许拆托 --> <!-- 允许拆托 -->
<el-col :span="12"> <el-form-item label="允许拆托" v-else-if="index == 13">
<el-form-item label="允许拆托" prop="allowOpenHolder"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.allowOpenHolder" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
</el-form>
</div> </div>
<template #footer> <template #footer>
<!-- 按钮--> <!-- 按钮-->
@ -172,7 +141,15 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'WarehouseStorageStrategyAddForm' }) defineOptions({ name: 'UpShelfStrategyAddForm' })
import { getWarehouseList } from '@/api/wms/warehouse'
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 { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -181,69 +158,175 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formRef1 = ref() // Ref const formRef = ref() // Ref
const formRef2 = ref() // Ref
const formRef3 = ref() // Ref
const formStrategyCode = ref('')
// form // form
const formData = ref({ const formData = ref({
code: '',// id: '',
strategyCode: formStrategyCode.value,//id
name: '',// name: '',//
describe: '',// description: '',//
priority: '',// priority: '',//
status: false,// status: true,//
//
// condition: [
warehouseType: 1,///// //
warehouseTypeRange: 1,// { ParamCode: 'LocationCode', Value: "" },
warehouse: '',///// ],
configuration: [
//
{ ParamCode: 'DefaultInventoryStatus', Value: 'OK' },
//
{ ParamCode: 'OverflowLocationCode', Value: '' },
//
{ ParamCode: 'EnableNegative', Value: true },
//
{ ParamCode: 'EnableKeepZero', Value: true },
//
{ ParamCode: 'EnablePick', Value: true },
//
{ ParamCode: 'EnableOverPick', Value: true },
//
{ ParamCode: 'EnableWholeStore', Value: true },
//
{ ParamCode: 'EnableBreakStore', Value: true },
//
{ ParamCode: 'EnableShip', Value: true },
//
{ ParamCode: 'EnableReceive', Value: true },
// 退
{ ParamCode: 'EnableReturnToSupplier', Value: true },
// 退
{ ParamCode: 'EnableReturnFromCustomer', Value: true },
//
{ ParamCode: 'EnableSplitBox', Value: true },
//
{ ParamCode: 'EnableSplitPallet', Value: true },
]
defaultInventoryStatus: 1,//
overflowWarehouse: '',//
allowNegativeInventory: false,//
reserveZeroInventory: false,//
allowPicking: false,//
allowExcessPicking: false,//
allowPackageStorage: false,//
allowDispersionStorage: false,//
allowOutbound: false,//
allowInbound: false,//
allowReturn: false,//退
allowReceiveReturn: false,//退
allowOpenBox: false,//
allowOpenHolder: false,//
}) })
// //
const rules = ref({ const rules = ref({
code: [{ required: true, message: '请输入代码', trigger: 'blur' }], strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }], name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
describe: [{ required: true, message: '请输入描述', trigger: 'blur' }], description: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
warehouse: [{ required: true, message: '请选择仓库', trigger: 'blur' }],
overflowWarehouse: [{ required: true, message: '请选择溢流库位', trigger: 'blur' }],
}) })
//
const rangeOptions = [
{ value: '==', label: '等于' },
{ value: '!=', label: '不等于' },
{ value: '>', label: '大于' },
{ value: '<', label: '小于' },
{ value: '>=', label: '大于等于' },
{ value: '<=', label: '小于等于' },
{ value: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' },
]
const formatRangeOptions = (...rest) => {
//
let result = rangeOptions.filter(aItem => rest.some(bItem => aItem.value === bItem));
return result
}
// //
const options = reactive({ const options = reactive({
// //
rangeOptions: [{ value: 1, label: '包含' }, { value: 2, label: '大于', }], rangeOptions1: formatRangeOptions('IN', 'NOT IN'),
// rangeOptions2: formatRangeOptions('>', '<', '>=', '<='),
warehouseTypeOptions: [{ value: 1, label: '仓库' }, { value: 2, label: '库区' }, { value: 3, label: '库位组' }, { value: 4, label: '库位' }],
// //
warehouseTypeList: [{ value: 1, label: '仓库1' }, { value: 2, label: '仓库2' }, { value: 3, label: '仓库3' }], warehouseTypeOptions: [{ value: 'WarehouseCode', label: '仓库' }, { value: 'AreaCode', label: '库区' }, { value: 'LocationGroupCode', label: '库位组' }, { value: 'LocationCode', label: '库位' }],
// warehouseList: [],
defaultInventoryStatusOptions: [{ value: 1, label: '合格' }, { value: 2, label: '待检' }, { value: 3, label: '不合格' }, { value: 4, label: '隔离' }, { value: 5, label: '报废' }], //
// overflowWarehouseList: []
overflowWarehouseList: [{ value: 1, label: '溢流库存1' }, { value: 2, label: '溢流库存2' }],
}) })
//
const getFormWarehouseList = async () => {
options.warehouseList = await getWarehouseList();
}
//
const getFormAreaList = async () => {
options.warehouseList = await getAreaList();
}
//
const getFormLocationgrouList = async () => {
options.warehouseList = await getLocationgroupList();
}
//
const getFormLocationList = async (queryParms) => {
if (queryParms) {
options.overflowWarehouseList = await getLocationList(queryParms);
} else {
options.warehouseList = await getLocationList();
}
}
getFormLocationList()
//
const queryParms = {
type: 'OVERFLOW'
}
getFormLocationList(queryParms)
// ///
const changeWarehouse = (e) => {
formData.value.condition[0].Value = ''
if (e == 'WarehouseCode') {
getFormWarehouseList()
} else if (e == 'AreaCode') {
getFormAreaList()
} else if (e == 'LocationGroupCode') {
getFormLocationgrouList()
} else if (e == 'LocationCode') {
getFormLocationList()
}
}
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, strategyCode: string, id?: number) => {
formStrategyCode.value = strategyCode
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
if (id) {
formLoading.value = true
try {
let data = await RuleApi.getRule(id)
formData.value.id = data.id
formData.value.strategyCode = data.strategyCode
formData.value.name = data.name
formData.value.description = data.description
formData.value.priority = data.priority
formData.value.status = data.status == 0 ? true : false
if (data.condition) {
formData.value.condition = JSON.parse(data.condition)
}
if (data.configuration) {
formData.value.configuration = JSON.parse(data.configuration)
}
// ///
if (formData.value.configuration[0].ParamCode == 'WarehouseCode') {
getFormWarehouseList()
} else if (formData.value.configuration[0].ParamCode == 'AreaCode') {
getFormAreaList()
} else if (formData.value.configuration[0].ParamCode == 'LocationGroupCode') {
getFormLocationgrouList()
} else if (formData.value.configuration[0].ParamCode == 'LocationCode') {
getFormLocationList()
}
} finally {
formLoading.value = false
}
}
} }
defineExpose({ open }) // open defineExpose({ open }) // open
@ -251,44 +334,83 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
// //
if (!formRef1 || !formRef2 || !formRef3) return if (!formRef) return
const valid2 = formRef2.value.validate() const valid = await formRef.value.validate()
const valid1 = formRef1.value.validate() if (!valid) return
const valid3 = await formRef3.value.validate()
if (!valid1 || !valid2 || !valid3) return
// //
formLoading.value = true formLoading.value = true
try {
let data = {
id: formData.value.id,
strategyCode: formData.value.strategyCode,//
name: formData.value.name,//
description: formData.value.description,//
priority: formData.value.priority,//
status: formData.value.status ? 0 : 1,//
//
condition: JSON.stringify(formData.value.condition),
configuration: JSON.stringify(formData.value.configuration)
}
if (formType.value === 'create') {
await RuleApi.createRule(data)
message.success(t('common.createSuccess'))
} else {
await RuleApi.updateRule(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
} }
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
code: '', id: '',
name: '', strategyCode: formStrategyCode.value,//id
describe: '', name: '',//
priority: '', description: '',//
status: false, priority: '',//
status: true,//
// //
warehouseType: 1,///// condition: [
warehouseTypeRange: 1,// //
warehouse: '',///// { ParamCode: 'LocationCode', Value: "" },
],
defaultInventoryStatus: 1,// configuration: [
overflowWarehouse: '',// //
allowNegativeInventory: false,// { ParamCode: 'DefaultInventoryStatus', Value: 'OK' },
reserveZeroInventory: false,// //
allowPicking: false,// { ParamCode: 'OverflowLocationCode', Value: '' },
allowExcessPicking: false,// //
allowPackageStorage: false,// { ParamCode: 'EnableNegative', Value: true },
allowDispersionStorage: false,// //
allowOutbound: false,// { ParamCode: 'EnableKeepZero', Value: true },
allowInbound: false,// //
allowReturn: false,//退 { ParamCode: 'EnablePick', Value: true },
allowReceiveReturn: false,//退 //
allowOpenBox: false,// { ParamCode: 'EnableOverPick', Value: true },
allowOpenHolder: false,// //
{ ParamCode: 'EnableWholeStore', Value: true },
//
{ ParamCode: 'EnableBreakStore', Value: true },
//
{ ParamCode: 'EnableShip', Value: true },
//
{ ParamCode: 'EnableReceive', Value: true },
// 退
{ ParamCode: 'EnableReturnToSupplier', Value: true },
// 退
{ ParamCode: 'EnableReturnFromCustomer', Value: true },
//
{ ParamCode: 'EnableSplitBox', Value: true },
//
{ ParamCode: 'EnableSplitPallet', Value: true },
]
} }
} }
@ -340,11 +462,16 @@ const buttonBaseClick = (val, item) => {
align-items: flex-start !important; align-items: flex-start !important;
} }
::v-deep .err-260 .el-form-item__error { ::v-deep .err-240 .el-form-item__error {
padding-left: 260px !important; padding-left: 240px !important;
}
::v-deep .err-120 .el-form-item__error {
padding-left: 120px !important;
} }
::v-deep .err-130 .el-form-item__error { ::v-deep .err-130 .el-form-item__error {
padding-left: 130px !important; padding-left: 130px !important;
} }
</style> </style>

85
src/views/wms/strategy/warehouseStorageStrategy/index.vue

@ -1,28 +1,88 @@
<!-- 库位存储策略 -->
<!-- 上架策略 -->
<template> <template>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" /> <TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" />
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table-column align="center" label="策略代码" prop="strategyCode" />
<el-table-column align="center" label="策略名称" prop="name" show-overflow-tooltip />
<el-table-column align="center" label="策略描述" prop="description" />
<el-table-column align="center" label="优先级" prop="priority" />
<el-table-column align="center" label="状态" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="240">
<template #default="scope">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, scope.row)" />
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNo" :total="total"
@pagination="getList" />
</ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<AddForm ref="formRef" @success="getList" /> <AddForm ref="formRef" @success="getList" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { DICT_TYPE } from '@/utils/dict'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as RuleApi from '@/api/wms/rule'
import AddForm from './AddForm.vue' import AddForm from './AddForm.vue'
// import { dateFormatter } from '@/utils/formatTime'
defineOptions({ name: 'SupplieDeliveryStrategy' })
const { t } = useI18n() //
const message = useMessage() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
strategyCode: 'S011',
})
/** 查询字典类型列表 */
const getList = async () => {
loading.value = true
try {
const data = await RuleApi.getRulePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
defineOptions({ name: 'WarehouseStorageStrategy' })
// //
const formRef = ref() const formRef = ref()
const openForm = (type: string) => { const openForm = (type: string, strategyCode: string, id: number) => {
formRef.value.open(type) formRef.value.open(type, strategyCode, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await RuleApi.deleteRule(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch { }
} }
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn(null), //
defaultButtons.defaultExportBtn(null), //
// defaultButtons.defaultFilterBtn(), //
defaultButtons.defaultFreshBtn(null), //
] ]
@ -30,7 +90,7 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
openForm('create') openForm('create', queryParams.strategyCode)
} else if (val == 'import') { // } else if (val == 'import') { //
handleImport() handleImport()
} else if (val == 'export') { // } else if (val == 'export') { //
@ -52,10 +112,15 @@ const butttondata = [
// - // -
const buttonTableClick = (val, row) => { const buttonTableClick = (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
openForm('update', row.id) openForm('update', queryParams.strategyCode, row.id)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} }
} }
/** 初始化 **/
onMounted(() => {
getList()
})
</script> </script>

Loading…
Cancel
Save