CountryFeeCost.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <div>
  3. <div class="communal-list">
  4. <div class="communal-title">
  5. <div>签证费用标准</div>
  6. <div class="communal-box">
  7. <el-input @input="Inquireclick()" placeholder="国家" v-model="input" clearable style="width: 350px;">
  8. </el-input>
  9. <router-link to="/home/CountryFeeCostOperation">
  10. <el-button type="primary" style="margin-left: 10px;">新增</el-button>
  11. </router-link>
  12. </div>
  13. </div>
  14. <template>
  15. <el-table :data="tableDatas.slice((currentPage - 1) * pageSize, currentPage * pageSize)" border
  16. style="width: 100%" v-loading="loading" element-loading-text="拼命加载中...">
  17. <el-table-column prop="num" label="序 号" width="55">
  18. <template slot-scope="scope">
  19. {{ (currentPage - 1) * pageSize + scope.$index + 1 }}
  20. </template>
  21. </el-table-column>
  22. <el-table-column prop="visaContinent" label="洲" width="80">
  23. </el-table-column>
  24. <el-table-column prop="visaCountry" label="国家" width="150">
  25. </el-table-column>
  26. <el-table-column prop="isVisaExemption" label="是否免签" width="80">
  27. <template slot-scope="is">
  28. <span v-if="is.row.isVisaExemption == 1">否</span>
  29. <span v-else>是</span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column prop="isVisaOnArrival" label="是否落地签" width="80">
  33. <template slot-scope="is">
  34. <span v-if="is.row.isVisaOnArrival == 1">否</span>
  35. <span v-else>是</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column prop="isElectronicSignature" label="是否电子签" width="80">
  39. <template slot-scope="is">
  40. <span v-if="is.row.isElectronicSignature == 1">否</span>
  41. <span v-else>是</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="visaTime" label="一般签证时间(天)" width="100">
  45. </el-table-column>
  46. <el-table-column prop="visaPrice" label="费用(元)" :formatter="rounding">
  47. </el-table-column>
  48. <el-table-column prop="grandBusinessAgencyFee" label="大公务代办费(元)" :formatter="rounding">
  49. </el-table-column>
  50. <el-table-column prop="pettyBusinessAgencyFee" label="小公务代办费(元)" :formatter="rounding">
  51. </el-table-column>
  52. <el-table-column prop="urgentTime" label="加急签证时间(天)">
  53. </el-table-column>
  54. <el-table-column prop="urgentPrice" label="加急签证费用(元)" :formatter="rounding">
  55. </el-table-column>
  56. <el-table-column prop="visaPriceDesc" label="费用描述" width="110">
  57. <template slot-scope="visaPriceDesc">
  58. <el-popover placement="top-start" title="费用描述" trigger="hover" width="200"
  59. :content="visaPriceDesc.row.visaPriceDesc">
  60. <el-button slot="reference" size="mini">移上查看</el-button>
  61. </el-popover>
  62. </template>
  63. </el-table-column>
  64. <!-- <el-table-column prop="urgentTime" label="加急签证时间" width="50">
  65. </el-table-column>
  66. <el-table-column prop="urgentPrice" label="加急费用" width="80">
  67. </el-table-column>
  68. <el-table-column prop="urgentPriceDesc" label="加急费用描述" width="180">
  69. <template slot-scope="urgentPriceDesc">
  70. <el-popover placement="top-start" title="加急费用描述" width="200" trigger="hover"
  71. :content="urgentPriceDesc.row.urgentPriceDesc">
  72. <el-button slot="reference">移上查看</el-button>
  73. </el-popover>
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="remark" label="签证描述" width="180">
  77. <template slot-scope="remark">
  78. <el-popover placement="top-start" title="加急费用描述" width="200" trigger="hover"
  79. :content="remark.row.remark">
  80. <el-button slot="reference">移上查看</el-button>
  81. </el-popover>
  82. </template>
  83. </el-table-column> -->
  84. <el-table-column label="操作" width="160">
  85. <template slot-scope="scope">
  86. <el-button size="mini" @click="upDate(scope.$index, scope.row)">编辑</el-button>
  87. <el-button size="mini" type="danger" @click="del(scope.$index, scope.row)">删除</el-button>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. </template>
  92. <div class="block">
  93. <el-pagination align='center' @size-change="handleSizeChange" @current-change="handleCurrentChange"
  94. :current-page="currentPage" :page-sizes="[10, 12, 15, 20]" :page-size="pageSize"
  95. layout="total, sizes, prev, pager, next" :total="tableDatas.length">
  96. </el-pagination>
  97. </div>
  98. </div>
  99. </div>
  100. </template>
  101. <script>
  102. export default {
  103. beforeRouteLeave(to, from, next) {
  104. if(to.name!='CountryFeeCostOperation'){
  105. localStorage.removeItem('qzfyval');
  106. }
  107. next()
  108. },
  109. data() {
  110. return {
  111. loading: false,
  112. tableDatas: [],
  113. tableData: [],
  114. currentPage: 1, // 当前页码
  115. pageSize: 12,// 每页的数据条数
  116. input: '',
  117. token: '',
  118. userId: 0
  119. }
  120. },
  121. methods: {
  122. //每页条数改变时触发 选择一页显示多少行
  123. handleSizeChange(val) {
  124. this.currentPage = 1;
  125. this.pageSize = val;
  126. },
  127. //当前页改变时触发 跳转其他页
  128. handleCurrentChange(val) {
  129. this.currentPage = val;
  130. },
  131. HotelData() {
  132. this.loading = true
  133. var url = "/api/Resource/QueryCountryFeeCost"
  134. var that = this
  135. this.$axios({
  136. method: 'post',
  137. url: url,
  138. headers: {
  139. Authorization: 'Bearer ' + this.token
  140. },
  141. data: {
  142. portType: 1,
  143. }
  144. }).then(function (res) {
  145. console.log(res)
  146. if (res.data.code == 200) {
  147. that.tableData = res.data.data;
  148. that.tableDatas = that.tableData;
  149. if (that.tableDatas.slice((that.currentPage - 1) * that.pageSize, that.currentPage * that.pageSize).length == 0) {
  150. if (that.currentPage > 1) {
  151. that.currentPage = that.currentPage - 1;
  152. }
  153. }
  154. if(JSON.parse(localStorage.getItem('qzfyval'))){
  155. that.currentPage=JSON.parse(localStorage.getItem('qzfyval')).currentPage;
  156. that.input=JSON.parse(localStorage.getItem('qzfyval')).input;
  157. var newarr = [];
  158. if (that.input == "") {
  159. newarr = that.tableData;
  160. } else {
  161. for (var i = 0; i < that.tableData.length; i++) {
  162. if (that.tableData[i].visaCountry.indexOf(that.input) != -1) {
  163. newarr.push(that.tableData[i]);
  164. }
  165. }
  166. }
  167. that.tableDatas = newarr;
  168. }
  169. }
  170. that.loading = false
  171. }).catch(function (error) {
  172. that.loading = false
  173. that.$message.error("网络错误,请稍后重试");
  174. });
  175. },
  176. //搜索框处理
  177. Inquireclick() {
  178. var newarr = [];
  179. if (this.input == "") {
  180. newarr = this.tableData;
  181. } else {
  182. for (var i = 0; i < this.tableData.length; i++) {
  183. if (this.tableData[i].visaCountry.indexOf(this.input) != -1) {
  184. newarr.push(this.tableData[i]);
  185. }
  186. }
  187. }
  188. this.tableDatas = newarr;
  189. this.currentPage = 1;
  190. },
  191. rounding(row, column) {
  192. return parseFloat(row[column.property]).toFixed(2)
  193. },
  194. upDate(index, row) {
  195. var qzfyval={
  196. currentPage:this.currentPage,
  197. input:this.input,
  198. }
  199. localStorage.setItem('qzfyval', JSON.stringify(qzfyval));
  200. this.$router.push({
  201. path: "/home/CountryFeeCostOperation",
  202. query: { id: row.id }
  203. })
  204. },
  205. del(index, row) {
  206. this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
  207. confirmButtonText: '确定',
  208. cancelButtonText: '取消',
  209. type: 'warning'
  210. }).then(() => {
  211. var url = "/api/Resource/DelCountryFeeCost"
  212. var that = this
  213. this.$axios({
  214. method: 'post',
  215. url: url,
  216. headers: {
  217. Authorization: 'Bearer ' + this.token
  218. },
  219. data: {
  220. Id: row.id,
  221. DeleteUserId: this.userId
  222. }
  223. }).then(function (res) {
  224. console.log(res)
  225. if (res.data.code == 200) {
  226. that.$message({
  227. message: '删除成功',
  228. type: 'success'
  229. });
  230. that.HotelData();
  231. } else {
  232. that.$message.error('删除失败!');
  233. }
  234. that.loading = false
  235. }).catch(function (error) {
  236. that.loading = false
  237. that.$message.error("网络错误,请稍后重试");
  238. });
  239. }).catch(() => {
  240. this.$message({
  241. type: 'info',
  242. message: '操作已取消!'
  243. });
  244. });
  245. }
  246. },
  247. mounted() {
  248. this.token = JSON.parse(localStorage.getItem('userinif')).token;
  249. this.userId = JSON.parse(localStorage.getItem('userinif')).userInfo.userId
  250. this.HotelData();
  251. }
  252. }
  253. </script>
  254. <style>
  255. .communal-list {
  256. background-color: #fff;
  257. padding: 10px;
  258. box-shadow: 0 0 5px #0005;
  259. border-radius: 10px;
  260. }
  261. .communal-title {
  262. display: flex;
  263. font-size: 17px;
  264. font-weight: 600;
  265. color: #555;
  266. margin-top: 8px;
  267. margin-bottom: 10px;
  268. justify-content: space-between;
  269. align-items: center;
  270. }
  271. .communal-box {
  272. display: flex;
  273. }
  274. .communal-box>button {
  275. margin-left: 10px;
  276. padding: 8px 20px;
  277. }
  278. </style>