list.vue 96 KB

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