index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view class="uni-column container">
  3. <view style="margin: 12rpx;">
  4. <view class="margenTop" style="font-size: 30rpx;font-weight: bold;">批次号:{{product.lotCode}}</view>
  5. <view class="margenTop" style="font-size: 30rpx;font-weight: bold;">产品描述:{{product.productDescription}}</view>
  6. <view class="margenTop" style="font-size: 30rpx;font-weight: bold; flex-direction: row;">
  7. <view >工艺版本:{{product.technologyVersion}}</view>
  8. <view style="margin-left: 200rpx;" >工序:{{product.processAlias}}</view>
  9. </view>
  10. </view>
  11. <view class='middle'>
  12. <view class='segment'></view>
  13. <uni-icons type="paperclip" size="30" ></uni-icons>
  14. <view class='segment'></view>
  15. </view>
  16. <view style="overflow: auto;">
  17. <view :class="{'list-container':true}"
  18. v-for="(item, index) in drawingList" :key="item.id">
  19. <view ><text style="text-align: center; font-size: 28rpx; padding: 48rpx 0 24rpx 0;color: #1684fc;" @click="handleOpenDrawing(item)">{{item.drawingName}}</text></view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script setup>
  25. import{getDrawingList,getProcessDetail} from '@/api/business/drawing.js'
  26. import {
  27. ref
  28. } from 'vue'
  29. import {
  30. onLoad,
  31. } from '@dcloudio/uni-app'
  32. import { store } from '../../store';
  33. const technologicalProcessDetailId = ref("")
  34. const drawingList = ref([])
  35. const product = ref({})
  36. const lotCode = ref("")
  37. onLoad((options) => {
  38. console.log(options,1111)
  39. technologicalProcessDetailId.value = options.param1
  40. lotCode.value = options.param2
  41. init();
  42. })
  43. function init() {
  44. console.log(product.value)
  45. getProcessDetail(technologicalProcessDetailId.value).then(response=>{
  46. console.log(response,1123)
  47. if(response.code ==200){
  48. product.value = response.data
  49. product.value.lotCode = lotCode.value
  50. }
  51. })
  52. getDrawingList({technologicalProcessDetailId:technologicalProcessDetailId.value}).then(res=>{
  53. if(res.code == 200){
  54. drawingList.value = res.data
  55. // product.value = drawingList.value[0].product
  56. // product.value.technologyVersion = drawingList.value[0].technologyVersion
  57. // product.value.processAlias = drawingList.value[0].processAlias
  58. // product.value.lotCode = lotCode.value
  59. }
  60. })
  61. }
  62. function handleOpenDrawing(row){
  63. // 检查 filteredProcess 是否有元素,并选择第一个元素
  64. // 对 technologicalProcessDetailId 进行URL编码
  65. var encodeUrl = row.url;
  66. console.log(row)
  67. // 构建查询参数字符串
  68. var queryParam = `param1=${encodeUrl}`;
  69. // 使用模板字符串构建完整的URL
  70. var navigateUrl = `/pages/pdfviewer/index?${queryParam}`;
  71. // 导航到指定页面
  72. uni.navigateTo({
  73. url: navigateUrl
  74. });
  75. }
  76. </script>
  77. <style lang="scss">
  78. .container {
  79. height: 100%;
  80. background-color: #f5f5f5;
  81. }
  82. .middle {
  83. display: flex;
  84. flex-direction: row;
  85. align-items: center;
  86. justify-content: center;
  87. margin-top: 20rpx;
  88. }
  89. .scroll-container {
  90. position: absolute;
  91. top: 24rpx;
  92. right: 0;
  93. bottom: 160rpx;
  94. left: 0;
  95. }
  96. .segment {
  97. width: 280rpx;
  98. background-color: rgba(213, 213, 213, 1);
  99. border: 1rpx solid rgba(213, 213, 213, 1);
  100. }
  101. .selected {
  102. border: 1px solid #1684fc;
  103. }
  104. .margenTop{
  105. margin: 20rpx;
  106. }
  107. .list-item {
  108. background-color: #fff;
  109. position: relative;
  110. padding: 16rpx;
  111. padding-bottom: 24rpx;
  112. margin: 0 24rpx;
  113. margin-bottom: 24rpx;
  114. border-radius: 8rpx;
  115. .title-container {
  116. justify-content: space-between;
  117. margin-top: 8rpx;
  118. margin-bottom: 16rpx;
  119. .title {
  120. height: 48rpx;
  121. align-items: center;
  122. .label {
  123. color: #1684fc;
  124. font-size: 32rpx;
  125. font-weight: bold;
  126. &.code {
  127. color: #000000;
  128. margin-left: 32rpx;
  129. }
  130. }
  131. }
  132. }
  133. .item-info {
  134. margin-bottom: 16rpx;
  135. .label {
  136. font-size: 28rpx;
  137. width: 152rpx;
  138. color: #808080;
  139. &.right {
  140. flex: 1;
  141. color: #808080;
  142. }
  143. }
  144. }
  145. .right-info {
  146. justify-content: flex-end;
  147. margin-top: 2rpx;
  148. .label {
  149. font-size: 28rpx;
  150. color: #ff0000;
  151. }
  152. }
  153. }
  154. .bottom {
  155. position: fixed;
  156. right: 0;
  157. bottom: 0;
  158. left: 0;
  159. height: 100rpx;
  160. padding: 16rpx 24rpx;
  161. align-items: center;
  162. background-color: #FFFFFF;
  163. justify-content: space-between;
  164. .bottom-btn {
  165. flex: 1;
  166. font-size: 28rpx;
  167. color: #FFFFFF;
  168. &.left-btn {
  169. background-color: #1684fc;
  170. }
  171. &.right-btn {
  172. background-color: rgb(255, 121, 1);
  173. margin-left: 24rpx;
  174. }
  175. }
  176. }
  177. </style>