VisaPriec.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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: 80%;display: flex;">
  10. <div style="width: 25%;">
  11. <el-select v-model="DiId" placeholder="团组选择" clearable filterable @change="VisaSelectChange"
  12. style="width: 100%;">
  13. <el-option v-for="item in delegationInfoList" :key="item.id" :label="item.teamName"
  14. :value="item.id">
  15. </el-option>
  16. </el-select>
  17. </div>
  18. <div style="width: 25%;margin-left: 10px;"><el-input v-model="VisaClient" placeholder="请输入费用名称" clearable></el-input>
  19. </div>
  20. <div style="width: 25%;margin-left: 10px;"><el-button type="primary"
  21. @click="QueryByVisaClient">查询</el-button>
  22. </div>
  23. </div>
  24. <div style="width: 20%;text-align: right;">
  25. <el-button type="primary" style="" @click="addIf">新增</el-button>
  26. </div>
  27. </div>
  28. </div>
  29. <div style="margin:10px 0;color:#606266;">
  30. <span style="font-weight: bold;font-size:17px;">团队名称:</span>
  31. <span style="color:#606266;">{{ delegationInfo.teamName }}&nbsp;&nbsp;&nbsp;</span>
  32. <span style="font-weight: bold;font-size:17px;">客户:</span>
  33. <span style="color:#606266;">{{ delegationInfo.clientName }}&nbsp;&nbsp;&nbsp; {{
  34. }}&nbsp;&nbsp;&nbsp;</span>
  35. <span style="font-weight: bold;font-size:17px;">出访国家:</span>
  36. <span style="color:#606266;">{{ delegationInfo.visitCountry }}&nbsp;&nbsp;&nbsp;</span>
  37. <span style="font-weight: bold;font-size:17px;">起止日期:</span>
  38. <span style="color:#606266;">{{ delegationInfo.visitStartDate }}—{{ delegationInfo.visitEndDate
  39. }}&nbsp;&nbsp;&nbsp;</span>
  40. <span style="font-weight: bold;font-size:17px;">天数/人数:</span>
  41. <span style="color:#606266;">{{ delegationInfo.visitDays }}天/{{ delegationInfo.visitPNumber }}人</span>
  42. </div>
  43. <template>
  44. <el-table :data="tableDatas.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border
  45. style="width: 100%" v-loading="loading" element-loading-text="拼命加载中...">
  46. <el-table-column prop="num" label="序 号" width="55">
  47. <template slot-scope="scope">
  48. {{ (currentPage - 1) * pageSize + scope.$index + 1 }}
  49. </template>
  50. </el-table-column>
  51. <el-table-column prop="visaClient" label="签证客户">
  52. </el-table-column>
  53. <el-table-column prop="visaPrice,visaCurrencyStr" label="签证费用">
  54. <template slot-scope="scope">
  55. {{ townum(scope.row.visaPrice) }}({{ scope.row.visaCurrencyStr }})
  56. </template>
  57. </el-table-column>
  58. <el-table-column prop="isAuditGM" label="是否审核">
  59. <template slot-scope="isAuditGM">
  60. <span v-if="isAuditGM.row.isAuditGM == 1">已通过</span>
  61. <span v-else-if="isAuditGM.row.isAuditGM == 0">未审核</span>
  62. <span v-else-if="isAuditGM.row.isAuditGM == 2">未通过</span>
  63. <span v-else>自动审核通过</span>
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="操作">
  67. <template slot-scope="scope">
  68. <el-button-group>
  69. <el-button type="primary" size="mini" icon="el-icon-edit"
  70. @click="upDate(scope.$index, scope.row)"></el-button>
  71. <el-button type="danger" size="mini" icon="el-icon-delete"
  72. @click="del(scope.$index, scope.row)"></el-button>
  73. </el-button-group>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. </template>
  78. <div class="block">
  79. <el-pagination align='center' @size-change="handleSizeChange" @current-change="handleCurrentChange"
  80. :current-page="currentPage" :page-sizes="[5, 10, 12, 15, 20]" :page-size="pageSize"
  81. layout="total, sizes, prev, pager, next" :total="tableDatas.length">
  82. </el-pagination>
  83. </div>
  84. </div>
  85. </div>
  86. </template>
  87. <script>
  88. import { el } from '@fullcalendar/core/internal-common';
  89. export default {
  90. data() {
  91. return {
  92. loading: false,
  93. tableDatas: [],
  94. tableData: [],
  95. currentPage: 1, // 当前页码
  96. pageSize: 12,// 每页的数据条数
  97. input: '',
  98. token: '',
  99. userId: 0,
  100. DiId: '',
  101. VisaSelectList: [],
  102. VisaClient: '',
  103. delegationInfoList: [],
  104. delegationInfo: {},
  105. }
  106. },
  107. methods: {
  108. //保留两位小数
  109. townum(val){
  110. return val.toFixed(2)
  111. },
  112. //每页条数改变时触发 选择一页显示多少行
  113. handleSizeChange(val) {
  114. this.currentPage = 1;
  115. this.pageSize = val;
  116. },
  117. //当前页改变时触发 跳转其他页
  118. handleCurrentChange(val) {
  119. this.currentPage = val;
  120. },
  121. //团组下拉框
  122. visaSelect() {
  123. var url = "/api/Groups/DecreasePaymentsSelect"
  124. var that = this
  125. this.$axios({
  126. method: 'post',
  127. url: url,
  128. headers: {
  129. Authorization: 'Bearer ' + this.token
  130. },
  131. data: {
  132. UserId: that.userId,
  133. CTId: 80
  134. }
  135. }).then(function (res) {
  136. if (res.data.code == 200) {
  137. that.delegationInfoList = res.data.data.groupName;
  138. that.DiId = that.$route.query.diId
  139. if (that.DiId == undefined) {
  140. that.delegationInfo = that.delegationInfoList[0]
  141. that.DiId = that.delegationInfoList[0].id;
  142. } else {
  143. for (let index = 0; index < that.delegationInfoList.length; index++) {
  144. if (that.delegationInfoList[index].id == that.DiId) {
  145. that.delegationInfo = that.delegationInfoList[index];
  146. that.DiId = that.delegationInfoList[index].id;
  147. break;
  148. }
  149. }
  150. }
  151. that.PostVisaByDiId()
  152. }
  153. }).catch(function (error) {
  154. that.$message.error("网络错误,请稍后重试");
  155. });
  156. },
  157. VisaSelectChange() {
  158. if (this.DiId != "") {
  159. this.PostVisaByDiId();
  160. } else {
  161. this.tableDatas = [];
  162. this.tableData = [];
  163. }
  164. },
  165. //团组信息绑定
  166. PostVisaByDiId() {
  167. var url = "/api/Groups/QueryVisaByDiId"
  168. var that = this
  169. this.$axios({
  170. method: 'post',
  171. url: url,
  172. headers: {
  173. Authorization: 'Bearer ' + this.token
  174. },
  175. data: {
  176. pageIndex: 0,
  177. pageSize: 0,
  178. portType: 1,
  179. diID: that.DiId,
  180. VisaClient: that.VisaClient
  181. }
  182. }).then(function (res) {
  183. if (res.data.code == 200) {
  184. that.tableDatas = res.data.data;
  185. that.tableData = that.tableDatas
  186. if (that.tableDatas.length != 0) {
  187. if (that.tableDatas.slice((that.currentPage - 1) * that.pageSize, that.currentPage * that.pageSize).length == 0) {
  188. if (that.currentPage > 1) {
  189. that.currentPage = that.currentPage - 1;
  190. }
  191. }
  192. }
  193. }
  194. }).catch(function (error) {
  195. that.$message.error("网络错误,请稍后重试");
  196. });
  197. },
  198. QueryByVisaClient() {
  199. this.PostVisaByDiId()
  200. },
  201. upDate(index, row) {
  202. this.$router.push({
  203. path: "/home/OpVisaPriec",
  204. query: {
  205. DiId: this.DiId,
  206. id: row.id
  207. }
  208. })
  209. },
  210. addIf() {
  211. if (this.DiId != 0 && this.DiId != '' && this.DiId != undefined) {
  212. this.$router.push({
  213. path: "/home/OpVisaPriec",
  214. query: {
  215. DiId: this.DiId,
  216. }
  217. })
  218. } else {
  219. this.$message('请选择团组在进行添加');
  220. }
  221. },
  222. del(index, row) {
  223. this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
  224. confirmButtonText: '确定',
  225. cancelButtonText: '取消',
  226. type: 'warning'
  227. }).then(() => {
  228. var url = "/api/Groups/DelVisaPrice"
  229. var that = this
  230. this.$axios({
  231. method: 'post',
  232. url: url,
  233. headers: {
  234. Authorization: 'Bearer ' + this.token
  235. },
  236. data: {
  237. Id: row.id,
  238. DeleteUserId: this.userId
  239. }
  240. }).then(function (res) {
  241. console.log(res)
  242. if (res.data.code == 200) {
  243. that.$message({
  244. message: '删除成功',
  245. type: 'success'
  246. });
  247. that.PostVisaByDiId();
  248. } else {
  249. that.$message.error('删除失败!');
  250. }
  251. that.loading = false
  252. }).catch(function (error) {
  253. that.loading = false
  254. that.$message.error("网络错误,请稍后重试");
  255. });
  256. }).catch(() => {
  257. this.$message({
  258. type: 'info',
  259. message: '操作已取消!'
  260. });
  261. });
  262. },
  263. },
  264. mounted() {
  265. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  266. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
  267. this.visaSelect();
  268. //this.AirTicketResList()
  269. }
  270. }
  271. </script>
  272. <style>
  273. .communal-list {
  274. background-color: #fff;
  275. padding: 10px;
  276. box-shadow: 0 0 5px #0005;
  277. border-radius: 10px;
  278. min-height: 830px;
  279. }
  280. .communal-title {
  281. display: flex;
  282. font-size: 17px;
  283. font-weight: 600;
  284. color: #555;
  285. margin-top: 8px;
  286. margin-bottom: 10px;
  287. justify-content: space-between;
  288. align-items: center;
  289. }
  290. .communal-box {
  291. display: flex;
  292. }
  293. .communal-box>button {
  294. margin-left: 10px;
  295. padding: 8px 20px;
  296. }
  297. </style>