VisaPriec.vue 12 KB

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