This commit is contained in:
lb 2024-02-05 11:17:19 +08:00
parent ae7b13695a
commit 9f82aac931
2 changed files with 100 additions and 208 deletions

View File

@ -29,16 +29,11 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="保养计划名称" prop="name">
label="保养计划名称"
prop="name"
:rules="[
{ required: true, message: '请输入保养计划名称', trigger: 'blur' },
]">
<el-input <el-input
v-model="form.name" v-model="form.name"
:placeholder="`请输入保养计划名称`" disabled
:disabled="disabled" /> :placeholder="`请输入保养计划名称`" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -101,114 +96,27 @@
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item
label="设备"
prop="equipmentId"
:rules="[{ required: true, message: '请选择设备', trigger: 'blur' }]">
<el-select
v-model="form.equipmentId"
:placeholder="`请选择设备`"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in equipmentOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item> -->
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="计划保养人员" prop="maintainer">
label="保养频率(天/次)" <el-input v-model="form.maintainer" disabled />
prop="maintenancePeriod"
:rules="[
{
type: 'number',
message: '请输入正确的数字',
trigger: 'blur',
transform: (val) => Number(val),
},
{ required: true, message: '保养频率不能为空', trigger: 'blur' },
]">
<el-input
v-model="form.maintenancePeriod"
@change="$emit('update', form)"
:placeholder="`请输入保养频率`"
:disabled="disabled" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="确认时限(h)" label="计划开始时间"
prop="confirmTimeLimit"
:rules="[
{ required: true, message: '请输入确认时限', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字',
trigger: 'blur',
transform: (val) => Number(val),
},
]">
<el-input
v-model="form.confirmTimeLimit"
@change="$emit('update', form)"
:placeholder="`请输入确认时限(小时)`"
:disabled="disabled" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="保养类型" prop="maintainType">
<el-select
v-model="form.maintainType"
:placeholder="`请选择保养类型`"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.MAINTAIN_TYPE)"
:key="opt.value"
:label="opt.label"
:value="+opt.value" />
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="保养时长(h)"
prop="maintainDuration"
:rules="[
{
type: 'number',
message: '请输入正确的数字',
trigger: 'blur',
transform: (val) => Number(val),
},
]">
<el-input
v-model="form.maintainDuration"
@change="$emit('update', form)"
:placeholder="`请输入保养时长(小时)`"
:disabled="disabled" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="首次保养时间"
prop="firstMaintenanceTime" prop="firstMaintenanceTime"
:rules="[ :rules="[
{ required: true, message: '请选择首次保养时间', trigger: 'blur' }, { required: true, message: '请选择计划开始时间', trigger: 'blur' },
]"> ]">
<el-date-picker <el-date-picker
v-model="form.firstMaintenanceTime" v-model="form.firstMaintenanceTime"
type="datetime" type="datetime"
:disabled="edit" :disabled="edit"
:placeholder="`请选择首次保养时间`" placeholder="请选择计划开始时间"
@change="$emit('update', form)" @change="$emit('update', form)"
value-format="timestamp"></el-date-picker> value-format="timestamp"></el-date-picker>
</el-form-item> </el-form-item>
@ -216,10 +124,61 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="计划保养人员" label="计划结束时间"
prop="firstMaintenanceTime"
:rules="[
{ required: true, message: '请选择计划结束时间', trigger: 'blur' },
]">
<el-date-picker
v-model="form.firstMaintenanceTime"
type="datetime"
:disabled="edit"
placeholder="请选择计划结束时间"
@change="$emit('update', form)"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="实际开始时间"
prop="firstMaintenanceTime"
:rules="[
{ required: true, message: '请选择实际开始时间', trigger: 'blur' },
]">
<el-date-picker
v-model="form.firstMaintenanceTime"
type="datetime"
:disabled="edit"
placeholder="请选择实际开始时间"
@change="$emit('update', form)"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="实际结束时间"
prop="firstMaintenanceTime"
:rules="[
{ required: true, message: '请选择实际结束时间', trigger: 'blur' },
]">
<el-date-picker
v-model="form.firstMaintenanceTime"
type="datetime"
:disabled="edit"
placeholder="请选择实际结束时间"
@change="$emit('update', form)"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="实际保养人员"
prop="maintainer" prop="maintainer"
:rules="[ :rules="[
{ required: true, message: '请选择计划保养人员', trigger: 'blur' }, { required: true, message: '请选择实际保养人员', trigger: 'blur' },
]"> ]">
<el-select <el-select
v-model="form.maintainer" v-model="form.maintainer"

