index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view class="page-container uni-column">
  3. <view class="search-container uni-row">
  4. <input type="text" v-model="keywords" placeholder="请输入关键字" />
  5. <view class="btn uni-row">搜索</view>
  6. <!-- <uni-icons type="scan" size="24" /> -->
  7. </view>
  8. <view class="scan-btn uni-row" @click.stop="handleAddProcessInspection">新增序检</view>
  9. <view class="daywork-item uni-column" v-for="(item, index) in dayworkList" :key="index">
  10. <view class="lot-code uni-row">
  11. <text>批次号:{{ item.lot_code }}</text>
  12. <uni-icons type="right" size="16" />
  13. </view>
  14. <view class="info">
  15. <view class="info-row uni-row">
  16. <view class="label">序检箱号:</view>
  17. <view class="value">{{ item.carrier_code }}</view>
  18. <view class="label">检察员:</view>
  19. <view class="value">{{ item.inspector }}</view>
  20. </view>
  21. <view class="info-row uni-row">
  22. <view class="label">检查数量:</view>
  23. <view class="value">{{ item.checks_number }}</view>
  24. <view class="label">不合格数:</view>
  25. <view class="value">{{ item.unacceptable_amount }}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script setup>
  32. import { ref } from 'vue'
  33. import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
  34. const keywords = ref('')
  35. const dayworkList = ref([])
  36. /***************************** 页面生命周期函数 *****************************/
  37. onShow(() => {
  38. dayworkList.value = [
  39. {
  40. lot_code: 'D2423156000691',
  41. carrier_code: '000010',
  42. inspector: '张蕾',
  43. checks_number: 20,
  44. unacceptable_amount: 3
  45. },
  46. {
  47. lot_code: 'D2423156000691',
  48. carrier_code: '000010',
  49. inspector: '张蕾',
  50. checks_number: 20,
  51. unacceptable_amount: 3
  52. }
  53. ]
  54. })
  55. /***************************** 定义了一些方法 *****************************/
  56. const addProcessInspection = (data) => {
  57. const info = {
  58. title: data.title,
  59. standard: data.standard,
  60. result: '',
  61. number: 1
  62. }
  63. unfitInfos.value.push(info)
  64. }
  65. /***************************** 定义了一些事件 *****************************/
  66. // 新增序检
  67. const handleAddProcessInspection = () => {
  68. uni.navigateTo({
  69. url: '/pages/processInspection/scan'
  70. })
  71. }
  72. // 添加不合格信息
  73. const handleShowUnfit = () => {
  74. uni.navigateTo({
  75. url: '/pages/processInspection/form'
  76. })
  77. }
  78. </script>
  79. <style lang="scss">
  80. .page-container {
  81. height: 100%;
  82. background-color: #ececec;
  83. font-size: 28rpx;
  84. padding: 24rpx;
  85. box-sizing: border-box;
  86. }
  87. .search-container {
  88. border-radius: 12rpx;
  89. align-items: center;
  90. input {
  91. flex: 1;
  92. background-color: #ffffff;
  93. height: 64rpx;
  94. box-sizing: border-box;
  95. padding: 0 16rpx;
  96. }
  97. .btn {
  98. width: 120rpx;
  99. height: 64rpx;
  100. background-color: #1684FC;
  101. justify-content: center;
  102. font-size: 24rpx;
  103. color: #ffffff;
  104. justify-content: center;
  105. align-items: center;
  106. }
  107. }
  108. .scan-btn {
  109. height: 64rpx;
  110. margin: 32rpx 32rpx 0 32rpx;
  111. color: #ffffff;
  112. background-color: #f47c3c;
  113. align-items: center;
  114. justify-content: center;
  115. border-radius: 8rpx;
  116. }
  117. .daywork-item {
  118. padding: 24rpx;
  119. background-color: #ffffff;
  120. margin-top: 24rpx;
  121. border-radius: 8rpx;
  122. .lot-code {
  123. align-items: center;
  124. justify-content: space-between;
  125. font-weight: 700;
  126. }
  127. .info {
  128. font-size: 24rpx;
  129. color: #767676;
  130. .info-row {
  131. margin-top: 16rpx;
  132. .label {
  133. width: 120rpx;
  134. }
  135. .value {
  136. flex: 1;
  137. }
  138. }
  139. }
  140. }
  141. </style>