updateShipmentInstructions.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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="114" 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/getShipmentInstructions/" + this.$route.params.instructionsId)
  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 omsshipShipmentInstructions = {
  57. shipmentInstructionsId:this.$route.params.instructionsId,
  58. batchId: this.form1.batchId,
  59. instructionsTotalTonnage: this.form1.instructionsTotalTonnage,
  60. instructionTime: sjTime(
  61. this.form1.instructionTime
  62. ),
  63. };
  64. this.axios
  65. .post("/api/v1/tms/updateShipmentInstructions",
  66. omsshipShipmentInstructions)
  67. .then((res) => {
  68. if (res.data.code == 200) {
  69. this.$message({
  70. type: "success",
  71. message: "修改成功!",
  72. });
  73. // this.$refs.table.refreshData();
  74. this.$router.go(-1);
  75. } else {
  76. this.$message.error("修改失败!");
  77. }
  78. this.$refs['table'].resetField();
  79. });
  80. },
  81. },
  82. };
  83. </script>
  84. <style lang="scss">
  85. .shipTransport{
  86. .form{
  87. display: flex;
  88. .form_box{
  89. width: 320px;
  90. margin-left: 35%;
  91. margin-top: 30px;
  92. margin-right: 20px;
  93. .el-form{
  94. .preview-group{
  95. .el-form-item{
  96. .el-form-item__label{
  97. display: inline-block;
  98. width: 70px !important;
  99. }
  100. .el-form-item__content{
  101. .el-select{
  102. width: 250px;
  103. }
  104. .el-input{
  105. width: 250px;
  106. }
  107. }
  108. }
  109. }
  110. }
  111. }
  112. }
  113. .button_box{
  114. margin-left: 45%;
  115. }
  116. }
  117. </style>