clientNotice.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. //公告管理
  2. <template>
  3. <div class="notice">
  4. <div class="sache">
  5. <el-input
  6. placeholder="请输入内容"
  7. v-model="textInput"
  8. clearable>
  9. </el-input>
  10. <el-button type="primary" class="btn" @click="onclick">
  11. <i class="el-icon-search"></i>查询
  12. </el-button>
  13. <el-button type="primary" class="btn" @click="toInsert">
  14. <i class="el-icon-plus"></i>新增
  15. </el-button>
  16. </div>
  17. <div class="table">
  18. <dilTable v-bind.sync="options">
  19. <el-table-column fixed="right" label="操作" width="120" header-align="center">
  20. <template slot-scope="scope">
  21. <el-button
  22. type="text"
  23. size="small"
  24. @click="noticeDetail(scope)"
  25. >
  26. 详情
  27. </el-button>
  28. <el-button
  29. type="text"
  30. size="small"
  31. @click="updateNotice(scope)"
  32. >
  33. 修改
  34. </el-button>
  35. <el-button
  36. type="text"
  37. size="mini"
  38. @click="deleteNotice(scope)"
  39. >
  40. 删除
  41. </el-button>
  42. </template>
  43. </el-table-column>
  44. </dilTable>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. export default {
  50. name:"homeworkPath",
  51. data(){
  52. return{
  53. textInput: "" ,
  54. restaurants: [],
  55. options:{
  56. // first请求数据的地址
  57. requestUrl: "/api/v1/ams/getClientNoticeList?apiId=414",
  58. },
  59. }
  60. },
  61. methods:{
  62. onclick(){
  63. this.options.requestUrl = "/api/v1/ams/getClientNoticeList?apiId=414&con="+this.textInput;
  64. },
  65. CarrierNotice() {
  66. this.$router.push("/addNotice");
  67. },
  68. /*新增通知*/
  69. toInsert() {
  70. this.$router.push("/addNotice");
  71. },
  72. /*通知详情*/
  73. noticeDetail(scope) {
  74. console.log(scope.row.noticeId)
  75. this.$router.push("/getNoticeById/"+scope.row.noticeId)
  76. },
  77. /*这里要改一改*/
  78. updateNotice(scope){
  79. console.log(scope.row.noticeId)
  80. this.$router.push("/editNotice/"+scope.row.noticeId)
  81. },
  82. deleteNotice(scope){
  83. console.log(scope)
  84. this.$confirm("是否删除", "提示", {
  85. confirmButtonText: "确定",
  86. cancelButtonText: "取消",
  87. type: "warning",
  88. center: true,
  89. })
  90. .then(() => {
  91. console.log("enter")
  92. this.axios
  93. .post("/api/v1/ams/deleteNotice/" + scope.row.noticeId)
  94. .then((res) => {
  95. console.log("res.data.code",res.data.code);
  96. if (res.data.code == 200) {
  97. this.$message({
  98. type: "success",
  99. message: "删除成功!",
  100. });
  101. this.$router.go(0);
  102. } else {
  103. this.$message({
  104. message: "删除失败",
  105. type: "warning",
  106. });
  107. }
  108. });
  109. })
  110. .catch(() => {
  111. this.$message({
  112. type: "info",
  113. message: "删除操作已取消!",
  114. });
  115. });
  116. },
  117. },
  118. }
  119. </script>
  120. <style lang="scss" scode>
  121. .notice{
  122. .sache{
  123. padding: 1.25rem 0.375rem;
  124. .el-input {
  125. width: 20%;
  126. margin-right: 1.25rem;
  127. }
  128. }
  129. }
  130. </style>