index.vue 5.6 KB

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