track-form.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view class="track-form">
  3. <view class="header">
  4. <view class="line"></view>
  5. <text class="title">新增跟进记录</text>
  6. </view>
  7. <view class="field">
  8. <text class="label">任务详情</text>
  9. <u-textarea v-model="content" placeholder="请输入" :height="120" :autoHeight="true"></u-textarea>
  10. </view>
  11. <view class="field">
  12. <text class="label">上传图片</text>
  13. <cy-upload :filename="files" @update:filename="files = $event" @update:loading="uploading = $event" />
  14. </view>
  15. <view class="actions">
  16. <u-button type="primary" :loading="uploading" :disabled="uploading || submitting" @click="submit">跟进</u-button>
  17. </view>
  18. </view>
  19. </template>
  20. <script setup>
  21. import { ref } from 'vue'
  22. import CyUpload from '@/components/cy-upload/index.vue'
  23. const emit = defineEmits(['submit'])
  24. const content = ref('')
  25. const files = ref([])
  26. const uploading = ref(false)
  27. const submitting = ref(false)
  28. const submit = () => {
  29. if (uploading.value || submitting.value) return
  30. submitting.value = true
  31. emit('submit', { content: content.value, files: files.value })
  32. content.value = ''
  33. files.value = []
  34. submitting.value = false
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .track-form {
  39. background: #ffffff;
  40. border-radius: 12rpx;
  41. padding: 24rpx;
  42. }
  43. .header {
  44. display: flex;
  45. align-items: center;
  46. gap: 12rpx;
  47. margin-bottom: 12rpx;
  48. }
  49. .line {
  50. width: 8rpx;
  51. height: 32rpx;
  52. background: #22ac38;
  53. border-radius: 4rpx;
  54. }
  55. .title {
  56. font-size: 30rpx;
  57. color: #333333;
  58. }
  59. .field {
  60. margin-top: 16rpx;
  61. }
  62. .label {
  63. display: block;
  64. font-size: 28rpx;
  65. color: #666666;
  66. margin-bottom: 8rpx;
  67. }
  68. .actions {
  69. display: flex;
  70. justify-content: flex-end;
  71. margin-top: 20rpx;
  72. }
  73. </style>