Browse Source

存储容量策略

master
zhangli 1 year ago
parent
commit
f009d255dc
  1. 2
      src/components/Annex/src/Annex.vue
  2. 2
      src/components/SearchHigh/src/SearchHigh.vue
  3. 193
      src/views/wms/strategy/arrivalInspectionStrategy/AddForm.vue
  4. 5
      src/views/wms/strategy/arrivalInspectionStrategy/index.vue
  5. 381
      src/views/wms/strategy/inspectStrategy/AddForm copy.vue
  6. 25
      src/views/wms/strategy/inspectStrategy/AddForm.vue
  7. 2
      src/views/wms/strategy/inspectStrategy/index.vue
  8. 29
      src/views/wms/strategy/purchaseReceiptStrategy/AddForm.vue
  9. 451
      src/views/wms/strategy/storageCapacityStrategy/AddForm.vue
  10. 82
      src/views/wms/strategy/storageCapacityStrategy/index.vue
  11. 350
      src/views/wms/strategy/warehouseStorageStrategy/AddForm copy.vue

2
src/components/Annex/src/Annex.vue

@ -64,7 +64,7 @@ const deleteAnnex = async (id) => {
emit('deleteAnnexSuccess') emit('deleteAnnexSuccess')
} }
const downFile = (item)=>{ const downFile = (item)=>{
window.open(import.meta.env.VITE_BASE_URL + '/admin-api/infra/file/0/get/' + item.path,'222') window.open(import.meta.env.VITE_BASE_URL + '/admin-api/infra/file/0/get/' + item.path)
} }
</script> </script>

2
src/components/SearchHigh/src/SearchHigh.vue

@ -62,7 +62,7 @@ import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const message = useMessage() // const message = useMessage() //
const route = useRoute() // const route = useRoute() //
const popoverVisible = ref(false) const popoverVisible = ref(false)
const searchOption_high = ref(tableColumnsFun[route.name].allSchemas.tableColumns.filter(item => (item.field != "action"))) const searchOption_high = ref(tableColumnsFun[route.name]?.allSchemas.tableColumns.filter(item => (item.field != "action")))
const moreListData = ref({ const moreListData = ref({
filters:[] filters:[]
}) })

193
src/views/wms/strategy/arrivalInspectionStrategy/AddForm.vue

