addTrainDetails.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <!-- 火运计费详单页面 -->
  3. <div class="purchaseOrder">
  4. <page-title>火运详单</page-title>
  5. <div class="top">
  6. <el-input
  7. placeholder="请输入内容"
  8. v-model="input"
  9. clearable>
  10. </el-input>
  11. <el-button type="primary" class="btn" @click="onclick">
  12. <i class="el-icon-search"></i>查询
  13. </el-button>
  14. <el-button type="primary" @click="btnclick">
  15. 新增
  16. </el-button>
  17. </div>
  18. <dilTable v-bind.sync="option" @radio-change="currentRadioChange">
  19. </dilTable>
  20. </div>
  21. </template>
  22. <script>
  23. import PageTitle from "@/components/Page/Title";
  24. export default {
  25. components: { PageTitle },
  26. name: "purchaseOrder",
  27. data() {
  28. return {
  29. input:"",
  30. map:{},
  31. option: {
  32. // 表格请求数据的地址
  33. requestUrl: "/api/v1/bms/getTrainResultList?apiId=122",
  34. // 控制显示当选列
  35. selectionType: "radio",
  36. },
  37. };
  38. },
  39. methods: {
  40. currentRadioChange(row) {
  41. this.map=row
  42. console.log(row);
  43. },
  44. onclick() {
  45. console.log(1);
  46. },
  47. btnclick() {
  48. console.log()
  49. if(JSON.stringify(this.map).length == 2){
  50. this.$message.error("未勾选火运实绩")
  51. return
  52. }
  53. this.$confirm("是否生成", "提示", {
  54. confirmButtonText: "确定",
  55. cancelButtonText: "取消",
  56. type: "warning",
  57. center: true,
  58. })
  59. .then(() => {
  60. this.$message({
  61. type: "success",
  62. message: "生成详单成功!",
  63. });
  64. this.axios.post("/api/v1/bms/addTrainDetails",this.map)
  65. .then(() => {
  66. this.$router.go(-1);
  67. });
  68. })
  69. .catch(() => {
  70. this.$message({
  71. type: "info",
  72. message: "取消生成!",
  73. });
  74. });
  75. // this.$router.push("/path/addHomeworkPath/");
  76. },
  77. },
  78. };
  79. </script>
  80. <style lang='scss' scoped>
  81. .purchaseOrder {
  82. .top {
  83. padding: 1.25rem 1.875rem;
  84. .el-input {
  85. width: 250px;
  86. }
  87. }
  88. }
  89. </style>