list.vue 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058
  1. <template>
  2. <section id="section">
  3. <div class="sidebars" ref="sidebars" :style="'width: 180px;display: block;background: #fff;height:'+hubs+ 'px'">
  4. <h3><i class="iconfont firerock-iconbaoxiao" style="padding-right: 10px"></i>请假管理</h3>
  5. <el-divider ></el-divider>
  6. <el-col :span="12">
  7. <el-menu :default-active="isDingding ? '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="!isDingding">
  19. <el-menu-item index="1" v-if="permissions.leaveFil">
  20. <i class="iconfont firerock-icontianbao"></i>
  21. <span slot="title">员工请假填报</span>
  22. </el-menu-item>
  23. <el-submenu index="2" v-if="permissions.leaveAll">
  24. <template slot="title">
  25. <i class="iconfont firerock-iconbaoxiaodan"></i>
  26. <span>{{"请假单列表"}}</span>
  27. </template>
  28. <el-menu-item index="2-1" ><p @click="bills(false, 2)" v-if="permissions.leaveAll">全部</p></el-menu-item>
  29. <el-menu-item index="2-2" ><p @click="bills(true, 1)" v-if="permissions.leaveAudit">待审核</p></el-menu-item>
  30. </el-submenu>
  31. <el-menu-item index="3" @select="bills" @click="bills(false, 2)" v-if="!permissions.leaveAll">
  32. <i class="iconfont firerock-iconbaoxiaodan"></i>
  33. <span slot="title">我的请假单</span>
  34. </el-menu-item>
  35. <el-menu-item index="4" v-if="permissions.leaveStatistical">
  36. <template slot="title">
  37. <i class="iconfont firerock-icontianbao"></i>
  38. <span slot="title">请假统计</span>
  39. </template>
  40. </el-menu-item>
  41. <el-menu-item index="5" v-if="permissions.leaveProcess">
  42. <template slot="title">
  43. <i class="iconfont firerock-iconliucheng"></i>
  44. <span slot="title">请假审批流程</span>
  45. </template>
  46. </el-menu-item>
  47. <el-menu-item index="6" v-if="permissions.leaveAnnual">
  48. <template slot="title">
  49. <i class="iconfont firerock-icontianbao"></i>
  50. <span slot="title">年假管理</span>
  51. </template>
  52. </el-menu-item>
  53. </template>
  54. <!-- 钉钉环境对接 -->
  55. <template v-if="isDingding">
  56. <el-menu-item index="7" v-if="permissions.leaveAll">
  57. <template slot="title">
  58. <i class="iconfont firerock-iconbaoxiaodan"></i>
  59. <span slot="title">请假单列表</span>
  60. </template>
  61. </el-menu-item>
  62. <el-menu-item index="8" v-if="permissions.leaveAll">
  63. <template slot="title">
  64. <i class="iconfont firerock-iconbaoxiaodan"></i>
  65. <span slot="title">假期剩余表</span>
  66. </template>
  67. </el-menu-item>
  68. </template>
  69. </el-menu>
  70. </el-col>
  71. </div>
  72. <!-- 侧边栏点击事件 -->
  73. <!-- <div class="side" @click="side" ref="sid" style="left: 430px">
  74. <div class="spans" ref="side" style="left: -19px;"><i ref="sideI" class="el-icon-arrow-left"></i></div>
  75. </div> -->
  76. <!-- 内容主体区域 -->
  77. <div class="contents">
  78. <div v-if="!displayTable && !isDingding" class="headine" ref="headine">
  79. <h3 ref="headHe" style="padding-left: 220px">请假填报</h3>
  80. <!-- <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p> -->
  81. </div>
  82. <!-- 上面部分 -->
  83. <div v-if="!displayTable && apk == false" class="tops" :style="'height:' +hubs+'px'">
  84. <!-- 公共 -->
  85. <div class="ctons" style="width: 98%">
  86. <!-- 表单 -->
  87. <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
  88. <!-- 请假类型 -->
  89. <el-form-item label="请假类型" prop="leaveType" style="width: 100%">
  90. <!--普通员工只能自己填报自己的 -->
  91. <el-select v-model="addForm.leaveType" @change="txselts(addForm.leaveType,addForm.ownerId)" placeholder="请选择请假类型" style="width: 240px">
  92. <el-option v-for="item in qjType" :key="item.id" :label="item.name" :value="item.id"></el-option>
  93. </el-select>
  94. <template v-if="addForm.leaveType == 6">
  95. <span style="margin-left:18px;color:#777;">剩余可调休 {{addForm.ownerId != '' ? txselnum : '~'}} 天</span>
  96. <el-tooltip effect="dark" content="加班时长可用于调休抵扣" placement="top-start">
  97. <i class="el-icon-question" style="color:#606266;"></i>
  98. </el-tooltip>
  99. </template>
  100. </el-form-item>
  101. <!-- 请假人 -->
  102. <el-form-item label="请假人" prop="ownerId" style="width: 300px">
  103. <!--普通员工只能自己填报自己的 -->
  104. <el-select v-model="addForm.ownerId" @change="txselts(addForm.leaveType,addForm.ownerId)" placeholder="请选择请假人" style="width: 240px" :disabled="true" filterable="true">
  105. <span v-for="(item, index) in users" :key="index">
  106. <el-option :label="item.name" :value="item.id"></el-option>
  107. </span>
  108. </el-select>
  109. </el-form-item>
  110. <!-- 电话 -->
  111. <el-form-item label="电话" prop="tel" style="margin-right:300px">
  112. <el-input ref="ipts" v-model="addForm.tel" placeholder="请输入手机号" style="width: 250px"></el-input>
  113. </el-form-item>
  114. <!-- 单选 -->
  115. <el-form-item style="display: inline-block;width:300px" label="时长单位">
  116. <el-radio-group v-model="addForm.timeType" @change="chanRadio()" style="display:inline-block;width:240px">
  117. <el-radio label="0">按天请假</el-radio>
  118. <el-radio label="1" v-if="addForm.leaveType != 6">按小时请假</el-radio>
  119. </el-radio-group>
  120. </el-form-item>
  121. <!-- 选择审批人 -->
  122. <el-form-item label="审批人" style="width:300px" :prop="mustApprover">
  123. <el-select style="display:inline-block;width:250px;" multiple v-model="addForm.projectAuditorJson" placeholder="请选择">
  124. <el-option
  125. v-for="item in approverList"
  126. :key="item.id"
  127. :label="item.name"
  128. :value="item.id"
  129. ></el-option>
  130. </el-select>
  131. </el-form-item>
  132. <!-- 时间选择 -->
  133. <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 100%;">
  134. <el-col style="display: inline-block; width: 240px">
  135. <el-date-picker v-if="flg" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @blur="datas()"></el-date-picker>
  136. <el-date-picker v-else type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @change="datasss()"></el-date-picker>
  137. </el-col>
  138. <el-col class="line" v-if="flg" style="display: inline-block; width: 50px">-</el-col>
  139. <el-col style="display: inline-block; width: 240px">
  140. <el-date-picker v-if="flg" type="date" placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptionsEnd" v-model="addForm.endDate" style="width: 250px;" @blur="datas()"></el-date-picker>
  141. <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  142. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  143. </el-select> -->
  144. </el-col>
  145. </el-form-item>
  146. <!-- 请假天数 -->
  147. <el-form-item :label="flg ? '请假天数' : '请假时长'" prop="timeDays" style="margin-right: 500px">
  148. <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
  149. <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
  150. <div v-if="flg"> <el-input v-model="addForm.timeDays" @blur="inputs()" @input="addForm.timeDays=addForm.timeDays.replace(/[^\d.]/g,'')" style="width: 120px; margin-right: 20px;" type="number" :step="0.5"></el-input> 天</div>
  151. <div v-else>
  152. <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 120px; margin-right: 20px;"></el-input> 小时
  153. </div>
  154. </el-form-item>
  155. <!-- 备注 -->
  156. <el-form-item label="备注" style="width: 100%">
  157. <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 550px" maxlength="100" show-word-limit></el-input>
  158. </el-form-item>
  159. </el-form>
  160. <div>
  161. <p style="margin-left: 20%"><el-button type="primary" @click="submits('addFormRules')" size="mini" :disabled="txselnum == 0 && addForm.leaveType == 6 && addForm.ownerId != '' ? true : false">提交</el-button></p>
  162. </div>
  163. </div>
  164. </div>
  165. <!-- 下面部分 -->
  166. <div v-if="displayTable && apk == false" class="tops" :style="'height:' +hubs+'px'">
  167. <!-- 公共 -->
  168. <div class="ctons" style="width: 98%;">
  169. <div class="flex">
  170. <div>
  171. <el-select v-model="ownerIds" placeholder="请选择请假人" clearable @change="chufas()" style="width: 160px" size="small" v-show="permissions.leaveAll" filterable="true">
  172. <span v-for="(item, index) in users" :key="index">
  173. <el-option :label="item.name" :value="item.id"></el-option>
  174. </span>
  175. </el-select>
  176. </div>
  177. <div>
  178. <span style="color: #606266">请假类型</span>
  179. <el-select v-model="type" placeholder="请选择请假类型" clearable @change="chufas()" style="width: 160px;" size="small" filterable="true">
  180. <span v-for="(item, index) in typess" :key="index">
  181. <el-option :label="item.name" :value="item.id"></el-option>
  182. </span>
  183. </el-select>
  184. </div>
  185. <div>
  186. <span style="color: #606266">请假状态</span>
  187. <el-select v-if="falg == 0" v-model="code" placeholder="请选择请假状态" clearable @change="chufas()" size="small" style="width: 160px" filterable="true">
  188. <span v-for="(item, index) in statuss" :key="index">
  189. <el-option :label="item.name" :value="item.id"></el-option>
  190. </span>
  191. </el-select>
  192. <el-select v-if="falg == 1" disabled v-model="code" placeholder="请选择请假类型" clearable @change="chufas()" size="small" style="width: 160px" filterable="true">
  193. <span v-for="(item, index) in statuss" :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">请假时间</span>
  200. <el-date-picker v-model="createDate" type="date" @change="chufas()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable="false"> </el-date-picker>
  201. </div>
  202. </div>
  203. <el-table v-loading="loading" :data="tableData" style="width: 100%" height="94%">
  204. <el-table-column prop="ownerName" label="请假人" min-width="120" fixed="left"></el-table-column>
  205. <el-table-column prop="tel" label="电话" min-width="120"></el-table-column>
  206. <el-table-column prop="leaveType" label="请假类型" min-width="120">
  207. <template slot-scope="scope">
  208. <!-- <div v-if="scope.row.leaveType == 0">事假</div>
  209. <div v-if="scope.row.leaveType == 1">病假</div>
  210. <div v-if="scope.row.leaveType == 2">年假</div>
  211. <div v-if="scope.row.leaveType == 3">产假</div> -->
  212. {{qjType[scope.row.leaveType].name}}
  213. </template>
  214. </el-table-column>
  215. <el-table-column prop="startDate" label="请假开始时间" min-width="150"></el-table-column>
  216. <el-table-column prop="endDate" label="请假结束时间" min-width="150"></el-table-column>
  217. <el-table-column label="请假天数" min-width="120">
  218. <template slot-scope="scope">
  219. <div v-if="scope.row.timeType == '1'">/</div>
  220. <div v-else>{{scope.row.timeDays}}天</div>
  221. </template>
  222. </el-table-column>
  223. <el-table-column label="请假时长" min-width="120" v-if="!user.timeType.syncDingding">
  224. <template slot-scope="scope">
  225. <div>{{scope.row.timeHours}}小时</div>
  226. </template>
  227. </el-table-column>
  228. <el-table-column prop="status" label="状态" min-width="100">
  229. <template slot-scope="scope">
  230. <div v-if="scope.row.status == 0 || scope.row.status == 1 || scope.row.status == 2 || scope.row.status == 3 || scope.row.status == 4">
  231. <div v-if="scope.row.status == 0" >审核通过</div>
  232. <div v-if="scope.row.status == 1" style="color: orange">待审核</div>
  233. <div v-if="scope.row.status == 2" style="color: red">驳回</div>
  234. <div v-if="scope.row.status == 3" style="color: #666666">撤销</div>
  235. </div>
  236. <div v-else>
  237. <span>暂无请假单</span>
  238. </div>
  239. </template>
  240. </el-table-column>
  241. <el-table-column prop="remark" label="备注" min-width="200" header-align="center">
  242. <template slot-scope="scope">
  243. <!-- <div class="apls">{{scope.row.remark}}</div> -->
  244. <el-popover placement="top-start" title="标题" width="200" trigger="hover" :content="scope.row.remark">
  245. <div slot="reference" class="apls">{{scope.row.remark}}</div>
  246. </el-popover>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="操作" min-width="180" fixed="right" v-if="isAuditList && !isDingding">
  250. <template slot-scope="scope">
  251. <div>
  252. <el-button icon="el-icon-check" circle size="mini" @click.stop.native="approve(scope.row)"></el-button>
  253. <el-button icon="el-icon-close" circle size="mini" @click.stop.native="deny(scope.row)"></el-button>
  254. </div>
  255. </template>
  256. </el-table-column>
  257. <el-table-column label="操作" min-width="180" fixed="right" v-if="!isAuditList && !isDingding">
  258. <template slot-scope="scope">
  259. <div v-if="(scope.row.status != 0 && scope.row.ownerId == user.id) || permissions.leaveAll">
  260. <el-button icon="el-icon-delete" circle size="mini" @click.stop.native="deletes(scope.row)" ></el-button>
  261. <el-button icon="el-icon-edit" circle size="mini" @click.stop.native="editor(scope.row)"></el-button>
  262. </div>
  263. <!-- <div>
  264. <el-button icon="el-icon-delete" circle size="mini" @click.stop.native="deletes(scope.row)"></el-button>
  265. <el-button icon="el-icon-edit" circle size="mini" @click.stop.native="editor(scope.row)"></el-button>
  266. </div> -->
  267. </template>
  268. </el-table-column>
  269. </el-table>
  270. <div class="poss">
  271. <el-pagination
  272. @size-change="handleSizeChange"
  273. @current-change="handleCurrentChange"
  274. :current-page="currentPage4"
  275. :page-sizes="[20, 50, 100, 200]"
  276. :page-size="20"
  277. layout="total, sizes, prev, pager, next"
  278. :total="total">
  279. </el-pagination>
  280. </div>
  281. </div>
  282. </div>
  283. <!-- 统计部分 -->
  284. <div v-if="displayTable && apk && apk2 == 4" class="tops" :style="'height:' +hubs+'px'">
  285. <!-- 公共 -->
  286. <div class="ctons" style="width: 98%;">
  287. <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
  288. <div style="display: inline-block;width: 350px">
  289. <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入人员搜索" clearable="true" size="small">
  290. <el-button slot="append" @click="statistical()" icon="el-icon-search"></el-button>
  291. </el-input>
  292. </div>
  293. <div style="display: inline-block;width: 340px">
  294. <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">开始日期</span>
  295. <el-date-picker
  296. v-model="statData"
  297. type="date"
  298. placeholder="选择日期"
  299. size="small"
  300. @change="statistical()"
  301. clearable="false"
  302. value-format="yyyy-MM-dd"
  303. :picker-options="pickerOptionsStarts">
  304. </el-date-picker>
  305. </div>
  306. <div style="display: inline-block;width: 350px">
  307. <span style="display: inline-block;margin: 0 15px 0 0;color: rgb(96, 98, 102);">结束日期</span>
  308. <el-date-picker
  309. v-model="endData"
  310. type="date"
  311. placeholder="选择日期"
  312. size="small"
  313. @change="statistical()"
  314. clearable="fasle"
  315. value-format="yyyy-MM-dd"
  316. :picker-options="pickerOptionsEnds">
  317. </el-date-picker>
  318. </div>
  319. </div>
  320. <!-- <div style="margin-top: 30px"> -->
  321. <div>
  322. <el-table key="apk2is4" v-loading="loading" :data="statisticalList" height="780px" style="width: 99%">
  323. <el-table-column prop="ownerName" label="姓名" width="300">
  324. <template slot-scope="scope">
  325. <div v-if="scope.row.ownerName">
  326. {{scope.row.ownerName}}
  327. </div>
  328. <div v-else>
  329. <span>暂无请假统计</span>
  330. </div>
  331. </template>
  332. </el-table-column>
  333. <el-table-column prop="timeDays" label="请假总天数" width="300">
  334. <template slot-scope="scope">
  335. {{scope.row.timeDays}}/天
  336. </template>
  337. </el-table-column>
  338. <el-table-column prop="timeHours" label="请假总时长">
  339. <template slot-scope="scope">
  340. {{scope.row.timeHours}}/小时
  341. </template>
  342. </el-table-column>
  343. </el-table>
  344. </div>
  345. </div>
  346. </div>
  347. <!-- 审批流 -->
  348. <div v-if="displayTable && apk && apk2 == 5" class="tops" :style="'height:' +hubs+'px'">
  349. <div class="ctons" style="width: 98%;">
  350. <el-col :span="6" >
  351. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-left:15px;" >
  352. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  353. <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion></el-tree>
  354. </div>
  355. </el-scrollbar>
  356. </el-col>
  357. <el-col :span="18" >
  358. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-right:20px;" >
  359. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  360. <div style="padding:5px;color:#333;" v-if="depData != null">设置 &lt;<span style="color:#20a0ff;">{{depData.label}}&gt;</span> 直属人员请假审批流程
  361. <el-tooltip effect="dark" v-if="depData != null && depData.children!=null" content="仅适用于当前部门的直属人员,子部门人员的审批流程需要单独设置" placement="top-start">
  362. <i class="el-icon-question"></i>
  363. </el-tooltip>
  364. </div>
  365. <div style="padding:5px;" v-if="depData == null">请选择部门</div>
  366. <div style="width:100%;margin:0 auto;text-align: center; margin-top:50px;" v-if="depData != null">
  367. <span>员工填报</span>
  368. <icon class="iconfont firerock-iconright"></icon>
  369. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(0)"></icon>
  370. <icon class="iconfont firerock-iconright"></icon>
  371. <span v-for="(item, index) in dataArray" :key="item.seq" >
  372. <el-button type="primary" v-if="item.auditorType == 1" @click="editNodeDialog(index, item)">{{item.auditDeptName}}</el-button>
  373. <el-button type="primary" v-if="item.auditorType == 2" @click="editNodeDialog(index, item)">{{item.userName}}</el-button>
  374. <template v-if="item.auditorType == 1 || item.auditorType == 2">
  375. <icon class="iconfont firerock-iconright"></icon>
  376. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(index+1)"></icon>
  377. <icon class="iconfont firerock-iconright"></icon>
  378. </template>
  379. </span>
  380. <!--结束点 -->
  381. <icon class="iconfont firerock-iconApp_New_Line" style="color:#20A0FF;"></icon>
  382. 审批完成
  383. </div>
  384. <div style="width:100%;margin:0 auto;margin-bottom:30px;position: absolute;bottom: 0px;text-align: center; ">
  385. <el-button type="primary" @click="submitInsert" :loading="addLoading">保存</el-button>
  386. </div>
  387. </div>
  388. </el-scrollbar>
  389. </el-col>
  390. </div>
  391. <!--部门选择列表 -->
  392. <el-dialog title="请选择审批人" v-if="dialogVisible" :visible.sync="dialogVisible" width="460px">
  393. <el-form label-width="140px">
  394. <el-form-item label="选择部门/指定人员" >
  395. <el-cascader filterable ref="deptCascader" v-model="curDeptId" placeholder="请选择部门/指定人员" style="width: 100%" @change="chooseDept"
  396. :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  397. </el-form-item>
  398. </el-form>
  399. <div slot="footer" class="dialog-footer">
  400. <el-button type="default" @click="deleteNode" v-if="!isAdd" style="float:left;">删除</el-button>
  401. <el-button type="primary" @click="addNode" >确定</el-button>
  402. </div>
  403. </el-dialog>
  404. </div>
  405. <!-- 年假管理 -->
  406. <div v-if="displayTable && apk && apk2 == 6" class="tops" :style="'height:' +hubs+'px'">
  407. <div class="ctons" style="width: 98%;">
  408. <div style="display: flex;align-items: center;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
  409. <div style="display: inline-block;width: 18%;margin-left:1%">
  410. <el-button size="small" @click="changeAltime(0)">批量设置</el-button>
  411. </div>
  412. <div style="display: inline-block;width: 26%">
  413. <el-input style="float:left;" v-model="keywordAl" class="input-with-select" placeholder="请输入人员姓名搜索" clearable="true" size="small" @clear="clearsearchAl()">
  414. <el-button slot="append" @click="searchAl()" icon="el-icon-search"></el-button>
  415. </el-input>
  416. </div>
  417. <div style="display: inline-block;width: 32%;margin-left:12%">
  418. <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">按部门筛选</span>
  419. <el-cascader
  420. ref="selectAl"
  421. filterable
  422. v-model="NcurDeptId"
  423. placeholder="请选择部门"
  424. size="small"
  425. style="width: 60%"
  426. @change="selAl()"
  427. clearable
  428. :options="Nsdata"
  429. :props="{ checkStrictly: true, expandTrigger: 'hover' }"
  430. :show-all-levels="false">
  431. </el-cascader>
  432. </div>
  433. </div>
  434. <div>
  435. <el-table key="apk2is6" v-loading="loading" :data="iAlDataS" height="480" style="width: 99%;" @selection-change="selPchg">
  436. <el-table-column type="selection"></el-table-column>
  437. <el-table-column prop="userName" label="姓名" width="200">
  438. <template slot-scope="scope">
  439. <div v-if="scope.row.userName">
  440. {{scope.row.userName}}
  441. </div>
  442. </template>
  443. </el-table-column>
  444. <el-table-column prop="department" label="所在部门" width="200">
  445. <template slot-scope="scope">
  446. {{scope.row.department}}
  447. </template>
  448. </el-table-column>
  449. <el-table-column prop="yearDays" label="每年年假天数" width="200">
  450. <template slot-scope="scope">
  451. {{scope.row.yearDays != null ? scope.row.yearDays + "天" : "-"}}
  452. </template>
  453. </el-table-column>
  454. <el-table-column prop="leftdays" label="剩余年假天数" width="200">
  455. <template slot-scope="scope">
  456. {{scope.row.yearDays != null ? scope.row.yearDays - scope.row.alreadyDays + "天" : "-"}}
  457. </template>
  458. </el-table-column>
  459. <el-table-column prop="id" label="修改年假天数">
  460. <template slot-scope="scope">
  461. <el-button size="small" @click="changeAltime(scope.row)">设置</el-button>
  462. </template>
  463. </el-table-column>
  464. </el-table>
  465. </div>
  466. </div>
  467. <el-dialog title="请设置年假时限" v-if="Alshow" :visible.sync="Alshow" @close="delAltime()" width="500px">
  468. <el-form label-width="8rem">
  469. <el-form-item label="设置每年年假天数" >
  470. <el-input v-model="Alchange.yearDays" type="number" min="0" placeholder="请输入天数"></el-input>
  471. </el-form-item>
  472. </el-form>
  473. <div slot="footer" class="dialog-footer">
  474. <el-button type="default" @click="delAltime()">取消</el-button>
  475. <el-button type="primary" @click="chgAltime()">确定</el-button>
  476. </div>
  477. </el-dialog>
  478. </div>
  479. <div v-if="displayTable && apk && apk2 == 8" class="tops" :style="'height:' +hubs+'px'">
  480. <!-- 公共 -->
  481. <div class="ctons" style="width: 98%;">
  482. <div class="flex">
  483. <div>
  484. <span>请假类型</span>
  485. <el-select v-model="leaveTypeItem" placeholder="请选择请假类型" @change="leaveTypeChange()" style="width: 180px" size="small" v-show="permissions.leaveAll" filterable="true">
  486. <span v-for="item in leaveTypeList" :key="item.leaveCode">
  487. <el-option :label="item.leaveName" :value="item.leaveCode"></el-option>
  488. </span>
  489. </el-select>
  490. </div>
  491. <div>
  492. <span>部门筛选</span>
  493. <el-cascader
  494. size="small"
  495. @change="departmentOptionsChg"
  496. v-model="departmentSel"
  497. :options="departmentOptions"
  498. placeholder="请选择部门"
  499. :show-all-levels="false"
  500. :props="{ checkStrictly: true }"
  501. clearable></el-cascader>
  502. </div>
  503. <div>
  504. <span>人员筛选</span>
  505. <el-select v-model="userSelId" placeholder="请选择请假人" clearable @change="userChg()" style="width: 180px" size="small" v-show="permissions.leaveAll" filterable="true">
  506. <span v-for="(item, index) in users" :key="index">
  507. <el-option :label="item.name" :value="item.id"></el-option>
  508. </span>
  509. </el-select>
  510. </div>
  511. <div style="margin:0 10px 0 40px">
  512. <el-button size="small" type="primary" @click="listSynchronize" :loading="synchronizeLoading">从钉钉同步</el-button>
  513. </div>
  514. </div>
  515. <el-table key="apk2is8" v-loading="loading" :data="vacationList" style="width: 100%" height="94%">
  516. <el-table-column prop="name" label="员工姓名" min-width="120" fixed="left"></el-table-column>
  517. <el-table-column label="有效期" min-width="250" align="center">
  518. <template slot-scope="scope">
  519. <span>{{scope.row.startTime == null && scope.row.endTime == null ? '~ ~' : (scope.row.startTime + '\u3000~\u3000' + scope.row.endTime)}}</span>
  520. </template>
  521. </el-table-column>
  522. <el-table-column label="总额度" min-width="100" align="center">
  523. <template slot-scope="scope">
  524. <span>{{scope.row.quotaInDays == null && scope.row.quotaInHours == null ? '-' : (scope.row.quotaInDays == null ? scope.row.quotaInHours + '小时' : scope.row.quotaInDays + '天')}}</span>
  525. </template>
  526. </el-table-column>
  527. <el-table-column label="已使用" min-width="100" align="center">
  528. <template slot-scope="scope">
  529. <span>{{scope.row.usedInDays == null && scope.row.usedInHours == null ? '-' : (scope.row.usedInDays == null ? scope.row.usedInHours + '小时' : scope.row.usedInDays + '天')}}</span>
  530. </template>
  531. </el-table-column>
  532. <el-table-column label="剩余额度" min-width="100" align="center">
  533. <template slot-scope="scope">
  534. <span>{{scope.row.leftInDays == null && scope.row.leftInHours == null ? '-' : (scope.row.leftInDays == null ? scope.row.leftInHours + '小时' : scope.row.leftInDays + '天')}}</span>
  535. </template>
  536. </el-table-column>
  537. </el-table>
  538. <div class="poss">
  539. <el-pagination
  540. @size-change="vacationSizeChange"
  541. @current-change="vacationCurrentChange"
  542. :current-page="page"
  543. :page-sizes="[50]"
  544. :page-size="50"
  545. layout="total, sizes, prev, pager, next"
  546. :total="total">
  547. </el-pagination>
  548. </div>
  549. </div>
  550. </div>
  551. <!-- --------- -->
  552. </div>
  553. <!-- 请假单详情 -->
  554. <el-dialog title="请假单详情" :visible.sync="dialog" width="1000px" @close="bangd()">
  555. <!-- 表单 -->
  556. <el-form ref="addForm" :model="addForm" label-width="80px" :rules="addFormRules">
  557. <!-- 请假人 -->
  558. <el-form-item label="请假人" prop="ownerId" style="width: 300px;display: inline-block;">
  559. <!--普通员工只能自己填报自己的 -->
  560. <el-select v-model="addForm.ownerId" @change="selts()" placeholder="请选择请假人" style="width: 240px" :disabled="true" filterable="true">
  561. <span v-for="(item, index) in users" :key="index">
  562. <el-option :label="item.name" :value="item.id"></el-option>
  563. </span>
  564. </el-select>
  565. </el-form-item>
  566. <!-- 电话 -->
  567. <el-form-item label="电话" prop="tel" style="width: 300px;display: inline-block;">
  568. <el-input ref="ipts" v-model="addForm.tel" placeholder="请输入手机号" style="width: 250px;"></el-input>
  569. </el-form-item>
  570. <!-- 单选 -->
  571. <el-form-item style="display: block" label="时长单位">
  572. <el-radio-group v-model="addForm.timeType" @change="chanRadio()">
  573. <el-radio label="0">按天请假</el-radio>
  574. <el-radio label="1">按小时请假</el-radio>
  575. </el-radio-group>
  576. </el-form-item>
  577. <!-- 时间选择 -->
  578. <el-form-item :label="flg ? '选择日期' : '选择时间'" style="width: 74%;margin-right:500px">
  579. <el-col :span="9">
  580. <el-date-picker v-if="flg" type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @blur="datas()"></el-date-picker>
  581. <el-date-picker v-else type="date" placeholder="开始日期" value-format="yyyy-MM-dd" v-model="addForm.startDate" style="width: 240px;" @change="datasss()"></el-date-picker>
  582. </el-col>
  583. <el-col class="line" v-if="flg" :span="2">-</el-col>
  584. <el-col :span="9">
  585. <el-date-picker v-if="flg" type="date" placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptionsEnd" v-model="addForm.endDate" style="width: 250px;" @blur="datas()"></el-date-picker>
  586. <!-- <el-select v-else v-model="addForm.timeHours" placeholder="请假时长" @change="chanSele()">
  587. <el-option v-for="(item, index) in options" :key="index" :label="item" :value="item"></el-option>
  588. </el-select> -->
  589. </el-col>
  590. </el-form-item>
  591. <!-- 请假天数 -->
  592. <el-form-item :label="flg ? '请假天数' : '请假时长'" prop="timeDays" style="margin-right: 500px">
  593. <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
  594. <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
  595. <div v-if="flg"> <el-input v-model="addForm.timeDays" @blur="inputs()" @input="addForm.timeDays=addForm.timeDays.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 天</div>
  596. <div v-else>
  597. <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 小时
  598. </div>
  599. </el-form-item>
  600. <!-- 备注 -->
  601. <el-form-item label="备注" style="width: 100%">
  602. <el-input type="textarea" v-model="addForm.remark" :rows="5" style="width: 62%" maxlength="100" show-word-limit></el-input>
  603. </el-form-item>
  604. </el-form>
  605. <span slot="footer" class="dialog-footer">
  606. <el-button @click="dialog = false">取 消</el-button>
  607. <el-button type="primary" @click="determine()">确 定</el-button>
  608. </span>
  609. </el-dialog>
  610. </section>
  611. </template>
  612. <script>
  613. import { config, error } from 'dingtalk-jsapi';
  614. export default {
  615. name: "expense",
  616. components: {},
  617. props: {},
  618. data() {
  619. //验证手机号
  620. var checkTel = (rule, value, callback) =>{
  621. if (!value) {
  622. return callback(new Error('手机号不能为空'));
  623. } else {
  624. const reg = /^1[3|4|5|7|8|9][0-9]\d{8}$/
  625. if (reg.test(value)) {
  626. callback();
  627. } else {
  628. return callback(new Error('请输入正确的手机号'));
  629. }
  630. }
  631. };
  632. var checks = (rule, value, callback) => {
  633. if (!value) {
  634. return callback(new Error('请假天数不能为空'));
  635. } else {
  636. if (value > this.timeChoose) {
  637. return callback(new Error('超过当前选择日期的天数'));
  638. } else {
  639. callback();
  640. }
  641. }
  642. };
  643. return {
  644. addFormRules: {
  645. ownerId: [{ required: true, message: "请选择请假人", trigger: "blur" }],
  646. tel: [{required: true, validator: checkTel, trigger: 'blur'}],
  647. timeDays: [{required: true, validator: checks, trigger: 'blur'}],
  648. leaveType: [{ required: true, message: "请选择请假类型", trigger: "blur" }],
  649. approver: [{ required: true, message: "请选择审批人", trigger: "blur" }]
  650. },
  651. user: JSON.parse(sessionStorage.getItem("user")),
  652. shuz: ['事假填报', '病假填报', '年假填报', '产假填报'],
  653. ins: 0,
  654. addForm: {
  655. timeType: '0',
  656. startDate: this.getCurrentTime(),
  657. endDate: this.getCurrentTime(),
  658. timeDays: 1,
  659. leaveType: 0,
  660. ownerId: '',
  661. // indate: this.getCurrentTime(),
  662. timeHours: 8,
  663. tel: '',
  664. remark: '',
  665. projectAuditorJson: ''
  666. },
  667. displayTable: false,
  668. users: [], // 人员信息
  669. flg: true,
  670. createDate: '2020-01-01',
  671. // pickerOptionsStart: {
  672. // disabledDate: (time) => {
  673. // if (this.addForm.endDate) {
  674. // return time.getTime() > new Date(this.addForm.endDate).getTime() || time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  675. // }
  676. // return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  677. // },
  678. // },
  679. pickerOptionsEnd: {
  680. disabledDate: (time) => {
  681. if (this.addForm.startDate) {
  682. return time.getTime() < new Date(this.addForm.startDate).getTime() - 86400000;
  683. }
  684. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  685. },
  686. },
  687. // pickerOptionsStarts: {
  688. // disabledDate: (time) => {
  689. // if (this.endData) {
  690. // return time.getTime() > new Date(this.endData).getTime() || time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  691. // }
  692. // return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  693. // },
  694. // },
  695. pickerOptionsEnds: {
  696. disabledDate: (time) => {
  697. if (this.statData) {
  698. return time.getTime() < new Date(this.statData).getTime() - 86400000;
  699. }
  700. return time.getTime() <= new Date(this.createDate).getTime() - 86400000;
  701. },
  702. },
  703. options: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
  704. tableData: [],
  705. page: 1,
  706. size: 20,
  707. isAuditList: '',
  708. total:0,
  709. apk: false,
  710. keyword: '',
  711. statData: this.getCurrentTimes(),
  712. endData: this.getCurrentTime(),
  713. statisticalList: [],
  714. loading: false,
  715. timeChoose: 1,
  716. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  717. // typess: [{
  718. // name: '事假',
  719. // id: 0
  720. // },{
  721. // name: '病假',
  722. // id: 1
  723. // },{
  724. // name: '年假',
  725. // id: 2
  726. // },{
  727. // name: '产假',
  728. // id: 3
  729. // }],
  730. typess: [{name: '事假',id: 0},{name: '病假',id: 1},{name: '年假',id: 2},{name: '产假',id: 3},{name: '婚假',id: 4},{name: '丧假',id: 5},{name: '调休假',id: 6},{name: '陪产假',id: 7},{name: '其他', id: 8}],
  731. statuss: [{
  732. name: '审核通过',
  733. id: 0
  734. },{
  735. name: '待审核',
  736. id: 1
  737. },{
  738. name: '驳回',
  739. id: 2
  740. },{
  741. name: '已撤销',
  742. id: 3
  743. }],
  744. createDatelis: '',
  745. ownerIds: '',
  746. type: '',
  747. code: '',
  748. createDate: '',
  749. falg: 0,
  750. dialog: false,
  751. adform: {},
  752. affId: '',
  753. qjType: [
  754. {name: '事假', id: 0},
  755. {name: '病假', id: 1},
  756. {name: '年假', id: 2},
  757. {name: '产假', id: 3},
  758. {name: '婚假', id: 4},
  759. {name: '丧假', id: 5},
  760. {name: '调休假', id: 6},
  761. {name: '陪产假', id: 7},
  762. {name: '其他', id: 8}
  763. ],
  764. //
  765. apk2: false,
  766. sdata:[],
  767. dataArray:[],
  768. sdefaultProps: {
  769. children: 'children',
  770. label: 'label'
  771. },
  772. depData: null,
  773. isAdd : false,
  774. sindex : 0,
  775. curDeptId : null,
  776. curUserId : null,
  777. dialogVisible: false,
  778. soption : null,
  779. Alshow: false,
  780. Alchange: {yearDays:null,userId:null},
  781. AlchangeP: [],
  782. susers: [],
  783. keywordAl: '',
  784. NcurDeptId:[],
  785. Nsdata : [],
  786. AlData : [],
  787. iAlDataS: [],
  788. iAlData : [],
  789. // ---------
  790. txselnum: 0,
  791. approverList: [],
  792. mustApprover: '',
  793. isDingding: 0,
  794. vacationList: [],
  795. leaveTypeList: [],
  796. leaveTypeItem: '',
  797. departmentOptions: [],
  798. departmentSel: [],
  799. userSelId: '',
  800. synchronizeLoading: false,
  801. kuanBl: 0,
  802. hubs: 0
  803. };
  804. },
  805. computed: {},
  806. watch: {},
  807. created() {
  808. let widTHBul = document.documentElement.clientWidth - 440
  809. this.kuanBl = widTHBul
  810. this.hubs = (document.documentElement.clientHeight || document.body.clientHeight) - 70
  811. let height = window.innerHeight;
  812. this.tableHeight = height - 195;
  813. const that = this;
  814. window.onresize = function temp() {
  815. that.tableHeight = window.innerHeight - 195;
  816. };
  817. // console.log('user',this.user);
  818. this.isDingding = this.user.timeType.syncDingding
  819. },
  820. mounted() {
  821. if(this.isDingding){
  822. this.bills(false,2)
  823. this.staffs(7,['7'])
  824. this.getUsers()
  825. }else{
  826. this.getUsers() // 获取人员信息
  827. this.getDepartment();
  828. this.getAl();
  829. this.getApproverList()
  830. }
  831. },
  832. filters: {},
  833. methods: {
  834. // 从钉钉同步假期剩余表
  835. listSynchronize(){
  836. this.synchronizeLoading = true
  837. this.http.post('/dingding/syncLeaveQuotaData',{
  838. companyId: this.user.companyId
  839. },res => {
  840. if(res.code == 'ok'){
  841. this.synchronizeLoading = false
  842. this.$message({
  843. message: '同步成功',
  844. type: 'success'
  845. })
  846. this.getVacationList()
  847. this.page = 1
  848. this.departmentSel = []
  849. this.userSelId = ''
  850. }else {
  851. this.synchronizeLoading = false
  852. this.$message({
  853. message: res.msg,
  854. type: 'error'
  855. })
  856. }
  857. },err => {
  858. this.synchronizeLoading = false
  859. this.$message({
  860. message: err,
  861. type: 'error'
  862. })
  863. })
  864. },
  865. // 获取部门列表
  866. getDepartmentOptions(){
  867. this.http.post(this.port.manage.depList,{
  868. },res =>{
  869. if(res.code == 'ok'){
  870. // console.log('getDepartment',res.data);
  871. this.departmentOptions = this.changeArr(res.data)
  872. }else {
  873. this.$message({
  874. message: res.msg,
  875. type: 'error'
  876. })
  877. }
  878. },err => {
  879. this.$message({
  880. message: err,
  881. type: 'error'
  882. })
  883. })
  884. },
  885. departmentOptionsChg(){
  886. // console.log(this.departmentSel);
  887. this.page = 1
  888. this.getVacationList(1)
  889. },
  890. userChg(){
  891. // console.log(this.userSelId);
  892. this.page = 1
  893. this.getVacationList(1)
  894. },
  895. // 获取剩余假期信息列表
  896. getVacationList(e){
  897. this.loading = true
  898. let item = {}
  899. if(e){
  900. item = {
  901. companyId: this.user.companyId,
  902. pageIndex: this.page,
  903. leaveCode: this.leaveTypeItem
  904. }
  905. if(this.departmentSel.length != 0){
  906. item.departmentId = this.departmentSel[this.departmentSel.length - 1]
  907. }
  908. if(this.userSelId != ''){
  909. item.userId = this.userSelId
  910. }
  911. // if()
  912. }else{
  913. item = {
  914. companyId: this.user.companyId,
  915. // leaveCode: '',
  916. // userId: '',
  917. pageIndex: this.page,
  918. // departmentId: ''
  919. }
  920. }
  921. this.http.post('/user-yearleave-setting/getDingDingLeaveQt',item,
  922. res => {
  923. if(res.code == 'ok'){
  924. this.vacationList = res.data.records
  925. this.total = res.data.total
  926. if(!e){
  927. this.leaveTypeList = res.data.leaveTypeList
  928. this.leaveTypeItem = res.data.defaultLeaveType.leaveCode
  929. }
  930. this.loading = false
  931. }else {
  932. this.loading = false
  933. this.$message({
  934. message: res.msg,
  935. type: 'error'
  936. })
  937. }
  938. },err => {
  939. this.loading = false
  940. this.$message({
  941. message: err,
  942. type: 'error'
  943. })
  944. })
  945. },
  946. leaveTypeChange(){
  947. // console.log(this.leaveTypeItem);
  948. this.page = 1
  949. this.getVacationList(1)
  950. },
  951. getApproverList(){
  952. this.http.post('/project/getMyParticiPMList',{
  953. },res => {
  954. if(res.code == 'ok'){
  955. this.approverList = res.data
  956. if(this.approverList.length != 0){
  957. this.mustApprover = 'approver'
  958. }
  959. // console.log('list',res.data);
  960. }else {
  961. this.$message({
  962. message: res.msg,
  963. type: 'error'
  964. })
  965. }
  966. },error => {
  967. this.$message({
  968. message: error,
  969. type: 'error'
  970. })
  971. })
  972. },
  973. changeAltime(e){
  974. if(e == 0 && this.AlchangeP.length == 0){
  975. this.$message('请选择要批量设置的项')
  976. return
  977. }else if(e != 0){
  978. this.Alchange = JSON.parse(JSON.stringify(e))
  979. }
  980. this.Alshow = true
  981. },
  982. selPchg(e){
  983. this.AlchangeP = e
  984. },
  985. searchAl(){
  986. this.iAlDataS = []
  987. for (let i = 0; i < this.iAlData.length; i++) {
  988. if (this.iAlData[i].userName.indexOf(this.keywordAl) != -1) {
  989. this.iAlDataS.push(this.iAlData[i])
  990. }
  991. }
  992. },
  993. clearsearchAl(){
  994. this.iAlDataS = this.iAlData
  995. },
  996. delAltime(){
  997. this.Alshow = false
  998. this.Alchange = {yearDays:null,userId:null}
  999. },
  1000. chgAltime(){
  1001. let chgPar = {}
  1002. let userids = ''
  1003. let Alpost = ''
  1004. if(this.Alchange.userId == null && this.AlchangeP != []){
  1005. Alpost = "/user-yearleave-setting/saveBatch"
  1006. for (let i = 0; i < this.AlchangeP.length; i++) {
  1007. userids = userids + "," + this.AlchangeP[i].userId
  1008. }
  1009. chgPar = {userIds: userids.slice(1), companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
  1010. }else {
  1011. Alpost = "/user-yearleave-setting/save"
  1012. userids = this.Alchange.userId
  1013. chgPar = {userId: userids, companyId: this.user.companyId, yearDays: this.Alchange.yearDays}
  1014. }
  1015. this.http.post(Alpost,chgPar,
  1016. res => {
  1017. if(res.code == "ok"){
  1018. this.Alshow = false,
  1019. this.Alchange = {yearDays:null,userId:null},
  1020. this.AlchangeP = []
  1021. this.getAl()
  1022. }else{
  1023. this.$message({
  1024. message: res.msg,
  1025. type: "error"
  1026. })
  1027. }
  1028. },
  1029. error => {
  1030. this.Alshow = false
  1031. this.$message({
  1032. message: error,
  1033. type: "error"
  1034. })
  1035. }
  1036. )
  1037. },
  1038. getAl(){
  1039. this.http.get('/user-yearleave-setting/list',
  1040. res => {
  1041. if(res.code == "ok"){
  1042. this.iAlData = res.data
  1043. this.iAlDataS = this.iAlData
  1044. if(this.apk2 == 6){
  1045. this.selAl()
  1046. }
  1047. } else {
  1048. this.$message({
  1049. message: res.msg,
  1050. type: "error"
  1051. })
  1052. }
  1053. },
  1054. error => {
  1055. this.Alshow = false
  1056. this.$message({
  1057. message: error,
  1058. type: "error"
  1059. })
  1060. }
  1061. )
  1062. },
  1063. selAl(){
  1064. let e = this.$refs.selectAl.getCheckedNodes()[0]
  1065. if(e == undefined){
  1066. this.iAlDataS = this.iAlData
  1067. }else{
  1068. this.iAlDataS = []
  1069. for (let i = 0; i < this.iAlData.length; i++) {
  1070. if (e.label == this.iAlData[i].department) {
  1071. this.iAlDataS.push(this.iAlData[i])
  1072. }
  1073. }
  1074. }
  1075. },
  1076. // ---------
  1077. handleNodeClick(data) {
  1078. if(this.depData == null || data.id != this.depData.id) {
  1079. this.depData = data;
  1080. // console.log("depdata",this.depData);
  1081. this.getSettings();
  1082. }
  1083. },
  1084. getSettings() {
  1085. this.http.post('/audit-workflow-setting/get',{deptId: this.depData.id,type: 1},
  1086. res => {
  1087. this.listLoading = false;
  1088. if (res.code == "ok") {
  1089. this.dataArray = res.data;
  1090. // console.log("请求1",res.data);
  1091. } else {
  1092. this.$message({
  1093. message: res.msg,
  1094. type: "error"
  1095. });
  1096. }
  1097. },
  1098. error => {
  1099. this.listLoading = false;
  1100. this.$message({
  1101. message: error,
  1102. type: "error"
  1103. });
  1104. }
  1105. );
  1106. },
  1107. // 获取部门列表
  1108. getDepartment() {
  1109. this.http.post( this.port.manage.depList, {},
  1110. res => {
  1111. if (res.code == "ok") {
  1112. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  1113. this.sdata = list;
  1114. this.soption = [
  1115. {value: 1 , label : "部门" , children : this.changeArr(list1)},
  1116. {value: 2 , label : "指定人员",children : this.susers}
  1117. ]
  1118. this.Nsdata = list1
  1119. } else {
  1120. this.$message({
  1121. message: res.msg,
  1122. type: "error"
  1123. });
  1124. }
  1125. },
  1126. error => {
  1127. this.$message({
  1128. message: error,
  1129. type: "error"
  1130. });
  1131. });
  1132. },
  1133. changeArr(arr) {
  1134. for (var i = 0; i < arr.length; i++) {
  1135. if(arr[i].id != -1 && arr[i].id != 0) {
  1136. if (arr[i].children != null && arr[i].children.length>0) {
  1137. arr[i].children = this.changeArr(arr[i].children);
  1138. }
  1139. arr[i].id && (arr[i].value = arr[i].id);
  1140. delete arr[i].id;
  1141. }
  1142. }
  1143. for(var i in arr) {
  1144. if(arr[i].id == -1 || arr[i].id == 0) {
  1145. arr.splice(i,1)
  1146. }
  1147. }
  1148. return arr;
  1149. },
  1150. showNodeDialog(index) {
  1151. this.isAdd = true;
  1152. this.sindex = index;
  1153. this.curDeptId = null;
  1154. this.curUserId = null;
  1155. this.dialogVisible = true;
  1156. },
  1157. editNodeDialog(index, item) {
  1158. //检查是否可编辑
  1159. this.http.post('/audit-workflow-setting/checkNodeInUse',{auditDeptId: item.auditDeptId, deptId: this.depData.id,type: 1},
  1160. res => {
  1161. this.listLoading = false;
  1162. if (res.code == "ok") {
  1163. this.isAdd = false;
  1164. this.sindex = index;
  1165. this.curUserId = item.userId;
  1166. this.dialogVisible = true;
  1167. this.curDeptId = item.auditDeptId;
  1168. } else {
  1169. this.$message({
  1170. message: res.msg,
  1171. type: "error"
  1172. });
  1173. }
  1174. },
  1175. error => {
  1176. this.listLoading = false;
  1177. this.$message({
  1178. message: error,
  1179. type: "error"
  1180. });
  1181. }
  1182. );
  1183. },
  1184. addNode() {
  1185. this.dialogVisible = false;
  1186. if (this.curDeptId == null) return;
  1187. var node = this.$refs.deptCascader.getCheckedNodes()[0];
  1188. // console.log("node",node);
  1189. if (this.isAdd) {
  1190. if(node.path[0] == 1){
  1191. var node = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1192. }else if(node.path[0] == 2){
  1193. var node = {userId: node.value, userName: node.label, auditorType: 2};
  1194. }
  1195. this.dataArray.splice(this.sindex, 0, node);
  1196. } else {
  1197. //编辑
  1198. this.dataArray[this.sindex].auditDeptId = node.value;
  1199. this.dataArray[this.sindex].auditDeptName = node.label;
  1200. }
  1201. },
  1202. deleteNode() {
  1203. this.dialogVisible = false;
  1204. this.dataArray.splice(this.sindex, 1);
  1205. },
  1206. submitInsert() {
  1207. this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id, type:1},
  1208. res => {
  1209. this.listLoading = false;
  1210. if (res.code == "ok") {
  1211. this.$message({
  1212. message: '保存成功',
  1213. type: "success"
  1214. });
  1215. } else {
  1216. this.$message({
  1217. message: res.msg,
  1218. type: "error"
  1219. });
  1220. }
  1221. },
  1222. error => {
  1223. this.listLoading = false;
  1224. this.$message({
  1225. message: error,
  1226. type: "error"
  1227. });
  1228. }
  1229. );
  1230. },
  1231. //
  1232. approve(item) {
  1233. //审核通过
  1234. this.http.post('/leave-sheet/approve', {id:item.id
  1235. },
  1236. res => {
  1237. if (res.code == "ok") {
  1238. this.bills(true);
  1239. } else {
  1240. this.$message({
  1241. message: res.msg,
  1242. type: "error"
  1243. });
  1244. }
  1245. },
  1246. error => {
  1247. this.$message({
  1248. message: error,
  1249. type: "error"
  1250. });
  1251. });
  1252. },
  1253. deny(item) {
  1254. //审核驳回
  1255. this.http.post('/leave-sheet/deny', {id:item.id
  1256. },
  1257. res => {
  1258. if (res.code == "ok") {
  1259. this.bills(true);
  1260. } else {
  1261. this.$message({
  1262. message: res.msg,
  1263. type: "error"
  1264. });
  1265. }
  1266. },
  1267. error => {
  1268. this.$message({
  1269. message: error,
  1270. type: "error"
  1271. });
  1272. });
  1273. },
  1274. getUsers() {
  1275. this.http.post(this.port.manage.list, {
  1276. departmentId: -1,
  1277. pageIndex: 1,
  1278. pageSize: 99999
  1279. },
  1280. res => {
  1281. if (res.code == "ok") {
  1282. this.users = res.data.records;
  1283. for (let i = 0; i < this.users.length; i++) {
  1284. this.susers.push({value:this.users[i].id,label:this.users[i].name})
  1285. }
  1286. //只能自己填报自己的请假单
  1287. this.addForm.ownerId = this.user.id;
  1288. this.addForm.status = 1;
  1289. this.addForm.tel = this.user.phone
  1290. } else {
  1291. this.$message({
  1292. message: res.msg,
  1293. type: "error"
  1294. });
  1295. }
  1296. },
  1297. error => {
  1298. this.$message({
  1299. message: error,
  1300. type: "error"
  1301. });
  1302. });
  1303. },
  1304. // 员工请假填报点击事件
  1305. ssl(index) {
  1306. this.ins = index;
  1307. this.addForm.leaveType = index
  1308. },
  1309. staffs(key, keyPath) {
  1310. // console.log("keypath",key,keyPath)
  1311. if (keyPath[0] == '1') {
  1312. this.displayTable = false;
  1313. this.apk = false
  1314. } else if(keyPath[0] == '2' || keyPath[0] == '3') {
  1315. this.displayTable = true;
  1316. this.apk = false
  1317. } else if(keyPath[0] == '4'){
  1318. this.displayTable = true;
  1319. this.apk = true
  1320. this.apk2 = 4
  1321. this.statistical()
  1322. } else if(keyPath[0] == '5'){
  1323. this.displayTable = true;
  1324. this.apk2 = 5
  1325. this.apk = true
  1326. } else if(keyPath[0] == '6'){
  1327. this.NcurDeptId = []
  1328. this.displayTable = true;
  1329. this.apk2 = 6
  1330. this.apk = true
  1331. this.getAl()
  1332. } else if(keyPath[0] == '7'){
  1333. this.displayTable = true;
  1334. this.apk = false
  1335. this.bills(false,2)
  1336. } else if(keyPath[0] == '8'){
  1337. this.apk2 = 8
  1338. this.displayTable = true
  1339. this.apk = true
  1340. this.userSelId = ''
  1341. this.page = 1
  1342. this.departmentSel = []
  1343. this.getVacationList()
  1344. this.getDepartmentOptions()
  1345. }
  1346. },
  1347. bills(audit, tr){
  1348. if(tr) {
  1349. this.code = ''
  1350. this.createDate = ''
  1351. // this.ownerIds = ''
  1352. this.type = ''
  1353. if(tr == 1) {
  1354. this.falg = 1
  1355. this.code = 1
  1356. } else if(tr == 2) {
  1357. this.code = ''
  1358. this.falg = 0
  1359. } else {
  1360. this.falg = 0
  1361. }
  1362. } else {
  1363. this.falg = false
  1364. }
  1365. this.tableData = []
  1366. this.displayTable = true;
  1367. this.isAuditList = audit;
  1368. this.loading = true
  1369. var param = {pageIndex: this.page,
  1370. pageSize: this.size,
  1371. status: this.code,
  1372. createDate: this.createDate,
  1373. ownerId: this.ownerIds,
  1374. leaveType: this.type,
  1375. };
  1376. if (this.isAuditList) {
  1377. param.status = 1;
  1378. }
  1379. this.list = [];
  1380. // this.total = 0;
  1381. this.http.post('/leave-sheet/list', param,
  1382. res => {
  1383. if (res.code == "ok") {
  1384. this.tableData = res.data.records
  1385. this.total = res.data.total
  1386. this.loading = false
  1387. } else {
  1388. this.loading = false
  1389. this.$message({
  1390. message: res.msg,
  1391. type: "error"
  1392. });
  1393. }
  1394. },
  1395. error => {
  1396. this.loading = false
  1397. this.$message({
  1398. message: error,
  1399. type: "error"
  1400. });
  1401. });
  1402. },
  1403. billss() {
  1404. var param = {pageIndex: this.page,
  1405. pageSize: this.size,
  1406. status: this.code,
  1407. startDate: this.createDate,
  1408. ownerId: this.ownerIds,
  1409. leaveType: this.type,
  1410. };
  1411. this.http.post('/leave-sheet/list', param,
  1412. res => {
  1413. if (res.code == "ok") {
  1414. this.tableData = res.data.records
  1415. this.total = res.data.total
  1416. this.loading = false
  1417. } else {
  1418. this.loading = false
  1419. this.$message({
  1420. message: res.msg,
  1421. type: "error"
  1422. });
  1423. }
  1424. },
  1425. error => {
  1426. this.loading = false
  1427. this.$message({
  1428. message: error,
  1429. type: "error"
  1430. });
  1431. });
  1432. },
  1433. // 判断日期是否补零了
  1434. buling(das) {
  1435. var rqi = das.split('-')
  1436. rqi[1].length <= 1 ? rqi[1] = '0' + rqi[1] : rqi[1] = rqi[1]
  1437. rqi[2].length <= 1 ? rqi[2] = '0' + rqi[2] : rqi[2] = rqi[2]
  1438. var zong = rqi[0] + '-' + rqi[1] + '-' + rqi[2]
  1439. return zong
  1440. },
  1441. submits(){
  1442. // console.log(this.addForm)
  1443. // return
  1444. this.$refs.addForm.validate(valid => {
  1445. this.addForm.endDate = this.buling(this.addForm.endDate)
  1446. this.addForm.startDate = this.buling(this.addForm.startDate)
  1447. // this.addForm.projectAuditorJson = JSON.stringify(this.addForm.projectAuditorJson)
  1448. if (valid) {
  1449. this.http.post('/leave-sheet/add', this.addForm,
  1450. res => {
  1451. if (res.code == "ok") {
  1452. this.$message({
  1453. message: '填报成功',
  1454. type: "success"
  1455. });
  1456. this.addForm.timeType = '0'
  1457. this.addForm.startDate = this.getCurrentTime()
  1458. this.addForm.endDate = this.getCurrentTime()
  1459. this.addForm.timeDays = 1
  1460. this.addForm.leaveType = 0
  1461. this.addForm.timeHours = 8
  1462. this.addForm.remark = ''
  1463. this.addForm.projectAuditorJson = ''
  1464. // this.addForm = {
  1465. // timeType: '0',
  1466. // startDate: this.getCurrentTime(),
  1467. // endDate: this.getCurrentTime(),
  1468. // timeDays: 1,
  1469. // leaveType: 0,
  1470. // ownerId: '',
  1471. // // indate: this.getCurrentTime(),
  1472. // timeHours: 8,
  1473. // tel: '',
  1474. // remark: '',
  1475. // projectAuditorJson: ''
  1476. // }
  1477. this.flg = true
  1478. } else {
  1479. this.$message({
  1480. message: res.msg,
  1481. type: "error"
  1482. });
  1483. }
  1484. },
  1485. error => {
  1486. this.$message({
  1487. message: error,
  1488. type: "error"
  1489. });
  1490. });
  1491. } else {
  1492. return false;
  1493. }
  1494. });
  1495. },
  1496. txselts(a,b){
  1497. this.selts()
  1498. // console.log('txselts',this.addForm.ownerId);
  1499. if(a == 6 && this.addForm.ownerId != ''){
  1500. this.http.post('/leave-sheet/getOTAvaiDays',{ userId:b },
  1501. res => {
  1502. if(res.code == "ok") {
  1503. // console.log('post',res.data);
  1504. if(res.data < 0.5){
  1505. this.txselnum = 0
  1506. }else{
  1507. this.txselnum = res.data.toFixed(1)
  1508. }
  1509. } else {
  1510. this.$message({
  1511. message: res.msg,
  1512. type: "error"
  1513. });
  1514. }
  1515. },
  1516. error => {
  1517. this.$message({
  1518. message: error,
  1519. type: "error"
  1520. });
  1521. })
  1522. }
  1523. },
  1524. selts() {
  1525. for(var i in this.users) {
  1526. if(this.users[i].id == this.addForm.ownerId) {
  1527. this.addForm.tel = this.users[i].phone
  1528. }
  1529. }
  1530. },
  1531. chanRadio() {
  1532. // console.log(this.addForm.timeType)
  1533. if(this.addForm.timeType == '0') {
  1534. this.flg = true
  1535. this.addForm.startDate = this.getCurrentTime()
  1536. this.addForm.endDate = this.getCurrentTime()
  1537. this.addForm.timeType = '0'
  1538. this.addForm.timeDays = '1'
  1539. this.addForm.timeHours = '8'
  1540. } else {
  1541. this.flg = false
  1542. this.addForm.startDate = this.getCurrentTime()
  1543. this.addForm.endDate = this.getCurrentTime()
  1544. this.addForm.timeType = '1'
  1545. this.addForm.timeHours = 1,
  1546. this.addForm.timeDays = 1
  1547. }
  1548. },
  1549. // 计算日期
  1550. datas() {
  1551. // this.addForm.timeDays = this.DateDiff(this.addForm.startDate, this.addForm.endDate)
  1552. if(this.addForm.startDate > this.addForm.endDate) {
  1553. this.addForm.endDate = this.addForm.startDate
  1554. }
  1555. this.addForm.timeDays = this.countWorkDay(this.addForm.startDate, this.addForm.endDate)
  1556. this.timeChoose = this.addForm.timeDays
  1557. this.addForm.timeHours = this.addForm.timeDays * 8
  1558. },
  1559. datasss() {
  1560. // console.log(123)
  1561. this.addForm.endDate = this.addForm.startDate
  1562. },
  1563. DateDiff(sDate1, sDate2){
  1564. var aDate, oDate1, oDate2, iDays
  1565. aDate = sDate1.split("-")
  1566. oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1567. aDate = sDate2.split("-")
  1568. oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
  1569. iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24)
  1570. return iDays + 1
  1571. },
  1572. stringToDate(dateString){
  1573. dateString = dateString.split('-');
  1574. return new Date(dateString[0], dateString[1] - 1, dateString[2]);
  1575. },
  1576. countWorkDay(date1, date2){
  1577. date1 = this.stringToDate(date1);
  1578. date2 = this.stringToDate(date2);
  1579. var delta = (date2 - date1) / (1000 * 60 * 60 * 24) + 1; // 计算出总时间
  1580. var weeks = 0;
  1581. for(var i = 0; i < delta; i++){
  1582. if(date1.getDay() == 0 || date1.getDay() == 6) weeks ++; // 若为周六或周天则加1
  1583. date1 = date1.valueOf();
  1584. date1 += 1000 * 60 * 60 * 24;
  1585. date1 = new Date(date1);
  1586. }
  1587. return delta - weeks;
  1588. },
  1589. chufas() {
  1590. this.billss()
  1591. },
  1592. // 时间
  1593. getTadeTime() {
  1594. var time = new Date();
  1595. return time.getHours() +':00:00'
  1596. },
  1597. // 日期
  1598. getCurrentTime() {
  1599. var _this = this;
  1600.   let yy = new Date().getFullYear();
  1601.   let mm = new Date().getMonth()+1;
  1602.   let dd = new Date().getDate();
  1603.   _this.gettime = yy +'-'+ mm +'-'+ dd;
  1604.   return _this.gettime
  1605. },
  1606. getCurrentTimes() {
  1607. var _this = this;
  1608.   let yy = new Date().getFullYear();
  1609.   let mm = new Date().getMonth()+1;
  1610.   let dd = new Date().getDate();
  1611.   _this.gettime = yy+'-'+mm+'-'+'01';
  1612.   return _this.gettime
  1613. },
  1614. chanSele() {
  1615. this.addForm.timeHours = parseInt(this.addForm.timeHours)
  1616. },
  1617. handleSizeChange(val){
  1618. this.size = val;
  1619. this.bills()
  1620. },
  1621. handleCurrentChange(val) {
  1622. // console.log(val, 1, '1')
  1623. this.page = val;
  1624. this.bills()
  1625. },
  1626. vacationSizeChange(val){
  1627. this.size = val
  1628. this.getVacationList(1)
  1629. },
  1630. vacationCurrentChange(val){
  1631. this.page = val
  1632. this.getVacationList(1)
  1633. },
  1634. statistical() {
  1635. this.loading = true
  1636. this.http.post('/leave-sheet/summaryData', {
  1637. keyword: this.keyword,
  1638. startDate: this.statData,
  1639. endDate: this.endData
  1640. },
  1641. res => {
  1642. if (res.code == "ok") {
  1643. this.statisticalList = res.data
  1644. this.loading = false
  1645. } else {
  1646. this.loading = false
  1647. this.$message({
  1648. message: res.msg,
  1649. type: "error"
  1650. });
  1651. }
  1652. },
  1653. error => {
  1654. this.$message({
  1655. message: error,
  1656. type: "error"
  1657. });
  1658. });
  1659. },
  1660. //
  1661. inputs() {
  1662. var str = this.addForm.timeDays + ''
  1663. if(str.indexOf('.') != '-1') {
  1664. var s = str.split('.')[0]
  1665. var st = str.split('.')[1]
  1666. var sts = st.split('')
  1667. this.addForm.timeDays = s + '.' + sts[0]
  1668. }
  1669. },
  1670. inputss() {
  1671. if(this.addForm.timeHours <= 0) {
  1672. this.addForm.timeHours = 1
  1673. } else if(this.addForm.timeHours > 8) {
  1674. this.addForm.timeHours = 8
  1675. } else {
  1676. if(this.addForm.timeHours.indexOf('.') != '-1') {
  1677. var str = this.addForm.timeHours
  1678. // console.log(str)
  1679. if(str.indexOf('.') != '-1') {
  1680. var s = str.split('.')[0]
  1681. var st = str.split('.')[1]
  1682. var sts = st.split('')
  1683. this.addForm.timeHours = s + '.' + sts[0]
  1684. }
  1685. }
  1686. }
  1687. // console.log(this.addForm)
  1688. },
  1689. deletes(e) {
  1690. this.$confirm("确认要删除吗?", "提示", {
  1691. //type: 'warning'
  1692. }).then(() => {
  1693. this.http.post('/leave-sheet/delete', {id:e.id},
  1694. res => {
  1695. if (res.code == "ok") {
  1696. this.bills();
  1697. this.$message({
  1698. message: '删除成功',
  1699. type: "success"
  1700. });
  1701. } else {
  1702. this.$message({
  1703. message: res.msg,
  1704. type: "error"
  1705. });
  1706. }
  1707. },
  1708. error => {
  1709. this.$message({
  1710. message: error,
  1711. type: "error"
  1712. });
  1713. });
  1714. });
  1715. },
  1716. editor(items) {
  1717. this.dialog = true
  1718. this.addForm.ownerId = items.ownerId
  1719. this.addForm.tel = items.tel
  1720. this.addForm.timeType = items.timeType + ''
  1721. this.addForm.startDate = items.startDate
  1722. this.addForm.endDate = items.endDate
  1723. this.addForm.timeDays = items.timeDays
  1724. this.addForm.timeHours = items.timeHours
  1725. this.addForm.remark = items.remark
  1726. this.affId = items.id
  1727. },
  1728. determine () {
  1729. var adl = this.addForm
  1730. adl.id = this.affId
  1731. this.http.post('/leave-sheet/add', adl,
  1732. res => {
  1733. if (res.code == "ok") {
  1734. this.dialog = false
  1735. this.bills();
  1736. this.addForm = {
  1737. timeType: '0',
  1738. startDate: this.getCurrentTime(),
  1739. endDate: this.getCurrentTime(),
  1740. timeDays: 1,
  1741. leaveType: 0,
  1742. timeHours: '8',
  1743. tel: '',
  1744. remark: ''
  1745. }
  1746. this.getUsers()
  1747. } else {
  1748. this.$message({
  1749. message: res.msg,
  1750. type: "error"
  1751. });
  1752. }
  1753. },
  1754. error => {
  1755. this.$message({
  1756. message: error,
  1757. type: "error"
  1758. });
  1759. });
  1760. },
  1761. bangd() {
  1762. this.addForm = {
  1763. timeType: '0',
  1764. startDate: this.getCurrentTime(),
  1765. endDate: this.getCurrentTime(),
  1766. timeDays: 1,
  1767. leaveType: 0,
  1768. timeHours: '8',
  1769. tel: '',
  1770. remark: ''
  1771. }
  1772. this.getUsers()
  1773. }
  1774. }
  1775. };
  1776. </script>
  1777. <style scoped>
  1778. .addNode {
  1779. cursor:pointer;
  1780. }
  1781. .addNode:hover {
  1782. color:#20a0ff;
  1783. }
  1784. .apls {
  1785. width: 200px;
  1786. white-space:nowrap;
  1787. overflow:hidden;
  1788. text-overflow:ellipsis;
  1789. }
  1790. .tups {
  1791. width: 100%;
  1792. height: 25px;
  1793. position: relative;
  1794. z-index: 99;
  1795. overflow: hidden;
  1796. }
  1797. .tups img {
  1798. height: 25px !important;
  1799. position: relative;
  1800. z-index: 99;
  1801. }
  1802. .viewer-canvas {
  1803. position: absolute;
  1804. z-index: 9 !important;
  1805. }
  1806. .icl {
  1807. margin-top: -25px !important;
  1808. }
  1809. /* 费用报销标题 */
  1810. .headine {
  1811. width: 100%;
  1812. height: 46.4px;
  1813. line-height: 46.4px;
  1814. background: #fff;
  1815. box-sizing: border-box;
  1816. }
  1817. .headine h3 {
  1818. margin: 0;
  1819. display: inline-block;
  1820. box-sizing: border-box;
  1821. color: #999;
  1822. }
  1823. .headine p {
  1824. display: inline-block;
  1825. margin: 0;
  1826. }
  1827. /* /费用报销标题 */
  1828. .sidebars {
  1829. height: 100%;
  1830. position: absolute;
  1831. border-right: 1px solid #E6E6E6;
  1832. z-index: 2;
  1833. top: 0;
  1834. }
  1835. .sidebars h3 {
  1836. margin: 0;
  1837. line-height: 45px;
  1838. background: #ffffff;
  1839. font-weight: normal;
  1840. color: #666;
  1841. padding-left: 20px;
  1842. }
  1843. .sidebars .el-col-12 {
  1844. width: 100%
  1845. }
  1846. .public {
  1847. height: 230px;
  1848. border-bottom: 1px solid #ddd;
  1849. }
  1850. .public .el-form-item {
  1851. display: inline-block;
  1852. }
  1853. .pu_button {
  1854. text-align: right;
  1855. width: 100%;
  1856. padding: 24px 30px;
  1857. box-sizing: border-box;
  1858. }
  1859. .pu_bu_x .pu_bu_t {
  1860. display: inline-block;
  1861. }
  1862. .pu_bu_x {
  1863. margin-right: 20px;
  1864. color: #20A0F7;
  1865. cursor: pointer;
  1866. }
  1867. .pu_bu_t {
  1868. color: #20A0F7;
  1869. cursor: pointer;
  1870. display: block;
  1871. float: right;
  1872. position:
  1873. relative;
  1874. top: -20px;
  1875. right: 63px;
  1876. }
  1877. .pu_table {
  1878. margin-left: 10px;
  1879. }
  1880. .pu_bu_t:hover {
  1881. color: #7bbcff;
  1882. }
  1883. .pu_bu_x:hover {
  1884. color: #7bbcff;
  1885. }
  1886. /* 我的单据报销凭证 */
  1887. .staff{
  1888. border-left: 1px solid #fff;
  1889. border-top: 1px solid #fff;
  1890. border-right: 1px solid #fff;
  1891. background: #fff;
  1892. }
  1893. /* */
  1894. .sdat{
  1895. display: inline-block;
  1896. width: 260px;
  1897. margin-left: 13px;
  1898. }
  1899. .messages .el-form-item{
  1900. display: inline-block;
  1901. }
  1902. .messages .el-date-editor.el-input, .el-date-editor.el-input__inner{
  1903. width: 190px;
  1904. }
  1905. /* 我的报销单据 */
  1906. .search {
  1907. position: relative;
  1908. top: 20px;
  1909. left: 20px;
  1910. }
  1911. .tables {
  1912. margin-top: 50px;
  1913. box-sizing: border-box;
  1914. padding: 10px;
  1915. }
  1916. .informant .el-form-item {
  1917. display: inline-block;
  1918. }
  1919. /* 侧边栏收索 */
  1920. .side {
  1921. position: absolute;
  1922. z-index: 2;
  1923. border-right: 2px solid #DDDDDD;
  1924. height: 100%;
  1925. top: 0;
  1926. width: 0;
  1927. }
  1928. .side .spans {
  1929. width: 20px;
  1930. height: 30px;
  1931. border: 1px solid #DDDDDD;
  1932. box-sizing: border-box;
  1933. position: absolute;
  1934. top: 50%;
  1935. margin-top: -50%;
  1936. text-align: center;
  1937. z-index: 1;
  1938. background: #fff;
  1939. }
  1940. .side .spans i{
  1941. margin-top: 7px;
  1942. color: #C0BFBF
  1943. }
  1944. .side:hover {
  1945. border-right: 2px solid #20A0FF;
  1946. }
  1947. .side:hover .spans {
  1948. border: 1px solid #20A0FF;
  1949. background: #20A0FF;
  1950. }
  1951. .side:hover .spans i{
  1952. color: #fff;
  1953. }
  1954. /* 右边整体页面 */
  1955. .contents {
  1956. height: 100%;
  1957. /* padding: 30px; */
  1958. background: #F7F7F7;
  1959. /* position: absolute; */
  1960. }
  1961. .submits {
  1962. margin-left: 50%;
  1963. }
  1964. .waiting {
  1965. color:orange;
  1966. }
  1967. .rejected {
  1968. color:red;
  1969. }
  1970. /* 请假模块 */
  1971. .tops {
  1972. width: 100%;
  1973. position: relative;
  1974. background: #f7f7f7;
  1975. box-sizing: border-box;
  1976. padding: 20px 0 0 200px;
  1977. }
  1978. .ctons {
  1979. /* width: 86%; */
  1980. height: 92%;
  1981. overflow: hidden;
  1982. background: #fff;
  1983. padding: 30px 40px;
  1984. box-sizing: border-box;
  1985. }
  1986. .ctons .el-form-item {
  1987. display: inline-block;
  1988. }
  1989. .line {
  1990. text-align: center;
  1991. margin: 0 6px
  1992. }
  1993. .poss {
  1994. position: fixed;
  1995. bottom: 4px;
  1996. right: 1%;
  1997. box-sizing: border-box;
  1998. }
  1999. .flex {
  2000. display: flex;
  2001. padding: 0 0 20px 0;
  2002. border-bottom: 1px solid #f2f2f2;
  2003. }
  2004. .flex span {
  2005. color: #606266;
  2006. display: inline-block;
  2007. margin: 0 10px 0 20px;
  2008. }
  2009. </style>