| | |
| | | <el-col :span="12" v-if="form.frequencyType === 'DAILY' && form.frequencyType"> |
| | | <el-form-item label="日期" prop="frequencyDetail"> |
| | | <el-time-picker v-model="form.frequencyDetail" placeholder="选择时间" format="HH:mm" |
| | | value-format="HH:mm" /> |
| | | value-format="HH:mm" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" v-if="form.frequencyType === 'WEEKLY' && form.frequencyType"> |
| | |
| | | <el-option label="周日" value="SUN"/> |
| | | </el-select> |
| | | <el-time-picker v-model="form.time" placeholder="选择时间" format="HH:mm" |
| | | value-format="HH:mm" style="width: 50%"/> |
| | | value-format="HH:mm" style="width: 50%"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" v-if="form.frequencyType === 'MONTHLY' && form.frequencyType"> |
| | |
| | | format="MM,DD,HH:mm" |
| | | value-format="MM,DD,HH:mm" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="定时任务"> |
| | | <el-switch |
| | | v-model="form.isActive" |
| | | :active-value="1" |
| | | :inactive-value="0" |
| | | active-text="开启" |
| | | inactive-text="关闭" |
| | | inline-prompt |
| | | /> |
| | | <span style="margin-left: 12px; color: #909399; font-size: 12px;"> |
| | | {{ form.isActive === 1 ? '任务将按计划执行' : '任务暂停执行' }} |
| | | </span> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | time: '', |
| | | deviceModel: undefined, // 规格型号 |
| | | registrationDate: '', |
| | | maintenancePerson: '' // 保养人 |
| | | maintenancePerson: '', // 保养人 |
| | | isActive: 0 // 定时任务开关:0=关闭,1=开启 |
| | | }, |
| | | rules: { |
| | | taskId: [{ required: true, message: "请选择设备", trigger: "change" },], |
| | |
| | | time: '', |
| | | deviceModel: undefined, |
| | | registrationDate: '', |
| | | maintenancePerson: '' |
| | | maintenancePerson: '', |
| | | isActive: 0 |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | delete payload.inspector |
| | | delete payload.inspectorIds |
| | | |
| | | delete payload.active |
| | | |
| | | if (payload.frequencyType === 'WEEKLY') { |
| | | let frequencyDetail = '' |
| | | frequencyDetail = payload.week + ',' + payload.time |
| | | payload.frequencyDetail = frequencyDetail |
| | | } |
| | | |
| | | |
| | | // 录入日期:直接使用表单里的 registrationDate 字段 |
| | | // 一些默认状态字段 |
| | | if (payload.status === undefined || payload.status === null || payload.status === '') { |
| | | payload.status = '0' // 默认状态,可按实际枚举调整 |
| | | } |
| | | payload.active = true |
| | | payload.deleted = 0 |
| | | |
| | | |
| | | if (operationType.value === 'edit') { |
| | | await deviceMaintenanceTaskEdit(payload) |
| | | } else { |
| | |
| | | }" |
| | | @selection-change="handleScheduledSelectionChange" |
| | | @pagination="changeScheduledPage"> |
| | | <template #isActiveRef="{ row }"> |
| | | <el-tag v-if="row.isActive === 1" |
| | | type="success">开启</el-tag> |
| | | <el-tag v-else |
| | | type="info">关闭</el-tag> |
| | | </template> |
| | | <template #statusRef="{ row }"> |
| | | <el-tag v-if="row.status === 1" |
| | | type="success">启用</el-tag> |
| | |
| | | { |
| | | prop: "frequencyType", |
| | | label: "频次", |
| | | minWidth: 150, |
| | | minWidth: 50, |
| | | // PIMTable 使用的是 formatData,而不是 Element-Plus 的 formatter |
| | | formatData: cell => |
| | | ({ |
| | |
| | | { |
| | | prop: "frequencyDetail", |
| | | label: "开始日期与时间", |
| | | minWidth: 150, |
| | | minWidth: 130, |
| | | // 同样改用 formatData,PIMTable 内部会把单元格值传进来 |
| | | formatData: cell => { |
| | | if (typeof cell !== "string") return ""; |
| | |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | prop: "isActive", |
| | | label: "定时任务", |
| | | dataType: "slot", |
| | | slot: "isActiveRef", |
| | | align: "center", |
| | | minWidth: 100, |
| | | }, |
| | | { prop: "maintenancePerson", label: "保养人", minWidth: 100 }, |
| | | { prop: "registrant", label: "登记人", minWidth: 100 }, |
| | | { |
| | |
| | | label: "登记日期", |
| | | minWidth: 100, |
| | | formatData: cell => |
| | | cell ? dayjs(cell).format("YYYY-MM-DD HH:mm:ss") : "-", |
| | | cell ? dayjs(cell).format("YYYY-MM-DD") : "-", |
| | | }, |
| | | { |
| | | fixed: "right", |
| | |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | width: "150px", |
| | | }, |
| | | ]); |
| | | |