|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="question-infos">
|
|
<div class="question-infos">
|
|
|
- <DialogCom title="编辑作息" @close="handleClose" :visible="show" width="800px">
|
|
|
|
|
|
|
+ <DialogCom title="编辑作息" @close="handleClose" :visible="show" width="800px" append-to-body>
|
|
|
<div class="page-body">
|
|
<div class="page-body">
|
|
|
<el-form :model="formData" :rules="formData.isEnable?formDataRules:{}" size="small" ref="form" label-position="right"
|
|
<el-form :model="formData" :rules="formData.isEnable?formDataRules:{}" size="small" ref="form" label-position="right"
|
|
|
label-width="120px" label-prefix=":">
|
|
label-width="120px" label-prefix=":">
|
|
@@ -30,47 +30,47 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item prop="workTime" label="上班时间:">
|
|
|
|
|
- <template >
|
|
|
|
|
- <el-time-select
|
|
|
|
|
- :picker-options="pickerOptions"
|
|
|
|
|
- v-model="formData.workTime"
|
|
|
|
|
- :disabled="!formData.isEnable || formData.isEnable === false"/>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item prop="workOffTime" label="下班时间:">
|
|
|
|
|
- <template >
|
|
|
|
|
- <el-time-select
|
|
|
|
|
- :picker-options="pickerOptions"
|
|
|
|
|
- v-model="formData.workOffTime"
|
|
|
|
|
- :disabled="!formData.isEnable || formData.isEnable === false"/>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
|
|
+<!-- <el-col :span="12">-->
|
|
|
|
|
+<!-- <el-form-item prop="workTime" label="上班时间:">-->
|
|
|
|
|
+<!-- <template >-->
|
|
|
|
|
+<!-- <el-time-select-->
|
|
|
|
|
+<!-- :picker-options="pickerOptions"-->
|
|
|
|
|
+<!-- v-model="formData.workTime"-->
|
|
|
|
|
+<!-- :disabled="!formData.isEnable || formData.isEnable === false"/>-->
|
|
|
|
|
+<!-- </template>-->
|
|
|
|
|
+<!-- </el-form-item>-->
|
|
|
|
|
+<!-- </el-col>-->
|
|
|
|
|
+<!-- <el-col :span="12">-->
|
|
|
|
|
+<!-- <el-form-item prop="workOffTime" label="下班时间:">-->
|
|
|
|
|
+<!-- <template >-->
|
|
|
|
|
+<!-- <el-time-select-->
|
|
|
|
|
+<!-- :picker-options="pickerOptions"-->
|
|
|
|
|
+<!-- v-model="formData.workOffTime"-->
|
|
|
|
|
+<!-- :disabled="!formData.isEnable || formData.isEnable === false"/>-->
|
|
|
|
|
+<!-- </template>-->
|
|
|
|
|
+<!-- </el-form-item>-->
|
|
|
|
|
+<!-- </el-col>-->
|
|
|
|
|
+<!-- <el-col :span="12">-->
|
|
|
|
|
|
|
|
- <el-form-item prop="noonbreakStart" label="午休开始:">
|
|
|
|
|
- <template>
|
|
|
|
|
- <el-time-select
|
|
|
|
|
- :picker-options="pickerOptions"
|
|
|
|
|
- v-model="formData.noonbreakStart"
|
|
|
|
|
- :disabled="!formData.isEnable || formData.isEnable === false"/>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item prop="noonbreakEnd" label="午休结束:">
|
|
|
|
|
- <template >
|
|
|
|
|
- <el-time-select
|
|
|
|
|
- :picker-options="pickerOptions"
|
|
|
|
|
- v-model="formData.noonbreakEnd"
|
|
|
|
|
- :disabled="!formData.isEnable || formData.isEnable === false"/>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
|
|
+<!-- <el-form-item prop="noonbreakStart" label="午休开始:">-->
|
|
|
|
|
+<!-- <template>-->
|
|
|
|
|
+<!-- <el-time-select-->
|
|
|
|
|
+<!-- :picker-options="pickerOptions"-->
|
|
|
|
|
+<!-- v-model="formData.noonbreakStart"-->
|
|
|
|
|
+<!-- :disabled="!formData.isEnable || formData.isEnable === false"/>-->
|
|
|
|
|
+<!-- </template>-->
|
|
|
|
|
+<!-- </el-form-item>-->
|
|
|
|
|
+<!-- </el-col>-->
|
|
|
|
|
+<!-- <el-col :span="12">-->
|
|
|
|
|
+<!-- <el-form-item prop="noonbreakEnd" label="午休结束:">-->
|
|
|
|
|
+<!-- <template >-->
|
|
|
|
|
+<!-- <el-time-select-->
|
|
|
|
|
+<!-- :picker-options="pickerOptions"-->
|
|
|
|
|
+<!-- v-model="formData.noonbreakEnd"-->
|
|
|
|
|
+<!-- :disabled="!formData.isEnable || formData.isEnable === false"/>-->
|
|
|
|
|
+<!-- </template>-->
|
|
|
|
|
+<!-- </el-form-item>-->
|
|
|
|
|
+<!-- </el-col>-->
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<el-form-item prop="openTime" label="营业开始:">
|
|
<el-form-item prop="openTime" label="营业开始:">
|
|
|
<template >
|
|
<template >
|
|
@@ -121,10 +121,10 @@ export default {
|
|
|
//表单验证
|
|
//表单验证
|
|
|
formDataRules: {
|
|
formDataRules: {
|
|
|
isEnable: [{ required: true, message: "请选择状态" }],
|
|
isEnable: [{ required: true, message: "请选择状态" }],
|
|
|
- workTime: [{ required: true, message: "请输入上班时间" }],
|
|
|
|
|
- workOffTime: [{ required: true, message: "请输入下班时间" }],
|
|
|
|
|
- noonbreakStart: [{ required: true, message: "请输入午休开始时间" }],
|
|
|
|
|
- noonbreakEnd: [{ required: true, message: "请输入午休结束时间" }],
|
|
|
|
|
|
|
+ // workTime: [{ required: true, message: "请输入上班时间" }],
|
|
|
|
|
+ // workOffTime: [{ required: true, message: "请输入下班时间" }],
|
|
|
|
|
+ // noonbreakStart: [{ required: true, message: "请输入午休开始时间" }],
|
|
|
|
|
+ // noonbreakEnd: [{ required: true, message: "请输入午休结束时间" }],
|
|
|
openTime: [{ required: true, message: "请输入营业时间" }],
|
|
openTime: [{ required: true, message: "请输入营业时间" }],
|
|
|
closeTime: [{ required: true, message: "请输入营业终了时间" }],
|
|
closeTime: [{ required: true, message: "请输入营业终了时间" }],
|
|
|
},
|
|
},
|
|
@@ -138,7 +138,7 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
start: "00:00",
|
|
start: "00:00",
|
|
|
end: "24:00",
|
|
end: "24:00",
|
|
|
- step: "00:10",
|
|
|
|
|
|
|
+ step: "00:05",
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -156,20 +156,20 @@ export default {
|
|
|
isEnable: 1,
|
|
isEnable: 1,
|
|
|
openTime: null,
|
|
openTime: null,
|
|
|
closeTime: null,
|
|
closeTime: null,
|
|
|
- noonbreakStart: null,
|
|
|
|
|
- noonbreakEnd: null,
|
|
|
|
|
- workTime: null,
|
|
|
|
|
- workOffTime: null,
|
|
|
|
|
|
|
+ // noonbreakStart: null,
|
|
|
|
|
+ // noonbreakEnd: null,
|
|
|
|
|
+ // workTime: null,
|
|
|
|
|
+ // workOffTime: null,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onEnableChange(workTime) {
|
|
onEnableChange(workTime) {
|
|
|
if (workTime.isEnable === false) {
|
|
if (workTime.isEnable === false) {
|
|
|
workTime.openTime = null;
|
|
workTime.openTime = null;
|
|
|
workTime.closeTime = null;
|
|
workTime.closeTime = null;
|
|
|
- workTime.noonbreakStart = null;
|
|
|
|
|
- workTime.noonbreakEnd = null;
|
|
|
|
|
- workTime.workTime = null;
|
|
|
|
|
- workTime.workOffTime = null;
|
|
|
|
|
|
|
+ // workTime.noonbreakStart = null;
|
|
|
|
|
+ // workTime.noonbreakEnd = null;
|
|
|
|
|
+ // workTime.workTime = null;
|
|
|
|
|
+ // workTime.workOffTime = null;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
handleClose() {
|
|
handleClose() {
|
|
@@ -182,23 +182,13 @@ export default {
|
|
|
onSubmit() {
|
|
onSubmit() {
|
|
|
this.$refs.form.validate((isValidate) => {
|
|
this.$refs.form.validate((isValidate) => {
|
|
|
if (!isValidate) return;
|
|
if (!isValidate) return;
|
|
|
- if (!this.formData.noonbreakStart ^ !this.formData.noonbreakEnd) {
|
|
|
|
|
- this.$message.warning(`午休开始及结束时间必须同时配置`);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
if (
|
|
if (
|
|
|
!timeCheck([
|
|
!timeCheck([
|
|
|
- this.formData.workTime,
|
|
|
|
|
this.formData.openTime,
|
|
this.formData.openTime,
|
|
|
- this.formData.noonbreakStart,
|
|
|
|
|
- this.formData.noonbreakEnd,
|
|
|
|
|
this.formData.closeTime,
|
|
this.formData.closeTime,
|
|
|
- this.formData.workOffTime,
|
|
|
|
|
])
|
|
])
|
|
|
) {
|
|
) {
|
|
|
- this.$message.warning(
|
|
|
|
|
- `时间配置规则:上班时间<=午休开始<=午休结束<=下班时间`
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ this.$message.warning(`营业开始时间应在营业结束之前`);
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
editWorkTime(this.formData).then(res=>{
|
|
editWorkTime(this.formData).then(res=>{
|