consultation.vue 2.3 KB

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