entrustEmergency.vue 2.4 KB

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