index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  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,getTechnologicalProcess} 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 technologicalProcessId = ref("")
  34. const drawingList = ref([])
  35. const processCode = ref("")
  36. const productId = ref("")
  37. const product = ref({})
  38. const lotCode = ref("")
  39. const processAlias = ref("")
  40. onLoad((options) => {
  41. console.log(options,1111)
  42. technologicalProcessId.value = options.param4
  43. lotCode.value = options.param2
  44. productId.value = options.param1
  45. processCode.value = options.param3
  46. processAlias.value = options.param5
  47. init();
  48. })
  49. function init() {
  50. console.log(product.value)
  51. getTechnologicalProcess(technologicalProcessId.value).then(response=>{
  52. console.log(response,1123)
  53. if(response.code ==200){
  54. product.value = response.data
  55. product.value.lotCode = lotCode.value
  56. product.value.processAlias = processAlias.value
  57. getDrawingList({productVersion:product.value.technologyVersion,processCode:processCode.value,productId:productId.value}).then(res=>{
  58. if(res.code == 200){
  59. drawingList.value = res.data
  60. // product.value = drawingList.value[0].product
  61. // product.value.technologyVersion = drawingList.value[0].technologyVersion
  62. // product.value.processAlias = drawingList.value[0].processAlias
  63. // product.value.lotCode = lotCode.value
  64. }
  65. })
  66. }
  67. })
  68. }
  69. function handleOpenDrawing(row){
  70. // 检查 filteredProcess 是否有元素,并选择第一个元素
  71. var encodeUrl = row.url;
  72. console.log(row)
  73. // 构建查询参数字符串
  74. var queryParam = `param1=${encodeUrl}`;
  75. // 使用模板字符串构建完整的URL
  76. var navigateUrl = `/pages/pdfviewer/index?${queryParam}`;
  77. // 导航到指定页面
  78. uni.navigateTo({
  79. url: navigateUrl
  80. });
  81. }
  82. </script>
  83. <style lang="scss">
  84. .container {
  85. height: 100%;
  86. background-color: #f5f5f5;
  87. }
  88. .middle {
  89. display: flex;
  90. flex-direction: row;
  91. align-items: center;
  92. justify-content: center;
  93. margin-top: 20rpx;
  94. }
  95. .scroll-container {
  96. position: absolute;
  97. top: 24rpx;
  98. right: 0;
  99. bottom: 160rpx;
  100. left: 0;
  101. }
  102. .segment {
  103. width: 280rpx;
  104. background-color: rgba(213, 213, 213, 1);
  105. border: 1rpx solid rgba(213, 213, 213, 1);
  106. }
  107. .selected {
  108. border: 1px solid #1684fc;
  109. }
  110. .margenTop{
  111. margin: 20rpx;
  112. }
  113. .list-item {
  114. background-color: #fff;
  115. position: relative;
  116. padding: 16rpx;
  117. padding-bottom: 24rpx;
  118. margin: 0 24rpx;
  119. margin-bottom: 24rpx;
  120. border-radius: 8rpx;
  121. .title-container {
  122. justify-content: space-between;
  123. margin-top: 8rpx;
  124. margin-bottom: 16rpx;
  125. .title {
  126. height: 48rpx;
  127. align-items: center;
  128. .label {
  129. color: #1684fc;
  130. font-size: 32rpx;
  131. font-weight: bold;
  132. &.code {
  133. color: #000000;
  134. margin-left: 32rpx;
  135. }
  136. }
  137. }
  138. }
  139. .item-info {
  140. margin-bottom: 16rpx;
  141. .label {
  142. font-size: 28rpx;
  143. width: 152rpx;
  144. color: #808080;
  145. &.right {
  146. flex: 1;
  147. color: #808080;
  148. }
  149. }
  150. }
  151. .right-info {
  152. justify-content: flex-end;
  153. margin-top: 2rpx;
  154. .label {
  155. font-size: 28rpx;
  156. color: #ff0000;
  157. }
  158. }
  159. }
  160. .bottom {
  161. position: fixed;
  162. right: 0;
  163. bottom: 0;
  164. left: 0;
  165. height: 100rpx;
  166. padding: 16rpx 24rpx;
  167. align-items: center;
  168. background-color: #FFFFFF;
  169. justify-content: space-between;
  170. .bottom-btn {
  171. flex: 1;
  172. font-size: 28rpx;
  173. color: #FFFFFF;
  174. &.left-btn {
  175. background-color: #1684fc;
  176. }
  177. &.right-btn {
  178. background-color: rgb(255, 121, 1);
  179. margin-left: 24rpx;
  180. }
  181. }
  182. }
  183. </style>