VisitSchedule.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <template>
  2. <div class="VisitSchedule-all" v-loading.fullscreen.lock="fullscreenLoading">
  3. <div class="VisitSchedule-search-head">
  4. <el-form ref="form" label-width="75px">
  5. <el-form-item style="width: 340px;" label="团组名称:">
  6. <el-select @change="ApprovalJourneyInit" filterable v-model="diid" placeholder="请选择团组名称">
  7. <el-option v-for="(item, index) in groupList" :key="index" :label="item.teamName"
  8. :value="item.id"></el-option>
  9. </el-select>
  10. </el-form-item>
  11. </el-form>
  12. <div style="display: flex;gap: 5px;">
  13. <div style="flex: 1">
  14. <el-select filterable v-model="blackCodeId" placeholder="请选择黑屏代码">
  15. <el-option v-for="(item, index) in blackCodeList" :key="index" :label="item.title"
  16. :value="item.id"></el-option>
  17. </el-select>
  18. </div>
  19. <div>
  20. <el-button style="margin-left: 0px;" @click="CreateApprovalJourney"
  21. type="primary">导入机票信息</el-button>
  22. <el-button style="margin-left: 0px;" @click="SaveApprovalJourney" type="primary">保存</el-button>
  23. <el-button style="margin-left: 0px;" @click="DeleteApprovalJourney" type="primary">删除</el-button>
  24. <el-select style="width: auto;" filterable v-model="fileIndex" placeholder="请选择文件类型">
  25. <el-option v-for="(item, index) in fileTempList" :key="index" :label="item.fileName"
  26. :value="item.index"></el-option>
  27. </el-select>
  28. <el-button @click="ExportApprovalJourneyWord" type="primary">导出word</el-button>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="VisitSchedule-content">
  33. <div class="VisitSchedule-content-title">出访行程</div>
  34. <div class="VisitSchedule-content-info">
  35. 团组名:{{ groupInfo.teamName }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;团组号:{{ groupInfo.tourCode
  36. }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;出访日期:{{ groupInfo.visitStartDate + '~' + groupInfo.visitEndDate
  37. }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ groupInfo.visitDays + '天/' + groupInfo.visitPNumber + '人' }}
  38. </div>
  39. <div class="VisitSchedule-content-table">
  40. <div v-for="(item, index) in tablearr" :key="index" class="VisitSchedule-content-ul">
  41. <div class="content-ul-title">{{ item.date }}</div>
  42. <div v-for="(items, index) in item.chiList" :key="index" class="VisitSchedule-content-li">
  43. <div class="VisitSchedule-content-time">
  44. <el-time-picker is-range format='HH:mm' value-format='HH:mm' v-model="items.timeInterval"
  45. :default-value="value1" range-separator="至" start-placeholder="开始时间"
  46. end-placeholder="结束时间" placeholder="选择时间范围">
  47. </el-time-picker>
  48. </div>
  49. <div class="VisitSchedule-content-remark">
  50. <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="items.details">
  51. </el-input>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. diid: '',
  64. groupList: [],
  65. tablearr: [],
  66. userId: '',
  67. value1: ['', ''],
  68. textarea: '',
  69. ss: [0, 0],
  70. groupInfo: {},
  71. fullscreenLoading: false,
  72. blackCodeId: '',
  73. blackCodeList: [],
  74. fileTempList: [],
  75. fileIndex: 1,
  76. }
  77. },
  78. methods: {
  79. //报批行程初始化
  80. ApprovalJourneyInit() {
  81. this.groupInfo = {};
  82. this.tablearr = [];
  83. this.fullscreenLoading = true;
  84. this.blackCodeId = '';
  85. this.blackCodeList = [];
  86. var url = "/api/Groups/ApprovalJourneyInit"
  87. var that = this
  88. this.$axios({
  89. method: 'post',
  90. url: url,
  91. headers: {
  92. Authorization: 'Bearer '
  93. },
  94. data: {
  95. diid: that.diid == '' ? -1 : that.diid,
  96. userId: that.userId,
  97. }
  98. }).then(function (res) {
  99. if (res.data.code == 200) {
  100. that.groupList = res.data.data.groupList;
  101. if (that.diid == '') {
  102. that.diid = that.groupList[0].id;
  103. }
  104. that.tablearr = res.data.data.content;
  105. for (let i = 0; i < that.tablearr.length; i++) {
  106. for (let a = 0; a < that.tablearr[i].chiList.length; a++) {
  107. if (that.tablearr[i].chiList[a].timeInterval.length == 1) {
  108. that.tablearr[i].chiList[a].timeInterval = that.value1;
  109. }
  110. }
  111. }
  112. that.groupInfo = res.data.data.groupInfo;
  113. that.fullscreenLoading = false;
  114. that.blackCodeList = res.data.data.blackCodeList;
  115. that.fileTempList = res.data.data.fileTempList;
  116. } else {
  117. that.$message({
  118. message: res.data.msg,
  119. duration: 1000,
  120. type: "error"
  121. });
  122. that.fullscreenLoading = false;
  123. }
  124. }).catch(function (error) {
  125. that.$message.error('请联系信息部!');
  126. });
  127. },
  128. //报批行程保存
  129. SaveApprovalJourney() {
  130. var url = "/api/Groups/SaveApprovalJourney"
  131. var that = this
  132. this.$axios({
  133. method: 'post',
  134. url: url,
  135. headers: {
  136. Authorization: 'Bearer '
  137. },
  138. data: {
  139. userId: that.userId,
  140. arr: that.tablearr
  141. }
  142. }).then(function (res) {
  143. if (res.data.code == 200) {
  144. that.$message({
  145. message: res.data.msg,
  146. type: 'success'
  147. });
  148. that.ApprovalJourneyInit();
  149. } else {
  150. that.$message({
  151. message: res.data.msg,
  152. duration: 1000,
  153. type: "error"
  154. });
  155. }
  156. }).catch(function (error) {
  157. that.$message.error('请联系信息部!');
  158. });
  159. },
  160. //报批行程删除
  161. DeleteApprovalJourney() {
  162. var url = "/api/Groups/DeleteApprovalJourney"
  163. var that = this
  164. this.$axios({
  165. method: 'post',
  166. url: url,
  167. headers: {
  168. Authorization: 'Bearer '
  169. },
  170. data: {
  171. diid: that.diid,
  172. userId: that.userId,
  173. }
  174. }).then(function (res) {
  175. if (res.data.code == 200) {
  176. that.$message({
  177. message: res.data.msg,
  178. type: 'success'
  179. });
  180. that.ApprovalJourneyInit();
  181. } else {
  182. that.$message({
  183. message: res.data.msg,
  184. duration: 1000,
  185. type: "error"
  186. });
  187. }
  188. }).catch(function (error) {
  189. that.$message.error('请联系信息部!');
  190. });
  191. },
  192. //报批行程导入机票信息
  193. CreateApprovalJourney() {
  194. if (!this.blackCodeId) {
  195. this.$message({
  196. message: '请选择黑屏代码',
  197. duration: 1000,
  198. type: "error"
  199. });
  200. return;
  201. }
  202. var url = "/api/Groups/CreateApprovalJourney"
  203. var that = this
  204. this.$axios({
  205. method: 'post',
  206. url: url,
  207. headers: {
  208. Authorization: 'Bearer '
  209. },
  210. data: {
  211. diid: that.diid,
  212. userid: that.userId,
  213. BlackCodeId: that.blackCodeId
  214. }
  215. }).then(function (res) {
  216. if (res.data.code == 200) {
  217. that.$message({
  218. message: res.data.msg,
  219. type: 'success'
  220. });
  221. that.tablearr = res.data.data;
  222. for (let i = 0; i < that.tablearr.length; i++) {
  223. for (let a = 0; a < that.tablearr[i].chiList.length; a++) {
  224. if (that.tablearr[i].chiList[a].timeInterval.length == 1) {
  225. that.tablearr[i].chiList[a].timeInterval = that.value1;
  226. }
  227. }
  228. }
  229. } else {
  230. that.$message({
  231. message: res.data.msg,
  232. duration: 1000,
  233. type: "error"
  234. });
  235. }
  236. }).catch(function (error) {
  237. that.$message.error('请联系信息部!');
  238. });
  239. },
  240. //报批行程导出
  241. ExportApprovalJourneyWord() {
  242. if (!this.fileIndex) {
  243. this.$message({
  244. message: '请选择文件类型',
  245. duration: 1000,
  246. type: "error"
  247. });
  248. return;
  249. }
  250. var url = "/api/Groups/ExportApprovalJourneyWord"
  251. var that = this
  252. this.$axios({
  253. method: 'post',
  254. url: url,
  255. headers: {
  256. Authorization: 'Bearer '
  257. },
  258. data: {
  259. diid: that.diid,
  260. fileIndex: this.fileIndex
  261. }
  262. }).then(function (res) {
  263. if (res.data.code == 200) {
  264. that.$message({
  265. message: "导出成功!",
  266. type: 'success'
  267. });
  268. window.open(res.data.data)
  269. } else {
  270. that.$message({
  271. message: res.data.msg,
  272. duration: 1000,
  273. type: "error"
  274. });
  275. }
  276. }).catch(function (error) {
  277. that.$message.error('请联系信息部!');
  278. });
  279. },
  280. },
  281. mounted() {
  282. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
  283. this.ApprovalJourneyInit();
  284. }
  285. }
  286. </script>
  287. <style>
  288. .VisitSchedule-all {
  289. background-color: #fff;
  290. padding: 10px;
  291. box-shadow: 0 0 5px #0005;
  292. border-radius: 10px;
  293. min-height: 830px;
  294. }
  295. .VisitSchedule-search-head {
  296. display: flex;
  297. justify-content: space-between;
  298. }
  299. .VisitSchedule-search-head .el-select {
  300. width: 100%;
  301. }
  302. .VisitSchedule-content-table {
  303. padding: 10px 0;
  304. border: 1px solid #DCDFE6;
  305. }
  306. .VisitSchedule-content-li {
  307. border-top: 1px solid #DCDFE6;
  308. display: flex;
  309. align-items: center;
  310. }
  311. .VisitSchedule-content-time {
  312. padding: 10px;
  313. width: 25%;
  314. }
  315. .VisitSchedule-content-remark {
  316. width: 75%;
  317. padding: 10px;
  318. }
  319. .VisitSchedule-content-time .el-range-editor.el-input__inner {
  320. width: 100%;
  321. }
  322. .content-ul-title {
  323. padding: 10px;
  324. }
  325. .VisitSchedule-content-ul .VisitSchedule-content-li:last-child {
  326. border-bottom: 1px solid #DCDFE6;
  327. }
  328. .VisitSchedule-content-title {
  329. text-align: center;
  330. margin-bottom: 10px;
  331. color: #555;
  332. font-size: 17px;
  333. font-weight: 600;
  334. }
  335. .VisitSchedule-content-info {
  336. text-align: center;
  337. color: #555;
  338. font-size: 15px;
  339. margin-bottom: 20px;
  340. }
  341. </style>