awayOffice.vue 88 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968
  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="remark" :label="$t('bei-zhu')" width="200">
  245. <template slot-scope="scope">
  246. <el-popover placement="top-start" :title="$t('biao-ti')" width="200" trigger="hover" :content="scope.row.remark">
  247. <div slot="reference" class="apls">{{scope.row.remark}}</div>
  248. </el-popover>
  249. </template>
  250. </el-table-column>
  251. <el-table-column prop="status" :label="$t('state.states')" width="100" fixed="right">
  252. <template slot-scope="scope">
  253. <span v-if="scope.row.status == 0">{{ $t('state.approved') }}</span>
  254. <span v-if="scope.row.status == 1" style="color: orange">{{ $t('state.WaitingAudit') }}</span>
  255. <span v-if="scope.row.status == 2" style="color: red">{{ $t('btn.rejected') }}</span>
  256. <span v-if="scope.row.status == 3" style="color: #666666">{{ $t('btn.undo') }}</span>
  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="summaryLoading" :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. summaryLoading: false,
  678. displayTable: false,
  679. formloading: false,
  680. apk: 0,
  681. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  682. userComLis: JSON.parse(sessionStorage.getItem("user")),
  683. addform: {
  684. reason: null, //出差事由
  685. startDate: null, //开始时间
  686. endDate: null, //结束时间
  687. way: 0, //交通工具
  688. cityFrom: null, //出发城市
  689. cityTo: null, //目的城市
  690. goBack: 0, //单程往返
  691. dayCount: null, //出差天数
  692. remark: '', //备注
  693. projectId: null, //项目id
  694. wuduId:null //维度id
  695. },
  696. formrules:{
  697. reason:[{ required: true, message: this.$t('yourbusinesstrip'), trigger: "blur" }],
  698. cityFrom:[{ required: true, message: this.$t('selectyourdeparturecity'), trigger: "blur" }],
  699. cityTo:[{ required: true, message: this.$t('saelectdestinationcity'), trigger: "blur" }],
  700. startDate:[{ required: true, message: this.$t('selectastarttime'), trigger: "blur" }],
  701. endDate:[{ required: true, message: this.$t('selectanendtime'), trigger: "blur" }]
  702. },
  703. editItemRules:{
  704. cityFrom:[{ required: true, message: this.$t('selectyourdeparturecity'), trigger: "blur" }],
  705. cityTo:[{ required: true, message: this.$t('saelectdestinationcity'), trigger: "blur" }],
  706. startDate:[{ required: true, message: this.$t('selectastarttime'), trigger: "blur" }],
  707. endDate:[{ required: true, message: this.$t('selectanendtime'), trigger: "blur" }]
  708. },
  709. cityList:[],
  710. cityList2:[],
  711. projectList: [],
  712. wuduList: [],
  713. wuduData: JSON.parse(sessionStorage.getItem("user")).timeType,
  714. user: JSON.parse(sessionStorage.getItem("user")),
  715. tableList: [],
  716. isAuditList: false,
  717. editItemForm: {},
  718. // editItemFormRules: {
  719. // timeDays: [{required: true, validator: checks, trigger: 'blur'}],
  720. // leaveType: [{ required: true, message: "请选择出差类型", trigger: "blur" }]
  721. // },
  722. editDialog: false,
  723. users: null,
  724. total:0,
  725. page: 1,
  726. size: 20,
  727. falg: 0,
  728. code: '',
  729. type: '',
  730. ownerIds: null,
  731. createDate: [],
  732. // 出差统计
  733. searchWord:'',
  734. searchDates: null,
  735. searchStartDate: null,
  736. searchEndDate: null,
  737. statisticalList: [],
  738. // 出差统计查看详情
  739. seeDialog: false,
  740. detailsData: [],
  741. detailstotal: 0,
  742. detailspage: 1,
  743. detailssize: 20,
  744. detailsuserid: null,
  745. // 出差审批流
  746. sdata: [],
  747. sdefaultProps: {
  748. children: 'children',
  749. label: 'label'
  750. },
  751. depData: null,
  752. dataArray: [],
  753. dialogVisible: false,
  754. curDeptId: null,
  755. isAdd: false,
  756. susers: [],
  757. // 钉钉环境交互
  758. isDingding: 0,
  759. DingdingEditDialog: false,
  760. DingdingTableLoading: false,
  761. appendAddorModDialog: false,
  762. relationList: [],
  763. relationItem: {
  764. bustripId: null, //出差记录id
  765. startDate: null,
  766. endDate: null,
  767. projectId: null,
  768. degreeId: null
  769. },
  770. relationItemRules: {
  771. startDate:[{required: true,message: this.$t('selectastartdate'),trigger: 'change'}],
  772. endDate:[{required: true,message: this.$t('selectaenddate'),trigger: 'change'}],
  773. projectId:[{required: true,message: this.$t('projectassociate'),trigger: 'change'}],
  774. },
  775. relationItemTemporaryDate: {},
  776. synchronizeLoading: false,
  777. synchronizationDaying:false,
  778. createDateList: [],
  779. ownerIdsId: '',
  780. isOverTendays: false,
  781. tableListLoading: false,
  782. }
  783. },
  784. created(){
  785. this.cityList = citys
  786. // console.log("city",this.cityList);
  787. let height = window.innerHeight;
  788. this.tableHeight = height - 195;
  789. const that = this;
  790. window.onresize = function temp() {
  791. that.tableHeight = window.innerHeight - 195;
  792. };
  793. this.isDingding = this.wuduData.syncDingding
  794. },
  795. mounted(){
  796. if(this.isDingding){
  797. this.staffs(2,['2'])
  798. }
  799. this.getTableList()
  800. this.getProjectList()
  801. this.getDepartment()
  802. // console.log("session",this.wuduData);
  803. },
  804. methods: {
  805. // 自定义事件
  806. selectCal(obj) {
  807. if(obj.distinction == '1') {
  808. this.ownerIds = obj.id
  809. this.billss(obj.other)
  810. } else if(obj.distinction == '2') {
  811. this.ownerIdsId = obj.id
  812. }
  813. },
  814. dingdingListExport(){
  815. let parameter = {
  816. keyword: ''
  817. }
  818. if(this.createDate.length != 0){
  819. parameter.startDate = this.createDate[0]
  820. parameter.endDate = this.createDate[1]
  821. }
  822. this.http.post("/business-trip/exportData",parameter,
  823. res => {
  824. if(res.code == 'ok'){
  825. var filePath = res.data;
  826. const a = document.createElement('a'); // 创建a标签
  827. a.setAttribute('download', this.$t('tripStatistics')+'.xls');// download属性
  828. a.setAttribute('href', filePath);// href链接
  829. a.click(); //自执行点击事件
  830. a.remove();
  831. }else{
  832. this.$message({
  833. message: res.msg,
  834. type: "error"
  835. });
  836. }
  837. },error => {
  838. this.$message({
  839. message: error,
  840. type: "error"
  841. });
  842. })
  843. },
  844. checkboxChange(){
  845. this.billss(1)
  846. },
  847. deleteOfDingding(e) {
  848. this.$confirm(this.$t('deleteit'), this.$t('other.prompts'), {}).then(() => {
  849. this.http.post('/business-trip/delete', {id:e.id},
  850. res => {
  851. if (res.code == "ok") {
  852. this.billss();
  853. this.$message({
  854. message: this.$t('message.successfullyDeleted'),
  855. type: "success"
  856. });
  857. } else {
  858. this.$message({
  859. message: res.msg,
  860. type: "error"
  861. });
  862. }
  863. },
  864. error => {
  865. this.$message({
  866. message: error,
  867. type: "error"
  868. });
  869. });
  870. });
  871. },
  872. dingdingClick() {
  873. this.synchronizationDaying = true
  874. this.ownerIdsId = this.users[0].id
  875. let startDates = this.dayjs().add('-7','day').format("YYYY-MM-DD")
  876. let endDates = this.dayjs().format("YYYY-MM-DD")
  877. let arr = []
  878. arr.push(startDates)
  879. arr.push(endDates)
  880. this.createDateList = arr
  881. },
  882. // 判断日期
  883. determineDate(startDate, endDate) {
  884. let startTime = new Date(Date.parse(startDate.replace(/-/g, "/"))).getTime();
  885. let endTime = new Date(Date.parse(endDate.replace(/-/g, "/"))).getTime();
  886. let dates = Math.abs((startTime - endTime)) / (1000 * 60 * 60 * 24);
  887. let flg = dates > 7 ? false : true
  888. return flg ;
  889. },
  890. // 从钉钉同步假期剩余表
  891. listSynchronize(){
  892. // 判断日期
  893. let flgs = this.determineDate(this.createDateList[0], this.createDateList[1])
  894. if(flgs) {
  895. this.synchronizeLoading = true
  896. let transmissionObj = {}
  897. transmissionObj.userId = this.ownerIdsId
  898. transmissionObj.companyId = this.userComLis.companyId
  899. if(this.createDateList != 'null' && this.createDateList != null) {
  900. if(this.createDateList.length > 0) {
  901. transmissionObj.startDate = this.createDateList[0]
  902. transmissionObj.endDate = this.createDateList[1]
  903. } else {
  904. transmissionObj.startDate = this.dayjs().add('-7','day').format("YYYY-MM-DD")
  905. transmissionObj.endDate = this.dayjs().format("YYYY-MM-DD")
  906. }
  907. } else {
  908. transmissionObj.startDate = ''
  909. transmissionObj.endDate = ''
  910. }
  911. this.http.post('/dingding/syncUserWorkData',transmissionObj,
  912. res => {
  913. if(res.code == 'ok'){
  914. this.synchronizeLoading = false
  915. this.synchronizationDaying = false
  916. this.$message({
  917. message: this.$t('synchronoussuccess'),
  918. type: 'success'
  919. })
  920. // this.ownerIdsId = ''
  921. // this.createDateList = []
  922. this.getTableList()
  923. }else {
  924. this.synchronizeLoading = false
  925. this.$message({
  926. message: res.msg,
  927. type: 'error'
  928. })
  929. }
  930. },err => {
  931. this.synchronizeLoading = false
  932. this.$message({
  933. message: err,
  934. type: 'error'
  935. })
  936. })
  937. } else {
  938. this.$message({
  939. message: this.$t('cannotbesynchronized'),
  940. type: 'warning'
  941. });
  942. }
  943. },
  944. // 钉钉环境交互
  945. DingdingEditor(e){
  946. console.log(e);
  947. this.DingdingEditDialog = true
  948. this.relationItem.bustripId = e.id
  949. this.relationItemTemporaryDate = {
  950. startDate: e.startDate,
  951. endDate: e.endDate
  952. }
  953. this.getRelationList()
  954. },
  955. getRelationList(){
  956. this.DingdingTableLoading = true
  957. this.http.post('/bustrip-project/list',{
  958. bustripId: this.relationItem.bustripId
  959. },res => {
  960. if(res.code == 'ok'){
  961. this.DingdingTableLoading = false
  962. console.log('getlist',res.data);
  963. this.relationList = res.data
  964. }else {
  965. this.DingdingTableLoading = false
  966. this.$message({
  967. message: res.msg,
  968. type: 'error'
  969. })
  970. }
  971. },err => {
  972. this.DingdingTableLoading = false
  973. this.$message({
  974. message: err,
  975. type: 'error'
  976. })
  977. })
  978. },
  979. DingdingAddorMod(row){
  980. this.appendAddorModDialog = true
  981. if(row){
  982. this.relationItem.id = row.id
  983. this.relationItem.projectId = row.projectId
  984. this.getwuduList(2,1)
  985. this.relationItem.startDate = row.startDate
  986. this.relationItem.endDate = row.endDate
  987. this.relationItem.degreeId = row.degreeId == null ? row.degreeId : row.degreeId.toString()
  988. // console.log('degreeId',this.relationItem.degreeId);
  989. }else {
  990. this.relationItem.startDate = this.relationItemTemporaryDate.startDate
  991. this.relationItem.endDate = this.relationItemTemporaryDate.endDate
  992. this.relationItem.projectId = null
  993. this.relationItem.degreeId = null
  994. delete this.relationItem.id
  995. }
  996. },
  997. appendAddorModSure(formname){
  998. this.$refs[formname].validate((valid)=>{
  999. if(valid){
  1000. this.http.post('/bustrip-project/addOrMod',this.relationItem,
  1001. res => {
  1002. if(res.code == 'ok'){
  1003. this.appendAddorModDialog = false
  1004. this.getRelationList()
  1005. this.getTableList()
  1006. }else {
  1007. this.$message({
  1008. message: res.msg,
  1009. type: 'error'
  1010. })
  1011. }
  1012. },err => {
  1013. this.$message({
  1014. message: err,
  1015. type: 'error'
  1016. })
  1017. })
  1018. }else {
  1019. return false
  1020. }
  1021. })
  1022. },
  1023. DingdingDelete(row){
  1024. console.log('row',this.relationItem);
  1025. this.$confirm(this.$t('doyouwanttodeleteit'),this.$t('other.prompts'),{
  1026. confirmButtonText: this.$t('btn.determine'),
  1027. cancelButtonText: this.$t('btn.cancel'),
  1028. type: 'warning'
  1029. }).then(()=>{
  1030. this.http.post('/bustrip-project/delete',{
  1031. id:row.id
  1032. },res => {
  1033. if(res.code == 'ok'){
  1034. // this.$message({
  1035. // message: '删除成功',
  1036. // type: 'success'
  1037. // })
  1038. this.getRelationList()
  1039. }else {
  1040. this.$message({
  1041. message: res.msg,
  1042. type: 'error'
  1043. })
  1044. }
  1045. },err => {
  1046. this.$message({
  1047. message: err,
  1048. type: 'error'
  1049. })
  1050. })
  1051. })
  1052. },
  1053. staffs(key, keyPath) {
  1054. // console.log("keypath",keyPath)
  1055. if (keyPath[0] == '1') {
  1056. this.displayTable = false;
  1057. this.apk = 0
  1058. } else if(keyPath[0] == '2' || keyPath[0] == '3') {
  1059. this.displayTable = true;
  1060. this.apk = 0
  1061. if(this.users == null){ this.getUsers() }
  1062. } else if(keyPath[0] == '4'){
  1063. if(this.searchDates == null){
  1064. this.searchDates = this.getautoDate()
  1065. // console.log('000');
  1066. }
  1067. this.displayTable = true;
  1068. this.apk = 1
  1069. this.statistical()
  1070. } else {
  1071. this.displayTable = true;
  1072. this.apk = 2
  1073. }
  1074. },
  1075. // 导航切换
  1076. bills(audit, tr){
  1077. if(tr) {
  1078. this.code = ''
  1079. this.createDate = []
  1080. // this.ownerIds = ''
  1081. this.type = ''
  1082. if(tr == 1) {
  1083. this.falg = 1
  1084. this.code = 1
  1085. } else if(tr == 2) {
  1086. this.code = ''
  1087. this.falg = 0
  1088. } else {
  1089. this.falg = 0
  1090. }
  1091. } else {
  1092. this.falg = false
  1093. }
  1094. this.tableList = []
  1095. this.displayTable = true;
  1096. this.isAuditList = audit;
  1097. this.loading = true
  1098. var param = {
  1099. pageIndex: this.page,
  1100. pageSize: this.size,
  1101. status: this.code,
  1102. startDate: this.createDate[0],
  1103. endDate: this.createDate[1],
  1104. ownerId: this.ownerIds,
  1105. leaveType: this.type,
  1106. };
  1107. if (this.isAuditList) {
  1108. param.status = 1;
  1109. }
  1110. this.list = [];
  1111. // this.total = 0;
  1112. this.http.post('/business-trip/list', param,
  1113. res => {
  1114. if (res.code == "ok") {
  1115. this.tableList = res.data.records
  1116. this.total = res.data.total
  1117. this.loading = false
  1118. } else {
  1119. this.loading = false
  1120. this.$message({
  1121. message: res.msg,
  1122. type: "error"
  1123. });
  1124. }
  1125. },
  1126. error => {
  1127. this.loading = false
  1128. this.$message({
  1129. message: error,
  1130. type: "error"
  1131. });
  1132. });
  1133. },
  1134. handleSizeChange(val){
  1135. this.size = val;
  1136. this.page = 1
  1137. if(this.isDingding){
  1138. this.billss()
  1139. }else{
  1140. this.bills()
  1141. }
  1142. },
  1143. handleCurrentChange(val) {
  1144. // console.log(val, 1, '1')
  1145. this.page = val;
  1146. if(this.isDingding){
  1147. this.billss()
  1148. }else{
  1149. this.bills()
  1150. }
  1151. },
  1152. // 出差申请
  1153. formsubmit(){
  1154. this.$refs.addformAO.validate(val => {
  1155. if(val){
  1156. this.formloading = true
  1157. // console.log("addform",this.addform);
  1158. this.http.post( '/business-trip/add', this.addform,
  1159. res => {
  1160. if (res.code == "ok") {
  1161. this.formloading = false
  1162. this.$message({
  1163. message: this.$t('applicationissuccessful'),
  1164. type: "success"
  1165. })
  1166. this.addform = {
  1167. reason: null, //出差事由
  1168. startDate: null, //开始时间
  1169. endDate: null, //结束时间
  1170. way: 0, //交通工具
  1171. cityFrom: null, //出发城市
  1172. cityTo: null, //目的城市
  1173. goBack: 0, //单程往返
  1174. dayCount: null, //出差天数
  1175. remark: '', //备注
  1176. projectId: null, //项目id
  1177. degreeId:null //维度id
  1178. }
  1179. } else {
  1180. this.formloading = false
  1181. this.$message({
  1182. message: res.msg,
  1183. type: "error"
  1184. });
  1185. }
  1186. },
  1187. error => {
  1188. this.formloading = false
  1189. this.$message({
  1190. message: error,
  1191. type: "error"
  1192. });
  1193. });
  1194. }
  1195. })
  1196. },
  1197. // 日期改变
  1198. datechg(e){
  1199. if(this.addform.endDate != null && this.addform.startDate != null){
  1200. let days = this.autoCountDay(this.addform.startDate,this.addform.endDate)
  1201. if(days > 0){
  1202. this.addform.dayCount = days
  1203. }else{
  1204. this.addform.dayCount = 1
  1205. if(e){
  1206. this.addform.endDate = this.addform.startDate
  1207. }else{
  1208. this.addform.startDate = this.addform.endDate
  1209. }
  1210. }
  1211. }else{
  1212. this.addform.dayCount = null
  1213. }
  1214. },
  1215. datechg2(e){
  1216. // console.log(this.editItemForm.startDate,this.editItemForm.endDate);
  1217. if(this.editItemForm.endDate != null && this.editItemForm.startDate != null){
  1218. let days = this.autoCountDay(this.editItemForm.startDate,this.editItemForm.endDate)
  1219. if(days > 0){
  1220. this.editItemForm.dayCount = days
  1221. }else{
  1222. this.editItemForm.dayCount = 1
  1223. if(e){
  1224. this.editItemForm.endDate = this.editItemForm.startDate
  1225. }else{
  1226. this.editItemForm.startDate = this.editItemForm.endDate
  1227. }
  1228. }
  1229. }else{
  1230. this.editItemForm.dayCount = null
  1231. }
  1232. },
  1233. datechg3(e){
  1234. if(this.relationItem.endDate != null && this.relationItem.startDate != null){
  1235. let days = this.autoCountDay(this.relationItem.startDate,this.relationItem.endDate)
  1236. if(days <= 0){
  1237. if(e){
  1238. this.relationItem.endDate = this.relationItem.startDate
  1239. }else{
  1240. this.relationItem.startDate = this.relationItem.endDate
  1241. }
  1242. }
  1243. }
  1244. },
  1245. // 自动计算天数
  1246. autoCountDay(st,ed){
  1247. let differDay = new Date(ed).getTime() - new Date(st).getTime()
  1248. let differDay2 = differDay/(24*3600*1000) + 1
  1249. return differDay2
  1250. },
  1251. // 获取出差列表
  1252. getTableList(){
  1253. this.billss()
  1254. },
  1255. // 筛选刷新
  1256. billss(e) {
  1257. if(e){
  1258. this.page = 1
  1259. }
  1260. var param = {
  1261. pageIndex: this.page,
  1262. pageSize: this.size,
  1263. status: this.code,
  1264. startDate: this.createDate == null ? '' : this.createDate[0],
  1265. endDate: this.createDate == null ? '' : this.createDate[1],
  1266. ownerId: this.ownerIds,
  1267. way: this.type,
  1268. };
  1269. if(this.isOverTendays){
  1270. param.checkState = 1
  1271. }
  1272. this.tableListLoading = true
  1273. this.http.post('/business-trip/list', param,
  1274. res => {
  1275. if (res.code == "ok") {
  1276. this.tableList = res.data.records
  1277. this.total = res.data.total
  1278. this.tableListLoading = false
  1279. console.log('tablelist',this.tableList);
  1280. this.$forceUpdate()
  1281. } else {
  1282. this.tableListLoading = false
  1283. this.$message({
  1284. message: res.msg,
  1285. type: "error"
  1286. });
  1287. }
  1288. },
  1289. error => {
  1290. this.tableListLoading = false
  1291. this.$message({
  1292. message: error,
  1293. type: "error"
  1294. });
  1295. });
  1296. },
  1297. approve(item) {
  1298. //审核通过
  1299. this.http.post('/business-trip/approve', {id:item.id
  1300. },
  1301. res => {
  1302. if (res.code == "ok") {
  1303. this.billss(true);
  1304. } else {
  1305. this.$message({
  1306. message: res.msg,
  1307. type: "error"
  1308. });
  1309. }
  1310. },
  1311. error => {
  1312. this.$message({
  1313. message: error,
  1314. type: "error"
  1315. });
  1316. });
  1317. },
  1318. deny(item) {
  1319. //审核驳回
  1320. this.http.post('/business-trip/deny', {id:item.id
  1321. },
  1322. res => {
  1323. if (res.code == "ok") {
  1324. this.billss(true);
  1325. } else {
  1326. this.$message({
  1327. message: res.msg,
  1328. type: "error"
  1329. });
  1330. }
  1331. },
  1332. error => {
  1333. this.$message({
  1334. message: error,
  1335. type: "error"
  1336. });
  1337. });
  1338. },
  1339. // 操作 - 删除
  1340. deletes(e) {
  1341. this.$confirm(this.$t('deleteit'), this.$t('other.prompts'), {}).then(() => {
  1342. this.http.post('/business-trip/delete', {id:e.id},
  1343. res => {
  1344. if (res.code == "ok") {
  1345. this.getTableList();
  1346. this.$message({
  1347. message: this.$t('message.successfullyDeleted'),
  1348. type: "success"
  1349. });
  1350. } else {
  1351. this.$message({
  1352. message: res.msg,
  1353. type: "error"
  1354. });
  1355. }
  1356. },
  1357. error => {
  1358. this.$message({
  1359. message: error,
  1360. type: "error"
  1361. });
  1362. });
  1363. });
  1364. },
  1365. // 操作 - 编辑
  1366. editor(e) {
  1367. // console.log("编辑",e);
  1368. this.editDialog = true
  1369. if(e.degreeId != null){
  1370. e.degreeId = e.degreeId + ''
  1371. // console.log("e.degreeId",e.degreeId);
  1372. }
  1373. this.editItemForm = e
  1374. this.getwuduList(0)
  1375. },
  1376. // 编辑框确定
  1377. determine(){
  1378. let edddd = {
  1379. id: this.editItemForm.id,
  1380. reason: this.editItemForm.reason, //出差事由
  1381. startDate: this.editItemForm.startDate, //开始时间
  1382. endDate: this.editItemForm.endDate, //结束时间
  1383. way: this.editItemForm.way, //交通工具
  1384. cityFrom: this.editItemForm.cityFrom, //出发城市
  1385. cityTo: this.editItemForm.cityTo, //目的城市
  1386. goBack: this.editItemForm.goBack, //单程往返
  1387. dayCount: this.editItemForm.dayCount, //出差天数
  1388. remark: this.editItemForm.remark, //备注
  1389. projectId: this.editItemForm.projectId, //项目id
  1390. degreeId:this.editItemForm.degreeId, //维度id
  1391. degreeName: null
  1392. }
  1393. for(let i=0; i<this.wuduList.length; i++){
  1394. if(this.wuduList[i].id == edddd.degreeId){
  1395. edddd.degreeName = this.wuduList[i].name
  1396. }
  1397. }
  1398. this.http.post( '/business-trip/add', edddd,
  1399. res => {
  1400. if (res.code == "ok") {
  1401. this.editItemForm = null
  1402. this.editDialog = false
  1403. this.billss()
  1404. this.$message({
  1405. message: this.$t('message.modifyTheSuccess'),
  1406. type: 'success'
  1407. })
  1408. } else {
  1409. this.$message({
  1410. message: res.msg,
  1411. type: "error"
  1412. });
  1413. }
  1414. },
  1415. error => {
  1416. this.$message({
  1417. message: error,
  1418. type: "error"
  1419. });
  1420. });
  1421. },
  1422. // 出差统计
  1423. statistical() {
  1424. // console.log("date",this.searchDates);
  1425. this.summaryLoading = true
  1426. this.http.post('/business-trip/summaryData', {
  1427. keyword: this.searchWord,
  1428. startDate: this.searchDates[0],
  1429. endDate: this.searchDates[1]
  1430. },
  1431. res => {
  1432. if (res.code == "ok") {
  1433. // console.log("出差统计",res.data);
  1434. this.statisticalList = res.data
  1435. this.summaryLoading = false
  1436. } else {
  1437. this.summaryLoading = false
  1438. this.$message({
  1439. message: res.msg,
  1440. type: "error"
  1441. });
  1442. }
  1443. },
  1444. error => {
  1445. this.$message({
  1446. message: error,
  1447. type: "error"
  1448. });
  1449. });
  1450. },
  1451. // 获取本月一号至今
  1452. getautoDate() {
  1453. let newdate = new Date()
  1454. let newyear = newdate.getFullYear()
  1455. let newmonth = newdate.getMonth() + 1
  1456. let newday = newdate.getDate()
  1457. let firstdate = newyear + '-' + (newmonth < 10 ? '0' + newmonth : newmonth) + '-01'
  1458. let seconddate = newyear + '-' + (newmonth < 10 ? '0' + newmonth : newmonth) + '-' + (newday < 10 ? '0' + newday : newday)
  1459. return [firstdate,seconddate]
  1460. },
  1461. // 出差统计列表查看详情
  1462. viewDetails(s,e){
  1463. // console.log("e",e);
  1464. if(s){
  1465. this.detailsuserid = e.ownerId
  1466. }
  1467. var param = {
  1468. pageIndex: this.detailspage,
  1469. pageSize: this.detailssize,
  1470. status: 0,
  1471. startDate: '',
  1472. endDate: '',
  1473. ownerId: this.detailsuserid,
  1474. way: '',
  1475. };
  1476. this.detailsloading = true
  1477. this.http.post('/business-trip/list', param,
  1478. res => {
  1479. if (res.code == "ok") {
  1480. // this.tableList = res.data.records
  1481. this.detailstotal = res.data.total
  1482. // this.loading = false
  1483. // this.$forceUpdate()
  1484. this.detailsData = res.data.records
  1485. this.seeDialog = true
  1486. // console.log('see',res.data);
  1487. this.$forceUpdate()
  1488. this.detailsloading = false
  1489. } else {
  1490. this.detailsloading = false
  1491. this.$message({
  1492. message: res.msg,
  1493. type: "error"
  1494. });
  1495. }
  1496. },
  1497. error => {
  1498. this.detailsloading = false
  1499. this.$message({
  1500. message: error,
  1501. type: "error"
  1502. });
  1503. });
  1504. },
  1505. detailsSizeChange(val){
  1506. this.detailssize = val;
  1507. this.viewDetails(0)
  1508. },
  1509. detailsCurrentChange(val) {
  1510. // console.log(val, 1, '1')
  1511. this.detailspage = val;
  1512. this.viewDetails(0)
  1513. },
  1514. // 出差审批流
  1515. // 获取部门列表
  1516. getDepartment() {
  1517. this.http.post( this.port.manage.depList, {},
  1518. res => {
  1519. if (res.code == "ok") {
  1520. var list = res.data , list1 = JSON.parse(JSON.stringify(res.data));
  1521. this.sdata = list;
  1522. this.soption = [
  1523. {value: 1 , label : this.$t('lable.department') , children : this.changeArr(list1)},
  1524. {value: 2 , label : this.$t('designatedpersonnel'),children : this.susers}
  1525. ]
  1526. } else {
  1527. this.$message({
  1528. message: res.msg,
  1529. type: "error"
  1530. });
  1531. }
  1532. },
  1533. error => {
  1534. this.$message({
  1535. message: error,
  1536. type: "error"
  1537. });
  1538. });
  1539. },
  1540. changeArr(arr) {
  1541. for (var i = 0; i < arr.length; i++) {
  1542. if(arr[i].id != -1 && arr[i].id != 0) {
  1543. if (arr[i].children != null && arr[i].children.length>0) {
  1544. arr[i].children = this.changeArr(arr[i].children);
  1545. }
  1546. arr[i].id && (arr[i].value = arr[i].id);
  1547. delete arr[i].id;
  1548. }
  1549. }
  1550. for(var i in arr) {
  1551. if(arr[i].id == -1 || arr[i].id == 0) {
  1552. arr.splice(i,1)
  1553. }
  1554. }
  1555. return arr;
  1556. },
  1557. handleNodeClick(data) {
  1558. if(this.depData == null || data.id != this.depData.id) {
  1559. this.depData = data;
  1560. // console.log("depdata",this.depData);
  1561. this.getSettings();
  1562. }
  1563. },
  1564. getSettings() {
  1565. this.http.post('/audit-workflow-setting/get',{deptId: this.depData.id,type: 2},
  1566. res => {
  1567. this.listLoading = false;
  1568. if (res.code == "ok") {
  1569. this.dataArray = res.data;
  1570. // console.log("请求1",res.data);
  1571. } else {
  1572. this.$message({
  1573. message: res.msg,
  1574. type: "error"
  1575. });
  1576. }
  1577. },
  1578. error => {
  1579. this.listLoading = false;
  1580. this.$message({
  1581. message: error,
  1582. type: "error"
  1583. });
  1584. });
  1585. },
  1586. editNodeDialog(index, item) {
  1587. //检查是否可编辑
  1588. this.http.post('/audit-workflow-setting/checkNodeInUse',{auditDeptId: item.auditDeptId, deptId: this.depData.id,type: 2},
  1589. res => {
  1590. this.listLoading = false;
  1591. if (res.code == "ok") {
  1592. this.isAdd = false;
  1593. this.sindex = index;
  1594. this.curUserId = item.userId;
  1595. this.dialogVisible = true;
  1596. this.curDeptId = item.auditDeptId;
  1597. } else {
  1598. this.$message({
  1599. message: res.msg,
  1600. type: "error"
  1601. });
  1602. }
  1603. },
  1604. error => {
  1605. this.listLoading = false;
  1606. this.$message({
  1607. message: error,
  1608. type: "error"
  1609. });
  1610. });
  1611. },
  1612. showNodeDialog(index) {
  1613. this.isAdd = true;
  1614. this.sindex = index;
  1615. this.curDeptId = null;
  1616. this.curUserId = null;
  1617. this.dialogVisible = true;
  1618. },
  1619. submitInsert() {
  1620. this.http.post('/audit-workflow-setting/add',{json:JSON.stringify(this.dataArray), deptId: this.depData.id,type: 2},
  1621. res => {
  1622. this.listLoading = false;
  1623. if (res.code == "ok") {
  1624. this.$message({
  1625. message: this.$t('savesuccess'),
  1626. type: "success"
  1627. });
  1628. } else {
  1629. this.$message({
  1630. message: res.msg,
  1631. type: "error"
  1632. });
  1633. }
  1634. },
  1635. error => {
  1636. this.listLoading = false;
  1637. this.$message({
  1638. message: error,
  1639. type: "error"
  1640. });
  1641. });
  1642. },
  1643. deleteNode() {
  1644. this.dialogVisible = false;
  1645. this.dataArray.splice(this.sindex, 1);
  1646. },
  1647. addNode() {
  1648. this.dialogVisible = false;
  1649. if (this.curDeptId == null) return;
  1650. var node = this.user.userNameNeedTranslate != '1' ? this.vueCasaderItem : this.$refs.deptCascader.getCheckedNodes()[0];
  1651. // var node = this.$refs.deptCascader.getCheckedNodes()[0];
  1652. if (this.isAdd) {
  1653. // if(node.path[0] == 1){
  1654. // var node = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1655. // }else if(node.path[0] == 2){
  1656. // var node = {userId: node.value, userName: node.label, auditorType: 2};
  1657. // }
  1658. var nodes
  1659. if(this.user.userNameNeedTranslate != 1) {
  1660. if(node.path[0] == 1){
  1661. nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1662. }else if(node.path[0] == 2){
  1663. nodes = {userId: node.value, userName: node.label, auditorType: 2};
  1664. }
  1665. } else {
  1666. if(node.managerId) {
  1667. nodes = {auditDeptId: node.value, auditDeptName: node.label, auditorType: 1};
  1668. } else {
  1669. nodes = {userId: node.value, userName: node.label, auditorType: 2};
  1670. }
  1671. }
  1672. this.dataArray.splice(this.sindex, 0, nodes);
  1673. } else {
  1674. //编辑
  1675. this.dataArray[this.sindex].auditDeptId = node.value;
  1676. this.dataArray[this.sindex].auditDeptName = node.label;
  1677. }
  1678. },
  1679. getUsers() {
  1680. // this.http.post(this.port.manage.list, {
  1681. // departmentId: -1,
  1682. // pageIndex: 1,
  1683. // // pageSize: 99999
  1684. // pageSize: -1
  1685. // },
  1686. this.http.post('/user/getSimpleActiveUserList', {},
  1687. res => {
  1688. if (res.code == "ok") {
  1689. // console.log("users",res.data);
  1690. // this.users = res.data.records;
  1691. this.users = res.data;
  1692. for (let i = 0; i < this.users.length; i++) {
  1693. this.susers.push({value:this.users[i].id,label:this.users[i].name})
  1694. }
  1695. // if (this.user.role == 0) {
  1696. // this.editItemForm.ownerId = this.user.id;
  1697. // this.ownerIds = this.user.id
  1698. // this.editItemForm.status = 1;
  1699. // this.editItemForm.tel = this.user.phone
  1700. // }
  1701. } else {
  1702. this.$message({
  1703. message: res.msg,
  1704. type: "error"
  1705. });
  1706. }
  1707. },
  1708. error => {
  1709. this.$message({
  1710. message: error,
  1711. type: "error"
  1712. });
  1713. });
  1714. },
  1715. // 维度选择添加
  1716. getProjectList() {
  1717. this.http.post( this.port.project.list, {},
  1718. res => {
  1719. if (res.code == "ok") {
  1720. this.projectList = res.data;
  1721. console.log("项目列表",this.projectList);
  1722. } else {
  1723. this.$message({
  1724. message: res.msg,
  1725. type: "error"
  1726. });
  1727. }
  1728. },
  1729. error => {
  1730. this.$message({
  1731. message: error,
  1732. type: "error"
  1733. });
  1734. });
  1735. },
  1736. // 获取维度数据
  1737. getwuduList(e,i) {
  1738. if(e == 1){
  1739. this.addform.wuduId = null
  1740. if(this.addform.projectId == '' || this.addform.projectId == null) {
  1741. return
  1742. }
  1743. var pId = this.addform.projectId
  1744. }else if(e == 0){
  1745. this.editItemForm.wuduId = null
  1746. if(this.editItemForm.projectId == '' || this.editItemForm.projectId == null) {
  1747. return
  1748. }
  1749. var pId = this.editItemForm.projectId
  1750. }else{
  1751. if(i != 1){this.relationItem.degreeId = null}
  1752. if(this.relationItem.projectId == '' || this.relationItem.projectId == null){
  1753. return
  1754. }
  1755. var pId = this.relationItem.projectId
  1756. // if(i == 1){
  1757. // this.DingdingForm.degreeId = null
  1758. // }
  1759. // if(this.DingdingForm.projectId == '' || this.DingdingForm.projectId == null){
  1760. // return
  1761. // }
  1762. // var pId = this.DingdingForm.projectId
  1763. }
  1764. this.http.post('/project/getDegreeList',{
  1765. projectId: pId,
  1766. },
  1767. res => {
  1768. if (res.code == "ok") {
  1769. this.wuduList = res.data
  1770. }
  1771. },
  1772. error => {
  1773. this.$message({
  1774. message: error,
  1775. type: "error"
  1776. });
  1777. }
  1778. );
  1779. },
  1780. //获取项目列表
  1781. // getProjectList() {
  1782. // this.listLoading = true;
  1783. // this.http.post( this.port.project.list, {},
  1784. // res => {
  1785. // this.listLoading = false;
  1786. // if (res.code == "ok") {
  1787. // this.projectList = res.data;
  1788. // console.log("项目列表",this.projectList);
  1789. // } else {
  1790. // this.$message({
  1791. // message: res.msg,
  1792. // type: "error"
  1793. // });
  1794. // }
  1795. // },
  1796. // error => {
  1797. // this.listLoading = false;
  1798. // this.$message({
  1799. // message: error,
  1800. // type: "error"
  1801. // });
  1802. // });
  1803. // },
  1804. }
  1805. }
  1806. </script>
  1807. <style lang="scss" scoped>
  1808. .sidebars {
  1809. height: 100%;
  1810. position: absolute;
  1811. border-right: 1px solid #E6E6E6;
  1812. z-index: 2;
  1813. top: 0;
  1814. h3 {
  1815. margin: 0;
  1816. line-height: 45px;
  1817. background: #ffffff;
  1818. font-weight: normal;
  1819. color: #666;
  1820. padding-left: 20px;
  1821. }
  1822. .el-col-12 {
  1823. width: 100%
  1824. }
  1825. }
  1826. .contents {
  1827. height: 100%;
  1828. background: #F7F7F7;
  1829. .tops {
  1830. width: 100%;
  1831. height:100%;
  1832. position: absolute;
  1833. background: #f7f7f7;
  1834. box-sizing: border-box;
  1835. padding: 20px 0 0 220px;
  1836. }
  1837. .ctons {
  1838. width: 86%;
  1839. height: 92%;
  1840. overflow: hidden;
  1841. background: #fff;
  1842. padding: 30px 40px;
  1843. box-sizing: border-box;
  1844. .el-form-item {
  1845. display: inline-block;
  1846. }
  1847. .flex {
  1848. display: flex;
  1849. padding: 0 0 20px 0;
  1850. border-bottom: 1px solid #f2f2f2;
  1851. span {
  1852. display: inline-block;
  1853. margin: 0 10px 0 20px;
  1854. }
  1855. }
  1856. .poss {
  1857. position: fixed;
  1858. bottom: 20px;
  1859. right: 1%;
  1860. box-sizing: border-box;
  1861. }
  1862. }
  1863. .headine {
  1864. width: 100%;
  1865. height: 46.4px;
  1866. line-height: 46.4px;
  1867. background: #fff;
  1868. box-sizing: border-box;
  1869. h3 {
  1870. margin: 0;
  1871. display: inline-block;
  1872. box-sizing: border-box;
  1873. color: #999;
  1874. }
  1875. p {
  1876. display: inline-block;
  1877. margin: 0;
  1878. }
  1879. }
  1880. }
  1881. .addNode {
  1882. cursor:pointer;
  1883. }
  1884. .addNode:hover {
  1885. color:#20a0ff;
  1886. }
  1887. .detailsScope{
  1888. font-size: 12px;
  1889. padding: 3px 0;
  1890. line-height: 15px;
  1891. }
  1892. .detailsScope span:nth-child(1){
  1893. display: inline-block;
  1894. width: 25%;
  1895. }
  1896. .detailsScope span:nth-child(2){
  1897. display: inline-block;
  1898. width: 40%;
  1899. text-align: left;
  1900. }
  1901. .detailsScope span:nth-child(3){
  1902. display: inline-block;
  1903. width: 35%;
  1904. text-align: left;
  1905. }
  1906. .dingdingtongbu span {
  1907. display: inline-block;
  1908. width: 80px;
  1909. padding-left: 20px;
  1910. }
  1911. </style>