detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <view>
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" leftText="起重机02563663" @clickLeft="back">
  4. </uni-nav-bar>
  5. <view id="collapseBox">
  6. <!-- <scroll-view :scroll-into-view="pickId" scroll-y="true"> -->
  7. <!-- 基本信息 -->
  8. <uni-collapse ref="collapse-jbxx" id="jbxx">
  9. <uni-collapse-item :open="true" :typeOpen="1" title="基本信息">
  10. <view class="bg">
  11. <DetailMain :detailsInfo="moldsIndfoDetailFn(worksheetInfo)"></DetailMain>
  12. <view class="list-none" @click="showMore" v-if="detailShow">
  13. 查看更多
  14. </view>
  15. <DetailMain v-else :detailsInfo="moldsIndfoDetailFn(worksheetInfo, true)"></DetailMain>
  16. </view>
  17. </uni-collapse-item>
  18. </uni-collapse>
  19. <!-- 模具特有信息 -->
  20. <uni-collapse ref="collapse-tyxx" id="tyxx">
  21. <uni-collapse-item :open="true" :typeOpen="1" title="模具特有信息">
  22. <uni-collapse ref="collapse-tyxx1">
  23. <uni-collapse-item :open="false" :typeOpen="false" titleStyle="background-color: #ffffff">
  24. <OrderDetail slot="typeOpenShow" value1="模具1" value2="TO15546545646" value3="PAU08"
  25. value4="89636">
  26. </OrderDetail>
  27. <view class="mainShow-bg" @click.stop>
  28. <CellInfo v-for="(item,index) in tyxxList" :key="index" :label="item.label"
  29. :value="item.content"></CellInfo>
  30. </view>
  31. </uni-collapse-item>
  32. </uni-collapse>
  33. </uni-collapse-item>
  34. </uni-collapse>
  35. <!-- 牌号型号绑定 -->
  36. <uni-collapse ref="collapse-xhbd" id="xhbd">
  37. <uni-collapse-item :open="true" :typeOpen="1" title="牌号型号绑定">
  38. <uni-collapse ref="collapse">
  39. <uni-collapse-item :open="false" :typeOpen="false" titleStyle="background-color: #ffffff">
  40. <OrderDetail slot="typeOpenShow" value1="常规巡检" value2="TO15546545646" value3="巡检"
  41. value4="20分钟">
  42. </OrderDetail>
  43. <view class="mainShow-bg" @click.stop>
  44. <CellInfo v-for="(item,index) in xhbdList" :key="index" :label="item.label"
  45. :value="item.content"></CellInfo>
  46. </view>
  47. </uni-collapse-item>
  48. </uni-collapse>
  49. </uni-collapse-item>
  50. </uni-collapse>
  51. <!-- 盘点记录 -->
  52. <uni-collapse ref="collapse-pdjl" id="pdjl">
  53. <uni-collapse-item :open="true" :typeOpen="1" title="盘点记录">
  54. <uni-collapse ref="collapse">
  55. <uni-collapse-item :open="false" :typeOpen="false" titleStyle="background-color: #ffffff">
  56. <OrderDetail slot="typeOpenShow" value1="张武山" value2="TO15546545646"
  57. value3="2022-01-22 10:00:00" value4="20分钟"></OrderDetail>
  58. <view class="mainShow-bg" @click.stop>
  59. <CellInfo v-for="(item,index) in pdjlList" :key="index" :label="item.label"
  60. :value="item.content"></CellInfo>
  61. </view>
  62. </uni-collapse-item>
  63. </uni-collapse>
  64. </uni-collapse-item>
  65. </uni-collapse>
  66. <!-- </scroll-view> -->
  67. </view>
  68. <view class="page-bottom"></view>
  69. <view class="page-quickly" @click="setOptionShow">
  70. 导航
  71. </view>
  72. <!-- 进度组件 根据状态显示不同列表 -->
  73. <popupOper :optionShow="optionShow" point="bottom" :operationList="operationList" @operate="operate">
  74. </popupOper>
  75. </view>
  76. </template>
  77. <script>
  78. import {
  79. get
  80. } from "@/utils/api.js"
  81. import {
  82. moldsIndfoDetailFn
  83. } from '@/utils/common.js'
  84. import DetailMain from '@/components/DetailMain.vue'
  85. import CellInfo from '@/components/CellInfo.vue'
  86. import OrderDetail from '../components/OrderDetail.vue'
  87. import PopupOper from '@/components/PopupOper.vue'
  88. export default {
  89. components: {
  90. DetailMain,
  91. OrderDetail,
  92. CellInfo,
  93. PopupOper
  94. },
  95. data() {
  96. return {
  97. pageId: "",
  98. worksheetInfo: null,
  99. moldsIndfoDetailFn,
  100. detailShow: false,
  101. pickId: 'jbxx',
  102. tyxxList: [{
  103. label: '长(mm)',
  104. content: '10'
  105. },
  106. {
  107. label: '宽(mm)',
  108. content: '10'
  109. },
  110. {
  111. label: '高(mm)',
  112. content: '10'
  113. },
  114. {
  115. label: '外径(mm)',
  116. content: '10'
  117. },
  118. {
  119. label: '内径(mm)',
  120. content: '10'
  121. },
  122. {
  123. label: '孔径(mm)',
  124. content: '10'
  125. }
  126. ],
  127. xhpdList: [{
  128. label: '计划单号',
  129. content: '266356'
  130. },
  131. {
  132. label: '巡点检人员',
  133. content: '张三'
  134. },
  135. {
  136. label: '计划创建时间',
  137. content: '2022-01-22 10:00'
  138. },
  139. {
  140. label: '计划下发时间',
  141. content: '2022-01-22 10:00'
  142. },
  143. {
  144. label: '执行开始时间',
  145. content: '2022-01-22 10:00'
  146. },
  147. {
  148. label: '执行结束时间',
  149. content: '2022-01-22 10:00'
  150. },
  151. ],
  152. pdjlList: [{
  153. label: '计划创建时间',
  154. content: '2022-01-22 10:00'
  155. },
  156. {
  157. label: '计划下发时间',
  158. content: '2022-01-22 10:00'
  159. },
  160. {
  161. label: '执行开始时间',
  162. content: '2022-01-22 10:00'
  163. },
  164. {
  165. label: '执行结束时间',
  166. content: '2022-01-22 10:00'
  167. },
  168. ],
  169. optionShow: false,
  170. operationList: [{
  171. title: '基本信息',
  172. type: 'jbxx'
  173. },
  174. {
  175. title: '模具特有信息',
  176. type: 'tyxx'
  177. },
  178. {
  179. title: '牌号型号绑定',
  180. type: 'xhpd'
  181. },
  182. {
  183. title: '盘点记录',
  184. type: 'pdjl'
  185. }
  186. ],
  187. }
  188. },
  189. onLoad(options) {
  190. this.pageId = options.id || 746;
  191. this.getInfo();
  192. },
  193. methods: {
  194. getInfo() {
  195. get(this.apiUrl + "/feature/worksheet/info", {
  196. id: this.pageId
  197. }).then(res => {
  198. console.log(res)
  199. this.worksheetInfo = res.data;
  200. })
  201. },
  202. showMore() {
  203. this.detailShow = !this.detailShow
  204. },
  205. //滑动到指定的节点
  206. operate(type) {
  207. uni.createSelectorQuery().select("#" + type).boundingClientRect(data => { //目标节点、也可以是最外层的父级节点
  208. uni.createSelectorQuery().select("#collapseBox").boundingClientRect((res) => { //最外层盒子节点
  209. let tops = data.top - res.top
  210. uni.pageScrollTo({
  211. duration: 300,
  212. scrollTop: tops, //滚动到实际距离是元素距离顶部的距离减去最外层盒子的滚动距离
  213. })
  214. }).exec()
  215. }).exec();
  216. },
  217. //点击显示弹窗
  218. setOptionShow() {
  219. this.optionShow = !this.optionShow;
  220. },
  221. }
  222. }
  223. </script>
  224. <style lang="scss" scoped>
  225. .mainShow-bg {
  226. background-color: $page-bg;
  227. }
  228. .page-bottom {
  229. height: 160rpx;
  230. }
  231. .page-quickly {
  232. position: fixed;
  233. bottom: 0;
  234. right: 0;
  235. margin: 40rpx;
  236. width: 100rpx;
  237. height: 100rpx;
  238. line-height: 100rpx;
  239. text-align: center;
  240. border-radius: 50%;
  241. background-color: $j-primary-green;
  242. color: #FFFFFF;
  243. font-size: $uni-font-size-base;
  244. }
  245. </style>