list.vue 101 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600
  1. <template>
  2. <section id="section">
  3. <div class="sidebars" ref="sidebars" :style="'width: 180px;display: block;overflow:hidden;background: #fff;height:'+hubs+ 'px'">
  4. <h3><i class="iconfont firerock-iconbaoxiao" style="padding-right: 10px"></i>{{ $t('navigation.askForLeaveManagement') }}</h3>
  5. <el-divider ></el-divider>
  6. <el-col :span="12">
  7. <el-menu :default-active="isSyncData ? '7' : '1'" class="el-menu-vertical-demo" @select="staffs" background-color="#ffffff" text-color="#666666" active-text-color="#20A0FF" style="width:100%">
  8. <!-- <el-submenu index="1">
  9. <template slot="title">
  10. <i class="iconfont firerock-icontianbao"></i>
  11. <span>员工请假填报</span>
  12. </template>
  13. <el-menu-item index="1-1"><p @click="ssl(0)">请事假</p></el-menu-item>
  14. <el-menu-item index="1-2"><p @click="ssl(1)">请病假</p></el-menu-item>
  15. <el-menu-item index="1-3"><p @click="ssl(2)">请年假</p></el-menu-item>
  16. <el-menu-item index="1-4"><p @click="ssl(3)">请产假</p></el-menu-item>
  17. </el-submenu> -->
  18. <template v-if="!isSyncData">
  19. <el-menu-item index="1" v-if="permissions.leaveFil">
  20. <i class="iconfont firerock-icontianbao"></i>
  21. <span slot="title">{{ $t('staffleavetofillin') }}</span>
  22. </el-menu-item>
  23. <!-- <el-submenu index="2" v-if="permissions.leaveAll || permissions.leaveAudit">
  24. <template slot="title">
  25. <i class="iconfont firerock-iconbaoxiaodan"></i>
  26. <span>{{ $t('singlelistofleave') }}</span>
  27. </template>
  28. <el-menu-item index="2-1" ><p @click="bills(false, 2)" v-if="permissions.leaveAll">{{ $t('all') }}</p></el-menu-item>
  29. <el-menu-item index="2-2" ><p @click="bills(true, 1)" v-if="permissions.leaveAudit">{{ $t('state.WaitingAudit') }}</p></el-menu-item>
  30. </el-submenu> -->
  31. <el-menu-item index="2" @select="bills" @click="auditList()" v-if="permissions.leaveAudit">
  32. <i class="iconfont firerock-iconshenhe"></i>
  33. <span slot="title">{{ $t('qingJiaShenHe') }}</span>
  34. </el-menu-item>
  35. <el-menu-item index="3" @select="bills" @click="bills(false, 2)" >
  36. <i class="iconfont firerock-iconbaoxiaodan"></i>
  37. <span slot="title">{{ $t('singlelistofleave') }}</span>
  38. </el-menu-item>
  39. <!-- <el-menu-item index="3" @select="bills" @click="bills(false, 2)" v-if="!permissions.leaveAll">
  40. <i class="iconfont firerock-iconbaoxiaodan"></i>
  41. <span slot="title">{{ $t('myleaveform') }}</span>
  42. </el-menu-item> -->
  43. <el-menu-item index="4" v-if="permissions.leaveStatistical">
  44. <template slot="title">
  45. <i class="iconfont firerock-icongongshitongji"></i>
  46. <span slot="title">{{ $t('for') }}</span>
  47. </template>
  48. </el-menu-item>
  49. <el-menu-item index="9" v-if="permissions.leaveStatistical">
  50. <template slot="title">
  51. <i class="iconfont firerock-icongongshitongji"></i>
  52. <span slot="title">{{ $t('restTime') }}</span>
  53. </template>
  54. </el-menu-item>
  55. <el-menu-item index="5" v-if="permissions.leaveProcess">
  56. <template slot="title">
  57. <i class="iconfont firerock-iconliucheng"></i>
  58. <span slot="title">{{ $t('leaveApprovalProcess') }}</span>
  59. </template>
  60. </el-menu-item>
  61. <el-menu-item index="6" v-if="permissions.leaveAnnual">
  62. <template slot="title">
  63. <i class="iconfont firerock-iconsetting"></i>
  64. <span slot="title">{{ $t('annualleavemanagement') }}</span>
  65. </template>
  66. </el-menu-item>
  67. </template>
  68. <!-- 钉钉环境对接 -->
  69. <template v-if="isSyncData">
  70. <el-menu-item index="7">
  71. <template slot="title">
  72. <i class="iconfont firerock-iconbaoxiaodan"></i>
  73. <span slot="title">{{ $t('singlelistofleave') }}</span>
  74. </template>
  75. </el-menu-item>
  76. <el-menu-item index="8">
  77. <template slot="title">
  78. <i class="iconfont firerock-iconbaoxiaodan"></i>
  79. <span slot="title">{{ $t('scheduleofremainingLeave') }}</span>
  80. </template>
  81. </el-menu-item>
  82. </template>
  83. </el-menu>
  84. </el-col>
  85. </div>
  86. <!-- 侧边栏点击事件 -->
  87. <!-- <div class="side" @click="side" ref="sid" style="left: 430px">
  88. <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
  89. </div> -->
  90. <!-- 内容主体区域 -->
  91. <div class="contents">
  92. <div v-if="!displayTable && !isSyncData" class="headine" ref="headine">
  93. <h3 ref="headHe" style="padding-left: 220px">{{ $t('aketimeoffto') }}</h3>
  94. <!-- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p> -->
  95. </div>
  96. <!-- 上面部分 -->
  97. <div v-if="!displayTable && apk == false" class="tops" :style="'height:' +hubs+'px'">
  98. <!-- 公共 -->
  99. <div class="ctons" style="width: 98%">
  100. <!-- 表单 -->
  101. <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
  102. <!-- 请假类型 -->
  103. <el-form-item :label="$t('leavetype')" prop="leaveType" style="width: 100%">
  104. <!--普通员工只能自己填报自己的 -->
  105. <el-select v-model="addForm.leaveType" @change="txselts(addForm.leaveType,addForm.ownerId)" :placeholder="$t('defaultText.pleaseChoose')" style="width: 240px">
  106. <el-option v-for="item in qjType" :key="item.id" :label="item.name" :value="item.id"></el-option>
  107. </el-select>
  108. <template v-if="addForm.leaveType == 6">
  109. <span style="margin-left:18px;color:#777;">{{ $t('restcanbeadjusted') }} {{addForm.ownerId != '' ? txselnum : '~'}} {{ addForm.timeType == 0 ? '天' : '小时' }}</span>
  110. <el-tooltip effect="dark" :content="$t('overtimhourscabeusedforoffsetting')" placement="top-start">
  111. <i class="el-icon-question" style="color:#606266;"></i>
  112. </el-tooltip>
  113. </template>
  114. </el-form-item>
  115. <!-- 请假人 -->
  116. <el-form-item :label="$t('leavepeople')" prop="ownerId" style="width: 300px">
  117. <!--普通员工只能自己填报自己的 -->
  118. <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.ownerId" @change="txselts(addForm.leaveType,addForm.ownerId)" :placeholder="$t('defaultText.pleaseChoose')" style="width: 240px" :disabled="true" filterable="true">
  119. <span v-for="(item, index) in users" :key="index">
  120. <el-option :label="item.name" :value="item.id"></el-option>
  121. </span>
  122. </el-select>
  123. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :widthStr="'240'" :subject="users" :subjectId="addForm.ownerId" :distinction="'1'" :disabled="true" @selectCal="selectCal"></selectCat>
  124. </el-form-item>
  125. <!-- 电话 -->
  126. <el-form-item :label="$t('phone')" prop="tel" style="margin-right:300px">
  127. <el-input ref="ipts" v-model="addForm.tel" :placeholder="$t('peaseenterthe')" style="width: 250px"></el-input>
  128. </el-form-item>
  129. <!-- 单选 -->
  130. <el-form-item style="display: inline-block;width:300px;margin-right: 400px" :label="$t('lengthunit')">
  131. <el-radio-group v-model="addForm.timeType" @change="chanRadio()" style="display:inline-block;width:240px">
  132. <el-radio label="0">{{ $t('accordingdays') }}</el-radio>
  133. <!-- <el-radio label="1" v-if="addForm.leaveType != 6">{{ $t('leavehour') }}</el-radio> -->
  134. <el-radio label="1">{{ $t('leavehour') }}</el-radio>
  135. </el-radio-group>
  136. </el-form-item>
  137. <!-- 时间选择 -->
  138. <el-form-item :label="flg ? $t('optiondate') : $t('other.timeSelection')" style="width: 100%;">
  139. <el-col style="display: inline-block; width: 240px">
  140. <el-date-picker v-if="flg" type="date" :placeholder="$t('time.startDate')" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @blur="datas()"></el-date-picker>
  141. <el-date-picker v-else type="date" :placeholder="$t('time.startDate')" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @change="datasss()"></el-date-picker>
  142. </el-col>
  143. <el-col class="line" v-if="flg" style="display: inline-block; width: 50px">-</el-col>
  144. <el-col style="display: inline-block; width: 240px">
  145. <el-date-picker v-if="flg" type="date" :placeholder="$t('time.endDate')" value-format="yyyy-MM-dd" :picker-options="pickerOptionsEnd" v-model="addForm.endDate" style="width: 250px;" @blur="datas()"></el-date-picker>
  146. <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  147. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  148. </el-select> -->
  149. </el-col>
  150. </el-form-item>
  151. <!-- 请假天数 -->
  152. <el-form-item :label="flg ? $t('leavedays') : $t('leavetime')" prop="timeDays" style="margin-right: 500px">
  153. <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
  154. <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
  155. <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> {{ $t('time.day') }}</div>
  156. <div v-else>
  157. <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 120px; margin-right: 20px;"></el-input> {{ $t('time.hour') }}
  158. </div>
  159. </el-form-item>
  160. <!-- 备注 -->
  161. <el-form-item :label="$t('bei-zhu')" style="width: 100%">
  162. <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 550px" maxlength="100" show-word-limit></el-input>
  163. </el-form-item>
  164. <!--请假流程显示-->
  165. <el-form-item :label="$t('other.approvalProcess')" style="width: 100%;color:#606266" >
  166. <span v-for="(item, index) in curWorkflowList" :key="item.id" >
  167. <span v-if="index>0"><i class="el-icon-right"></i></span>
  168. <span><i class="el-icon-s-custom"></i></span>
  169. <span v-if="user.userNameNeedTranslate == 1">
  170. <span v-if="item.auditorType == 1"><TranslationOpenDataText type='departmentName' :openid='item.auditDeptName' ></TranslationOpenDataText>{{ $t('zhu-yao-fu-ze-ren') }}</span>
  171. <TranslationOpenDataText type='userName' :openid='item.userName' v-if="item.auditorType == 2"></TranslationOpenDataText>
  172. </span>
  173. <span v-if="user.userNameNeedTranslate == 0">
  174. {{item.auditorType == 1 ? (`${item.auditDeptName} ${$t('zhu-yao-fu-ze-ren')}`) : item.userName}}
  175. </span>
  176. </span>
  177. </el-form-item>
  178. </el-form>
  179. <div>
  180. <p style="margin-left: 20%"><el-button type="primary" @click="submits('addFormRules')" size="mini" :disabled="txselnum == 0 && addForm.leaveType == 6 && addForm.ownerId != '' ? true : false">{{ $t('btn.submit') }}</el-button></p>
  181. </div>
  182. </div>
  183. </div>
  184. <!-- 下面部分 -->
  185. <div v-if="displayTable && apk == false" class="tops" :style="'height:' +hubs+'px'">
  186. <!-- 公共 -->
  187. <div class="ctons" style="width: 98%;">
  188. <div class="flex">
  189. <div>
  190. <el-select v-if="user.userNameNeedTranslate != 1" v-model="ownerIds" :placeholder="$t('pleaseselectthepersonaskingforleave')" clearable @change="chufas()" style="width: 120px" size="small" v-show="permissions.leaveAll" filterable="true">
  191. <span v-for="(item, index) in users" :key="index">
  192. <el-option :label="item.name" :value="item.id"></el-option>
  193. </span>
  194. </el-select>
  195. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="ownerIds" :distinction="'3'" :disabled="false" :widthStr="'120'" :clearable="true" @selectCal="selectCal" v-show="permissions.leaveAll" style="width: 120px"></selectCat>
  196. </div>
  197. <div>
  198. <span style="color: #606266">{{ $t('leavetype') }}</span>
  199. <el-select v-model="type" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="chufas()" style="width: 110px;" size="small" filterable="true">
  200. <span v-for="(item, index) in typess" :key="index">
  201. <el-option :label="item.name" :value="item.id"></el-option>
  202. </span>
  203. </el-select>
  204. </div>
  205. <div>
  206. <span style="color: #606266">{{$t('offstate')}}</span>
  207. <el-select v-if="falg == 0" v-model="code" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="chufas()" size="small" style="width: 110px" filterable="true">
  208. <span v-for="(item, index) in statuss" :key="index">
  209. <el-option :label="item.name" :value="item.id"></el-option>
  210. </span>
  211. </el-select>
  212. <el-select v-if="falg == 1" disabled v-model="code" :placeholder="$t('pleaseselectthetypeofleave')" clearable @change="chufas()" size="small" style="width: 110px" filterable="true">
  213. <span v-for="(item, index) in statuss" :key="index">
  214. <el-option :label="item.name" :value="item.id"></el-option>
  215. </span>
  216. </el-select>
  217. </div>
  218. <div>
  219. <!-- <span style="color: #606266">请假时间</span>
  220. <el-date-picker v-model="createDate" type="date" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable="false"> </el-date-picker> -->
  221. <span style="color: #606266">{{ $t('message.period') }}</span>
  222. <el-date-picker v-model="createDate" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" @change="chufas()" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')" size="small" clearable style="width:250px"></el-date-picker>
  223. </div>
  224. <div>
  225. <el-button type="primary" v-if="!isAuditList" size="small" style="margin-left:20px" @click="exportLeave()">{{ $t('dao-chu-qing-jia-dan') }}</el-button>
  226. </div>
  227. <!--美莱德同步请假数据按钮 -->
  228. <div v-if="user.companyId==876" >
  229. <el-button type="primary" v-if="!isAuditList" size="small" style="margin-left:20px" @click="syncLeave()" :loading="this.syncLeaveLoading">{{ '同步请假数据' }}</el-button>
  230. </div>
  231. </div>
  232. <el-table v-loading="loading" :data="tableData" style="width: 100%" height="94%">
  233. <el-table-column prop="ownerName" :label="$t('leavepeople')" min-width="120" fixed="left">
  234. <template slot-scope="scope">
  235. <div>
  236. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
  237. <span v-if="user.userNameNeedTranslate == 1">
  238. <TranslationOpenDataText type='userName' :openid='scope.row.ownerName'></TranslationOpenDataText>
  239. </span>
  240. </div>
  241. </template>
  242. </el-table-column>
  243. <el-table-column prop="tel" :label="$t('phone')" min-width="120"></el-table-column>
  244. <el-table-column prop="leaveType" :label="$t('leavetype')" min-width="120">
  245. <template slot-scope="scope">
  246. <!-- <div v-if="scope.row.leaveType == 0">事假</div>
  247. <div v-if="scope.row.leaveType == 1">病假</div>
  248. <div v-if="scope.row.leaveType == 2">年假</div>
  249. <div v-if="scope.row.leaveType == 3">产假</div> -->
  250. {{qjType[scope.row.leaveType].name}}
  251. </template>
  252. </el-table-column>
  253. <el-table-column prop="startDate" :label="$t('leavestarttime')" min-width="150"></el-table-column>
  254. <el-table-column prop="endDate" :label="$t('leaveendtime')" min-width="150"></el-table-column>
  255. <el-table-column :label="$t('leavedays')" min-width="120">
  256. <template slot-scope="scope">
  257. <div v-if="scope.row.timeType == '1'">/</div>
  258. <div v-else>{{scope.row.timeDays}} {{ $t('time.day') }}</div>
  259. </template>
  260. </el-table-column>
  261. <el-table-column :label="$t('leavetime')" min-width="120" v-if="!user.timeType.syncDingding">
  262. <template slot-scope="scope">
  263. <div>{{scope.row.timeHours}} {{ $t('time.hour') }}</div>
  264. </template>
  265. </el-table-column>
  266. <el-table-column prop="status" :label="$t('state.states')" min-width="180">
  267. <template slot-scope="scope">
  268. <div v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 4">
  269. <div v-if="scope.row.status == 0" >{{ $t('state.approved') }}</div>
  270. <div v-if="scope.row.status == 1" style="color: orange"><span>{{ $t('state.WaitingAudit') }}-</span>
  271. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.auditorName}}</span>
  272. <span v-if="user.userNameNeedTranslate == 1">
  273. <TranslationOpenDataText type='userName' :openid='scope.row.auditorName'></TranslationOpenDataText>
  274. </span>
  275. </div>
  276. <div v-if="scope.row.status == 2" style="color: red">{{ $t('btn.rejected') }}<el-link style="margin-left:5px;" @click="showDenyReason(scope.row.id)">{{ $t('chaKanYuanYin') }}</el-link></div>
  277. <div v-if="scope.row.status == 3" style="color: #666666">{{ $t('yiCheHui') }}</div>
  278. </div>
  279. <div v-else>
  280. <span>{{ $t('norequestforleaveatpresent') }}</span>
  281. </div>
  282. </template>
  283. </el-table-column>
  284. <el-table-column prop="remark" :label="$t('bei-zhu')" min-width="200" header-align="center">
  285. <template slot-scope="scope">
  286. <!-- <div class="apls">{{scope.row.remark}}</div> -->
  287. <el-popover placement="top-start" width="200" trigger="hover" :content="scope.row.remark">
  288. <div slot="reference" class="apls">{{scope.row.remark}}</div>
  289. </el-popover>
  290. </template>
  291. </el-table-column>
  292. <el-table-column :label="$t('operation')" min-width="180" fixed="right" v-if="isAuditList && !isSyncData">
  293. <template slot-scope="scope">
  294. <div>
  295. <el-button icon="el-icon-check" circle size="mini" @click.stop.native="approve(scope.row)"></el-button>
  296. <el-button icon="el-icon-close" circle size="mini" @click.stop.native="deny(scope.row)"></el-button>
  297. </div>
  298. </template>
  299. </el-table-column>
  300. <el-table-column :label="$t('operation')" min-width="180" fixed="right" v-if="!isAuditList && !isSyncData">
  301. <template slot-scope="scope">
  302. <!-- <div v-if="(scope.row.status != 0 && scope.row.ownerId == user.id) || permissions.leaveAll"> -->
  303. <div v-if="(scope.row.status != 0 || permissions.leaveAll) && scope.row.ownerId == user.id">
  304. <el-button size="mini" v-if="scope.row.status == 3 ||scope.row.status == 2" @click.stop.native="deletes(scope.row)" >{{ $t('btn.delete') }}</el-button>
  305. <el-button size="mini" v-if="scope.row.status == 1" @click.stop.native="cancel(scope.row)">{{ $t('btn.withdraw') }}</el-button>
  306. <el-button size="mini" v-if="scope.row.status == 3 ||scope.row.status == 2 " type="primary" @click.stop.native="editor(scope.row)">{{ $t('zhong-xin-ti-jiao') }}</el-button>
  307. </div>
  308. </template>
  309. </el-table-column>
  310. </el-table>
  311. <div class="poss">
  312. <el-pagination
  313. @size-change="handleSizeChange"
  314. @current-change="handleCurrentChange"
  315. :current-page="page"
  316. :page-sizes="[20, 50, 100, 200]"
  317. :page-size="20"
  318. layout="total, sizes, prev, pager, next"
  319. :total="total">
  320. </el-pagination>
  321. </div>
  322. </div>
  323. </div>
  324. <!-- 统计部分 -->
  325. <div v-if="displayTable && apk && apk2 == 4" class="tops" :style="'height:' +hubs+'px'">
  326. <!-- 公共 -->
  327. <div class="ctons" style="width: 98%;">
  328. <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
  329. <div style="display: inline-block;width: 350px">
  330. <el-input style="float:left;" v-if="user.userNameNeedTranslate != 1" v-model="keyword" class="input-with-select" @keyup.enter.native="statistical()" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
  331. <el-button slot="append" @click="statistical()" icon="el-icon-search"></el-button>
  332. </el-input>
  333. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :widthStr="'240'" :subject="users" :distinction="'11'" :disabled="false" @selectCal="selectCal" :clearable="true"></selectCat>
  334. </div>
  335. <div style="display: inline-block;width: 340px">
  336. <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">{{ $t('time.startDate') }}</span>
  337. <el-date-picker
  338. v-model="statData"
  339. type="date"
  340. :placeholder="$t('optiondate')"
  341. size="small"
  342. @change="statistical()"
  343. clearable="false"
  344. value-format="yyyy-MM-dd"
  345. :picker-options="pickerOptionsStarts">
  346. </el-date-picker>
  347. </div>
  348. <div style="display: inline-block;width: 350px">
  349. <span style="display: inline-block;margin: 0 15px 0 0;color: rgb(96, 98, 102);">{{ $t('time.endDate') }}</span>
  350. <el-date-picker
  351. v-model="endData"
  352. type="date"
  353. :placeholder="$t('optiondate')"
  354. size="small"
  355. @change="statistical()"
  356. clearable="fasle"
  357. value-format="yyyy-MM-dd"
  358. :picker-options="pickerOptionsEnds">
  359. </el-date-picker>
  360. </div>
  361. </div>
  362. <!-- <div style="margin-top: 30px"> -->
  363. <div>
  364. <el-table key="apk2is4" v-loading="loading" :data="statisticalList" height="780px" style="width: 99%">
  365. <el-table-column prop="ownerName" :label="$t('lable.name')" width="300">
  366. <template slot-scope="scope">
  367. <div v-if="scope.row.ownerName">
  368. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
  369. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.ownerName'></TranslationOpenDataText></span>
  370. </div>
  371. <div v-else>
  372. <span>{{ $t('Nstatisticpresent') }}</span>
  373. </div>
  374. </template>
  375. </el-table-column>
  376. <el-table-column prop="timeDays" :label="$t('totaldaysleave')" width="300">
  377. <template slot-scope="scope">
  378. {{scope.row.timeDays}} / {{ $t('time.day') }}
  379. </template>
  380. </el-table-column>
  381. <el-table-column prop="timeHours" :label="$t('totallengthofleave')">
  382. <template slot-scope="scope">
  383. {{scope.row.timeHours}}/{{ $t('time.hour') }}
  384. </template>
  385. </el-table-column>
  386. </el-table>
  387. </div>
  388. </div>
  389. </div>
  390. <!-- 调休 统计部分 -->
  391. <div v-if="displayTable && apk && apk2 == 9" class="tops" :style="'height:' +hubs+'px'">
  392. <!-- 公共 -->
  393. <div class="ctons" style="width: 98%;">
  394. <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
  395. <div style="display: inline-block;width: 350px">
  396. <!-- <el-input style="float:left;" v-if="user.userNameNeedTranslate != 1" v-model="userName" class="input-with-select" @keyup.enter.native="restTime()" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
  397. <el-button slot="append" @click="restTime()" icon="el-icon-search"></el-button>
  398. </el-input>
  399. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :widthStr="'240'" :subject="users" :distinction="'11'" :disabled="false" @selectCal="selectCal" :clearable="true"></selectCat> -->
  400. <selectPersonnel v-model="userId" @change="restTime" />
  401. </div>
  402. </div>
  403. <!-- <div style="margin-top: 30px"> -->
  404. <div>
  405. <el-table key="apk2is4" v-loading="loading" :data="restTimeList" height="780px" style="width: 99%">
  406. <el-table-column prop="userName" :label="$t('lable.name')" width="300">
  407. <template slot-scope="scope">
  408. <div v-if="scope.row.userName">
  409. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.userName}}</span>
  410. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText></span>
  411. </div>
  412. <div v-else>
  413. <span>{{ $t('Nstatisticpresent') }}</span>
  414. </div>
  415. </template>
  416. </el-table-column>
  417. <el-table-column prop="restTimeDayStr" :label="$t('remaindaysRest')" width="300">
  418. <template slot-scope="scope">
  419. {{scope.row.restTimeDayStr}} / {{ $t('time.day') }}
  420. </template>
  421. </el-table-column>
  422. <el-table-column prop="restTimeHourStr" :label="$t('remainlengthofRest')">
  423. <template slot-scope="scope">
  424. {{scope.row.restTimeHourStr}}/{{ $t('time.hour') }}
  425. </template>
  426. </el-table-column>
  427. </el-table>
  428. </div>
  429. </div>
  430. </div>
  431. <!-- 审批流 -->
  432. <div v-if="displayTable && apk && apk2 == 5" class="tops" :style="'height:' +hubs+'px'">
  433. <div class="ctons" style="width: 98%;">
  434. <el-col :span="6" >
  435. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-left:15px;" >
  436. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  437. <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion>
  438. <!-- 添加试试看 -->
  439. <span class="custom-tree-node" slot-scope="{ node, data }">
  440. <!-- <span>{{ node.label }}</span> -->
  441. <span v-if="user.userNameNeedTranslate == '1'">
  442. <TranslationOpenDataText type='departmentName' :openid='node.label'></TranslationOpenDataText>
  443. </span>
  444. <span v-else>
  445. {{ node.label }}
  446. <span v-if="false">{{data}}</span>
  447. </span>
  448. </span>
  449. </el-tree>
  450. </div>
  451. </el-scrollbar>
  452. </el-col>
  453. <el-col :span="18" >
  454. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-right:20px;" >
  455. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  456. <div style="padding:5px;color:#333;" v-if="depData != null">{{ $t('setup') }} &lt;<span style="color:#20a0ff;">
  457. <!-- {{depData.label}} -->
  458. <span v-if="user.userNameNeedTranslate != 1">{{depData.label}}</span>
  459. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='departmentName' :openid='depData.label'></TranslationOpenDataText></span>
  460. &gt;</span> {{ $t('approvalprocessforleaveofdirect staff') }}
  461. <el-tooltip effect="dark" v-if="depData != null && depData.children!=null" content="仅适用于当前部门的直属人员,子部门人员的审批流程需要单独设置" placement="top-start">
  462. <i class="el-icon-question"></i>
  463. </el-tooltip>
  464. </div>
  465. <div style="padding:5px;" v-if="depData == null">{{ $t('qing-xuan-ze-bu-men') }}</div>
  466. <div style="width:100%;margin:0 auto;text-align: center; margin-top:50px;" v-if="depData != null">
  467. <span>{{ $t('employeeisallowed') }}</span>
  468. <icon class="iconfont firerock-iconright"></icon>
  469. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(0)"></icon>
  470. <icon class="iconfont firerock-iconright"></icon>
  471. <span v-for="(item, index) in dataArray" :key="item.seq" >
  472. <el-button type="primary" v-if="item.auditorType == 1 && user.userNameNeedTranslate == 1" @click="editNodeDialog(index, item)">
  473. <!-- {{item.auditDeptName}} -->
  474. <TranslationOpenDataText type='departmentName' :openid='item.auditDeptName'></TranslationOpenDataText>
  475. </el-button>
  476. <el-button type="primary" v-if="item.auditorType == 2 && user.userNameNeedTranslate == 1" @click="editNodeDialog(index, item)">
  477. <!-- {{item.userName}} -->
  478. <TranslationOpenDataText type='userName' :openid='item.userName'></TranslationOpenDataText>
  479. </el-button>
  480. <el-button type="primary" v-if="item.auditorType == 1 && user.userNameNeedTranslate != 1" @click="editNodeDialog(index, item)">
  481. {{item.auditDeptName}}
  482. </el-button>
  483. <el-button type="primary" v-if="item.auditorType == 2 && user.userNameNeedTranslate != 1" @click="editNodeDialog(index, item)">
  484. {{item.userName}}
  485. </el-button>
  486. <template v-if="item.auditorType == 1 || item.auditorType == 2">
  487. <icon class="iconfont firerock-iconright"></icon>
  488. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(index+1)"></icon>
  489. <icon class="iconfont firerock-iconright"></icon>
  490. </template>
  491. </span>
  492. <!--结束点 -->
  493. <icon class="iconfont firerock-iconApp_New_Line" style="color:#20A0FF;"></icon>
  494. {{ $t('approvaltocomplete') }}
  495. </div>
  496. <div style="width:100%;margin:0 auto;margin-bottom:30px;position: absolute;bottom: 0px;text-align: center; ">
  497. <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('save') }}</el-button>
  498. </div>
  499. </div>
  500. </el-scrollbar>
  501. </el-col>
  502. </div>
  503. <!--部门选择列表 -->
  504. <el-dialog :title="$t('pleaseselectapprover')" v-if="dialogVisible" :visible.sync="dialogVisible" width="460px">
  505. <el-form label-width="140px">
  506. <el-form-item :label="$t('selectdepartmentsdesignatepersonnel')" >
  507. <el-cascader filterable ref="deptCascader" v-model="curDeptId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" @change="chooseDept"
  508. :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable v-show="user.userNameNeedTranslate != 1"></el-cascader>
  509. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :userName="true" :fistRadio="true" :subjectId="this.selectedAuuid" :subject="soption" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  510. </el-form-item>
  511. </el-form>
  512. <div slot="footer" class="dialog-footer">
  513. <el-button type="default" @click="deleteNode" v-if="!isAdd" style="float:left;">{{ $t('btn.delete') }}</el-button>
  514. <el-button type="primary" @click="addNode" >{{ $t('btn.determine') }}</el-button>
  515. </div>
  516. </el-dialog>
  517. </div>
  518. <!-- 年假管理 -->
  519. <div v-if="displayTable && apk && apk2 == 6" class="tops" :style="'height:' +hubs+'px'">
  520. <div class="ctons" style="width: 98%;">
  521. <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
  522. <div style="display: inline-block;width: 18%;margin-left:1%">
  523. <el-button size="small" @click="changeAltime(0)">{{ $t('volumeset') }}</el-button>
  524. </div>
  525. <div style="display: inline-block;width: 26%" v-if="user.userNameNeedTranslate != 1">
  526. <el-input style="float:left;" v-model="keywordAl" class="input-with-select" @keyup.enter.native="searchAl()" :placeholder="$t('pleaseenterhepersonnamesearch')" clearable="true" size="small" @clear="clearsearchAl()">
  527. <el-button slot="append" @click="searchAl()" icon="el-icon-search"></el-button>
  528. </el-input>
  529. </div>
  530. <div style="display: inline-block;width: 32%;">
  531. <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">{{ $t('screeningDepartment') }}</span>
  532. <el-cascader
  533. ref="selectAl"
  534. filterable
  535. v-model="NcurDeptId"
  536. :placeholder="$t('defaultText.pleaseChoose')"
  537. size="small"
  538. style="width: 60%"
  539. @change="selAl()"
  540. clearable
  541. :options="Nsdata"
  542. :props="{ checkStrictly: true, expandTrigger: 'hover' }"
  543. :show-all-levels="false" v-if="user.userNameNeedTranslate != 1">
  544. </el-cascader>
  545. <vueCascader :size="'small'" :widthStr="'120'" :clearable="true" :subject="Nsdata" :radios="true" :distinction="'2'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  546. </div>
  547. </div>
  548. <div>
  549. <el-table key="apk2is6" v-loading="loading" :data="iAlDataS" height="480" style="width: 99%;" @selection-change="selPchg">
  550. <el-table-column type="selection"></el-table-column>
  551. <el-table-column prop="userName" :label="$t('lable.name')" width="200">
  552. <template slot-scope="scope">
  553. <div v-if="scope.row.userName">
  554. <span v-if="user.userNameNeedTranslate != 1">
  555. {{scope.row.userName}}
  556. </span>
  557. <span v-if="user.userNameNeedTranslate == 1">
  558. <TranslationOpenDataText type='userName' :openid='scope.row.userName'></TranslationOpenDataText>
  559. </span>
  560. </div>
  561. </template>
  562. </el-table-column>
  563. <el-table-column prop="department" :label="$t('departmentsuod')" width="200">
  564. <template slot-scope="scope">
  565. <span v-if="user.userNameNeedTranslate != 1">
  566. {{scope.row.department}}
  567. </span>
  568. <span v-if="user.userNameNeedTranslate == 1">
  569. <TranslationOpenDataText type='departmentName' :openid='scope.row.department'></TranslationOpenDataText>
  570. </span>
  571. </template>
  572. </el-table-column>
  573. <el-table-column prop="yearDays" :label="$t('annualleaveperyear')" width="200">
  574. <template slot-scope="scope">
  575. {{scope.row.yearDays != null ? scope.row.yearDays + $t('time.day') : "-"}}
  576. </template>
  577. </el-table-column>
  578. <el-table-column prop="leftdays" :label="$t('remainingdaysofannualleave')" width="200">
  579. <template slot-scope="scope">
  580. {{scope.row.yearDays != null ? scope.row.yearDays - scope.row.alreadyDays + $t('time.day') : "-"}}
  581. </template>
  582. </el-table-column>
  583. <el-table-column prop="id" :label="$t('numberofannualleavedays')">
  584. <template slot-scope="scope">
  585. <el-button size="small" @click="changeAltime(scope.row)">{{ $t('setup') }}</el-button>
  586. </template>
  587. </el-table-column>
  588. </el-table>
  589. </div>
  590. </div>
  591. <el-dialog :title="$t('pleasesetthetimelimitforannualleave')" v-if="Alshow" :visible.sync="Alshow" @close="delAltime()" width="500px">
  592. <el-form label-width="8rem">
  593. <el-form-item :label="$t('setthenumberofannualleavedaysperyear')" >
  594. <el-input v-model="Alchange.yearDays" type="number" min="0" :placeholder="$t('pleaseenterdays')"></el-input>
  595. </el-form-item>
  596. </el-form>
  597. <div slot="footer" class="dialog-footer">
  598. <el-button type="default" @click="delAltime()">{{ $t('btn.cancel') }}</el-button>
  599. <el-button type="primary" @click="chgAltime()">{{ $t('btn.determine') }}</el-button>
  600. </div>
  601. </el-dialog>
  602. </div>
  603. <div v-if="displayTable && apk && apk2 == 8" class="tops" :style="'height:' +hubs+'px'">
  604. <!-- 公共 -->
  605. <div class="ctons" style="width: 98%;">
  606. <div class="flex">
  607. <div>
  608. <span>{{ $t('leavetype') }}</span>
  609. <el-select v-model="leaveTypeItem" :placeholder="$t('pleaseselectthetypeofleave')" @change="leaveTypeChange()" style="width: 120px" size="small" filterable="true">
  610. <span v-for="item in leaveTypeList" :key="item.leaveCode">
  611. <el-option :label="item.leaveName" :value="item.leaveCode"></el-option>
  612. </span>
  613. </el-select>
  614. </div>
  615. <template v-if="permissions.leaveAll">
  616. <div>
  617. <span>{{ $t('departmentofscreening') }}</span>
  618. <el-cascader
  619. size="small"
  620. collapse-tags
  621. @change="departmentOptionsChg"
  622. v-model="departmentSel"
  623. :options="departmentOptions"
  624. :placeholder="$t('qing-xuan-ze-bu-men')"
  625. :show-all-levels="false"
  626. :props="{ multiple: true }"
  627. clearable></el-cascader>
  628. </div>
  629. <div>
  630. <span>{{ $t('personnelselection') }}</span>
  631. <el-select v-model="userSelId" :placeholder="$t('pleaseselectthepersonaskingforleave')" clearable @change="userChg()" style="width: 140px" size="small" v-show="permissions.leaveAll" filterable="true">
  632. <span v-for="(item, index) in users" :key="index">
  633. <el-option :label="item.name" :value="item.id"></el-option>
  634. </span>
  635. </el-select>
  636. </div>
  637. <div style="margin:0 0px 0 10px">
  638. <el-button size="small" type="primary" @click="listSynchronize" :loading="synchronizeLoading">{{ $t('synchronizefromStaple') }}</el-button>
  639. <el-button size="small" type="primary" @click="exportLeaveList" :loading="exporLoading">{{ $t('dao-chu-jia-qi') }}</el-button>
  640. </div>
  641. </template>
  642. </div>
  643. <el-table key="apk2is8" v-loading="loading" :data="vacationList" style="width: 100%" height="94%">
  644. <el-table-column prop="name" :label="$t('screening.employeename')" min-width="120" fixed="left"></el-table-column>
  645. <el-table-column :label="$t('periodofvalidity')" min-width="250" align="center">
  646. <template slot-scope="scope">
  647. <span>{{scope.row.startTime == null && scope.row.endTime == null ? '~ ~' : (scope.row.startTime + '\u3000~\u3000' + scope.row.endTime)}}</span>
  648. </template>
  649. </el-table-column>
  650. <el-table-column :label="$t('combination')" min-width="100" align="center">
  651. <template slot-scope="scope">
  652. <span>{{scope.row.quotaInDays == null && scope.row.quotaInHours == null ? '-' : (scope.row.quotaInDays == null ? scope.row.quotaInHours + $t('time.hour') : scope.row.quotaInDays + $t('time.day'))}}</span>
  653. </template>
  654. </el-table-column>
  655. <el-table-column :label="$t('beenused')" min-width="100" align="center">
  656. <template slot-scope="scope">
  657. <span>{{scope.row.usedInDays == null && scope.row.usedInHours == null ? '-' : (scope.row.usedInDays == null ? scope.row.usedInHours + $t('time.hour') : scope.row.usedInDays + $t('time.day'))}}</span>
  658. </template>
  659. </el-table-column>
  660. <el-table-column :label="$t('remainingamount')" min-width="100" align="center">
  661. <template slot-scope="scope">
  662. <span>{{scope.row.leftInDays == null && scope.row.leftInHours == null ? '-' : (scope.row.leftInDays == null ? scope.row.leftInHours + $t('time.hour') : scope.row.leftInDays + $t('time.day'))}}</span>
  663. </template>
  664. </el-table-column>
  665. </el-table>
  666. <div class="poss">
  667. <el-pagination
  668. @size-change="vacationSizeChange"
  669. @current-change="vacationCurrentChange"
  670. :current-page="page"
  671. :page-sizes="[50]"
  672. :page-size="50"
  673. layout="total, sizes, prev, pager, next"
  674. :total="total">
  675. </el-pagination>
  676. </div>
  677. </div>
  678. </div>
  679. <!-- --------- -->
  680. </div>
  681. <!-- 请假单详情 -->
  682. <el-dialog :title="$t('leaveForm')" :visible.sync="dialog" width="1000px" @close="bangd()">
  683. <!-- 表单 -->
  684. <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
  685. <!-- 请假人 -->
  686. <el-form-item :label="$t('leavepeople')" prop="ownerId" style="width: 300px;display: inline-block;">
  687. <!--普通员工只能自己填报自己的 -->
  688. <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.ownerId" @change="selts()" :placeholder="$t('pleaseselectthepersonaskingforleave')" style="width: 240px" :disabled="true" filterable="true">
  689. <span v-for="(item, index) in users" :key="index">
  690. <el-option :label="item.name" :value="item.id"></el-option>
  691. </span>
  692. </el-select>
  693. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :subject="users" :subjectId="addForm.ownerId" :disabled="true" :distinction="'4'" :filterable="false" @selectCal="selectCal"></selectCat>
  694. </el-form-item>
  695. <!-- 电话 -->
  696. <el-form-item :label="$t('phone')" prop="tel" style="width: 300px;display: inline-block;">
  697. <el-input ref="ipts" v-model="addForm.tel" :placeholder="$t('defaultText.PleaseEnterYourPhone')" style="width: 250px;"></el-input>
  698. </el-form-item>
  699. <!-- 单选 -->
  700. <el-form-item style="display: block" :label="$t('lengthunit')">
  701. <el-radio-group v-model="addForm.timeType" @change="chanRadio()">
  702. <el-radio label="0">{{ $t('accordingdays') }}</el-radio>
  703. <el-radio label="1">{{ $t('leavehour') }}</el-radio>
  704. </el-radio-group>
  705. </el-form-item>
  706. <!-- 时间选择 -->
  707. <el-form-item :label="flg ? $t('optiondate') : $t('other.timeSelection')" style="width: 74%;margin-right:500px">
  708. <el-col :span="9">
  709. <el-date-picker v-if="flg" type="date" :placeholder="$t('time.startDate')" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @blur="datas()"></el-date-picker>
  710. <el-date-picker v-else type="date" :placeholder="$t('time.startDate')" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @change="datasss()"></el-date-picker>
  711. </el-col>
  712. <el-col class="line" v-if="flg" :span="2">-</el-col>
  713. <el-col :span="9">
  714. <el-date-picker v-if="flg" type="date" :placeholder="$t('time.endDate')" value-format="yyyy-MM-dd" :picker-options="pickerOptionsEnd" v-model="addForm.endDate" style="width: 250px;" @blur="datas()"></el-date-picker>
  715. <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  716. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  717. </el-select> -->
  718. </el-col>
  719. </el-form-item>
  720. <!-- 请假天数 -->
  721. <el-form-item :label="flg ? $t('leavedays') : $t('leavetime')" prop="timeDays" style="margin-right: 500px">
  722. <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
  723. <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
  724. <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> {{ $t('time.day') }}</div>
  725. <div v-else>
  726. <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> {{ $t('time.hour') }}
  727. </div>
  728. </el-form-item>
  729. <!-- 备注 -->
  730. <el-form-item :label="$t('bei-zhu')" style="width: 100%">
  731. <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 62%" maxlength="100" show-word-limit></el-input>
  732. </el-form-item>
  733. </el-form>
  734. <span slot="footer" class="dialog-footer">
  735. <el-button @click="dialog = false">{{ $t('btn.cancel') }}</el-button>
  736. <el-button type="primary" @click="determine()">{{ $t('btn.determine') }}</el-button>
  737. </span>
  738. </el-dialog>
  739. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyDialogV" :visible.sync="denyDialogV" :close-on-click-modal="false" customClass="customWidth" width="500px">
  740. <div>
  741. <el-input type="textarea" v-model="denyInfo.reason" rows="2" :placeholder="$t('reasonforyourdecisiontoreject')" />
  742. </div>
  743. <div slot="footer" class="dialog-footer">
  744. <el-button @click="denyDialogV = false" >{{ $t('btn.cancel') }}</el-button>
  745. <el-button type="primary" @click="submitDeny()" >{{ $t('btn.determine') }}</el-button>
  746. </div>
  747. </el-dialog>
  748. <el-dialog :title="$t('dismissreason')" v-if="denyReasonVisible" :visible.sync="denyReasonVisible" customClass="customWidth" width="400px">
  749. <div style="padding:20px 40px 20px 0">
  750. <el-timeline :reverse="false">
  751. <el-timeline-item v-for="item in auditLogList" :key="item.id" :timestamp="item.indate">
  752. <span v-if="user.userNameNeedTranslate == 1"><TranslationOpenDataText type='userName' :openid='item.auditorName'></TranslationOpenDataText> </span>
  753. <span v-if="user.userNameNeedTranslate == 0">{{item.auditorName}}</span>
  754. <span> {{item.isPass==0?$t('boHuiLeQingJiaShenQing'):$t('state.approved')}}</span>
  755. <span v-if="item.isPass == 0">{{ $t('other.reason') }} :{{item.denyReason}}</span>
  756. </el-timeline-item>
  757. </el-timeline>
  758. </div>
  759. </el-dialog>
  760. <!-- <el-dialog title="审批流程" v-if="denyReasonVisible" :visible.sync="denyReasonVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  761. <div>
  762. <el-steps direction="vertical" >
  763. <el-step v-for="item in auditLogList" :title="item.auditorName" description="这是一段很长很长很长的描述性文字"></el-step>
  764. </el-steps>
  765. </div>
  766. <div slot="footer" class="dialog-footer">
  767. <el-button @click="denyReasonVisible = false" >{{ $t('btn.cancel') }}</el-button>
  768. </div>
  769. </el-dialog> -->
  770. </section>
  771. </template>
  772. <script>
  773. import { config, error } from 'dingtalk-jsapi';
  774. // 自定义select组件
  775. import selectCat from "@/components/select.vue"
  776. import Select from '../../components/select.vue';
  777. import selectPersonnel from '../../components/selectPersonnel.vue';
  778. // 引入自定义级联组件
  779. import vueCascader from "@/components/cascader.vue"
  780. export default {
  781. name: "expense",
  782. components: {
  783. selectCat,
  784. Select,
  785. vueCascader,
  786. selectPersonnel
  787. },
  788. props: {},
  789. data() {
  790. //验证手机号
  791. var checkTel = (rule, value, callback) =>{
  792. if (!value) {
  793. return callback(new Error(this.$t('phonenumbercannotbeempty')));
  794. } else {
  795. const reg = /^1[3|4|5|7|8|9][0-9]\d{8}$/
  796. if (reg.test(value)) {
  797. callback();
  798. } else {
  799. return callback(new Error(this.$t('pleaseenterthecorrectcellphonenumber')));
  800. }
  801. }
  802. };
  803. var checks = (rule, value, callback) => {
  804. if (!value) {
  805. return callback(new Error(this.$t('leavedayscannotbeempty')));
  806. } else {
  807. if (value > this.timeChoose) {
  808. return callback(new Error(this.$t('daysbeyondthecurrentlyselecteddat')));
  809. } else {
  810. callback();
  811. }
  812. }
  813. };
  814. return {
  815. denyDialogV: false,
  816. denyInfo: {},
  817. addFormRules: {
  818. ownerId: [{ required: true, message: this.$t('pleaseselectthepersonaskingforleave'), trigger: "blur" }],
  819. tel: [{required: true, validator: checkTel, trigger: 'blur'}],
  820. timeDays: [{required: true, validator: checks, trigger: 'blur'}],
  821. leaveType: [{ required: true, message: this.$t('pleaseselectthetypeofleave'), trigger: "blur" }]
  822. },
  823. user: JSON.parse(sessionStorage.getItem("user")),
  824. shuz: [this.$t('personalleaveisallowed'), this.$t('leaveisallowed'), this.$t('annualleaveisallowed'), this.$t('maternityleaveisallowed')],
  825. ins: 0,
  826. addForm: {
  827. timeType: '0',
  828. startDate: this.getCurrentTime(),
  829. endDate: this.getCurrentTime(),
  830. timeDays: 1,
  831. leaveType: 0,
  832. ownerId: '',
  833. // indate: this.getCurrentTime(),
  834. timeHours: 8,
  835. tel: '',
  836. remark: ''
  837. },
  838. displayTable: false,
  839. users: [], // 人员信息
  840. flg: true,
  841. createDate: [],
  842. pickerOptionsEnd: {
  843. disabledDate: (time) => {
  844. if (this.addForm.startDate) {
  845. return time.getTime() < new Date(this.addForm.startDate).getTime() - 86400000;
  846. }
  847. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  848. },
  849. },
  850. pickerOptionsEnds: {
  851. disabledDate: (time) => {
  852. if (this.statData) {
  853. return time.getTime() < new Date(this.statData).getTime() - 86400000;
  854. }
  855. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  856. },
  857. },
  858. options: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
  859. tableData: [],
  860. page: 1,
  861. size: 20,
  862. isAuditList: '',
  863. total:0,
  864. apk: false,
  865. keyword: '',
  866. userId:'',
  867. statData: this.getCurrentTimes(),
  868. endData: this.getCurrentTime(),
  869. statisticalList: [],
  870. restTimeList:[],
  871. loading: false,
  872. timeChoose: 1,
  873. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  874. typess: [{name: this.$t('leave.personalLeave'),id: 0},{name: this.$t('leave.sickLeave'),id: 1},{name: this.$t('leave.annualLeave'),id: 2},{name: this.$t('leave.maternityLeave'),id: 3},{name: this.$t('leave.marriageLeave'),id: 4},{name: this.$t('leave.bereavementLeave'),id: 5},{name: this.$t('leave.leave'),id: 6},{name: this.$t('leave.paternityLeave'),id: 7},{name: this.$t('leave.other'), id: 8}],
  875. statuss: [{
  876. name: this.$t('state.approved'),
  877. id: 0
  878. },{
  879. name: this.$t('state.WaitingAudit'),
  880. id: 1
  881. },{
  882. name: this.$t('btn.rejected'),
  883. id: 2
  884. },{
  885. name: this.$t('state.undone'),
  886. id: 3
  887. }],
  888. createDatelis: '',
  889. ownerIds: '',
  890. type: '',
  891. code: '',
  892. falg: 0,
  893. dialog: false,
  894. adform: {},
  895. affId: '',
  896. qjType: [
  897. {name: this.$t('leave.personalLeave'), id: 0},
  898. {name: this.$t('leave.sickLeave'), id: 1},
  899. {name: this.$t('leave.annualLeave'), id: 2},
  900. {name: this.$t('leave.maternityLeave'), id: 3},
  901. {name: this.$t('leave.marriageLeave'), id: 4},
  902. {name: this.$t('leave.bereavementLeave'), id: 5},
  903. {name: this.$t('leave.leave'), id: 6},
  904. {name: this.$t('leave.paternityLeave'), id: 7},
  905. {name: this.$t('leave.other'), id: 8}
  906. ],
  907. //
  908. apk2: false,
  909. sdata:[],
  910. dataArray:[],
  911. sdefaultProps: {
  912. children: 'children',
  913. label: 'label'
  914. },
  915. depData: null,
  916. isAdd : false,
  917. sindex : 0,
  918. curDeptId : null,
  919. curUserId : null,
  920. dialogVisible: false,
  921. soption : null,
  922. Alshow: false,
  923. Alchange: {yearDays:null,userId:null},
  924. AlchangeP: [],
  925. susers: [],
  926. keywordAl: '',
  927. NcurDeptId:[],
  928. Nsdata : [],
  929. AlData : [],
  930. iAlDataS: [],
  931. iAlData : [],
  932. // ---------
  933. txselnum: 0,
  934. txselnumTwo: 0,
  935. approverList: [],
  936. isSyncData: 0,
  937. vacationList: [],
  938. leaveTypeList: [],
  939. leaveTypeItem: '',
  940. departmentOptions: [],
  941. departmentSel: [],
  942. userSelId: '',
  943. synchronizeLoading: false,
  944. kuanBl: 0,
  945. hubs: 0,
  946. vueCasaderItem: [], // 仿数据
  947. vueIAlDataSItems: undefined, // 仿数据
  948. exporLoading: false,
  949. addNodeObj: {},
  950. curWorkflowList:{},
  951. denyReasonVisible : false,
  952. auditLogList:[],
  953. selectedAuuid: '',
  954. syncLeaveLoading:false,
  955. };
  956. },
  957. computed: {},
  958. watch: {},
  959. created() {
  960. let widTHBul = document.documentElement.clientWidth - 440
  961. this.kuanBl = widTHBul
  962. this.hubs = (document.documentElement.clientHeight || document.body.clientHeight) - 70
  963. let height = window.innerHeight;
  964. this.tableHeight = height - 195;
  965. const that = this;
  966. window.onresize = function temp() {
  967. that.tableHeight = window.innerHeight - 195;
  968. };
  969. // console.log('user',this.user);
  970. this.isSyncData = this.user.timeType.syncDingding || this.user.timeType.syncFanwei;
  971. },
  972. mounted() {
  973. if(this.isSyncData){
  974. this.bills(false,2)
  975. this.staffs(7,['7'])
  976. this.getUsers()
  977. }else{
  978. this.getUsers() // 获取人员信息
  979. this.getDepartment();
  980. this.getAl();
  981. this.getAuditWorkflow();
  982. }
  983. },
  984. filters: {},
  985. methods: {
  986. showDenyReason(sheetId) {
  987. this.denyReasonVisible = true;
  988. this.auditLogList = [];
  989. this.http.post('/leave-audit-log/getBySheetId',{sheetId: sheetId},
  990. res => {
  991. if(res.code == 'ok'){
  992. this.auditLogList = res.data;
  993. }else{
  994. this.$message({
  995. message: res.msg,
  996. type: 'error'
  997. })
  998. }
  999. },err => {
  1000. this.$message({
  1001. message: err,
  1002. type: 'error'
  1003. })
  1004. })
  1005. },
  1006. //获取添加请假单时的审批流
  1007. getAuditWorkflow() {
  1008. this.http.post('/audit-workflow-setting/get',{userId: this.user.id, type: 1},
  1009. res => {
  1010. if(res.code == 'ok'){
  1011. this.curWorkflowList = res.data;
  1012. }else{
  1013. this.$message({
  1014. message: res.msg,
  1015. type: 'error'
  1016. })
  1017. }
  1018. },err => {
  1019. this.$message({
  1020. message: err,
  1021. type: 'error'
  1022. })
  1023. })
  1024. },
  1025. // 导出请假单
  1026. exportLeave(){
  1027. let param = {}
  1028. if(this.code !== ''){
  1029. param.status = this.code
  1030. }
  1031. if(this.type !== ''){
  1032. param.leaveType = this.type
  1033. }
  1034. if(this.createDate && this.createDate.length){
  1035. param.startTime = this.createDate[0]
  1036. param.endTime = this.createDate[1]
  1037. }
  1038. // console.log(this.code,this.type,param);
  1039. // return
  1040. this.http.post('/leave-sheet/exportLeave',param,
  1041. res => {
  1042. if(res.code == 'ok'){
  1043. var filePath = res.data;
  1044. const a = document.createElement('a'); // 创建a标签
  1045. a.setAttribute('download', this.$t('qingJiaDan'));// download属性
  1046. a.setAttribute('href', filePath);// href链接
  1047. a.click(); //自执行点击事件
  1048. a.remove();
  1049. }else{
  1050. this.$message({
  1051. message: res.msg,
  1052. type: 'error'
  1053. })
  1054. }
  1055. },err => {
  1056. this.$message({
  1057. message: err,
  1058. type: 'error'
  1059. })
  1060. })
  1061. },
  1062. // 导出假期
  1063. exportLeaveList() {
  1064. this.exporLoading = true
  1065. let param = {
  1066. leaveCode: this.leaveTypeItem,
  1067. companyId: this.user.companyId,
  1068. // departmentId: this.departmentSel ? this.departmentSel[this.departmentSel.length - 1] : '',
  1069. }
  1070. let arrList = []
  1071. for(let i in this.departmentSel) {
  1072. arrList.push(this.departmentSel[i][this.departmentSel[i].length - 1])
  1073. }
  1074. console.log(arrList, '处理好的')
  1075. param.departmentId = arrList
  1076. if(this.userSelId != '') {
  1077. param.userId = this.userSelId
  1078. }
  1079. this.http.post('/user-yearleave-setting/exportDingDingLeaveQt',param,
  1080. res => {
  1081. this.exporLoading = false
  1082. if(res.code == 'ok'){
  1083. var filePath = res.data;
  1084. const a = document.createElement('a'); // 创建a标签
  1085. a.setAttribute('download', this.$t('shengYuJiaQi'));// download属性
  1086. a.setAttribute('href', filePath);// href链接
  1087. a.click(); //自执行点击事件
  1088. a.remove();
  1089. }else{
  1090. this.$message({
  1091. message: res.msg,
  1092. type: 'error'
  1093. })
  1094. }
  1095. },err => {
  1096. this.exporLoading = false
  1097. this.$message({
  1098. message: err,
  1099. type: 'error'
  1100. })
  1101. })
  1102. },
  1103. // 从钉钉同步假期剩余表
  1104. listSynchronize(){
  1105. this.synchronizeLoading = true
  1106. this.http.post('/dingding/syncLeaveQuotaData',{
  1107. companyId: this.user.companyId
  1108. },res => {
  1109. if(res.code == 'ok'){
  1110. this.synchronizeLoading = false
  1111. this.$message({
  1112. message: this.$t('synchronoussuccess'),
  1113. type: 'success'
  1114. })
  1115. this.getVacationList()
  1116. this.page = 1
  1117. this.departmentSel = []
  1118. this.userSelId = ''
  1119. }else {
  1120. this.synchronizeLoading = false
  1121. this.$message({
  1122. message: res.msg,
  1123. type: 'error'
  1124. })
  1125. }
  1126. },err => {
  1127. this.synchronizeLoading = false
  1128. this.$message({
  1129. message: err,
  1130. type: 'error'
  1131. })
  1132. })
  1133. },
  1134. // 获取部门列表
  1135. getDepartmentOptions(){
  1136. this.http.post(this.port.manage.depList,{
  1137. },res =>{
  1138. if(res.code == 'ok'){
  1139. // console.log('getDepartment',res.data);
  1140. this.departmentOptions = this.changeArr(res.data)
  1141. }else {
  1142. this.$message({
  1143. message: res.msg,
  1144. type: 'error'
  1145. })
  1146. }
  1147. },err => {
  1148. this.$message({
  1149. message: err,
  1150. type: 'error'
  1151. })
  1152. })
  1153. },
  1154. departmentOptionsChg(){
  1155. // console.log(this.departmentSel);
  1156. this.page = 1
  1157. this.getVacationList(1)
  1158. },
  1159. userChg(){
  1160. // console.log(this.userSelId);
  1161. this.page = 1
  1162. this.getVacationList(1)
  1163. },
  1164. // 获取剩余假期信息列表
  1165. getVacationList(e){
  1166. this.loading = true
  1167. let item = {}
  1168. if(e){
  1169. item = {
  1170. companyId: this.user.companyId,
  1171. pageIndex: this.page,
  1172. leaveCode: this.leaveTypeItem
  1173. }
  1174. console.log(this.departmentSel, '甚于')
  1175. // if(this.departmentSel.length != 0){
  1176. // item.departmentId = this.departmentSel[this.departmentSel.length - 1]
  1177. // }
  1178. let arrList = []
  1179. for(let i in this.departmentSel) {
  1180. arrList.push(this.departmentSel[i][this.departmentSel[i].length - 1])
  1181. }
  1182. console.log(arrList, '处理好的')
  1183. item.departmentId = arrList
  1184. if(this.userSelId != ''){
  1185. item.userId = this.userSelId
  1186. }
  1187. // if()
  1188. }else{
  1189. item = {
  1190. companyId: this.user.companyId,
  1191. // leaveCode: '',
  1192. // userId: '',
  1193. pageIndex: this.page,
  1194. // departmentId: ''
  1195. }
  1196. }
  1197. this.http.post('/user-yearleave-setting/getDingDingLeaveQt',item,
  1198. res => {
  1199. if(res.code == 'ok'){
  1200. this.vacationList = res.data.records
  1201. this.total = res.data.total
  1202. if(!e){
  1203. this.leaveTypeList = res.data.leaveTypeList
  1204. this.leaveTypeItem = res.data.defaultLeaveType.leaveCode
  1205. }
  1206. this.loading = false
  1207. }else {
  1208. this.loading = false
  1209. this.$message({
  1210. message: res.msg,
  1211. type: 'error'
  1212. })
  1213. }
  1214. },err => {
  1215. this.loading = false
  1216. this.$message({
  1217. message: err,
  1218. type: 'error'
  1219. })
  1220. })
  1221. },
  1222. leaveTypeChange(){
  1223. // console.log(this.leaveTypeItem);
  1224. this.page = 1
  1225. this.getVacationList(1)
  1226. },
  1227. changeAltime(e){
  1228. if(e == 0 && this.AlchangeP.length == 0){
  1229. this.$message(this.$t('selecttheitemsyouwanttobatchset'))
  1230. return
  1231. }else if(e != 0){
  1232. this.Alchange = JSON.parse(JSON.stringify(e))
  1233. }
  1234. this.Alshow = true
  1235. },
  1236. selPchg(e){
  1237. this.AlchangeP = e
  1238. },
  1239. searchAl(){
  1240. this.iAlDataS = []
  1241. for (let i = 0; i < this.iAlData.length; i++) {
  1242. if (this.iAlData[i].userName.indexOf(this.keywordAl) != -1) {
  1243. this.iAlDataS.push(this.iAlData[i])
  1244. }
  1245. }
  1246. },
  1247. clearsearchAl(){
  1248. this.iAlDataS = this.iAlData
  1249. },
  1250. delAltime(){
  1251. this.Alshow = false
  1252. this.Alchange = {yearDays:null,userId:null}
  1253. },
  1254. chgAltime(){
  1255. let chgPar = {}
  1256. let userids = ''
  1257. let Alpost = ''
  1258. if(this.Alchange.userId == null && this.AlchangeP != []){
  1259. Alpost = "/user-yearleave-setting/saveBatch"
  1260. for (let i = 0; i < this.AlchangeP.length; i++) {
  1261. userids = userids + "," + this.AlchangeP[i].userId
  1262. }
  1263. chgPar = {userIds: userids.slice(1), companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
  1264. }else {
  1265. Alpost = "/user-yearleave-setting/save"
  1266. userids = this.Alchange.userId
  1267. chgPar = {userId: userids, companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
  1268. }
  1269. this.http.post(Alpost,chgPar,
  1270. res => {
  1271. if(res.code == "ok"){
  1272. this.Alshow = false,
  1273. this.Alchange = {yearDays:null,userId:null},
  1274. this.AlchangeP = []
  1275. this.getAl()
  1276. }else{
  1277. this.$message({
  1278. message: res.msg,
  1279. type: "error"
  1280. })
  1281. }
  1282. },
  1283. error => {
  1284. this.Alshow = false
  1285. this.$message({
  1286. message: error,
  1287. type: "error"
  1288. })
  1289. }
  1290. )
  1291. },
  1292. getAl(){
  1293. this.http.get('/user-yearleave-setting/list',
  1294. res => {
  1295. if(res.code == "ok"){
  1296. this.iAlData = res.data
  1297. this.iAlDataS = this.iAlData
  1298. if(this.apk2 == 6){
  1299. this.selAl()
  1300. }
  1301. } else {
  1302. this.$message({
  1303. message: res.msg,
  1304. type: "error"
  1305. })
  1306. }
  1307. },
  1308. error => {
  1309. this.Alshow = false
  1310. this.$message({
  1311. message: error,
  1312. type: "error"
  1313. })
  1314. }
  1315. )
  1316. },
  1317. selAl(){
  1318. let e = this.user.userNameNeedTranslate != 1 ? this.$refs.selectAl.getCheckedNodes()[0] : this.vueIAlDataSItems
  1319. if(e == undefined){
  1320. this.iAlDataS = this.iAlData
  1321. }else{
  1322. this.iAlDataS = []
  1323. for (let i = 0; i < this.iAlData.length; i++) {
  1324. if (e.label == this.iAlData[i].department) {
  1325. this.iAlDataS.push(this.iAlData[i])
  1326. }
  1327. }
  1328. }
  1329. },
  1330. // ---------
  1331. handleNodeClick(data) {
  1332. if(this.depData == null || data.id != this.depData.id) {
  1333. this.depData = data;
  1334. // console.log("depdata",this.depData);
  1335. this.getSettings();
  1336. }
  1337. },
  1338. getSettings() {
  1339. this.http.post('/audit-workflow-setting/get',{deptId: this.depData.id,type: 1},
  1340. res => {
  1341. this.listLoading = false;
  1342. if (res.code == "ok") {
  1343. this.dataArray = res.data;
  1344. // console.log("请求1",res.data);
  1345. } else {
  1346. this.$message({
  1347. message: res.msg,
  1348. type: "error"
  1349. });
  1350. }
  1351. },
  1352. error => {
  1353. this.listLoading = false;
  1354. this.$message({
  1355. message: error,
  1356. type: "error"
  1357. });
  1358. }
  1359. );
  1360. },
  1361. // 获取部门列表
  1362. getDepartment() {
  1363. this.http.post( this.port.manage.depList, {},
  1364. res => {
  1365. if (res.code == "ok") {
  1366. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  1367. this.sdata = list;
  1368. this.soption = [
  1369. {value: 1 , label : this.$t('lable.department') , children : this.changeArr(list1), type: 'dep', id: 0},
  1370. {value: 2 , label : this.$t('designatedpersonnel'),children : this.susers, type: 'user', id: 0}
  1371. ]
  1372. console.log(this.soption, '选人的数据')
  1373. this.Nsdata = list1
  1374. } else {
  1375. this.$message({
  1376. message: res.msg,
  1377. type: "error"
  1378. });
  1379. }
  1380. },
  1381. error => {
  1382. this.$message({
  1383. message: error,
  1384. type: "error"
  1385. });
  1386. });
  1387. },
  1388. changeArr(arr) {
  1389. for (var i = 0; i < arr.length; i++) {
  1390. if(arr[i].id != -1 && arr[i].id != 0) {
  1391. if (arr[i].children != null && arr[i].children.length>0) {
  1392. arr[i].children = this.changeArr(arr[i].children);
  1393. }
  1394. arr[i].type = 'dep'
  1395. arr[i].id && (arr[i].value = arr[i].id);
  1396. delete arr[i].id;
  1397. }
  1398. }
  1399. for(var i in arr) {
  1400. if(arr[i].id == -1 || arr[i].id == 0) {
  1401. arr.splice(i,1)
  1402. }
  1403. }
  1404. return arr;
  1405. },
  1406. showNodeDialog(index) {
  1407. this.isAdd = true;
  1408. this.sindex = index;
  1409. this.curDeptId = null;
  1410. this.curUserId = null;
  1411. this.dialogVisible = true;
  1412. this.selectedAuuid = ''
  1413. },
  1414. editNodeDialog(index, item) {
  1415. //检查是否可编辑
  1416. this.http.post('/audit-workflow-setting/checkNodeInUse',{auditDeptId: item.auditDeptId, deptId: this.depData.id,type: 1},
  1417. res => {
  1418. this.listLoading = false;
  1419. if (res.code == "ok") {
  1420. this.isAdd = false;
  1421. this.sindex = index;
  1422. this.curUserId = item.userId;
  1423. this.curDeptId = item.auditDeptId;
  1424. this.selectedAuuid = item.userId || item.auditDeptId
  1425. console.log(this.selectedAuuid, '看看数据类')
  1426. this.dialogVisible = true;
  1427. } else {
  1428. this.$message({
  1429. message: res.msg,
  1430. type: "error"
  1431. });
  1432. }
  1433. },
  1434. error => {
  1435. this.listLoading = false;
  1436. this.$message({
  1437. message: error,
  1438. type: "error"
  1439. });
  1440. }
  1441. );
  1442. },
  1443. addNode() {
  1444. if (this.curDeptId == null) return;
  1445. // if(this.user.userNameNeedTranslate != '1') {
  1446. // var node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
  1447. // var node = this.$refs.deptCascader.getCheckedNodes()[0];
  1448. var node = ''
  1449. if(this.user.userNameNeedTranslate != 1) {
  1450. // node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
  1451. node = this.$refs.deptCascader.getCheckedNodes()[0];
  1452. } else {
  1453. node = this.addNodeObj
  1454. }
  1455. console.log(this.vueCasaderItem)
  1456. console.log("node",node);
  1457. let flgUserRadio = true
  1458. if(this.user.userNameNeedTranslate == 1) {
  1459. for(let s in this.dataArray) {
  1460. if(node.type == 'dep') {
  1461. if(this.dataArray[s].auditDeptName == node.label) {
  1462. flgUserRadio = false
  1463. }
  1464. } else {
  1465. if(this.dataArray[s].userName == node.label) {
  1466. flgUserRadio = false
  1467. }
  1468. }
  1469. }
  1470. }
  1471. if(!flgUserRadio) {
  1472. if(node.type == 'dep') {
  1473. this.$message({
  1474. message: this.$t('yi-cun-zai-zhong-fu-bu-men'),
  1475. type: "error"
  1476. });
  1477. } else {
  1478. this.$message({
  1479. message: this.$t('yi-cun-zai-zhong-fu-ren-yuan'),
  1480. type: "error"
  1481. });
  1482. }
  1483. return false
  1484. }
  1485. this.dialogVisible = false;
  1486. if (this.isAdd) {
  1487. if(this.user.userNameNeedTranslate != 1) {
  1488. var nodes
  1489. if(node.path[0] == 1){
  1490. nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1491. }else if(node.path[0] == 2){
  1492. nodes = {userId: node.value, userName: node.label, auditorType: 2};
  1493. }
  1494. } else {
  1495. if(node.type == 'dep') {
  1496. nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1497. } else {
  1498. nodes = {userId: node.value, userName: node.label, auditorType: 2};
  1499. }
  1500. }
  1501. this.dataArray.splice(this.sindex, 0, nodes);
  1502. } else {
  1503. //编辑
  1504. if(node.type == 'dep') {
  1505. this.dataArray[this.sindex].auditDeptId = node.value;
  1506. this.dataArray[this.sindex].auditDeptName = node.label;
  1507. this.dataArray[this.sindex].auditorType = 1
  1508. this.dataArray[this.sindex].userId = ''
  1509. this.dataArray[this.sindex].userName = ''
  1510. } else {
  1511. this.dataArray[this.sindex].userId = node.value;
  1512. this.dataArray[this.sindex].userName = node.label;
  1513. this.dataArray[this.sindex].auditDeptId = ''
  1514. this.dataArray[this.sindex].auditDeptName = ''
  1515. this.dataArray[this.sindex].auditorType = 2
  1516. }
  1517. }
  1518. console.log(this.dataArray, '数据')
  1519. },
  1520. deleteNode() {
  1521. this.dialogVisible = false;
  1522. this.dataArray.splice(this.sindex, 1);
  1523. },
  1524. submitInsert() {
  1525. if(this.dataArray.length > 0) {
  1526. this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id, type:1},
  1527. res => {
  1528. this.listLoading = false;
  1529. if (res.code == "ok") {
  1530. this.$message({
  1531. message: this.$t('savesuccess'),
  1532. type: "success"
  1533. });
  1534. } else {
  1535. this.$message({
  1536. message: res.msg,
  1537. type: "error"
  1538. });
  1539. }
  1540. },
  1541. error => {
  1542. this.listLoading = false;
  1543. this.$message({
  1544. message: error,
  1545. type: "error"
  1546. });
  1547. });
  1548. } else {
  1549. this.$message({
  1550. message: this.$t('zhi-shao-xuan-ze-yi-ge-bu-men-huo-zhe-ren-yuan-zuo-wei-shen-he-ren'),
  1551. type: "error"
  1552. });
  1553. }
  1554. },
  1555. //
  1556. approve(item) {
  1557. //审核通过
  1558. this.http.post('/leave-sheet/approve', {id:item.id
  1559. },
  1560. res => {
  1561. if (res.code == "ok") {
  1562. this.auditList();
  1563. this.$message({
  1564. message: this.$t('operationissuccessful'),
  1565. type: "success"
  1566. });
  1567. } else {
  1568. this.$message({
  1569. message: res.msg,
  1570. type: "error"
  1571. });
  1572. }
  1573. },
  1574. error => {
  1575. this.$message({
  1576. message: error,
  1577. type: "error"
  1578. });
  1579. });
  1580. },
  1581. deny(item) {
  1582. this.denyDialogV = true;
  1583. this.denyInfo = {id:item.id, reason:null};
  1584. },
  1585. syncLeave(){
  1586. this.syncLeaveLoading=true
  1587. this.http.post('/leave-sheet/syncLeaveSheet',{},
  1588. res => {
  1589. if (res.code == "ok") {
  1590. this.$message({
  1591. message: this.$t('operationissuccessful'),
  1592. type: "success"
  1593. });
  1594. } else {
  1595. this.$message({
  1596. message: res.msg,
  1597. type: "error"
  1598. });
  1599. }
  1600. this.syncLeaveLoading=false
  1601. },
  1602. error => {
  1603. this.$message({
  1604. message: error,
  1605. type: "error"
  1606. });
  1607. });
  1608. },
  1609. submitDeny(id) {
  1610. //审核驳回
  1611. this.http.post('/leave-sheet/deny', this.denyInfo,
  1612. res => {
  1613. if (res.code == "ok") {
  1614. this.auditList();
  1615. this.denyDialogV = false;
  1616. this.$message({
  1617. message: this.$t('operationissuccessful'),
  1618. type: "success"
  1619. });
  1620. } else {
  1621. this.$message({
  1622. message: res.msg,
  1623. type: "error"
  1624. });
  1625. }
  1626. },
  1627. error => {
  1628. this.$message({
  1629. message: error,
  1630. type: "error"
  1631. });
  1632. });
  1633. },
  1634. getUsers() {
  1635. this.http.post('/user/getSimpleActiveUserList', {},
  1636. res => {
  1637. if (res.code == "ok") {
  1638. // this.users = res.data.records;
  1639. this.users = res.data;
  1640. for (let i = 0; i < this.users.length; i++) {
  1641. this.susers.push({value:this.users[i].id,label:this.users[i].name,type: 'user'})
  1642. }
  1643. //只能自己填报自己的请假单
  1644. this.addForm.ownerId = this.user.id;
  1645. this.addForm.status = 1;
  1646. this.addForm.tel = this.user.phone
  1647. } else {
  1648. this.$message({
  1649. message: res.msg,
  1650. type: "error"
  1651. });
  1652. }
  1653. },
  1654. error => {
  1655. this.$message({
  1656. message: error,
  1657. type: "error"
  1658. });
  1659. });
  1660. },
  1661. // 员工请假填报点击事件
  1662. ssl(index) {
  1663. this.ins = index;
  1664. this.addForm.leaveType = index
  1665. },
  1666. staffs(key, keyPath) {
  1667. // console.log("keypath",key,keyPath)
  1668. if (keyPath[0] == '1') {
  1669. this.displayTable = false;
  1670. this.apk = false;
  1671. this.getAuditWorkflow();
  1672. } else if(keyPath[0] == '2' || keyPath[0] == '3') {
  1673. this.displayTable = true;
  1674. this.apk = false
  1675. } else if(keyPath[0] == '4'){
  1676. this.displayTable = true;
  1677. this.apk = true
  1678. this.apk2 = 4
  1679. this.statistical()
  1680. } else if(keyPath[0] == '5'){
  1681. this.displayTable = true;
  1682. this.apk2 = 5
  1683. this.apk = true
  1684. } else if(keyPath[0] == '6'){
  1685. this.NcurDeptId = []
  1686. this.displayTable = true;
  1687. this.apk2 = 6
  1688. this.apk = true
  1689. this.getAl()
  1690. } else if(keyPath[0] == '7'){
  1691. this.displayTable = true;
  1692. this.apk = false
  1693. this.bills(false,2)
  1694. } else if(keyPath[0] == '8'){
  1695. this.apk2 = 8
  1696. this.displayTable = true
  1697. this.apk = true
  1698. this.userSelId = ''
  1699. this.page = 1
  1700. this.departmentSel = []
  1701. this.getVacationList()
  1702. this.getDepartmentOptions()
  1703. } else if(keyPath[0] == '9'){
  1704. this.displayTable = true;
  1705. this.apk = true
  1706. this.apk2 = 9
  1707. this.restTime()
  1708. }
  1709. },
  1710. auditList() {
  1711. this.falg = 1
  1712. this.code = 1
  1713. this.tableData = []
  1714. this.displayTable = true;
  1715. this.isAuditList = true;
  1716. this.loading = true
  1717. this.page = '1'
  1718. var param = { pageIndex: this.page,
  1719. pageSize: this.size,
  1720. // createDate: this.createDate,
  1721. startDate: this.createDate == null ? '' : this.createDate[0],
  1722. endDate: this.createDate == null ? '' : this.createDate[1],
  1723. ownerId: this.ownerIds,
  1724. way: this.type,
  1725. };
  1726. this.list = [];
  1727. // this.total = 0;
  1728. this.http.post('/leave-sheet/auditList', param,
  1729. res => {
  1730. if (res.code == "ok") {
  1731. this.tableData = res.data.records
  1732. this.total = res.data.total
  1733. this.loading = false
  1734. } else {
  1735. this.loading = false
  1736. this.$message({
  1737. message: res.msg,
  1738. type: "error"
  1739. });
  1740. }
  1741. },
  1742. error => {
  1743. this.loading = false
  1744. this.$message({
  1745. message: error,
  1746. type: "error"
  1747. });
  1748. });
  1749. },
  1750. bills(audit, tr){
  1751. if(tr) {
  1752. this.code = ''
  1753. this.createDate = []
  1754. // this.ownerIds = ''
  1755. this.type = ''
  1756. if(tr == 1) {
  1757. this.falg = 1
  1758. this.code = 1
  1759. } else if(tr == 2) {
  1760. this.code = ''
  1761. this.falg = 0
  1762. } else {
  1763. this.falg = 0
  1764. }
  1765. } else {
  1766. this.falg = false
  1767. }
  1768. this.tableData = []
  1769. this.displayTable = true;
  1770. this.isAuditList = audit;
  1771. this.loading = true
  1772. this.page = '1'
  1773. var param = { pageIndex: this.page,
  1774. pageSize: this.size,
  1775. status: this.code,
  1776. // createDate: this.createDate,
  1777. startDate: this.createDate == null ? '' : this.createDate[0],
  1778. endDate: this.createDate == null ? '' : this.createDate[1],
  1779. ownerId: this.ownerIds,
  1780. leaveType: this.type,
  1781. };
  1782. if (this.isAuditList) {
  1783. param.status = 1;
  1784. }
  1785. this.list = [];
  1786. // this.total = 0;
  1787. this.http.post('/leave-sheet/list', param,
  1788. res => {
  1789. if (res.code == "ok") {
  1790. this.tableData = res.data.records
  1791. this.total = res.data.total
  1792. this.loading = false
  1793. } else {
  1794. this.loading = false
  1795. this.$message({
  1796. message: res.msg,
  1797. type: "error"
  1798. });
  1799. }
  1800. },
  1801. error => {
  1802. this.loading = false
  1803. this.$message({
  1804. message: error,
  1805. type: "error"
  1806. });
  1807. });
  1808. },
  1809. billss() {
  1810. var param = {pageIndex: this.page,
  1811. pageSize: this.size,
  1812. status: this.code,
  1813. // startDate: this.createDate,
  1814. startDate: this.createDate == null ? '' : this.createDate[0],
  1815. endDate: this.createDate == null ? '' : this.createDate[1],
  1816. ownerId: this.ownerIds,
  1817. leaveType: this.type,
  1818. };
  1819. this.http.post('/leave-sheet/list', param,
  1820. res => {
  1821. if (res.code == "ok") {
  1822. this.tableData = res.data.records
  1823. this.total = res.data.total
  1824. this.loading = false
  1825. } else {
  1826. this.loading = false
  1827. this.$message({
  1828. message: res.msg,
  1829. type: "error"
  1830. });
  1831. }
  1832. },
  1833. error => {
  1834. this.loading = false
  1835. this.$message({
  1836. message: error,
  1837. type: "error"
  1838. });
  1839. });
  1840. },
  1841. // 判断日期是否补零了
  1842. buling(das) {
  1843. var rqi = das.split('-')
  1844. rqi[1].length <= 1 ? rqi[1] = '0' + rqi[1] : rqi[1] = rqi[1]
  1845. rqi[2].length <= 1 ? rqi[2] = '0' + rqi[2] : rqi[2] = rqi[2]
  1846. var zong = rqi[0] + '-' + rqi[1] + '-' + rqi[2]
  1847. return zong
  1848. },
  1849. submits(){
  1850. // return
  1851. this.$refs.addForm.validate(valid => {
  1852. this.addForm.endDate = this.buling(this.addForm.endDate)
  1853. this.addForm.startDate = this.buling(this.addForm.startDate)
  1854. if (valid) {
  1855. this.http.post('/leave-sheet/add', this.addForm,
  1856. res => {
  1857. if (res.code == "ok") {
  1858. this.$message({
  1859. message: this.$t('message.fillinsuccessfully'),
  1860. type: "success"
  1861. });
  1862. this.addForm.timeType = '0'
  1863. this.addForm.startDate = this.getCurrentTime()
  1864. this.addForm.endDate = this.getCurrentTime()
  1865. this.addForm.timeDays = 1
  1866. this.addForm.leaveType = 0
  1867. this.addForm.timeHours = 8
  1868. this.addForm.remark = ''
  1869. this.flg = true
  1870. } else {
  1871. this.$message({
  1872. message: res.msg,
  1873. type: "error"
  1874. });
  1875. }
  1876. },
  1877. error => {
  1878. this.$message({
  1879. message: error,
  1880. type: "error"
  1881. });
  1882. });
  1883. } else {
  1884. return false;
  1885. }
  1886. });
  1887. },
  1888. txselts(a,b){
  1889. this.selts()
  1890. // console.log('txselts',this.addForm.ownerId);
  1891. if(a == 6 && this.addForm.ownerId != ''){
  1892. this.http.post('/leave-sheet/getOTAvaiDays',{ userId:b },
  1893. res => {
  1894. if(res.code == "ok") {
  1895. // console.log('post',res.data);
  1896. if(res.data < 0.5){
  1897. this.txselnum = 0
  1898. }else{
  1899. this.txselnum = res.data.toFixed(1)
  1900. }
  1901. this.txselnumTwo = res.data
  1902. } else {
  1903. this.$message({
  1904. message: res.msg,
  1905. type: "error"
  1906. });
  1907. }
  1908. },
  1909. error => {
  1910. this.$message({
  1911. message: error,
  1912. type: "error"
  1913. });
  1914. })
  1915. }
  1916. },
  1917. selts() {
  1918. for(var i in this.users) {
  1919. if(this.users[i].id == this.addForm.ownerId) {
  1920. this.addForm.tel = this.users[i].phone
  1921. }
  1922. }
  1923. },
  1924. chanRadio() {
  1925. // console.log(this.addForm.timeType)
  1926. if(this.addForm.timeType == '0') {
  1927. this.flg = true
  1928. this.addForm.startDate = this.getCurrentTime()
  1929. this.addForm.endDate = this.getCurrentTime()
  1930. this.addForm.timeType = '0'
  1931. this.addForm.timeDays = '1'
  1932. this.addForm.timeHours = '8'
  1933. this.txselnum = this.txselnumTwo > 0.5 ? this.txselnumTwo.toFixed(1) : 0
  1934. } else {
  1935. this.flg = false
  1936. this.addForm.startDate = this.getCurrentTime()
  1937. this.addForm.endDate = this.getCurrentTime()
  1938. this.addForm.timeType = '1'
  1939. this.addForm.timeHours = 1,
  1940. this.addForm.timeDays = 1
  1941. this.txselnum = this.dayToHourConversion(this.txselnumTwo)
  1942. }
  1943. },
  1944. dayToHourConversion(val) {
  1945. let value = +val;
  1946. let workHours = 8;
  1947. let result = value * workHours;
  1948. return result.toFixed(1);
  1949. },
  1950. // 计算日期
  1951. datas() {
  1952. // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)
  1953. if(this.addForm.startDate > this.addForm.endDate) {
  1954. this.addForm.endDate = this.addForm.startDate
  1955. }
  1956. this.addForm.timeDays = this.countWorkDay(this.addForm.startDate, this.addForm.endDate)
  1957. this.timeChoose = this.addForm.timeDays
  1958. this.addForm.timeHours = this.addForm.timeDays * 8
  1959. // 调用接口获取请假天数
  1960. let startDateData = this.buling(this.addForm.startDate)
  1961. let endDateData = this.buling(this.addForm.endDate)
  1962. this.http.post('/leave-sheet/leaveDays', {
  1963. startDate: startDateData,
  1964. endDate: endDateData
  1965. },
  1966. res => {
  1967. if (res.code == "ok") {
  1968. this.addForm.timeDays = res.data
  1969. this.timeChoose = res.data
  1970. } else {
  1971. this.$message({
  1972. message: res.msg,
  1973. type: "error"
  1974. });
  1975. }
  1976. },
  1977. error => {
  1978. this.$message({
  1979. message: error,
  1980. type: "error"
  1981. });
  1982. });
  1983. },
  1984. datasss() {
  1985. // console.log(123)
  1986. this.addForm.endDate = this.addForm.startDate
  1987. },
  1988. DateDiff(sDate1, sDate2){
  1989. var aDate, oDate1, oDate2, iDays
  1990. aDate = sDate1.split("-")
  1991. oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1992. aDate = sDate2.split("-")
  1993. oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1994. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24)
  1995. return iDays + 1
  1996. },
  1997. stringToDate(dateString){
  1998. dateString = dateString.split('-');
  1999. return new Date(dateString[0], dateString[1] - 1, dateString[2]);
  2000. },
  2001. countWorkDay(date1, date2){
  2002. date1 = this.stringToDate(date1);
  2003. date2 = this.stringToDate(date2);
  2004. var delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1; // 计算出总时间
  2005. var weeks = 0;
  2006. for(var i = 0; i < delta; i++){
  2007. if(date1.getDay() == 0 || date1.getDay() == 6) weeks ++; // 若为周六或周天则加1
  2008. date1 = date1.valueOf();
  2009. date1 += 1000 * 60 * 60 * 24;
  2010. date1 = new Date(date1);
  2011. }
  2012. return delta - weeks;
  2013. },
  2014. chufas() {
  2015. this.billss()
  2016. },
  2017. // 时间
  2018. getTadeTime() {
  2019. var time = new Date();
  2020. return time.getHours() +':00:00'
  2021. },
  2022. // 日期
  2023. getCurrentTime() {
  2024. var _this = this;
  2025.   let yy = new Date().getFullYear();
  2026.   let mm = new Date().getMonth()+1;
  2027.   let dd = new Date().getDate();
  2028.   _this.gettime = yy +'-'+ mm +'-'+ dd;
  2029.   return _this.gettime
  2030. },
  2031. getCurrentTimes() {
  2032. var _this = this;
  2033.   let yy = new Date().getFullYear();
  2034.   let mm = new Date().getMonth()+1;
  2035.   let dd = new Date().getDate();
  2036.   _this.gettime = yy+'-'+mm+'-'+'01';
  2037.   return _this.gettime
  2038. },
  2039. chanSele() {
  2040. this.addForm.timeHours = parseInt(this.addForm.timeHours)
  2041. },
  2042. handleSizeChange(val){
  2043. this.page = 1
  2044. this.size = val;
  2045. this.bills()
  2046. },
  2047. handleCurrentChange(val) {
  2048. // console.log(val, 1, '1')
  2049. this.page = val;
  2050. this.bills()
  2051. },
  2052. vacationSizeChange(val){
  2053. this.size = val
  2054. this.getVacationList(1)
  2055. },
  2056. vacationCurrentChange(val){
  2057. this.page = val
  2058. this.getVacationList(1)
  2059. },
  2060. statistical() {
  2061. this.loading = true
  2062. this.http.post('/leave-sheet/summaryData', {
  2063. keyword: this.keyword,
  2064. startDate: this.statData,
  2065. endDate: this.endData
  2066. },
  2067. res => {
  2068. if (res.code == "ok") {
  2069. this.statisticalList = res.data
  2070. this.loading = false
  2071. } else {
  2072. this.loading = false
  2073. this.$message({
  2074. message: res.msg,
  2075. type: "error"
  2076. });
  2077. }
  2078. },
  2079. error => {
  2080. this.$message({
  2081. message: error,
  2082. type: "error"
  2083. });
  2084. });
  2085. },
  2086. restTime() {
  2087. this.loading = true
  2088. this.http.post('/leave-sheet/getCompanyUserTime', {
  2089. userId: this.userId,
  2090. },
  2091. res => {
  2092. if (res.code == "ok") {
  2093. this.restTimeList = res.data
  2094. this.loading = false
  2095. } else {
  2096. this.loading = false
  2097. this.$message({
  2098. message: res.msg,
  2099. type: "error"
  2100. });
  2101. }
  2102. },
  2103. error => {
  2104. this.$message({
  2105. message: error,
  2106. type: "error"
  2107. });
  2108. });
  2109. },
  2110. //
  2111. inputs() {
  2112. var str = this.addForm.timeDays + ''
  2113. if(str.indexOf('.') != '-1') {
  2114. var s = str.split('.')[0]
  2115. var st = str.split('.')[1]
  2116. var sts = st.split('')
  2117. this.addForm.timeDays = s + '.' + sts[0]
  2118. }
  2119. },
  2120. inputss() {
  2121. if(this.addForm.timeHours <= 0) {
  2122. this.addForm.timeHours = 1
  2123. } else if(this.addForm.timeHours > 8) {
  2124. this.addForm.timeHours = 8
  2125. } else {
  2126. if(this.addForm.timeHours.indexOf('.') != '-1') {
  2127. var str = this.addForm.timeHours
  2128. // console.log(str)
  2129. if(str.indexOf('.') != '-1') {
  2130. var s = str.split('.')[0]
  2131. var st = str.split('.')[1]
  2132. var sts = st.split('')
  2133. this.addForm.timeHours = s + '.' + sts[0]
  2134. }
  2135. }
  2136. }
  2137. // console.log(this.addForm)
  2138. },
  2139. cancel(e) {
  2140. this.$confirm(this.$t('queDingYaoCheHuiGaiQingJiaShenQingMa'), this.$t('other.prompts'), {
  2141. //type: 'warning'
  2142. }).then(() => {
  2143. this.http.post('/leave-sheet/cancel', {id:e.id},
  2144. res => {
  2145. if (res.code == "ok") {
  2146. this.bills();
  2147. this.$message({
  2148. message: this.$t('operationissuccessful'),
  2149. type: "success"
  2150. });
  2151. } else {
  2152. this.$message({
  2153. message: res.msg,
  2154. type: "error"
  2155. });
  2156. }
  2157. },
  2158. error => {
  2159. this.$message({
  2160. message: error,
  2161. type: "error"
  2162. });
  2163. });
  2164. });
  2165. },
  2166. deletes(e) {
  2167. this.$confirm(this.$t('deleteit'), this.$t('other.prompts'), {
  2168. //type: 'warning'
  2169. }).then(() => {
  2170. this.http.post('/leave-sheet/delete', {id:e.id},
  2171. res => {
  2172. if (res.code == "ok") {
  2173. this.bills();
  2174. this.$message({
  2175. message: this.$t('message.successfullyDeleted'),
  2176. type: "success"
  2177. });
  2178. } else {
  2179. this.$message({
  2180. message: res.msg,
  2181. type: "error"
  2182. });
  2183. }
  2184. },
  2185. error => {
  2186. this.$message({
  2187. message: error,
  2188. type: "error"
  2189. });
  2190. });
  2191. });
  2192. },
  2193. editor(items) {
  2194. this.dialog = true
  2195. this.addForm.ownerId = items.ownerId
  2196. this.addForm.tel = items.tel
  2197. this.addForm.timeType = items.timeType + ''
  2198. this.addForm.startDate = items.startDate
  2199. this.addForm.endDate = items.endDate
  2200. this.addForm.timeDays = items.timeDays
  2201. this.addForm.timeHours = items.timeHours
  2202. this.addForm.remark = items.remark
  2203. this.affId = items.id
  2204. },
  2205. determine () {
  2206. var adl = this.addForm
  2207. adl.id = this.affId
  2208. this.http.post('/leave-sheet/add', adl,
  2209. res => {
  2210. if (res.code == "ok") {
  2211. this.dialog = false
  2212. this.bills();
  2213. this.addForm = {
  2214. timeType: '0',
  2215. startDate: this.getCurrentTime(),
  2216. endDate: this.getCurrentTime(),
  2217. timeDays: 1,
  2218. leaveType: 0,
  2219. timeHours: '8',
  2220. tel: '',
  2221. remark: ''
  2222. }
  2223. this.getUsers()
  2224. } else {
  2225. this.$message({
  2226. message: res.msg,
  2227. type: "error"
  2228. });
  2229. }
  2230. },
  2231. error => {
  2232. this.$message({
  2233. message: error,
  2234. type: "error"
  2235. });
  2236. });
  2237. },
  2238. bangd() {
  2239. this.addForm = {
  2240. timeType: '0',
  2241. startDate: this.getCurrentTime(),
  2242. endDate: this.getCurrentTime(),
  2243. timeDays: 1,
  2244. leaveType: 0,
  2245. timeHours: '8',
  2246. tel: '',
  2247. remark: ''
  2248. }
  2249. this.getUsers()
  2250. },
  2251. // 自定义组件事件
  2252. selectCal(obj) {
  2253. if(obj.distinction == '1') {
  2254. this.addForm.ownerId = obj.id
  2255. this.txselts(obj.other, obj.id)
  2256. } else if(obj.distinction == '2') {
  2257. let arr = []
  2258. for(let i in obj.arrUserList) {
  2259. arr.push(obj.arrUserList[i].id)
  2260. }
  2261. } else if(obj.distinction == '3') {
  2262. this.ownerIds = obj.id
  2263. this.chufas()
  2264. } else if(obj.distinction == '4') {
  2265. this.addForm.ownerId = obj.id
  2266. this.selts()
  2267. } else if(obj.distinction == '11') {
  2268. if(obj.name != this.$t('defaultText.pleaseChoose')) {
  2269. this.keyword = obj.name
  2270. } else {
  2271. this.keyword = ''
  2272. }
  2273. this.statistical()
  2274. }
  2275. },
  2276. vueCasader(obj) {
  2277. if(obj.distinction == 1) {
  2278. let arr = []
  2279. arr.push(obj.id)
  2280. this.curDeptId = arr
  2281. this.vueCasaderItem = obj.item
  2282. this.addNodeObj = obj.item
  2283. console.log(obj)
  2284. } else if(obj.distinction == 2) {
  2285. let arr = []
  2286. arr.push(obj.id)
  2287. this.NcurDeptId = arr
  2288. console.log(obj, '闯过奥的值')
  2289. if(obj.item) {
  2290. if(obj.item.label != this.$t('defaultText.pleaseChoose')) {
  2291. this.vueIAlDataSItems = obj.item
  2292. } else {
  2293. this.vueIAlDataSItems = undefined
  2294. }
  2295. } else {
  2296. this.vueIAlDataSItems = undefined
  2297. }
  2298. this.selAl()
  2299. }
  2300. }
  2301. }
  2302. };
  2303. </script>
  2304. <style scoped>
  2305. .addNode {
  2306. cursor:pointer;
  2307. }
  2308. .addNode:hover {
  2309. color:#20a0ff;
  2310. }
  2311. .apls {
  2312. width: 200px;
  2313. white-space:nowrap;
  2314. overflow:hidden;
  2315. text-overflow:ellipsis;
  2316. }
  2317. .tups {
  2318. width: 100%;
  2319. height: 25px;
  2320. position: relative;
  2321. z-index: 99;
  2322. overflow: hidden;
  2323. }
  2324. .tups img {
  2325. height: 25px !important;
  2326. position: relative;
  2327. z-index: 99;
  2328. }
  2329. .viewer-canvas {
  2330. position: absolute;
  2331. z-index: 9 !important;
  2332. }
  2333. .icl {
  2334. margin-top: -25px !important;
  2335. }
  2336. /* 费用报销标题 */
  2337. .headine {
  2338. width: 100%;
  2339. height: 46.4px;
  2340. line-height: 46.4px;
  2341. background: #fff;
  2342. box-sizing: border-box;
  2343. }
  2344. .headine h3 {
  2345. margin: 0;
  2346. display: inline-block;
  2347. box-sizing: border-box;
  2348. color: #999;
  2349. }
  2350. .headine p {
  2351. display: inline-block;
  2352. margin: 0;
  2353. }
  2354. /* /费用报销标题 */
  2355. .sidebars {
  2356. height: 100%;
  2357. position: absolute;
  2358. border-right: 1px solid #E6E6E6;
  2359. z-index: 2;
  2360. top: 0;
  2361. }
  2362. .sidebars h3 {
  2363. margin: 0;
  2364. line-height: 45px;
  2365. background: #ffffff;
  2366. font-weight: normal;
  2367. color: #666;
  2368. padding-left: 20px;
  2369. }
  2370. .sidebars .el-col-12 {
  2371. width: 100%
  2372. }
  2373. .public {
  2374. height: 230px;
  2375. border-bottom: 1px solid #ddd;
  2376. }
  2377. .public .el-form-item {
  2378. display: inline-block;
  2379. }
  2380. .pu_button {
  2381. text-align: right;
  2382. width: 100%;
  2383. padding: 24px 30px;
  2384. box-sizing: border-box;
  2385. }
  2386. .pu_bu_x .pu_bu_t {
  2387. display: inline-block;
  2388. }
  2389. .pu_bu_x {
  2390. margin-right: 20px;
  2391. color: #20A0F7;
  2392. cursor: pointer;
  2393. }
  2394. .pu_bu_t {
  2395. color: #20A0F7;
  2396. cursor: pointer;
  2397. display: block;
  2398. float: right;
  2399. position:
  2400. relative;
  2401. top: -20px;
  2402. right: 63px;
  2403. }
  2404. .pu_table {
  2405. margin-left: 10px;
  2406. }
  2407. .pu_bu_t:hover {
  2408. color: #7bbcff;
  2409. }
  2410. .pu_bu_x:hover {
  2411. color: #7bbcff;
  2412. }
  2413. /* 我的单据报销凭证 */
  2414. .staff{
  2415. border-left: 1px solid #fff;
  2416. border-top: 1px solid #fff;
  2417. border-right: 1px solid #fff;
  2418. background: #fff;
  2419. }
  2420. /* */
  2421. .sdat{
  2422. display: inline-block;
  2423. width: 260px;
  2424. margin-left: 13px;
  2425. }
  2426. .messages .el-form-item{
  2427. display: inline-block;
  2428. }
  2429. .messages .el-date-editor.el-input, .el-date-editor.el-input__inner{
  2430. width: 190px;
  2431. }
  2432. /* 我的报销单据 */
  2433. .search {
  2434. position: relative;
  2435. top: 20px;
  2436. left: 20px;
  2437. }
  2438. .tables {
  2439. margin-top: 50px;
  2440. box-sizing: border-box;
  2441. padding: 10px;
  2442. }
  2443. .informant .el-form-item {
  2444. display: inline-block;
  2445. }
  2446. /* 侧边栏收索 */
  2447. .side {
  2448. position: absolute;
  2449. z-index: 2;
  2450. border-right: 2px solid #DDDDDD;
  2451. height: 100%;
  2452. top: 0;
  2453. width: 0;
  2454. }
  2455. .side .spans {
  2456. width: 20px;
  2457. height: 30px;
  2458. border: 1px solid #DDDDDD;
  2459. box-sizing: border-box;
  2460. position: absolute;
  2461. top: 50%;
  2462. margin-top: -50%;
  2463. text-align: center;
  2464. z-index: 1;
  2465. background: #fff;
  2466. }
  2467. .side .spans i{
  2468. margin-top: 7px;
  2469. color: #C0BFBF
  2470. }
  2471. .side:hover {
  2472. border-right: 2px solid #20A0FF;
  2473. }
  2474. .side:hover .spans {
  2475. border: 1px solid #20A0FF;
  2476. background: #20A0FF;
  2477. }
  2478. .side:hover .spans i{
  2479. color: #fff;
  2480. }
  2481. /* 右边整体页面 */
  2482. .contents {
  2483. height: 100%;
  2484. /* padding: 30px; */
  2485. background: #F7F7F7;
  2486. /* position: absolute; */
  2487. }
  2488. .submits {
  2489. margin-left: 50%;
  2490. }
  2491. .waiting {
  2492. color:orange;
  2493. }
  2494. .rejected {
  2495. color:red;
  2496. }
  2497. /* 请假模块 */
  2498. .tops {
  2499. width: 100%;
  2500. position: relative;
  2501. background: #f7f7f7;
  2502. box-sizing: border-box;
  2503. padding: 20px 0 0 200px;
  2504. }
  2505. .ctons {
  2506. /* width: 86%; */
  2507. height: 92%;
  2508. overflow: hidden;
  2509. background: #fff;
  2510. padding: 30px 40px;
  2511. box-sizing: border-box;
  2512. }
  2513. .ctons .el-form-item {
  2514. display: inline-block;
  2515. }
  2516. .line {
  2517. text-align: center;
  2518. margin: 0 6px
  2519. }
  2520. .poss {
  2521. position: fixed;
  2522. bottom: 4px;
  2523. right: 1%;
  2524. box-sizing: border-box;
  2525. }
  2526. .flex {
  2527. display: flex;
  2528. padding: 0 0 20px 0;
  2529. border-bottom: 1px solid #f2f2f2;
  2530. }
  2531. .flex span {
  2532. color: #606266;
  2533. display: inline-block;
  2534. margin: 0 10px 0 20px;
  2535. }
  2536. </style>