arapRemarks.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <div>
  3. <BaseDialog
  4. width="600px"
  5. :isShow.sync="isShow"
  6. title="修改备注"
  7. @submit="submitForm"
  8. >
  9. <el-input
  10. :rows="6"
  11. type="textarea"
  12. placeholder="请输入备注"
  13. v-model="value"
  14. ></el-input>
  15. </BaseDialog>
  16. </div>
  17. </template>
  18. <script>
  19. import { updateRemark, updateMonthRemark } from "@/api/financed/index";
  20. export default {
  21. name: "remarks",
  22. props: {
  23. dialogVisible: {
  24. type: Boolean,
  25. default: false,
  26. },
  27. info: {
  28. type: Object,
  29. default: () => {
  30. return {};
  31. },
  32. },
  33. },
  34. data() {
  35. return {
  36. value: "",
  37. };
  38. },
  39. mounted() {},
  40. methods: {
  41. init() {
  42. this.value = this.info.remark;
  43. },
  44. submitForm() {
  45. let { orderSn, id } = this.info;
  46. let fn = orderSn ? updateRemark : updateMonthRemark;
  47. fn({
  48. orderSn: orderSn,
  49. remark: this.value,
  50. id: id,
  51. }).then((res) => {
  52. this.$message.success("修改备注成功");
  53. this.isShow = false;
  54. this.info.remark = this.value;
  55. // this.$emit("search");
  56. });
  57. },
  58. },
  59. computed: {
  60. isShow: {
  61. get() {
  62. if (this.dialogVisible) {
  63. this.init();
  64. }
  65. return this.dialogVisible;
  66. },
  67. set(val) {
  68. this.$emit("update:dialogVisible", false);
  69. },
  70. },
  71. },
  72. };
  73. </script>
  74. <style lang="scss" scoped></style>