addRemark.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div>
  3. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  4. <el-form-item label="备注" prop="remark">
  5. <el-input :rows="2" v-model="form.remark" type="textarea" placeholder="请输入内容" />
  6. </el-form-item>
  7. </el-form>
  8. <div class="footer">
  9. <el-button type="primary" @click="submitForm">确 定</el-button>
  10. </div>
  11. </div>
  12. </template>
  13. <script>
  14. import { updateCustomer } from "@/api/crm/customer";
  15. export default {
  16. name: "remark",
  17. data() {
  18. return {
  19. form: {
  20. customerId:null,
  21. remark:null,
  22. },
  23. // 表单校验
  24. rules: {
  25. remark: [
  26. { required: true, message: "备注不能为空", trigger: "change" }
  27. ],
  28. }
  29. };
  30. },
  31. created() {
  32. },
  33. methods: {
  34. reset(customer) {
  35. this.form.customerId=customer.customerId;
  36. this.form.remark=customer.remark;
  37. },
  38. submitForm() {
  39. this.$refs["form"].validate(valid => {
  40. if (valid) {
  41. updateCustomer(this.form).then(response => {
  42. if (response.code === 200) {
  43. this.msgSuccess("操作成功");
  44. this.$emit('close');
  45. }
  46. });
  47. }
  48. });
  49. },
  50. }
  51. };
  52. </script>
  53. <style lang="scss" scoped>
  54. .contents{
  55. height: 100%;
  56. background-color: #fff;
  57. padding: 20px;
  58. }
  59. .footer{
  60. display: flex;
  61. align-items: center;
  62. justify-content: flex-end;
  63. }
  64. </style>