updateWaterQuality.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <!-- 修改水分质检作业 -->
  3. <div class="shipTransport">
  4. <page-title>返回</page-title>
  5. <div class="form">
  6. <div class="form_box">
  7. <dil-form :formId="135" v-model="form1" ref="from1"></dil-form>
  8. </div>
  9. </div>
  10. <!-- 确定和取消 -->
  11. <div class="button_box">
  12. <el-button type="primary" @click="onClickConfirm">确认</el-button>
  13. <el-button @click="onClickCancel">返回</el-button>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import PageTitle from "@/components/Page/Title";
  19. import { sjTime } from "@/utils/sharedJsFile";
  20. export default {
  21. components: { PageTitle },
  22. data(){
  23. return {
  24. form1: {},
  25. }
  26. },
  27. mounted() {
  28. this.information();
  29. },
  30. methods: {
  31. information() {
  32. //编辑水分质检作业
  33. this.axios
  34. .post("/api/v1/tms/getWaterQuality/" + this.$route.params.resultId)
  35. .then((res) => {
  36. res.data.data.forEach((e) => {
  37. this.form1 = e;
  38. // console.log(e);
  39. // console.log(this.form1);
  40. // console.log(this.$route.params.loadingId);
  41. });
  42. });
  43. },
  44. handleCheckedCitiesChange(value) {
  45. console.log(value);
  46. },
  47. // 返回
  48. onClickCancel() {
  49. this.$router.go(-1);
  50. },
  51. currentRadioChange(row) {
  52. this.aaaa = row;
  53. },
  54. // 确认
  55. onClickConfirm() {
  56. let waterQualityMap = {
  57. resultId: this.$route.params.resultId,
  58. resultPlannedDate: sjTime(
  59. this.form1.resultPlannedDate
  60. ),
  61. };
  62. console.log(waterQualityMap);
  63. this.axios
  64. .post(
  65. "/api/v1/tms/updateWaterQualityResult",
  66. waterQualityMap
  67. )
  68. .then((res) => {
  69. if (res.data.code == 200) {
  70. this.$message({
  71. type: "success",
  72. message: "修改成功!",
  73. });
  74. // this.$refs.table.refreshData();
  75. this.$router.go(-1);
  76. } else {
  77. this.$message.error("修改失败!");
  78. }
  79. this.$refs['table'].resetField();
  80. });
  81. },
  82. },
  83. };
  84. </script>
  85. <style lang="scss">
  86. .shipTransport{
  87. .form{
  88. display: flex;
  89. .form_box{
  90. width: 320px;
  91. margin-left: 35%;
  92. margin-top: 30px;
  93. margin-right: 20px;
  94. .el-form{
  95. .preview-group{
  96. .el-form-item{
  97. .el-form-item__label{
  98. display: inline-block;
  99. width: 70px !important;
  100. }
  101. .el-form-item__content{
  102. .el-select{
  103. width: 250px;
  104. }
  105. .el-input{
  106. width: 250px;
  107. }
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. .button_box{
  115. margin-left: 45%;
  116. }
  117. }
  118. </style>