historicalNotesDlg.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <div class="container container-historical-notes-dlg">
  3. <el-dialog title="历史备注" :visible.sync="historicalNotesDlgVisible" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleClose">
  4. <div>
  5. <p class="title">添加备注</p>
  6. <el-input type="textarea" :rows="2" placeholder="请输入备注内容" v-model="textarea"> </el-input>
  7. <el-button style="margin: 20px 0" type="primary" @click="addHistoricalNotes">保存</el-button>
  8. </div>
  9. <div>
  10. <el-table :data="tableData" style="width: 100%; margin-bottom: 20px" border height="400">
  11. <el-table-column align="center" prop="Content" label="记录内容" width="180"> </el-table-column>
  12. <el-table-column align="center" prop="RemarkType" label="备注类型"> </el-table-column>
  13. <el-table-column align="center" prop="SysAdminName" label="创建人"> </el-table-column>
  14. <el-table-column align="center" prop="CreateTime" label="创建时间" width="200"> </el-table-column>
  15. </el-table>
  16. </div>
  17. </el-dialog>
  18. </div>
  19. </template>
  20. <script>
  21. import { dataMainInterface } from "@/api/api.js";
  22. export default {
  23. name: "",
  24. props: {
  25. historicalNotesDlgVisible: {
  26. type: Boolean,
  27. default: false,
  28. },
  29. CompanyId: {
  30. type: Number,
  31. default: 0,
  32. },
  33. },
  34. data() {
  35. return {
  36. tableData: [],
  37. textarea: "",
  38. dialogVisible: true,
  39. };
  40. },
  41. watch: {
  42. historicalNotesDlgVisible: {
  43. handler(newVal) {
  44. if (newVal) {
  45. this.getDataList();
  46. }
  47. },
  48. },
  49. },
  50. methods: {
  51. // 获取列表
  52. async getDataList() {
  53. const res = await dataMainInterface.getRaiServeRemarkList({
  54. CompanyId: this.CompanyId,
  55. });
  56. if (res.Ret === 200) {
  57. this.tableData = res.Data.List || [];
  58. }
  59. },
  60. // 新增历史留言
  61. async addHistoricalNotes() {
  62. const res = await dataMainInterface.getRaiServeRemarkAdd({
  63. CompanyId: this.CompanyId,
  64. Content: this.textarea,
  65. });
  66. if (res.Ret === 200) {
  67. this.textarea = "";
  68. this.$message.success("新增成功");
  69. this.getDataList();
  70. }
  71. },
  72. // 关闭弹框
  73. handleClose() {
  74. this.$emit("update:historicalNotesDlgVisible", false);
  75. this.$emit("update:CompanyId", 0);
  76. },
  77. },
  78. };
  79. </script>
  80. <style scoped lang="scss">
  81. .container-historical-notes-dlg {
  82. .title {
  83. font-weight: 600;
  84. margin-bottom: 10px;
  85. }
  86. }
  87. </style>