entrustMine.vue 2.2 KB

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