list.vue 94 KB

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