View File

@ -29,16 +29,8 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="保养计划名称" prop="name">
label="保养计划名称" <span>---</span>
prop="name"
:rules="[
{ required: true, message: '请输入保养计划名称', trigger: 'blur' },
]">
<el-input
v-model="form.name"
:placeholder="`请输入保养计划名称`"
:disabled="disabled" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -101,114 +93,38 @@
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item
label="设备"
prop="equipmentId"
:rules="[{ required: true, message: '请选择设备', trigger: 'blur' }]">
<el-select
v-model="form.equipmentId"
:placeholder="`请选择设备`"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in equipmentOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item> -->
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="计划保养人员" prop="maintainer">
label="保养频率(天/次)" <span>---</span>
prop="maintenancePeriod" </el-form-item>
:rules="[ </el-col>
{
type: 'number', <el-col :span="12">
message: '请输入正确的数字', <el-form-item label="计划开始时间" prop="firstMaintenanceTime">
trigger: 'blur', <span>---</span>
transform: (val) => Number(val), </el-form-item>
}, </el-col>
{ required: true, message: '保养频率不能为空', trigger: 'blur' },
]"> <el-col :span="12">
<el-input <el-form-item label="计划结束时间" prop="firstMaintenanceTime">
v-model="form.maintenancePeriod" <span>---</span>
@change="$emit('update', form)"
:placeholder="`请输入保养频率`"
:disabled="disabled" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="确认时限(h)" label="实际开始时间"
prop="confirmTimeLimit"
:rules="[
{ required: true, message: '请输入确认时限', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字',
trigger: 'blur',
transform: (val) => Number(val),
},
]">
<el-input
v-model="form.confirmTimeLimit"
@change="$emit('update', form)"
:placeholder="`请输入确认时限(小时)`"
:disabled="disabled" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="保养类型" prop="maintainType">
<el-select
v-model="form.maintainType"
:placeholder="`请选择保养类型`"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.MAINTAIN_TYPE)"
:key="opt.value"
:label="opt.label"
:value="+opt.value" />
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="保养时长(h)"
prop="maintainDuration"
:rules="[
{
type: 'number',
message: '请输入正确的数字',
trigger: 'blur',
transform: (val) => Number(val),
},
]">
<el-input
v-model="form.maintainDuration"
@change="$emit('update', form)"
:placeholder="`请输入保养时长(小时)`"
:disabled="disabled" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="首次保养时间"
prop="firstMaintenanceTime" prop="firstMaintenanceTime"
:rules="[ :rules="[
{ required: true, message: '请选择首次保养时间', trigger: 'blur' }, { required: true, message: '请选择实际开始时间', trigger: 'blur' },
]"> ]">
<el-date-picker <el-date-picker
v-model="form.firstMaintenanceTime" v-model="form.firstMaintenanceTime"
type="datetime" type="datetime"
:disabled="edit" :disabled="edit"
:placeholder="`请选择首次保养时间`" placeholder="请选择实际开始时间"
@change="$emit('update', form)" @change="$emit('update', form)"
value-format="timestamp"></el-date-picker> value-format="timestamp"></el-date-picker>
</el-form-item> </el-form-item>
@ -216,10 +132,27 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="计划保养人员" label="实际结束时间"
prop="firstMaintenanceTime"
:rules="[
{ required: true, message: '请选择实际结束时间', trigger: 'blur' },
]">
<el-date-picker
v-model="form.firstMaintenanceTime"
type="datetime"
:disabled="edit"
placeholder="请选择实际结束时间"
@change="$emit('update', form)"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="实际保养人员"
prop="maintainer" prop="maintainer"
:rules="[ :rules="[
{ required: true, message: '请选择计划保养人员', trigger: 'blur' }, { required: true, message: '请选择实际保养人员', trigger: 'blur' },
]"> ]">
<el-select <el-select
v-model="form.maintainer" v-model="form.maintainer"