awayOffice.vue 85 KB

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