arapRemarks.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.$emit("search");
  55. });
  56. },
  57. },
  58. computed: {
  59. isShow: {
  60. get() {
  61. if (this.dialogVisible) {
  62. this.init();
  63. }
  64. return this.dialogVisible;
  65. },
  66. set(val) {
  67. this.$emit("update:dialogVisible", false);
  68. },
  69. },
  70. },
  71. };
  72. </script>
  73. <style lang="scss" scoped></style>