AirTicketRes.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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;">
  9. <div style="width: 90%;">
  10. <el-select v-model="DiId" placeholder="团组选择" @change="AirTicketResSelectChange">
  11. <el-option v-for="item in AirTicketResSelectData" :key="item.id" :label="item.groupName"
  12. :value="item.id">
  13. </el-option>
  14. </el-select>
  15. </div>
  16. <div>
  17. <router-link :to="{ path: '/home/OpAirTicketRes', query: { DiId } }">
  18. <el-button type="primary" style="margin-left: 10px;">新增</el-button>
  19. </router-link>
  20. </div>
  21. </div>
  22. <span style="font-weight: bold;">团队名称:</span>
  23. {{ delegationInfo.teamName }}&nbsp;&nbsp;&nbsp;
  24. <span style="font-weight: bold;">客户:</span>
  25. {{ delegationInfo.clientName }}&nbsp;&nbsp;&nbsp;
  26. <span style="font-weight: bold;">出访国家:</span>
  27. {{ delegationInfo.visitCountry }}&nbsp;&nbsp;&nbsp;
  28. <span style="font-weight: bold;">起止日期:</span>
  29. {{ delegationInfo.visitStartDate }}—{{ delegationInfo.visitEndDate }}&nbsp;&nbsp;&nbsp;
  30. <span style="font-weight: bold;">天数/人数:</span>
  31. {{ delegationInfo.visitDays }}天/{{ delegationInfo.visitPNumber }}人
  32. </div>
  33. <hr style='background-color:#5555; height:1px; border:none;' />
  34. <template>
  35. <el-table :data="tableDatas.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border
  36. style="width: 100%" v-loading="loading" element-loading-text="拼命加载中...">
  37. <el-table-column prop="num" label="序 号" width="55">
  38. <template slot-scope="scope">
  39. {{ (currentPage - 1) * pageSize + scope.$index + 1 }}
  40. </template>
  41. </el-table-column>
  42. <el-table-column prop="cTypeName" label="舱位类型" width="100">
  43. </el-table-column>
  44. <el-table-column prop="flightDescription" label="航班行程" width="220">
  45. </el-table-column>
  46. <el-table-column prop="clientName" label="客人名单" width="280">
  47. </el-table-column>
  48. <el-table-column prop="clientNum" label="客人人数" width="50">
  49. </el-table-column>
  50. <el-table-column prop="prePrice,preCurrencyStr" label="机票单价" width="120" sortable>
  51. <template slot-scope="scope">
  52. {{ scope.row.prePrice }}({{ scope.row.preCurrencyStr }})
  53. </template>
  54. </el-table-column>
  55. <el-table-column prop="price,currencyStr" label="机票总价" width="120">
  56. <template slot-scope="scope">
  57. {{ scope.row.price }}({{ scope.row.currencyStr }})
  58. </template>
  59. </el-table-column>
  60. <el-table-column prop="isAuditGM" label="是否审核" width="120">
  61. <template slot-scope="isAuditGM">
  62. <span v-if="isAuditGM.row.isAuditGM == 1">已通过</span>
  63. <span v-else-if="isAuditGM.row.isAuditGM == 0">未审核</span>
  64. <span v-else-if="isAuditGM.row.isAuditGM == 2">未通过</span>
  65. <span v-else>自动审核通过</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="操作">
  69. <template slot-scope="scope">
  70. <el-button size="mini" @click="upDate(scope.$index, scope.row)">编辑</el-button>
  71. <el-button size="mini" type="danger" @click="del(scope.$index, scope.row)">删除</el-button>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. </template>
  76. <div class="block">
  77. <el-pagination align='center' @size-change="handleSizeChange" @current-change="handleCurrentChange"
  78. :current-page="currentPage" :page-sizes="[10, 12, 15, 20]" :page-size="pageSize"
  79. layout="total, sizes, prev, pager, next" :total="tableDatas.length">
  80. </el-pagination>
  81. </div>
  82. </div>
  83. </div>
  84. </template>
  85. <script>
  86. export default {
  87. data() {
  88. return {
  89. loading: false,
  90. tableDatas: [],
  91. tableData: [],
  92. currentPage: 1, // 当前页码
  93. pageSize: 12,// 每页的数据条数
  94. input: '',
  95. token: '',
  96. userId: 0,
  97. DiId: '',
  98. AirTicketResSelectData: [],
  99. delegationInfo: {},
  100. }
  101. },
  102. methods: {
  103. //每页条数改变时触发 选择一页显示多少行
  104. handleSizeChange(val) {
  105. this.currentPage = 1;
  106. this.pageSize = val;
  107. },
  108. //当前页改变时触发 跳转其他页
  109. handleCurrentChange(val) {
  110. this.currentPage = val;
  111. },
  112. //团组下拉框
  113. AirTicketResSelect() {
  114. var url = "/api/Groups/AirTicketResSelect"
  115. var that = this
  116. this.$axios({
  117. method: 'post',
  118. url: url,
  119. headers: {
  120. Authorization: 'Bearer ' + this.token
  121. },
  122. data: {
  123. userId: that.userId
  124. }
  125. }).then(function (res) {
  126. if (res.data.code == 200) {
  127. that.AirTicketResSelectData = res.data.data.groupName;
  128. debugger
  129. that.DiId = that.AirTicketResSelectData[0].id;
  130. that.AirTicketResList()
  131. }
  132. }).catch(function (error) {
  133. that.$message.error("网络错误,请稍后重试");
  134. });
  135. },
  136. AirTicketResSelectChange() {
  137. this.AirTicketResList();
  138. },
  139. //团组信息绑定
  140. AirTicketResList() {
  141. var url = "/api/Groups/AirTicketResList"
  142. var that = this
  143. this.$axios({
  144. method: 'post',
  145. url: url,
  146. headers: {
  147. Authorization: 'Bearer ' + this.token
  148. },
  149. data: {
  150. diId: that.DiId
  151. }
  152. }).then(function (res) {
  153. if (res.data.code == 200) {
  154. that.tableDatas = res.data.data.airTicketReservations;
  155. that.tableData = that.tableDatas
  156. if (that.tableDatas.slice((that.currentPage - 1) * that.pageSize, that.currentPage * that.pageSize).length == 0) {
  157. if (that.currentPage > 1) {
  158. that.currentPage = that.currentPage - 1;
  159. }
  160. }
  161. that.delegationInfo = res.data.data.delegationInfo
  162. }
  163. }).catch(function (error) {
  164. that.$message.error("网络错误,请稍后重试");
  165. });
  166. },
  167. upDate(index, row) {
  168. localStorage.setItem('CarDataEdit', JSON.stringify(row));
  169. this.$router.push('/home/carDataEdit')
  170. },
  171. del(index, row) {
  172. this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
  173. confirmButtonText: '确定',
  174. cancelButtonText: '取消',
  175. type: 'warning'
  176. }).then(() => {
  177. var url = "/api/Resource/DelCarData"
  178. var that = this
  179. this.$axios({
  180. method: 'post',
  181. url: url,
  182. headers: {
  183. Authorization: 'Bearer ' + this.token
  184. },
  185. data: {
  186. Id: row.id,
  187. DeleteUserId: this.userId
  188. }
  189. }).then(function (res) {
  190. console.log(res)
  191. if (res.data.code == 200) {
  192. that.$message({
  193. message: '删除成功',
  194. type: 'success'
  195. });
  196. that.carData();
  197. } else {
  198. that.$message.error('删除失败!');
  199. }
  200. that.loading = false
  201. }).catch(function (error) {
  202. that.loading = false
  203. that.$message.error("网络错误,请稍后重试");
  204. });
  205. }).catch(() => {
  206. this.$message({
  207. type: 'info',
  208. message: '操作已取消!'
  209. });
  210. });
  211. }
  212. },
  213. mounted() {
  214. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  215. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
  216. this.AirTicketResSelect();
  217. //this.AirTicketResList()
  218. }
  219. }
  220. </script>
  221. <style>
  222. .communal-list {
  223. background-color: #fff;
  224. padding: 10px;
  225. box-shadow: 0 0 5px #0005;
  226. border-radius: 10px;
  227. }
  228. .communal-title {
  229. display: flex;
  230. font-size: 17px;
  231. font-weight: 600;
  232. color: #555;
  233. margin-top: 8px;
  234. margin-bottom: 10px;
  235. justify-content: space-between;
  236. align-items: center;
  237. }
  238. .communal-box {
  239. display: flex;
  240. }
  241. .communal-box>button {
  242. margin-left: 10px;
  243. padding: 8px 20px;
  244. }
  245. </style>