Browse Source

策略单选变成多选

master
zhang_li 12 months ago
parent
commit
36502beb51
  1. 2
      src/views/wms/basicDataManage/strategySetting/strategy/arrivalInspectionStrategy/AddForm.vue
  2. 332
      src/views/wms/basicDataManage/strategySetting/strategy/batchStrategy/AddForm.vue
  3. 714
      src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue
  4. 2
      src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue
  5. 386
      src/views/wms/basicDataManage/strategySetting/strategy/manageAccuracyStrategy/AddForm.vue
  6. 2
      src/views/wms/basicDataManage/strategySetting/strategy/purchaseReceiptStrategy/AddForm.vue
  7. 251
      src/views/wms/basicDataManage/strategySetting/strategy/repairMaterialStrategy/AddForm.vue
  8. 14
      src/views/wms/basicDataManage/strategySetting/strategy/storageCapacityStrategy/AddForm.vue
  9. 8
      src/views/wms/basicDataManage/strategySetting/strategy/supplieDeliveryStrategy/AddForm.vue
  10. 26
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue
  11. 240
      src/views/wms/basicDataManage/strategySetting/strategy/utensilCapacityStrategy/AddForm.vue
  12. 4
      src/views/wms/basicDataManage/strategySetting/strategy/warehouseStorageStrategy/AddForm.vue

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

@ -106,6 +106,8 @@
placeholder="请选择供应商"
style="flex: 1"
clearable
multiple
collapse-tags
>
<el-option
v-for="cur in options.supplierList"

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

@ -1,15 +1,26 @@
<!-- 批次策略弹窗 -->
<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,47 +53,127 @@
<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="" style="width: 110px;margin-right: 10px;"
@change="changeSupplierCustomer">
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.typeOptions"
:key="index" />
<el-select
v-model="item.ParamCode"
placeholder=""
style="width: 110px; margin-right: 10px"
@change="changeSupplierCustomer"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="(cur, index) in options.typeOptions"
: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 == 'SupplierCode' ? '供应商' : '客户'}`"
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="`请选择${item.ParamCode == 'SupplierCode' ? '供应商' : '客户'}`"
style="flex: 1"
clearable
multiple
collapse-tags
>
<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 label="" label-width="0" class="err-240" v-if="index == 1">
<el-select v-model="item.ParamCode" placeholder="" @change="changeItemsType"
style="width: 110px;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.itemTypeOptions"
:key="item.value" />
<el-select
v-model="item.ParamCode"
placeholder=""
@change="changeItemsType"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="item.label"
:value="item.value"
v-for="item in options.itemTypeOptions"
:key="item.value"
/>
</el-select>
<el-select v-model="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
multiple
collapse-tags
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
multiple
collapse-tags
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-col>
</el-row>
@ -94,37 +185,61 @@
<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 formData.configuration.ManagementPrecision" :key="key">
<div style="width: 26px;display: flex;">
<Icon icon="ep:remove" color="#757575" size="26" style="cursor: pointer;"
@click="handleDeleteTable(formData.configuration.ManagementPrecision, cur, key)" v-if="formData?.configuration?.ManagementPrecision?.length > 1" />
<div
style="width: 100%; display: flex; align-items: center; margin-bottom: 10px"
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(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>
<el-select v-model="cur.BatchType" placeholder="请选择批次类型" style="flex:1">
<el-option v-for="it in getStrDictOptions(DICT_TYPE.BATCH_TYPE)" :key="it.value" :label="it.label"
:value="it.value" />
<el-select v-model="cur.BatchType" placeholder="请选择批次类型" style="flex: 1">
<el-option
v-for="it in getStrDictOptions(DICT_TYPE.BATCH_TYPE)"
:key="it.value"
:label="it.label"
:value="it.value"
/>
</el-select>
</div>
<div class="flex w-[28%]">
<div class="ml-10px mr-10px">批次格式</div>
<el-input v-model="cur.BatchFormat" placeholder="yyyyMMDD" clearable style="flex:1"
@blur="inputBlur" />
<el-input
v-model="cur.BatchFormat"
placeholder="yyyyMMDD"
clearable
style="flex: 1"
@blur="inputBlur"
/>
</div>
<div class="flex" style="flex:1">
<div class="flex" style="flex: 1">
<div class="ml-10px mr-10px">批次方向</div>
<div class="checkbox">
<el-radio-group v-model="cur.BatchDirection">
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.BATCH_DIRECTION)"
:key="cur.value">{{ cur.label }}</el-radio>
<el-radio
:label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.BATCH_DIRECTION)"
:key="cur.value"
>{{ cur.label }}</el-radio
>
</el-radio-group>
</div>
</div>
</div>
<div class="button flex">
<div @click="handleAddTable(formData.configuration.ManagementPrecision)">
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer;" />
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer" />
<div>添加条件</div>
</div>
</div>
@ -158,33 +273,33 @@ 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: 'SupplierCode', Operator: "IN", Value: "" },
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' },
// ///abc//
{ ParamCode: 'ItemType', Operator: "IN", Value: "" },
{ ParamCode: 'ItemType', Operator: 'IN', Value: '' }
],
configuration: {
//
ManagementPrecision:[{
BatchType: 'ARRIVE_TIME',
BatchFormat: '',
BatchDirection: 'ASC',
}]
ManagementPrecision: [
{
BatchType: 'ARRIVE_TIME',
BatchFormat: '',
BatchDirection: 'ASC'
}
]
},
configurationRules: '1'//
configurationRules: '1' //
})
//
const rules = ref({
@ -192,8 +307,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' }]
})
//
@ -207,11 +321,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
}
@ -221,12 +335,20 @@ const options = reactive({
rangeOptions1: formatRangeOptions('IN', 'NOT IN'),
rangeOptions2: formatRangeOptions('IN'),
//
typeOptions: [{ value: 'SupplierCode', label: '供应商' }, { value: 'CustomerCode', label: '客户' }],
typeOptions: [
{ value: 'SupplierCode', label: '供应商' },
{ value: 'CustomerCode', label: '客户' }
],
//
supplierList: [],
//
itemTypeOptions: [{ value: 'ItemType', label: '物品类型' }, { value: 'ItemGroup', label: '物品分组' }, { value: 'ItemCode', label: '物品' }, { value: 'Project', label: '项目' }, { value: 'AbcClass', label: 'ABC类' }],
itemTypeOptions: [
{ value: 'ItemType', label: '物品类型' },
{ value: 'ItemGroup', label: '物品分组' },
{ value: 'ItemCode', label: '物品' },
{ value: 'Project', label: '项目' },
{ value: 'AbcClass', label: 'ABC类' }
]
})
//
const Butttondata = ref([
@ -246,11 +368,11 @@ const buttonBaseClick = (val, item) => {
}
//
const getFormSupplierList = async () => {
options.supplierList = await getSupplierList();
options.supplierList = await getSupplierList()
}
//
const getFormCustomerList = async () => {
options.supplierList = await getCustomerList();
options.supplierList = await getCustomerList()
}
//
const changeSupplierCustomer = (e) => {
@ -287,7 +409,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.status = data.status == 0 ? true : false
if (formData.value.priority == 0) {
Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), //
defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) //
]
} else {
@ -328,7 +450,7 @@ const submitForm = async () => {
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
if(formData.value.priority == 0){
if (formData.value.priority == 0) {
message.error('优先级不可以为0')
return
}
@ -337,11 +459,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)
@ -365,27 +487,29 @@ 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: 'SupplierCode', Operator: "IN", Value: "" },
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' },
// ///abc//
{ ParamCode: 'ItemType', Operator: "IN", Value: "" },
{ ParamCode: 'ItemType', Operator: 'IN', Value: '' }
],
configuration: {
//
ManagementPrecision:[{
BatchType: 'ARRIVE_TIME',
BatchFormat: '',
BatchDirection: 'ASC',
}]
ManagementPrecision: [
{
BatchType: 'ARRIVE_TIME',
BatchFormat: '',
BatchDirection: 'ASC'
}
]
},
configurationRules: '1'//
configurationRules: '1' //
}
}
@ -394,7 +518,7 @@ const handleAddTable = (item) => {
item.push({
BatchType: 'ARRIVE_TIME',
BatchFormat: '',
BatchDirection: 'ASC',
BatchDirection: 'ASC'
})
}
//
@ -404,21 +528,21 @@ const handleDeleteTable = (item, cur, key) => {
//
const inputBlur = () => {
let arr = []
formData.value.configuration.ManagementPrecision.forEach(item => {
formData.value.configuration.ManagementPrecision.forEach((item) => {
let bol = false
if (!item.BatchFormat) {
bol = false
} else {
bol = true
}
arr.push(bol)
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'
}
@ -463,13 +587,13 @@ const inputBlur = () => {
}
.button {
>div {
> div {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
>div {
> div {
margin-left: 6px;
text-decoration: underline;
color: #409eff;

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

File diff suppressed because it is too large

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

@ -132,7 +132,7 @@
: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>

386
src/views/wms/basicDataManage/strategySetting/strategy/manageAccuracyStrategy/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>
<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,80 +53,226 @@
<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="" style="width: 110px;margin-right: 10px;"
@change="changeSupplierCustomer">
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.typeOptions"
:key="index" />
<el-select
v-model="item.ParamCode"
placeholder=""
style="width: 110px; margin-right: 10px"
@change="changeSupplierCustomer"
>
<el-option
:label="cur.label"
:value="cur.value"
v-for="(cur, index) in options.typeOptions"
: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 == 'SupplierCode' ? '供应商' : '客户'}`"
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="`请选择${item.ParamCode == 'SupplierCode' ? '供应商' : '客户'}`"
style="flex: 1"
clearable
multiple
collapse-tags
>
<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 label="" label-width="0" class="err-240" v-if="index == 1">
<el-select v-model="item.ParamCode" placeholder="" @change="changeItemsType"
style="width: 110px;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.itemTypeOptions"
:key="item.value" />
<el-select
v-model="item.ParamCode"
placeholder=""
@change="changeItemsType"
style="width: 110px; margin-right: 10px"
>
<el-option
:label="item.label"
:value="item.value"
v-for="item in options.itemTypeOptions"
:key="item.value"
/>
</el-select>
<el-select v-model="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
multiple
collapse-tags
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
multiple
collapse-tags
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 == 2">
<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.code" :label="cur.name" :value="cur.code" />
<el-select
v-model="item.Value"
:placeholder="`请选择${
item.ParamCode == 'WarehouseCode'
? '仓库'
: item.ParamCode == 'AreaCode'
? '库区'
: item.ParamCode == 'LocationGroupCode'
? '库位组'
: item.ParamCode == 'LocationCode'
? '库位'
: ''
}`"
clearable
multiple
collapse-tags
style="flex: 1"
>
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.code"
:value="cur.code"
/>
</el-select>
</el-form-item>
<!-- 忽略物品 -->
<el-form-item label="忽略物品" class="err-120" v-if="index == 3">
<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.rangeOptions2"
: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.rangeOptions2"
:key="cur.value"
/>
</el-select>
<el-input v-model="item.Value" placeholder="请输入忽略物品" clearable style="flex: 1;" />
<el-input
v-model="item.Value"
placeholder="请输入忽略物品,多个忽略物品以逗号分隔"
clearable
multiple
collapse-tags
style="flex: 1"
/>
</el-form-item>
<!-- 忽略库位 -->
<el-form-item label="忽略库位" class="err-120" v-if="index == 4">
<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.rangeOptions2"
: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.rangeOptions2"
:key="cur.value"
/>
</el-select>
<el-input v-model="item.Value" placeholder="请输入忽略库位" clearable style="flex: 1;" />
<el-input
v-model="item.Value"
placeholder="请输入忽略库位,多个忽略库位以逗号分隔"
clearable
multiple
collapse-tags
style="flex: 1"
/>
</el-form-item>
</el-col>
</el-row>
@ -129,8 +286,12 @@
<el-form-item label="管理精度">
<div class="checkbox">
<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
:label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.MANAGEMENT_MODE)"
:key="cur.value"
>{{ cur.label }}</el-radio
>
</el-radio-group>
</div>
</el-form-item>
@ -167,42 +328,39 @@ 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: 'SupplierCode', Operator: "IN", Value: "" },
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' },
// ///abc//
{ ParamCode: 'ItemType', Operator: "IN", Value: "" },
{ ParamCode: 'ItemType', Operator: 'IN', Value: '' },
//
{ ParamCode: 'LocationCode', Operator: "IN", Value: "" },
{ ParamCode: 'LocationCode', Operator: 'IN', Value: '' },
//
{ ParamCode: 'IgnoreListOfItem', Operator: "IN", Value: "" },
{ ParamCode: 'IgnoreListOfItem', Operator: 'IN', Value: '' },
//
{ ParamCode: 'IgnoreListOfLocation', Operator: "IN", Value: "" },
{ ParamCode: 'IgnoreListOfLocation', Operator: 'IN', Value: '' }
],
configuration: {
//
ManagementPrecision:'BY_PACKAGING'
ManagementPrecision: 'BY_PACKAGING'
}
})
//
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' }]
})
//
@ -216,11 +374,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
}
@ -230,18 +388,36 @@ const options = reactive({
rangeOptions1: formatRangeOptions('IN', 'NOT IN'),
rangeOptions2: formatRangeOptions('IN'),
//
typeOptions: [{ value: 'SupplierCode', label: '供应商' }, { value: 'CustomerCode', label: '客户' }],
typeOptions: [
{ value: 'SupplierCode', label: '供应商' },
{ value: 'CustomerCode', label: '客户' }
],
//
supplierList: [],
//
itemTypeOptions: [{ value: 'ItemType', label: '物品类型' }, { value: 'ItemGroup', label: '物品分组' }, { value: 'ItemCode', label: '物品' }, { value: 'Project', label: '项目' }, { value: 'AbcClass', label: 'ABC类' }],
itemTypeOptions: [
{ value: 'ItemType', label: '物品类型' },
{ value: 'ItemGroup', label: '物品分组' },
{ value: 'ItemCode', label: '物品' },
{ value: 'Project', label: '项目' },
{ value: 'AbcClass', label: 'ABC类' }
],
//
calculationTypeOptions: [{ value: 'Weight', label: '重量' }, { value: 'Volume', label: '体积' }, { value: 'Area', label: '面积' }],
calculationTypeOptions: [
{ value: 'Weight', label: '重量' },
{ value: 'Volume', label: '体积' },
{ value: 'Area', label: '面积' }
],
warehouseTypeOptions: [{ value: 'WarehouseCode', label: '仓库' }, { value: 'AreaCode', label: '库区' }, { value: 'LocationGroupCode', label: '库位组' }, { value: 'LocationCode', label: '库位' }],
warehouseTypeOptions: [
{ value: 'WarehouseCode', label: '仓库' },
{ value: 'AreaCode', label: '库区' },
{ value: 'LocationGroupCode', label: '库位组' },
{ value: 'LocationCode', label: '库位' }
],
//
warehouseList: [],
warehouseList: []
})
//
const Butttondata = ref([
@ -261,11 +437,11 @@ const buttonBaseClick = (val, item) => {
}
//
const getFormSupplierList = async () => {
options.supplierList = await getSupplierList();
options.supplierList = await getSupplierList()
}
//
const getFormCustomerList = async () => {
options.supplierList = await getCustomerList();
options.supplierList = await getCustomerList()
}
//
const changeSupplierCustomer = (e) => {
@ -284,19 +460,19 @@ 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 () => {
options.warehouseList = await getLocationList();
options.warehouseList = await getLocationList()
}
getFormLocationList()
// ///
@ -332,7 +508,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.status = data.status == 0 ? true : false
if (formData.value.priority == 0) {
Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), //
defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) //
]
} else {
@ -363,7 +539,6 @@ const open = async (type: string, strategyCode: string, id?: number) => {
} else if (formData.value.condition[2].ParamCode == 'LocationCode') {
getFormLocationList()
}
} finally {
formLoading.value = false
}
@ -384,7 +559,7 @@ const submitForm = async () => {
const valid = await formRef.value.validate()
if (!valid) return
if(formData.value.priority == 0){
if (formData.value.priority == 0) {
message.error('优先级不可以为0')
return
}
@ -393,11 +568,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)
@ -421,31 +596,30 @@ 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: 'SupplierCode', Operator: "IN", Value: "" },
{ ParamCode: 'SupplierCode', Operator: 'IN', Value: '' },
// ///abc//
{ ParamCode: 'ItemType', Operator: "IN", Value: "" },
{ ParamCode: 'ItemType', Operator: 'IN', Value: '' },
//
{ ParamCode: 'LocationCode', Operator: "IN", Value: "" },
{ ParamCode: 'LocationCode', Operator: 'IN', Value: '' },
//
{ ParamCode: 'IgnoreListOfItem', Operator: "IN", Value: "" },
{ ParamCode: 'IgnoreListOfItem', Operator: 'IN', Value: '' },
//
{ ParamCode: 'IgnoreListOfLocation', Operator: "IN", Value: "" },
{ ParamCode: 'IgnoreListOfLocation', Operator: 'IN', Value: '' }
],
configuration: {
//
ManagementPrecision:'BY_PACKAGING'
}
//
ManagementPrecision: 'BY_PACKAGING'
}
}
}
</script>
<style scoped lang="scss">
.item {

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

@ -107,6 +107,8 @@
placeholder="请选择供应商"
style="flex: 1"
clearable
multiple
collapse-tags
>
<el-option
v-for="cur in options.supplierList"

251
src/views/wms/basicDataManage/strategySetting/strategy/repairMaterialStrategy/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,136 @@
<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
multiple
collapse-tags
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
multiple
collapse-tags
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.code" :label="cur.name" :value="cur.code" />
<el-select
v-model="item.Value"
:placeholder="`请选择${
item.ParamCode == 'WarehouseCode'
? '仓库'
: item.ParamCode == 'AreaCode'
? '库区'
: item.ParamCode == 'LocationGroupCode'
? '库位组'
: item.ParamCode == 'LocationCode'
? '库位'
: ''
}`"
clearable
multiple
collapse-tags
style="flex: 1"
>
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.code"
:value="cur.code"
/>
</el-select>
</el-form-item>
</el-col>
@ -95,32 +195,76 @@
<el-row gutter="10">
<!-- 最大库存 -->
<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
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-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
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-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
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-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
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>
</el-row>
@ -312,7 +456,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.status = data.status == 0 ? true : false
if (formData.value.priority == 0) {
Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), //
defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) //
]
} else {
@ -341,7 +485,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
} finally {
formLoading.value = false
}
}else {
} else {
Butttondata.value = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
@ -357,7 +501,7 @@ const submitForm = async () => {
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
if(formData.value.priority == 0){
if (formData.value.priority == 0) {
message.error('优先级不可以为0')
return
}
@ -419,7 +563,6 @@ const resetForm = () => {
}
}
const validatorNum = (rule: any, value: any, callback: any) => {
if (value && formData.value.configuration.MaxQty != -1) {
if (value > formData.value.configuration.MaxQty) {

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

@ -83,6 +83,8 @@
placeholder="请选择物品类型"
style="flex: 1"
clearable
multiple
collapse-tags
v-if="item.ParamCode == 'ItemType'"
>
<el-option
@ -97,6 +99,8 @@
placeholder="请选择ABC类"
style="flex: 1"
clearable
multiple
collapse-tags
v-else-if="item.ParamCode == 'AbcClass'"
>
<el-option
@ -108,21 +112,21 @@
</el-select>
<el-input
v-model="item.Value"
placeholder="请输入物品分组"
placeholder="请输入物品分组,多个物品分组以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemGroup'"
/>
<el-input
v-model="item.Value"
placeholder="请输入项目"
placeholder="请输入项目,多个项目以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'Project'"
/>
<el-input
v-model="item.Value"
placeholder="请输入物品"
placeholder="请输入物品,多个物品以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'"
@ -169,12 +173,14 @@
: ''
}`"
clearable
multiple
collapse-tags
style="flex: 1"
>
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>

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

