awayOffice.vue 88 KB

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