threeSectionFee.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <!-- 二程船水运费 -->
  3. <div class="contract_price">
  4. <div class="sache">
  5. <el-input placeholder="请输入内容" v-model="inputText" clearable>
  6. </el-input>
  7. <el-button type="primary" class="btn" @click="onclick">
  8. <i class="el-icon-search"></i>查询
  9. </el-button>
  10. <el-button type="primary" class="btn" @click="toInsert">
  11. <i class="el-icon-plus"></i>新增
  12. </el-button>
  13. </div>
  14. <div class="table">
  15. <mergeRowTable v-bind.sync="options">
  16. <el-table-column fixed="right" label="操作" width="100">
  17. <template slot-scope="scope">
  18. <el-button type="text" size="small" @click="update(scope)">
  19. 修改
  20. </el-button>
  21. <el-button type="text" size="mini" @click="deleteOne(scope)">
  22. 删除
  23. </el-button>
  24. <el-button
  25. @click="toPhotoClick(scope.row.resultId)"
  26. type="text"
  27. size="small"
  28. >
  29. 水运单图片
  30. </el-button>
  31. </template>
  32. </el-table-column>
  33. </mergeRowTable>
  34. </div>
  35. <vxe-modal width="549px" height="731px" v-model="isShow" show-footer>
  36. <div class="demo-image__preview">
  37. <el-image
  38. style=" height:731px;text-align:center"
  39. :src="src"
  40. :preview-src-list="srcList"
  41. >
  42. </el-image>
  43. </div>
  44. </vxe-modal>
  45. </div>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. inputText: "",
  52. isShow: false,
  53. options: {
  54. // first请求数据的地址
  55. requestUrl: "/api/v1/bms/selectPortFeeSecondList?apiId=506&feeType=3",
  56. comparison:"resultForeignShipName",
  57. columnIndexs:[0,1,2,3]
  58. }
  59. };
  60. },
  61. methods: {
  62. getRequestUrl() {
  63. this.options.requestUrl =
  64. "/api/v1/bms/selectPortFeeSecondList?apiId=506&feeType=3&i=" +
  65. new Date();
  66. },
  67. //查询
  68. onclick() {
  69. this.options.requestUrl =
  70. "/api/v1/bms/selectPortFeeSecondList?apiId=506&feeType=3&con=" +
  71. this.inputText;
  72. },
  73. //新增
  74. toInsert() {
  75. this.$router.push("/addThreeSectionFee");
  76. },
  77. update(scope) {
  78. console.log(scope.row.resultId);
  79. this.$router.push("/editThreeSectionFee/" + scope.row.resultId);
  80. },
  81. showCarrier(scope) {
  82. console.log(scope.row.resultId);
  83. this.$router.push("/showTwoSectionFee/" + scope.row.resultId);
  84. },
  85. deleteOne(scope) {
  86. this.$confirm("是否删除", "提示", {
  87. confirmButtonText: "确定",
  88. cancelButtonText: "取消",
  89. type: "warning",
  90. center: true
  91. })
  92. .then(() => {
  93. let map = {
  94. resultId: scope.row.resultId
  95. };
  96. this.axios
  97. .post(
  98. "/api/v1/bms/deletePortHandlingFeeSecond/" + scope.row.resultId
  99. )
  100. .then(res => {
  101. if (res.data.code == 200) {
  102. this.$message({
  103. type: "success",
  104. message: "删除成功!"
  105. });
  106. this.getRequestUrl();
  107. } else {
  108. this.$message({
  109. message: "删除失败",
  110. type: "warning"
  111. });
  112. }
  113. });
  114. })
  115. .catch(() => {
  116. this.$message({
  117. type: "info",
  118. message: "删除操作已取消!"
  119. });
  120. });
  121. },
  122. toPhotoClick(resultId) {
  123. this.axios
  124. .post("/api/v1/bms/downloadBmsshipOrder?resultId=" + resultId)
  125. .then(res => {
  126. console.log("res", res.data.data);
  127. this.srcList = [];
  128. this.src = res.data.data;
  129. this.isShow = true;
  130. this.srcList.push(res.data.data);
  131. });
  132. }
  133. }
  134. };
  135. </script>
  136. <style lang="scss" scode>
  137. .contract_price {
  138. .sache {
  139. padding: 1.25rem 0.375rem;
  140. .el-input {
  141. width: 20%;
  142. margin-right: 1.25rem;
  143. }
  144. }
  145. }
  146. </style>