awayOffice.vue 100 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184
  1. <template>
  2. <section>
  3. <div class="sidebars" ref="sidebars" style="width: 200px;display: block;background: #fff" v-if="!isSyncData">
  4. <h3><i class="iconfont firerock-iconbaoxiao" style="padding-right: 10px"></i>{{ $t('navigation.evectionManagement') }}</h3>
  5. <el-divider ></el-divider>
  6. <el-col :span="12">
  7. <el-menu default-active="1" class="el-menu-vertical-demo" @select="staffs" background-color="#ffffff" text-color="#666666" active-text-color="#20A0FF" style="width:100%">
  8. <el-menu-item index="1" v-if="permissions.awayOfficeFil">
  9. <i class="iconfont firerock-icontianbao"></i>
  10. <span slot="title">{{ $t('businesstriisallowed') }}</span>
  11. </el-menu-item>
  12. <el-menu-item index="2" @select="bills" @click="auditList()" v-if="permissions.awayOfficeAudit">
  13. <i class="iconfont firerock-iconbaoxiaodan"></i>
  14. <span slot="title">出差审核</span>
  15. </el-menu-item>
  16. <el-menu-item index="3" @select="bills" @click="bills(false, 2)" >
  17. <i class="iconfont firerock-iconbaoxiaodan"></i>
  18. <span slot="title">{{ $t('businesstriplist') }}</span>
  19. </el-menu-item>
  20. <el-menu-item index="4" v-if="permissions.awayOfficeStatistical">
  21. <template slot="title">
  22. <i class="iconfont firerock-icontianbao"></i>
  23. <span slot="title">{{ $t('businessstatistics') }}</span>
  24. </template>
  25. </el-menu-item>
  26. <el-menu-item index="5" v-if="permissions.awayOfficeProcess">
  27. <template slot="title">
  28. <i class="iconfont firerock-iconliucheng"></i>
  29. <span slot="title">{{ $t('businesstriApprovalProcess') }}</span>
  30. </template>
  31. </el-menu-item>
  32. </el-menu>
  33. </el-col>
  34. </div>
  35. <div class="contents">
  36. <div ref="headine" class="headine" v-if="!displayTable">
  37. <h3 ref="headHe" style="padding-left: 220px">{{ $t('businesstriisallowed') }}</h3>
  38. </div>
  39. <!-- 出差填报 -->
  40. <div class="tops" v-if="!displayTable && apk == 0">
  41. <div class="ctons">
  42. <el-form ref="addformAO" v-loading="formloading" :model="addform" label-width="80px" :rules="formrules" style="width:700px">
  43. <!-- 出差事由 -->
  44. <el-form-item :label="$t('travelreason')" prop="reason" style="width:100%">
  45. <el-input v-model="addform.reason" style="width: 555px" maxlength="25" type="text" show-word-limit></el-input>
  46. </el-form-item>
  47. <!-- 维度选择添加 -->
  48. <!-- <el-form-item :label="$t('screening.inputProject')" style="width:300px;margin-right:30px" prop="projectId">
  49. <el-select style="width:100%" @change="getwuduList(1)" v-model="addform.projectId" filterable clearable :placeholder="$t('defaultText.pleaseChoose')" >
  50. <el-option
  51. v-for="item in projectList"
  52. :key="item.id"
  53. :label="item.projectName"
  54. :value="item.id">
  55. </el-option>
  56. </el-select>
  57. </el-form-item> -->
  58. <el-form-item :label="wuduData.customDegreeName"
  59. v-if="addform.projectId != null && wuduData.customDegreeActive == 1"
  60. style="width:300px;margin-right:30px"
  61. prop="degreeId">
  62. <el-select style="width:100%" v-model="addform.degreeId" filterable clearable :placeholder="$t('defaultText.pleaseChoose')" >
  63. <el-option
  64. v-for="item in wuduList"
  65. :key="item.id"
  66. :label="item.name"
  67. :value="item.id">
  68. </el-option>
  69. </el-select>
  70. </el-form-item>
  71. <!-- <span>行程</span> -->
  72. <!-- 交通工具 -->
  73. <el-form-item :label="$t('traffictools')" style="width:100%">
  74. <el-radio-group v-model="addform.way">
  75. <el-radio :label="0">{{ $t('plane') }}</el-radio>
  76. <el-radio :label="1">{{ $t('train') }}</el-radio>
  77. <el-radio :label="2">{{ $t('car') }}</el-radio>
  78. <el-radio :label="3">{{ $t('ship') }}</el-radio>
  79. <el-radio :label="4">{{ $t('leave.other') }}</el-radio>
  80. </el-radio-group>
  81. </el-form-item>
  82. <!-- 出发城市 -->
  83. <el-form-item :label="$t('departurecity')" style="width:300px;margin-right:30px" prop="cityFrom">
  84. <el-select style="width:100%" v-model="addform.cityFrom" filterable clearable :placeholder="$t('defaultText.pleaseChoose')" >
  85. <el-option
  86. v-for="item in cityList"
  87. :key="item.value"
  88. :label="item.label"
  89. :value="item.label">
  90. </el-option>
  91. </el-select>
  92. </el-form-item>
  93. <!-- 目的城市 -->
  94. <el-form-item :label="$t('destinationcity')" style="width:300px" prop="cityTo">
  95. <el-select style="width:100%" v-model="addform.cityTo" filterable clearable :placeholder="$t('defaultText.pleaseChoose')">
  96. <el-option
  97. v-for="item in cityList"
  98. :key="item.value"
  99. :label="item.label"
  100. :value="item.label">
  101. </el-option>
  102. </el-select>
  103. </el-form-item>
  104. <!-- 开始时间 -->
  105. <el-form-item :label="$t('starttimes')" style="width:300px;margin-right:30px" prop="startDate">
  106. <el-date-picker
  107. type="date"
  108. :placeholder="$t('time.startDate')"
  109. value-format="yyyy-MM-dd"
  110. v-model="addform.startDate"
  111. style="width:100%"
  112. @change="datechg(1)">
  113. </el-date-picker>
  114. </el-form-item>
  115. <!-- 结束时间 -->
  116. <el-form-item :label="$t('time.endTime')" style="width:300px" prop="endDate">
  117. <el-date-picker
  118. type="date"
  119. :placeholder="$t('time.endDate')"
  120. value-format="yyyy-MM-dd"
  121. v-model="addform.endDate"
  122. style="width:100%"
  123. @change="datechg(0)">
  124. </el-date-picker>
  125. </el-form-item>
  126. <!-- 单程/往返 -->
  127. <el-form-item :label="$t('roundtrip')" style="width:300px;margin-right:30px">
  128. <el-radio-group v-model="addform.goBack">
  129. <el-radio :label="0">{{ $t('oneway') }}</el-radio>
  130. <el-radio :label="1">{{ $t('backandforth') }}</el-radio>
  131. </el-radio-group>
  132. </el-form-item>
  133. <!-- 出差天数 -->
  134. <el-form-item :label="$t('traveldays')" style="width:300px">
  135. <el-input type="number" :placeholder="$t('automaticcalculation')" v-model="addform.dayCount" min="0" style="width:100%"></el-input>
  136. </el-form-item>
  137. <!-- 出差备注 -->
  138. <el-form-item :label="$t('travelnote')" style="width:635px">
  139. <el-input type="textarea" v-model="addform.remark" :rows="3" style="width: 100%" maxlength="100" show-word-limit></el-input>
  140. </el-form-item>
  141. <!--流程显示-->
  142. <el-form-item label="审批流程" style="width: 100%;color:#606266" >
  143. <span v-for="(item, index) in curWorkflowList" :key="item.id" >
  144. <span v-if="index>0"><i class="el-icon-right"></i></span>
  145. <span><i class="el-icon-s-custom"></i></span>
  146. <span v-if="user.userNameNeedTranslate == 1">
  147. <span v-if="item.auditorType == 1"><ww-open-data type='departmentName' :openid='item.auditDeptName' ></ww-open-data>(主要负责人)</span>
  148. <ww-open-data type='userName' :openid='item.userName' v-if="item.auditorType == 2"></ww-open-data>
  149. </span>
  150. <span v-if="user.userNameNeedTranslate == 0">
  151. {{item.auditorType == 1?(item.auditDeptName+'(主要负责人)'):item.userName}}
  152. </span>
  153. </span>
  154. </el-form-item>
  155. </el-form>
  156. <div>
  157. <p style="width:635px;text-align:center;">
  158. <el-button type="primary" @click="formsubmit('formrules')" size="mini">{{ $t('btn.submit') }}</el-button>
  159. </p>
  160. </div>
  161. </div>
  162. </div>
  163. <!-- 出差列表 -->
  164. <div class="tops" v-if="displayTable && apk == 0" :style="isSyncData ? 'padding-left:20px' : ''">
  165. <div class="ctons">
  166. <!-- 出差列表筛选 -->
  167. <div class="flex">
  168. <div>
  169. <el-select v-if="user.userNameNeedTranslate != 1" v-model="ownerIds" :placeholder="$t('pleaseselectbusinesstraveler')" clearable @change="billss(1)" style="width: 140px;margin-left:10px" size="small" filterable="true">
  170. <el-option
  171. v-for="item in users"
  172. :key="item.id"
  173. :label="item.name"
  174. :value="item.id">
  175. </el-option>
  176. </el-select>
  177. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="ownerIds" :clearable="true" :filterable="false" :distinction="'1'" :other="'1'" @selectCal="selectCal"></selectCat>
  178. </div>
  179. <div>
  180. <!-- <span style="color: #606266">{{ $t('traffictools') }}</span> -->
  181. <el-select v-model="type" :placeholder="$t('defaultText.pleaseChoose') + $t('traffictools')" clearable @change="billss(1)" style="width: 140px;margin-left:10px" size="small" filterable="true">
  182. <el-option :label="$t('plane')" :value="0"></el-option>
  183. <el-option :label="$t('train')" :value="1"></el-option>
  184. <el-option :label="$t('car')" :value="2"></el-option>
  185. <el-option :label="$t('ship')" :value="3"></el-option>
  186. <el-option :label="$t('leave.other')" :value="4"></el-option>
  187. </el-select>
  188. </div>
  189. <div>
  190. <!-- <span style="color: #606266">{{ $t('businessstate') }}</span> -->
  191. <el-select :disabled="falg" v-model="code" :placeholder="$t('defaultText.pleaseChoose') + $t('businessstate')" clearable @change="billss(1)" size="small" style="width: 140px;margin-left:10px" filterable="true">
  192. <el-option :label="$t('state.approved')" :value="0"></el-option>
  193. <el-option :label="$t('state.WaitingAudit')" :value="1"></el-option>
  194. <el-option :label="$t('btn.rejected')" :value="2"></el-option>
  195. <!-- <el-option :label="$t('state.undone')" :value="3"></el-option> -->
  196. </el-select>
  197. </div>
  198. <div>
  199. <!-- <span style="color: #606266">{{ $t('message.period') }}</span> -->
  200. <el-date-picker v-model="createDate" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" @change="billss(1)" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')" size="small" clearable style="width:280px;margin-left:10px"></el-date-picker>
  201. </div>
  202. <div style="line-height: 32px;margin: 0 20px;">
  203. <el-checkbox v-model="isOverTendays" @change="checkboxChange">{{ $t('morethantendays') }}</el-checkbox>
  204. </div>
  205. <!-- 从钉钉同步按钮,只有钉钉的用户并且有查看全部权限的管理员才有同步按钮 -->
  206. <div style="margin: 0 0 0 20px" v-if="userComLis.dingdingUserid != null && permissions.awayOfficeAll">
  207. <el-button size="small" type="primary" @click="dingdingClick()" >{{ $t('synchronizefromStaple') }}</el-button>
  208. </div>
  209. <div style="margin: 0 0 0 20px" v-if="userComLis.dingdingUserid != null">
  210. <el-button size="small" type="primary" @click="dingdingListExport()" >{{ $t('export.export') }}</el-button>
  211. </div>
  212. </div>
  213. <!-- 出差列表 -->
  214. <el-table :data="tableList" style="width: 100%" height="90%" :loading="tableListLoading">
  215. <el-table-column prop="ownerName" :label="$t('businesspersonnel')" width="100" fixed="left" align="center">
  216. <template slot-scope="scope">
  217. <span :style="scope.row.dayCount >= 10 ? 'color:#e62412' : ''">
  218. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
  219. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.ownerName'></ww-open-data></span>
  220. </span>
  221. </template>
  222. </el-table-column>
  223. <!-- <el-table-column prop="reason" label="出差事由" width="150" header-align="center"></el-table-column> -->
  224. <el-table-column :label="$t('traveldays')" width="120" align="center">
  225. <template slot-scope="scope">
  226. <div><span :style="scope.row.dayCount >= 10 ? 'color:#e62412' : ''">{{scope.row.dayCount}}{{ $t('time.day') }}</span></div>
  227. </template>
  228. </el-table-column>
  229. <el-table-column :label="$t('detailsbusinessrip')" width="600" align="center" v-if="isSyncData">
  230. <template slot-scope="scope">
  231. <div v-for="item in scope.row.projectList" :key="item.projectId" class="detailsScope">
  232. <span>{{item.startDate + $t('other.to') + item.endDate}}</span><span>{{item.projectName}}</span><span>{{item.degreeName}}</span>
  233. </div>
  234. </template>
  235. </el-table-column>
  236. <!-- <el-table-column prop="degreeName" :label="wuduData.customDegreeName" width="150" align="center">
  237. <template slot-scope="scope">
  238. <span v-for="item in scope.row.projectList" :key="item.projectId">{{item.degreeName == null ? '' : item.degreeName + '\u3000'}}</span>
  239. </template>
  240. </el-table-column> -->
  241. <el-table-column :label="$t('traffictools')" width="120" align="center">
  242. <template slot-scope="scope">
  243. <span v-if="scope.row.way == 0">{{ $t('plane') }}</span>
  244. <span v-if="scope.row.way == 1">{{ $t('train') }}</span>
  245. <span v-if="scope.row.way == 2">{{ $t('car') }}</span>
  246. <span v-if="scope.row.way == 3">{{ $t('ship') }}</span>
  247. <span v-if="scope.row.way == 4">{{ $t('leave.other') }}</span>
  248. </template>
  249. </el-table-column>
  250. <el-table-column :label="$t('trip')" width="120" align="center" v-if="!isSyncData">
  251. <template slot-scope="scope">{{scope.row.cityFrom + '-' + scope.row.cityTo}}</template>
  252. </el-table-column>
  253. <el-table-column prop="indate" :label="$t('applytime')" width="150" align="center" v-if="!isSyncData"></el-table-column>
  254. <el-table-column prop="startDate" :label="$t('starttimeofbusinessrip')" width="150"></el-table-column>
  255. <el-table-column prop="endDate" :label="$t('endtimeofbusinesstrip')" width="150"></el-table-column>
  256. <el-table-column prop="remark" :label="$t('bei-zhu')" width="200">
  257. <template slot-scope="scope">
  258. <el-popover placement="top-start" :title="$t('biao-ti')" width="200" trigger="hover" :content="scope.row.remark">
  259. <div slot="reference" class="apls">{{scope.row.remark}}</div>
  260. </el-popover>
  261. </template>
  262. </el-table-column>
  263. <el-table-column prop="status" :label="$t('state.states')" width="100" fixed="right">
  264. <template slot-scope="scope">
  265. <span v-if="scope.row.status == 0">{{ $t('state.approved') }}</span>
  266. <div v-if="scope.row.status == 1" style="color: orange"><span>{{ $t('state.WaitingAudit') }}-</span>
  267. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.auditorName}}</span>
  268. <span v-if="user.userNameNeedTranslate == 1">
  269. <ww-open-data type='userName' :openid='scope.row.auditorName'></ww-open-data>
  270. </span>
  271. </div>
  272. <span v-if="scope.row.status == 2" style="color: red">{{ $t('btn.rejected') }}</span>
  273. <span v-if="scope.row.status == 3" style="color: #666666">{{ $t('btn.undo') }}</span>
  274. </template>
  275. </el-table-column>
  276. <el-table-column v-if="!isSyncData" :label="isAuditList ? $t('other.audit') : $t('operation')" width="180" fixed="right" >
  277. <!-- <template slot-scope="scope">
  278. <div v-if="isAuditList">
  279. <el-button icon="el-icon-check" circle size="mini" @click="approve(scope.row)"></el-button>
  280. <el-button icon="el-icon-close" circle size="mini" @click="deny(scope.row)"></el-button>
  281. </div>
  282. <div v-if="!isAuditList">
  283. <el-button v-if="permissions.awayOfficeDelete && ((scope.row.status != 0 && scope.row.ownerId == user.id) || permissions.awayOfficeAll)" icon="el-icon-delete" circle size="mini" @click="deletes(scope.row)"></el-button>
  284. <el-button v-if="((scope.row.status != 0 && scope.row.ownerId == user.id) || permissions.awayOfficeAll) || scope.row.status == 1" icon="el-icon-edit" circle size="mini" @click="editor(scope.row)"></el-button>
  285. </div>
  286. </template> -->
  287. <template slot-scope="scope">
  288. <div v-if="isAuditList" >
  289. <el-button icon="el-icon-check" circle size="mini" @click.stop.native="approve(scope.row)"></el-button>
  290. <el-button icon="el-icon-close" circle size="mini" @click.stop.native="deny(scope.row)"></el-button>
  291. </div>
  292. <div v-if="!isAuditList && ((scope.row.status != 0 && scope.row.ownerId == user.id) || permissions.awayOfficeAll)">
  293. <el-button size="mini" v-if="scope.row.status == 3 ||scope.row.status == 2" @click.stop.native="deletes(scope.row)" >删除</el-button>
  294. <el-button size="mini" v-if="scope.row.status == 1" @click.stop.native="cancel(scope.row)">撤回</el-button>
  295. <el-button size="mini" v-if="scope.row.status == 3 ||scope.row.status == 2 " type="primary" @click.stop.native="editor(scope.row)">重新提交</el-button>
  296. </div>
  297. </template>
  298. </el-table-column>
  299. <el-table-column v-if="isSyncData" :label="$t('operation')" width="150" fixed="right">
  300. <template slot-scope="scope">
  301. <el-button icon="iconfont firerock-iconguanlian" circle size="mini" @click="DingdingEditor(scope.row)"></el-button>
  302. <el-button v-if="permissions.awayOfficeDelete" icon="el-icon-delete" circle size="mini" @click="deleteOfDingding(scope.row)"></el-button>
  303. </template>
  304. </el-table-column>
  305. </el-table>
  306. <!-- 页码 -->
  307. <div class="poss">
  308. <el-pagination
  309. @size-change="handleSizeChange"
  310. @current-change="handleCurrentChange"
  311. :current-page="page"
  312. :page-sizes="[20, 50, 100, 200]"
  313. :page-size="20"
  314. layout="total, sizes, prev, pager, next"
  315. :total="total">
  316. </el-pagination>
  317. </div>
  318. </div>
  319. </div>
  320. <!-- 出差统计 -->
  321. <div class="tops" v-if="displayTable && apk == 1">
  322. <div class="ctons">
  323. <div style="display: flex;align-items: center;justify-content: flex-start;padding-bottom: 20px;border-bottom: 1px solid #f2f2f2">
  324. <div style="display: inline-block;width: 350px">
  325. <el-input style="float:left;" v-if="user.userNameNeedTranslate != 1" v-model="searchWord" class="input-with-select" :placeholder="$t('pleaseenterstaffsearch')" clearable="true" size="small">
  326. <el-button slot="append" @click="statistical()" icon="el-icon-search"></el-button>
  327. </el-input>
  328. </div>
  329. <div style="display: inline-block;width: 700px;margin-left: 100px">
  330. <span style="display: inline-block;margin: 0 15px 0 20px;color: rgb(96, 98, 102);">{{ $t('message.period') }}</span>
  331. <el-date-picker
  332. size="small"
  333. v-model="searchDates"
  334. type="daterange"
  335. :range-separator="$t('other.to')"
  336. :start-placeholder="$t('time.startDate')"
  337. :end-placeholder="$t('time.endDate')"
  338. @change="statistical()"
  339. :clearable="false"
  340. value-format="yyyy-MM-dd">
  341. </el-date-picker>
  342. </div>
  343. </div>
  344. <!-- <div style="margin-top: 30px"> -->
  345. <div>
  346. <el-table key="apk2is4" v-loading="summaryLoading" :data="statisticalList" height="780px" style="width: 99%">
  347. <el-table-column prop="ownerName" :label="$t('lable.name')" width="300">
  348. <template slot-scope="scope">
  349. <div v-if="scope.row.ownerName">
  350. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
  351. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.ownerName'></ww-open-data></span>
  352. </div>
  353. <div v-else>
  354. <span>{{ $t('nostatisticsonbusinesstripsatpresent') }}</span>
  355. </div>
  356. </template>
  357. </el-table-column>
  358. <el-table-column prop="departmentName" :label="$t('lable.department')" width="300">
  359. <template slot-scope="scope">
  360. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.departmentName}}</span>
  361. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data></span>
  362. </template>
  363. </el-table-column>
  364. <el-table-column prop="dayCount" :label="$t('cumulativebusinesstripdays')" width="300">
  365. <template slot-scope="scope">
  366. {{scope.row.dayCount}}{{ $t('time.day') }}
  367. </template>
  368. </el-table-column>
  369. <el-table-column :label="$t('details')" width="300">
  370. <template slot-scope="scope">
  371. <!-- {{scope.row.timeDays}} -->
  372. <el-button size="mini" @click="viewDetails(1,scope.row)">{{ $t('Checkthedetails') }}</el-button>
  373. </template>
  374. </el-table-column>
  375. </el-table>
  376. </div>
  377. </div>
  378. </div>
  379. <!-- 出差审批流 -->
  380. <div class="tops" v-if="displayTable && apk == 2">
  381. <div class="ctons">
  382. <el-col :span="6" >
  383. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-left:15px;" >
  384. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  385. <el-tree :data="sdata" :props="sdefaultProps" @node-click="handleNodeClick" accordion>
  386. <!-- 添加试试看 -->
  387. <span class="custom-tree-node" slot-scope="{ node, data }">
  388. <!-- <span>{{ node.label }}</span> -->
  389. <span v-if="user.userNameNeedTranslate == '1'">
  390. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  391. </span>
  392. <span v-else>
  393. {{ node.label }}
  394. <span v-if="false">{{data}}</span>
  395. </span>
  396. </span>
  397. </el-tree>
  398. </div>
  399. </el-scrollbar>
  400. </el-col>
  401. <el-col :span="18" >
  402. <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-right:20px;" >
  403. <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
  404. <div style="padding:5px;color:#333;" v-if="depData != null">{{ $t('setup') }} &lt;<span style="color:#20a0ff;">
  405. <!-- {{depData.label}} -->
  406. <span v-if="user.userNameNeedTranslate != 1">{{depData.label}}</span>
  407. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='depData.label'></ww-open-data></span>
  408. &gt;</span> {{ $t('approvalprocessforbusiness') }}
  409. <el-tooltip effect="dark" v-if="depData != null && depData.children!=null" :content="$t('onlyapplicabletotheimmediatestaffofthecurrentdepartment')" placement="top-start">
  410. <i class="el-icon-question"></i>
  411. </el-tooltip>
  412. </div>
  413. <div style="padding:5px;" v-if="depData == null">{{ $t('qing-xuan-ze-bu-men') }}</div>
  414. <div style="width:100%;margin:0 auto;text-align: center; margin-top:50px;" v-if="depData != null">
  415. <span>{{ $t('employeeisallowed') }}</span>
  416. <icon class="iconfont firerock-iconright"></icon>
  417. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(0)"></icon>
  418. <icon class="iconfont firerock-iconright"></icon>
  419. <span v-for="(item, index) in dataArray" :key="item.seq" >
  420. <!-- <el-button type="primary" v-if="item.auditorType == 1" @click="editNodeDialog(index, item)">{{item.auditDeptName}}</el-button> -->
  421. <!-- <el-button type="primary" v-if="item.auditorType == 2" @click="editNodeDialog(index, item)">{{item.userName}}</el-button> -->
  422. <el-button type="primary" v-if="item.auditorType == 1 && user.userNameNeedTranslate == 1" @click="editNodeDialog(index, item)">
  423. <ww-open-data type='departmentName' :openid='item.auditDeptName'></ww-open-data>
  424. </el-button>
  425. <el-button type="primary" v-if="item.auditorType == 2 && user.userNameNeedTranslate == 1" @click="editNodeDialog(index, item)">
  426. <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
  427. </el-button>
  428. <el-button type="primary" v-if="item.auditorType == 0" >{{ $t('projectLeader') }}</el-button>
  429. <el-button type="primary" v-if="item.auditorType == 1 && user.userNameNeedTranslate != 1" @click="editNodeDialog(index, item)">
  430. {{item.auditDeptName}}
  431. </el-button>
  432. <el-button type="primary" v-if="item.auditorType == 2 && user.userNameNeedTranslate != 1" @click="editNodeDialog(index, item)">
  433. {{item.userName}}
  434. </el-button>
  435. <icon class="iconfont firerock-iconright"></icon>
  436. <icon class="iconfont firerock-iconInsertLine addNode" @click="showNodeDialog(index+1)"></icon>
  437. <icon class="iconfont firerock-iconright"></icon>
  438. </span>
  439. <icon class="iconfont firerock-iconApp_New_Line" style="color:#20A0FF;"></icon>
  440. {{ $t('approvaltocomplete') }}
  441. </div>
  442. <div style="width:100%;margin:0 auto;margin-bottom:30px;position: absolute;bottom: 0px;text-align: center; ">
  443. <el-button type="primary" @click="submitInsert">{{ $t('save') }}</el-button>
  444. </div>
  445. </div>
  446. </el-scrollbar>
  447. </el-col>
  448. </div>
  449. <el-dialog :title="$t('pleaseselectapprover')" v-if="dialogVisible" :visible.sync="dialogVisible" width="460px">
  450. <el-form label-width="140px">
  451. <el-form-item :label="$t('selectdepartmentsdesignatepersonnel')" >
  452. <el-cascader filterable ref="deptCascader" v-model="curDeptId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 100%" @change="chooseDept" v-if="user.userNameNeedTranslate != 1" :options="soption" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable></el-cascader>
  453. <!-- <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :subjectId="this.selectedAuuid" :subject="soption" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader> -->
  454. <vueCascader :size="'small'" :widthStr="'200'" :clearable="true" :userName="true" :subjectId="this.selectedAuuid" :subject="soption" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
  455. </el-form-item>
  456. </el-form>
  457. <div slot="footer" class="dialog-footer">
  458. <el-button type="default" @click="deleteNode" v-if="!isAdd" style="float:left;">{{ $t('btn.delete') }}</el-button>
  459. <el-button type="primary" @click="addNode" >{{ $t('btn.determine') }}</el-button>
  460. </div>
  461. </el-dialog>
  462. </div>
  463. </div>
  464. <!-- 编辑框 -->
  465. <el-dialog :title="$t('detailsbusinessrip')" v-if="editDialog" :visible.sync="editDialog" width="1000px">
  466. <!-- <el-form ref="editItemForm" :model="editItemForm" label-width="80px" :rules="editItemFormRules"> -->
  467. <el-form ref="editItemForm" :model="editItemForm" label-width="80px" :rules="editItemRules">
  468. <el-form-item :label="$t('businesspersonnel')" prop="ownerName" style="width: 300px;display: inline-block;">
  469. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='editItemForm.ownerName'></ww-open-data></span>
  470. <span v-else>{{editItemForm.ownerName}}</span>
  471. </el-form-item>
  472. <el-form-item :label="$t('onewayroundtrip')" prop="goBack" style="width: 300px;display: inline-block;">
  473. <el-radio-group v-model="editItemForm.goBack">
  474. <el-radio :label="0">{{ $t('oneway') }}</el-radio>
  475. <el-radio :label="1">{{ $t('backandforth') }}</el-radio>
  476. </el-radio-group>
  477. </el-form-item>
  478. <!-- 交通工具 -->
  479. <el-form-item :label="$t('traffictools')" style="width:100%">
  480. <el-radio-group v-model="editItemForm.way">
  481. <el-radio :label="0">{{ $t('plane') }}</el-radio>
  482. <el-radio :label="1">{{ $t('train') }}</el-radio>
  483. <el-radio :label="2">{{ $t('car') }}</el-radio>
  484. <el-radio :label="3">{{ $t('ship') }}</el-radio>
  485. <el-radio :label="4">{{ $t('leave.other') }}</el-radio>
  486. </el-radio-group>
  487. </el-form-item>
  488. <!-- <el-form-item :label="$t('screening.inputProject')" style="width:300px;margin-right:30px;display:inline-block;" prop="projectId">
  489. <el-select style="width:100%" @change="getwuduList(0)" v-model="editItemForm.projectId" filterable clearable :placeholder="$t('defaultText.pleaseChoose')" >
  490. <el-option
  491. v-for="item in projectList"
  492. :key="item.id"
  493. :label="item.projectName"
  494. :value="item.id">
  495. </el-option>
  496. </el-select>
  497. </el-form-item> -->
  498. <el-form-item :label="wuduData.customDegreeName"
  499. v-if="editItemForm.projectId != null && wuduData.customDegreeActive == 1"
  500. style="width:300px;margin-right:30px;display:inline-block;"
  501. prop="degreeName">
  502. <el-select style="width:100%" v-model="editItemForm.degreeId" filterable clearable :placeholder="$t('defaultText.pleaseChoose')" >
  503. <el-option
  504. v-for="item in wuduList"
  505. :key="item.id"
  506. :label="item.name"
  507. :value="item.id">
  508. </el-option>
  509. </el-select>
  510. </el-form-item>
  511. <el-form-item :label="$t('departurecity')" style="width:300px;margin-right:30px;display: inline-block;" prop="cityFrom">
  512. <el-select style="width:100%" v-model="editItemForm.cityFrom" filterable clearable :placeholder="$t('defaultText.pleaseChoose')" >
  513. <el-option
  514. v-for="item in cityList"
  515. :key="item.value"
  516. :label="item.label"
  517. :value="item.label">
  518. </el-option>
  519. </el-select>
  520. </el-form-item>
  521. <!-- 目的城市 -->
  522. <el-form-item :label="$t('destinationcity')" style="width:300px;display: inline-block;" prop="cityTo">
  523. <el-select style="width:100%" v-model="editItemForm.cityTo" filterable clearable :placeholder="$t('defaultText.pleaseChoose')">
  524. <el-option
  525. v-for="item in cityList"
  526. :key="item.value"
  527. :label="item.label"
  528. :value="item.label">
  529. </el-option>
  530. </el-select>
  531. </el-form-item>
  532. <el-form-item :label="$t('starttimes')" style="width:300px;margin-right:30px;display:inline-block;" prop="startDate">
  533. <el-date-picker
  534. type="date"
  535. :placeholder="$t('time.startDate')"
  536. value-format="yyyy-MM-dd"
  537. v-model="editItemForm.startDate"
  538. style="width:100%"
  539. @change="datechg2(1)">
  540. </el-date-picker>
  541. </el-form-item>
  542. <!-- 结束时间 -->
  543. <el-form-item :label="$t('time.endTime')" style="width:300px;display:inline-block;" prop="endDate">
  544. <el-date-picker
  545. type="date"
  546. :placeholder="$t('time.endDate')"
  547. value-format="yyyy-MM-dd"
  548. v-model="editItemForm.endDate"
  549. style="width:100%"
  550. @change="datechg2(0)">
  551. </el-date-picker>
  552. </el-form-item>
  553. <el-form-item :label="$t('traveldays')" style="width:300px">
  554. <el-input type="number" :placeholder="$t('automaticcalculation')" v-model="editItemForm.dayCount" min="0" style="width:100%"></el-input>
  555. </el-form-item>
  556. <el-form-item :label="$t('bei-zhu')" style="width: 100%">
  557. <el-input type="textarea" v-model="editItemForm.remark" :rows="3" style="width: 62%" maxlength="100" show-word-limit></el-input>
  558. </el-form-item>
  559. </el-form>
  560. <span slot="footer" class="dialog-footer">
  561. <el-button @click="editDialog = false">{{ $t('btn.cancel') }}</el-button>
  562. <el-button type="primary" @click="determine()">{{ $t('btn.determine') }}</el-button>
  563. </span>
  564. </el-dialog>
  565. <!-- 出差统计查看详情 -->
  566. <el-dialog :title="$t('detailsbusinessrip')" :visible.sync="seeDialog" width="1000px">
  567. <el-table :data="detailsData" style="width:100%" height="400" v-loading="detailsloading">
  568. <!-- <el-table-column prop="date" label="日期" width="150"></el-table-column>
  569. <el-table-column prop="name" label="姓名" width="200"></el-table-column>
  570. <el-table-column prop="address" label="地址"></el-table-column> -->
  571. <el-table-column prop="ownerName" :label="$t('businesspersonnel')" width="100" fixed="left">
  572. <template slot-scope="scope">
  573. <div>
  574. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='scope.row.ownerName'></ww-open-data></span>
  575. <span v-if="user.userNameNeedTranslate != 1">{{scope.row.ownerName}}</span>
  576. </div>
  577. </template>
  578. </el-table-column>
  579. <el-table-column prop="reason" :label="$t('travelreason')" width="150" header-align="center"></el-table-column>
  580. <el-table-column prop="projectName" :label="$t('screening.inputProject')" width="150" align="center" v-if="isSyncData"></el-table-column>
  581. <el-table-column :label="$t('traffictools')" width="120" align="center">
  582. <template slot-scope="scope">
  583. <span v-if="scope.row.way == 0">{{ $t('plane') }}</span>
  584. <span v-if="scope.row.way == 1">{{ $t('train') }}</span>
  585. <span v-if="scope.row.way == 2">{{ $t('car') }}</span>
  586. <span v-if="scope.row.way == 3">{{ $t('ship') }}</span>
  587. <span v-if="scope.row.way == 4">{{ $t('leave.other') }}</span>
  588. </template>
  589. </el-table-column>
  590. <el-table-column :label="$t('trip')" width="120" align="center">
  591. <template slot-scope="scope">{{scope.row.cityFrom + '-' + scope.row.cityTo}}</template>
  592. </el-table-column>
  593. <el-table-column prop="indate" :label="$t('applytime')" width="150" align="center"></el-table-column>
  594. <el-table-column :label="$t('traveldays')" width="80" align="center">
  595. <template slot-scope="scope"><div>{{scope.row.dayCount}}{{ $t('time.day') }}</div></template>
  596. </el-table-column>
  597. <el-table-column prop="startDate" :label="$t('starttimeofbusinessrip')" width="150" align="center"></el-table-column>
  598. <el-table-column prop="endDate" :label="$t('endtimeofbusinesstrip')" width="150" align="center"></el-table-column>
  599. <el-table-column prop="remark" :label="$t('bei-zhu')" width="200">
  600. <template slot-scope="scope">
  601. <el-popover placement="top-start" width="200" trigger="hover" :content="scope.row.remark">
  602. <div slot="reference" class="apls">{{scope.row.remark}}</div>
  603. </el-popover>
  604. </template>
  605. </el-table-column>
  606. </el-table>
  607. <div class="poss" style="text-align:right;">
  608. <el-pagination
  609. @size-change="detailsSizeChange"
  610. @current-change="detailsCurrentChange"
  611. :current-page="detailspage"
  612. :page-sizes="[20, 50, 100, 200]"
  613. :page-size="20"
  614. layout="total, sizes, prev, pager, next"
  615. :total="detailstotal">
  616. </el-pagination>
  617. </div>
  618. </el-dialog>
  619. <!-- 钉钉环境交互效果切换 -->
  620. <el-dialog :title="$t('projectAssociationInformation')" v-if="DingdingEditDialog" :close-on-click-modal="false" :visible.sync="DingdingEditDialog" width="800px" customClass="customWidth">
  621. <el-table :data="relationList" :loading="DingdingTableLoading">
  622. <el-table-column :label="$t('message.period')">
  623. <template slot-scope="scope">
  624. <span>{{scope.row.startDate + $t('other.to') + scope.row.endDate}}</span>
  625. </template>
  626. </el-table-column>
  627. <el-table-column :label="$t('rselatedprojects')" prop="projectName" show-overflow-tooltip></el-table-column>
  628. <el-table-column :label="wuduData.customDegreeName" prop="degreeName" show-overflow-tooltip></el-table-column>
  629. <el-table-column :label="$t('operation')" width="150">
  630. <template slot-scope="scope">
  631. <el-button size="small" type="primary" @click="DingdingAddorMod(scope.row)">{{ $t('bian-ji') }}</el-button>
  632. <el-button size="small" type="danger" @click="DingdingDelete(scope.row)">{{ $t('btn.delete') }}</el-button>
  633. </template>
  634. </el-table-column>
  635. </el-table>
  636. <div slot="footer" class="dialog-footer">
  637. <el-button type="primary" @click="DingdingEditDialog = false">{{ $t('Shutdown') }}</el-button>
  638. <el-button type="primary" @click="DingdingAddorMod()">{{ $t('addinganAssociatedItem') }}</el-button>
  639. </div>
  640. <el-dialog append-to-body :title="$t('addedormodifiedassociateditems')" v-if="appendAddorModDialog" :visible.sync="appendAddorModDialog" width="700px" customClass="customWidth">
  641. <el-form label-width="100" :inline="true" style="margin-top:20px" :model="relationItem" :rules="relationItemRules" ref="relationItemForm">
  642. <el-form-item :label="$t('time.startDate')" prop="startDate">
  643. <el-date-picker
  644. style="width:220px"
  645. v-model="relationItem.startDate"
  646. value-format="yyyy-MM-dd"
  647. type="date"
  648. @change="datechg3(1)"
  649. :placeholder="$t('defaultText.pleaseChoose')"></el-date-picker>
  650. </el-form-item>
  651. <el-form-item :label="$t('time.endDate')" prop="endDate" style="margin-left:35px">
  652. <el-date-picker
  653. style="width:220px"
  654. v-model="relationItem.endDate"
  655. value-format="yyyy-MM-dd"
  656. type="date"
  657. @change="datechg3(0)"
  658. :placeholder="$t('defaultText.pleaseChoose')"></el-date-picker>
  659. </el-form-item><br>
  660. <el-form-item :label="$t('rselatedprojects')" prop="projectId">
  661. <el-select v-model="relationItem.projectId" :placeholder="$t('defaultText.pleaseChoose')" @change="getwuduList(2)" style="width:220px" filterable >
  662. <el-option
  663. v-for="item in projectList"
  664. :key="item.id"
  665. :value="item.id"
  666. :label="item.projectName"></el-option>
  667. </el-select>
  668. </el-form-item>
  669. <el-form-item :label="wuduData.customDegreeName" prop="degreeId" style="margin-left:44.5px">
  670. <el-select v-model="relationItem.degreeId" :placeholder="$t('defaultText.pleaseChoose') + wuduData.customDegreeName" style="width:220px">
  671. <el-option
  672. v-for="item in wuduList"
  673. :key="item.id"
  674. :value="item.id"
  675. :label="item.name"></el-option>
  676. </el-select>
  677. </el-form-item>
  678. </el-form>
  679. <div slot="footer" class="dialog-footer">
  680. <el-button @click="appendAddorModDialog = false">{{ $t('btn.cancel') }}</el-button>
  681. <el-button type="primary" @click="appendAddorModSure('relationItemForm')">{{ $t('btn.submit') }}</el-button>
  682. </div>
  683. </el-dialog>
  684. </el-dialog>
  685. <!-- 点击钉钉同步弹窗 -->
  686. <el-dialog :title="$t('synchronizefromStaple')" :visible.sync="synchronizationDaying" width="480px" :before-close="handleClose">
  687. <div>
  688. <div class="dingdingtongbu">
  689. <span>{{ $t('screening.selectPeople') }}</span>
  690. <el-select v-if="user.userNameNeedTranslate != 1" v-model="ownerIdsId" :placeholder="$t('pleaseselectpersonnel')" style="width:280px" size="small" filterable="true">
  691. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  692. </el-option>
  693. </el-select>
  694. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'small'" :subject="users" :subjectId="ownerIdsId" :distinction="'2'" :filterable="false" @selectCal="selectCal"></selectCat>
  695. </div>
  696. <div class="dingdingtongbu" style="margin-top: 20px">
  697. <span>{{ $t('message.period') }}</span>
  698. <el-date-picker v-model="createDateList" type="daterange" :range-separator="$t('other.to')" :start-placeholder="$t('time.startDate')" :end-placeholder="$t('time.endDate')" value-format="yyyy-MM-dd" :placeholder="$t('optiondate')" size="small" clearable style="width:280px"></el-date-picker>
  699. <span style="width: 300px;color: #E6A23C;font-size: 10px;padding-left: 105px;margin-top: 10px"> <i class="el-icon-warning-outline"></i> {{ $t('synchronizationperiodfromstaplecannotexceedsevendays') }}</span>
  700. </div>
  701. </div>
  702. <span slot="footer" class="dialog-footer">
  703. <el-button @click="synchronizationDaying = false">{{ $t('btn.cancel') }}</el-button>
  704. <el-button type="primary" @click="listSynchronize()" :loading="synchronizeLoading">{{ $t('synchronous') }}</el-button>
  705. </span>
  706. </el-dialog>
  707. <el-dialog :title="$t('defaultText.pleaseEnterTheReason')" v-if="denyDialogV" :visible.sync="denyDialogV" :close-on-click-modal="false" customClass="customWidth" width="500px">
  708. <div>
  709. <el-input type="textarea" v-model="denyInfo.reason" rows="2" :placeholder="$t('reasonforyourdecisiontoreject')" />
  710. </div>
  711. <div slot="footer" class="dialog-footer">
  712. <el-button @click="denyDialogV = false" >{{ $t('btn.cancel') }}</el-button>
  713. <el-button type="primary" @click="submitDeny()" >{{ $t('btn.determine') }}</el-button>
  714. </div>
  715. </el-dialog>
  716. <el-dialog :title="$t('title.reviewProcess')" v-if="denyReasonVisible" :visible.sync="denyReasonVisible" customClass="customWidth" width="400px">
  717. <div style="padding:20px 40px 20px 0">
  718. <el-timeline :reverse="false">
  719. <el-timeline-item v-for="item in auditLogList" :key="item.id" :timestamp="item.indate">
  720. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.auditorName'></ww-open-data> </span>
  721. <span v-if="user.userNameNeedTranslate == 0">{{item.auditorName}}</span>
  722. <span> {{item.isPass==0?"驳回了请假申请。":"审核通过。"}}</span>
  723. <span v-if="item.isPass == 0">原因:{{item.denyReason}}</span>
  724. </el-timeline-item>
  725. </el-timeline>
  726. </div>
  727. </el-dialog>
  728. </section>
  729. </template>
  730. <script>
  731. // 自定义select组件
  732. import selectCat from "@/components/select.vue"
  733. import citys from '../../assets/citys/shju.json'
  734. // 引入自定义级联组件
  735. import vueCascader from "@/components/cascader.vue"
  736. export default {
  737. components: {
  738. selectCat,
  739. vueCascader
  740. },
  741. name: "awayOffice",
  742. data(){
  743. // 验证手机号
  744. // var checks = (rule, value, callback) => {
  745. // if (!value) {
  746. // return callback(new Error('出差天数不能为空'));
  747. // } else {
  748. // if (value > this.timeChoose) {
  749. // return callback(new Error('超过当前选择日期的天数'));
  750. // } else {
  751. // callback();
  752. // }
  753. // }
  754. // };
  755. return {
  756. denyDialogV: false,
  757. denyInfo: {},
  758. summaryLoading: false,
  759. displayTable: false,
  760. formloading: false,
  761. apk: 0,
  762. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  763. userComLis: JSON.parse(sessionStorage.getItem("user")),
  764. addform: {
  765. reason: null, //出差事由
  766. startDate: null, //开始时间
  767. endDate: null, //结束时间
  768. way: 0, //交通工具
  769. cityFrom: null, //出发城市
  770. cityTo: null, //目的城市
  771. goBack: 0, //单程往返
  772. dayCount: null, //出差天数
  773. remark: '', //备注
  774. projectId: null, //项目id
  775. wuduId:null //维度id
  776. },
  777. formrules:{
  778. reason:[{ required: true, message: this.$t('yourbusinesstrip'), trigger: "blur" }],
  779. cityFrom:[{ required: true, message: this.$t('selectyourdeparturecity'), trigger: "blur" }],
  780. cityTo:[{ required: true, message: this.$t('saelectdestinationcity'), trigger: "blur" }],
  781. startDate:[{ required: true, message: this.$t('selectastarttime'), trigger: "blur" }],
  782. endDate:[{ required: true, message: this.$t('selectanendtime'), trigger: "blur" }]
  783. },
  784. editItemRules:{
  785. cityFrom:[{ required: true, message: this.$t('selectyourdeparturecity'), trigger: "blur" }],
  786. cityTo:[{ required: true, message: this.$t('saelectdestinationcity'), trigger: "blur" }],
  787. startDate:[{ required: true, message: this.$t('selectastarttime'), trigger: "blur" }],
  788. endDate:[{ required: true, message: this.$t('selectanendtime'), trigger: "blur" }]
  789. },
  790. cityList:[],
  791. cityList2:[],
  792. projectList: [],
  793. wuduList: [],
  794. wuduData: JSON.parse(sessionStorage.getItem("user")).timeType,
  795. user: JSON.parse(sessionStorage.getItem("user")),
  796. tableList: [],
  797. isAuditList: false,
  798. editItemForm: {},
  799. // editItemFormRules: {
  800. // timeDays: [{required: true, validator: checks, trigger: 'blur'}],
  801. // leaveType: [{ required: true, message: "请选择出差类型", trigger: "blur" }]
  802. // },
  803. editDialog: false,
  804. users: null,
  805. total:0,
  806. page: 1,
  807. size: 20,
  808. falg: 0,
  809. code: '',
  810. type: '',
  811. ownerIds: null,
  812. createDate: [],
  813. // 出差统计
  814. searchWord:'',
  815. searchDates: null,
  816. searchStartDate: null,
  817. searchEndDate: null,
  818. statisticalList: [],
  819. // 出差统计查看详情
  820. seeDialog: false,
  821. detailsData: [],
  822. detailstotal: 0,
  823. detailspage: 1,
  824. detailssize: 20,
  825. detailsuserid: null,
  826. // 出差审批流
  827. sdata: [],
  828. sdefaultProps: {
  829. children: 'children',
  830. label: 'label'
  831. },
  832. depData: null,
  833. dataArray: [],
  834. dialogVisible: false,
  835. curDeptId: null,
  836. isAdd: false,
  837. susers: [],
  838. // 钉钉环境交互
  839. isSyncData: 0,
  840. DingdingEditDialog: false,
  841. DingdingTableLoading: false,
  842. appendAddorModDialog: false,
  843. relationList: [],
  844. relationItem: {
  845. bustripId: null, //出差记录id
  846. startDate: null,
  847. endDate: null,
  848. projectId: null,
  849. degreeId: null
  850. },
  851. relationItemRules: {
  852. startDate:[{required: true,message: this.$t('selectastartdate'),trigger: 'change'}],
  853. endDate:[{required: true,message: this.$t('selectaenddate'),trigger: 'change'}],
  854. projectId:[{required: true,message: this.$t('projectassociate'),trigger: 'change'}],
  855. },
  856. relationItemTemporaryDate: {},
  857. synchronizeLoading: false,
  858. synchronizationDaying:false,
  859. createDateList: [],
  860. ownerIdsId: '',
  861. isOverTendays: false,
  862. tableListLoading: false,
  863. curWorkflowList:{},
  864. denyReasonVisible : false,
  865. auditLogList:[],
  866. selectedAuuid: ''
  867. }
  868. },
  869. created(){
  870. this.cityList = citys
  871. // console.log("city",this.cityList);
  872. let height = window.innerHeight;
  873. this.tableHeight = height - 195;
  874. const that = this;
  875. window.onresize = function temp() {
  876. that.tableHeight = window.innerHeight - 195;
  877. };
  878. this.isSyncData = (this.wuduData.syncDingding || this.wuduData.syncFanwei)
  879. },
  880. mounted(){
  881. if(this.isSyncData){
  882. this.staffs(2,['2'])
  883. }
  884. this.getTableList()
  885. this.getProjectList()
  886. this.getDepartment()
  887. this.getAuditWorkflow();
  888. this.getUsers()
  889. },
  890. methods: {
  891. // 自定义事件
  892. selectCal(obj) {
  893. if(obj.distinction == '1') {
  894. this.ownerIds = obj.id
  895. this.billss(obj.other)
  896. } else if(obj.distinction == '2') {
  897. this.ownerIdsId = obj.id
  898. }
  899. },
  900. //获取添加出差单时的审批流
  901. getAuditWorkflow() {
  902. this.http.post('/audit-workflow-setting/get',{userId: this.user.id, type: 2},
  903. res => {
  904. if(res.code == 'ok'){
  905. this.curWorkflowList = res.data;
  906. }else{
  907. this.$message({
  908. message: res.msg,
  909. type: 'error'
  910. })
  911. }
  912. },err => {
  913. this.$message({
  914. message: err,
  915. type: 'error'
  916. })
  917. })
  918. },
  919. dingdingListExport(){
  920. let parameter = {
  921. keyword: ''
  922. }
  923. if(this.createDate.length != 0){
  924. parameter.startDate = this.createDate[0]
  925. parameter.endDate = this.createDate[1]
  926. }
  927. this.http.post("/business-trip/exportData",parameter,
  928. res => {
  929. if(res.code == 'ok'){
  930. var filePath = res.data;
  931. const a = document.createElement('a'); // 创建a标签
  932. a.setAttribute('download', this.$t('tripStatistics')+'.xls');// download属性
  933. a.setAttribute('href', filePath);// href链接
  934. a.click(); //自执行点击事件
  935. a.remove();
  936. }else{
  937. this.$message({
  938. message: res.msg,
  939. type: "error"
  940. });
  941. }
  942. },error => {
  943. this.$message({
  944. message: error,
  945. type: "error"
  946. });
  947. })
  948. },
  949. checkboxChange(){
  950. this.billss(1)
  951. },
  952. deleteOfDingding(e) {
  953. this.$confirm(this.$t('deleteit'), this.$t('other.prompts'), {}).then(() => {
  954. this.http.post('/business-trip/delete', {id:e.id},
  955. res => {
  956. if (res.code == "ok") {
  957. this.billss();
  958. this.$message({
  959. message: this.$t('message.successfullyDeleted'),
  960. type: "success"
  961. });
  962. } else {
  963. this.$message({
  964. message: res.msg,
  965. type: "error"
  966. });
  967. }
  968. },
  969. error => {
  970. this.$message({
  971. message: error,
  972. type: "error"
  973. });
  974. });
  975. });
  976. },
  977. dingdingClick() {
  978. this.synchronizationDaying = true
  979. this.ownerIdsId = this.users[0].id
  980. let startDates = this.dayjs().add('-7','day').format("YYYY-MM-DD")
  981. let endDates = this.dayjs().format("YYYY-MM-DD")
  982. let arr = []
  983. arr.push(startDates)
  984. arr.push(endDates)
  985. this.createDateList = arr
  986. },
  987. // 判断日期
  988. determineDate(startDate, endDate) {
  989. let startTime = new Date(Date.parse(startDate.replace(/-/g, "/"))).getTime();
  990. let endTime = new Date(Date.parse(endDate.replace(/-/g, "/"))).getTime();
  991. let dates = Math.abs((startTime - endTime)) / (1000 * 60 * 60 * 24);
  992. let flg = dates > 7 ? false : true
  993. return flg ;
  994. },
  995. // 从钉钉同步假期剩余表
  996. listSynchronize(){
  997. // 判断日期
  998. let flgs = this.determineDate(this.createDateList[0], this.createDateList[1])
  999. if(flgs) {
  1000. this.synchronizeLoading = true
  1001. let transmissionObj = {}
  1002. transmissionObj.userId = this.ownerIdsId
  1003. transmissionObj.companyId = this.userComLis.companyId
  1004. if(this.createDateList != 'null' && this.createDateList != null) {
  1005. if(this.createDateList.length > 0) {
  1006. transmissionObj.startDate = this.createDateList[0]
  1007. transmissionObj.endDate = this.createDateList[1]
  1008. } else {
  1009. transmissionObj.startDate = this.dayjs().add('-7','day').format("YYYY-MM-DD")
  1010. transmissionObj.endDate = this.dayjs().format("YYYY-MM-DD")
  1011. }
  1012. } else {
  1013. transmissionObj.startDate = ''
  1014. transmissionObj.endDate = ''
  1015. }
  1016. this.http.post('/dingding/syncUserWorkData',transmissionObj,
  1017. res => {
  1018. if(res.code == 'ok'){
  1019. this.synchronizeLoading = false
  1020. this.synchronizationDaying = false
  1021. this.$message({
  1022. message: this.$t('synchronoussuccess'),
  1023. type: 'success'
  1024. })
  1025. // this.ownerIdsId = ''
  1026. // this.createDateList = []
  1027. this.getTableList()
  1028. }else {
  1029. this.synchronizeLoading = false
  1030. this.$message({
  1031. message: res.msg,
  1032. type: 'error'
  1033. })
  1034. }
  1035. },err => {
  1036. this.synchronizeLoading = false
  1037. this.$message({
  1038. message: err,
  1039. type: 'error'
  1040. })
  1041. })
  1042. } else {
  1043. this.$message({
  1044. message: this.$t('cannotbesynchronized'),
  1045. type: 'warning'
  1046. });
  1047. }
  1048. },
  1049. // 钉钉环境交互
  1050. DingdingEditor(e){
  1051. console.log(e);
  1052. this.DingdingEditDialog = true
  1053. this.relationItem.bustripId = e.id
  1054. this.relationItemTemporaryDate = {
  1055. startDate: e.startDate,
  1056. endDate: e.endDate
  1057. }
  1058. this.getRelationList()
  1059. },
  1060. getRelationList(){
  1061. this.DingdingTableLoading = true
  1062. this.http.post('/bustrip-project/list',{
  1063. bustripId: this.relationItem.bustripId
  1064. },res => {
  1065. if(res.code == 'ok'){
  1066. this.DingdingTableLoading = false
  1067. console.log('getlist',res.data);
  1068. this.relationList = res.data
  1069. }else {
  1070. this.DingdingTableLoading = false
  1071. this.$message({
  1072. message: res.msg,
  1073. type: 'error'
  1074. })
  1075. }
  1076. },err => {
  1077. this.DingdingTableLoading = false
  1078. this.$message({
  1079. message: err,
  1080. type: 'error'
  1081. })
  1082. })
  1083. },
  1084. DingdingAddorMod(row){
  1085. this.appendAddorModDialog = true
  1086. if(row){
  1087. this.relationItem.id = row.id
  1088. this.relationItem.projectId = row.projectId
  1089. this.getwuduList(2,1)
  1090. this.relationItem.startDate = row.startDate
  1091. this.relationItem.endDate = row.endDate
  1092. this.relationItem.degreeId = row.degreeId == null ? row.degreeId : row.degreeId.toString()
  1093. // console.log('degreeId',this.relationItem.degreeId);
  1094. }else {
  1095. this.relationItem.startDate = this.relationItemTemporaryDate.startDate
  1096. this.relationItem.endDate = this.relationItemTemporaryDate.endDate
  1097. this.relationItem.projectId = null
  1098. this.relationItem.degreeId = null
  1099. delete this.relationItem.id
  1100. }
  1101. },
  1102. appendAddorModSure(formname){
  1103. this.$refs[formname].validate((valid)=>{
  1104. if(valid){
  1105. this.http.post('/bustrip-project/addOrMod',this.relationItem,
  1106. res => {
  1107. if(res.code == 'ok'){
  1108. this.appendAddorModDialog = false
  1109. this.getRelationList()
  1110. this.getTableList()
  1111. }else {
  1112. this.$message({
  1113. message: res.msg,
  1114. type: 'error'
  1115. })
  1116. }
  1117. },err => {
  1118. this.$message({
  1119. message: err,
  1120. type: 'error'
  1121. })
  1122. })
  1123. }else {
  1124. return false
  1125. }
  1126. })
  1127. },
  1128. DingdingDelete(row){
  1129. console.log('row',this.relationItem);
  1130. this.$confirm(this.$t('doyouwanttodeleteit'),this.$t('other.prompts'),{
  1131. confirmButtonText: this.$t('btn.determine'),
  1132. cancelButtonText: this.$t('btn.cancel'),
  1133. type: 'warning'
  1134. }).then(()=>{
  1135. this.http.post('/bustrip-project/delete',{
  1136. id:row.id
  1137. },res => {
  1138. if(res.code == 'ok'){
  1139. // this.$message({
  1140. // message: '删除成功',
  1141. // type: 'success'
  1142. // })
  1143. this.getRelationList()
  1144. }else {
  1145. this.$message({
  1146. message: res.msg,
  1147. type: 'error'
  1148. })
  1149. }
  1150. },err => {
  1151. this.$message({
  1152. message: err,
  1153. type: 'error'
  1154. })
  1155. })
  1156. })
  1157. },
  1158. staffs(key, keyPath) {
  1159. // console.log("keypath",keyPath)
  1160. if (keyPath[0] == '1') {
  1161. this.displayTable = false;
  1162. this.apk = 0;
  1163. this.getAuditWorkflow();
  1164. } else if(keyPath[0] == '2' || keyPath[0] == '3') {
  1165. this.displayTable = true;
  1166. this.apk = 0
  1167. if(this.users == null){ this.getUsers() }
  1168. } else if(keyPath[0] == '4'){
  1169. if(this.searchDates == null){
  1170. this.searchDates = this.getautoDate()
  1171. // console.log('000');
  1172. }
  1173. this.displayTable = true;
  1174. this.apk = 1
  1175. this.statistical()
  1176. } else {
  1177. this.displayTable = true;
  1178. this.apk = 2
  1179. }
  1180. },
  1181. auditList() {
  1182. this.falg = 1
  1183. this.code = 1
  1184. this.tableList = []
  1185. this.displayTable = true;
  1186. this.isAuditList = true;
  1187. this.loading = true
  1188. this.page = '1'
  1189. var param = { pageIndex: this.page,
  1190. pageSize: this.size,
  1191. // createDate: this.createDate,
  1192. startDate: this.createDate == null ? '' : this.createDate[0],
  1193. endDate: this.createDate == null ? '' : this.createDate[1],
  1194. ownerId: this.ownerIds,
  1195. way: this.type,
  1196. };
  1197. this.tableList = [];
  1198. this.total = 0;
  1199. this.http.post('/business-trip/auditList', param,
  1200. res => {
  1201. if (res.code == "ok") {
  1202. this.tableList = res.data.records
  1203. this.total = res.data.total
  1204. this.loading = false
  1205. } else {
  1206. this.loading = false
  1207. this.$message({
  1208. message: res.msg,
  1209. type: "error"
  1210. });
  1211. }
  1212. },
  1213. error => {
  1214. this.loading = false
  1215. this.$message({
  1216. message: error,
  1217. type: "error"
  1218. });
  1219. });
  1220. },
  1221. // 导航切换
  1222. bills(audit, tr){
  1223. if(tr) {
  1224. this.code = ''
  1225. this.createDate = []
  1226. // this.ownerIds = ''
  1227. this.type = ''
  1228. if(tr == 1) {
  1229. this.falg = 1
  1230. this.code = 1
  1231. } else if(tr == 2) {
  1232. this.code = ''
  1233. this.falg = 0
  1234. } else {
  1235. this.falg = 0
  1236. }
  1237. } else {
  1238. this.falg = false
  1239. }
  1240. this.tableList = []
  1241. this.displayTable = true;
  1242. this.isAuditList = audit;
  1243. this.loading = true
  1244. var param = {
  1245. pageIndex: this.page,
  1246. pageSize: this.size,
  1247. status: this.code,
  1248. startDate: this.createDate[0],
  1249. endDate: this.createDate[1],
  1250. ownerId: this.ownerIds,
  1251. leaveType: this.type,
  1252. };
  1253. if (this.isAuditList) {
  1254. param.status = 1;
  1255. }
  1256. this.list = [];
  1257. // this.total = 0;
  1258. this.http.post('/business-trip/list', param,
  1259. res => {
  1260. if (res.code == "ok") {
  1261. this.tableList = res.data.records
  1262. this.total = res.data.total
  1263. this.loading = false
  1264. } else {
  1265. this.loading = false
  1266. this.$message({
  1267. message: res.msg,
  1268. type: "error"
  1269. });
  1270. }
  1271. },
  1272. error => {
  1273. this.loading = false
  1274. this.$message({
  1275. message: error,
  1276. type: "error"
  1277. });
  1278. });
  1279. },
  1280. handleSizeChange(val){
  1281. this.size = val;
  1282. this.page = 1
  1283. if(this.isSyncData){
  1284. this.billss()
  1285. }else{
  1286. this.bills()
  1287. }
  1288. },
  1289. handleCurrentChange(val) {
  1290. // console.log(val, 1, '1')
  1291. this.page = val;
  1292. if(this.isSyncData){
  1293. this.billss()
  1294. }else{
  1295. this.bills()
  1296. }
  1297. },
  1298. // 出差申请
  1299. formsubmit(){
  1300. this.$refs.addformAO.validate(val => {
  1301. if(val){
  1302. this.formloading = true
  1303. // console.log("addform",this.addform);
  1304. this.http.post( '/business-trip/add', this.addform,
  1305. res => {
  1306. if (res.code == "ok") {
  1307. this.formloading = false
  1308. this.$message({
  1309. message: this.$t('applicationissuccessful'),
  1310. type: "success"
  1311. })
  1312. this.addform = {
  1313. reason: null, //出差事由
  1314. startDate: null, //开始时间
  1315. endDate: null, //结束时间
  1316. way: 0, //交通工具
  1317. cityFrom: null, //出发城市
  1318. cityTo: null, //目的城市
  1319. goBack: 0, //单程往返
  1320. dayCount: null, //出差天数
  1321. remark: '', //备注
  1322. projectId: null, //项目id
  1323. degreeId:null //维度id
  1324. }
  1325. } else {
  1326. this.formloading = false
  1327. this.$message({
  1328. message: res.msg,
  1329. type: "error"
  1330. });
  1331. }
  1332. },
  1333. error => {
  1334. this.formloading = false
  1335. this.$message({
  1336. message: error,
  1337. type: "error"
  1338. });
  1339. });
  1340. }
  1341. })
  1342. },
  1343. // 日期改变
  1344. datechg(e){
  1345. if(this.addform.endDate != null && this.addform.startDate != null){
  1346. let days = this.autoCountDay(this.addform.startDate,this.addform.endDate)
  1347. if(days > 0){
  1348. this.addform.dayCount = days
  1349. }else{
  1350. this.addform.dayCount = 1
  1351. if(e){
  1352. this.addform.endDate = this.addform.startDate
  1353. }else{
  1354. this.addform.startDate = this.addform.endDate
  1355. }
  1356. }
  1357. }else{
  1358. this.addform.dayCount = null
  1359. }
  1360. },
  1361. datechg2(e){
  1362. // console.log(this.editItemForm.startDate,this.editItemForm.endDate);
  1363. if(this.editItemForm.endDate != null && this.editItemForm.startDate != null){
  1364. let days = this.autoCountDay(this.editItemForm.startDate,this.editItemForm.endDate)
  1365. if(days > 0){
  1366. this.editItemForm.dayCount = days
  1367. }else{
  1368. this.editItemForm.dayCount = 1
  1369. if(e){
  1370. this.editItemForm.endDate = this.editItemForm.startDate
  1371. }else{
  1372. this.editItemForm.startDate = this.editItemForm.endDate
  1373. }
  1374. }
  1375. }else{
  1376. this.editItemForm.dayCount = null
  1377. }
  1378. },
  1379. datechg3(e){
  1380. if(this.relationItem.endDate != null && this.relationItem.startDate != null){
  1381. let days = this.autoCountDay(this.relationItem.startDate,this.relationItem.endDate)
  1382. if(days <= 0){
  1383. if(e){
  1384. this.relationItem.endDate = this.relationItem.startDate
  1385. }else{
  1386. this.relationItem.startDate = this.relationItem.endDate
  1387. }
  1388. }
  1389. }
  1390. },
  1391. // 自动计算天数
  1392. autoCountDay(st,ed){
  1393. let differDay = new Date(ed).getTime() - new Date(st).getTime()
  1394. let differDay2 = differDay/(24*3600*1000) + 1
  1395. return differDay2
  1396. },
  1397. // 获取出差列表
  1398. getTableList(){
  1399. this.billss()
  1400. },
  1401. // 筛选刷新
  1402. billss(e) {
  1403. if(e){
  1404. this.page = 1
  1405. }
  1406. var param = {
  1407. pageIndex: this.page,
  1408. pageSize: this.size,
  1409. status: this.code,
  1410. startDate: this.createDate == null ? '' : this.createDate[0],
  1411. endDate: this.createDate == null ? '' : this.createDate[1],
  1412. ownerId: this.ownerIds,
  1413. way: this.type,
  1414. };
  1415. if(this.isOverTendays){
  1416. param.checkState = 1
  1417. }
  1418. this.tableListLoading = true
  1419. this.http.post('/business-trip/list', param,
  1420. res => {
  1421. if (res.code == "ok") {
  1422. this.tableList = res.data.records
  1423. this.total = res.data.total
  1424. this.tableListLoading = false
  1425. console.log('tablelist',this.tableList);
  1426. this.$forceUpdate()
  1427. } else {
  1428. this.tableListLoading = false
  1429. this.$message({
  1430. message: res.msg,
  1431. type: "error"
  1432. });
  1433. }
  1434. },
  1435. error => {
  1436. this.tableListLoading = false
  1437. this.$message({
  1438. message: error,
  1439. type: "error"
  1440. });
  1441. });
  1442. },
  1443. approve(item) {
  1444. //审核通过
  1445. this.http.post('/business-trip/approve', {id:item.id
  1446. },
  1447. res => {
  1448. if (res.code == "ok") {
  1449. this.auditList();
  1450. this.$message({
  1451. message: '操作成功',
  1452. type: "success"
  1453. });
  1454. } else {
  1455. this.$message({
  1456. message: res.msg,
  1457. type: "error"
  1458. });
  1459. }
  1460. },
  1461. error => {
  1462. this.$message({
  1463. message: error,
  1464. type: "error"
  1465. });
  1466. });
  1467. },
  1468. deny(item) {
  1469. this.denyDialogV = true;
  1470. this.denyInfo = {id:item.id, reason:null};
  1471. },
  1472. submitDeny(id) {
  1473. //审核驳回
  1474. this.http.post('/business-trip/deny', this.denyInfo,
  1475. res => {
  1476. if (res.code == "ok") {
  1477. this.auditList();
  1478. this.denyDialogV = false;
  1479. this.$message({
  1480. message: '操作成功',
  1481. type: "success"
  1482. });
  1483. } else {
  1484. this.$message({
  1485. message: res.msg,
  1486. type: "error"
  1487. });
  1488. }
  1489. },
  1490. error => {
  1491. this.$message({
  1492. message: error,
  1493. type: "error"
  1494. });
  1495. });
  1496. },
  1497. cancel(e) {
  1498. this.$confirm('确定要撤回该出差申请吗', this.$t('other.prompts'), {
  1499. //type: 'warning'
  1500. }).then(() => {
  1501. this.http.post('/business-trip/cancel', {id:e.id},
  1502. res => {
  1503. if (res.code == "ok") {
  1504. this.bills();
  1505. this.$message({
  1506. message: '操作成功',
  1507. type: "success"
  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. // 操作 - 删除
  1525. deletes(e) {
  1526. this.$confirm(this.$t('deleteit'), this.$t('other.prompts'), {}).then(() => {
  1527. this.http.post('/business-trip/delete', {id:e.id},
  1528. res => {
  1529. if (res.code == "ok") {
  1530. this.getTableList();
  1531. this.$message({
  1532. message: this.$t('message.successfullyDeleted'),
  1533. type: "success"
  1534. });
  1535. } else {
  1536. this.$message({
  1537. message: res.msg,
  1538. type: "error"
  1539. });
  1540. }
  1541. },
  1542. error => {
  1543. this.$message({
  1544. message: error,
  1545. type: "error"
  1546. });
  1547. });
  1548. });
  1549. },
  1550. // 操作 - 编辑
  1551. editor(e) {
  1552. // console.log("编辑",e);
  1553. this.editDialog = true
  1554. if(e.degreeId != null){
  1555. e.degreeId = e.degreeId + ''
  1556. // console.log("e.degreeId",e.degreeId);
  1557. }
  1558. this.editItemForm = e
  1559. this.getwuduList(0)
  1560. },
  1561. // 编辑框确定
  1562. determine(){
  1563. let edddd = {
  1564. id: this.editItemForm.id,
  1565. reason: this.editItemForm.reason, //出差事由
  1566. startDate: this.editItemForm.startDate, //开始时间
  1567. endDate: this.editItemForm.endDate, //结束时间
  1568. way: this.editItemForm.way, //交通工具
  1569. cityFrom: this.editItemForm.cityFrom, //出发城市
  1570. cityTo: this.editItemForm.cityTo, //目的城市
  1571. goBack: this.editItemForm.goBack, //单程往返
  1572. dayCount: this.editItemForm.dayCount, //出差天数
  1573. remark: this.editItemForm.remark, //备注
  1574. projectId: this.editItemForm.projectId, //项目id
  1575. degreeId:this.editItemForm.degreeId, //维度id
  1576. degreeName: null
  1577. }
  1578. for(let i=0; i<this.wuduList.length; i++){
  1579. if(this.wuduList[i].id == edddd.degreeId){
  1580. edddd.degreeName = this.wuduList[i].name
  1581. }
  1582. }
  1583. this.http.post( '/business-trip/add', edddd,
  1584. res => {
  1585. if (res.code == "ok") {
  1586. this.editItemForm = null
  1587. this.editDialog = false
  1588. this.billss()
  1589. this.$message({
  1590. message: this.$t('message.modifyTheSuccess'),
  1591. type: 'success'
  1592. })
  1593. } else {
  1594. this.$message({
  1595. message: res.msg,
  1596. type: "error"
  1597. });
  1598. }
  1599. },
  1600. error => {
  1601. this.$message({
  1602. message: error,
  1603. type: "error"
  1604. });
  1605. });
  1606. },
  1607. // 出差统计
  1608. statistical() {
  1609. // console.log("date",this.searchDates);
  1610. this.summaryLoading = true
  1611. this.http.post('/business-trip/summaryData', {
  1612. keyword: this.searchWord,
  1613. startDate: this.searchDates[0],
  1614. endDate: this.searchDates[1]
  1615. },
  1616. res => {
  1617. if (res.code == "ok") {
  1618. // console.log("出差统计",res.data);
  1619. this.statisticalList = res.data
  1620. this.summaryLoading = false
  1621. } else {
  1622. this.summaryLoading = false
  1623. this.$message({
  1624. message: res.msg,
  1625. type: "error"
  1626. });
  1627. }
  1628. },
  1629. error => {
  1630. this.$message({
  1631. message: error,
  1632. type: "error"
  1633. });
  1634. });
  1635. },
  1636. // 获取本月一号至今
  1637. getautoDate() {
  1638. let newdate = new Date()
  1639. let newyear = newdate.getFullYear()
  1640. let newmonth = newdate.getMonth() + 1
  1641. let newday = newdate.getDate()
  1642. let firstdate = newyear + '-' + (newmonth < 10 ? '0' + newmonth : newmonth) + '-01'
  1643. let seconddate = newyear + '-' + (newmonth < 10 ? '0' + newmonth : newmonth) + '-' + (newday < 10 ? '0' + newday : newday)
  1644. return [firstdate,seconddate]
  1645. },
  1646. // 出差统计列表查看详情
  1647. viewDetails(s,e){
  1648. // console.log("e",e);
  1649. if(s){
  1650. this.detailsuserid = e.ownerId
  1651. }
  1652. var param = {
  1653. pageIndex: this.detailspage,
  1654. pageSize: this.detailssize,
  1655. status: 0,
  1656. startDate: this.searchDates[0],
  1657. endDate: this.searchDates[1],
  1658. ownerId: this.detailsuserid,
  1659. way: '',
  1660. };
  1661. this.detailsloading = true
  1662. this.http.post('/business-trip/list', param,
  1663. res => {
  1664. if (res.code == "ok") {
  1665. // this.tableList = res.data.records
  1666. this.detailstotal = res.data.total
  1667. // this.loading = false
  1668. // this.$forceUpdate()
  1669. this.detailsData = res.data.records
  1670. this.seeDialog = true
  1671. // console.log('see',res.data);
  1672. this.$forceUpdate()
  1673. this.detailsloading = false
  1674. } else {
  1675. this.detailsloading = false
  1676. this.$message({
  1677. message: res.msg,
  1678. type: "error"
  1679. });
  1680. }
  1681. },
  1682. error => {
  1683. this.detailsloading = false
  1684. this.$message({
  1685. message: error,
  1686. type: "error"
  1687. });
  1688. });
  1689. },
  1690. detailsSizeChange(val){
  1691. this.detailssize = val;
  1692. this.viewDetails(0)
  1693. },
  1694. detailsCurrentChange(val) {
  1695. // console.log(val, 1, '1')
  1696. this.detailspage = val;
  1697. this.viewDetails(0)
  1698. },
  1699. // 出差审批流
  1700. // 获取部门列表
  1701. getDepartment() {
  1702. this.http.post( this.port.manage.depList, {},
  1703. res => {
  1704. if (res.code == "ok") {
  1705. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  1706. this.sdata = list;
  1707. this.soption = [
  1708. {value: 1 , label : this.$t('lable.department') , children : this.changeArr(list1), type: 'dep'},
  1709. {value: 2 , label : this.$t('designatedpersonnel'),children : this.susers, type: 'user'}
  1710. ]
  1711. } else {
  1712. this.$message({
  1713. message: res.msg,
  1714. type: "error"
  1715. });
  1716. }
  1717. },
  1718. error => {
  1719. this.$message({
  1720. message: error,
  1721. type: "error"
  1722. });
  1723. });
  1724. },
  1725. changeArr(arr) {
  1726. for (var i = 0; i < arr.length; i++) {
  1727. if(arr[i].id != -1 && arr[i].id != 0) {
  1728. if (arr[i].children != null && arr[i].children.length>0) {
  1729. arr[i].children = this.changeArr(arr[i].children);
  1730. }
  1731. arr[i].type = 'dep'
  1732. arr[i].id && (arr[i].value = arr[i].id);
  1733. delete arr[i].id;
  1734. }
  1735. }
  1736. for(var i in arr) {
  1737. if(arr[i].id == -1 || arr[i].id == 0) {
  1738. arr.splice(i,1)
  1739. }
  1740. }
  1741. return arr;
  1742. },
  1743. handleNodeClick(data) {
  1744. if(this.depData == null || data.id != this.depData.id) {
  1745. this.depData = data;
  1746. // console.log("depdata",this.depData);
  1747. this.getSettings();
  1748. }
  1749. },
  1750. getSettings() {
  1751. this.http.post('/audit-workflow-setting/get',{deptId: this.depData.id,type: 2},
  1752. res => {
  1753. this.listLoading = false;
  1754. if (res.code == "ok") {
  1755. this.dataArray = res.data;
  1756. // console.log("请求1",res.data);
  1757. } else {
  1758. this.$message({
  1759. message: res.msg,
  1760. type: "error"
  1761. });
  1762. }
  1763. },
  1764. error => {
  1765. this.listLoading = false;
  1766. this.$message({
  1767. message: error,
  1768. type: "error"
  1769. });
  1770. });
  1771. },
  1772. editNodeDialog(index, item) {
  1773. //检查是否可编辑
  1774. this.http.post('/audit-workflow-setting/checkNodeInUse',{auditDeptId: item.auditDeptId, deptId: this.depData.id,type: 2},
  1775. res => {
  1776. this.listLoading = false;
  1777. if (res.code == "ok") {
  1778. this.isAdd = false;
  1779. this.sindex = index;
  1780. this.curUserId = item.userId;
  1781. this.dialogVisible = true;
  1782. this.curDeptId = item.auditDeptId;
  1783. this.selectedAuuid = item.userId || item.auditDeptId
  1784. } else {
  1785. this.$message({
  1786. message: res.msg,
  1787. type: "error"
  1788. });
  1789. }
  1790. },
  1791. error => {
  1792. this.listLoading = false;
  1793. this.$message({
  1794. message: error,
  1795. type: "error"
  1796. });
  1797. });
  1798. },
  1799. showNodeDialog(index) {
  1800. this.isAdd = true;
  1801. this.sindex = index;
  1802. this.curDeptId = null;
  1803. this.curUserId = null;
  1804. this.dialogVisible = true;
  1805. },
  1806. submitInsert() {
  1807. this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id,type: 2},
  1808. res => {
  1809. this.listLoading = false;
  1810. if (res.code == "ok") {
  1811. this.$message({
  1812. message: this.$t('savesuccess'),
  1813. type: "success"
  1814. });
  1815. } else {
  1816. this.$message({
  1817. message: res.msg,
  1818. type: "error"
  1819. });
  1820. }
  1821. },
  1822. error => {
  1823. this.listLoading = false;
  1824. this.$message({
  1825. message: error,
  1826. type: "error"
  1827. });
  1828. });
  1829. },
  1830. deleteNode() {
  1831. this.dialogVisible = false;
  1832. this.dataArray.splice(this.sindex, 1);
  1833. },
  1834. addNode() {
  1835. this.dialogVisible = false;
  1836. if (this.curDeptId == null) return;
  1837. // var node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
  1838. var node = ''
  1839. if(this.user.userNameNeedTranslate != 1) {
  1840. // node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
  1841. node = this.$refs.deptCascader.getCheckedNodes()[0];
  1842. } else {
  1843. node = this.addNodeObj
  1844. }
  1845. // var node = this.$refs.deptCascader.getCheckedNodes()[0];
  1846. if (this.isAdd) {
  1847. // if(node.path[0] == 1){
  1848. // var node = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1849. // }else if(node.path[0] == 2){
  1850. // var node = {userId: node.value, userName: node.label, auditorType: 2};
  1851. // }
  1852. var nodes
  1853. if(this.user.userNameNeedTranslate != 1) {
  1854. if(node.path[0] == 1){
  1855. nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1856. }else if(node.path[0] == 2){
  1857. nodes = {userId: node.value, userName: node.label, auditorType: 2};
  1858. }
  1859. } else {
  1860. if(node.managerId) {
  1861. nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1862. } else {
  1863. nodes = {userId: node.value, userName: node.label, auditorType: 2};
  1864. }
  1865. }
  1866. this.dataArray.splice(this.sindex, 0, nodes);
  1867. } else {
  1868. //编辑
  1869. if(node.type == 'dep') {
  1870. this.dataArray[this.sindex].auditDeptId = node.value;
  1871. this.dataArray[this.sindex].auditDeptName = node.label;
  1872. this.dataArray[this.sindex].auditorType = 1
  1873. this.dataArray[this.sindex].userId = ''
  1874. this.dataArray[this.sindex].userName = ''
  1875. } else {
  1876. this.dataArray[this.sindex].userId = node.value;
  1877. this.dataArray[this.sindex].userName = node.label;
  1878. this.dataArray[this.sindex].auditDeptId = ''
  1879. this.dataArray[this.sindex].auditDeptName = ''
  1880. this.dataArray[this.sindex].auditorType = 2
  1881. }
  1882. }
  1883. },
  1884. getUsers() {
  1885. this.http.post('/user/getSimpleActiveUserList', {},
  1886. res => {
  1887. if (res.code == "ok") {
  1888. // console.log("users",res.data);
  1889. // this.users = res.data.records;
  1890. this.users = res.data;
  1891. for (let i = 0; i < this.users.length; i++) {
  1892. // this.susers.push({value:this.users[i].id,label:this.users[i].name})
  1893. this.susers.push({value:this.users[i].id,label:this.users[i].name,type: 'user'})
  1894. }
  1895. // if (this.user.role == 0) {
  1896. // this.editItemForm.ownerId = this.user.id;
  1897. // this.ownerIds = this.user.id
  1898. // this.editItemForm.status = 1;
  1899. // this.editItemForm.tel = this.user.phone
  1900. // }
  1901. } else {
  1902. this.$message({
  1903. message: res.msg,
  1904. type: "error"
  1905. });
  1906. }
  1907. },
  1908. error => {
  1909. this.$message({
  1910. message: error,
  1911. type: "error"
  1912. });
  1913. });
  1914. },
  1915. // 维度选择添加
  1916. getProjectList() {
  1917. this.http.post( this.port.project.list, {},
  1918. res => {
  1919. if (res.code == "ok") {
  1920. this.projectList = res.data;
  1921. console.log("项目列表",this.projectList);
  1922. } else {
  1923. this.$message({
  1924. message: res.msg,
  1925. type: "error"
  1926. });
  1927. }
  1928. },
  1929. error => {
  1930. this.$message({
  1931. message: error,
  1932. type: "error"
  1933. });
  1934. });
  1935. },
  1936. // 获取维度数据
  1937. getwuduList(e,i) {
  1938. if(e == 1){
  1939. this.addform.wuduId = null
  1940. if(this.addform.projectId == '' || this.addform.projectId == null) {
  1941. return
  1942. }
  1943. var pId = this.addform.projectId
  1944. }else if(e == 0){
  1945. this.editItemForm.wuduId = null
  1946. if(this.editItemForm.projectId == '' || this.editItemForm.projectId == null) {
  1947. return
  1948. }
  1949. var pId = this.editItemForm.projectId
  1950. }else{
  1951. if(i != 1){this.relationItem.degreeId = null}
  1952. if(this.relationItem.projectId == '' || this.relationItem.projectId == null){
  1953. return
  1954. }
  1955. var pId = this.relationItem.projectId
  1956. // if(i == 1){
  1957. // this.DingdingForm.degreeId = null
  1958. // }
  1959. // if(this.DingdingForm.projectId == '' || this.DingdingForm.projectId == null){
  1960. // return
  1961. // }
  1962. // var pId = this.DingdingForm.projectId
  1963. }
  1964. this.http.post('/project/getDegreeList',{
  1965. projectId: pId,
  1966. },
  1967. res => {
  1968. if (res.code == "ok") {
  1969. this.wuduList = res.data
  1970. }
  1971. },
  1972. error => {
  1973. this.$message({
  1974. message: error,
  1975. type: "error"
  1976. });
  1977. }
  1978. );
  1979. },
  1980. vueCasader(obj) {
  1981. if(obj.distinction == 1) {
  1982. let arr = []
  1983. arr.push(obj.id)
  1984. this.curDeptId = arr
  1985. this.vueCasaderItem = obj.item
  1986. this.addNodeObj = obj.item
  1987. console.log(obj, '选中的')
  1988. }
  1989. }
  1990. //获取项目列表
  1991. // getProjectList() {
  1992. // this.listLoading = true;
  1993. // this.http.post( this.port.project.list, {},
  1994. // res => {
  1995. // this.listLoading = false;
  1996. // if (res.code == "ok") {
  1997. // this.projectList = res.data;
  1998. // console.log("项目列表",this.projectList);
  1999. // } else {
  2000. // this.$message({
  2001. // message: res.msg,
  2002. // type: "error"
  2003. // });
  2004. // }
  2005. // },
  2006. // error => {
  2007. // this.listLoading = false;
  2008. // this.$message({
  2009. // message: error,
  2010. // type: "error"
  2011. // });
  2012. // });
  2013. // },
  2014. }
  2015. }
  2016. </script>
  2017. <style lang="scss" scoped>
  2018. .sidebars {
  2019. height: 100%;
  2020. position: absolute;
  2021. border-right: 1px solid #E6E6E6;
  2022. z-index: 2;
  2023. top: 0;
  2024. h3 {
  2025. margin: 0;
  2026. line-height: 45px;
  2027. background: #ffffff;
  2028. font-weight: normal;
  2029. color: #666;
  2030. padding-left: 20px;
  2031. }
  2032. .el-col-12 {
  2033. width: 100%
  2034. }
  2035. }
  2036. .contents {
  2037. height: 100%;
  2038. background: #F7F7F7;
  2039. .tops {
  2040. width: 100%;
  2041. height:100%;
  2042. position: absolute;
  2043. background: #f7f7f7;
  2044. box-sizing: border-box;
  2045. padding: 20px 0 0 220px;
  2046. }
  2047. .ctons {
  2048. width: 86%;
  2049. height: 92%;
  2050. overflow: hidden;
  2051. background: #fff;
  2052. padding: 30px 40px;
  2053. box-sizing: border-box;
  2054. .el-form-item {
  2055. display: inline-block;
  2056. }
  2057. .flex {
  2058. display: flex;
  2059. justify-content: flex-start;
  2060. padding: 0 0 20px 0;
  2061. border-bottom: 1px solid #f2f2f2;
  2062. span {
  2063. display: inline-block;
  2064. margin: 0 10px 0 20px;
  2065. }
  2066. }
  2067. .poss {
  2068. position: fixed;
  2069. bottom: 20px;
  2070. right: 1%;
  2071. box-sizing: border-box;
  2072. }
  2073. }
  2074. .headine {
  2075. width: 100%;
  2076. height: 46.4px;
  2077. line-height: 46.4px;
  2078. background: #fff;
  2079. box-sizing: border-box;
  2080. h3 {
  2081. margin: 0;
  2082. display: inline-block;
  2083. box-sizing: border-box;
  2084. color: #999;
  2085. }
  2086. p {
  2087. display: inline-block;
  2088. margin: 0;
  2089. }
  2090. }
  2091. }
  2092. .addNode {
  2093. cursor:pointer;
  2094. }
  2095. .addNode:hover {
  2096. color:#20a0ff;
  2097. }
  2098. .detailsScope{
  2099. font-size: 12px;
  2100. padding: 3px 0;
  2101. line-height: 15px;
  2102. }
  2103. .detailsScope span:nth-child(1){
  2104. display: inline-block;
  2105. width: 25%;
  2106. }
  2107. .detailsScope span:nth-child(2){
  2108. display: inline-block;
  2109. width: 40%;
  2110. text-align: left;
  2111. }
  2112. .detailsScope span:nth-child(3){
  2113. display: inline-block;
  2114. width: 35%;
  2115. text-align: left;
  2116. }
  2117. .dingdingtongbu span {
  2118. display: inline-block;
  2119. width: 80px;
  2120. padding-left: 20px;
  2121. }
  2122. </style>