consultation.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="page-container uni-column">
  3. <view class="consultation-container uni-column">
  4. <view class="title uni-row">咨询</view>
  5. <view class="info-row uni-row">
  6. <view class="label">批次号</view>
  7. <view class="value">{{ dayworkItem.lotCode }}</view>
  8. </view>
  9. <view class="info-row uni-row">
  10. <view class="label">产品描述</view>
  11. <view class="value">{{ dayworkItem.productDescription }}</view>
  12. </view>
  13. <view class="info-row uni-row">
  14. <view class="label">技术负责人</view>
  15. <view class="value">{{ dayworkItem.technicianName }}</view>
  16. </view>
  17. <view class="info-row uni-column">
  18. <view class="label" style="margin-bottom: 16rpx;">问题描述</view>
  19. <view class="value uni-row">
  20. <textarea v-model="data.content"></textarea>
  21. </view>
  22. </view>
  23. <view class="btn uni-row" @click.stop="handleSubmit">提交</view>
  24. </view>
  25. </view>
  26. </template>
  27. <script setup>
  28. import {
  29. ref
  30. } from 'vue'
  31. import {
  32. onLoad,
  33. onReady,
  34. onUnload,
  35. onShow
  36. } from '@dcloudio/uni-app'
  37. import {
  38. onMounted,
  39. getCurrentInstance
  40. } from 'vue';
  41. const dayworkItem = ref({})
  42. const data = ref({
  43. content: ''
  44. })
  45. onMounted(() => {
  46. const instance = getCurrentInstance().proxy
  47. const eventChannel = instance.getOpenerEventChannel();
  48. eventChannel.on('acceptDataFromOpenerPage', function(data) {
  49. console.log('acceptDataFromOpenerPage', data)
  50. // 传入当前报工信息 通过当前报工的产品和工序获取检查指导书和分选标准
  51. if (data && data.data) {
  52. dayworkItem.value = data.data
  53. }
  54. })
  55. })
  56. // 页面生命周期函数
  57. onLoad(() => {
  58. })
  59. const handleSubmit = () => {
  60. if (data.value.content == null || data.value.content == '') {
  61. uni.showToast({
  62. icon: 'none',
  63. title: '请输入问题描述'
  64. })
  65. return
  66. }
  67. uni.$emit('addConsulttationEvent', {
  68. content: data.value.content
  69. })
  70. uni.navigateBack()
  71. }
  72. </script>
  73. <style lang="scss">
  74. .page-container {
  75. height: 100%;
  76. background-color: #ececec;
  77. font-size: 28rpx;
  78. padding: 24rpx;
  79. box-sizing: border-box;
  80. }
  81. .consultation-container {
  82. background-color: #ffffff;
  83. padding: 24rpx;
  84. border-radius: 12rpx;
  85. .title {
  86. justify-content: center;
  87. font-size: 32rpx;
  88. font-weight: 700;
  89. }
  90. .info-row {
  91. margin-top: 24rpx;
  92. .label {
  93. width: 160rpx;
  94. }
  95. .value {
  96. flex: 1;
  97. textarea {
  98. flex: 1;
  99. border: 1px solid #888888;
  100. box-sizing: border-box;
  101. padding: 16rpx;
  102. }
  103. }
  104. }
  105. .btn {
  106. background-color: #00D068;
  107. color: #ffffff;
  108. border-radius: 8rpx;
  109. margin: 24rpx;
  110. height: 64rpx;
  111. justify-content: center;
  112. align-items: center;
  113. }
  114. }
  115. </style>