entrust.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <!-- 发送计量委托界面 -->
  3. <div class="trainTransport">
  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" @click="btnclick(0)">
  10. <i class="el-icon-s-promotion"></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=1",
  25. // 控制显示多选列
  26. selectionType: "select",
  27. },
  28. selectionListMap:[],
  29. };
  30. },
  31. methods: {
  32. onclick() {
  33. this.option.requestUrl = "/api/v1/tms/getLoadResultToSendMC?apiId=58&resultType=1&con="+this.input;
  34. },
  35. btnclick() {
  36. this.axios.post('/api/v1/tms/batchSendMeasureCommission',{resultIdList:this.selectionListMap}).then((res)=>{
  37. if(res.data.code == "200"){
  38. this.$message({
  39. type: "success",
  40. message: "发送成功",
  41. });
  42. this.option.requestUrl = "/api/v1/tms/getLoadResultToSendMC?apiId=58&resultType=1"+"&i=" + new Date();
  43. }
  44. })
  45. },
  46. selectionChange(selection) {
  47. this.selectionListMap = []
  48. selection.forEach(element => {
  49. this.selectionListMap.push(element.resultId);
  50. });
  51. },
  52. },
  53. };
  54. </script>
  55. <style lang='scss'>
  56. .trainTransport {
  57. .top {
  58. padding: 1.25rem 0.375rem;
  59. .el-input {
  60. width: 20%;
  61. margin-right: 1.25rem;
  62. }
  63. }
  64. }
  65. </style>