editNotice.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <!-- 修改通知信息 -->
  3. <div id="contractDetails">
  4. <page-title>编辑</page-title>
  5. <div class="main">
  6. <span class="text">通知信息</span>
  7. </div>
  8. <div class="contractTitle">
  9. <div class="form-box">
  10. <div class="form-one">
  11. <dil-form :formId="369" v-model="form1"></dil-form>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="button-box">
  16. <el-button type="primary" @click="onClickConfirm">确认</el-button>
  17. <el-button @click="onClickCancel">返回</el-button>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import PageTitle from "@/components/Page/Title";
  23. export default {
  24. components: { PageTitle },
  25. data() {
  26. return {
  27. form1: {},
  28. };
  29. },
  30. mounted() {
  31. console.log(this.$route)
  32. this.information();
  33. },
  34. methods: {
  35. information() {
  36. //编辑
  37. this.axios
  38. .post(
  39. "/api/v1/ams/getNoticeById/" +
  40. this.$route.params.noticeId
  41. )
  42. .then((res) => {
  43. console.log(res)
  44. res.data.data.forEach((e) => {
  45. this.form1 = e;
  46. console.log(e);
  47. console.log(this.form1);
  48. console.log(this.$route.params.noticeId);
  49. });
  50. });
  51. },
  52. // 返回
  53. onClickCancel() {
  54. this.$router.go(-1);
  55. },
  56. // 确认
  57. onClickConfirm() {
  58. console.log(this.form1)
  59. let DilNotice = {
  60. noticeId:this.form1.noticeId,
  61. insertTime:this.form1.insertTime,
  62. insertUsername:this.form1.insertUsername,
  63. noticeContent:this.form1.noticeContent,
  64. };
  65. this.axios
  66. .post(
  67. "/api/v1/ams/updateNotice",
  68. DilNotice
  69. )
  70. .then((res) => {
  71. if (res.data.code == "200") {
  72. this.$router.go(-1);
  73. }
  74. });
  75. },
  76. },
  77. };
  78. </script>
  79. <style lang="scss" scoped>
  80. .form-box,
  81. .from {
  82. display: flex;
  83. align-items: center;
  84. justify-content: center;
  85. margin-top: 5px;
  86. margin-bottom: 20px;
  87. }
  88. .button-box{
  89. display: flex;
  90. text-align: center;
  91. align-items: center;
  92. justify-content: center;
  93. margin-top: 0.3125rem;
  94. margin-bottom: 1.25rem;
  95. }
  96. </style>
  97. <style>
  98. .el-textarea__inner{
  99. /* width: 300px !important;*/
  100. min-height:250px !important;
  101. }
  102. </style>