entrustEmergency.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <!-- 海港-老区轨道衡计量委托 -->
  3. <div class="homeworkPath">
  4. <div class="top">
  5. <el-input
  6. class="el-input"
  7. placeholder="请输入内容"
  8. v-model="input"
  9. clearable
  10. >
  11. </el-input>
  12. <el-button type="primary" class="btn" @click="onclick">
  13. <i class="el-icon-search"></i>查询
  14. </el-button>
  15. </div>
  16. <dilTable v-bind.sync="option" @selection-change="selectionChange">
  17. </dilTable>
  18. </div>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. input: "",
  25. option: {
  26. // 表格请求数据的地址
  27. requestUrl: "/api/v1/tms/getLoadResultToSendMC?apiId=58&resultType=2",
  28. // 控制显示多选列
  29. selectionType: "select",
  30. },
  31. selectionListMap: [],
  32. };
  33. },
  34. methods: {
  35. onclick() {
  36. this.option.requestUrl =
  37. "/api/v1/tms/getTmstrainWagonLoad?apiId=58&resultType=2&con=" +
  38. this.input;
  39. },
  40. btnclick() {
  41. let map = {
  42. resultIdList: this.selectionListMap,
  43. };
  44. if (this.selectionListMap.length == 0) {
  45. this.$message({
  46. message: "请勾选要发送计量委托的实绩!",
  47. type: "warning",
  48. });
  49. } else {
  50. this.axios
  51. .post("/api/v1/tms/batchSendMeasureCommission", map)
  52. .then((res) => {
  53. if (res.data.data == "发送成功") {
  54. this.$message({
  55. type: "success",
  56. message: res.data.data,
  57. });
  58. this.option.requestUrl =
  59. "/api/v1/tms/getLoadResultToSendMC?apiId=58&resultType=2&i=" +
  60. new Date();
  61. }else{
  62. this.$message({
  63. type: "warning",
  64. message: res.data.data,
  65. });
  66. }
  67. });
  68. }
  69. },
  70. selectionChange(selection) {
  71. this.selectionListMap = [];
  72. console.log(selection);
  73. this.selectionListMap = selection;
  74. },
  75. },
  76. };
  77. </script>
  78. <style lang='scss'>
  79. .homeworkPath {
  80. .top {
  81. padding: 1.25rem 0.375rem;
  82. .el-input {
  83. width: 20%;
  84. margin-right: 40rpx;
  85. }
  86. .btn {
  87. width: 5.5%;
  88. margin-left: 0.25rem;
  89. }
  90. .btn1 {
  91. width: 7%;
  92. margin-left: 00.375rem;
  93. }
  94. }
  95. }
  96. </style>