index.vue 5.2 KB

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