AirTicketRes.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <template>
  2. <div>
  3. <div class="communal-list">
  4. <div>
  5. <div class="communal-title">
  6. <div>机票费用录入</div>
  7. </div>
  8. <div style="display: flex;justify-content: space-between;">
  9. <div style="width: 60%;">
  10. <el-select v-model="DiId" placeholder="团组选择" clearable filterable
  11. @change="AirTicketResSelectChange">
  12. <el-option v-for="item in AirTicketResSelectData" :key="item.id" :label="item.groupName"
  13. :value="item.id">
  14. </el-option>
  15. </el-select>
  16. </div>
  17. <div>
  18. <el-button type="primary" @click="download" style="margin-left: 10px;">导出报表</el-button>
  19. <el-button type="primary" @click="downloadCN" style="margin-left: 10px;">中文行程单</el-button>
  20. <el-button type="primary" @click="downloadEN" style="margin-left: 10px;">英文行程单</el-button>
  21. <el-button type="primary" style="margin-left: 10px;" @click="addIf">新增</el-button>
  22. </div>
  23. </div>
  24. <div style="margin:10px 0;color:#606266;">
  25. <span style="font-weight: bold;font-size:15px;">团队名称:</span>
  26. <span style="color:#606266;">{{ delegationInfo.teamName }}&nbsp;&nbsp;&nbsp;</span>
  27. <span style="font-weight: bold;font-size:15px;">客户:</span>
  28. <span style="color:#606266;">{{ delegationInfo.clientName }}&nbsp;&nbsp;&nbsp;</span>
  29. <span style="font-weight: bold;font-size:15px;">出访国家:</span>
  30. <span style="color:#606266;">{{ delegationInfo.visitCountry }}&nbsp;&nbsp;&nbsp;</span>
  31. <span style="font-weight: bold;font-size:15px;">起止日期:</span>
  32. <span style="color:#606266;">{{ delegationInfo.visitStartDate }}—{{ delegationInfo.visitEndDate
  33. }}&nbsp;&nbsp;&nbsp;</span>
  34. <span style="font-weight: bold;font-size:15px;">天数/人数:</span>
  35. <span style="color:#606266;">{{ delegationInfo.visitDays }}天/{{ delegationInfo.visitPNumber }}人</span>
  36. </div>
  37. </div>
  38. <template>
  39. <el-table :data="tableDatas.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border
  40. style="width: 100%" v-loading="loading" element-loading-text="拼命加载中...">
  41. <el-table-column prop="num" label="序 号" width="55">
  42. <template slot-scope="scope">
  43. {{ (currentPage - 1) * pageSize + scope.$index + 1 }}
  44. </template>
  45. </el-table-column>
  46. <el-table-column prop="cTypeName" label="舱位类型" width="100">
  47. </el-table-column>
  48. <el-table-column prop="flightDescription" label="航班简述" width="600">
  49. </el-table-column>
  50. <el-table-column prop="clientNameStr" label="客人名单" width="280">
  51. </el-table-column>
  52. <el-table-column prop="clientNum" label="客人人数">
  53. </el-table-column>
  54. <el-table-column prop="prePrice,preCurrencyStr" label="机票单价" width="120" sortable>
  55. <template slot-scope="scope">
  56. {{ scope.row.prePrice }}({{ scope.row.preCurrencyStr }})
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="price,currencyStr" label="机票总价" width="120">
  60. <template slot-scope="scope">
  61. {{ scope.row.price }}({{ scope.row.currencyStr }})
  62. </template>
  63. </el-table-column>
  64. <el-table-column prop="isAuditGM" label="是否审核" width="120">
  65. <template slot-scope="isAuditGM">
  66. <span v-if="isAuditGM.row.isAuditGM == 1">已通过</span>
  67. <span v-else-if="isAuditGM.row.isAuditGM == 0">未审核</span>
  68. <span v-else-if="isAuditGM.row.isAuditGM == 2">未通过</span>
  69. <span v-else>自动审核通过</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="操作" :width="'80px'">
  73. <template slot-scope="scope">
  74. <el-button size="mini" @click="upDate(scope.$index, scope.row)">编辑</el-button>
  75. <div style="height: 8px;"></div>
  76. <el-button size="mini" type="danger" @click="del(scope.$index, scope.row)">删除</el-button>
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. </template>
  81. <div v-if="fynone" class="block">
  82. <el-pagination align='center' @size-change="handleSizeChange" @current-change="handleCurrentChange"
  83. :current-page="currentPage" :page-sizes="[10, 12, 15, 20]" :page-size="pageSize"
  84. layout="total, sizes, prev, pager, next" :total="tableDatas.length">
  85. </el-pagination>
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. import { el } from '@fullcalendar/core/internal-common';
  92. export default {
  93. data() {
  94. return {
  95. loading: false,
  96. tableDatas: [],
  97. tableData: [],
  98. currentPage: 1, // 当前页码
  99. pageSize: 12,// 每页的数据条数
  100. input: '',
  101. token: '',
  102. userId: 0,
  103. DiId: '',
  104. AirTicketResSelectData: [],
  105. delegationInfo: {},
  106. fynone:true
  107. }
  108. },
  109. methods: {
  110. //每页条数改变时触发 选择一页显示多少行
  111. handleSizeChange(val) {
  112. this.currentPage = 1;
  113. this.pageSize = val;
  114. },
  115. //当前页改变时触发 跳转其他页
  116. handleCurrentChange(val) {
  117. this.currentPage = val;
  118. },
  119. //团组下拉框
  120. AirTicketResSelect() {
  121. var url = "/api/Groups/AirTicketResSelect"
  122. var that = this
  123. this.$axios({
  124. method: 'post',
  125. url: url,
  126. headers: {
  127. Authorization: 'Bearer ' + this.token
  128. },
  129. data: {
  130. userId: that.userId
  131. }
  132. }).then(function (res) {
  133. console.log(res)
  134. if (res.data.code == 200) {
  135. that.AirTicketResSelectData = res.data.data.groupName;
  136. if (that.AirTicketResSelectData.length != 0) {
  137. var diid = that.$route.query.DiId;
  138. if (diid) {
  139. that.DiId = parseInt(diid);
  140. } else {
  141. that.DiId = that.AirTicketResSelectData[0].id;
  142. }
  143. that.AirTicketResList()
  144. }
  145. }
  146. }).catch(function (error) {
  147. that.$message.error("网络错误,请稍后重试");
  148. });
  149. },
  150. AirTicketResSelectChange() {
  151. this.AirTicketResList();
  152. },
  153. //团组信息绑定
  154. AirTicketResList() {
  155. var url = "/api/Groups/AirTicketResList"
  156. var that = this
  157. this.$axios({
  158. method: 'post',
  159. url: url,
  160. headers: {
  161. Authorization: 'Bearer ' + this.token
  162. },
  163. data: {
  164. portType: 1,
  165. diId: that.DiId,
  166. userId: that.userId,
  167. }
  168. }).then(function (res) {
  169. console.log(res)
  170. if (res.data.code == 200) {
  171. that.tableDatas = res.data.data.airTicketReservations;
  172. that.tableData = that.tableDatas
  173. if(that.tableData<=0){
  174. that.fynone=false;
  175. }else{
  176. that.fynone=true;
  177. }
  178. if (that.tableDatas.length != 0) {
  179. if (that.tableDatas.slice((that.currentPage - 1) * that.pageSize, that.currentPage * that.pageSize).length == 0) {
  180. if (that.currentPage > 1) {
  181. that.currentPage = that.currentPage - 1;
  182. }
  183. }
  184. }
  185. that.delegationInfo = res.data.data.delegationInfo
  186. }else{
  187. that.fynone=false;
  188. }
  189. }).catch(function (error) {
  190. that.fynone=false;
  191. that.$message.error("网络错误,请稍后重试");
  192. });
  193. },
  194. upDate(index, row) {
  195. this.$router.push({
  196. path: "/home/OpAirTicketRes",
  197. query: {
  198. DiId: this.DiId,
  199. id: row.id
  200. }
  201. })
  202. },
  203. addIf() {
  204. if (this.DiId != 0 && this.DiId != '' && this.DiId != undefined) {
  205. this.$router.push({
  206. path: "/home/OpAirTicketRes",
  207. query: {
  208. DiId: this.DiId,
  209. }
  210. })
  211. } else {
  212. this.$message('请选择团组在进行添加');
  213. }
  214. },
  215. del(index, row) {
  216. this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
  217. confirmButtonText: '确定',
  218. cancelButtonText: '取消',
  219. type: 'warning'
  220. }).then(() => {
  221. var url = "/api/Groups/DelAirTicketRes"
  222. var that = this
  223. this.$axios({
  224. method: 'post',
  225. url: url,
  226. headers: {
  227. Authorization: 'Bearer ' + this.token
  228. },
  229. data: {
  230. Id: row.id,
  231. DeleteUserId: this.userId
  232. }
  233. }).then(function (res) {
  234. console.log(res)
  235. if (res.data.code == 200) {
  236. that.$message({
  237. message: '删除成功',
  238. type: 'success'
  239. });
  240. that.AirTicketResList();
  241. } else {
  242. that.$message.error('删除失败!');
  243. }
  244. that.loading = false
  245. }).catch(function (error) {
  246. that.loading = false
  247. that.$message.error("网络错误,请稍后重试");
  248. });
  249. }).catch(() => {
  250. this.$message({
  251. type: 'info',
  252. message: '操作已取消!'
  253. });
  254. });
  255. },
  256. download() {
  257. var url = "/api/Groups/DeriveAirTicketRes"
  258. var that = this
  259. this.$axios({
  260. method: 'post',
  261. url: url,
  262. headers: {
  263. Authorization: 'Bearer ' + this.token
  264. },
  265. data: {
  266. DiId: that.DiId,
  267. UserId: that.userId
  268. }
  269. }).then(function (res) {
  270. if (res.data.code == 200) {
  271. window.location.href = res.data.data
  272. } else {
  273. that.$message.error("网络错误,请稍后重试");
  274. }
  275. })
  276. },
  277. downloadCN() {
  278. var url = "/api/Groups/ItineraryAirTicketRes"
  279. var that = this
  280. this.$axios({
  281. method: 'post',
  282. url: url,
  283. headers: {
  284. Authorization: 'Bearer ' + this.token
  285. },
  286. data: {
  287. DiId: that.DiId,
  288. UserId: that.userId,
  289. Language: "CN"
  290. }
  291. }).then(function (res) {
  292. if (res.data.code == 200) {
  293. window.location.href = res.data.data
  294. } else {
  295. that.$message.error("网络错误,请稍后重试");
  296. }
  297. })
  298. },
  299. downloadEN() {
  300. var url = "/api/Groups/ItineraryAirTicketRes"
  301. var that = this
  302. this.$axios({
  303. method: 'post',
  304. url: url,
  305. headers: {
  306. Authorization: 'Bearer ' + this.token
  307. },
  308. data: {
  309. DiId: that.DiId,
  310. UserId: that.userId,
  311. Language: "EN"
  312. }
  313. }).then(function (res) {
  314. if (res.data.code == 200) {
  315. window.location.href = res.data.data
  316. } else {
  317. that.$message.error("网络错误,请稍后重试");
  318. }
  319. })
  320. }
  321. },
  322. mounted() {
  323. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  324. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
  325. this.AirTicketResSelect();
  326. //this.AirTicketResList()
  327. }
  328. }
  329. </script>
  330. <style>
  331. .communal-list {
  332. background-color: #fff;
  333. padding: 10px;
  334. box-shadow: 0 0 5px #0005;
  335. border-radius: 10px;
  336. min-height: 830px;
  337. }
  338. .communal-title {
  339. display: flex;
  340. font-size: 17px;
  341. font-weight: 600;
  342. color: #555;
  343. margin-top: 8px;
  344. margin-bottom: 10px;
  345. justify-content: space-between;
  346. align-items: center;
  347. }
  348. .communal-list .block{
  349. margin-top: 20px;
  350. }
  351. .communal-box {
  352. display: flex;
  353. }
  354. .communal-box>button {
  355. margin-left: 10px;
  356. padding: 8px 20px;
  357. }
  358. </style>