list.vue 97 KB

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