| | |
| | | <el-form-item label="班次" |
| | | prop="shift"> |
| | | <el-select v-model="form.shift" |
| | | placeholder="请选择班次" |
| | | placeholder="请选择或输入班次" |
| | | filterable |
| | | allow-create |
| | | default-first-option |
| | | :disabled="operationType === 'view'" |
| | | style="width: 100%"> |
| | | <el-option v-for="item in shifts_list" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :disabled=" |
| | | operationType === 'add' && |
| | | (String(item.label || '').includes('假') || |
| | | String(item.label || '').includes('休')) |
| | | " /> |
| | | :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="打卡范围(m)" |
| | |
| | | // 获取班次字典值 |
| | | const { shifts_list } = useDict("shifts_list"); |
| | | |
| | | const selectedShiftLabel = computed(() => { |
| | | const item = shifts_list.value?.find( |
| | | s => String(s.value) === String(form.shift) |
| | | ); |
| | | return item?.label || ""; |
| | | }); |
| | | |
| | | const hideClockFields = computed(() => { |
| | | if (props.operationType === "view") return false; |
| | | return ( |
| | | selectedShiftLabel.value.includes("假") || |
| | | selectedShiftLabel.value.includes("休") |
| | | ); |
| | | const shiftName = form.shift || ""; |
| | | return shiftName.includes("假") || shiftName.includes("休"); |
| | | }); |
| | | |
| | | // 表单数据 |