|
@@ -21,13 +21,13 @@
|
|
|
<span>{{user.role == 0?"我的请假单":"请假单列表"}}</span>
|
|
|
</template>
|
|
|
<el-menu-item index="2-1" ><p @click="bills(false, 2)" >全部</p></el-menu-item>
|
|
|
- <el-menu-item index="2-2" ><p @click="bills(true, 1)">待核审</p></el-menu-item>
|
|
|
+ <el-menu-item index="2-2" ><p @click="bills(true, 1)">待审核</p></el-menu-item>
|
|
|
</el-submenu>
|
|
|
- <el-menu-item index="3" @select="bills" @click="bills(false)" v-if="user.role == 0">
|
|
|
+ <el-menu-item index="3" @select="bills" @click="bills(false, 2)" v-if="user.role == 0">
|
|
|
<i class="iconfont firerock-iconbaoxiaodan"></i>
|
|
|
<span slot="title">{{user.role == 0?"我的请假单":"请假单列表"}}</span>
|
|
|
</el-menu-item>
|
|
|
- <el-menu-item index="4">
|
|
|
+ <el-menu-item index="4" v-if="user.role != 0">
|
|
|
<template slot="title">
|
|
|
<i class="iconfont firerock-icontianbao"></i>
|
|
|
<span slot="title">请假统计</span>
|
|
@@ -73,7 +73,7 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<!-- 时间选择 -->
|
|
|
- <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 60%;margin-right:500px">
|
|
|
+ <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 48%;margin-right:500px">
|
|
|
<el-col :span="9">
|
|
|
<el-date-picker v-if="flg" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" :picker-options="pickerOptionsStart" v-model="addForm.startDate" style="width: 240px;" @blur="datas()"></el-date-picker>
|
|
|
<el-date-picker v-else type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @change="datasss()"></el-date-picker>
|
|
@@ -100,12 +100,12 @@
|
|
|
</el-form-item>
|
|
|
<!-- 备注 -->
|
|
|
<el-form-item label="备注" style="width: 100%">
|
|
|
- <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 50%"></el-input>
|
|
|
+ <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 39%" maxlength="100" show-word-limit></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
<div>
|
|
|
- <p style="margin-left: 75px"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p>
|
|
|
+ <p style="margin-left: 20%"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -133,7 +133,7 @@
|
|
|
</div>
|
|
|
<div>
|
|
|
<span>请假状态</span>
|
|
|
- <el-select v-if="falg == 0" v-model="code" placeholder="请选择请假状态" @change="chufas()" style="width: 180px" :disabled="user.role == 0" filterable="true">
|
|
|
+ <el-select v-if="falg == 0" v-model="code" placeholder="请选择请假状态" @change="chufas()" style="width: 180px" filterable="true">
|
|
|
<span v-for="(item, index) in statuss" :key="index">
|
|
|
<el-option :label="item.name" :value="item.id"></el-option>
|
|
|
</span>
|
|
@@ -175,8 +175,8 @@
|
|
|
<el-table-column prop="status" label="状态" width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 4">
|
|
|
- <div v-if="scope.row.status == 0" >核审通过</div>
|
|
|
- <div v-if="scope.row.status == 1" style="color: orange">待核审</div>
|
|
|
+ <div v-if="scope.row.status == 0" >审核通过</div>
|
|
|
+ <div v-if="scope.row.status == 1" style="color: orange">待审核</div>
|
|
|
<div v-if="scope.row.status == 2" style="color: red">驳回</div>
|
|
|
<div v-if="scope.row.status == 3" style="color: #666666">撤销</div>
|
|
|
</div>
|
|
@@ -196,14 +196,26 @@
|
|
|
<el-table-column label="操作" width="180" fixed="right" v-if="isAuditList">
|
|
|
<template slot-scope="scope">
|
|
|
<div v-if="user.role != 0">
|
|
|
- <el-button type="primary" size="mini" @click.stop.native="approve(scope.row)">通过</el-button>
|
|
|
- <el-button type="danger" size="mini" @click.stop.native="deny(scope.row)">驳回</el-button>
|
|
|
+ <el-button icon="el-icon-check" circle size="mini" @click.stop.native="approve(scope.row)"></el-button>
|
|
|
+ <el-button icon="el-icon-close" circle size="mini" @click.stop.native="deny(scope.row)"></el-button>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<el-button type="danger" size="mini">撤销</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="操作" width="180" fixed="right" v-if="!isAuditList">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div v-if="user.role == 0">
|
|
|
+ <el-button icon="el-icon-delete" circle size="mini" @click.stop.native="deletes(scope.row)" v-if="scope.row.status != 0"></el-button>
|
|
|
+ <el-button icon="el-icon-edit" circle size="mini" @click.stop.native="editor(scope.row)" v-if="scope.row.status != 0"></el-button>
|
|
|
+ </div>
|
|
|
+ <div v-if="user.role != 0">
|
|
|
+ <el-button icon="el-icon-delete" circle size="mini" @click.stop.native="deletes(scope.row)"></el-button>
|
|
|
+ <el-button icon="el-icon-edit" circle size="mini" @click.stop.native="editor(scope.row)"></el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
<div class="poss">
|
|
|
<el-pagination
|
|
@@ -273,6 +285,66 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 请假单详情 -->
|
|
|
+ <el-dialog title="请假单详情" :visible.sync="dialog" width="1000px" @close="bangd()">
|
|
|
+ <!-- 表单 -->
|
|
|
+ <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
|
|
|
+ <!-- 请假人 -->
|
|
|
+ <el-form-item label="请假人" prop="ownerId" style="width: 300px;display: inline-block;">
|
|
|
+ <!--普通员工只能自己填报自己的 -->
|
|
|
+ <el-select v-model="addForm.ownerId" @change="selts()" placeholder="请选择请假人" style="width: 240px" :disabled="user.role == 0" filterable="true">
|
|
|
+ <span v-for="(item, index) in users" :key="index">
|
|
|
+ <el-option :label="item.name" :value="item.id"></el-option>
|
|
|
+ </span>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 电话 -->
|
|
|
+ <el-form-item label="电话" prop="tel" style="width: 300px;display: inline-block;">
|
|
|
+ <el-input ref="ipts" v-model="addForm.tel" placeholder="请输入手机号" style="width: 250px;"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 单选 -->
|
|
|
+ <el-form-item style="display: block" label="时长单位">
|
|
|
+ <el-radio-group v-model="addForm.timeType" @change="chanRadio()">
|
|
|
+ <el-radio label="0">按天请假</el-radio>
|
|
|
+ <el-radio label="1">按小时请假</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 时间选择 -->
|
|
|
+ <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 74%;margin-right:500px">
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-date-picker v-if="flg" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" :picker-options="pickerOptionsStart" v-model="addForm.startDate" style="width: 240px;" @blur="datas()"></el-date-picker>
|
|
|
+ <el-date-picker v-else type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @change="datasss()"></el-date-picker>
|
|
|
+ </el-col>
|
|
|
+ <el-col class="line" v-if="flg" :span="2">-</el-col>
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-date-picker v-if="flg" type="date" placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptionsEnd" v-model="addForm.endDate" style="width: 250px;" @blur="datas()"></el-date-picker>
|
|
|
+ <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
|
|
|
+ <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
|
|
|
+ </el-select> -->
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 请假天数 -->
|
|
|
+ <el-form-item :label="flg ? '请假天数' : '请假时长'" prop="timeDays" style="margin-right: 500px">
|
|
|
+ <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
|
|
|
+ <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
|
|
|
+ <div v-if="flg"> <el-input v-model="addForm.timeDays" @blur="inputs()" @input="addForm.timeDays=addForm.timeDays.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 天</div>
|
|
|
+ <div v-else>
|
|
|
+ <!-- <el-select v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
|
|
|
+ <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
|
|
|
+ </el-select>小时 -->
|
|
|
+ <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeDays=addForm.timeDays.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 小时
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- 备注 -->
|
|
|
+ <el-form-item label="备注" style="width: 100%">
|
|
|
+ <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 62%" maxlength="100" show-word-limit></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialog = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="determine()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
</section>
|
|
|
</template>
|
|
@@ -325,7 +397,8 @@ export default {
|
|
|
leaveType: 0,
|
|
|
// indate: this.getCurrentTime(),
|
|
|
timeHours: '8',
|
|
|
- tel: ''
|
|
|
+ tel: '',
|
|
|
+ remark: ''
|
|
|
},
|
|
|
displayTable: false,
|
|
|
users: [], // 人员信息
|
|
@@ -374,10 +447,10 @@ export default {
|
|
|
id: 3
|
|
|
}],
|
|
|
statuss: [{
|
|
|
- name: '核审通过',
|
|
|
+ name: '审核通过',
|
|
|
id: 0
|
|
|
},{
|
|
|
- name: '待核审',
|
|
|
+ name: '待审核',
|
|
|
id: 1
|
|
|
},{
|
|
|
name: '驳回',
|
|
@@ -391,7 +464,10 @@ export default {
|
|
|
type: '',
|
|
|
code: '',
|
|
|
createDate: '',
|
|
|
- falg: 0
|
|
|
+ falg: 0,
|
|
|
+ dialog: false,
|
|
|
+ adform: {},
|
|
|
+ affId: ''
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -456,6 +532,7 @@ export default {
|
|
|
this.users = res.data.records;
|
|
|
if (this.user.role == 0) {
|
|
|
this.addForm.ownerId = this.user.id;
|
|
|
+ this.ownerIds = this.user.id
|
|
|
this.addForm.status = 1;
|
|
|
this.addForm.tel = this.user.phone
|
|
|
}
|
|
@@ -479,10 +556,11 @@ export default {
|
|
|
this.addForm.leaveType = index
|
|
|
},
|
|
|
staffs(key, keyPath) {
|
|
|
+ console.log(keyPath)
|
|
|
if (keyPath[0] == '1') {
|
|
|
this.displayTable = false;
|
|
|
this.apk = false
|
|
|
- } else if(keyPath[0] == '2') {
|
|
|
+ } else if(keyPath[0] == '2' || keyPath[0] == '3') {
|
|
|
this.displayTable = true;
|
|
|
this.apk = false
|
|
|
} else {
|
|
@@ -495,7 +573,7 @@ export default {
|
|
|
if(tr) {
|
|
|
this.code = ''
|
|
|
this.createDate = ''
|
|
|
- this.ownerIds = ''
|
|
|
+ // this.ownerIds = ''
|
|
|
this.type = ''
|
|
|
if(tr == 1) {
|
|
|
this.falg = 1
|
|
@@ -547,6 +625,36 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ billss() {
|
|
|
+ var param = {pageIndex: this.page,
|
|
|
+ pageSize: this.size,
|
|
|
+ status: this.code,
|
|
|
+ createDate: this.createDate,
|
|
|
+ ownerId: this.ownerIds,
|
|
|
+ leaveType: this.type,
|
|
|
+ };
|
|
|
+ this.http.post('/leave-sheet/list', param,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.tableData = res.data.records
|
|
|
+ this.total = res.data.total
|
|
|
+ this.loading = false
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.loading = false
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
submits(){
|
|
|
this.$refs.addForm.validate(valid => {
|
|
|
if (valid) {
|
|
@@ -557,6 +665,14 @@ export default {
|
|
|
message: '填报成功',
|
|
|
type: "success"
|
|
|
});
|
|
|
+ this.addForm.timeType = '0'
|
|
|
+ this.addForm.startDate = this.getCurrentTime()
|
|
|
+ this.addForm.endDate = this.getCurrentTime()
|
|
|
+ this.addForm.timeDays = 1
|
|
|
+ this.addForm.leaveType = 0
|
|
|
+ this.addForm.timeHours = 8
|
|
|
+ this.addForm.remark = ''
|
|
|
+
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -638,7 +754,7 @@ export default {
|
|
|
return delta - weeks;
|
|
|
},
|
|
|
chufas() {
|
|
|
- this.bills(true, 0)
|
|
|
+ this.billss()
|
|
|
},
|
|
|
// 时间
|
|
|
getTadeTime() {
|
|
@@ -726,6 +842,91 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ deletes(e) {
|
|
|
+ this.$confirm("确认要删除吗?", "提示", {
|
|
|
+ //type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.http.post('/leave-sheet/delete', {id:e.id},
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.bills();
|
|
|
+ this.$message({
|
|
|
+ message: '删除成功',
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ editor(items) {
|
|
|
+ this.dialog = true
|
|
|
+ this.addForm.ownerId = items.ownerId
|
|
|
+ this.addForm.tel = items.tel
|
|
|
+ this.addForm.timeType = items.timeType + ''
|
|
|
+ this.addForm.startDate = items.startDate
|
|
|
+ this.addForm.endDate = items.endDate
|
|
|
+ this.addForm.timeDays = items.timeDays
|
|
|
+ this.addForm.timeHours = items.timeHours
|
|
|
+ this.addForm.remark = items.remark
|
|
|
+ this.affId = items.id
|
|
|
+ },
|
|
|
+ determine () {
|
|
|
+ var adl = this.addForm
|
|
|
+ adl.id = this.affId
|
|
|
+ this.http.post('/leave-sheet/add', adl,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.dialog = false
|
|
|
+ this.bills();
|
|
|
+ this.addForm = {
|
|
|
+ timeType: '0',
|
|
|
+ startDate: this.getCurrentTime(),
|
|
|
+ endDate: this.getCurrentTime(),
|
|
|
+ timeDays: 1,
|
|
|
+ leaveType: 0,
|
|
|
+ timeHours: '8',
|
|
|
+ tel: '',
|
|
|
+ remark: ''
|
|
|
+ }
|
|
|
+ this.getUsers()
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ bangd() {
|
|
|
+ this.addForm = {
|
|
|
+ timeType: '0',
|
|
|
+ startDate: this.getCurrentTime(),
|
|
|
+ endDate: this.getCurrentTime(),
|
|
|
+ timeDays: 1,
|
|
|
+ leaveType: 0,
|
|
|
+ timeHours: '8',
|
|
|
+ tel: '',
|
|
|
+ remark: ''
|
|
|
+ }
|
|
|
+ this.getUsers()
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|