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

tui

parent 5332d7a4
<template> <template>
<!-- 弹出框表单 --> <!-- 弹出框表单 -->
<el-drawer <el-drawer
title="批量处理" title="批量处理"
:visible.sync="open" :visible.sync="open"
:direction="direction" :direction="direction"
size="50%"> size="50%"
<div style="padding:20px;font-size:15px"> >
<div> <div style="padding:20px;font-size:15px">
已选择{{selection.length}}个: <div>已选择{{ selection.length }}个:</div>
</div> <div class="staffList mt20">
<div class="staffList mt20"> <div v-for="item in selection" :key="item" class="mt10">
<div v-for="item in selection" :key="item" class="mt10"> <span> {{ item.staffName }} </span>
<span> {{item.staffName}} </span> <span
<span>{{item.goOrOff}} 时间 {{item.goOffDateTime}} 打卡异常状态</span> >{{ item.goOrOff }} 时间
<span class="ml10" style="color:#f56c6c"> {{ item.goOffDateTime }} 打卡异常状态</span
{{dict['errorStatus'][item.errorStatus]}} >
</span> <span class="ml10" style="color:#f56c6c">
<span class="ml10">修改为</span> {{ dict["errorStatus"][item.errorStatus] }}
</div> </span>
<div class="mt10"> <span class="ml10">修改为</span>
</div>
<!-- <div class="mt10">
<!--
<Field label="" v-model="dealParams.processResult" type="select" :enumData="dict.errorStatus"/> <Field label="" v-model="dealParams.processResult" type="select" :enumData="dict.errorStatus"/>
--> -->
<!-- 处理异常状态 --> <!-- 处理异常状态 -->
<el-select v-model="dealParams.processResult"> <el-select v-model="dealParams.errorStatus">
<el-option <el-option
v-for='($label, $value) in dict.errorStatus' v-for="($label, $value) in dict.errorStatus"
:key="$value" :key="$value"
:label="$label" :label="$label"
:value="$value"> :value="$value"
</el-option> >
</el-select> </el-option>
<!-- 早退/迟到 --> </el-select>
<el-input style="width:220px" placeholder="请输入数字" :maxlength="4" v-model="duration" <!-- 早退/迟到 -->
v-if="dealParams.processResult == '1'|| dealParams.processResult == '2'" <el-input
class="ml20" type="number"> style="width:220px"
<template slot="append">分钟</template> placeholder="请输入数字"
</el-input> :maxlength="4"
</div> v-model="duration"
<div class="mt10"> v-if="
<span>备注:</span> dealParams.errorStatus == '1' || dealParams.errorStatus == '2'
<el-input placeholder="请输入备注" type="textarea" show-word-limit class="mt10" "
:maxlength="50" v-model="dealParams.remark"></el-input> class="ml20"
</div> type="number"
</div> >
<div class="mt20"> <template slot="append">分钟</template>
<el-button type="primary" @click="saveForm">确定</el-button> </el-input>
<el-button @click="cancleFn">取消</el-button>
</div>
</div> </div>
<div class="mt10">
</el-drawer> <span>备注:</span>
<el-input
placeholder="请输入备注"
type="textarea"
show-word-limit
class="mt10"
:maxlength="50"
v-model="dealParams.processResult"
></el-input>
</div>
</div>
<div class="mt20">
<el-button type="primary" @click="saveForm">确定</el-button>
<el-button @click="cancleFn">取消</el-button>
</div>
</div>
</el-drawer>
</template> </template>
<script> <script>
export default { export default {
name: "AttendanceRecordDetail", name: "AttendanceRecordDetail",
created() { created() {},
data() {
}, return {
data() { // 遮罩层
return { loading: true,
// 遮罩层 // 弹出层标题
loading: true, title: "考勤打卡记录信息",
// 弹出层标题 // 是否显示弹出层
title: "考勤打卡记录信息", open: false,
// 是否显示弹出层 direction: "rtl",
open: false, toString: ["processResult"],
direction:"rtl", // 表单校验
toString: ["processResult"], rules: {
// 表单校验 staffName: [
rules: { { required: true, message: "请输入员工姓名", trigger: "blur" },
staffName: [ { max: 64, message: "最多只能录入64个字符", trigger: "blur" },
{required: true,message: "请输入员工姓名", trigger: "blur" }, ],
{max: 64,message: "最多只能录入64个字符",trigger: "blur",}, createTime: [{ required: true, message: "请选择创建时间" }],
], },
createTime: [ dealParams: {
{required: true,message: "请选择创建时间" }, remark: "",
], errorStatus: null,
}, durtion: 0,
dealParams:{ processResult: "",
remark:'', recordErrorEntities: [], //处理员工
errorStatus:null, processStatus: 1, //处理状态
durtion:0, },
processResult:'', selection: [],
recordErrorEntities:[],//处理员工 query: {},
processStatus:1//处理状态 urls: {
}, currUrl: "",
selection:[], saveUrl: "attendance/record/error/save",
query:{}, },
urls:{ dict: {
currUrl:'', errorStatus: "",
saveUrl:'attendance/record/error/save' },
}, duration: "",
dict:{ };
errorStatus:'' },
},
duration:''
}
},
methods: { methods: {
// 渲染前置处理 // 渲染前置处理
beforeRender(data) { beforeRender(data) {
return data return data;
}, },
/** 编辑 */ /** 编辑 */
edit(row,selection) { edit(row, selection) {
if(selection.length<1){ if (selection.length < 1) {
this.selection = [row] this.selection = [row];
this.query = { id: row.id }; this.query = { id: row.id };
}else{ } else {
this.selection = selection this.selection = selection;
this.query = {id:this.selection[0].id} this.query = { id: this.selection[0].id };
} }
this.dealParams.recordErrorEntities = this.selection this.dealParams.recordErrorEntities = this.selection;
this.urls.currUrl ="attendance/record/error/edit"; this.urls.currUrl = "attendance/record/error/edit";
this.getInital(this.query.id) this.getInital(this.query.id);
}, },
/**获取数据后弹框 */ /**获取数据后弹框 */
afterRender(data) { afterRender(data) {
this.open = true; this.open = true;
}, },
getInital(id){ getInital(id) {
this.$post(this.urls.currUrl+'?id='+id).then(res => { this.$post(this.urls.currUrl + "?id=" + id).then((res) => {
if(res.code == 1){ if (res.code == 1) {
this.afterRender() this.afterRender();
this.dict = res.data.dict this.dict = res.data.dict;
} }
}) });
}, },
// 保存 // 保存
saveForm(){ saveForm() {
if(this.dealParams.processResult == ''){ if (this.dealParams.errorStatus == "") {
this.$message.error('请选择处理结果') this.$message.error("请选择处理结果");
return return;
} }
this.dealParams.errorStatus=this.dealParams.processResult this.dealParams.errorStatus = this.dealParams.errorStatus;
if(this.duration && (this.dealParams.processResult == '1' || this.dealParams.processResult == '2')){ if (
this.dealParams.processResult =this.dict.errorStatus[this.dealParams.processResult] + this.duration +'分钟' this.duration &&
this.dealParams.durtion=this.duration (this.dealParams.errorStatus == "1" ||
} this.dealParams.errorStatus == "2")
// 保存结果处理 ) {
this.$post(this.urls.saveUrl,this.dealParams).then(res => { this.dealParams.errorStatus =
if(res.code == 1){ this.dict.errorStatus[this.dealParams.errorStatus] +
this.cancleFn() this.duration +
} "分钟";
}) this.dealParams.durtion = this.duration;
}, }
cancleFn(){ // 保存结果处理
this.open = false this.$post(this.urls.saveUrl, this.dealParams).then((res) => {
this.dealParams = { if (res.code == 1) {
remark:'', this.cancleFn();
errorStatus:null,
durtion:0,
processResult:'',
recordErrorEntities:[],//处理员工
processStatus:1//处理状态
}
this.$emit("ok")
}
} }
} });
},
cancleFn() {
this.open = false;
this.dealParams = {
remark: "",
errorStatus: null,
durtion: 0,
processResult: "",
recordErrorEntities: [], //处理员工
processStatus: 1, //处理状态
};
this.$emit("ok");
},
},
};
</script> </script>
<template> <template>
<div class="page"> <div class="page">
<LayoutTable :data="tableData" :config="tableConfig" notDel notAdd> <LayoutTable :data="tableData" :config="tableConfig" notDel notAdd>
<el-button <el-button
slot="table-head-left2" slot="table-head-left2"
style="margin-left: 10px" style="margin-left: 10px"
size="mini" size="mini"
type="primary" type="primary"
@click="morehandle" @click="morehandle"
>批量处理</el-button> >批量处理</el-button
</LayoutTable> >
<drawer-show ref="drawerShow" @ok="getData" /> </LayoutTable>
<!-- 撤销提示 --> <drawer-show ref="drawerShow" @ok="getData" />
<el-dialog :visible.sync="dialogVisible" title="提示" width="40%"> <!-- 撤销提示 -->
<div>撤销异常处理结果后,当天的考勤结果将会重新计算,系统需要花费一点时间。</div> <el-dialog :visible.sync="dialogVisible" title="提示" width="40%">
<div class="flex flex_end"> <div>
<el-button @click="dialogVisible = false">取消</el-button> 撤销异常处理结果后,当天的考勤结果将会重新计算,系统需要花费一点时间。
<el-button type="primary" @click="resetError">确定</el-button> </div>
</div> <div class="flex flex_end">
</el-dialog> <el-button @click="dialogVisible = false">取消</el-button>
</div> <el-button type="primary" @click="resetError">确定</el-button>
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from "./drawershow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { export default {
name: "AttendanceRecordErrorList", name: "AttendanceRecordErrorList",
components: { components: {
drawerShow drawerShow,
}, },
mixins: [table], mixins: [table],
created() { created() {},
}, methods: {
methods: { /** 重写新增方法 */
/** 重写新增方法 */ // toAdd(row) {
// toAdd(row) { // this.$refs.dialogform.add(row);
// this.$refs.dialogform.add(row); // },
// }, // /** 重写编辑方法 */
// /** 重写编辑方法 */ // toEdit(row) {
// toEdit(row) { // this.$refs.dialogform.edit(row);
// this.$refs.dialogform.edit(row); // },
// }, // /** 重写查看方法 */
// /** 重写查看方法 */ // toView(row) {
// toView(row) { // this.$refs.dialogform.view(row);
// this.$refs.dialogform.view(row); // },
// },
morehandle(){ morehandle() {
let arr = this.tableData.data.filter(item => { let arr = this.tableData.data.filter((item) => {
if(this.selection.includes(item.id) && item.processStatus == 0){ if (this.selection.includes(item.id) && item.processStatus == 0) {
return item return item;
} }
}) });
this.$nextTick(() => { this.$nextTick(() => {
this.selection = arr.map(item => item.id) this.selection = arr.map((item) => item.id);
}) });
if(arr.length < 1){ if (arr.length < 1) {
this.$message.error('请至少选择一条处理') this.$message.error("请至少选择一条处理");
return return;
} }
this.$refs.drawerShow.edit(arr[0],arr); this.$refs.drawerShow.edit(arr[0], arr);
}, },
// 处理 // 处理
handle(err){ handle(err) {
console.log(err) console.log(err);
this.$refs.drawerShow.edit(err,[]); this.$refs.drawerShow.edit(err, []);
}, },
// 撤销 // 撤销
reCancle(err){ reCancle(err) {
console.log(err) console.log(err);
this.currentParams = err this.currentParams = err;
this.dialogVisible = true this.dialogVisible = true;
}, },
resetError(){ resetError() {
this.$post('attendance/record/error/revokeError',{...this.currentParams}).then(res => { this.$post("attendance/record/error/revokeError", {
if(res.code == 1){ ...this.currentParams,
this.dialogVisible = false }).then((res) => {
this.getData() if (res.code == 1) {
} this.dialogVisible = false;
}) this.getData();
} }
}, });
data() { },
return { },
config: { data() {
isshowTabPane:true, return {
search: [ config: {
{ isshowTabPane: true,
name: "deptId", search: [
type: "select", {
label: "全部部门" name: "deptId",
}, type: "select",
{ label: "全部部门",
name: "groupId", },
type: "select", {
label: "全部考勤组" name: "groupId",
}, type: "select",
/* { label: "全部考勤组",
},
/* {
name: "classId", name: "classId",
type: "select", type: "select",
label: "全部班次", label: "全部班次",
fuzzy: false fuzzy: false
},*/ },*/
{ {
name: "errorStatus", name: "errorStatus",
type: "select", type: "select",
label: "全部异常状态" label: "全部异常状态",
}, },
{ {
name: "processStatus", name: "processStatus",
type: "select", type: "select",
label: "全部处理状态" label: "全部处理状态",
}, },
{ {
name:'errorDateTimeStart', name: "errorDateTimeStart",
type: "date", type: "date",
label: "异常开始时间" label: "异常开始时间",
}, },
{ {
name:'attendanceDateEnd', name: "attendanceDateEnd",
type: "date", type: "date",
label: "errorDateTimeEnd" label: "errorDateTimeEnd",
}, },
{ {
name: "staffName", name: "staffName",
type: "text", type: "text",
label: "员工姓名", label: "员工姓名",
fuzzy: true fuzzy: true,
}, },
{ {
name: "phoneNumber", name: "phoneNumber",
type: "text", type: "text",
label: "手机号", label: "手机号",
fuzzy: true fuzzy: true,
}, },
], ],
columns: [ columns: [
{type: "selection", width: 60,fixed:'left'}, { type: "selection", width: 60, fixed: "left" },
{type: "index",label: "序号",width: 50,fixed:'left'}, { type: "index", label: "序号", width: 50, fixed: "left" },
{label: "员工姓名", prop: "staffName",fixed:'left',width:100}, { label: "员工姓名", prop: "staffName", fixed: "left", width: 100 },
{label: "工号", prop: "workNum"}, { label: "工号", prop: "workNum" },
{label: "部门", prop: "deptName"}, { label: "部门", prop: "deptName" },
{label: "考勤组", prop: "attendanceGroupName"}, { label: "考勤组", prop: "attendanceGroupName" },
/* {label: "班次", prop: "shiftsName"},*/ /* {label: "班次", prop: "shiftsName"},*/
{label: "异常状态", prop: "errorStatus",formatter: this.formattereErrorStatus}, {
{label: "异常时间", prop: "errorDateTime", formatter: this.formatterDate}, label: "异常状态",
{label: "处理结果", prop: "processResult", formatter: this.formatters}, prop: "errorStatus",
{label: "上下班时间", prop: "goOffDateTime",formatter:(row) => { formatter: this.formattereErrorStatus,
return row.goOrOff+" "+row.goOffDateTime },
}}, {
{label: "实际打卡时间", prop: "actualAttendanceDateTime", formatter: this.formatterDate}, label: "异常时间",
{label: "处理时间", prop: "operDateTime", formatter: this.formatterDate}, prop: "errorDateTime",
{label: "处理状态", prop: "processStatus",formatter: this.formattereDealStatus}, formatter: this.formatterDate,
{label: "处理人", prop: "opertor",formatter:this.formatters}, },
{label: "备注", prop: "remark",formatter:this.formatters}, {
{ label: "处理结果",
label: "操作", prop: "processResult",
width: 240, formatter: this.formatters,
formatter: (row) => { },
if(row.processStatus == 0 || !row.processStatus){ {
return( label: "上下班时间",
<el-button type="text" size='mini' onClick={() => { prop: "goOffDateTime",
this.handle(row) formatter: (row) => {
}}>处理</el-button> return row.goOrOff + " " + row.goOffDateTime;
) },
}else{ },
return ( {
<span> label: "实际打卡时间",
prop: "actualAttendanceDateTime",
<el-button type="text" size='mini' onClick={() => { formatter: this.formatterDate,
this.reCancle(row) },
}}>撤销</el-button> {
</span> label: "处理时间",
) prop: "operDateTime",
} formatter: this.formatterDate,
},
} {
} label: "处理状态",
] prop: "processStatus",
}, formatter: this.formattereDealStatus,
dialogVisible:false, },
currentParams:{} { label: "处理人", prop: "opertor", formatter: this.formatters },
} { label: "备注", prop: "remark", formatter: this.formatters },
} {
} label: "操作",
width: 240,
formatter: (row) => {
if (row.processStatus == 0 || !row.processStatus) {
return (
<el-button
type="text"
size="mini"
onClick={() => {
this.handle(row);
}}
>
处理
</el-button>
);
} else {
return (
<span>
<el-button
type="text"
size="mini"
onClick={() => {
this.reCancle(row);
}}
>
撤销
</el-button>
</span>
);
}
},
},
],
},
dialogVisible: false,
currentParams: {},
};
},
};
</script> </script>
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