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. 722
      src/views/wms/basicDataManage/strategySetting/strategy/downShelfStrategy/AddForm.vue
  4. 2
      src/views/wms/basicDataManage/strategySetting/strategy/inspectStrategy/AddForm.vue
  5. 388
      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="请选择供应商" placeholder="请选择供应商"
style="flex: 1" style="flex: 1"
clearable clearable
multiple
collapse-tags
> >
<el-option <el-option
v-for="cur in options.supplierList" v-for="cur in options.supplierList"

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

@ -1,15 +1,26 @@
<!-- 批次策略弹窗 --> <!-- 批次策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width:800px;"> <Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 800px">
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;"> <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"> <el-form
ref="formRef"
:model="formData"
:rules="rules"
label-width="120px"
label-position="left"
>
<!-- 规则 --> <!-- 规则 -->
<div class="item"> <div class="item">
<div class="title">规则</div> <div class="title">规则</div>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="代码" prop="strategyCode"> <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-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -42,47 +53,127 @@
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index"> <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-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;" <el-select
@change="changeSupplierCustomer"> v-model="item.ParamCode"
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.typeOptions" placeholder=""
:key="index" /> 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>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> <el-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1" v-model="item.Operator"
:key="cur.value" /> 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>
<el-select v-model="item.Value" :placeholder="`请选择${item.ParamCode == 'SupplierCode' ? '供应商' : '客户'}`" <el-select
style="flex: 1;" clearable> v-model="item.Value"
<el-option v-for="cur in options.supplierList" :key="cur.id" :label="cur.name" :value="cur.id" /> :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-select>
</el-form-item> </el-form-item>
<!-- 选择物品类型 --> <!-- 选择物品类型 -->
<el-form-item label="" label-width="0" class="err-240" v-if="index == 1"> <el-form-item label="" label-width="0" class="err-240" v-if="index == 1">
<el-select v-model="item.ParamCode" placeholder="" @change="changeItemsType" <el-select
style="width: 110px;margin-right: 10px;"> v-model="item.ParamCode"
<el-option :label="item.label" :value="item.value" v-for="item in options.itemTypeOptions" placeholder=""
:key="item.value" /> @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>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> <el-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1" v-model="item.Operator"
:key="cur.value" /> 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>
<el-select v-model="item.Value" placeholder="请选择物品类型" style="flex: 1;" clearable <el-select
v-if="item.ParamCode == 'ItemType'"> v-model="item.Value"
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :key="cur.value" :label="cur.label" placeholder="请选择物品类型"
:value="cur.value" /> 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>
<el-select v-model="item.Value" placeholder="请选择ABC类" style="flex: 1;" clearable <el-select
v-else-if="item.ParamCode == 'AbcClass'"> v-model="item.Value"
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ABC_CLASS)" :key="cur.value" :label="cur.label" placeholder="请选择ABC类"
:value="cur.value" /> 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-select>
<el-input v-model="item.Value" placeholder="请输入物品分组" clearable style="flex: 1;" <el-input
v-else-if="item.ParamCode == 'ItemGroup'" /> v-model="item.Value"
<el-input v-model="item.Value" placeholder="请输入项目" clearable style="flex: 1;" placeholder="请输入物品分组,多个物品分组以逗号分隔"
v-else-if="item.ParamCode == 'Project'" /> clearable
<el-input v-model="item.Value" placeholder="请输入物品" clearable style="flex: 1;" style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'" /> 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>
</el-col> </el-col>
</el-row> </el-row>
@ -94,37 +185,61 @@
<el-col :span="24"> <el-col :span="24">
<!-- 存储类型 --> <!-- 存储类型 -->
<el-form-item label="" label-width="0" class="flex-top" prop="configurationRules"> <el-form-item label="" label-width="0" class="flex-top" prop="configurationRules">
<div style="width: 100%;display:flex;align-items:center;margin-bottom:10px" <div
v-for="(cur, key) in formData.configuration.ManagementPrecision" :key="key"> style="width: 100%; display: flex; align-items: center; margin-bottom: 10px"
<div style="width: 26px;display: flex;"> v-for="(cur, key) in formData.configuration.ManagementPrecision"
<Icon icon="ep:remove" color="#757575" size="26" style="cursor: pointer;" :key="key"
@click="handleDeleteTable(formData.configuration.ManagementPrecision, cur, key)" v-if="formData?.configuration?.ManagementPrecision?.length > 1" /> >
<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>
<div class="flex w-[28%]"> <div class="flex w-[28%]">
<div class="ml-10px mr-10px">批次类型</div> <div class="ml-10px mr-10px">批次类型</div>
<el-select v-model="cur.BatchType" placeholder="请选择批次类型" style="flex:1"> <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" <el-option
:value="it.value" /> v-for="it in getStrDictOptions(DICT_TYPE.BATCH_TYPE)"
:key="it.value"
:label="it.label"
:value="it.value"
/>
</el-select> </el-select>
</div> </div>
<div class="flex w-[28%]"> <div class="flex w-[28%]">
<div class="ml-10px mr-10px">批次格式</div> <div class="ml-10px mr-10px">批次格式</div>
<el-input v-model="cur.BatchFormat" placeholder="yyyyMMDD" clearable style="flex:1" <el-input
@blur="inputBlur" /> v-model="cur.BatchFormat"
placeholder="yyyyMMDD"
clearable
style="flex: 1"
@blur="inputBlur"
/>
</div> </div>
<div class="flex" style="flex:1"> <div class="flex" style="flex: 1">
<div class="ml-10px mr-10px">批次方向</div> <div class="ml-10px mr-10px">批次方向</div>
<div class="checkbox"> <div class="checkbox">
<el-radio-group v-model="cur.BatchDirection"> <el-radio-group v-model="cur.BatchDirection">
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.BATCH_DIRECTION)" <el-radio
:key="cur.value">{{ cur.label }}</el-radio> :label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.BATCH_DIRECTION)"
:key="cur.value"
>{{ cur.label }}</el-radio
>
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
</div> </div>
<div class="button flex"> <div class="button flex">
<div @click="handleAddTable(formData.configuration.ManagementPrecision)"> <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>
</div> </div>
</div> </div>
@ -158,33 +273,33 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formRef = ref() // Ref const formRef = ref() // Ref
const formStrategyCode = ref('') const formStrategyCode = ref('')
// form // form
const formData = ref({ const formData = ref({
id: '', id: '',
strategyCode: formStrategyCode.value,//id strategyCode: formStrategyCode.value, //id
name: '',// name: '', //
description: '',// description: '', //
priority: '',// priority: '', //
status: true,// status: true, //
// //
condition: [ condition: [
// //
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }, { ParamCode: 'SupplierCode', Operator: 'IN', Value: '' },
// ///abc// // ///abc//
{ ParamCode: 'ItemType', Operator: "IN", Value: "" }, { ParamCode: 'ItemType', Operator: 'IN', Value: '' }
], ],
configuration: { configuration: {
// //
ManagementPrecision:[{ ManagementPrecision: [
BatchType: 'ARRIVE_TIME', {
BatchFormat: '', BatchType: 'ARRIVE_TIME',
BatchDirection: 'ASC', BatchFormat: '',
}] BatchDirection: 'ASC'
}
]
}, },
configurationRules: '1'// configurationRules: '1' //
}) })
// //
const rules = ref({ const rules = ref({
@ -192,8 +307,7 @@ const rules = ref({
name: [{ required: true, message: '请输入名字', trigger: 'blur' }], name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' }], description: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ 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: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' }, { value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' }, { value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' }, { value: 'NOT NULL', label: '不为空' }
] ]
const formatRangeOptions = (...rest) => { 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 return result
} }
@ -221,12 +335,20 @@ const options = reactive({
rangeOptions1: formatRangeOptions('IN', 'NOT IN'), rangeOptions1: formatRangeOptions('IN', 'NOT IN'),
rangeOptions2: formatRangeOptions('IN'), rangeOptions2: formatRangeOptions('IN'),
// //
typeOptions: [{ value: 'SupplierCode', label: '供应商' }, { value: 'CustomerCode', label: '客户' }], typeOptions: [
{ value: 'SupplierCode', label: '供应商' },
{ value: 'CustomerCode', label: '客户' }
],
// //
supplierList: [], 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([ const Butttondata = ref([
@ -246,11 +368,11 @@ const buttonBaseClick = (val, item) => {
} }
// //
const getFormSupplierList = async () => { const getFormSupplierList = async () => {
options.supplierList = await getSupplierList(); options.supplierList = await getSupplierList()
} }
// //
const getFormCustomerList = async () => { const getFormCustomerList = async () => {
options.supplierList = await getCustomerList(); options.supplierList = await getCustomerList()
} }
// //
const changeSupplierCustomer = (e) => { const changeSupplierCustomer = (e) => {
@ -287,7 +409,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.status = data.status == 0 ? true : false formData.value.status = data.status == 0 ? true : false
if (formData.value.priority == 0) { if (formData.value.priority == 0) {
Butttondata.value = [ Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), // defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) // defaultButtons.formCloseBtn(null) //
] ]
} else { } else {
@ -328,7 +450,7 @@ const submitForm = async () => {
if (!formRef) return if (!formRef) return
const valid = await formRef.value.validate() const valid = await formRef.value.validate()
if (!valid) return if (!valid) return
if(formData.value.priority == 0){ if (formData.value.priority == 0) {
message.error('优先级不可以为0') message.error('优先级不可以为0')
return return
} }
@ -337,11 +459,11 @@ const submitForm = async () => {
try { try {
let data = { let data = {
id: formData.value.id, id: formData.value.id,
strategyCode: formData.value.strategyCode,// strategyCode: formData.value.strategyCode, //
name: formData.value.name,// name: formData.value.name, //
description: formData.value.description,// description: formData.value.description, //
priority: formData.value.priority,// priority: formData.value.priority, //
status: formData.value.status ? 0 : 1,// status: formData.value.status ? 0 : 1, //
// //
condition: JSON.stringify(formData.value.condition), condition: JSON.stringify(formData.value.condition),
configuration: JSON.stringify(formData.value.configuration) configuration: JSON.stringify(formData.value.configuration)
@ -365,27 +487,29 @@ const submitForm = async () => {
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
id: '', id: '',
strategyCode: formStrategyCode.value,//id strategyCode: formStrategyCode.value, //id
name: '',// name: '', //
description: '',// description: '', //
priority: '',// priority: '', //
status: true,// status: true, //
// //
condition: [ condition: [
// //
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }, { ParamCode: 'SupplierCode', Operator: 'IN', Value: '' },
// ///abc// // ///abc//
{ ParamCode: 'ItemType', Operator: "IN", Value: "" }, { ParamCode: 'ItemType', Operator: 'IN', Value: '' }
], ],
configuration: { configuration: {
// //
ManagementPrecision:[{ ManagementPrecision: [
BatchType: 'ARRIVE_TIME', {
BatchFormat: '', BatchType: 'ARRIVE_TIME',
BatchDirection: 'ASC', BatchFormat: '',
}] BatchDirection: 'ASC'
}
]
}, },
configurationRules: '1'// configurationRules: '1' //
} }
} }
@ -394,7 +518,7 @@ const handleAddTable = (item) => {
item.push({ item.push({
BatchType: 'ARRIVE_TIME', BatchType: 'ARRIVE_TIME',
BatchFormat: '', BatchFormat: '',
BatchDirection: 'ASC', BatchDirection: 'ASC'
}) })
} }
// //
@ -404,21 +528,21 @@ const handleDeleteTable = (item, cur, key) => {
// //
const inputBlur = () => { const inputBlur = () => {
let arr = [] let arr = []
formData.value.configuration.ManagementPrecision.forEach(item => { formData.value.configuration.ManagementPrecision.forEach((item) => {
let bol = false let bol = false
if (!item.BatchFormat) { if (!item.BatchFormat) {
bol = false bol = false
} else { } else {
bol = true bol = true
} }
arr.push(bol) arr.push(bol)
}) })
const isEmpty = arr.some(cur => { const isEmpty = arr.some((cur) => {
return !cur return !cur
}) })
if (isEmpty) { if (isEmpty) {
formData.value.configurationRules = '' formData.value.configurationRules = ''
return; return
} else { } else {
formData.value.configurationRules = '1' formData.value.configurationRules = '1'
} }
@ -463,13 +587,13 @@ const inputBlur = () => {
} }
.button { .button {
>div { > div {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
>div { > div {
margin-left: 6px; margin-left: 6px;
text-decoration: underline; text-decoration: underline;
color: #409eff; color: #409eff;

722
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" :key="cur.value"
/> />
</el-select> </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-form-item>
</el-col> </el-col>
</el-row> </el-row>

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

@ -1,15 +1,26 @@
<!-- 管理精度策略弹窗 --> <!-- 管理精度策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px;"> <Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px">
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;"> <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"> <el-form
ref="formRef"
:model="formData"
:rules="rules"
label-width="120px"
label-position="left"
>
<!-- 规则 --> <!-- 规则 -->
<div class="item"> <div class="item">
<div class="title">规则</div> <div class="title">规则</div>
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="代码" prop="strategyCode"> <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-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -42,80 +53,226 @@
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index"> <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-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;" <el-select
@change="changeSupplierCustomer"> v-model="item.ParamCode"
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.typeOptions" placeholder=""
:key="index" /> 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>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> <el-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1" v-model="item.Operator"
:key="cur.value" /> 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>
<el-select v-model="item.Value" :placeholder="`请选择${item.ParamCode == 'SupplierCode' ? '供应商' : '客户'}`" <el-select
style="flex: 1;" clearable> v-model="item.Value"
<el-option v-for="cur in options.supplierList" :key="cur.id" :label="cur.name" :value="cur.id" /> :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-select>
</el-form-item> </el-form-item>
<!-- 选择物品类型 --> <!-- 选择物品类型 -->
<el-form-item label="" label-width="0" class="err-240" v-if="index == 1"> <el-form-item label="" label-width="0" class="err-240" v-if="index == 1">
<el-select v-model="item.ParamCode" placeholder="" @change="changeItemsType" <el-select
style="width: 110px;margin-right: 10px;"> v-model="item.ParamCode"
<el-option :label="item.label" :value="item.value" v-for="item in options.itemTypeOptions" placeholder=""
:key="item.value" /> @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>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> <el-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1" v-model="item.Operator"
:key="cur.value" /> 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>
<el-select v-model="item.Value" placeholder="请选择物品类型" style="flex: 1;" clearable <el-select
v-if="item.ParamCode == 'ItemType'"> v-model="item.Value"
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :key="cur.value" :label="cur.label" placeholder="请选择物品类型"
:value="cur.value" /> 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>
<el-select v-model="item.Value" placeholder="请选择ABC类" style="flex: 1;" clearable <el-select
v-else-if="item.ParamCode == 'AbcClass'"> v-model="item.Value"
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ABC_CLASS)" :key="cur.value" :label="cur.label" placeholder="请选择ABC类"
:value="cur.value" /> 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-select>
<el-input v-model="item.Value" placeholder="请输入物品分组" clearable style="flex: 1;" <el-input
v-else-if="item.ParamCode == 'ItemGroup'" /> v-model="item.Value"
<el-input v-model="item.Value" placeholder="请输入项目" clearable style="flex: 1;" placeholder="请输入物品分组,多个物品分组以逗号分隔"
v-else-if="item.ParamCode == 'Project'" /> clearable
<el-input v-model="item.Value" placeholder="请输入物品" clearable style="flex: 1;" style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'" /> 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>
<!-- 仓库 库区 库位组 库位 --> <!-- 仓库 库区 库位组 库位 -->
<el-form-item label="" label-width="0" class="err-240" v-if="index == 2"> <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;" <el-select
@change="changeWarehouse"> v-model="item.ParamCode"
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions" placeholder=""
:key="index" /> 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>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> <el-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1" v-model="item.Operator"
:key="cur.value" /> 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>
<el-select v-model="item.Value" <el-select
:placeholder="`请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`" v-model="item.Value"
clearable style="flex: 1;"> :placeholder="`请选择${
<el-option v-for="cur in options.warehouseList" :key="cur.code" :label="cur.name" :value="cur.code" /> 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-select>
</el-form-item> </el-form-item>
<!-- 忽略物品 --> <!-- 忽略物品 -->
<el-form-item label="忽略物品" class="err-120" v-if="index == 3"> <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-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions2" v-model="item.Operator"
:key="cur.value" /> 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-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>
<!-- 忽略库位 --> <!-- 忽略库位 -->
<el-form-item label="忽略库位" class="err-120" v-if="index == 4"> <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-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions2" v-model="item.Operator"
:key="cur.value" /> 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-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>
</el-col> </el-col>
</el-row> </el-row>
@ -129,8 +286,12 @@
<el-form-item label="管理精度"> <el-form-item label="管理精度">
<div class="checkbox"> <div class="checkbox">
<el-radio-group v-model="formData.configuration.ManagementPrecision"> <el-radio-group v-model="formData.configuration.ManagementPrecision">
<el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.MANAGEMENT_MODE)" <el-radio
:key="cur.value">{{ cur.label }}</el-radio> :label="cur.value"
v-for="cur in getStrDictOptions(DICT_TYPE.MANAGEMENT_MODE)"
:key="cur.value"
>{{ cur.label }}</el-radio
>
</el-radio-group> </el-radio-group>
</div> </div>
</el-form-item> </el-form-item>
@ -167,42 +328,39 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formRef = ref() // Ref const formRef = ref() // Ref
const formStrategyCode = ref('') const formStrategyCode = ref('')
// form // form
const formData = ref({ const formData = ref({
id: '', id: '',
strategyCode: formStrategyCode.value,//id strategyCode: formStrategyCode.value, //id
name: '',// name: '', //
description: '',// description: '', //
priority: '',// priority: '', //
status: true,// status: true, //
// //
condition: [ condition: [
// //
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }, { ParamCode: 'SupplierCode', Operator: 'IN', Value: '' },
// ///abc// // ///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: { configuration: {
// //
ManagementPrecision:'BY_PACKAGING' ManagementPrecision: 'BY_PACKAGING'
} }
}) })
// //
const rules = ref({ const rules = ref({
strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }], strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }], name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
description: [{ 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: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' }, { value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' }, { value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' }, { value: 'NOT NULL', label: '不为空' }
] ]
const formatRangeOptions = (...rest) => { 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 return result
} }
@ -230,18 +388,36 @@ const options = reactive({
rangeOptions1: formatRangeOptions('IN', 'NOT IN'), rangeOptions1: formatRangeOptions('IN', 'NOT IN'),
rangeOptions2: formatRangeOptions('IN'), rangeOptions2: formatRangeOptions('IN'),
// //
typeOptions: [{ value: 'SupplierCode', label: '供应商' }, { value: 'CustomerCode', label: '客户' }], typeOptions: [
{ value: 'SupplierCode', label: '供应商' },
{ value: 'CustomerCode', label: '客户' }
],
// //
supplierList: [], 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([ const Butttondata = ref([
@ -261,11 +437,11 @@ const buttonBaseClick = (val, item) => {
} }
// //
const getFormSupplierList = async () => { const getFormSupplierList = async () => {
options.supplierList = await getSupplierList(); options.supplierList = await getSupplierList()
} }
// //
const getFormCustomerList = async () => { const getFormCustomerList = async () => {
options.supplierList = await getCustomerList(); options.supplierList = await getCustomerList()
} }
// //
const changeSupplierCustomer = (e) => { const changeSupplierCustomer = (e) => {
@ -284,19 +460,19 @@ const changeItemsType = () => {
// //
const getFormWarehouseList = async () => { const getFormWarehouseList = async () => {
options.warehouseList = await getWarehouseList(); options.warehouseList = await getWarehouseList()
} }
// //
const getFormAreaList = async () => { const getFormAreaList = async () => {
options.warehouseList = await getAreaList(); options.warehouseList = await getAreaList()
} }
// //
const getFormLocationgrouList = async () => { const getFormLocationgrouList = async () => {
options.warehouseList = await getLocationgroupList(); options.warehouseList = await getLocationgroupList()
} }
// //
const getFormLocationList = async () => { const getFormLocationList = async () => {
options.warehouseList = await getLocationList(); options.warehouseList = await getLocationList()
} }
getFormLocationList() getFormLocationList()
// /// // ///
@ -332,7 +508,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.status = data.status == 0 ? true : false formData.value.status = data.status == 0 ? true : false
if (formData.value.priority == 0) { if (formData.value.priority == 0) {
Butttondata.value = [ Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), // defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) // defaultButtons.formCloseBtn(null) //
] ]
} else { } else {
@ -363,7 +539,6 @@ const open = async (type: string, strategyCode: string, id?: number) => {
} else if (formData.value.condition[2].ParamCode == 'LocationCode') { } else if (formData.value.condition[2].ParamCode == 'LocationCode') {
getFormLocationList() getFormLocationList()
} }
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -383,8 +558,8 @@ const submitForm = async () => {
if (!formRef) return if (!formRef) return
const valid = await formRef.value.validate() const valid = await formRef.value.validate()
if (!valid) return if (!valid) return
if(formData.value.priority == 0){ if (formData.value.priority == 0) {
message.error('优先级不可以为0') message.error('优先级不可以为0')
return return
} }
@ -393,11 +568,11 @@ const submitForm = async () => {
try { try {
let data = { let data = {
id: formData.value.id, id: formData.value.id,
strategyCode: formData.value.strategyCode,// strategyCode: formData.value.strategyCode, //
name: formData.value.name,// name: formData.value.name, //
description: formData.value.description,// description: formData.value.description, //
priority: formData.value.priority,// priority: formData.value.priority, //
status: formData.value.status ? 0 : 1,// status: formData.value.status ? 0 : 1, //
// //
condition: JSON.stringify(formData.value.condition), condition: JSON.stringify(formData.value.condition),
configuration: JSON.stringify(formData.value.configuration) configuration: JSON.stringify(formData.value.configuration)
@ -421,31 +596,30 @@ const submitForm = async () => {
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
id: '', id: '',
strategyCode: formStrategyCode.value,//id strategyCode: formStrategyCode.value, //id
name: '',// name: '', //
description: '',// description: '', //
priority: '',// priority: '', //
status: true,// status: true, //
// //
condition: [ condition: [
// //
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }, { ParamCode: 'SupplierCode', Operator: 'IN', Value: '' },
// ///abc// // ///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: { configuration: {
// //
ManagementPrecision:'BY_PACKAGING' ManagementPrecision: 'BY_PACKAGING'
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.item { .item {

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

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

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

@ -1,15 +1,26 @@
<!-- 补料策略弹窗 --> <!-- 补料策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px;"> <Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px">
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;"> <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"> <el-form
ref="formRef"
:model="formData"
:rules="rules"
label-width="120px"
label-position="left"
>
<!-- 规则 --> <!-- 规则 -->
<div class="item"> <div class="item">
<div class="title">规则</div> <div class="title">规则</div>
<el-row gutter="10"> <el-row gutter="10">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="代码" prop="strategyCode"> <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-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -42,47 +53,136 @@
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index"> <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-form-item label="" label-width="0" class="err-240" v-if="index == 0">
<el-select v-model="item.ParamCode" placeholder="" @change="changeItemsType" <el-select
style="width: 110px;margin-right: 10px;"> v-model="item.ParamCode"
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.itemTypeOptions" placeholder=""
:key="cur.value" /> @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>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> <el-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1" v-model="item.Operator"
:key="cur.value" /> 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>
<el-select v-model="item.Value" placeholder="请选择物品类型" style="flex: 1;" clearable <el-select
v-if="item.ParamCode == 'ItemType'"> v-model="item.Value"
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :key="cur.value" :label="cur.label" placeholder="请选择物品类型"
:value="cur.value" /> 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>
<el-select v-model="item.Value" placeholder="请选择ABC类" style="flex: 1;" clearable <el-select
v-else-if="item.ParamCode == 'AbcClass'"> v-model="item.Value"
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ABC_CLASS)" :key="cur.value" :label="cur.label" placeholder="请选择ABC类"
:value="cur.value" /> 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-select>
<el-input v-model="item.Value" placeholder="请输入物品分组" clearable style="flex: 1;" <el-input
v-else-if="item.ParamCode == 'ItemGroup'" /> v-model="item.Value"
<el-input v-model="item.Value" placeholder="请输入项目" clearable style="flex: 1;" placeholder="请输入物品分组,多个物品分组以逗号分隔"
v-else-if="item.ParamCode == 'Project'" /> clearable
<el-input v-model="item.Value" placeholder="请输入物品" clearable style="flex: 1;" style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'" /> 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>
<!-- 仓库 库区 库位组 库位 --> <!-- 仓库 库区 库位组 库位 -->
<el-form-item label="" label-width="0" class="err-240" v-if="index == 1"> <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;" <el-select
@change="changeWarehouse"> v-model="item.ParamCode"
<el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions" placeholder=""
:key="index" /> 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>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> <el-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1" v-model="item.Operator"
:key="cur.value" /> 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>
<el-select v-model="item.Value" <el-select
:placeholder="`请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`" v-model="item.Value"
clearable style="flex: 1;"> :placeholder="`请选择${
<el-option v-for="cur in options.warehouseList" :key="cur.code" :label="cur.name" :value="cur.code" /> 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-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -95,32 +195,76 @@
<el-row gutter="10"> <el-row gutter="10">
<!-- 最大库存 --> <!-- 最大库存 -->
<el-col :span="24"> <el-col :span="24">
<el-form-item label="最大库存" prop="configuration.MaxQty" :rules="[{ required: true, message: '请输入最小库存', trigger: 'change', }]"> <el-form-item
<el-input-number v-model="formData.configuration.MaxQty" :min="-1" controls-position="right" /> 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>
</el-col> </el-col>
<!-- 最小库存 --> <!-- 最小库存 -->
<el-col :span="24"> <el-col :span="24">
<el-form-item label="最小库存" prop="configuration.MinQty" :rules="[{ required: true, message: '请输入最小库存', trigger: 'change', }, { validator: validatorNum, message: '不可以大于最大库存', trigger: 'change', }]"> <el-form-item
<el-input-number v-model="formData.configuration.MinQty" :min="0" label="最小库存"
:max="formData.configuration.MaxQty != -1 ? formData.configuration.MaxQty : Infinity" prop="configuration.MinQty"
controls-position="right" /> :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>
</el-col> </el-col>
<!-- 安全库存 --> <!-- 安全库存 -->
<el-col :span="24"> <el-col :span="24">
<el-form-item label="安全库存" prop="configuration.SafetyQty" :rules="[{ required: true, message: '请输入安全库存', trigger: 'change', }, { validator: validatorNum, message: '不可以大于最大库存', trigger: 'change', }]"> <el-form-item
<el-input-number v-model="formData.configuration.SafetyQty" :min="0" label="安全库存"
:max="formData.configuration.MaxQty != -1 ? formData.configuration.MaxQty : Infinity" prop="configuration.SafetyQty"
controls-position="right" /> :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>
</el-col> </el-col>
<!-- 补料数量 --> <!-- 补料数量 -->
<el-col :span="24"> <el-col :span="24">
<el-form-item label="补料数量" prop="configuration.FeedQty" :rules="[{ required: true, message: '请输入补料数量', trigger: 'change', }, { validator: validatorNum, message: '不可以大于最大库存', trigger: 'change', }]"> <el-form-item
<el-input-number v-model="formData.configuration.FeedQty" :min="0" label="补料数量"
:max="formData.configuration.MaxQty != -1 ? formData.configuration.MaxQty : Infinity" prop="configuration.FeedQty"
controls-position="right" /> :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-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -312,7 +456,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.status = data.status == 0 ? true : false formData.value.status = data.status == 0 ? true : false
if (formData.value.priority == 0) { if (formData.value.priority == 0) {
Butttondata.value = [ Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), // defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) // defaultButtons.formCloseBtn(null) //
] ]
} else { } else {
@ -341,7 +485,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
}else { } else {
Butttondata.value = [ Butttondata.value = [
defaultButtons.formSaveBtn(null), // defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) // defaultButtons.formCloseBtn(null) //
@ -357,7 +501,7 @@ const submitForm = async () => {
if (!formRef) return if (!formRef) return
const valid = await formRef.value.validate() const valid = await formRef.value.validate()
if (!valid) return if (!valid) return
if(formData.value.priority == 0){ if (formData.value.priority == 0) {
message.error('优先级不可以为0') message.error('优先级不可以为0')
return return
} }
@ -419,7 +563,6 @@ const resetForm = () => {
} }
} }
const validatorNum = (rule: any, value: any, callback: any) => { const validatorNum = (rule: any, value: any, callback: any) => {
if (value && formData.value.configuration.MaxQty != -1) { if (value && formData.value.configuration.MaxQty != -1) {
if (value > formData.value.configuration.MaxQty) { if (value > formData.value.configuration.MaxQty) {

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

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

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

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

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

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

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

@ -1,15 +1,26 @@
<!-- 器具容量策略弹窗 --> <!-- 器具容量策略弹窗 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px;"> <Dialog :title="dialogTitle" v-model="dialogVisible" style="width: 700px">
<div class="p-20px m--10px" style="max-height: 50vh;overflow-y: auto;"> <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"> <el-form
ref="formRef"
:model="formData"
:rules="rules"
label-width="120px"
label-position="left"
>
<!-- 规则 --> <!-- 规则 -->
<div class="item"> <div class="item">
<div class="title">规则</div> <div class="title">规则</div>
<el-row gutter="10"> <el-row gutter="10">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="代码" prop="strategyCode"> <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-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -41,47 +52,125 @@
<el-row gutter="10"> <el-row gutter="10">
<el-col :span="24" v-for="(item, index) in formData.condition" :key="index"> <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="{ <el-form-item
required: true, label="器具类型"
message: '请选择器具类型', class="err-120"
trigger: 'change', v-if="index == 0"
}"> :prop="'condition.' + index + '.Value'"
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> :rules="{
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1" required: true,
:key="cur.value" /> 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>
<el-select v-model="item.Value" placeholder="请选择器具类型" style="flex: 1;" clearable> <el-select
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.CONTAINER_TYPE)" :key="cur.value" v-model="item.Value"
:label="cur.label" :value="cur.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-select>
</el-form-item> </el-form-item>
<!-- 选择物品类型 --> <!-- 选择物品类型 -->
<el-form-item label="" label-width="0" class="err-240" v-if="index == 1"> <el-form-item label="" label-width="0" class="err-240" v-if="index == 1">
<el-select v-model="item.ParamCode" placeholder="" @change="changeItemsType" <el-select
style="width: 110px;margin-right: 10px;"> v-model="item.ParamCode"
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.itemTypeOptions" placeholder=""
:key="cur.value" /> @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>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> <el-select
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1" v-model="item.Operator"
:key="cur.value" /> 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>
<el-select v-model="item.Value" placeholder="请选择物品类型" style="flex: 1;" clearable <el-select
v-if="item.ParamCode == 'ItemType'"> v-model="item.Value"
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :key="cur.value" :label="cur.label" placeholder="请选择物品类型"
:value="cur.value" /> 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>
<el-select v-model="item.Value" placeholder="请选择ABC类" style="flex: 1;" clearable <el-select
v-else-if="item.ParamCode == 'AbcClass'"> v-model="item.Value"
<el-option v-for="cur in getStrDictOptions(DICT_TYPE.ABC_CLASS)" :key="cur.value" :label="cur.label" placeholder="请选择ABC类"
:value="cur.value" /> 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-select>
<el-input v-model="item.Value" placeholder="请输入物品分组" clearable style="flex: 1;" <el-input
v-else-if="item.ParamCode == 'ItemGroup'" /> v-model="item.Value"
<el-input v-model="item.Value" placeholder="请输入项目" clearable style="flex: 1;" placeholder="请输入物品分组,多个物品分组以逗号分隔"
v-else-if="item.ParamCode == 'Project'" /> clearable
<el-input v-model="item.Value" placeholder="请输入物品" clearable style="flex: 1;" style="flex: 1"
v-else-if="item.ParamCode == 'ItemCode'" /> 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>
</el-col> </el-col>
</el-row> </el-row>
@ -93,9 +182,16 @@
<el-row gutter="10"> <el-row gutter="10">
<el-col :span="24"> <el-col :span="24">
<!-- 容纳数量 --> <!-- 容纳数量 -->
<el-form-item label="容纳数量" prop="configuration.ContentCount" <el-form-item
:rules="[{ required: true, message: '请输入容纳数量', trigger: 'change', }]"> label="容纳数量"
<el-input-number v-model="formData.configuration.ContentCount" :min="-1" controls-position="right" /> 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-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -115,7 +211,6 @@ import * as RuleApi from '@/api/wms/rule'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -125,35 +220,33 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formRef = ref() // Ref const formRef = ref() // Ref
const formStrategyCode = ref('') const formStrategyCode = ref('')
// form // form
const formData = ref({ const formData = ref({
id: '', id: '',
strategyCode: formStrategyCode.value,//id strategyCode: formStrategyCode.value, //id
name: '',// name: '', //
description: '',// description: '', //
priority: '',// priority: '', //
status: true,// status: true, //
// //
condition: [ condition: [
// //
{ ParamCode: 'ContainerType', Operator: "IN", Value: "" }, { ParamCode: 'ContainerType', Operator: 'IN', Value: '' },
// ///abc// // ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" }, { ParamCode: 'ItemGroup', Operator: 'IN', Value: '' }
], ],
configuration: { configuration: {
// //
ContentCount:0 ContentCount: 0
} }
}) })
// //
const rules = ref({ const rules = ref({
strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }], strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }], name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
description: [{ 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: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' }, { value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' }, { value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' }, { value: 'NOT NULL', label: '不为空' }
] ]
const formatRangeOptions = (...rest) => { 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 return result
} }
@ -181,7 +274,11 @@ const options = reactive({
rangeOptions1: formatRangeOptions('IN', 'NOT IN'), 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([ const Butttondata = ref([
@ -224,7 +321,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formData.value.status = data.status == 0 ? true : false formData.value.status = data.status == 0 ? true : false
if (formData.value.priority == 0) { if (formData.value.priority == 0) {
Butttondata.value = [ Butttondata.value = [
defaultButtons.formSaveBtn({disabled:true}), // defaultButtons.formSaveBtn({ disabled: true }), //
defaultButtons.formCloseBtn(null) // defaultButtons.formCloseBtn(null) //
] ]
} else { } else {
@ -239,7 +336,6 @@ const open = async (type: string, strategyCode: string, id?: number) => {
if (data.configuration) { if (data.configuration) {
formData.value.configuration = JSON.parse(data.configuration) formData.value.configuration = JSON.parse(data.configuration)
} }
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -259,7 +355,7 @@ const submitForm = async () => {
if (!formRef) return if (!formRef) return
const valid = await formRef.value.validate() const valid = await formRef.value.validate()
if (!valid) return if (!valid) return
if(formData.value.priority == 0){ if (formData.value.priority == 0) {
message.error('优先级不可以为0') message.error('优先级不可以为0')
return return
} }
@ -268,11 +364,11 @@ const submitForm = async () => {
try { try {
let data = { let data = {
id: formData.value.id, id: formData.value.id,
strategyCode: formData.value.strategyCode,// strategyCode: formData.value.strategyCode, //
name: formData.value.name,// name: formData.value.name, //
description: formData.value.description,// description: formData.value.description, //
priority: formData.value.priority,// priority: formData.value.priority, //
status: formData.value.status ? 0 : 1,// status: formData.value.status ? 0 : 1, //
// //
condition: JSON.stringify(formData.value.condition), condition: JSON.stringify(formData.value.condition),
configuration: JSON.stringify(formData.value.configuration) configuration: JSON.stringify(formData.value.configuration)
@ -296,32 +392,30 @@ const submitForm = async () => {
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
id: '', id: '',
strategyCode: formStrategyCode.value,//id strategyCode: formStrategyCode.value, //id
name: '',// name: '', //
description: '',// description: '', //
priority: '',// priority: '', //
status: true,// status: true, //
// //
condition: [ condition: [
// //
{ ParamCode: 'ContainerType', Operator: "IN", Value: "" }, { ParamCode: 'ContainerType', Operator: 'IN', Value: '' },
// ///abc// // ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" }, { ParamCode: 'ItemGroup', Operator: 'IN', Value: '' }
], ],
configuration: { configuration: {
// //
ContentCount:0 ContentCount: 0
} }
} }
} }
const validatorNum = (rule: any, value: any, callback: any) => { const validatorNum = (rule: any, value: any, callback: any) => {
if (value && formData.value.configuration[0].Value != -1) { if (value && formData.value.configuration[0].Value != -1) {
if (value > formData.value.configuration[0].Value) { if (value > formData.value.configuration[0].Value) {
callback(new Error("11")) callback(new Error('11'))
} else { } else {
callback() callback()
} }
} else { } else {

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

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

Loading…
Cancel
Save