@ -107,6 +107,8 @@
placeholder="请选择供应商"
style="flex: 1"
clearable
multiple
collapse-tags
>
<el-option
v-for="cur in options.supplierList"
@ -195,7 +197,7 @@
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>
@ -210,7 +212,7 @@
<el-option
v-for="cur in options.dockList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>
@ -225,7 +227,7 @@
<el-option
v-for="cur in options.locationList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>

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

@ -84,6 +84,8 @@
:placeholder="`请选择${item.ParamCode == 'SupplierCode' ? '供应商' : '客户'}`"
style="flex: 1"
clearable
multiple
collapse-tags
>
<el-option
v-for="cur in options.supplierList"
@ -125,6 +127,8 @@
placeholder="请选择物品类型"
style="flex: 1"
clearable
multiple
collapse-tags
v-if="item.ParamCode == 'ItemType'"
>
<el-option
@ -139,6 +143,8 @@
placeholder="请选择ABC类"
style="flex: 1"
clearable
multiple
collapse-tags
v-else-if="item.ParamCode == 'AbcClass'"
>
<el-option
@ -150,21 +156,21 @@
</el-select>
<el-input
v-model="item.Value"
placeholder="请输入物品分组"
placeholder="请输入物品分组,多个物品分组以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemGroup'"
/>
<el-input
v-model="item.Value"
placeholder="请输入项目"
placeholder="请输入项目,多个项目以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'Project'"
/>
<el-input
v-model="item.Value"
placeholder="请输入物品"
placeholder="请输入物品,多个物品以逗号分隔"
clearable
style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'"
@ -225,6 +231,8 @@
placeholder="请选择库存状态"
style="flex: 1"
clearable
multiple
collapse-tags
>
<el-option
v-for="cur in getStrDictOptions(DICT_TYPE.INVENTORY_STATUS)"
@ -253,6 +261,8 @@
placeholder="请选择存储类型"
style="flex: 1"
clearable
multiple
collapse-tags
>
<el-option
v-for="cur in getStrDictOptions(DICT_TYPE.STORAGE_TYPE)"
@ -278,7 +288,7 @@
</el-select>
<el-input
v-model="item.Value"
placeholder="请输入库存事务"
placeholder="请输入库存事务,多个库存事务以逗号分隔"
clearable
style="flex: 1"
/>
@ -317,7 +327,7 @@
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>
@ -331,7 +341,7 @@
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>
@ -345,7 +355,7 @@
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>
@ -360,7 +370,7 @@
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>

