editRmsShipper.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <!-- 修改托运人信息 -->
  3. <div id="contractDetails">
  4. <page-title>编辑</page-title>
  5. <div class="main">
  6. </div>
  7. <div class="contractTitle">
  8. <div class="form-box">
  9. <div class="form-one">
  10. <dil-form :formId="322" v-model="form1"></dil-form>
  11. </div>
  12. </div>
  13. </div>
  14. <div class="button-box">
  15. <el-button @click="onClickCancel">返回</el-button>
  16. <el-button type="primary" @click="onClickConfirm">确认</el-button>
  17. </div>
  18. </div>
  19. </template>
  20. <script>
  21. import PageTitle from "@/components/Page/Title";
  22. export default {
  23. components: { PageTitle },
  24. data() {
  25. return {
  26. form1: {},
  27. shipperName:"四川达钢",
  28. shipperAbbreviation:"四川达钢"
  29. };
  30. },
  31. mounted() {
  32. this.form1.shipperName = this.shipperName;
  33. this.form1.shipperAbbreviation = this.shipperAbbreviation;
  34. this.information();
  35. },
  36. methods: {
  37. information() {
  38. //编辑
  39. this.axios
  40. .post(
  41. "/api/v1/rms/getShipperById/" +
  42. this.$route.params.shipperId
  43. )
  44. .then((res) => {
  45. res.data.data.forEach((e) => {
  46. this.form1 = e;
  47. });
  48. });
  49. },
  50. // 返回
  51. onClickCancel() {
  52. this.$router.go(-1);
  53. },
  54. // 确认
  55. onClickConfirm() {
  56. console.log(this.form1)
  57. let RmsShipper={
  58. shipperId:this.form1.shipperId,
  59. shipperName: this.form1.shipperName,
  60. shipperAbbreviation: this.form1.shipperAbbreviation,
  61. shipperCompanyBranch:this.form1.shipperCompanyBranch,
  62. shipperBranchFactory:this.form1.shipperBranchFactory
  63. };
  64. if(
  65. RmsShipper.shipperName==null ||
  66. RmsShipper.shipperAbbreviation ==null ||
  67. RmsShipper.shipperCompanyBranch ==null ||
  68. RmsShipper.shipperBranchFactory ==null
  69. )this.$message.error("存在空值!");
  70. this.axios
  71. .post(
  72. "/api/v1/rms/updateShipper",
  73. RmsShipper
  74. )
  75. .then((res) => {
  76. if (res.data.code == "200") {
  77. this.$router.go(-1);
  78. }
  79. });
  80. },
  81. },
  82. };
  83. </script>
  84. <style lang='scss' scoped>
  85. .form-box,
  86. .button-box{
  87. display: flex;
  88. justify-content: center;
  89. .el-button{
  90. width: 80px;
  91. margin-right: 10px;
  92. }
  93. }
  94. .button-box{
  95. display: flex;
  96. justify-items: center;
  97. margin-left: 0rem;
  98. }
  99. </style>