entrustMine.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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" class="btn1" @click="btnclick(0)">
  16. <i class="el-icon-success"></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=3",
  31. // 控制显示多选列
  32. selectionType: "select",
  33. },
  34. selectionListMap: [],
  35. };
  36. },
  37. methods: {
  38. onclick() {
  39. this.option.requestUrl =
  40. "/api/v1/tms/getLoadResultToSendMC?apiId=209&resultType=1&con=" +
  41. this.input;
  42. },
  43. btnclick() {
  44. let map = {
  45. resultIdList: this.selectionListMap,
  46. };
  47. console.log("map" + map);
  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=209&resultType=3";
  64. }
  65. });
  66. }
  67. },
  68. selectionChange(selection) {
  69. this.selectionListMap = [];
  70. console.log(selection);
  71. this.selectionListMap = selection;
  72. },
  73. },
  74. };
  75. </script>
  76. <style lang='scss'>
  77. .homeworkPath {
  78. .top {
  79. padding: 1.25rem 0.375rem;
  80. .el-input {
  81. width: 20%;
  82. margin-right: 40rpx;
  83. }
  84. .btn {
  85. width: 5.5%;
  86. margin-left: 0.25rem;
  87. }
  88. .btn1 {
  89. width: 7%;
  90. margin-left: 00.375rem;
  91. }
  92. }
  93. }
  94. </style>