entrust.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <!-- 发送计量委托界面 -->
  3. <div class="trainTransport">
  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=1",
  31. // 控制显示多选列
  32. selectionType: "select",
  33. },
  34. selectionListMap: [],
  35. resultIdList: [],
  36. };
  37. },
  38. methods: {
  39. onclick() {
  40. this.option.requestUrl =
  41. "/api/v1/tms/getLoadResultToSendMC?apiId=58&resultType=1&con=" +
  42. this.input;
  43. },
  44. btnclick() {
  45. let map = {
  46. resultIdList: this.selectionListMap,
  47. };
  48. if (this.selectionListMap.length == 0) {
  49. this.$message({
  50. message: "请勾选要发送计量委托的实绩!",
  51. type: "warning",
  52. });
  53. } else {
  54. this.axios
  55. .post("/api/v1/tms/batchSendMeasureCommission", map)
  56. .then((res) => {
  57. if (res.data.code == "200") {
  58. this.$message({
  59. type: "success",
  60. message: "发送成功",
  61. });
  62. this.option.requestUrl =
  63. "/api/v1/tms/getLoadResultToSendMC?apiId=58&resultType=1" +
  64. "&i=" +
  65. new Date();
  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. .trainTransport {
  80. .top {
  81. padding: 1.25rem 0.375rem;
  82. .el-input {
  83. width: 20%;
  84. margin-right: 1.25rem;
  85. }
  86. }
  87. }
  88. </style>