@ -1,16 +1,15 @@
<!-- 到货验货任务拆分策略弹出层 -->
<!-- 供应商送货策略弹出层 -->
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;"> <div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;">
<!-- 规则 --> <!-- 规则 -->
<el-form ref="formRef" :model="formData" :rules="rules" label-width="140px" label-position="left">
<div class="item"> <div class="item">
<div class="title">规则</div> <div class="title">规则</div>
<el-form ref="formRef1" :model="formData" :rules="rules" label-width="120px" label-position="left">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="代码" prop="code"> <el-form-item label="代码" prop="strategyCode">
<el-input v-model="formData.code" placeholder="请输入代码" clearable 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">
@ -34,12 +33,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
<!-- 规则条件 --> <!-- 规则条件 -->
<div class="item mt-20px"> <div class="item mt-20px">
<div class="title">规则条件</div> <div class="title">规则条件</div>
<el-form ref="formRef2" :model="formData" :rules="rules" label-width="120px" label-position="left">
<el-row> <el-row>
<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">
<!-- 供应商类型 --> <!-- 供应商类型 -->
@ -53,7 +50,6 @@
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" /> :label="dict.label" :value="dict.value" />
</el-select> </el-select>
<!-- </div> -->
</el-form-item> </el-form-item>
<!-- 供应商 --> <!-- 供应商 -->
<el-form-item v-else-if="item.ParamCode == 'SupplierCode'" label="供应商" class="err-120"> <el-form-item v-else-if="item.ParamCode == 'SupplierCode'" label="供应商" class="err-120">
@ -65,86 +61,26 @@
<el-option v-for="cur in options.supplierList" :key="cur.id" :label="cur.name" :value="cur.id" /> <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 v-else-if="item.ParamCode == 'Weekday'" label="星期几" class="flex-top err-120">
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="cur.label" :value="cur.value" v-for="cur in options.weekRangeOptions"
:key="cur.value" />
</el-select>
<div class="checkbox">
<el-checkbox-group v-model="item.Value" @change="change">
<el-checkbox :label="cur.label" v-for="cur in options.weekOptions" :key="cur.value" />
</el-checkbox-group>
</div>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
<!-- 规则配置 --> <!-- 规则配置 -->
<div class="item mt-20px"> <div class="item mt-20px">
<div class="title">规则配置</div> <div class="title">规则配置</div>
<el-form ref="formRef3" :model="formData" label-width="120px" label-position="left">
<el-row> <el-row>
<!-- 开始时间 -->
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index"> <el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<!-- 开始时间 --> <!-- 按零件拆分 -->
<el-form-item v-if="item.ParamCode == 'BeginTime'" label="开始时间" :prop="'configuration.' + index + '.Value'" <el-form-item v-if="item.ParamCode == 'ByItem'" label="按零件拆分">
:rules="{ <el-switch v-model="item.Value" />
required: true,
message: '请选择开始时间',
trigger: 'change',
}">
<el-time-select v-model="item.Value" start="00:00" end="23:59" step="00:15" placeholder="请选择开始时间"
style="width: 100%;" />
</el-form-item>
<!-- 结束时间 -->
<el-form-item v-else-if="item.ParamCode == 'EndTime'" label="结束时间"
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: '请选择结束时间',
trigger: 'change',
}">
<el-time-select v-model="item.Value" start="00:00" end="23:59" step="00:15" placeholder="请选择结束时间"
style="width: 100%;" />
</el-form-item>
<!-- 仓库 -->
<el-form-item v-else-if="item.ParamCode == 'WarehouseCode'" label="仓库"
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: '请选择仓库',
trigger: 'change',
}">
<el-select v-model="item.Value" placeholder="请选择仓库" clearable>
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
</el-form-item> </el-form-item>
<!-- 月台 --> <!-- 按批次拆分 -->
<el-form-item v-else-if="item.ParamCode == 'DockCode'" label="月台" <el-form-item v-else-if="item.ParamCode == 'ByBatch'" label="按批次拆分">
:prop="'configuration.' + index + '.Value'" :rules="{ <el-switch v-model="item.Value" />
required: true,
message: '请选择月台',
trigger: 'change',
}">
<el-select v-model="item.Value" placeholder="请选择月台" clearable>
<el-option v-for="cur in options.dockList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
</el-form-item>
<!-- 在途库位 -->
<el-form-item v-else-if="item.ParamCode == 'OnTheWayLocationCode'" label="在途库位"
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: '请选择在途库位',
trigger: 'change',
}">
<el-select v-model="item.Value" placeholder="请选择在途库位" clearable>
<el-option v-for="cur in options.locationList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
</el-form>
</div> </div>
<template #footer> <template #footer>
<!-- 按钮--> <!-- 按钮-->
@ -157,9 +93,6 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'SupplieDeliveryStrategyAddForm' }) defineOptions({ name: 'SupplieDeliveryStrategyAddForm' })
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { getSupplierList } from '@/api/wms/supplier' import { getSupplierList } from '@/api/wms/supplier'
import { getWarehouseList } from '@/api/wms/warehouse'
import { getDockList } from '@/api/wms/dock'
import { getLocationList } from '@/api/wms/location'
import * as RuleApi from '@/api/wms/rule' import * as RuleApi from '@/api/wms/rule'
@ -171,9 +104,7 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formRef1 = ref() // Ref const formRef = ref() // Ref
const formRef2 = ref() // Ref
const formRef3 = ref() // Ref
const change = (e) => { const change = (e) => {
console.log(e); console.log(e);
@ -181,8 +112,8 @@ const change = (e) => {
const formStrategyCode = ref('') const formStrategyCode = ref('')
// form // form
const formData = ref({ const formData = ref({
strategyCode: formStrategyCode.value,// id: '',
code: formStrategyCode.value,// strategyCode: formStrategyCode.value,//id
name: '',// name: '',//
description: '',// description: '',//
priority: '',// priority: '',//
@ -192,35 +123,22 @@ const formData = ref({
// //
{ ParamCode: 'SupplierType', Operator: "==", Value: "" }, { ParamCode: 'SupplierType', Operator: "==", Value: "" },
// //
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }, { ParamCode: 'SupplierCode', Operator: "IN", Value: "" }
//
{ ParamCode: 'Weekday', Operator: "IN", Value: [] }
], ],
configuration: [ configuration: [
// //
{ ParamCode: 'BeginTime', Value: "" }, { ParamCode: 'ByItem', Value: false },
// //
{ ParamCode: 'EndTime', Value: "" }, { ParamCode: 'ByBatch', Value: false },
//
{ ParamCode: 'WarehouseCode', Value: '' },
//
{ ParamCode: 'DockCode', Value: '' },
//
{ ParamCode: 'OnTheWayLocationCode', Value: '' },
] ]
}) })
// //
const rules = ref({ const rules = ref({
code: [{ required: true, message: '请输入代码', trigger: 'blur' }], strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }], name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
description: [{ required: true, message: '请输入描述', trigger: 'blur' }], description: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }]
BeginTime: [{ required: true, message: '请选择开始时间', trigger: 'change' }],
EndTime: [{ required: true, message: '请选择结束时间', trigger: 'change' }],
WarehouseCode: [{ required: true, message: '请选择仓库', trigger: 'change' }],
DockCode: [{ required: true, message: '请选择月台', trigger: 'change' }],
OnTheWayLocationCode: [{ required: true, message: '请选择在途库位', trigger: 'change' }],
}) })
// //
@ -252,16 +170,7 @@ const options = reactive({
supplierRangeOptions: formatRangeOptions('IN', 'NOT IN'), supplierRangeOptions: formatRangeOptions('IN', 'NOT IN'),
// //
supplierList: [{ value: 1, label: '供应商1' }, { value: 2, label: '供应商2' }, { value: 3, label: '供应商3' }], supplierList: [{ value: 1, label: '供应商1' }, { value: 2, label: '供应商2' }, { value: 3, label: '供应商3' }],
//
weekRangeOptions: formatRangeOptions('IN', 'NOT IN'),
//
weekOptions: [{ value: 1, label: '星期一' }, { value: 2, label: '星期二' }, { value: 3, label: '星期三' }, { value: 4, label: '星期四' }, { value: 5, label: '星期五' }, { value: 6, label: '星期六' }, { value: 7, label: '星期日' }],
//
warehouseList: [],
//
dockList: [],
//
locationList: [],
}) })
// //
const querySupplierParams = ref({ const querySupplierParams = ref({
@ -275,27 +184,12 @@ const getFormSupplierList = async () => {
// //
const changeSupplierType = (e) => { const changeSupplierType = (e) => {
querySupplierParams.value.type = e querySupplierParams.value.type = e
formData.value.condition[1].Value = []
getFormSupplierList() getFormSupplierList()
} }
//
const getFormWarehouseList = async () => {
options.warehouseList = await getWarehouseList();
}
//
const getFormDockList = async () => {
options.dockList = await getDockList();
}
//
const getFormLocationList = async () => {
options.locationList = await getLocationList({ type: 'TRANSPORT' });
}
getFormSupplierList() getFormSupplierList()
getFormWarehouseList()
getFormDockList()
getFormLocationList()
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, strategyCode: string, id?: number) => { const open = async (type: string, strategyCode: string, id?: number) => {
@ -309,19 +203,22 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formLoading.value = true formLoading.value = true
try { try {
let data = await RuleApi.getRule(id) let data = await RuleApi.getRule(id)
formData.value.id = data.id
formData.value.strategyCode = data.strategyCode formData.value.strategyCode = data.strategyCode
formData.value.code = data.code
formData.value.name = data.name formData.value.name = data.name
formData.value.description = data.description formData.value.description = data.description
formData.value.priority = data.priority formData.value.priority = data.priority
formData.value.status = data.status==1?true:false formData.value.status = data.status == 0 ? true : false
if(data.condition){ if (data.condition) {
formData.value.condition = JSON.parse(data.condition) formData.value.condition = JSON.parse(data.condition)
} }
if(data.configuration){ if (data.configuration) {
formData.value.configuration = JSON.parse(data.configuration) formData.value.configuration = JSON.parse(data.configuration)
} }
querySupplierParams.value.type = formData.value?.condition[0]?.Value || ''
getFormSupplierList()
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -333,21 +230,19 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
// //
if (!formRef1 || !formRef2 || !formRef3) return if (!formRef) return
const valid2 = formRef2.value.validate() const valid = await formRef.value.validate()
const valid1 = formRef1.value.validate() if (!valid) return;
const valid3 = await formRef3.value.validate()
if (!valid1 || !valid2 || !valid3) return
// //
formLoading.value = true formLoading.value = true
try { try {
let data = { let data = {
id: formData.value.id,
strategyCode: formData.value.strategyCode,// strategyCode: formData.value.strategyCode,//
code: formData.value.code,//
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?1:0,// 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)
@ -370,8 +265,8 @@ const submitForm = async () => {
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
id: '',
strategyCode: formStrategyCode.value,// strategyCode: formStrategyCode.value,//
code: formStrategyCode.value,//
name: '',// name: '',//
description: '',// description: '',//
priority: '',// priority: '',//
@ -382,20 +277,12 @@ const resetForm = () => {
{ ParamCode: 'SupplierType', Operator: "==", Value: "" }, { ParamCode: 'SupplierType', Operator: "==", Value: "" },
// //
{ ParamCode: 'SupplierCode', Operator: "IN", Value: "" }, { ParamCode: 'SupplierCode', Operator: "IN", Value: "" },
//
{ ParamCode: 'Weekday', Operator: "IN", Value: [] }
], ],
configuration: [ configuration: [
// //
{ ParamCode: 'BeginTime', Value: "" }, { ParamCode: 'ByItem', Value: false },
// //
{ ParamCode: 'EndTime', Value: "" }, { ParamCode: 'ByBatch', Value: false },
//
{ ParamCode: 'WarehouseCode', Value: '' },
//
{ ParamCode: 'DockCode', Value: '' },
//
{ ParamCode: 'OnTheWayLocationCode', Value: '' },
] ]
} }
} }

5
src/views/wms/strategy/arrivalInspectionStrategy/index.vue

@ -15,7 +15,6 @@
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180" :formatter="dateFormatter" /> -->
<el-table-column align="center" label="操作" fixed="right" width="240"> <el-table-column align="center" label="操作" fixed="right" width="240">
<template #default="scope"> <template #default="scope">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, scope.row)" /> <ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event, scope.row)" />
@ -37,7 +36,7 @@ import * as RuleApi from '@/api/wms/rule'
import AddForm from './AddForm.vue' import AddForm from './AddForm.vue'
// import { dateFormatter } from '@/utils/formatTime' // import { dateFormatter } from '@/utils/formatTime'
defineOptions({ name: 'ArrivalInspectionStrategy' }) defineOptions({ name: 'PurchaseReceiptStrategy' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -48,7 +47,7 @@ const list = ref([]) // 字典表格数据
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
strategyCode: 'S001', strategyCode: 'S004',
}) })
/** 查询字典类型列表 */ /** 查询字典类型列表 */

381
src/views/wms/strategy/inspectStrategy/AddForm copy.vue

@ -1,381 +0,0 @@
<!-- 检验策略弹窗 -->
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;">
<!-- 规则 -->
<div class="item">
<div class="title">规则</div>
<el-form ref="formRef1" :model="formData" :rules="rules" label-width="120px" label-position="left">
<el-row>
<el-col :span="24">
<el-form-item label="代码" prop="code">
<el-input v-model="formData.code" placeholder="请输入代码" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入名称" clearable />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="描述" prop="describe">
<el-input v-model="formData.describe" placeholder="请输入描述" clearable />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="优先级" prop="priority">
<el-input-number v-model="formData.priority" :min="1" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="状态" prop="status">
<el-switch v-model="formData.status" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 规则条件 -->
<div class="item mt-20px">
<div class="title">规则条件</div>
<el-form ref="formRef2" :model="formData" :rules="rules" label-width="120px" label-position="left">
<el-row>
<!-- 供应商类型 -->
<el-col :span="24">
<el-form-item label="供应商类型" class="flex-top err-120" prop="supplierType">
<el-select v-model="formData.supplierTypeRange" placeholder="请选择范围"
style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.supplierType" placeholder="请选择供应商类型" style="flex: 1;" clearable>
<el-option v-for="item in options.supplierTypeOptions" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 供应商 -->
<el-col :span="24">
<el-form-item label="供应商" prop="supplier" class="err-120">
<el-select v-model="formData.supplierRange" placeholder="请选择范围" style="width: 110px;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.supplier" placeholder="请选择供应商" style="flex: 1;" clearable>
<el-option v-for="item in options.supplierList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 物品 -->
<el-col :span="24">
<el-form-item label="物品" prop="items" class="err-120">
<el-select v-model="formData.itemsRange" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select>
<el-select v-model="formData.items" placeholder="请选择物品" style="flex: 1;" clearable>
<el-option v-for="item in options.itemsList" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!-- 规则配置 -->
<div class="item mt-20px">
<div class="title">规则配置</div>
<el-form ref="formRef3" :model="formData" :rules="rules" label-width="120px" label-position="left">
<el-row>
<!-- 检验方式 -->
<el-col :span="24">
<el-form-item label="检验方式" class="flex-top" prop="inspectWay">
<div class="checkbox">
<el-checkbox-group v-model="formData.inspectWay">
<el-checkbox :label="item.label" v-for="item in options.inspectWayOptions" :key="item.value" />
</el-checkbox-group>
</div>
</el-form-item>
</el-col>
<!-- 抽检方式 -->
<el-col :span="24">
<el-form-item label="抽检方式" class="flex-top" prop="spotceckWay">
<div class="checkbox">
<el-radio-group v-model="formData.spotceckWay">
<el-radio :label="item.value" v-for="item in options.spotceckWayOptions" :key="item.value">{{
item.label }}</el-radio>
</el-radio-group>
</div>
</el-form-item>
</el-col>
<!-- 抽检规则 -->
<el-col :span="24">
<el-form-item label="抽检规则" class="flex-top" prop="spotceckRules1">
<div style="flex:1;display:flex;align-items:center;margin-bottom:10px"
v-for="(item, index) in formData.spotceckRules" :key="index">
<div style="width: 26px;display: flex;">
<Icon icon="ep:remove" color="#757575" size="26" style="cursor: pointer;"
@click="handleDeleteTable(item, index)" v-if="formData.spotceckRules?.length>1" />
</div>
<el-input-number v-model="item.minNum" :min="0" :max="item.maxNum - 1" class='ml-20px mr-20px'
style="width:100px" controls-position="right" @blur="inputNumberBlur" />
<div></div>
<el-input-number v-model="item.maxNum" :min="item.minNum + 1" class='ml-20px mr-20px'
style="width:100px" controls-position="right" @blur="inputNumberBlur"/>
<div>抽样数</div>
<el-input-number v-model="item.num" :min="0" class='ml-20px mr-20px'
style="width:100px" controls-position="right" @blur="inputNumberBlur"/>
<div>EA</div>
</div>
<div class="button flex">
<div @click="handleAddTable">
<Icon icon="ep:circle-plus" color="#409eff" size="26" style="cursor: pointer;" />
<div>添加条件</div>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<template #footer>
<!-- 按钮-->
<TableHead :HeadButttondata="Butttondata" @buttonBaseClick="buttonBaseClick" />
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import {
validateInteger,
} from "@/utils/validator";
defineOptions({ name: 'InspectStrategyAddForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formRef1 = ref() // Ref
const formRef2 = ref() // Ref
const formRef3 = ref() // Ref
// form
const formData = ref({
code: '',//
name: '',//
describe: '',//
priority: '',//
status: false,//
supplierTypeRange: 1,//
supplierType: '',//
supplierRange: 1,//
supplier: '',//
itemsRange: 1,//
items: '',//
inspectWay: [],//
spotceckWay: 1,//
spotceckRules: [{
minNum: 0,
maxNum: 1,
num: 0,
}],//
spotceckRules1: ''
})
//
const rules = ref({
code: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
describe: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
supplierType: [{ required: true, message: '请选择供应商类型', trigger: 'change' }],
supplier: [{ required: true, message: '请选择供应商', trigger: 'change' }],
items: [{ required: true, message: '请选择物品', trigger: 'change' }],
inspectWay: [{ required: true, message: '请选择检验方式', trigger: 'change' }],
spotceckWay: [{ required: true, message: '请选择抽检方式', trigger: 'change' }],
spotceckRules1: [{ required: true, message: '抽检规则请填写完全', trigger: 'blur' },
{ validator: validateInteger, message: '请输入整数', trigger: 'blur' }],
})
//
const options = reactive({
//
rangeOptions: [{ value: 1, label: '包含' }, { value: 2, label: '大于', }],
//
supplierTypeOptions: [{ value: 1, label: '标准' }, { value: 2, label: '委外' }, { value: 3, label: '其他' }],
//
supplierList: [{ value: 1, label: '供应商1' }, { value: 2, label: '供应商2' }, { value: 3, label: '供应商3' }],
//
itemsList: [{ value: 1, label: '物品1' }, { value: 2, label: '物品2' }],
//
inspectWayOptions: [{ value: 1, label: '免检' }, { value: 2, label: '全检' }, { value: 3, label: '抽检' }],
//
spotceckWayOptions: [{ value: 1, label: '数量' }, { value: 2, label: '半分比' }],
})
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
}
defineExpose({ open }) // open
//
const inputNumberBlur = ()=>{
const isEmpty = formData.value.spotceckRules.some((item, index) => {
return item.minNum < 0 || item.minNum == null || item.maxNum < 0 || item.maxNum == null || item.num < 0 || item.num == null
})
console.log(isEmpty);
if (isEmpty) {
formData.value.spotceckRules1 = ''
} else {
formData.value.spotceckRules1 = '1'
}
}
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
const isEmpty = formData.value.spotceckRules.some((item, index) => {
return item.minNum<0|| item.minNum==null || item.maxNum < 0 || item.maxNum == null || item.num < 0 || item.num == null
})
if (isEmpty) {
formData.value.spotceckRules1 = ''
} else {
formData.value.spotceckRules1 = '1'
}
//
if (!formRef1 || !formRef2 || !formRef3) return
const valid2 = formRef2.value.validate()
const valid1 = formRef1.value.validate()
const valid3 = await formRef3.value.validate()
if (!valid1 || !valid2 || !valid3) return
//
formLoading.value = true
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
code: '',
name: '',
describe: '',
priority: '',
status: false,
supplierTypeRange: 1,//
supplierType: '',//
supplierRange: 1,//
supplier: '',//
itemsRange: 1,//
items: '',//
inspectWay: [],//
spotceckWay: 1,//
spotceckRules: [{
minNum: 0,
maxNum: 1,
num: 0,
}],//
}
}
//
const Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null), //
]
//
const buttonBaseClick = (val, item) => {
//
if (val == 'save') {
submitForm()
}
//
else if (val == 'close') {
dialogVisible.value = false
}
}
//
const handleAddTable = () => {
console.log(formData.value.spotceckRules);
formData.value.spotceckRules.push({
minNum: 0,
maxNum: 1,
num: 0,
})
}
//
const handleDeleteTable = (item, index) => {
formData.value.spotceckRules.splice(index, 1)
}
</script>
<style scoped lang="scss">
.item {
border: 1px solid #dedede;
border-radius: 4px;
padding: 30px 30px 5px;
position: relative;
.title {
position: absolute;
background: white;
padding: 0px 10px;
position: absolute;
top: 0px;
height: 30px;
line-height: 30px;
margin-top: -15px;
}
}
.checkbox {
background: #f5f5f5;
flex: 1;
padding: 0px 15px;
border-radius: 2px;
}
::v-deep .flex-top .el-form-item__content {
align-items: flex-start !important;
}
::v-deep .err-120 .el-form-item__error {
padding-left: 120px !important;
}
.button {
>div {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
>div {
margin-left: 6px;
text-decoration: underline;
color: #409eff;
}
}
}
</style>

25
src/views/wms/strategy/inspectStrategy/AddForm.vue

@ -110,13 +110,13 @@
<Icon icon="ep:remove" color="#757575" size="26" style="cursor: pointer;" <Icon icon="ep:remove" color="#757575" size="26" style="cursor: pointer;"
@click="handleDeleteTable(item.Value,cur, key)" v-if="item.Value?.length > 1" /> @click="handleDeleteTable(item.Value,cur, key)" v-if="item.Value?.length > 1" />
</div> </div>
<el-input-number v-model="cur.minNum" :min="0" :max="cur.maxNum - 1" class='ml-20px mr-20px' <el-input-number v-model="cur.FloorQty" :min="1" :max="cur.CeilingQty - 1" class='ml-20px mr-20px'
style="width:100px" controls-position="right" @blur="inputNumberBlur" /> style="width:100px" controls-position="right" @blur="inputNumberBlur" />
<div></div> <div></div>
<el-input-number v-model="cur.maxNum" :min="cur.minNum + 1" class='ml-20px mr-20px' style="width:100px" <el-input-number v-model="cur.CeilingQty" :min="cur.FloorQty + 1" class='ml-20px mr-20px' style="width:100px"
controls-position="right" @blur="inputNumberBlur" /> controls-position="right" @blur="inputNumberBlur" />
<div>抽样数</div> <div>抽样数</div>
<el-input-number v-model="cur.num" :min="0" class='ml-20px mr-20px' style="width:100px" <el-input-number v-model="cur.SampleValue" :min="1" class='ml-20px mr-20px' style="width:100px"
controls-position="right" @blur="inputNumberBlur" /> controls-position="right" @blur="inputNumberBlur" />
<div>EA</div> <div>EA</div>
</div> </div>
@ -188,9 +188,9 @@ const formData = ref({
// //
{ {
ParamCode: 'AqlList', Value: [{ ParamCode: 'AqlList', Value: [{
minNum: 0, FloorQty: 1,
maxNum: 1, CeilingQty:2,
num: 0, SampleValue: 1,
}] }]
}, },
] ]
@ -294,6 +294,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
console.log(formData.value);
// //
formLoading.value = true formLoading.value = true
try { try {
@ -349,9 +350,9 @@ const resetForm = () => {
// //
{ {
ParamCode: 'AqlList', Value: [{ ParamCode: 'AqlList', Value: [{
minNum: 0, FloorQty: 1,
maxNum: 1, CeilingQty: 2,
num: 0, SampleValue: 1,
}] }]
}, },
] ]
@ -378,9 +379,9 @@ const buttonBaseClick = (val, item) => {
// //
const handleAddTable = (item) => { const handleAddTable = (item) => {
item.push({ item.push({
minNum: 0, FloorQty: 1,
maxNum: 1, CeilingQty: 2,
num: 0, SampleValue: 1,
}) })
} }
// //

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

@ -1,4 +1,4 @@
<!-- 策略 --> <!-- 检验策略策略 -->
<template> <template>
<!-- 列表头部 --> <!-- 列表头部 -->
<TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" /> <TableHead :HeadButttondata="HeadButttondata" @buttonBaseClick="buttonBaseClick" />

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

@ -51,7 +51,6 @@
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value" <el-option v-for="dict in getStrDictOptions(DICT_TYPE.SUPPLIER_TYPE)" :key="dict.value"
:label="dict.label" :value="dict.value" /> :label="dict.label" :value="dict.value" />
</el-select> </el-select>
<!-- </div> -->
</el-form-item> </el-form-item>
<!-- 供应商 --> <!-- 供应商 -->
<el-form-item v-else-if="item.ParamCode == 'SupplierCode'" label="供应商" class="err-120"> <el-form-item v-else-if="item.ParamCode == 'SupplierCode'" label="供应商" class="err-120">
@ -72,39 +71,19 @@
<el-row> <el-row>
<el-col :span="24" v-for="(item, index) in formData.configuration" :key="index"> <el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<!-- 按零件拆分 --> <!-- 按零件拆分 -->
<el-form-item v-if="item.ParamCode == 'ByItem'" label="按零件拆分" :prop="'configuration.' + index + '.Value'" <el-form-item v-if="item.ParamCode == 'ByItem'" label="按零件拆分">
:rules="{
required: true,
message: '请选择开始时间',
trigger: 'change',
}">
<el-switch v-model="item.Value" /> <el-switch v-model="item.Value" />
</el-form-item> </el-form-item>
<!-- 按库位拆分 --> <!-- 按库位拆分 -->
<el-form-item v-else-if="item.ParamCode == 'ByLocation'" label="按库位拆分" <el-form-item v-else-if="item.ParamCode == 'ByLocation'" label="按库位拆分">
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: '请选择按库位拆分',
trigger: 'change',
}">
<el-switch v-model="item.Value" /> <el-switch v-model="item.Value" />
</el-form-item> </el-form-item>
<!--按器具拆分--> <!--按器具拆分-->
<el-form-item v-else-if="item.ParamCode == 'ByContainer'" label="按器具拆分" <el-form-item v-else-if="item.ParamCode == 'ByContainer'" label="按器具拆分">
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: '请选择按器具拆分',
trigger: 'change',
}">
<el-switch v-model="item.Value" /> <el-switch v-model="item.Value" />
</el-form-item> </el-form-item>
<!-- 每个任务明细数量 --> <!-- 每个任务明细数量 -->
<el-form-item v-else-if="item.ParamCode == 'JobDetailCount'" label="每个任务明细数量" <el-form-item v-else-if="item.ParamCode == 'JobDetailCount'" label="每个任务明细数量">
:prop="'configuration.' + index + '.Value'" :rules="{
required: true,
message: '请选择每个任务明细数量',
trigger: 'change',
}">
<!-- <el-input v-model="item.Value" placeholder="请输入每个任务明细数量" clearable /> --> <!-- <el-input v-model="item.Value" placeholder="请输入每个任务明细数量" clearable /> -->
<el-input-number v-model="item.Value" :min="0" /> <el-input-number v-model="item.Value" :min="0" />
</el-form-item> </el-form-item>

451
src/views/wms/strategy/storageCapacityStrategy/AddForm.vue

@ -2,14 +2,14 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible"> <Dialog :title="dialogTitle" v-model="dialogVisible">
<div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;"> <div class="p-20px m--10px" style="max-height: 500px;overflow-y: auto;">
<el-form ref="formRef" :model="formData" :rules="rules" label-width="120px" label-position="left">
<!-- 规则 --> <!-- 规则 -->
<div class="item"> <div class="item">
<div class="title">规则</div> <div class="title">规则</div>
<el-form ref="formRef1" :model="formData" :rules="rules" label-width="120px" label-position="left"> <el-row gutter="10">
<el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="代码" prop="code"> <el-form-item label="代码" prop="strategyCode">
<el-input v-model="formData.code" placeholder="请输入代码" clearable /> <el-input v-model="formData.strategyCode" placeholder="请输入代码" clearable disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -18,8 +18,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="描述" prop="describe"> <el-form-item label="描述" prop="description">
<el-input v-model="formData.describe" placeholder="请输入描述" clearable /> <el-input v-model="formData.description" placeholder="请输入描述" clearable />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -33,109 +33,107 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
<!-- 规则条件 --> <!-- 规则条件 -->
<div class="item mt-20px"> <div class="item mt-20px">
<div class="title">规则条件</div> <div class="title">规则条件</div>
<el-form ref="formRef2" :model="formData" :rules="rules" label-width="120px" label-position="left"> <el-row gutter="10">
<el-row> <el-col :span="24" v-for="(item, index) in formData.condition" :key="index">
<!-- 选择物品类型 --> <!-- 选择物品类型 -->
<el-col :span="24"> <el-form-item label="" label-width="0" class="err-240" v-if="index == 0">
<el-form-item label="" label-width="0" prop="item" class="err-240"> <el-select v-model="item.ParamCode" placeholder="" @change="changeItemsType"
<el-select v-model="formData.itemType" placeholder="" style="width: 110px;margin-right: 10px;"> style="width: 110px;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.itemTypeOptions" <el-option :label="cur.label" :value="cur.value" v-for="cur in options.itemTypeOptions"
:key="item.value" /> :key="cur.value" />
</el-select> </el-select>
<el-select v-model="formData.itemTypeRange" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;"> <el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions" <el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1"
:key="item.value" /> :key="cur.value" />
</el-select> </el-select>
<el-select v-model="formData.item" placeholder="请选择物品" style="flex: 1;" clearable> <el-select v-model="item.Value" placeholder="请选择物品类型" style="flex: 1;" clearable
<el-option v-for="item in options.itemList" :key="item.value" :label="item.label" :value="item.value" /> 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
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-form-item> </el-form-item>
</el-col>
<!-- 仓库 库区 库位组 库位 --> <!-- 仓库 库区 库位组 库位 -->
<el-col :span="24"> <el-form-item label="" label-width="0" class="err-240" v-if="index == 1">
<el-form-item label="" label-width="0" prop="warehouse" class="err-240"> <el-select v-model="item.ParamCode" placeholder="" style="width: 110px;margin-right: 10px;"
<el-select v-model="formData.warehouseType" style="width: 110px;;margin-right: 10px;"> @change="changeWarehouse">
<el-option :label="item.label" :value="item.value" v-for="item in options.warehouseTypeOptions" <el-option :label="cur.label" :value="cur.value" v-for="(cur, index) in options.warehouseTypeOptions"
:key="item.value" /> :key="index" />
</el-select> </el-select>
<el-select v-model="item.Operator" placeholder="请选择范围" style="width: 110px;;margin-right: 10px;">
<el-select v-model="formData.warehouseTypeRange" placeholder="请选择范围" <el-option :label="cur.label" :value="cur.value" v-for="cur in options.rangeOptions1"
style="width: 110px;;margin-right: 10px;"> :key="cur.value" />
<el-option :label="item.label" :value="item.value" v-for="item in options.rangeOptions"
:key="item.value" />
</el-select> </el-select>
<el-select v-model="formData.warehouse" placeholder="请选择库位" style="flex: 1;" clearable> <el-select v-model="item.Value"
<el-option v-for="item in options.warehouseTypeList" :key="item.value" :label="item.label" :placeholder="`请选择${item.ParamCode == 'WarehouseCode' ? '仓库' : item.ParamCode == 'AreaCode' ? '库区' : item.ParamCode == 'LocationGroupCode' ? '库位组' : item.ParamCode == 'LocationCode' ? '库位' : ''}`"
:value="item.value" /> clearable style="flex: 1;">
<el-option v-for="cur in options.warehouseList" :key="cur.id" :label="cur.name" :value="cur.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
<!-- 规则配置 --> <!-- 规则配置 -->
<div class="item mt-20px"> <div class="item mt-20px">
<div class="title">规则配置</div> <div class="title">规则配置</div>
<el-form ref="formRef3" :model="formData" :rules="rules" label-width="120px" label-position="left"> <el-row gutter="10">
<el-row> <el-col :span="24" v-for="(item, index) in formData.configuration" :key="index">
<!-- 存储类型 --> <!-- 存储类型 -->
<el-col :span="24"> <el-form-item label="存储类型" v-if="index == 0">
<el-form-item label="存储类型" class="flex-top" prop="storageType"> <div class="checkbox">
<div class="checkbox flex"> <el-radio-group v-model="item.Value">
<el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" <el-radio label="NOTLIMIT">不限制</el-radio>
@change="handleCheckAllChange">全部</el-checkbox> <el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.STORAGE_TYPE)"
<el-checkbox-group v-model="formData.storageType" @change="handleCheckedCitiesChange" :key="cur.value">{{ cur.label }}</el-radio>
style="margin-left: 30px;flex:1"> </el-radio-group>
<el-checkbox :label="item" v-for="(item, index) in options.storageTypeOptions" :key="index" />
</el-checkbox-group>
</div> </div>
</el-form-item> </el-form-item>
</el-col>
<!-- 存储容量 --> <!-- 存储容量 -->
<el-col :span="24"> <el-form-item label="存储容量" v-else-if="index == 1">
<el-form-item label="存储容量" prop="storageCapacity"> <el-input v-model="item.Value" placeholder="请输入存储容量" clearable />
<el-input v-model="formData.storageCapacity" placeholder="请输入存储容量" clearable />
</el-form-item> </el-form-item>
</el-col>
<!-- 替代存储类型 --> <!-- 替代存储类型 -->
<el-col :span="24"> <el-form-item label="替代存储类型" v-if="index == 2">
<el-form-item label="替代存储类型" class="flex-top" prop="replaceStorageType"> <div class="checkbox">
<div class="checkbox flex"> <el-radio-group v-model="item.Value">
<el-checkbox v-model="replaceCheckAll" :indeterminate="replaceIsIndeterminate" <el-radio label="NOTLIMIT">不限制</el-radio>
@change="replaceHandleCheckAllChange">全部</el-checkbox> <el-radio :label="cur.value" v-for="cur in getStrDictOptions(DICT_TYPE.STORAGE_TYPE)"
<el-checkbox-group v-model="formData.replaceStorageType" @change="replaceHandleCheckedCitiesChange" :key="cur.value">{{ cur.label }}</el-radio>
style="margin-left: 30px;flex:1"> </el-radio-group>
<el-checkbox :label="item" v-for="(item, index) in options.storageTypeOptions" :key="index" />
</el-checkbox-group>
</div> </div>
</el-form-item> </el-form-item>
</el-col> <!-- 替代容量 -->
<!-- 替代存储容量 --> <el-form-item label="替代容量" v-else-if="index == 3">
<el-col :span="24"> <el-input v-model="item.Value" placeholder="请输入替代容量" clearable />
<el-form-item label="替代存储容量" prop="replaceStorageCapacity">
<el-input v-model="formData.replaceStorageCapacity" placeholder="请输入存储容量" clearable />
</el-form-item> </el-form-item>
</el-col>
<!-- 固定位置 --> <!-- 固定位置 -->
<el-col :span="24"> <el-form-item label="固定位置" v-else-if="index == 4">
<el-form-item label="固定位置" prop="fixedPosition"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.fixedPosition" />
</el-form-item> </el-form-item>
</el-col>
<!-- 占用相邻库位 --> <!-- 占用相邻库位 -->
<el-col :span="24"> <el-form-item label="占用相邻库位" v-else-if="index == 5">
<el-form-item label="占用相邻库位" prop="occupyWarehouse"> <el-switch v-model="item.Value" />
<el-switch v-model="formData.occupyWarehouse" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
</el-form>
</div> </div>
<template #footer> <template #footer>
<!-- 按钮--> <!-- 按钮-->
@ -145,7 +143,15 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'StorageCapacityStrategyAddForm' }) defineOptions({ name: 'UpShelfStrategyAddForm' })
import { getWarehouseList } from '@/api/wms/warehouse'
import { getAreaList } from '@/api/wms/areabasic'
import { getLocationgroupList } from '@/api/wms/locationgroup'
import { getLocationList } from '@/api/wms/location'
import * as RuleApi from '@/api/wms/rule'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -154,74 +160,166 @@ const dialogVisible = ref(false) // 弹窗的是否展示
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formRef1 = ref() // Ref const formRef = ref() // Ref
const formRef2 = ref() // Ref
const formRef3 = ref() // Ref
const formStrategyCode = ref('')
// form // form
const formData = ref({ const formData = ref({
code: '',// id: '',
strategyCode: formStrategyCode.value,//id
name: '',// name: '',//
describe: '',// description: '',//
priority: '',// priority: '',//
status: false,// status: true,//
//
condition: [
// ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
//
{ ParamCode: 'LocationCode', Operator: "IN", Value: "" },
],
configuration: [
//
{ ParamCode: 'StorageType', Value: 'NOTLIMIT' },
//
{ ParamCode: 'StorageQty', Value: '' },
//
{ ParamCode: 'AltStorageType', Value: 'NOTLIMIT' },
//
{ ParamCode: 'AltStorageQty', Value: '' },
//
{ ParamCode: 'IsFixed', Value: false },
//
{ ParamCode: 'IsOccupyAdjacent', Value: false },
]
//
itemType: 1,//
itemTypeRange: 1, //
item: '',//
//
warehouseType: 1,/////
warehouseTypeRange: 1, //
warehouse: '',/////
storageType: [],//
storageCapacity:'',//
replaceStorageType:[],//
replaceStorageCapacity: '',//
fixedPosition:false,//
occupyWarehouse: false,//
}) })
// //
const rules = ref({ const rules = ref({
code: [{ required: true, message: '请输入代码', trigger: 'blur' }], strategyCode: [{ required: true, message: '请输入代码', trigger: 'blur' }],
name: [{ required: true, message: '请输入名字', trigger: 'blur' }], name: [{ required: true, message: '请输入名字', trigger: 'blur' }],
describe: [{ required: true, message: '请输入描述', trigger: 'blur' }], description: [{ required: true, message: '请输入描述', trigger: 'blur' }],
priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }], priority: [{ required: true, message: '请输入优先级', trigger: 'blur' }],
item: [{ required: true, message: '请选择物品', trigger: 'change' }],
warehouse: [{ required: true, message: '请选择仓库', trigger: 'change' }],
storageType: [{ required: true, message: '请选择存储类型', trigger: 'change' }],
storageCapacity: [{ required: true, message: '请输入存储容量', trigger: 'blur' }],
replaceStorageType: [{ required: true, message: '请选择替代存储类型', trigger: 'change' }],
replaceStorageCapacity: [{ required: true, message: '请输入替代存储容量', trigger: 'blur' }],
fixedPosition: [{ required: true, message: '请选择固定位置', trigger: 'change' }],
occupyWarehouse: [{ required: true, message: '请选择占用相邻库位', trigger: 'change' }],
}) })
//
const rangeOptions = [
{ value: '==', label: '等于' },
{ value: '!=', label: '不等于' },
{ value: '>', label: '大于' },
{ value: '<', label: '小于' },
{ value: '>=', label: '大于等于' },
{ value: '<=', label: '小于等于' },
{ value: 'IN', label: '包含' },
{ value: 'NOT IN', label: '不包含' },
{ value: 'NULL', label: '为空' },
{ value: 'NOT NULL', label: '不为空' },
]
const formatRangeOptions = (...rest) => {
//
let result = rangeOptions.filter(aItem => rest.some(bItem => aItem.value === bItem));
return result
}
// //
const options = reactive({ const options = reactive({
// //
rangeOptions: [{ value: 1, label: '包含' }, { value: 2, label: '大于', }], rangeOptions1: formatRangeOptions('IN', 'NOT IN'),
// //
itemTypeOptions: [{ value: 1, label: '物品分类' }, { value: 2, label: '物品分组' }, { value: 3, label: '物品' }, { value: 4, label: '项目' }, { value: 5, label: 'ABC类' }], itemTypeOptions: [{ value: 'ItemGroup', label: '物品分组' }, { value: 'ItemCode', label: '物品' }, { value: 'Project', label: '项目' }],
//
itemList: [{ value: 1, label: '物品1' }, { value: 2, label: '物品2' }, { value: 3, label: '物品3' }], //
// warehouseTypeOptions: [{ value: 'WarehouseCode', label: '仓库' }, { value: 'AreaCode', label: '库区' }, { value: 'LocationGroupCode', label: '库位组' }, { value: 'LocationCode', label: '库位' }],
warehouseTypeOptions: [{ value: 1, label: '仓库' }, { value: 2, label: '库区' }, { value: 3, label: '库位组' }, { value: 4, label: '库位' }], warehouseList: [],
// //
warehouseTypeList: [{ value: 1, label: '仓库1' }, { value: 2, label: '仓库2' }, { value: 3, label: '仓库3' }], overflowWarehouseList: []
//
storageTypeOptions: ['包装', '容器', '单件'],
}) })
// //abc//
const changeItemsType = () => {
formData.value.condition[1].Value = ''
}
//
const getFormWarehouseList = async () => {
options.warehouseList = await getWarehouseList();
}
//
const getFormAreaList = async () => {
options.warehouseList = await getAreaList();
}
//
const getFormLocationgrouList = async () => {
options.warehouseList = await getLocationgroupList();
}
//
const getFormLocationList = async (queryParms) => {
if (queryParms) {
options.overflowWarehouseList = await getLocationList(queryParms);
} else {
options.warehouseList = await getLocationList();
}
}
getFormLocationList()
//
const queryParms = {
type: 'OVERFLOW'
}
getFormLocationList(queryParms)
// ///
const changeWarehouse = (e) => {
formData.value.condition[0].Value = ''
if (e == 'WarehouseCode') {
getFormWarehouseList()
} else if (e == 'AreaCode') {
getFormAreaList()
} else if (e == 'LocationGroupCode') {
getFormLocationgrouList()
} else if (e == 'LocationCode') {
getFormLocationList()
}
}
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, strategyCode: string, id?: number) => {
formStrategyCode.value = strategyCode
dialogVisible.value = true dialogVisible.value = true
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
formType.value = type formType.value = type
resetForm() resetForm()
// //
if (id) {
formLoading.value = true
try {
let data = await RuleApi.getRule(id)
formData.value.id = data.id
formData.value.strategyCode = data.strategyCode
formData.value.name = data.name
formData.value.description = data.description
formData.value.priority = data.priority
formData.value.status = data.status == 0 ? true : false
if (data.condition) {
formData.value.condition = JSON.parse(data.condition)
}
if (data.configuration) {
formData.value.configuration = JSON.parse(data.configuration)
}
// ///
if (formData.value.configuration[0].ParamCode == 'WarehouseCode') {
getFormWarehouseList()
} else if (formData.value.configuration[0].ParamCode == 'AreaCode') {
getFormAreaList()
} else if (formData.value.configuration[0].ParamCode == 'LocationGroupCode') {
getFormLocationgrouList()
} else if (formData.value.configuration[0].ParamCode == 'LocationCode') {
getFormLocationList()
}
} finally {
formLoading.value = false
}
}
} }
defineExpose({ open }) // open defineExpose({ open }) // open
@ -229,41 +327,68 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
// //
if (!formRef1 || !formRef2 || !formRef3) return if (!formRef) return
const valid2 = formRef2.value.validate() const valid = await formRef.value.validate()
const valid1 = formRef1.value.validate() if (!valid) return
const valid3 = await formRef3.value.validate()
if (!valid1 || !valid2 || !valid3) return
// //
formLoading.value = true formLoading.value = true
try {
let data = {
id: formData.value.id,
strategyCode: formData.value.strategyCode,//
name: formData.value.name,//
description: formData.value.description,//
priority: formData.value.priority,//
status: formData.value.status ? 0 : 1,//
//
condition: JSON.stringify(formData.value.condition),
configuration: JSON.stringify(formData.value.configuration)
}
if (formType.value === 'create') {
await RuleApi.createRule(data)
message.success(t('common.createSuccess'))
} else {
await RuleApi.updateRule(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
} }
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
code: '', id: '',
name: '', strategyCode: formStrategyCode.value,//id
describe: '', name: '',//
priority: '', description: '',//
status: false, priority: '',//
// status: true,//
itemType: 1,// //
itemTypeRange: 1, // condition: [
item: '',// // ///abc//
{ ParamCode: 'ItemGroup', Operator: "IN", Value: "" },
// //
warehouseType: 1,///// { ParamCode: 'LocationCode', Operator: "IN", Value: "" },
warehouseTypeRange: 1, // ],
warehouse: '',///// configuration: [
//
{ ParamCode: 'StorageType', Value: 'NOTLIMIT' },
storageType: [],// //
storageCapacity: '',// { ParamCode: 'StorageQty', Value: '' },
replaceStorageType: [],// //
replaceStorageCapacity: '',// { ParamCode: 'AltStorageType', Value: 'NOTLIMIT' },
fixedPosition: false,// //
occupyWarehouse: false,// { ParamCode: 'AltStorageQty', Value: '' },
//
{ ParamCode: 'IsFixed', Value: false },
//
{ ParamCode: 'IsOccupyAdjacent', Value: false },
]
} }
} }
@ -283,37 +408,7 @@ const buttonBaseClick = (val, item) => {
dialogVisible.value = false dialogVisible.value = false
} }
} }
//
const checkAll = ref(false)
const isIndeterminate = ref(false)
const handleCheckAllChange = (val: boolean) => {
console.log(formData.value.storageType);
formData.value.storageType = val ? options.storageTypeOptions : []
console.log(formData.value.storageType);
isIndeterminate.value = false
}
const handleCheckedCitiesChange = (value: string[]) => {
const checkedCount = value.length
checkAll.value = checkedCount === options.storageTypeOptions.length
isIndeterminate.value = checkedCount > 0 && checkedCount < options.storageTypeOptions.length
}
//
const replaceCheckAll = ref(false)
const replaceIsIndeterminate = ref(false)
const replaceHandleCheckAllChange = (val: boolean) => {
console.log(formData.value.storageType);
formData.value.replaceStorageType = val ? options.storageTypeOptions : []
console.log(formData.value.storageType);
replaceIsIndeterminate.value = false
}
const replaceHandleCheckedCitiesChange = (value: string[]) => {
const checkedCount = value.length
replaceCheckAll.value = checkedCount === options.storageTypeOptions.length
replaceIsIndeterminate.value = checkedCount > 0 && checkedCount < options.storageTypeOptions.length
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.item { .item {
@ -352,4 +447,8 @@ const replaceHandleCheckedCitiesChange = (value: string[]) => {
::v-deep .err-120 .el-form-item__error { ::v-deep .err-120 .el-form-item__error {
padding-left: 120px !important; padding-left: 120px !important;
} }
::v-deep .err-130 .el-form-item__error {
padding-left: 130px !important;
}
</style> </style>

82
src/views/wms/strategy/storageCapacityStrategy/index.vue

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

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

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