addRmsShipper.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <!-- 添加托运人信息 -->
  3. <div class="addWagonLoad">
  4. <PageTitle>返回</PageTitle>
  5. <el-divider content-position="left">托运人信息</el-divider>
  6. <div class="form-box" style="margin-right: 10rem">
  7. <!-- 323 -->
  8. <dil-form :formId="323" v-model="form1" ref="from1"></dil-form>
  9. </div>
  10. <div class="button-box">
  11. <el-button @click="cancel">取消</el-button>
  12. <el-button type="primary" @click="makeSure">确定</el-button>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import PageTitle from "@/components/Page/Title";
  18. export default {
  19. components: { PageTitle },
  20. data() {
  21. return {
  22. form1: {},
  23. value: undefined,
  24. shipperName:"四川达钢",
  25. shipperAbbreviation:"四川达钢"
  26. };
  27. },
  28. mounted() {
  29. this.form1.shipperName = this.shipperName;
  30. this.form1.shipperAbbreviation = this.shipperAbbreviation;
  31. },
  32. methods: {
  33. makeSure() {
  34. console.log(this.form1)
  35. let RmsShipper={
  36. shipperName: this.form1.shipperName,
  37. shipperAbbreviation: this.form1.shipperAbbreviation,
  38. shipperId:this.form1.shipperId,
  39. shipperCompanyBranch:this.form1.shipperCompanyBranch,
  40. shipperBranchFactory:this.form1.shipperBranchFactory
  41. };
  42. if(
  43. RmsShipper.shipperName==null ||
  44. RmsShipper.shipperAbbreviation ==null ||
  45. RmsShipper.shipperCompanyBranch ==null ||
  46. RmsShipper.shipperBranchFactory ==null
  47. )this.$message.error("存在空值!");
  48. else
  49. this.axios
  50. .post(
  51. "/api/v1/rms/insertShipper",
  52. RmsShipper
  53. )
  54. .then((res) => {
  55. if (res.data.code == 200) {
  56. this.$message({
  57. type: "success",
  58. message: "新增成功!",
  59. });
  60. // this.$refs.table.refreshData();
  61. this.$router.go(-1);
  62. } else {
  63. this.$message.error("新增失败,可能存在重复!");
  64. }
  65. this.$refs['table'].resetField();
  66. });
  67. },
  68. // 取消
  69. cancel() {
  70. this.$router.go(-1);
  71. },
  72. },
  73. };
  74. </script>
  75. <style lang='scss' >
  76. .button-box{
  77. display: flex;
  78. text-align: center;
  79. align-items: center;
  80. justify-content: center;
  81. margin-top: 0.3125rem;
  82. margin-bottom: 1.25rem;
  83. }
  84. .form-box{
  85. display: flex;
  86. justify-content: center;
  87. .el-form-item{
  88. display: flex;
  89. justify-content: center;
  90. .el-form-item__label{
  91. display: flex;
  92. align-items: center;
  93. }
  94. .el-form-item__content{
  95. .el-input{
  96. .el-input__inner{
  97. width: 250px;
  98. }
  99. }
  100. }
  101. }
  102. }
  103. </style>