Commit c34dbd07 authored by 姬鋆屾's avatar 姬鋆屾

修改字段

parent 452103c9
<template> <template>
<!-- 弹出框表单 --> <!-- 弹出框表单 -->
<el-drawer <el-drawer
:title="title" :title="title"
:visible.sync="open" :visible.sync="open"
:direction="direction" :direction="direction"
size="50%"> size="50%"
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> >
<el-row> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<Field label="班次ID" prop="shiftsId" v-model="form.shiftsId" placeholder="请输入班次ID"/> <el-row>
<Field label="班次名称" prop="shiftsName" v-model="form.shiftsName" placeholder="请输入班次名称"/> <Field
<Field label="上班打卡时间" prop="goWorkDate" v-model="form.goWorkDate" type="date" /> label="班次ID"
<Field label="上班打卡前时间段,单位分钟" prop="goWorkDateBefore" v-model="form.goWorkDateBefore" placeholder="请输入上班打卡前时间段,单位分钟"/> prop="shiftsId"
<Field label="上班打卡前时间段,单位分钟" prop="goWorkDateAfter" v-model="form.goWorkDateAfter" placeholder="请输入上班打卡前时间段,单位分钟"/> v-model="form.shiftsId"
<Field label="下班打卡时间" prop="offWorkDate" v-model="form.offWorkDate" type="date" /> placeholder="请输入班次ID"
<Field label="下班打卡前时间段,单位分钟" prop="offWorkDateBefore" v-model="form.offWorkDateBefore" placeholder="请输入下班打卡前时间段,单位分钟"/> />
<Field label="下班打卡前时间段,单位分钟" prop="offWorkDateAfter" v-model="form.offWorkDateAfter" placeholder="请输入下班打卡前时间段,单位分钟"/> <Field
<Field label="备注" prop="remark" v-model="form.remark" type="textarea" placeholder="请输入备注"/> label="班次名称"
prop="shiftsName"
v-model="form.shiftsName"
placeholder="请输入班次名称"
/>
<Field
label="上班打卡时间"
prop="goWorkDate"
v-model="form.goWorkDate"
type="date"
/>
<Field
label="上班打卡前时间段,单位分钟"
prop="goWorkDateBefore"
v-model="form.goWorkDateBefore"
placeholder="请输入上班打卡前时间段,单位分钟"
/>
<Field
label="上班打卡前时间段,单位分钟"
prop="goWorkDateAfter"
v-model="form.goWorkDateAfter"
placeholder="请输入上班打卡前时间段,单位分钟"
/>
<Field
label="下班打卡时间"
prop="offWorkDate"
v-model="form.offWorkDate"
type="date"
/>
<Field
label="下班打卡前时间段,单位分钟"
prop="offWorkDateBefore"
v-model="form.offWorkDateBefore"
placeholder="请输入下班打卡前时间段,单位分钟"
/>
<Field
label="下班打卡前时间段,单位分钟"
prop="offWorkDateAfter"
v-model="form.offWorkDateAfter"
placeholder="请输入下班打卡前时间段,单位分钟"
/>
<Field
label="备注"
prop="remark"
v-model="form.remark"
type="textarea"
placeholder="请输入备注"
/>
</el-row>
</el-row> <form-buttons @submit="submitForm" noCancelBtn />
</el-form>
<form-buttons @submit='submitForm' noCancelBtn /> </el-drawer>
</el-form>
</el-drawer>
</template> </template>
<script> <script>
import form from "@/assets/mixins/formdialog"; import form from "@/assets/mixins/formdialog";
export default { export default {
name: "AttendanceClassDetailDetail", name: "AttendanceClassDetailDetail",
mixins: [form], mixins: [form],
components: { components: {},
created() {
}, this.changePath("attendance/class/detail");
created() { },
this.changePath("attendance/class/detail") data() {
}, return {
data() { // 遮罩层
return { loading: true,
// 遮罩层 // 弹出层标题
loading: true, title: "考勤班次详细信息",
// 弹出层标题 // 是否显示弹出层
title: "考勤班次详细信息", open: false,
// 是否显示弹出层 direction: "rtl",
open: false, toString: [],
direction:"rtl", toDate: ["goWorkDate", "offWorkDate"],
toString:[ // 表单校验
], rules: {
toDate:[ createTime: [{ required: true, message: "请选择创建时间" }],
"goWorkDate", },
"offWorkDate", };
], },
// 表单校验
rules: {
createTime: [
{required: true,message: "请选择创建时间" },
],
}
};
},
methods: { methods: {
/** 编辑 */ /** 编辑 */
edit(row) { edit(row) {
this.reset() this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="attendance/class/detail/edit"; this.urls.currUrl = "attendance/class/detail/edit";
this.getData(); this.getData();
this.pageInfo.type="edit" this.pageInfo.type = "edit";
this.title = "修改考勤班次详细信息"; this.title = "修改考勤班次详细信息";
}, },
/** 新增 */ /** 新增 */
add(row) { add(row) {
this.reset() this.reset();
this.urls.currUrl = "attendance/class/detail/add"; this.urls.currUrl = "attendance/class/detail/add";
this.getData(); this.getData();
this.pageInfo.type="add" this.pageInfo.type = "add";
this.title = "新增考勤班次详细信息"; this.title = "新增考勤班次详细信息";
}, },
/** 查看*/ /** 查看*/
view(row) { view(row) {
this.reset() this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl ="attendance/class/detail/view"; this.urls.currUrl = "attendance/class/detail/view";
this.getData(); this.getData();
this.pageInfo.type="view" this.pageInfo.type = "view";
this.title = "考勤班次详细信息详细"; this.title = "考勤班次详细信息详细";
}, },
/**取消按钮 */ /**取消按钮 */
cancel() { cancel() {
this.open = false; this.open = false;
}, },
/**获取数据后弹框 */ /**获取数据后弹框 */
afterRender(data) { afterRender(data) {
this.open = true; this.open = true;
}, },
afterSubmit(data) { afterSubmit(data) {
this.open = false; this.open = false;
this.$emit("ok"); this.$emit("ok");
}, },
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
shiftsId : null, shiftsId: null,
shiftsName : "", shiftsName: "",
goWorkDate : null, goWorkDate: null,
goWorkDateBefore : null, goWorkDateBefore: null,
goWorkDateAfter : null, goWorkDateAfter: null,
offWorkDate : null, offWorkDate: null,
offWorkDateBefore : null, offWorkDateBefore: null,
offWorkDateAfter : null, offWorkDateAfter: null,
remark : "", remark: "",
}; };
this.resetForm("form"); this.resetForm("form");
}, },
resetForm(refName) { resetForm(refName) {
if (this.$refs[refName]) { if (this.$refs[refName]) {
this.$refs[refName].resetFields(); this.$refs[refName].resetFields();
} }
}, },
}, },
}; };
</script> </script>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<Field label="班次负责人" prop="classResponsiblePersonId" type="select" :enumData="dict.workManId" <Field label="班次负责人" prop="classResponsiblePersonId" type="select" :enumData="dict.workManId"
v-model="form.classResponsiblePersonId" placeholder="请选择班次负责人"/> v-model="form.classResponsiblePersonId" placeholder="请选择班次负责人"/>
</el-row> </el-row>
<el-form-item label="上下班时间" prop="attendanceClassDetailList"> <el-form-item label="上下班考勤时间" prop="attendanceClassDetailList">
<el-button type="text" @click="handleAddAttendanceClassDetail">添加</el-button> <el-button type="text" @click="handleAddAttendanceClassDetail">添加</el-button>
<div class="bancifor" v-for="(item,index) in attendanceClassDetailList" :key="index"> <div class="bancifor" v-for="(item,index) in attendanceClassDetailList" :key="index">
<div class="title flex flex-align-center flex-pack-justify"> <div class="title flex flex-align-center flex-pack-justify">
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<el-button type="danger" size="mini" @click="handleDeleteAttendanceClassDetail(index)">删除</el-button> <el-button type="danger" size="mini" @click="handleDeleteAttendanceClassDetail(index)">删除</el-button>
</div> </div>
<div> <div>
<span>上班时间</span> <span>上班考勤时间</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
style="width:150px" style="width:150px"
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
value-format="HH:mm" value-format="HH:mm"
format="HH:mm" format="HH:mm"
v-model="item.goWorkDate" v-model="item.goWorkDate"
placeholder="上班时间"> placeholder="上班考勤时间">
</el-time-picker> </el-time-picker>
</div> </div>
<div> <div>
<span>打开时段: </span> <span>打开时段: </span>
<span>上班前</span> <span>上班前签到</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
style="width:150px" style="width:150px"
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
placeholder="未设置"> placeholder="未设置">
</el-time-picker> </el-time-picker>
<span class="ml20">——</span> <span class="ml20">——</span>
<span class="ml20">上班后</span> <span class="ml20">上班后签到</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
style="width:150px" style="width:150px"
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</el-time-picker> </el-time-picker>
</div> </div>
<div> <div>
<span>下班时间</span> <span>下班考勤时间</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
style="width:150px" style="width:150px"
...@@ -61,12 +61,12 @@ ...@@ -61,12 +61,12 @@
format="HH:mm" format="HH:mm"
value-format="HH:mm" value-format="HH:mm"
v-model="item.offWorkDate" v-model="item.offWorkDate"
placeholder="下班时间"> placeholder="下班考勤时间">
</el-time-picker> </el-time-picker>
</div> </div>
<div> <div>
<span>打开时段:</span> <span>打开时段:</span>
<span>下班前</span> <span>下班前签退</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
style="width:150px" style="width:150px"
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
placeholder="未设置"> placeholder="未设置">
</el-time-picker> </el-time-picker>
<span class="ml20">——</span> <span class="ml20">——</span>
<span class="ml20">下班后</span> <span class="ml20">下班后签退</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
style="width:150px" style="width:150px"
...@@ -189,40 +189,40 @@ ...@@ -189,40 +189,40 @@
this.attendanceClassDetailList.push(obj); this.attendanceClassDetailList.push(obj);
}, },
// 判断添加上下班时间 // 判断添加上下班考勤时间
judgeStatus(arr,index){ judgeStatus(arr,index){
console.log(arr,index,'ces') console.log(arr,index,'ces')
let status = true let status = true
if(arr.length == 0){ if(arr.length == 0){
}else{ }else{
if(arr[index].goWorkDate === ''){ if(arr[index].goWorkDate === ''){
this.$message.error('请选择上班时间') this.$message.error('请选择上班考勤时间')
status = false status = false
return return
} }
if(arr[index].goWorkDateBefore === ''){ if(arr[index].goWorkDateBefore === ''){
this.$message.error('请选择允许上班前打卡时间') this.$message.error('请选择允许上班前签到打卡时间')
status = false status = false
return return
} }
if(arr[index].goWorkDateAfter === ''){ if(arr[index].goWorkDateAfter === ''){
this.$message.error('请选择允许上班后打卡时间') this.$message.error('请选择允许上班后签到打卡时间')
status = false status = false
return return
} }
if(arr[index].offWorkDate === ''){ if(arr[index].offWorkDate === ''){
this.$message.error('请选择下班时间') this.$message.error('请选择下班考勤时间')
status = false status = false
return return
} }
if(arr[index].offWorkDateBefore === ''){ if(arr[index].offWorkDateBefore === ''){
this.$message.error('请选择允许下班前打卡时间') this.$message.error('请选择允许下班前签退打卡时间')
status = false status = false
return return
} }
if(arr[index].offWorkDateAfter === ''){ if(arr[index].offWorkDateAfter === ''){
this.$message.error('请选择允许下班后打卡时间') this.$message.error('请选择允许下班后签退打卡时间')
status = false status = false
return return
} }
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
transFormMinut(arr[index].goWorkDateBefore) transFormMinut(arr[index].goWorkDateBefore)
if(currentwokeTime <= lastoffTime){ if(currentwokeTime <= lastoffTime){
this.$message.error(`第${index}上班时间需大于第${index-1}上班时间`) this.$message.error(`第${index}上班考勤时间需大于第${index-1}上班考勤时间`)
status = false status = false
return return
} }
......
...@@ -95,7 +95,6 @@ export default { ...@@ -95,7 +95,6 @@ export default {
data() { data() {
return { return {
switchValue: "0", switchValue: "0",
searchValue: "", searchValue: "",
index: -1, index: -1,
dataArr: [], dataArr: [],
...@@ -227,7 +226,7 @@ export default { ...@@ -227,7 +226,7 @@ export default {
type: this.activeName, type: this.activeName,
page: this.query.page, page: this.query.page,
orderColList: this.typeArr, orderColList: this.typeArr,
name: this.searchValue, name: `%${this.searchValue}%`,
}).then((res) => { }).then((res) => {
if (res.code == 1) { if (res.code == 1) {
this.tableData = res.data; this.tableData = res.data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment