12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781 |
- <template>
- <section>
- <div class="sidebars" ref="sidebars" style="width: 200px;display: block;background: #fff">
- <h3><i class="iconfont firerock-iconbaoxiao" style="padding-right: 10px"></i>请假管理</h3>
- <el-divider ></el-divider>
- <el-col :span="12">
- <el-menu default-active="1" class="el-menu-vertical-demo" @select="staffs" background-color="#ffffff" text-color="#666666" active-text-color="#20A0FF" style="width:100%">
- <!-- <el-submenu index="1">
- <template slot="title">
- <i class="iconfont firerock-icontianbao"></i>
- <span>员工请假填报</span>
- </template>
- <el-menu-item index="1-1"><p @click="ssl(0)">请事假</p></el-menu-item>
- <el-menu-item index="1-2"><p @click="ssl(1)">请病假</p></el-menu-item>
- <el-menu-item index="1-3"><p @click="ssl(2)">请年假</p></el-menu-item>
- <el-menu-item index="1-4"><p @click="ssl(3)">请产假</p></el-menu-item>
- </el-submenu> -->
- <el-menu-item index="1" v-if="permissions.leaveFil">
- <i class="iconfont firerock-icontianbao"></i>
- <span slot="title">员工请假填报</span>
- </el-menu-item>
- <el-submenu index="2" v-if="permissions.leaveAll">
- <template slot="title">
- <i class="iconfont firerock-iconbaoxiaodan"></i>
- <span>{{"请假单列表"}}</span>
- </template>
- <el-menu-item index="2-1" ><p @click="bills(false, 2)" v-if="permissions.leaveAll">全部</p></el-menu-item>
- <el-menu-item index="2-2" ><p @click="bills(true, 1)" v-if="permissions.leaveAudit">待审核</p></el-menu-item>
- </el-submenu>
- <el-menu-item index="3" @select="bills" @click="bills(false, 2)" v-if="!permissions.leaveAll">
- <i class="iconfont firerock-iconbaoxiaodan"></i>
- <span slot="title">我的请假单</span>
- </el-menu-item>
- <el-menu-item index="4" v-if="permissions.leaveStatistical">
- <template slot="title">
- <i class="iconfont firerock-icontianbao"></i>
- <span slot="title">请假统计</span>
- </template>
- </el-menu-item>
- <el-menu-item index="5" v-if="permissions.leaveProcess">
- <template slot="title">
- <i class="iconfont firerock-iconliucheng"></i>
- <span slot="title">请假审批流程</span>
- </template>
- </el-menu-item>
- <el-menu-item index="6" v-if="permissions.leaveAnnual">
- <template slot="title">
- <i class="iconfont firerock-icontianbao"></i>
- <span slot="title">年假管理</span>
- </template>
- </el-menu-item>
- </el-menu>
- </el-col>
- </div>
- <!-- 侧边栏点击事件 -->
- <!-- <div class="side" @click="side" ref="sid" style="left: 430px">
- <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
- </div> -->
- <!-- 内容主体区域 -->
- <div class="contents">
- <div v-if="!displayTable" class="headine" ref="headine">
- <h3 ref="headHe" style="padding-left: 220px">请假填报</h3>
- <!-- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p> -->
- </div>
- <!-- 上面部分 -->
- <div v-if="!displayTable && apk == false" class="tops">
- <!-- 公共 -->
- <div class="ctons">
- <!-- 表单 -->
- <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
- <!-- 请假类型 -->
- <el-form-item label="请假类型" prop="leaveType" style="width: 100%">
- <!--普通员工只能自己填报自己的 -->
- <el-select v-model="addForm.leaveType" @change="txselts(addForm.leaveType,addForm.ownerId)" placeholder="请选择请假类型" style="width: 240px">
- <el-option v-for="item in qjType" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <template v-if="addForm.leaveType == 6">
- <span style="margin-left:18px;color:#777;">剩余可调休 {{addForm.ownerId != '' ? txselnum : '~'}} 天</span>
- <el-tooltip effect="dark" content="加班时长可用于调休抵扣" placement="top-start">
- <i class="el-icon-question" style="color:#606266;"></i>
- </el-tooltip>
- </template>
- </el-form-item>
- <!-- 请假人 -->
- <el-form-item label="请假人" prop="ownerId" style="width: 300px" v-show="false">
- <!--普通员工只能自己填报自己的 -->
- <el-select v-model="addForm.ownerId" @change="txselts(addForm.leaveType,addForm.ownerId)" placeholder="请选择请假人" style="width: 240px" :disabled="!permissions.leaveFil" 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">
- <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()" style="display:inline-block;width:240px">
- <el-radio label="0">按天请假</el-radio>
- <el-radio label="1" v-if="addForm.leaveType != 6">按小时请假</el-radio>
- </el-radio-group>
- <span style="margin-left:8px">审批人</span>
- <el-select style="display:inline-block;width:250px;margin-left:6px" multiple v-model="addForm.projectAuditorJson" placeholder="请选择">
- <el-option
- v-for="item in approverList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </el-form-item>
- <!-- 时间选择 -->
- <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 100%;">
- <el-col style="display: inline-block; width: 240px">
- <el-date-picker v-if="flg" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" 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" style="display: inline-block; width: 50px">-</el-col>
- <el-col style="display: inline-block; width: 240px">
- <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: 120px; margin-right: 20px;" type="number" :step="0.5"></el-input> 天</div>
- <div v-else>
- <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 120px; 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: 550px" maxlength="100" show-word-limit></el-input>
- </el-form-item>
- </el-form>
- <div>
- <p style="margin-left: 20%"><el-button type="primary" @click="submits('addFormRules')" size="mini" :disabled="txselnum == 0 && addForm.leaveType == 6 && addForm.ownerId != '' ? true : false">提交</el-button></p>
- </div>
- </div>
- </div>
- <!-- 下面部分 -->
- <div v-if="displayTable && apk == false" class="tops">
- <!-- 公共 -->
- <div class="ctons">
- <div class="flex">
- <div>
- <el-select v-model="ownerIds" placeholder="请选择请假人" clearable @change="chufas()" style="width: 180px" size="small" v-show="permissions.leaveAll" filterable="true">
- <span v-for="(item, index) in users" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- </div>
- <div>
- <span style="color: #606266">请假类型</span>
- <el-select v-model="type" placeholder="请选择请假类型" clearable @change="chufas()" style="width: 180px;" size="small" filterable="true">
- <span v-for="(item, index) in typess" :key="index">
- <el-option :label="item.name" :value="item.id"></el-option>
- </span>
- </el-select>
- </div>
- <div>
- <span style="color: #606266">请假状态</span>
- <el-select v-if="falg == 0" v-model="code" placeholder="请选择请假状态" clearable @change="chufas()" size="small" 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>
- </el-select>
- <el-select v-if="falg == 1" disabled v-model="code" placeholder="请选择请假类型" clearable @change="chufas()" size="small" 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>
- </el-select>
- </div>
- <div>
- <span style="color: #606266">请假时间</span>
- <el-date-picker v-model="createDate" type="date" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable="false"> </el-date-picker>
- </div>
- </div>
- <el-table v-loading="loading" :data="tableData" style="width: 100%" height="90%">
- <el-table-column prop="ownerName" label="请假人" width="120"></el-table-column>
- <el-table-column prop="tel" label="电话" width="120"></el-table-column>
- <el-table-column prop="leaveType" label="请假类型" width="120">
- <template slot-scope="scope">
- <!-- <div v-if="scope.row.leaveType == 0">事假</div>
- <div v-if="scope.row.leaveType == 1">病假</div>
- <div v-if="scope.row.leaveType == 2">年假</div>
- <div v-if="scope.row.leaveType == 3">产假</div> -->
- {{qjType[scope.row.leaveType].name}}
- </template>
- </el-table-column>
- <el-table-column prop="startDate" label="请假开始时间" width="150"></el-table-column>
- <el-table-column prop="endDate" label="请假结束时间" width="150"></el-table-column>
- <el-table-column label="请假天数" width="120">
- <template slot-scope="scope">
- <div v-if="scope.row.timeType == '1'">/</div>
- <div v-else>{{scope.row.timeDays}}天</div>
- </template>
- </el-table-column>
- <el-table-column label="请假时长" width="120">
- <template slot-scope="scope">
- <div>{{scope.row.timeHours}}小时</div>
- </template>
- </el-table-column>
- <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 == 2" style="color: red">驳回</div>
- <div v-if="scope.row.status == 3" style="color: #666666">撤销</div>
- </div>
- <div v-else>
- <span>暂无请假单</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="remark" label="备注" width="200">
- <template slot-scope="scope">
- <!-- <div class="apls">{{scope.row.remark}}</div> -->
- <el-popover placement="top-start" title="标题" width="200" trigger="hover" :content="scope.row.remark">
- <div slot="reference" class="apls">{{scope.row.remark}}</div>
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="180" fixed="right" v-if="isAuditList">
- <template slot-scope="scope">
- <div>
- <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>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="180" fixed="right" v-if="!isAuditList">
- <template slot-scope="scope">
- <div v-if="(scope.row.status != 0 && scope.row.ownerId == user.id) || permissions.leaveAll">
- <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>
- <!-- <div>
- <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
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage4"
- :page-sizes="[20, 50, 100, 200]"
- :page-size="20"
- layout="total, sizes, prev, pager, next"
- :total="total">
- </el-pagination>
- </div>
- </div>
- </div>
- <!-- 统计部分 -->
- <div v-if="displayTable && apk && apk2 == 4" class="tops">
- <!-- 公共 -->
- <div class="ctons">
- <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
- <div style="display: inline-block;width: 350px">
- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
- <el-button slot="append" @click="statistical()" icon="el-icon-search"></el-button>
- </el-input>
- </div>
- <div style="display: inline-block;width: 340px">
- <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">开始日期</span>
- <el-date-picker
- v-model="statData"
- type="date"
- placeholder="选择日期"
- size="small"
- @change="statistical()"
- clearable="false"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptionsStarts">
- </el-date-picker>
- </div>
- <div style="display: inline-block;width: 350px">
- <span style="display: inline-block;margin: 0 15px 0 0;color: rgb(96, 98, 102);">结束日期</span>
- <el-date-picker
- v-model="endData"
- type="date"
- placeholder="选择日期"
- size="small"
- @change="statistical()"
- clearable="fasle"
- value-format="yyyy-MM-dd"
- :picker-options="pickerOptionsEnds">
- </el-date-picker>
- </div>
- </div>
- <!-- <div style="margin-top: 30px"> -->
- <div>
- <el-table key="apk2is4" v-loading="loading" :data="statisticalList" height="780px" style="width: 99%">
- <el-table-column prop="ownerName" label="姓名" width="300">
- <template slot-scope="scope">
- <div v-if="scope.row.ownerName">
- {{scope.row.ownerName}}
- </div>
- <div v-else>
- <span>暂无请假统计</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="timeDays" label="请假总天数" width="300">
- <template slot-scope="scope">
- {{scope.row.timeDays}}/天
- </template>
- </el-table-column>
- <el-table-column prop="timeHours" label="请假总时长">
- <template slot-scope="scope">
- {{scope.row.timeHours}}/小时
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </div>
- <div v-if="displayTable && apk && apk2 == 5" class="tops">
-
- <div class="ctons">
- <el-col :span="6" >
- <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-left:15px;" >
- <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
- <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion></el-tree>
- </div>
- </el-scrollbar>
- </el-col>
- <el-col :span="18" >
- <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-right:20px;" >
- <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
- <div style="padding:5px;color:#333;" v-if="depData != null">设置 <<span style="color:#20a0ff;">{{depData.label}}></span> 直属人员请假审批流程
- <el-tooltip effect="dark" v-if="depData != null && depData.children!=null" content="仅适用于当前部门的直属人员,子部门人员的审批流程需要单独设置" placement="top-start">
- <i class="el-icon-question"></i>
- </el-tooltip>
- </div>
- <div style="padding:5px;" v-if="depData == null">请选择部门</div>
- <div style="width:100%;margin:0 auto;text-align: center; margin-top:50px;" v-if="depData != null">
- <span>员工填报</span>
- <icon class="iconfont firerock-iconright"></icon>
- <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(0)"></icon>
- <icon class="iconfont firerock-iconright"></icon>
- <span v-for="(item, index) in dataArray" :key="item.seq" >
-
- <el-button type="primary" v-if="item.auditorType == 1" @click="editNodeDialog(index, item)">{{item.auditDeptName}}</el-button>
- <el-button type="primary" v-if="item.auditorType == 0" >项目负责人</el-button>
- <el-button type="primary" v-if="item.auditorType == 2" @click="editNodeDialog(index, item)">{{item.userName}}</el-button>
- <icon class="iconfont firerock-iconright"></icon>
- <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(index+1)"></icon>
- <icon class="iconfont firerock-iconright"></icon>
- </span>
- <!--结束点 -->
- <icon class="iconfont firerock-iconApp_New_Line" style="color:#20A0FF;"></icon>
- 审批完成
- </div>
- <div style="width:100%;margin:0 auto;margin-bottom:30px;position: absolute;bottom: 0px;text-align: center; ">
- <el-button type="primary" @click="submitInsert" :loading="addLoading">保存</el-button>
- </div>
- </div>
- </el-scrollbar>
-
- </el-col>
- </div>
- <!--部门选择列表 -->
- <el-dialog title="请选择审批人" v-if="dialogVisible" :visible.sync="dialogVisible" width="460px">
- <el-form label-width="140px">
- <el-form-item label="选择部门/指定人员" >
- <el-cascader filterable ref="deptCascader" v-model="curDeptId" placeholder="请选择部门/指定人员" style="width: 100%" @change="chooseDept"
- :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="default" @click="deleteNode" v-if="!isAdd" style="float:left;">删除</el-button>
- <el-button type="primary" @click="addNode" >确定</el-button>
- </div>
- </el-dialog>
- </div>
- <!-- --------- -->
- <div v-if="displayTable && apk && apk2 == 6" class="tops">
- <div class="ctons">
- <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
- <div style="display: inline-block;width: 18%;margin-left:1%">
- <el-button size="small" @click="changeAltime(0)">批量设置</el-button>
- </div>
- <div style="display: inline-block;width: 26%">
- <el-input style="float:left;" v-model="keywordAl" class="input-with-select" placeholder="请输入人员姓名搜索" clearable="true" size="small" @clear="clearsearchAl()">
- <el-button slot="append" @click="searchAl()" icon="el-icon-search"></el-button>
- </el-input>
- </div>
- <div style="display: inline-block;width: 32%;margin-left:12%">
- <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">按部门筛选</span>
- <el-cascader
- ref="selectAl"
- filterable
- v-model="NcurDeptId"
- placeholder="请选择部门"
- size="small"
- style="width: 60%"
- @change="selAl()"
- clearable
- :options="Nsdata"
- :props="{ checkStrictly: true, expandTrigger: 'hover' }"
- :show-all-levels="false">
- </el-cascader>
- </div>
-
- </div>
- <div>
- <el-table key="apk2is6" v-loading="loading" :data="iAlDataS" height="480" style="width: 99%;" @selection-change="selPchg">
- <el-table-column type="selection"></el-table-column>
- <el-table-column prop="userName" label="姓名" width="200">
- <template slot-scope="scope">
- <div v-if="scope.row.userName">
- {{scope.row.userName}}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="department" label="所在部门" width="200">
- <template slot-scope="scope">
- {{scope.row.department}}
- </template>
- </el-table-column>
- <el-table-column prop="yearDays" label="每年年假天数" width="200">
- <template slot-scope="scope">
- {{scope.row.yearDays != null ? scope.row.yearDays + "天" : "-"}}
- </template>
- </el-table-column>
- <el-table-column prop="leftdays" label="剩余年假天数" width="200">
- <template slot-scope="scope">
- {{scope.row.yearDays != null ? scope.row.yearDays - scope.row.alreadyDays + "天" : "-"}}
- </template>
- </el-table-column>
- <el-table-column prop="id" label="修改年假天数">
- <template slot-scope="scope">
- <el-button size="small" @click="changeAltime(scope.row)">设置</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <el-dialog title="请设置年假时限" v-if="Alshow" :visible.sync="Alshow" @close="delAltime()" width="500px">
- <el-form label-width="8rem">
- <el-form-item label="设置每年年假天数" >
- <el-input v-model="Alchange.yearDays" type="number" min="0" placeholder="请输入天数"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="default" @click="delAltime()">取消</el-button>
- <el-button type="primary" @click="chgAltime()">确定</el-button>
- </div>
- </el-dialog>
- </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" 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-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.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>
- <script>
- import { config, error } from 'dingtalk-jsapi';
- export default {
- name: "expense",
- components: {},
- props: {},
- data() {
- //验证手机号
- var checkTel = (rule, value, callback) =>{
- if (!value) {
- return callback(new Error('手机号不能为空'));
- } else {
- const reg = /^1[3|4|5|7|8|9][0-9]\d{8}$/
- if (reg.test(value)) {
- callback();
- } else {
- return callback(new Error('请输入正确的手机号'));
- }
- }
- };
- var checks = (rule, value, callback) => {
- if (!value) {
- return callback(new Error('请假天数不能为空'));
- } else {
- if (value > this.timeChoose) {
- return callback(new Error('超过当前选择日期的天数'));
- } else {
- callback();
- }
- }
- };
- return {
- addFormRules: {
- ownerId: [{ required: true, message: "请选择请假人", trigger: "blur" }],
- tel: [{required: true, validator: checkTel, trigger: 'blur'}],
- timeDays: [{required: true, validator: checks, trigger: 'blur'}],
- leaveType: [{ required: true, message: "请选择请假类型", trigger: "blur" }],
- projectAuditorJson: [{ required: true, message: "请选择审批人", trigger: "blur" }]
- },
- user: JSON.parse(sessionStorage.getItem("user")),
- shuz: ['事假填报', '病假填报', '年假填报', '产假填报'],
- ins: 0,
- addForm: {
- timeType: '0',
- startDate: this.getCurrentTime(),
- endDate: this.getCurrentTime(),
- timeDays: 1,
- leaveType: 0,
- ownerId: '',
- // indate: this.getCurrentTime(),
- timeHours: 8,
- tel: '',
- remark: '',
- projectAuditorJson: ''
- },
- displayTable: false,
- users: [], // 人员信息
- flg: true,
- createDate: '2020-01-01',
- // pickerOptionsStart: {
- // disabledDate: (time) => {
- // if (this.addForm.endDate) {
- // return time.getTime() > new Date(this.addForm.endDate).getTime() || time.getTime() <= new Date(this.createDate).getTime() - 86400000;
- // }
- // return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
- // },
- // },
- pickerOptionsEnd: {
- disabledDate: (time) => {
- if (this.addForm.startDate) {
- return time.getTime() < new Date(this.addForm.startDate).getTime() - 86400000;
- }
- return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
- },
- },
- // pickerOptionsStarts: {
- // disabledDate: (time) => {
- // if (this.endData) {
- // return time.getTime() > new Date(this.endData).getTime() || time.getTime() <= new Date(this.createDate).getTime() - 86400000;
- // }
- // return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
- // },
- // },
- pickerOptionsEnds: {
- disabledDate: (time) => {
- if (this.statData) {
- return time.getTime() < new Date(this.statData).getTime() - 86400000;
- }
- return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
- },
- },
- options: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
- tableData: [],
- page: 1,
- size: 20,
- isAuditList: '',
- total:0,
- apk: false,
- keyword: '',
- statData: this.getCurrentTimes(),
- endData: this.getCurrentTime(),
- statisticalList: [],
- loading: false,
- timeChoose: 1,
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- // typess: [{
- // name: '事假',
- // id: 0
- // },{
- // name: '病假',
- // id: 1
- // },{
- // name: '年假',
- // id: 2
- // },{
- // name: '产假',
- // id: 3
- // }],
- typess: [{name: '事假',id: 0},{name: '病假',id: 1},{name: '年假',id: 2},{name: '产假',id: 3},{name: '婚假',id: 4},{name: '丧假',id: 5},{name: '调休假',id: 6},{name: '陪产假',id: 7},{name: '其他', id: 8}],
- statuss: [{
- name: '审核通过',
- id: 0
- },{
- name: '待审核',
- id: 1
- },{
- name: '驳回',
- id: 2
- },{
- name: '已撤销',
- id: 3
- }],
- createDatelis: '',
- ownerIds: '',
- type: '',
- code: '',
- createDate: '',
- falg: 0,
- dialog: false,
- adform: {},
- affId: '',
- qjType: [{name: '事假',id: 0},{name: '病假',id: 1},{name: '年假',id: 2},{name: '产假',id: 3},{name: '婚假',id: 4},{name: '丧假',id: 5},{name: '调休假',id: 6},{name: '陪产假',id: 7},{name: '其他', id: 8}],
- //
- apk2: false,
- sdata:[],
- dataArray:[],
- sdefaultProps: {
- children: 'children',
- label: 'label'
- },
- depData: null,
- isAdd : false,
- sindex : 0,
- curDeptId : null,
- curUserId : null,
- dialogVisible: false,
- soption : null,
- Alshow: false,
- Alchange: {yearDays:null,userId:null},
- AlchangeP: [],
- susers: [],
- keywordAl: '',
- NcurDeptId:[],
- Nsdata : [],
- AlData : [],
- iAlDataS: [],
- iAlData : [],
- // ---------
- txselnum: 0,
- approverList: []
- };
- },
- computed: {},
- watch: {},
- created() {
- let height = window.innerHeight;
- this.tableHeight = height - 195;
- const that = this;
- window.onresize = function temp() {
- that.tableHeight = window.innerHeight - 195;
- };
- },
- mounted() {
- this.getUsers() // 获取人员信息
- this.getDepartment();
- this.getAl();
- this.getApproverList()
- },
- filters: {},
- methods: {
- getApproverList(){
- this.http.post('/project/getMyParticiPMList',{
- },res => {
- if(res.code == 'ok'){
- this.approverList = res.data
- console.log('list',res.data);
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },error => {
- this.$message({
- message: error,
- type: 'error'
- })
- })
- },
- changeAltime(e){
- if(e == 0 && this.AlchangeP.length == 0){
- this.$message('请选择要批量设置的项')
- return
- }else if(e != 0){
- this.Alchange = JSON.parse(JSON.stringify(e))
- }
- this.Alshow = true
- },
- selPchg(e){
- this.AlchangeP = e
- },
- searchAl(){
- this.iAlDataS = []
- for (let i = 0; i < this.iAlData.length; i++) {
- if (this.iAlData[i].userName.indexOf(this.keywordAl) != -1) {
- this.iAlDataS.push(this.iAlData[i])
- }
- }
- },
- clearsearchAl(){
- this.iAlDataS = this.iAlData
- },
- delAltime(){
- this.Alshow = false
- this.Alchange = {yearDays:null,userId:null}
- },
- chgAltime(){
- let chgPar = {}
- let userids = ''
- let Alpost = ''
- if(this.Alchange.userId == null && this.AlchangeP != []){
- Alpost = "/user-yearleave-setting/saveBatch"
- for (let i = 0; i < this.AlchangeP.length; i++) {
- userids = userids + "," + this.AlchangeP[i].userId
- }
- chgPar = {userIds: userids.slice(1), companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
- }else {
- Alpost = "/user-yearleave-setting/save"
- userids = this.Alchange.userId
- chgPar = {userId: userids, companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
- }
- this.http.post(Alpost,chgPar,
- res => {
- if(res.code == "ok"){
- this.Alshow = false,
- this.Alchange = {yearDays:null,userId:null},
- this.AlchangeP = []
- this.getAl()
- }else{
- this.$message({
- message: res.msg,
- type: "error"
- })
- }
- },
- error => {
- this.Alshow = false
- this.$message({
- message: error,
- type: "error"
- })
- }
- )
- },
- getAl(){
- this.http.get('/user-yearleave-setting/list',
- res => {
- if(res.code == "ok"){
- this.iAlData = res.data
- this.iAlDataS = this.iAlData
- if(this.apk2 == 6){
- this.selAl()
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- })
- }
- },
- error => {
- this.Alshow = false
- this.$message({
- message: error,
- type: "error"
- })
- }
- )
- },
- selAl(){
- let e = this.$refs.selectAl.getCheckedNodes()[0]
- if(e == undefined){
- this.iAlDataS = this.iAlData
- }else{
- this.iAlDataS = []
- for (let i = 0; i < this.iAlData.length; i++) {
- if (e.label == this.iAlData[i].department) {
- this.iAlDataS.push(this.iAlData[i])
- }
- }
- }
- },
- // ---------
- handleNodeClick(data) {
- if(this.depData == null || data.id != this.depData.id) {
- this.depData = data;
- console.log("depdata",this.depData);
- this.getSettings();
- }
- },
- getSettings() {
- this.http.post('/audit-workflow-setting/get',{deptId: this.depData.id,type: 1},
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.dataArray = res.data;
- console.log("请求1",res.data);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- // 获取部门列表
- getDepartment() {
- this.http.post( this.port.manage.depList, {},
- res => {
- if (res.code == "ok") {
- var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
- this.sdata = list;
- this.soption = [
- {value: 1 , label : "部门" , children : this.changeArr(list1)},
- {value: 2 , label : "指定人员",children : this.susers}
- ]
- this.Nsdata = list1
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- changeArr(arr) {
- for (var i = 0; i < arr.length; i++) {
- if(arr[i].id != -1 && arr[i].id != 0) {
- if (arr[i].children != null && arr[i].children.length>0) {
- arr[i].children = this.changeArr(arr[i].children);
- }
- arr[i].id && (arr[i].value = arr[i].id);
- delete arr[i].id;
- }
- }
- for(var i in arr) {
- if(arr[i].id == -1 || arr[i].id == 0) {
- arr.splice(i,1)
- }
- }
- return arr;
- },
- showNodeDialog(index) {
- this.isAdd = true;
- this.sindex = index;
- this.curDeptId = null;
- this.curUserId = null;
- this.dialogVisible = true;
- },
- editNodeDialog(index, item) {
- //检查是否可编辑
- this.http.post('/audit-workflow-setting/checkNodeInUse',{auditDeptId: item.auditDeptId, deptId: this.depData.id,type: 1},
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.isAdd = false;
- this.sindex = index;
- this.curUserId = item.userId;
- this.dialogVisible = true;
- this.curDeptId = item.auditDeptId;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
-
- },
- addNode() {
- this.dialogVisible = false;
- if (this.curDeptId == null) return;
- var node = this.$refs.deptCascader.getCheckedNodes()[0];
- console.log("node",node);
-
- if (this.isAdd) {
- if(node.path[0] == 1){
- var node = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
- }else if(node.path[0] == 2){
- var node = {userId: node.value, userName: node.label, auditorType: 2};
- }
- this.dataArray.splice(this.sindex, 0, node);
-
- } else {
- //编辑
- this.dataArray[this.sindex].auditDeptId = node.value;
- this.dataArray[this.sindex].auditDeptName = node.label;
- }
- },
- deleteNode() {
- this.dialogVisible = false;
- this.dataArray.splice(this.sindex, 1);
- },
- submitInsert() {
- this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id, type:1},
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: '保存成功',
- type: "success"
- });
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
-
- //
- approve(item) {
- //审核通过
- this.http.post('/leave-sheet/approve', {id:item.id
- },
- res => {
- if (res.code == "ok") {
- this.bills(true);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- deny(item) {
- //审核驳回
- this.http.post('/leave-sheet/deny', {id:item.id
- },
- res => {
- if (res.code == "ok") {
- this.bills(true);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- getUsers() {
- this.http.post(this.port.manage.list, {
- departmentId: -1,
- pageIndex: 1,
- pageSize: 99999
- },
- res => {
- if (res.code == "ok") {
- this.users = res.data.records;
- for (let i = 0; i < this.users.length; i++) {
- this.susers.push({value:this.users[i].id,label:this.users[i].name})
- }
- //只能自己填报自己的请假单
- this.addForm.ownerId = this.user.id;
- this.ownerIds = this.user.id
- this.addForm.status = 1;
- this.addForm.tel = this.user.phone
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 员工请假填报点击事件
- ssl(index) {
- this.ins = index;
- this.addForm.leaveType = index
- },
- staffs(key, keyPath) {
- console.log("keypath",keyPath)
- if (keyPath[0] == '1') {
- this.displayTable = false;
- this.apk = false
- } else if(keyPath[0] == '2' || keyPath[0] == '3') {
- this.displayTable = true;
- this.apk = false
- } else if(keyPath[0] == '4'){
- this.displayTable = true;
- this.apk = true
- this.apk2 = 4
- this.statistical()
- } else if(keyPath[0] == '5'){
- this.displayTable = true;
- this.apk2 = 5
- this.apk = true
- } else {
- this.NcurDeptId = []
- this.displayTable = true;
- this.apk2 = 6
- this.apk = true
- this.getAl()
- }
- },
- bills(audit, tr){
- if(tr) {
- this.code = ''
- this.createDate = ''
- // this.ownerIds = ''
- this.type = ''
- if(tr == 1) {
- this.falg = 1
- this.code = 1
- } else if(tr == 2) {
- this.code = ''
- this.falg = 0
- } else {
- this.falg = 0
- }
- } else {
- this.falg = false
- }
- this.tableData = []
- this.displayTable = true;
- this.isAuditList = audit;
- this.loading = true
- var param = {pageIndex: this.page,
- pageSize: this.size,
- status: this.code,
- createDate: this.createDate,
- ownerId: this.ownerIds,
- leaveType: this.type,
- };
- if (this.isAuditList) {
- param.status = 1;
- }
- this.list = [];
- // this.total = 0;
- 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"
- });
- });
- },
- billss() {
- var param = {pageIndex: this.page,
- pageSize: this.size,
- status: this.code,
- startDate: 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"
- });
- });
- },
- // 判断日期是否补零了
- buling(das) {
- var rqi = das.split('-')
- rqi[1].length <= 1 ? rqi[1] = '0' + rqi[1] : rqi[1] = rqi[1]
- rqi[2].length <= 1 ? rqi[2] = '0' + rqi[2] : rqi[2] = rqi[2]
- var zong = rqi[0] + '-' + rqi[1] + '-' + rqi[2]
- return zong
- },
- submits(){
- console.log(this.addForm)
- // return
- this.$refs.addForm.validate(valid => {
- this.addForm.endDate = this.buling(this.addForm.endDate)
- this.addForm.startDate = this.buling(this.addForm.startDate)
- this.addForm.projectAuditorJson = JSON.stringify(this.addForm.projectAuditorJson)
- if (valid) {
- this.http.post('/leave-sheet/add', this.addForm,
- res => {
- if (res.code == "ok") {
- this.$message({
- 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 = ''
- this.addForm = {
- timeType: '0',
- startDate: this.getCurrentTime(),
- endDate: this.getCurrentTime(),
- timeDays: 1,
- leaveType: 0,
- ownerId: '',
- // indate: this.getCurrentTime(),
- timeHours: 8,
- tel: '',
- remark: '',
- projectAuditorJson: ''
- }
- this.flg = true
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- } else {
- return false;
- }
- });
- },
- txselts(a,b){
- this.selts()
- console.log('txselts',this.addForm.ownerId);
- if(a == 6 && this.addForm.ownerId != ''){
- this.http.post('/leave-sheet/getOTAvaiDays',{ userId:b },
- res => {
- if(res.code == "ok") {
- console.log('post',res.data);
- if(res.data < 0.5){
- this.txselnum = 0
- }else{
- this.txselnum = res.data.toFixed(1)
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- })
- }
- },
- selts() {
- for(var i in this.users) {
- if(this.users[i].id == this.addForm.ownerId) {
- this.addForm.tel = this.users[i].phone
- }
- }
- },
- chanRadio() {
- console.log(this.addForm.timeType)
- if(this.addForm.timeType == '0') {
- this.flg = true
- this.addForm.startDate = this.getCurrentTime()
- this.addForm.endDate = this.getCurrentTime()
- this.addForm.timeType = '0'
- this.addForm.timeDays = '1'
- this.addForm.timeHours = '8'
- } else {
- this.flg = false
- this.addForm.startDate = this.getCurrentTime()
- this.addForm.endDate = this.getCurrentTime()
- this.addForm.timeType = '1'
- this.addForm.timeHours = 1,
- this.addForm.timeDays = 1
- }
- },
- // 计算日期
- datas() {
- // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)
- if(this.addForm.startDate > this.addForm.endDate) {
- this.addForm.endDate = this.addForm.startDate
- }
- this.addForm.timeDays = this.countWorkDay(this.addForm.startDate, this.addForm.endDate)
- this.timeChoose = this.addForm.timeDays
- this.addForm.timeHours = this.addForm.timeDays * 8
- },
- datasss() {
- console.log(123)
- this.addForm.endDate = this.addForm.startDate
- },
- DateDiff(sDate1, sDate2){
- var aDate, oDate1, oDate2, iDays
- aDate = sDate1.split("-")
- oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
- aDate = sDate2.split("-")
- oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
- iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24)
- return iDays + 1
- },
- stringToDate(dateString){
- dateString = dateString.split('-');
- return new Date(dateString[0], dateString[1] - 1, dateString[2]);
- },
- countWorkDay(date1, date2){
- date1 = this.stringToDate(date1);
- date2 = this.stringToDate(date2);
- var delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1; // 计算出总时间
- var weeks = 0;
- for(var i = 0; i < delta; i++){
- if(date1.getDay() == 0 || date1.getDay() == 6) weeks ++; // 若为周六或周天则加1
- date1 = date1.valueOf();
- date1 += 1000 * 60 * 60 * 24;
- date1 = new Date(date1);
- }
- return delta - weeks;
- },
- chufas() {
- this.billss()
- },
- // 时间
- getTadeTime() {
- var time = new Date();
- return time.getHours() +':00:00'
- },
- // 日期
- getCurrentTime() {
- var _this = this;
- let yy = new Date().getFullYear();
- let mm = new Date().getMonth()+1;
- let dd = new Date().getDate();
- _this.gettime = yy +'-'+ mm +'-'+ dd;
- return _this.gettime
- },
- getCurrentTimes() {
- var _this = this;
- let yy = new Date().getFullYear();
- let mm = new Date().getMonth()+1;
- let dd = new Date().getDate();
- _this.gettime = yy+'-'+mm+'-'+'01';
- return _this.gettime
- },
- chanSele() {
- this.addForm.timeHours = parseInt(this.addForm.timeHours)
- },
- handleSizeChange(val){
- this.size = val;
- this.bills()
- },
- handleCurrentChange(val) {
- console.log(val, 1, '1')
- this.page = val;
- this.bills()
- },
- statistical() {
- this.loading = true
- this.http.post('/leave-sheet/summaryData', {
- keyword: this.keyword,
- startDate: this.statData,
- endDate: this.endData
- },
- res => {
- if (res.code == "ok") {
- this.statisticalList = res.data
- this.loading = false
- } else {
- this.loading = false
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //
- inputs() {
- var str = this.addForm.timeDays + ''
- if(str.indexOf('.') != '-1') {
- var s = str.split('.')[0]
- var st = str.split('.')[1]
- var sts = st.split('')
- this.addForm.timeDays = s + '.' + sts[0]
- }
- },
- inputss() {
- if(this.addForm.timeHours <= 0) {
- this.addForm.timeHours = 1
- } else if(this.addForm.timeHours > 8) {
- this.addForm.timeHours = 8
- } else {
- if(this.addForm.timeHours.indexOf('.') != '-1') {
- var str = this.addForm.timeHours
- console.log(str)
- if(str.indexOf('.') != '-1') {
- var s = str.split('.')[0]
- var st = str.split('.')[1]
- var sts = st.split('')
- this.addForm.timeHours = s + '.' + sts[0]
- }
- }
- }
- console.log(this.addForm)
- },
- 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>
- <style scoped>
- .addNode {
- cursor:pointer;
- }
- .addNode:hover {
- color:#20a0ff;
- }
- .apls {
- width: 200px;
- white-space:nowrap;
- overflow:hidden;
- text-overflow:ellipsis;
- }
- .tups {
- width: 100%;
- height: 25px;
- position: relative;
- z-index: 99;
- overflow: hidden;
- }
- .tups img {
- height: 25px !important;
- position: relative;
- z-index: 99;
- }
- .viewer-canvas {
- position: absolute;
- z-index: 9 !important;
- }
- .icl {
- margin-top: -25px !important;
- }
- /* 费用报销标题 */
- .headine {
- width: 100%;
- height: 46.4px;
- line-height: 46.4px;
- background: #fff;
- box-sizing: border-box;
- }
- .headine h3 {
- margin: 0;
- display: inline-block;
- box-sizing: border-box;
- color: #999;
- }
- .headine p {
- display: inline-block;
- margin: 0;
- }
- /* /费用报销标题 */
- .sidebars {
- height: 100%;
- position: absolute;
- border-right: 1px solid #E6E6E6;
- z-index: 2;
- top: 0;
- }
- .sidebars h3 {
- margin: 0;
- line-height: 45px;
- background: #ffffff;
- font-weight: normal;
- color: #666;
- padding-left: 20px;
- }
- .sidebars .el-col-12 {
- width: 100%
- }
- .public {
- height: 230px;
- border-bottom: 1px solid #ddd;
- }
- .public .el-form-item {
- display: inline-block;
- }
- .pu_button {
- text-align: right;
- width: 100%;
- padding: 24px 30px;
- box-sizing: border-box;
- }
- .pu_bu_x .pu_bu_t {
- display: inline-block;
- }
- .pu_bu_x {
- margin-right: 20px;
- color: #20A0F7;
- cursor: pointer;
- }
- .pu_bu_t {
- color: #20A0F7;
- cursor: pointer;
- display: block;
- float: right;
- position:
- relative;
- top: -20px;
- right: 63px;
- }
- .pu_table {
- margin-left: 10px;
- }
- .pu_bu_t:hover {
- color: #7bbcff;
- }
- .pu_bu_x:hover {
- color: #7bbcff;
- }
- /* 我的单据报销凭证 */
- .staff{
- border-left: 1px solid #fff;
- border-top: 1px solid #fff;
- border-right: 1px solid #fff;
- background: #fff;
- }
- /* */
- .sdat{
- display: inline-block;
- width: 260px;
- margin-left: 13px;
- }
- .messages .el-form-item{
- display: inline-block;
- }
- .messages .el-date-editor.el-input, .el-date-editor.el-input__inner{
- width: 190px;
- }
- /* 我的报销单据 */
- .search {
- position: relative;
- top: 20px;
- left: 20px;
- }
- .tables {
- margin-top: 50px;
- box-sizing: border-box;
- padding: 10px;
- }
- .informant .el-form-item {
- display: inline-block;
- }
- /* 侧边栏收索 */
- .side {
- position: absolute;
- z-index: 2;
- border-right: 2px solid #DDDDDD;
- height: 100%;
- top: 0;
- width: 0;
- }
- .side .spans {
- width: 20px;
- height: 30px;
- border: 1px solid #DDDDDD;
- box-sizing: border-box;
- position: absolute;
- top: 50%;
- margin-top: -50%;
- text-align: center;
- z-index: 1;
- background: #fff;
- }
- .side .spans i{
- margin-top: 7px;
- color: #C0BFBF
- }
- .side:hover {
- border-right: 2px solid #20A0FF;
- }
- .side:hover .spans {
- border: 1px solid #20A0FF;
- background: #20A0FF;
- }
- .side:hover .spans i{
- color: #fff;
- }
- /* 右边整体页面 */
- .contents {
- height: 100%;
- /* padding: 30px; */
- background: #F7F7F7;
- /* position: absolute; */
- }
- .submits {
- margin-left: 50%;
- }
- .waiting {
- color:orange;
- }
- .rejected {
- color:red;
- }
- /* 请假模块 */
- .tops {
- width: 100%;
- height:100%;
- position: absolute;
- background: #f7f7f7;
- box-sizing: border-box;
- padding: 20px 0 0 220px;
- }
- .ctons {
- width: 86%;
- height: 92%;
- overflow: hidden;
- background: #fff;
- padding: 30px 40px;
- box-sizing: border-box;
- }
- .ctons .el-form-item {
- display: inline-block;
- }
- .line {
- text-align: center;
- margin: 0 6px
- }
- .poss {
- position: fixed;
- bottom: 20px;
- right: 1%;
- box-sizing: border-box;
- }
- .flex {
- display: flex;
- padding: 0 0 20px 0;
- border-bottom: 1px solid #f2f2f2;
- }
- .flex span {
- display: inline-block;
- margin: 0 10px 0 20px;
- }
- </style>
|