240
src/views/wms/basicDataManage/strategySetting/strategy/utensilCapacityStrategy/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">
@ -41,47 +52,125 @@
<el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index">
<!-- 器具类型 -->
<el-form-item label="器具类型" class="err-120" v-if="index == 0" :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.rangeOptions1"
:key="cur.value" />
<el-form-item
label="器具类型"
class="err-120"
v-if="index == 0"
: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.rangeOptions1"
:key="cur.value"
/>
</el-select>
<el-select v-model="item.Value" placeholder="请选择器具类型" style="flex: 1;" clearable>
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.CONTAINER_TYPE)" :key="cur.value"
:label="cur.label" :value="cur.value" />
<el-select
v-model="item.Value"
placeholder="请选择器具类型"
style="flex: 1"
clearable
multiple
collapse-tags
>
<el-option
v-for="cur in getStrDictOptions(DICT_TYPE.CONTAINER_TYPE)"
:key="cur.value"
:label="cur.label"
:value="cur.value"
/>
</el-select>
</el-form-item>
<!-- 选择物品类型 -->
<el-form-item label="" label-width="0" class="err-240" v-if="index == 1">
<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
multiple
collapse-tags
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
multiple
collapse-tags
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-col>
</el-row>
@ -93,9 +182,16 @@
<el-row gutter="10">
<el-col :span="24">
<!-- 容纳数量 -->
<el-form-item label="容纳数量" prop="configuration.ContentCount"
:rules="[{ required: true, message: '请输入容纳数量', trigger: 'change', }]">
<el-input-number v-model="formData.configuration.ContentCount" :min="-1" controls-position="right" />
<el-form-item
label="容纳数量"
prop="configuration.ContentCount"
:rules="[{ required: true, message: '请输入容纳数量', trigger: 'change' }]"
>
<el-input-number
v-model="formData.configuration.ContentCount"
:min="-1"
controls-position="right"
/>
</el-form-item>
</el-col>
</el-row>
@ -115,7 +211,6 @@ import * as RuleApi from '@/api/wms/rule'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const { t } = useI18n() //
const message = useMessage() //
@ -125,35 +220,33 @@ 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: 'ContainerType', Operator: "IN", Value: "" },
{ ParamCode: 'ContainerType', Operator: 'IN', Value: '' },
// ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
{ ParamCode: 'ItemGroup', Operator: 'IN', Value: '' }
],
configuration: {
//
ContentCount:0
ContentCount: 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' }]
})
//
@ -167,11 +260,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
}
@ -181,7 +274,11 @@ 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: '项目' }
]
})
//
const Butttondata = ref([
@ -224,7 +321,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.status = data.status == 0 ? true : false
if (formData.value.priority == 0) {
Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), //
defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) //
]
} else {
@ -239,7 +336,6 @@ const open = async (type: string, strategyCode: string, id?: number) => {
if (data.configuration) {
formData.value.configuration = JSON.parse(data.configuration)
}
} finally {
formLoading.value = false
}
@ -259,7 +355,7 @@ const submitForm = async () => {
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
if(formData.value.priority == 0){
if (formData.value.priority == 0) {
message.error('优先级不可以为0')
return
}
@ -268,11 +364,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)
@ -296,32 +392,30 @@ 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: 'ContainerType', Operator: "IN", Value: "" },
{ ParamCode: 'ContainerType', Operator: 'IN', Value: '' },
// ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
{ ParamCode: 'ItemGroup', Operator: 'IN', Value: '' }
],
configuration: {
//
ContentCount:0
ContentCount: 0
}
}
}
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"))
callback(new Error('11'))
} else {
callback()
}
} else {

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

@ -86,7 +86,7 @@
<el-option
v-for="cur in options.warehouseList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>
@ -125,7 +125,7 @@
<el-option
v-for="cur in options.overflowWarehouseList"
:key="cur.code"
:label="cur.name"
:label="cur.code"
:value="cur.code"
/>
</el-select>

Loading…
Cancel
Save