Browse Source

策略规则配置参数修改

master
zhang_li 1 year ago
parent
commit
61ee227554
  1. 12
      src/utils/disposition/defaultButtons.ts
  2. 197
      src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue
  3. 47
      src/views/wms/basicDataManage/strategySetting/strategy/batchStrategy/AddForm.vue
  4. 200
      src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue
  5. 349
      src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue
  6. 20
      src/views/wms/basicDataManage/strategySetting/strategy/manageAccuracyStrategy/AddForm.vue
  7. 210
      src/views/wms/basicDataManage/strategySetting/strategy/purchaseReceiptStrategy/AddForm.vue
  8. 148
      src/views/wms/basicDataManage/strategySetting/strategy/repairMaterialStrategy/AddForm.vue
  9. 351
      src/views/wms/basicDataManage/strategySetting/strategy/storageCapacityStrategy/AddForm.vue
  10. 89
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue
  11. 120
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue
  12. 18
      src/views/wms/basicDataManage/strategySetting/strategy/utensilCapacityStrategy/AddForm.vue
  13. 330
      src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue
  14. 7
      src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts
  15. 12
      src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/index.vue

12
src/utils/disposition/defaultButtons.ts

@ -614,6 +614,18 @@ export function mainListJobExeBtn(option:any) {
hasPermi: ''
})
}
// 主列表-打印
export function mainListPointBtn(option:any) {
return __defaultBtnOption(option,{
label: '单据打印',
name: 'point',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则
function __defaultBtnOption(option:any,specific:any){

197
src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue

@ -1,15 +1,26 @@
<!-- 到货验货任务拆分策略弹出层 -->
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px;">
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;">
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto">
<!-- 规则 -->
<el-form ref="formRef" :model="formData" :rules="rules" label-width="140px" label-position="left">
<el-form
ref="formRef"
:model="formData"
:rules="rules"
label-width="140px"
label-position="left"
>
<div class="item">
<div class="title">规则</div>
<el-row gutter="10">
<el-col :span="24">
<el-form-item label="代码" prop="strategyCode">
<el-input v-model="formData.strategyCode" placeholder="请输入代码" clearable disabled />
<el-input
v-model="formData.strategyCode"
placeholder="请输入代码"
clearable
disabled
/>
</el-form-item>
</el-col>
<el-col :span="24">
@ -40,25 +51,68 @@
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index">
<!-- 供应商类型 -->
<el-form-item v-if="item.ParamCode == 'SupplierType'" label="供应商类型" class="flex-top err-120">
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierTypeRangeOptions"
:key="cur.value" />
<el-form-item
v-if="item.ParamCode == 'SupplierType'"
label="供应商类型"
class="flex-top err-120"
>
<el-select
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.supplierTypeRangeOptions"
:key="cur.value"
/>
</el-select>
<el-select v-model="item.Value" placeholder="请选择供应商类型" style="flex: 1;" clearable
@change="changeSupplierType">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" />
<el-select
v-model="item.Value"
placeholder="请选择供应商类型"
style="flex: 1"
clearable
@change="changeSupplierType"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- 供应商 -->
<el-form-item v-else-if="item.ParamCode == 'SupplierCode'" label="供应商" class="err-120">
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierRangeOptions"
:key="cur.value" />
<el-form-item
v-else-if="item.ParamCode == 'SupplierCode'"
label="供应商"
class="err-120"
>
<el-select
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.supplierRangeOptions"
:key="cur.value"
/>
</el-select>
<el-select v-model="item.Value" placeholder="请选择供应商" style="flex: 1;" clearable>
<el-option v-for="cur in options.supplierList" :key="cur.id" :label="cur.name" :value="cur.id" />
<el-select
v-model="item.Value"
placeholder="请选择供应商"
style="flex: 1"
clearable
>
<el-option
v-for="cur in options.supplierList"
:key="cur.id"
:label="cur.name"
:value="cur.id"
/>
</el-select>
</el-form-item>
</el-col>
@ -68,14 +122,16 @@
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<el-col :span="24">
<!-- 按零件拆分 -->
<el-form-item v-if="item.ParamCode == 'ByItem'" label="按零件拆分">
<el-switch v-model="item.Value" />
<el-form-item label="按零件拆分">
<el-switch v-model="formData.configuration.ByItem" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 按批次拆分 -->
<el-form-item v-else-if="item.ParamCode == 'ByBatch'" label="按批次拆分">
<el-switch v-model="item.Value" />
</el-col>
<!-- 按批次拆分 -->
<el-col :span="24">
<el-form-item label="按批次拆分">
<el-switch v-model="formData.configuration.ByBatch" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
</el-row>
@ -95,8 +151,6 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { getSupplierList } from '@/api/wms/supplier'
import * as RuleApi from '@/api/wms/rule'
const { t } = useI18n() //
const message = useMessage() //
@ -110,24 +164,24 @@ const formStrategyCode = ref('')
// form
const formData = ref({
id: '',
strategyCode: formStrategyCode.value,//id
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //id
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
//
{ ParamCode: 'SupplierType', Operator: "==", Value: "" },
{ ParamCode: 'SupplierType', Operator: '==', Value: '' },
//
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'ByItem', Value: false },
ByItem: 'FALSE',
//
{ ParamCode: 'ByBatch', Value: false },
]
ByBatch: 'FALSE'
}
})
//
@ -149,25 +203,31 @@ const rangeOptions = [
{ value: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' },
{ value: 'NOT NULL', label: '不为空' }
]
const formatRangeOptions = (...rest) => {
//
let result = rangeOptions.filter(aItem => rest.some(bItem => aItem.value === bItem));
let result = rangeOptions.filter((aItem) => rest.some((bItem) => aItem.value === bItem))
return result
}
//
const options = reactive({
//
supplierTypeRangeOptions: formatRangeOptions('=='),
//
supplierTypeOptions: [{ value: 1, label: '标准' }, { value: 2, label: '委外' }, { value: 3, label: '其他' }],
supplierTypeOptions: [
{ value: 1, label: '标准' },
{ value: 2, label: '委外' },
{ value: 3, label: '其他' }
],
//
supplierRangeOptions: formatRangeOptions('IN', 'NOT IN'),
//
supplierList: [{ value: 1, label: '供应商1' }, { value: 2, label: '供应商2' }, { value: 3, label: '供应商3' }],
supplierList: [
{ value: 1, label: '供应商1' },
{ value: 2, label: '供应商2' },
{ value: 3, label: '供应商3' }
]
})
//
const querySupplierParams = ref({
@ -175,7 +235,7 @@ const querySupplierParams = ref({
})
//
const getFormSupplierList = async () => {
options.supplierList = await getSupplierList(querySupplierParams.value);
options.supplierList = await getSupplierList(querySupplierParams.value)
}
//
@ -185,7 +245,6 @@ const changeSupplierType = (e) => {
getFormSupplierList()
}
getFormSupplierList()
/** 打开弹窗 */
@ -215,7 +274,6 @@ const open = async (type: string, strategyCode: string, id?: number) => {
querySupplierParams.value.type = formData.value?.condition[0]?.Value || ''
getFormSupplierList()
} finally {
formLoading.value = false
}
@ -229,17 +287,25 @@ const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return;
if (!valid) return
let list = Object.values(formData.value.configuration)
let onlyOne = list.filter((item) => {
return item == 'TRUE'
})
if (onlyOne?.length != 1) {
message.error('只能选择一种拆分方式')
return
}
//
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,//
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)
@ -263,33 +329,33 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: '',
strategyCode: formStrategyCode.value,//
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
//
{ ParamCode: 'SupplierType', Operator: "==", Value: "" },
{ ParamCode: 'SupplierType', Operator: '==', Value: '' },
//
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" },
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'ByItem', Value: false },
ByItem: 'FALSE',
//
{ ParamCode: 'ByBatch', Value: false },
]
ByBatch: 'FALSE'
}
}
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
defaultButtons.formCloseBtn(null) //
]
//
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
@ -300,7 +366,6 @@ const buttonBaseClick = (val, item) => {
dialogVisible.value = false
}
}
</script>
<style scoped lang="scss">
.item {

47
src/views/wms/basicDataManage/strategySetting/strategy/batchStrategy/AddForm.vue

@ -91,14 +91,14 @@
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<el-col :span="24">
<!-- 存储类型 -->
<el-form-item label="" label-width="0" class="flex-top" prop="configurationRules">
<div style="width: 100%;display:flex;align-items:center;margin-bottom:10px"
v-for="(cur, key) in item.Value" :key="key">
v-for="(cur, key) in formData.configuration.ManagementPrecision" :key="key">
<div style="width: 26px;display: flex;">
<Icon icon="ep:remove" color="#757575" size="26" style="cursor: pointer;"
@click="handleDeleteTable(item.Value, cur, key)" v-if="item.Value?.length > 1" />
@click="handleDeleteTable(formData.configuration.ManagementPrecision, cur, key)" v-if="formData?.configuration?.ManagementPrecision?.length > 1" />
</div>
<div class="flex w-[28%]">
<div class="ml-10px mr-10px">批次类型</div>
@ -123,7 +123,7 @@
</div>
</div>
<div class="button flex">
<div @click="handleAddTable(item.Value)">
<div @click="handleAddTable(formData.configuration.ManagementPrecision)">
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer;" />
<div>添加条件</div>
</div>
@ -175,17 +175,14 @@ const formData = ref({
// ///abc//
{ ParamCode: 'ItemType', Operator: "IN", Value: "" },
],
configuration: [
configuration: {
//
{
ParamCode: 'ManagementPrecision', Value: [{
BatchType: 'ARRIVE_TIME',
BatchFormat: '',
BatchDirection: 'ASC',
}]
},
],
ManagementPrecision:[{
BatchType: 'ARRIVE_TIME',
BatchFormat: '',
BatchDirection: 'ASC',
}]
},
configurationRules: '1'//
})
@ -346,16 +343,14 @@ const resetForm = () => {
// ///abc//
{ ParamCode: 'ItemType', Operator: "IN", Value: "" },
],
configuration: [
configuration: {
//
{
ParamCode: 'ManagementPrecision', Value: [{
BatchType: 'ARRIVE_TIME',
BatchFormat: '',
BatchDirection: 'ASC',
}]
},
],
ManagementPrecision:[{
BatchType: 'ARRIVE_TIME',
BatchFormat: '',
BatchDirection: 'ASC',
}]
},
configurationRules: '1'//
}
}
@ -391,16 +386,14 @@ const handleDeleteTable = (item, cur, key) => {
//
const inputBlur = () => {
let arr = []
formData.value.configuration.forEach(item => {
formData.value.configuration.ManagementPrecision.forEach(item => {
let bol = false
item.Value.forEach(cur => {
if (!cur.BatchFormat) {
if (!item.BatchFormat) {
bol = false
} else {
bol = true
}
arr.push(bol)
})
})
const isEmpty = arr.some(cur => {
return !cur

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

@ -138,101 +138,135 @@
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-row gutter="10">
<el-col :span="index == 8 ? 7: index == 9 ? 8 : index == 10 ? 9 : 24" v-for="(item, index) in formData.configuration" :key="index">
<!-- 仓库 库区 库位组 库位 -->
<el-form-item label="" label-width="0" prop="warehouse" class="err-120" v-if="index == 0">
<el-select v-model="item.ParamCode" placeholder="" style="width: 110px;margin-right: 10px;"
<el-col :span="24">
<el-form-item label="" label-width="0" prop="warehouse" class="err-120">
<el-select v-model="warehouseType" placeholder="" style="width: 110px;margin-right: 10px;"
@change="changeWarehouse">
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions"
:key="index" />
</el-select>
<el-select v-model="item.Value" :placeholder="`请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`" clearable style="flex: 1;">
<el-select v-model="formData.configuration.WarehouseCode" v-if="warehouseType == 'WarehouseCode'" placeholder="请选择仓库" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
<el-select v-model="formData.configuration.AreaCode" v-if="warehouseType == 'AreaCode'" placeholder="请选择库区" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
<el-select v-model="formData.configuration.LocationGroupCode" v-if="warehouseType == 'LocationGroupCode'" placeholder="请选择库位组" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
<el-select v-model="formData.configuration.LocationCode" v-if="warehouseType == 'LocationCode'" placeholder="请选择库位" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
</el-form-item>
</el-col>
<!-- 数量排序方向 -->
<el-form-item label="数量排序方向" class="flex-top" v-else-if="index == 1">
<el-col :span="24">
<el-form-item label="数量排序方向" class="flex-top">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio-group v-model="formData.configuration.QtyOrder">
<el-radio :label="cur.value" v-for="cur in options.sortOptions" :key="cur.value">{{
cur.label }}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 巷道排序方向 -->
<el-form-item label="巷道排序方向" class="flex-top" v-else-if="index == 2">
<el-col :span="24">
<el-form-item label="巷道排序方向" class="flex-top">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio-group v-model="formData.configuration.AisleOrder">
<el-radio :label="cur.value" v-for="cur in options.sortOptions" :key="cur.value">{{
cur.label }}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 货架排序方向 -->
<el-form-item label="货架排序方向" class="flex-top" v-else-if="index == 3">
<el-col :span="24">
<el-form-item label="货架排序方向" class="flex-top">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio-group v-model="formData.configuration.ShelfOrder">
<el-radio :label="cur.value" v-for="cur in options.sortOptions" :key="cur.value">{{
cur.label }}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 行排序方向 -->
<el-form-item label="行排序方向" class="flex-top" v-else-if="index == 4">
<el-col :span="24">
<el-form-item label="行排序方向" class="flex-top">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio-group v-model="formData.configuration.RowOrder">
<el-radio :label="cur.value" v-for="cur in options.sortOptions" :key="cur.value">{{
cur.label }}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 列排序方向 -->
<el-form-item label="列排序方向" class="flex-top" v-else-if="index == 5">
<el-col :span="24">
<el-form-item label="列排序方向" class="flex-top">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio-group v-model="formData.configuration.ColumOrder">
<el-radio :label="cur.value" v-for="cur in options.sortOptions" :key="cur.value">{{
cur.label }}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 优先整包 -->
<el-form-item label="优先整包" v-else-if="index == 6">
<el-switch v-model="item.Value" />
<el-col :span="24">
<el-form-item label="优先整包">
<el-switch v-model="formData.configuration.EntirePackageFirst" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 发料包装类型 -->
<el-form-item label="发料包装类型" v-else-if="index == 7">
<el-col :span="24">
<el-form-item label="发料包装类型">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio-group v-model="formData.configuration.IssueStorageType">
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.STORAGE_TYPE)"
:key="cur.value">{{ cur.label }}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 多次发料 -->
<el-form-item label="多次发料" v-else-if="index == 8">
<el-switch v-model="item.Value" />
<el-col :span="7">
<el-form-item label="多次发料">
<el-switch v-model="formData.configuration.IsSplit" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 拆分次数 -->
<el-form-item label="拆分次数" label-width="70px" v-else-if="index == 9">
<el-input-number v-model="item.Value" :min="0" controls-position="right" />
<el-col :span="8">
<el-form-item label="拆分次数" label-width="70px">
<el-input-number v-model="formData.configuration.EachTimeQty" :min="0" controls-position="right" />
</el-form-item>
</el-col>
<!-- 时间间隔 -->
<el-form-item label="时间间隔" label-width="70px" v-else-if="index == 10">
<el-input-number v-model="item.Value" :min="0" style="flex:1;margin-right:10px"
<el-col :span="9">
<el-form-item label="时间间隔" label-width="70px" >
<el-input-number v-model="formData.configuration.TimeInterval" :min="0" style="flex:1;margin-right:10px"
controls-position="right" />小时
</el-form-item>
</el-col>
<!-- 使用整理库位-->
<el-form-item label="使用整理库位" v-else-if="index == 11">
<el-switch v-model="item.Value" />
<el-col :span="24">
<el-form-item label="使用整理库位">
<el-switch v-model="formData.configuration.UseOrganizeLocation" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 使用在途库位 -->
<el-form-item label="使用在途库位" v-else-if="index == 12">
<el-switch v-model="item.Value" />
<el-col :span="24">
<el-form-item label="使用在途库位" >
<el-switch v-model="formData.configuration.UseTransportLocation" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 生成接收任务 -->
<el-form-item label="生成接收任务" v-else-if="index == 13">
<el-switch v-model="item.Value" />
<el-col :span="24">
<el-form-item label="生成接收任务" >
<el-switch v-model="formData.configuration.CreateReceiptJob" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
</el-row>
@ -270,6 +304,9 @@ const formRef = ref() // 表单 Ref
const formStrategyCode = ref('')
//
const warehouseType = ref('WarehouseCode')
// form
const formData = ref({
id: '',
@ -293,37 +330,42 @@ const formData = ref({
//
{ ParamCode: 'TransactionType', Operator: "IN", Value: [] }
],
configuration: [
//
{ ParamCode: 'LocationCode', Value: "" },
configuration: {
//
WarehouseCode:"",
//
AreaCode:"",
//
LocationGroupCode:"",
//
LocationCode:"",
//
{ ParamCode: 'QtyOrder', Value: 'ASC' },
QtyOrder:"ASC",
//
{ ParamCode: 'AisleOrder', Value: 'ASC' },
AisleOrder:"ASC",
//
{ ParamCode: 'ShelfOrder', Value: 'ASC' },
ShelfOrder:"ASC",
//
{ ParamCode: 'RowOrder', Value: 'ASC' },
RowOrder:"ASC",
//
{ ParamCode: 'ColumOrder', Value: 'ASC' },
ColumOrder:"ASC",
//
{ ParamCode: 'EntirePackageFirst', Value: false },
EntirePackageFirst:'FALSE',
//
{ ParamCode: 'IssueStorageType', Value: 'SINGLE' },
IssueStorageType:"SINGLE",
//
{ ParamCode: 'IsSplit', Value: '' },
IsSplit:"",
//
{ ParamCode: 'EachTimeQty', Value: '' },
EachTimeQty:"",
//
{ ParamCode: 'TimeInterval', Value: '' },
TimeInterval:"",
// 使
{ ParamCode: 'UseOrganizeLocation', Value: false },
UseOrganizeLocation:'FALSE',
// 使
{ ParamCode: 'UseTransportLocation', Value: false },
UseTransportLocation:'FALSE',
//
{ ParamCode: 'CreateReceiptJob', Value: false },
]
CreateReceiptJob:'FALSE',
}
})
//
const rules = ref({
@ -417,7 +459,10 @@ const getFormLocationList = async () => {
getFormLocationList()
// ///
const changeWarehouse = (e) => {
formData.value.configuration[0].Value = ''
formData.value.configuration.WarehouseCode = ''
formData.value.configuration.AreaCode = ''
formData.value.configuration.LocationGroupCode = ''
formData.value.configuration.LocationCode = ''
if (e == 'WarehouseCode') {
getFormWarehouseList()
} else if (e == 'AreaCode') {
@ -434,6 +479,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
warehouseType.value = 'WarehouseCode'
resetForm()
//
if (id) {
@ -459,13 +505,17 @@ const open = async (type: string, strategyCode: string, id?: number) => {
getFormCustomerList()
}
// ///
if (formData.value.configuration[0].ParamCode == 'WarehouseCode') {
if ('WarehouseCode' in formData.value.configuration && formData.value.configuration.WarehouseCode) {
warehouseType.value = 'WarehouseCode'
getFormWarehouseList()
} else if (formData.value.configuration[0].ParamCode == 'AreaCode') {
} else if ('AreaCode' in formData.value.configuration && formData.value.configuration.AreaCode) {
warehouseType.value = 'AreaCode'
getFormAreaList()
} else if (formData.value.configuration[0].ParamCode == 'LocationGroupCode') {
} else if ('LocationGroupCode' in formData.value.configuration && formData.value.configuration.LocationGroupCode) {
warehouseType.value = 'LocationGroupCode'
getFormLocationgrouList()
} else if (formData.value.configuration[0].ParamCode == 'LocationCode') {
} else if ('LocationCode' in formData.value.configuration && formData.value.configuration.LocationCode) {
warehouseType.value = 'LocationCode'
getFormLocationList()
}
} finally {
@ -536,36 +586,42 @@ const resetForm = () => {
{ ParamCode: 'TransactionType', Operator: "IN", Value: [] }
],
configuration: [
//
{ ParamCode: 'LocationCode', Value: "" },
configuration: {
//
WarehouseCode:"",
//
AreaCode:"",
//
LocationGroupCode:"",
//
LocationCode:"",
//
{ ParamCode: 'QtyOrder', Value: 'ASC' },
QtyOrder:"ASC",
//
{ ParamCode: 'AisleOrder', Value: 'ASC' },
AisleOrder:"ASC",
//
{ ParamCode: 'ShelfOrder', Value: 'ASC' },
ShelfOrder:"ASC",
//
{ ParamCode: 'RowOrder', Value: 'ASC' },
RowOrder:"ASC",
//
{ ParamCode: 'ColumOrder', Value: 'ASC' },
ColumOrder:"ASC",
//
{ ParamCode: 'EntirePackageFirst', Value: false },
EntirePackageFirst:'FALSE',
//
{ ParamCode: 'IssueStorageType', Value: 'SINGLE' },
IssueStorageType:"SINGLE",
//
{ ParamCode: 'IsSplit', Value: '' },
IsSplit:"",
//
{ ParamCode: 'EachTimeQty', Value: '' },
EachTimeQty:"",
//
{ ParamCode: 'TimeInterval', Value: '' },
TimeInterval:"",
// 使
{ ParamCode: 'UseOrganizeLocation', Value: false },
UseOrganizeLocation:'FALSE',
// 使
{ ParamCode: 'UseTransportLocation', Value: false },
UseTransportLocation:'FALSE',
//
{ ParamCode: 'CreateReceiptJob', Value: false },
]
CreateReceiptJob:'FALSE',
}
}
}

349
src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue

@ -1,16 +1,27 @@
<!-- 检验策略弹窗 -->
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 800px;">
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;">
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px" label-position="left">
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 800px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto">
<el-form
ref="formRef"
:model="formData"
:rules="rules"
label-width="120px"
label-position="left"
>
<!-- 规则 -->
<div class="item">
<div class="title">规则</div>
<el-row>
<el-col :span="24">
<el-form-item label="代码" prop="strategyCode">
<el-input v-model="formData.strategyCode" placeholder="请输入代码" clearable disabled />
<el-input
v-model="formData.strategyCode"
placeholder="请输入代码"
clearable
disabled
/>
</el-form-item>
</el-col>
<el-col :span="24">
@ -42,38 +53,86 @@
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index">
<!-- 供应商类型 -->
<el-form-item v-if="index == 0" label="供应商类型" class="flex-top err-120">
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierTypeRangeOptions"
:key="cur.value" />
<el-select
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.supplierTypeRangeOptions"
:key="cur.value"
/>
</el-select>
<el-select v-model="item.Value" placeholder="请选择供应商类型" style="flex: 1;" clearable
@change="changeSupplierType">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" />
<el-select
v-model="item.Value"
placeholder="请选择供应商类型"
style="flex: 1"
clearable
@change="changeSupplierType"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- 供应商 -->
<el-form-item v-else-if="index == 1" label="供应商" class="err-120" :prop="'condition.' + index + '.Value'"
<el-form-item
v-else-if="index == 1"
label="供应商"
class="err-120"
:prop="'condition.' + index + '.Value'"
:rules="{
required: true,
message: '请选择供应商',
trigger: 'change',
}">
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierRangeOptions"
:key="cur.value" />
trigger: 'change'
}"
>
<el-select
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.supplierRangeOptions"
:key="cur.value"
/>
</el-select>
<el-select v-model="item.Value" placeholder="请选择供应商" style="flex: 1;" clearable>
<el-option v-for="cur in options.supplierList" :key="cur.id" :label="cur.name" :value="cur.id" />
<el-select
v-model="item.Value"
placeholder="请选择供应商"
style="flex: 1"
clearable
>
<el-option
v-for="cur in options.supplierList"
:key="cur.id"
:label="cur.name"
:value="cur.id"
/>
</el-select>
</el-form-item>
<!-- 物品 -->
<el-form-item v-else-if="index == 2" label="物品" class="flex-top err-120">
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.ItemCodeRangeOptions"
:key="cur.value" />
<el-select
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.ItemCodeRangeOptions"
:key="cur.value"
/>
</el-select>
<el-input v-model="item.Value" placeholder="请输入物品" clearable style="flex: 1;" />
<el-input v-model="item.Value" placeholder="请输入物品" clearable style="flex: 1" />
</el-form-item>
</el-col>
</el-row>
@ -83,46 +142,88 @@
<div class="title">规则配置</div>
<el-row>
<!-- 开始时间 -->
<el-col :span="24" 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">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.INSPECT_TYPE)"
:key="cur.value">{{ cur.label }}</el-radio>
<el-radio-group v-model="formData.configuration.InspectType">
<el-radio
:label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.INSPECT_TYPE)"
:key="cur.value"
>{{ cur.label }}</el-radio
>
</el-radio-group>
</div>
</el-form-item>
<!-- 抽检方式 -->
<el-form-item label="抽检方式" class="flex-top" v-if="index == 1">
</el-col>
<!-- 抽检方式 -->
<el-col :span="24">
<el-form-item label="抽检方式" class="flex-top">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.SAMPLE_METHOD)" @change="changeSampleMethod"
:key="cur.value">{{ cur.label }}</el-radio>
<el-radio-group v-model="formData.configuration.SampleMethod">
<el-radio
:label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.SAMPLE_METHOD)"
@change="changeSampleMethod"
:key="cur.value"
>{{ cur.label }}</el-radio
>
</el-radio-group>
</div>
</el-form-item>
<!-- 抽检规则 -->
<el-form-item label="抽检规则" class="flex-top" v-if="index == 2" prop="configurationRules">
<div style="flex:1;display:flex;align-items:center;margin-bottom:10px" v-for="(cur, key) in item.Value"
:key="key">
<div style="width: 26px;display: flex;">
<Icon icon="ep:remove" color="#757575" size="26" style="cursor: pointer;"
@click="handleDeleteTable(item.Value,cur, key)" v-if="item.Value?.length > 1" />
</el-col>
<!-- 抽检规则 -->
<el-col :span="24">
<el-form-item label="抽检规则" class="flex-top" prop="configurationRules">
<div
style="flex: 1; display: flex; align-items: center; margin-bottom: 10px"
v-for="(cur, key) in formData.configuration.AqlList"
:key="key"
>
<div style="width: 26px; display: flex">
<Icon
icon="ep:remove"
color="#757575"
size="26"
style="cursor: pointer"
@click="handleDeleteTable(formData.configuration.AqlList, cur, key)"
v-if="formData.configuration.AqlList?.length > 1"
/>
</div>
<el-input-number v-model="cur.FloorQty" :min="1" :max="cur.CeilingQty - 1" class='ml-20px mr-20px'
style="width:100px" controls-position="right" @blur="inputNumberBlur" />
<el-input-number
v-model="cur.FloorQty"
:min="1"
:max="cur.CeilingQty - 1"
class="ml-20px mr-20px"
style="width: 100px"
controls-position="right"
@blur="inputNumberBlur"
/>
<div></div>
<el-input-number v-model="cur.CeilingQty" :min="cur.FloorQty + 1" class='ml-20px mr-20px' style="width:100px"
controls-position="right" @blur="inputNumberBlur" />
<el-input-number
v-model="cur.CeilingQty"
:min="cur.FloorQty + 1"
class="ml-20px mr-20px"
style="width: 100px"
controls-position="right"
@blur="inputNumberBlur"
/>
<div>抽样数</div>
<el-input-number v-model="cur.SampleValue" :min="1" :max="formData.configuration[1].Value == 'QTY'?Infinity:100" class='ml-20px mr-20px' style="width:100px"
controls-position="right" @blur="inputNumberBlur" />
<div>{{formData.configuration[1].Value == 'QTY'?'EA':'%'}}</div>
<el-input-number
v-model="cur.SampleValue"
:min="1"
:max="formData.configuration.SampleMethod == 'QTY' ? Infinity : 100"
class="ml-20px mr-20px"
style="width: 100px"
controls-position="right"
@blur="inputNumberBlur"
/>
<div>{{ formData.configuration.SampleMethod == 'QTY' ? 'EA' : '%' }}</div>
</div>
<div class="button flex">
<div @click="handleAddTable(item.Value)">
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer;" />
<div @click="handleAddTable(formData.configuration.AqlList)">
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer" />
<div>添加条件</div>
</div>
</div>
@ -145,8 +246,6 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { getSupplierList } from '@/api/wms/supplier'
import * as RuleApi from '@/api/wms/rule'
const { t } = useI18n() //
const message = useMessage() //
@ -160,35 +259,35 @@ const formStrategyCode = ref('')
// form
const formData = ref({
id: '',
strategyCode: formStrategyCode.value,//id
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //id
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
//
{ ParamCode: 'SupplierType', Operator: "==", Value: "" },
{ ParamCode: 'SupplierType', Operator: '==', Value: '' },
//
{ ParamCode: 'SupplierCode', Operator: "==", Value: "" },
{ ParamCode: 'SupplierCode', Operator: '==', Value: '' },
//
{ ParamCode: 'ItemCode', Operator: "IN", Value: [] }
{ ParamCode: 'ItemCode', Operator: 'IN', Value: [] }
],
configuration: [
configuration: {
//
{ ParamCode: 'InspectType', Value: "EXAMPT" },
InspectType: 'EXEMPT',
//
{ ParamCode: 'SampleMethod', Value: "QTY" },
SampleMethod: 'QTY',
//
{
ParamCode: 'AqlList', Value: [{
AqlList: [
{
FloorQty: 1,
CeilingQty:2,
SampleValue: 1,
}]
}
],
configurationRules: '1'//
CeilingQty: 2,
SampleValue: 1
}
]
},
configurationRules: '1' //
})
//
@ -197,7 +296,7 @@ const rules = ref({
name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
configurationRules: [{ required: true, message: '抽奖规则请填写完全', trigger: 'blur' }],
configurationRules: [{ required: true, message: '抽奖规则请填写完全', trigger: 'blur' }]
})
//
@ -211,11 +310,11 @@ const rangeOptions = [
{ value: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' },
{ value: 'NOT NULL', label: '不为空' }
]
const formatRangeOptions = (...rest) => {
//
let result = rangeOptions.filter(aItem => rest.some(bItem => aItem.value === bItem));
let result = rangeOptions.filter((aItem) => rest.some((bItem) => aItem.value === bItem))
return result
}
//
@ -229,7 +328,7 @@ const options = reactive({
//
supplierList: [],
//
ItemCodeRangeOptions: formatRangeOptions('IN', 'NOT IN'),
ItemCodeRangeOptions: formatRangeOptions('IN', 'NOT IN')
})
//
const querySupplierParams = ref({
@ -237,7 +336,7 @@ const querySupplierParams = ref({
})
//
const getFormSupplierList = async () => {
options.supplierList = await getSupplierList(querySupplierParams.value);
options.supplierList = await getSupplierList(querySupplierParams.value)
}
//
@ -249,18 +348,15 @@ const changeSupplierType = (e) => {
getFormSupplierList()
//
function changeSampleMethod(e){
console.log(e);
if(e == 'PERCENT'){
console.log(formData.value.configuration[2].Value)
formData.value.configuration[2].Value.forEach(cur=>{
if(cur.SampleValue>100){
cur.SampleValue=100
function changeSampleMethod(e) {
console.log(e)
if (e == 'PERCENT') {
formData.value.configuration.AqlList.forEach((cur) => {
if (cur.SampleValue > 100) {
cur.SampleValue = 100
}
})
}
}
/** 打开弹窗 */
const open = async (type: string, strategyCode: string, id?: number) => {
@ -289,7 +385,6 @@ const open = async (type: string, strategyCode: string, id?: number) => {
querySupplierParams.value.type = formData.value?.condition[0]?.Value || ''
getFormSupplierList()
} finally {
formLoading.value = false
}
@ -310,11 +405,11 @@ const submitForm = async () => {
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,//
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)
@ -338,44 +433,44 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: '',
strategyCode: formStrategyCode.value,//
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
//
{ ParamCode: 'SupplierType', Operator: "==", Value: "" },
{ ParamCode: 'SupplierType', Operator: '==', Value: '' },
//
{ ParamCode: 'SupplierCode', Operator: "==", Value: "" },
{ ParamCode: 'SupplierCode', Operator: '==', Value: '' },
//
{ ParamCode: 'ItemCode', Operator: "IN", Value: [] }
{ ParamCode: 'ItemCode', Operator: 'IN', Value: [] }
],
configuration: [
configuration: {
//
{ ParamCode: 'InspectType', Value: "EXEMPT" },
InspectType: 'EXEMPT',
//
{ ParamCode: 'SampleMethod', Value: "QTY" },
SampleMethod: 'QTY',
//
{
ParamCode: 'AqlList', Value: [{
FloorQty: 1,
AqlList: [
{
FloorQty: 1,
CeilingQty: 2,
SampleValue: 1,
}]
},
],
configurationRules: '1'//
SampleValue: 1
}
]
},
configurationRules: '1' //
}
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
defaultButtons.formCloseBtn(null) //
]
//
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
@ -392,41 +487,35 @@ const handleAddTable = (item) => {
item.push({
FloorQty: 1,
CeilingQty: 2,
SampleValue: 1,
SampleValue: 1
})
}
//
const handleDeleteTable = (item,cur, key) => {
const handleDeleteTable = (item, cur, key) => {
item.splice(key, 1)
}
//
const inputNumberBlur=()=>{
const inputNumberBlur = () => {
let arr = []
formData.value.configuration.forEach(item => {
formData.value.configuration.AqlList.forEach((item) => {
let bol = false
if(item.ParamCode == 'AqlList'){
item.Value.forEach(cur => {
if (!cur.FloorQty|| !cur.CeilingQty || !cur.SampleValue) {
bol = false
} else {
bol = true
}
arr.push(bol)
})
if (!item.FloorQty || !item.CeilingQty || !item.SampleValue) {
bol = false
} else {
bol = true
}
arr.push(bol)
})
const isEmpty = arr.some(cur => {
const isEmpty = arr.some((cur) => {
return !cur
})
if (isEmpty) {
formData.value.configurationRules = ''
return;
return
} else {
formData.value.configurationRules = '1'
}
}
</script>
<style scoped lang="scss">
.item {
@ -462,13 +551,13 @@ const inputNumberBlur=()=>{
padding-left: 120px !important;
}
.button {
>div {
> div {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
>div {
> div {
margin-left: 6px;
text-decoration: underline;
color: #409eff;

20
src/views/wms/basicDataManage/strategySetting/strategy/manageAccuracyStrategy/AddForm.vue

@ -124,11 +124,11 @@
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<el-col :span="24">
<!-- 存储类型 -->
<el-form-item label="管理精度" v-if="index == 0">
<el-form-item label="管理精度">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio-group v-model="formData.configuration.ManagementPrecision">
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.MANAGEMENT_MODE)"
:key="cur.value">{{ cur.label }}</el-radio>
</el-radio-group>
@ -190,10 +190,10 @@ const formData = ref({
//
{ ParamCode: 'IgnoreListOfLocation', Operator: "IN", Value: "" },
],
configuration: [
configuration: {
//
{ ParamCode: 'ManagementPrecision', Value: "BY_PACKAGING" },
]
ManagementPrecision:'BY_PACKAGING'
}
})
//
@ -403,10 +403,10 @@ const resetForm = () => {
//
{ ParamCode: 'IgnoreListOfLocation', Operator: "IN", Value: "" },
],
configuration: [
//
{ ParamCode: 'ManagementPrecision', Value: "BY_PACKAGING" },
]
configuration: {
//
ManagementPrecision:'BY_PACKAGING'
}
}
}

210
src/views/wms/basicDataManage/strategySetting/strategy/purchaseReceiptStrategy/AddForm.vue

@ -1,16 +1,27 @@
<!-- 采购收货任务拆分策略弹出层 -->
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px;">
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;">
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto">
<!-- 规则 -->
<el-form ref="formRef" :model="formData" :rules="rules" label-width="140px" label-position="left">
<el-form
ref="formRef"
:model="formData"
:rules="rules"
label-width="140px"
label-position="left"
>
<div class="item">
<div class="title">规则</div>
<el-row gutter="10">
<el-col :span="24">
<el-form-item label="代码" prop="strategyCode">
<el-input v-model="formData.strategyCode" placeholder="请输入代码" clearable disabled />
<el-input
v-model="formData.strategyCode"
placeholder="请输入代码"
clearable
disabled
/>
</el-form-item>
</el-col>
<el-col :span="24">
@ -41,25 +52,68 @@
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index">
<!-- 供应商类型 -->
<el-form-item v-if="item.ParamCode == 'SupplierType'" label="供应商类型" class="flex-top err-120">
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierTypeRangeOptions"
:key="cur.value" />
<el-form-item
v-if="item.ParamCode == 'SupplierType'"
label="供应商类型"
class="flex-top err-120"
>
<el-select
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.supplierTypeRangeOptions"
:key="cur.value"
/>
</el-select>
<el-select v-model="item.Value" placeholder="请选择供应商类型" style="flex: 1;" clearable
@change="changeSupplierType">
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" />
<el-select
v-model="item.Value"
placeholder="请选择供应商类型"
style="flex: 1"
clearable
@change="changeSupplierType"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- 供应商 -->
<el-form-item v-else-if="item.ParamCode == 'SupplierCode'" label="供应商" class="err-120">
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.supplierRangeOptions"
:key="cur.value" />
<el-form-item
v-else-if="item.ParamCode == 'SupplierCode'"
label="供应商"
class="err-120"
>
<el-select
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.supplierRangeOptions"
:key="cur.value"
/>
</el-select>
<el-select v-model="item.Value" placeholder="请选择供应商" style="flex: 1;" clearable>
<el-option v-for="cur in options.supplierList" :key="cur.id" :label="cur.name" :value="cur.id" />
<el-select
v-model="item.Value"
placeholder="请选择供应商"
style="flex: 1"
clearable
>
<el-option
v-for="cur in options.supplierList"
:key="cur.id"
:label="cur.name"
:value="cur.id"
/>
</el-select>
</el-form-item>
</el-col>
@ -69,23 +123,22 @@
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<el-col :span="24">
<!-- 按零件拆分 -->
<el-form-item v-if="item.ParamCode == 'ByItem'" label="按零件拆分">
<el-switch v-model="item.Value" />
<el-form-item label="按零件拆分">
<el-switch v-model="formData.configuration.ByItem" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 按库位拆分 -->
<el-form-item v-else-if="item.ParamCode == 'ByLocation'" label="按库位拆分">
<el-switch v-model="item.Value" />
<el-form-item label="按库位拆分">
<el-switch v-model="formData.configuration.ByLocation" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!--按器具拆分-->
<el-form-item v-else-if="item.ParamCode == 'ByContainer'" label="按器具拆分">
<el-switch v-model="item.Value" />
<el-form-item label="按器具拆分">
<el-switch v-model="formData.configuration.ByContainer" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 每个任务明细数量 -->
<el-form-item v-else-if="item.ParamCode == 'JobDetailCount'" label="每个任务明细数量">
<!-- <el-input v-model="item.Value" placeholder="请输入每个任务明细数量" clearable /> -->
<el-input-number v-model="item.Value" :min="0" />
<el-form-item label="每个任务明细数量">
<el-input-number v-model="formData.configuration.JobDetailCount" :min="0" />
</el-form-item>
</el-col>
</el-row>
@ -104,8 +157,7 @@ defineOptions({ name: 'SupplieDeliveryStrategyAddForm' })
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { getSupplierList } from '@/api/wms/supplier'
import * as RuleApi from '@/api/wms/rule'
import { object } from 'vue-types'
const { t } = useI18n() //
const message = useMessage() //
@ -120,28 +172,28 @@ const formStrategyCode = ref('')
// form
const formData = ref({
id: '',
strategyCode: formStrategyCode.value,//id
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //id
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
//
{ ParamCode: 'SupplierType', Operator: "==", Value: "" },
{ ParamCode: 'SupplierType', Operator: '==', Value: '' },
//
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'ByItem', Value: false },
ByItem: 'FALSE',
//
{ ParamCode: 'ByLocation', Value: true },
ByLocation: 'TRUE',
//
{ ParamCode: 'ByContainer', Value: false },
ByContainer: 'FALSE',
//
{ ParamCode: 'JobDetailCount', Value: 0 },
]
JobDetailCount: 0
}
})
//
@ -163,25 +215,31 @@ const rangeOptions = [
{ value: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' },
{ value: 'NOT NULL', label: '不为空' }
]
const formatRangeOptions = (...rest) => {
//
let result = rangeOptions.filter(aItem => rest.some(bItem => aItem.value === bItem));
let result = rangeOptions.filter((aItem) => rest.some((bItem) => aItem.value === bItem))
return result
}
//
const options = reactive({
//
supplierTypeRangeOptions: formatRangeOptions('=='),
//
supplierTypeOptions: [{ value: 1, label: '标准' }, { value: 2, label: '委外' }, { value: 3, label: '其他' }],
supplierTypeOptions: [
{ value: 1, label: '标准' },
{ value: 2, label: '委外' },
{ value: 3, label: '其他' }
],
//
supplierRangeOptions: formatRangeOptions('IN', 'NOT IN'),
//
supplierList: [{ value: 1, label: '供应商1' }, { value: 2, label: '供应商2' }, { value: 3, label: '供应商3' }],
supplierList: [
{ value: 1, label: '供应商1' },
{ value: 2, label: '供应商2' },
{ value: 3, label: '供应商3' }
]
})
//
const querySupplierParams = ref({
@ -189,7 +247,7 @@ const querySupplierParams = ref({
})
//
const getFormSupplierList = async () => {
options.supplierList = await getSupplierList(querySupplierParams.value);
options.supplierList = await getSupplierList(querySupplierParams.value)
}
//
@ -199,7 +257,6 @@ const changeSupplierType = (e) => {
getFormSupplierList()
}
getFormSupplierList()
/** 打开弹窗 */
@ -229,7 +286,6 @@ const open = async (type: string, strategyCode: string, id?: number) => {
querySupplierParams.value.type = formData.value?.condition[0]?.Value || ''
getFormSupplierList()
} finally {
formLoading.value = false
}
@ -243,11 +299,12 @@ const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return;
let onlyOne = formData.value.configuration.filter(item=>{
return item.Value == true
if (!valid) return
let list = Object.values(formData.value.configuration)
let onlyOne = list.filter((item) => {
return item == 'TRUE'
})
if(onlyOne?.length !=1){
if (onlyOne?.length != 1) {
message.error('只能选择一种拆分方式')
return
}
@ -256,11 +313,11 @@ const submitForm = async () => {
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,//
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)
@ -284,37 +341,37 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: '',
strategyCode: formStrategyCode.value,//
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
//
{ ParamCode: 'SupplierType', Operator: "==", Value: "" },
{ ParamCode: 'SupplierType', Operator: '==', Value: '' },
//
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" },
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'ByItem', Value: false },
ByItem: 'FALSE',
//
{ ParamCode: 'ByLocation', Value: true },
ByLocation: 'TRUE',
//
{ ParamCode: 'ByContainer', Value: 'false' },
ByContainer: 'FALSE',
//
{ ParamCode: 'JobDetailCount', Value: 0 },
]
JobDetailCount: 0
}
}
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
defaultButtons.formCloseBtn(null) //
]
//
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
@ -325,7 +382,6 @@ const buttonBaseClick = (val, item) => {
dialogVisible.value = false
}
}
</script>
<style scoped lang="scss">
.item {

148
src/views/wms/basicDataManage/strategySetting/strategy/repairMaterialStrategy/AddForm.vue

@ -93,31 +93,33 @@
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<!-- 最大库存 -->
<el-form-item label="最大库存" v-if="index == 0" :prop="'configuration.' + index + '.Value'"
:rules="[{ required: true, message: '请输入最大库存', trigger: 'change', }]">
<el-input-number v-model="item.Value" :min="-1" controls-position="right" />
<!-- 最大库存 -->
<el-col :span="24">
<el-form-item label="最大库存" prop="configuration.MaxQty" :rules="[{ required: true, message: '请输入最小库存', trigger: 'change', }]">
<el-input-number v-model="formData.configuration.MaxQty" :min="-1" controls-position="right" />
</el-form-item>
<!-- 最小库存 -->
<el-form-item label="最小库存" v-else-if="index == 1" :prop="'configuration.' + index + '.Value'"
:rules="[{ required: true, message: '请输入最小库存', trigger: 'change', }, { validator: validatorNum, message: '不可以大于最大库存', trigger: 'change', }]">
<el-input-number v-model="item.Value" :min="0"
:max="formData.configuration[0].Value != -1 ? formData.configuration[0].Value : Infinity"
</el-col>
<!-- 最小库存 -->
<el-col :span="24">
<el-form-item label="最小库存" prop="configuration.MinQty" :rules="[{ required: true, message: '请输入最小库存', trigger: 'change', }, { validator: validatorNum, message: '不可以大于最大库存', trigger: 'change', }]">
<el-input-number v-model="formData.configuration.MinQty" :min="0"
:max="formData.configuration.MaxQty != -1 ? formData.configuration.MaxQty : Infinity"
controls-position="right" />
</el-form-item>
<!-- 安全库存 -->
<el-form-item label="安全库存" v-else-if="index == 2" :prop="'configuration.' + index + '.Value'"
:rules="[{ required: true, message: '请输入最小库存', trigger: 'change', }, { validator: validatorNum, message: '不可以大于最大库存', trigger: 'change', }]">
<el-input-number v-model="item.Value" :min="0"
:max="formData.configuration[0].Value != -1 ? formData.configuration[0].Value : Infinity"
</el-col>
<!-- 安全库存 -->
<el-col :span="24">
<el-form-item label="安全库存" prop="configuration.SafetyQty" :rules="[{ required: true, message: '请输入安全库存', trigger: 'change', }, { validator: validatorNum, message: '不可以大于最大库存', trigger: 'change', }]">
<el-input-number v-model="formData.configuration.SafetyQty" :min="0"
:max="formData.configuration.MaxQty != -1 ? formData.configuration.MaxQty : Infinity"
controls-position="right" />
</el-form-item>
<!-- 补料数量 -->
<el-form-item label="补料数量" v-else-if="index == 3" :prop="'configuration.' + index + '.Value'"
:rules="[{ required: true, message: '请输入最小库存', trigger: 'change', }, { validator: validatorNum, message: '不可以大于最大库存', trigger: 'change', }]">
<el-input-number v-model="item.Value" :min="0"
:max="formData.configuration[0].Value != -1 ? formData.configuration[0].Value : Infinity"
</el-col>
<!-- 补料数量 -->
<el-col :span="24">
<el-form-item label="补料数量" prop="configuration.FeedQty" :rules="[{ required: true, message: '请输入补料数量', trigger: 'change', }, { validator: validatorNum, message: '不可以大于最大库存', trigger: 'change', }]">
<el-input-number v-model="formData.configuration.FeedQty" :min="0"
:max="formData.configuration.MaxQty != -1 ? formData.configuration.MaxQty : Infinity"
controls-position="right" />
</el-form-item>
</el-col>
@ -142,7 +144,6 @@ import * as RuleApi from '@/api/wms/rule'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const { t } = useI18n() //
const message = useMessage() //
@ -152,41 +153,40 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update -
const formRef = ref() // Ref
const formStrategyCode = ref('')
// form
const formData = ref({
id: '',
strategyCode: formStrategyCode.value,//id
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //id
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
// ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
{ ParamCode: 'ItemGroup', Operator: 'IN', Value: '' },
//
{ ParamCode: 'LocationCode', Operator: "IN", Value: "" },
{ ParamCode: 'LocationCode', Operator: 'IN', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'MaxQty', Value: 0 },
MaxQty: 0,
//
{ ParamCode: 'MinQty', Value: 0 },
MinQty: 0,
//
{ ParamCode: 'SafetyQty', Value: 0 },
SafetyQty: 0,
//
{ ParamCode: 'SafetyQty', Value: 0 },
]
FeedQty: 0
}
})
//
const rules = ref({
strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }]
})
//
@ -200,11 +200,11 @@ const rangeOptions = [
{ value: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' },
{ value: 'NOT NULL', label: '不为空' }
]
const formatRangeOptions = (...rest) => {
//
let result = rangeOptions.filter(aItem => rest.some(bItem => aItem.value === bItem));
let result = rangeOptions.filter((aItem) => rest.some((bItem) => aItem.value === bItem))
return result
}
@ -214,10 +214,19 @@ const options = reactive({
rangeOptions1: formatRangeOptions('IN', 'NOT IN'),
//
itemTypeOptions: [{ value: 'ItemGroup', label: '物品分组' }, { value: 'ItemCode', label: '物品' }, { value: 'Project', label: '项目' }],
itemTypeOptions: [
{ value: 'ItemGroup', label: '物品分组' },
{ value: 'ItemCode', label: '物品' },
{ value: 'Project', 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: [],
//
overflowWarehouseList: []
@ -230,22 +239,22 @@ const changeItemsType = () => {
//
const getFormWarehouseList = async () => {
options.warehouseList = await getWarehouseList();
options.warehouseList = await getWarehouseList()
}
//
const getFormAreaList = async () => {
options.warehouseList = await getAreaList();
options.warehouseList = await getAreaList()
}
//
const getFormLocationgrouList = async () => {
options.warehouseList = await getLocationgroupList();
options.warehouseList = await getLocationgroupList()
}
//
const getFormLocationList = async (queryParms) => {
if (queryParms) {
options.overflowWarehouseList = await getLocationList(queryParms);
options.overflowWarehouseList = await getLocationList(queryParms)
} else {
options.warehouseList = await getLocationList();
options.warehouseList = await getLocationList()
}
}
getFormLocationList()
@ -321,11 +330,11 @@ const submitForm = async () => {
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,//
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)
@ -349,37 +358,37 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: '',
strategyCode: formStrategyCode.value,//id
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //id
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
// ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
{ ParamCode: 'ItemGroup', Operator: 'IN', Value: '' },
//
{ ParamCode: 'LocationCode', Operator: "IN", Value: "" },
{ ParamCode: 'LocationCode', Operator: 'IN', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'MaxQty', Value: 0 },
MaxQty: 0,
//
{ ParamCode: 'MinQty', Value: 0 },
MinQty: 0,
//
{ ParamCode: 'SafetyQty', Value: 0 },
SafetyQty: 0,
//
{ ParamCode: 'SafetyQty', Value: 0 },
]
FeedQty: 0
}
}
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
defaultButtons.formCloseBtn(null) //
]
//
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
@ -392,11 +401,10 @@ const buttonBaseClick = (val, item) => {
}
const validatorNum = (rule: any, value: any, callback: any) => {
if (value && formData.value.configuration[0].Value != -1) {
if (value > formData.value.configuration[0].Value) {
callback(new Error("11"))
if (value && formData.value.configuration.MaxQty != -1) {
if (value > formData.value.configuration.MaxQty) {
callback(new Error('11'))
} else {
callback()
}
} else {

351
src/views/wms/basicDataManage/strategySetting/strategy/storageCapacityStrategy/AddForm.vue

@ -1,15 +1,26 @@
<!-- 存储容量策略弹窗 -->
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px;">
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;">
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px" label-position="left">
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto">
<el-form
ref="formRef"
:model="formData"
:rules="rules"
label-width="120px"
label-position="left"
>
<!-- 规则 -->
<div class="item">
<div class="title">规则</div>
<el-row gutter="10">
<el-col :span="24">
<el-form-item label="代码" prop="strategyCode">
<el-input v-model="formData.strategyCode" placeholder="请输入代码" clearable disabled />
<el-input
v-model="formData.strategyCode"
placeholder="请输入代码"
clearable
disabled
/>
</el-form-item>
</el-col>
<el-col :span="24">
@ -42,47 +53,130 @@
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index">
<!-- 选择物品类型 -->
<el-form-item label="" label-width="0" class="err-240" v-if="index == 0">
<el-select v-model="item.ParamCode" placeholder="" @change="changeItemsType"
style="width: 110px;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.itemTypeOptions"
:key="cur.value" />
<el-select
v-model="item.ParamCode"
placeholder=""
@change="changeItemsType"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.itemTypeOptions"
:key="cur.value"
/>
</el-select>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1"
:key="cur.value" />
<el-select
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.rangeOptions1"
:key="cur.value"
/>
</el-select>
<el-select v-model="item.Value" placeholder="请选择物品类型" style="flex: 1;" clearable
v-if="item.ParamCode == 'ItemType'">
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :key="cur.value" :label="cur.label"
:value="cur.value" />
<el-select
v-model="item.Value"
placeholder="请选择物品类型"
style="flex: 1"
clearable
v-if="item.ParamCode == 'ItemType'"
>
<el-option
v-for="cur in getStrDictOptions(DICT_TYPE.ITEM_TYPE)"
:key="cur.value"
:label="cur.label"
:value="cur.value"
/>
</el-select>
<el-select v-model="item.Value" placeholder="请选择ABC类" style="flex: 1;" clearable
v-else-if="item.ParamCode == 'AbcClass'">
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ABC_CLASS)" :key="cur.value" :label="cur.label"
:value="cur.value" />
<el-select
v-model="item.Value"
placeholder="请选择ABC类"
style="flex: 1"
clearable
v-else-if="item.ParamCode == 'AbcClass'"
>
<el-option
v-for="cur in getStrDictOptions(DICT_TYPE.ABC_CLASS)"
:key="cur.value"
:label="cur.label"
:value="cur.value"
/>
</el-select>
<el-input v-model="item.Value" placeholder="请输入物品分组" clearable style="flex: 1;"
v-else-if="item.ParamCode == 'ItemGroup'" />
<el-input v-model="item.Value" placeholder="请输入项目" clearable style="flex: 1;"
v-else-if="item.ParamCode == 'Project'" />
<el-input v-model="item.Value" placeholder="请输入物品" clearable style="flex: 1;"
v-else-if="item.ParamCode == 'ItemCode'" />
<el-input
v-model="item.Value"
placeholder="请输入物品分组"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemGroup'"
/>
<el-input
v-model="item.Value"
placeholder="请输入项目"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'Project'"
/>
<el-input
v-model="item.Value"
placeholder="请输入物品"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'"
/>
</el-form-item>
<!-- 仓库 库区 库位组 库位 -->
<el-form-item label="" label-width="0" class="err-240" v-if="index == 1">
<el-select v-model="item.ParamCode" placeholder="" style="width: 110px;margin-right: 10px;"
@change="changeWarehouse">
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions"
:key="index" />
<el-select
v-model="item.ParamCode"
placeholder=""
style="width: 110px; margin-right: 10px"
@change="changeWarehouse"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="(cur, index) in options.warehouseTypeOptions"
:key="index"
/>
</el-select>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1"
:key="cur.value" />
<el-select
v-model="item.Operator"
placeholder="请选择范围"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="cur in options.rangeOptions1"
:key="cur.value"
/>
</el-select>
<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-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-select>
</el-form-item>
</el-col>
@ -93,42 +187,76 @@
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<el-col :span="24">
<!-- 存储类型 -->
<el-form-item label="存储类型" v-if="index == 0">
<el-form-item label="存储类型">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio-group v-model="formData.configuration.StorageType">
<el-radio label="NOTLIMIT">不限制</el-radio>
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.STORAGE_TYPE)"
:key="cur.value">{{ cur.label }}</el-radio>
<el-radio
:label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.STORAGE_TYPE)"
:key="cur.value"
>{{ cur.label }}</el-radio
>
</el-radio-group>
</div>
</el-form-item>
<!-- 存储容量 -->
<el-form-item label="存储容量" v-else-if="index == 1">
<el-input v-model="item.Value" placeholder="请输入存储容量" clearable />
</el-col>
<!-- 存储容量 -->
<el-col :span="24">
<el-form-item label="存储容量">
<el-input
v-model="formData.configuration.StorageQty"
placeholder="请输入存储容量"
clearable
/>
</el-form-item>
<!-- 替代存储类型 -->
<el-form-item label="替代存储类型" v-if="index == 2">
</el-col>
<!-- 替代存储类型 -->
<el-col :span="24">
<el-form-item label="替代存储类型">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio-group v-model="formData.configuration.AltStorageType">
<el-radio label="NOTLIMIT">不限制</el-radio>
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.STORAGE_TYPE)"
:key="cur.value">{{ cur.label }}</el-radio>
<el-radio
:label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.STORAGE_TYPE)"
:key="cur.value"
>{{ cur.label }}</el-radio
>
</el-radio-group>
</div>
</el-form-item>
<!-- 替代容量 -->
<el-form-item label="替代容量" v-else-if="index == 3">
<el-input v-model="item.Value" placeholder="请输入替代容量" clearable />
</el-col>
<!-- 替代容量 -->
<el-col :span="24">
<el-form-item label="替代容量">
<el-input
v-model="formData.configuration.AltStorageQty"
placeholder="请输入替代容量"
clearable
/>
</el-form-item>
<!-- 固定位置 -->
<el-form-item label="固定位置" v-else-if="index == 4">
<el-switch v-model="item.Value" />
</el-col>
<!-- 固定位置 -->
<el-col :span="24">
<el-form-item label="固定位置">
<el-switch
v-model="formData.configuration.IsFixed"
active-value="TRUE"
inactive-value="FALSE"
/>
</el-form-item>
<!-- 占用相邻库位 -->
<el-form-item label="占用相邻库位" v-else-if="index == 5">
<el-switch v-model="item.Value" />
</el-col>
<!-- 占用相邻库位 -->
<el-col :span="24">
<el-form-item label="占用相邻库位">
<el-switch
v-model="formData.configuration.IsOccupyAdjacent"
active-value="TRUE"
inactive-value="FALSE"
/>
</el-form-item>
</el-col>
</el-row>
@ -152,7 +280,6 @@ import * as RuleApi from '@/api/wms/rule'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const { t } = useI18n() //
const message = useMessage() //
@ -162,45 +289,43 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update -
const formRef = ref() // Ref
const formStrategyCode = ref('')
// form
const formData = ref({
id: '',
strategyCode: formStrategyCode.value,//id
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //id
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
// ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
{ ParamCode: 'ItemGroup', Operator: 'IN', Value: '' },
//
{ ParamCode: 'LocationCode', Operator: "IN", Value: "" },
{ ParamCode: 'LocationCode', Operator: 'IN', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'StorageType', Value: 'NOTLIMIT' },
StorageType: 'NOTLIMIT',
//
{ ParamCode: 'StorageQty', Value: '' },
StorageQty: '',
//
{ ParamCode: 'AltStorageType', Value: 'NOTLIMIT' },
AltStorageType: 'NOTLIMIT',
//
{ ParamCode: 'AltStorageQty', Value: '' },
AltStorageQty: '',
//
{ ParamCode: 'IsFixed', Value: false },
IsFixed: 'FALSE',
//
{ ParamCode: 'IsOccupyAdjacent', Value: false },
]
IsOccupyAdjacent: 'FALSE'
}
})
//
const rules = ref({
strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }]
})
//
@ -214,11 +339,11 @@ const rangeOptions = [
{ value: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' },
{ value: 'NOT NULL', label: '不为空' }
]
const formatRangeOptions = (...rest) => {
//
let result = rangeOptions.filter(aItem => rest.some(bItem => aItem.value === bItem));
let result = rangeOptions.filter((aItem) => rest.some((bItem) => aItem.value === bItem))
return result
}
@ -228,10 +353,19 @@ const options = reactive({
rangeOptions1: formatRangeOptions('IN', 'NOT IN'),
//
itemTypeOptions: [{ value: 'ItemGroup', label: '物品分组' }, { value: 'ItemCode', label: '物品' }, { value: 'Project', label: '项目' }],
itemTypeOptions: [
{ value: 'ItemGroup', label: '物品分组' },
{ value: 'ItemCode', label: '物品' },
{ value: 'Project', 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: [],
//
overflowWarehouseList: []
@ -244,22 +378,22 @@ const changeItemsType = () => {
//
const getFormWarehouseList = async () => {
options.warehouseList = await getWarehouseList();
options.warehouseList = await getWarehouseList()
}
//
const getFormAreaList = async () => {
options.warehouseList = await getAreaList();
options.warehouseList = await getAreaList()
}
//
const getFormLocationgrouList = async () => {
options.warehouseList = await getLocationgroupList();
options.warehouseList = await getLocationgroupList()
}
//
const getFormLocationList = async (queryParms) => {
if (queryParms) {
options.overflowWarehouseList = await getLocationList(queryParms);
options.overflowWarehouseList = await getLocationList(queryParms)
} else {
options.warehouseList = await getLocationList();
options.warehouseList = await getLocationList()
}
}
getFormLocationList()
@ -335,11 +469,11 @@ const submitForm = async () => {
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,//
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)
@ -363,41 +497,41 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: '',
strategyCode: formStrategyCode.value,//id
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //id
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
// ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
{ ParamCode: 'ItemGroup', Operator: 'IN', Value: '' },
//
{ ParamCode: 'LocationCode', Operator: "IN", Value: "" },
{ ParamCode: 'LocationCode', Operator: 'IN', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'StorageType', Value: 'NOTLIMIT' },
StorageType: 'NOTLIMIT',
//
{ ParamCode: 'StorageQty', Value: '' },
StorageQty: '',
//
{ ParamCode: 'AltStorageType', Value: 'NOTLIMIT' },
AltStorageType: 'NOTLIMIT',
//
{ ParamCode: 'AltStorageQty', Value: '' },
AltStorageQty: '',
//
{ ParamCode: 'IsFixed', Value: false },
IsFixed: 'FALSE',
//
{ ParamCode: 'IsOccupyAdjacent', Value: false },
]
IsOccupyAdjacent: 'FALSE'
}
}
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
defaultButtons.formCloseBtn(null) //
]
//
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
@ -408,7 +542,6 @@ const buttonBaseClick = (val, item) => {
dialogVisible.value = false
}
}
</script>
<style scoped lang="scss">
.item {

89
src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue

@ -82,59 +82,34 @@
<div class="title">规则配置</div>
<el-row>
<!-- 开始时间 -->
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<el-col :span="24">
<!-- 开始时间 -->
<el-form-item v-if="item.ParamCode == 'BeginTime'" label="开始时间" :prop="'configuration.' + index + '.Value'"
:rules="{
required: true,
message: '请选择开始时间',
trigger: 'change',
}">
<el-time-select v-model="item.Value" start="00:00" end="23:59" step="00:15" placeholder="请选择开始时间"
<el-form-item label="开始时间" prop="BeginTime">
<el-time-select v-model="formData.configuration.BeginTime" start="00:00" end="23:59" step="00:15" placeholder="请选择开始时间"
style="width: 100%;" />
</el-form-item>
<!-- 结束时间 -->
<el-form-item v-else-if="item.ParamCode == 'EndTime'" label="结束时间"
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: '请选择结束时间',
trigger: 'change',
}">
<el-time-select v-model="item.Value" start="00:00" end="23:59" step="00:15" placeholder="请选择结束时间"
<el-form-item label="结束时间" prop="EndTime">
<el-time-select v-model="formData.configuration.EndTime" start="00:00" end="23:59" step="00:15" placeholder="请选择结束时间"
style="width: 100%;" />
</el-form-item>
<!-- 仓库 -->
<el-form-item v-else-if="item.ParamCode == 'WarehouseCode'" label="仓库"
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: `请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`,
trigger: 'change',
}">
<el-select v-model="item.Value"
:placeholder="`请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`"
<el-form-item label="仓库" prop="WarehouseCode">
<el-select v-model="formData.configuration.WarehouseCode"
:placeholder="`请选择${formData.configuration.WarehouseCode == 'WarehouseCode' ? '仓库' : formData.configuration.WarehouseCode== 'AreaCode' ? '库区' : formData.configuration.WarehouseCode == 'LocationGroupCode' ? '库位组' : formData.configuration.WarehouseCode == 'LocationCode' ? '库位' : ''}`"
clearable>
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
</el-form-item>
<!-- 月台 -->
<el-form-item v-else-if="item.ParamCode == 'DockCode'" label="月台"
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: '请选择月台',
trigger: 'change',
}">
<el-select v-model="item.Value" placeholder="请选择月台" clearable>
<el-form-item label="月台" prop="DockCode" >
<el-select v-model="formData.configuration.DockCode" placeholder="请选择月台" clearable>
<el-option v-for="cur in options.dockList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
</el-form-item>
<!-- 在途库位 -->
<el-form-item v-else-if="item.ParamCode == 'OnTheWayLocationCode'" label="在途库位"
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: '请选择在途库位',
trigger: 'change',
}">
<el-select v-model="item.Value" placeholder="请选择在途库位" clearable>
<el-form-item label="在途库位" prop="OnTheWayLocationCode" >
<el-select v-model="formData.configuration.OnTheWayLocationCode" placeholder="请选择在途库位" clearable>
<el-option v-for="cur in options.locationList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
</el-form-item>
@ -188,18 +163,18 @@ const formData = ref({
//
{ ParamCode: 'Weekday', Operator: "IN", Value: [] }
],
configuration: [
configuration: {
//
{ ParamCode: 'BeginTime', Value: "" },
BeginTime:"",
//
{ ParamCode: 'EndTime', Value: "" },
EndTime:"",
//
{ ParamCode: 'WarehouseCode', Value: '' },
WarehouseCode:"",
//
{ ParamCode: 'DockCode', Value: '' },
DockCode:"",
//
{ ParamCode: 'OnTheWayLocationCode', Value: '' },
]
OnTheWayLocationCode:"",
}
})
//
@ -306,7 +281,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.condition = JSON.parse(data.condition)
}
if (data.configuration) {
formData.value.configuration = JSON.parse(data.configuration)
formData.value.configuration = JSON.parse(data.configuration)
}
querySupplierParams.value.type = formData.value?.condition[0]?.Value || ''
@ -373,18 +348,18 @@ const resetForm = () => {
//
{ ParamCode: 'Weekday', Operator: "IN", Value: [] }
],
configuration: [
//
{ ParamCode: 'BeginTime', Value: "" },
//
{ ParamCode: 'EndTime', Value: "" },
//
{ ParamCode: 'WarehouseCode', Value: '' },
//
{ ParamCode: 'DockCode', Value: '' },
//
{ ParamCode: 'OnTheWayLocationCode', Value: '' },
]
configuration: {
//
BeginTime:"",
//
EndTime:"",
//
WarehouseCode:"",
//
DockCode:"",
//
OnTheWayLocationCode:"",
}
}
}

120
src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue

@ -140,36 +140,56 @@
<div class="title">规则配置</div>
<el-row>
<!-- 仓库 库区 库位组 库位 -->
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<el-form-item label="" label-width="0" prop="warehouse" class="err-120" v-if="index == 0">
<el-select v-model="item.ParamCode" placeholder="" style="width: 110px;margin-right: 10px;"
<el-col :span="24">
<el-form-item label="" label-width="0" prop="warehouse" class="err-120">
<el-select v-model="warehouseType" placeholder="" style="width: 110px;margin-right: 10px;"
@change="changeWarehouse">
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions"
:key="index" />
</el-select>
<el-select v-model="item.Value" :placeholder="`请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`" clearable style="flex: 1;">
<el-select v-model="formData.configuration.WarehouseCode" v-if="warehouseType == 'WarehouseCode'" placeholder="请选择仓库" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
<el-select v-model="formData.configuration.AreaCode" v-if="warehouseType == 'AreaCode'" placeholder="请选择库区" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
<el-select v-model="formData.configuration.LocationGroupCode" v-if="warehouseType == 'LocationGroupCode'" placeholder="请选择库位组" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
<el-select v-model="formData.configuration.LocationCode" v-if="warehouseType == 'LocationCode'" placeholder="请选择库位" clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
</el-form-item>
</el-col>
<!-- 优先空位库 -->
<el-form-item label="优先空位库" v-else-if="index == 1">
<el-switch v-model="item.Value" />
<el-col :span="24">
<el-form-item label="优先空位库">
<el-switch v-model="formData.configuration.EmptyLocationFirst" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 优先非空位库 -->
<el-form-item label="优先非空位库" v-else-if="index == 2">
<el-switch v-model="item.Value" />
<el-col :span="24">
<el-form-item label="优先非空位库">
<el-switch v-model="formData.configuration.NotEmptyLocationFirst" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 可以混物品 -->
<el-form-item label="可以混物品" v-else-if="index == 3">
<el-switch v-model="item.Value" />
<el-col :span="24">
<el-form-item label="可以混物品">
<el-switch v-model="formData.configuration.EnableMixItem" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 可以混批次 -->
<el-form-item label="可以混批次" v-else-if="index == 4">
<el-switch v-model="item.Value" />
<el-col :span="24">
<el-form-item label="可以混批次">
<el-switch v-model="formData.configuration.EnableMixLot" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 可以混状态 -->
<el-form-item label="可以混状态" v-else-if="index == 5">
<el-switch v-model="item.Value" />
<el-col :span="24">
<el-form-item label="可以混状态">
<el-switch v-model="formData.configuration.EnableMixStatus" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
</el-row>
@ -206,6 +226,10 @@ const formRef = ref() // 表单 Ref
const formStrategyCode = ref('')
//
const warehouseType = ref('WarehouseCode')
// form
const formData = ref({
id: '',
@ -229,21 +253,26 @@ const formData = ref({
//
{ ParamCode: 'TransactionType', Operator: "IN", Value: [] }
],
configuration: [
//
{ ParamCode: 'LocationCode', Value: "" },
configuration: {
//
WarehouseCode:"",
//
AreaCode:"",
//
LocationGroupCode:"",
//
LocationCode:"",
//
{ ParamCode: 'EmptyLocationFirst', Value: false },
EmptyLocationFirst:'FALSE',
//
{ ParamCode: 'NotEmptyLocationFirst', Value: false },
NotEmptyLocationFirst:'FALSE',
//
{ ParamCode: 'EnableMixItem', Value: true },
EnableMixItem:'TRUE',
//
{ ParamCode: 'EnableMixLot', Value: true },
EnableMixLot:'TRUE',
//
{ ParamCode: 'EnableMixStatus', Value: true },
]
EnableMixStatus:'TRUE',
}
})
//
const rules = ref({
@ -338,7 +367,10 @@ const getFormLocationList = async () => {
getFormLocationList()
// ///
const changeWarehouse = (e) => {
formData.value.configuration[0].Value = ''
formData.value.configuration.WarehouseCode = ''
formData.value.configuration.AreaCode = ''
formData.value.configuration.LocationGroupCode = ''
formData.value.configuration.LocationCode = ''
if (e == 'WarehouseCode') {
getFormWarehouseList()
} else if (e == 'AreaCode') {
@ -355,6 +387,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
warehouseType.value = 'WarehouseCode'
resetForm()
//
if (id) {
@ -380,13 +413,17 @@ const open = async (type: string, strategyCode: string, id?: number) => {
getFormCustomerList()
}
// ///
if (formData.value.configuration[0].ParamCode == 'WarehouseCode') {
if ('WarehouseCode' in formData.value.configuration && formData.value.configuration.WarehouseCode) {
warehouseType.value = 'WarehouseCode'
getFormWarehouseList()
} else if (formData.value.configuration[0].ParamCode == 'AreaCode') {
} else if ('AreaCode' in formData.value.configuration && formData.value.configuration.AreaCode) {
warehouseType.value = 'AreaCode'
getFormAreaList()
} else if (formData.value.configuration[0].ParamCode == 'LocationGroupCode') {
} else if ('LocationGroupCode' in formData.value.configuration && formData.value.configuration.LocationGroupCode) {
warehouseType.value = 'LocationGroupCode'
getFormLocationgrouList()
} else if (formData.value.configuration[0].ParamCode == 'LocationCode') {
} else if ('LocationCode' in formData.value.configuration && formData.value.configuration.LocationCode) {
warehouseType.value = 'LocationCode'
getFormLocationList()
}
@ -457,21 +494,26 @@ const resetForm = () => {
//
{ ParamCode: 'TransactionType', Operator: "IN", Value: [] }
],
configuration: [
//
{ ParamCode: 'LocationCode', Value: "" },
configuration: {
//
WarehouseCode:"",
//
AreaCode:"",
//
LocationGroupCode:"",
//
LocationCode:"",
//
{ ParamCode: 'EmptyLocationFirst', Value: false },
EmptyLocationFirst:'FALSE',
//
{ ParamCode: 'NotEmptyLocationFirst', Value: false },
NotEmptyLocationFirst:'FALSE',
//
{ ParamCode: 'EnableMixItem', Value: true },
EnableMixItem:'TRUE',
//
{ ParamCode: 'EnableMixLot', Value: true },
EnableMixLot:'TRUE',
//
{ ParamCode: 'EnableMixStatus', Value: true },
]
EnableMixStatus:'TRUE',
}
}
}

18
src/views/wms/basicDataManage/strategySetting/strategy/utensilCapacityStrategy/AddForm.vue

@ -91,11 +91,11 @@
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<el-col :span="24">
<!-- 容纳数量 -->
<el-form-item label="容纳数量" v-if="index == 0" :prop="'configuration.' + index + '.Value'"
<el-form-item label="容纳数量" prop="configuration.ContentCount"
:rules="[{ required: true, message: '请输入容纳数量', trigger: 'change', }]">
<el-input-number v-model="item.Value" :min="-1" controls-position="right" />
<el-input-number v-model="formData.configuration.ContentCount" :min="-1" controls-position="right" />
</el-form-item>
</el-col>
</el-row>
@ -142,10 +142,10 @@ const formData = ref({
// ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
],
configuration: [
configuration: {
//
{ ParamCode: 'ContentCount', Value: 0 },
]
ContentCount:0
}
})
//
@ -272,10 +272,10 @@ const resetForm = () => {
// ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
],
configuration: [
configuration: {
//
{ ParamCode: 'ContentCount', Value: 0 },
]
ContentCount:0
}
}
}

330
src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue

@ -1,15 +1,26 @@
<!-- 库位存储策略弹窗弹窗 -->
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px;">
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;">
<el-form ref="formRef" :model="formData" :rules="rules" label-width="130px" label-position="left">
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px">
<div class="p-20px m--10px" style="max-height: 50vh; overflow-y: auto">
<el-form
ref="formRef"
:model="formData"
:rules="rules"
label-width="130px"
label-position="left"
>
<!-- 规则 -->
<div class="item">
<div class="title">规则</div>
<el-row gutter="10">
<el-col :span="24">
<el-form-item label="代码" prop="strategyCode">
<el-input v-model="formData.strategyCode" placeholder="请输入代码" clearable disabled />
<el-input
v-model="formData.strategyCode"
placeholder="请输入代码"
clearable
disabled
/>
</el-form-item>
</el-col>
<el-col :span="24">
@ -43,13 +54,41 @@
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index">
<!-- 仓库 库区 库位组 库位 -->
<el-form-item label="" label-width="0" class="err-130" v-if="index == 0">
<el-select v-model="item.ParamCode" placeholder="" style="width: 120px;margin-right: 10px;"
@change="changeWarehouse">
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions"
:key="index" />
<el-select
v-model="item.ParamCode"
placeholder=""
style="width: 120px; margin-right: 10px"
@change="changeWarehouse"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="(cur, index) in options.warehouseTypeOptions"
:key="index"
/>
</el-select>
<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-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-select>
</el-form-item>
</el-col>
@ -60,73 +99,110 @@
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-row gutter="10">
<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">
<div class="checkbox">
<el-radio-group v-model="item.Value">
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.INVENTORY_STATUS)"
:key="cur.value">{{ cur.label }}</el-radio>
<el-radio-group v-model="formData.configuration.DefaultInventoryStatus">
<el-radio
:label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.INVENTORY_STATUS)"
:key="cur.value"
>{{ cur.label }}</el-radio
>
</el-radio-group>
</div>
</el-form-item>
<!-- 溢流库位 -->
<el-form-item label="溢流库位" v-else-if="index == 1">
<el-select v-model="item.Value" placeholder="请选择溢流库位" clearable>
<el-option v-for="cur in options.overflowWarehouseList" :key="cur.id" :label="cur.name"
:value="cur.id" />
</el-col>
<!-- 溢流库位 -->
<el-col :span="24">
<el-form-item label="溢流库位">
<el-select
v-model="formData.configuration.OverflowLocationCode"
placeholder="请选择溢流库位"
clearable
>
<el-option
v-for="cur in options.overflowWarehouseList"
:key="cur.id"
:label="cur.name"
:value="cur.id"
/>
</el-select>
</el-form-item>
<!-- 允许负库存 -->
<el-form-item label="允许负库存" v-else-if="index == 2">
<el-switch v-model="item.Value" />
</el-col>
<!-- 允许负库存 -->
<el-col :span="12">
<el-form-item label="允许负库存">
<el-switch v-model="formData.configuration.EnableNegative" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 保留零库存 -->
<el-form-item label="保留零库存" v-else-if="index == 3">
<el-switch v-model="item.Value" />
</el-col>
<!-- 保留零库存 -->
<el-col :span="12">
<el-form-item label="保留零库存">
<el-switch v-model="formData.configuration.EnableKeepZero" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 允许领料 -->
<el-form-item label="允许领料" v-else-if="index == 4">
<el-switch v-model="item.Value" />
</el-col>
<!-- 允许领料 -->
<el-col :span="12">
<el-form-item label="允许领料">
<el-switch v-model="formData.configuration.EnablePick" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 允许过量领料 -->
<el-form-item label="允许过量领料" v-else-if="index == 5">
<el-switch v-model="item.Value" />
</el-col>
<!-- 允许过量领料 -->
<el-col :span="12">
<el-form-item label="允许过量领料">
<el-switch v-model="formData.configuration.EnableOverPick" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 允许整包存储 -->
<el-form-item label="允许整包存储" v-else-if="index == 6">
<el-switch v-model="item.Value" />
</el-col>
<!-- 允许整包存储 -->
<el-col :span="12">
<el-form-item label="允许整包存储">
<el-switch v-model="formData.configuration.EnableWholeStore" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 允许散量存储 -->
<el-form-item label="允许散量存储" v-else-if="index == 7">
<el-switch v-model="item.Value" />
</el-col>
<!-- 允许散量存储 -->
<el-col :span="12">
<el-form-item label="允许散量存储">
<el-switch v-model="formData.configuration.EnableBreakStore" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 允许出库 -->
<el-form-item label="允许出库" v-else-if="index == 8">
<el-switch v-model="item.Value" />
</el-col>
<!-- 允许出库 -->
<el-col :span="12">
<el-form-item label="允许出库">
<el-switch v-model="formData.configuration.EnableShip" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 允许入库 -->
<el-form-item label="允许入库" v-else-if="index == 9">
<el-switch v-model="item.Value" />
</el-col>
<!-- 允许入库 -->
<el-col :span="12">
<el-form-item label="允许入库">
<el-switch v-model="formData.configuration.EnableReceive" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 允许退货到供应商 -->
<el-form-item label="允许退货到供应商" v-else-if="index == 10">
<el-switch v-model="item.Value" />
</el-col>
<!-- 允许退货到供应商 -->
<el-col :span="12">
<el-form-item label="允许退货到供应商">
<el-switch v-model="formData.configuration.EnableReturnToSupplier" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
<!-- 允许接收客户退货 -->
<el-form-item label="允许接收客户退货" v-else-if="index == 11">
<el-switch v-model="item.Value" />
</el-col>
<!-- 允许接收客户退货 -->
<el-col :span="12">
<el-form-item label="允许接收客户退货">
<el-switch v-model="formData.configuration.EnableReturnFromCustomer" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 允许拆箱 -->
<el-form-item label="允许拆箱" v-else-if="index == 12">
<el-switch v-model="item.Value" />
<!-- 允许拆箱 -->
<el-col :span="12">
<el-form-item label="允许拆箱">
<el-switch v-model="formData.configuration.EnableSplitBox" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
<!-- 允许拆托 -->
<el-form-item label="允许拆托" v-else-if="index == 13">
<el-switch v-model="item.Value" />
<!-- 允许拆托 -->
<el-col :span="12">
<el-form-item label="允许拆托">
<el-switch v-model="formData.configuration.EnableSplitPallet" active-value="TRUE" inactive-value="FALSE"/>
</el-form-item>
</el-col>
</el-row>
@ -150,7 +226,6 @@ import * as RuleApi from '@/api/wms/rule'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const { t } = useI18n() //
const message = useMessage() //
@ -160,59 +235,57 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update -
const formRef = ref() // Ref
const formStrategyCode = ref('')
// form
const formData = ref({
id: '',
strategyCode: formStrategyCode.value,//id
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //id
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
//
{ ParamCode: 'LocationCode', Value: "" },
{ ParamCode: 'LocationCode', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'DefaultInventoryStatus', Value: 'OK' },
DefaultInventoryStatus: 'OK',
//
{ ParamCode: 'OverflowLocationCode', Value: '' },
OverflowLocationCode: '',
//
{ ParamCode: 'EnableNegative', Value: true },
EnableNegative: 'TRUE',
//
{ ParamCode: 'EnableKeepZero', Value: true },
EnableKeepZero: 'TRUE',
//
{ ParamCode: 'EnablePick', Value: true },
EnablePick: 'TRUE',
//
{ ParamCode: 'EnableOverPick', Value: true },
//
{ ParamCode: 'EnableWholeStore', Value: true },
//
{ ParamCode: 'EnableBreakStore', Value: true },
EnableOverPick: 'TRUE',
//
EnableWholeStore: 'TRUE',
//
EnableBreakStore: 'TRUE',
//
{ ParamCode: 'EnableShip', Value: true },
EnableShip: 'TRUE',
//
{ ParamCode: 'EnableReceive', Value: true },
EnableReceive: 'TRUE',
// 退
{ ParamCode: 'EnableReturnToSupplier', Value: true },
EnableReturnToSupplier: 'TRUE',
// 退
{ ParamCode: 'EnableReturnFromCustomer', Value: true },
EnableReturnFromCustomer: 'TRUE',
//
{ ParamCode: 'EnableSplitBox', Value: true },
EnableSplitBox: 'TRUE',
//
{ ParamCode: 'EnableSplitPallet', Value: true },
]
EnableSplitPallet: 'TRUE'
}
})
//
const rules = ref({
strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }]
})
//
@ -226,11 +299,11 @@ const rangeOptions = [
{ value: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' },
{ value: 'NOT NULL', label: '不为空' }
]
const formatRangeOptions = (...rest) => {
//
let result = rangeOptions.filter(aItem => rest.some(bItem => aItem.value === bItem));
let result = rangeOptions.filter((aItem) => rest.some((bItem) => aItem.value === bItem))
return result
}
@ -241,32 +314,35 @@ const options = reactive({
rangeOptions2: formatRangeOptions('>', '<', '>=', '<='),
//
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: [],
//
overflowWarehouseList: []
})
//
const getFormWarehouseList = async () => {
options.warehouseList = await getWarehouseList();
options.warehouseList = await getWarehouseList()
}
//
const getFormAreaList = async () => {
options.warehouseList = await getAreaList();
options.warehouseList = await getAreaList()
}
//
const getFormLocationgrouList = async () => {
options.warehouseList = await getLocationgroupList();
options.warehouseList = await getLocationgroupList()
}
//
const getFormLocationList = async (queryParms) => {
if (queryParms) {
options.overflowWarehouseList = await getLocationList(queryParms);
options.overflowWarehouseList = await getLocationList(queryParms)
} else {
options.warehouseList = await getLocationList();
options.warehouseList = await getLocationList()
}
}
getFormLocationList()
@ -342,11 +418,11 @@ const submitForm = async () => {
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,//
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)
@ -370,56 +446,56 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: '',
strategyCode: formStrategyCode.value,//id
name: '',//
description: '',//
priority: '',//
status: true,//
strategyCode: formStrategyCode.value, //id
name: '', //
description: '', //
priority: '', //
status: true, //
//
condition: [
//
{ ParamCode: 'LocationCode', Value: "" },
{ ParamCode: 'LocationCode', Value: '' }
],
configuration: [
configuration: {
//
{ ParamCode: 'DefaultInventoryStatus', Value: 'OK' },
DefaultInventoryStatus: 'OK',
//
{ ParamCode: 'OverflowLocationCode', Value: '' },
OverflowLocationCode: '',
//
{ ParamCode: 'EnableNegative', Value: true },
EnableNegative: 'TRUE',
//
{ ParamCode: 'EnableKeepZero', Value: true },
EnableKeepZero: 'TRUE',
//
{ ParamCode: 'EnablePick', Value: true },
EnablePick: 'TRUE',
//
{ ParamCode: 'EnableOverPick', Value: true },
//
{ ParamCode: 'EnableWholeStore', Value: true },
//
{ ParamCode: 'EnableBreakStore', Value: true },
EnableOverPick: 'TRUE',
//
EnableWholeStore: 'TRUE',
//
EnableBreakStore: 'TRUE',
//
{ ParamCode: 'EnableShip', Value: true },
EnableShip: 'TRUE',
//
{ ParamCode: 'EnableReceive', Value: true },
EnableReceive: 'TRUE',
// 退
{ ParamCode: 'EnableReturnToSupplier', Value: true },
EnableReturnToSupplier: 'TRUE',
// 退
{ ParamCode: 'EnableReturnFromCustomer', Value: true },
EnableReturnFromCustomer: 'TRUE',
//
{ ParamCode: 'EnableSplitBox', Value: true },
EnableSplitBox: 'TRUE',
//
{ ParamCode: 'EnableSplitPallet', Value: true },
]
EnableSplitPallet: 'TRUE'
}
}
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
defaultButtons.formCloseBtn(null) //
]
//
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
@ -430,7 +506,6 @@ const buttonBaseClick = (val, item) => {
dialogVisible.value = false
}
}
</script>
<style scoped lang="scss">
.item {
@ -473,5 +548,4 @@ const buttonBaseClick = (val, item) => {
::v-deep .err-130 .el-form-item__error {
padding-left: 130px !important;
}
</style>

7
src/views/wms/deliversettlementManage/deliverplan/deliverPlanMain/deliverPlanMain.data.ts

@ -51,15 +51,10 @@ export const DeliverPlanMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '业务类型',
field: 'businessType',
sort: 'custom',
isForm:false,
table: {
width: 150
},
form: {
value: 'Deliver',
componentProps: {
disabled: true
}
}
},
{
label: '备注',

12
src/views/wms/supplierManage/purchaseclaim/purchaseclaimRequestMain/index.vue

@ -71,6 +71,7 @@
</template>
<script setup lang="ts">
import { getAccessToken } from '@/utils/auth'
import download from '@/utils/download'
import * as PurchaseclaimRequestMainApi from '@/api/wms/purchaseclaimRequestMain'
import * as PurchaseclaimRequestDetailApi from '@/api/wms/purchaseclaimRequestDetail'
@ -191,6 +192,7 @@ const buttondata = (row) => {
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), //
defaultButtons.mainListEditBtn({ hide:isShowMainButton(row,['1']),hasPermi: 'wms:purchaseclaim-request-main:update' }), //
defaultButtons.mainListDeleteBtn({ hide:isShowMainButton(row,['1']),hasPermi: 'wms:purchaseclaim-request-main:delete' }), //
defaultButtons.mainListPointBtn(null), //
]
}
@ -220,6 +222,8 @@ const buttonTableClick = async (val, row) => {
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
} else if (val == 'point') { //
handlePoint(row.id)
}
}
@ -267,6 +271,14 @@ const handleExport = async () => {
exportLoading.value = false
}
}
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/882550592342003712?token=' + getAccessToken())
console.log(src)
//
const handlePoint = async (id) => {
window.open(src.value+'&id='+id)
}
/**
* tableForm方法
*/

Loading…
Cancel
Save