addShipLocation.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <!-- 船只信息页面 -->
  3. <div class="homeworkPath">
  4. <page-title>位置作业信息</page-title>
  5. <div class="main">
  6. <span class="text">位置作业新增</span>
  7. <span class="a"></span>
  8. </div>
  9. <div>
  10. <div class="form-box" style="margin-left: 5rem">
  11. <el-form
  12. ><dil-form :formId="127" v-model="form"></dil-form>
  13. <el-button type="primary" @click="makeSure">新增位置作业</el-button>
  14. </el-form>
  15. </div>
  16. </div>
  17. <div class="main">
  18. <span class="text">位置作业新增</span>
  19. <span class="a"></span>
  20. </div>
  21. <div class="top">
  22. <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
  23.      
  24. <el-button type="primary" class="btn" @click="onclick()">
  25.         <i class="el-icon-search"></i>查询      
  26. </el-button>
  27. </div>
  28. <dilTable v-bind.sync="option" @radio-change="currentRadioChange">
  29. </dilTable>
  30. </div>
  31. </template>
  32. <script>
  33. import PageTitle from "@/components/Page/Title";
  34. import { sjTime } from "@/utils/sharedJsFile";
  35. export default {
  36. components: { PageTitle },
  37. data() {
  38. return {
  39. input: "",
  40. restaurants: [],
  41. state: "",
  42. form: {},
  43. option: {
  44. // 表格请求数据的地址
  45. requestUrl: "/api/v1/tms/getCapacityList?apiId=138",
  46. // 控制显示当选列
  47. selectionType: "radio",
  48. shipLocationMap: {},
  49. },
  50. };
  51. },
  52. mounted() {},
  53. methods: {
  54. currentRadioChange(row) {
  55. this.shipLocationMap = row;
  56. console.log(row);
  57. },
  58. // 新增
  59. makeSure() {
  60. let mapVal = {
  61. locationValue: this.form.locationValue,
  62. locationRouteTime: sjTime(this.form.locationRouteTime),
  63. locationStatus: this.form.locationStatus,
  64. locationMemo: this.form.locationMemo,
  65. };
  66. if (
  67. mapVal.locationValue == null ||
  68. mapVal.locationRouteTime == null ||
  69. mapVal.locationStatus == null ||
  70. mapVal.locationMemo == null
  71. )
  72. this.$message.error("存在空值!");
  73. else
  74. this.axios
  75. .post("/api/v1/tms/addShipLocation", {
  76. mapVal: mapVal,
  77. shipLocationMap: this.shipLocationMap,
  78. })
  79. .then((res) => {
  80. if (res.data.code == 200) {
  81. this.$message({
  82. type: "success",
  83. message: "新增成功!",
  84. });
  85. // this.$refs.table.refreshData();
  86. this.$router.go(-1);
  87. } else {
  88. this.$message.error("新增失败!");
  89. }
  90. this.$refs["table"].resetField();
  91. });
  92. },
  93. loadAll() {
  94. return [];
  95. },
  96. handleSelect(item) {
  97. console.log(item);
  98. },
  99. onclick() {
  100. this.option.requestUrl =
  101. "/api/v1/tms/getCapacityList?apiId=138&con=" + this.input;
  102. },
  103. },
  104. };
  105. </script>
  106. <style lang='scss' scoped>
  107. .homeworkPath {
  108. .main {
  109. margin-bottom: 0.125rem;
  110. }
  111. .button-ins {
  112. margin: 0 50rem;
  113. text-align: center;
  114. }
  115. .top {
  116. margin: 0 auto;
  117. padding: 1.25rem 1.875rem;
  118. }
  119. }
  120. </style>