awayOffice.vue 102 KB

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