track-form.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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"
  17. @click="submit">跟进</u-button>
  18. </view>
  19. </view>
  20. </template>
  21. <script setup>
  22. import { ref } from 'vue'
  23. import CyUpload from '@/components/cy-upload/index.vue'
  24. const emit = defineEmits(['submit'])
  25. const content = ref('')
  26. const files = ref([])
  27. const uploading = ref(false)
  28. const submitting = ref(false)
  29. const submit = () => {
  30. if (uploading.value || submitting.value) return
  31. submitting.value = true
  32. emit('submit', { content: content.value, files: files.value, updateType: 1 })
  33. content.value = ''
  34. files.value = []
  35. submitting.value = false
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .track-form {
  40. background: #ffffff;
  41. border-radius: 12rpx;
  42. padding: 24rpx;
  43. }
  44. .header {
  45. display: flex;
  46. align-items: center;
  47. gap: 12rpx;
  48. margin-bottom: 12rpx;
  49. }
  50. .line {
  51. width: 8rpx;
  52. height: 32rpx;
  53. background: #22ac38;
  54. border-radius: 4rpx;
  55. }
  56. .title {
  57. font-size: 30rpx;
  58. color: #333333;
  59. }
  60. .field {
  61. margin-top: 16rpx;
  62. }
  63. .label {
  64. display: block;
  65. font-size: 28rpx;
  66. color: #666666;
  67. margin-bottom: 8rpx;
  68. }
  69. .actions {
  70. display: flex;
  71. justify-content: flex-end;
  72. margin-top: 20rpx;
  73. }
  74. </style>