DocumentSource.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="单据来源" @clickLeft="back">
  4. <!--右菜单-->
  5. <template slot="float">
  6. <view class="nav-icon-caozuo rightNav" @click="getsure"><u-button type="success" size="small" class="u-reset-button" text="确定"></u-button></view>
  7. </template>
  8. </uni-nav-bar>
  9. <view class="listBox">
  10. <view class="itemBox" v-for="(item, index) in listData" :key="index" @click="cleanchecked(index)">
  11. <view class="chooseBox"> <uni-icons :type="choose===index?'checkbox-filled':'circle'" size="28" :color="choose===index?'#19be6b':'#eee'"></uni-icons></view>
  12. <view class="infoBox">
  13. <view class="tit u-line-1">配置采购 {{item.title}}</view>
  14. <text class="tip">{{item.name}} {{item.department}}</text>
  15. </view>
  16. <view class="stateBox">
  17. <view class="tit">{{item.state==1?'已创建':'未创建'}}</view>
  18. <text class="tip">{{item.time}}</text>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import { post } from "@/utils/api.js";
  26. export default {
  27. name:"DocumentSource",
  28. data() {
  29. return {
  30. listData:[
  31. {
  32. title:'YQ56336325222001',
  33. name:'张三',
  34. department:'省事务管理局',
  35. state:1,
  36. time:'2021-11-06 18:00'
  37. },
  38. {
  39. title:'YQ56336325222001',
  40. name:'张三',
  41. department:'省事务管理局',
  42. state:1,
  43. time:'2021-11-06 18:00'
  44. },
  45. {
  46. title:'YQ56336325222001',
  47. name:'张三',
  48. department:'省事务管理局',
  49. state:1,
  50. time:'2021-11-06 18:00'
  51. },
  52. {
  53. title:'YQ56336325222001',
  54. name:'张三',
  55. department:'省事务管理局',
  56. state:1,
  57. time:'2021-11-06 18:00'
  58. },
  59. {
  60. title:'YQ56336325222001',
  61. name:'张三',
  62. department:'省事务管理局',
  63. state:1,
  64. time:'2021-11-06 18:00'
  65. },
  66. {
  67. title:'YQ56336325222001',
  68. name:'张三',
  69. department:'省事务管理局',
  70. state:1,
  71. time:'2021-11-06 18:00'
  72. },
  73. {
  74. title:'YQ56336325222001',
  75. name:'张三',
  76. department:'省事务管理局',
  77. state:1,
  78. time:'2021-11-06 18:00'
  79. },
  80. {
  81. title:'YQ56336325222001',
  82. name:'张三',
  83. department:'省事务管理局',
  84. state:1,
  85. time:'2021-11-06 18:00'
  86. },
  87. {
  88. title:'YQ56336325222001',
  89. name:'张三',
  90. department:'省事务管理局',
  91. state:1,
  92. time:'2021-11-06 18:00'
  93. },
  94. {
  95. title:'YQ56336325222001',
  96. name:'张三',
  97. department:'省事务管理局',
  98. state:1,
  99. time:'2021-11-06 18:00'
  100. },
  101. {
  102. title:'YQ56336325222001',
  103. name:'张三',
  104. department:'省事务管理局',
  105. state:1,
  106. time:'2021-11-06 18:00'
  107. },
  108. {
  109. title:'YQ56336325222001',
  110. name:'张三',
  111. department:'省事务管理局',
  112. state:1,
  113. time:'2021-11-06 18:00'
  114. }
  115. ], //列表数据
  116. screenHeight:'', //设备高度
  117. choose:'', //选择id
  118. chooseItem:{} //传参信息
  119. };
  120. },
  121. onLoad(){
  122. // 获取屏幕高度
  123. uni.getSystemInfo({
  124. success(res) {
  125. this.screenHeight = (res.screenHeight * (750 / res.windowWidth));
  126. }
  127. });
  128. },
  129. //加载更多
  130. onReachBottom(){
  131. console.log("加载更多");
  132. },
  133. methods: {
  134. //确定
  135. getsure() {
  136. console.log("点击确定");
  137. uni.$emit('updateData', this.chooseItem);
  138. uni.navigateBack({
  139. delta: 1
  140. })
  141. },
  142. cleanchecked(e){
  143. this.choose = e;
  144. this.chooseItem = this.listData[e];
  145. },
  146. }
  147. }
  148. </script>
  149. <style lang="scss" scoped>
  150. .itemBox{
  151. padding:30rpx 20rpx;
  152. display: flex;
  153. font-size: $uni-font-size-base;
  154. border-bottom: 1px #f2f2f2 solid;
  155. .chooseBox{
  156. margin-right: 20rpx;
  157. }
  158. .infoBox{
  159. .tit{max-width:100%;overflow: hidden;}
  160. .tip{
  161. color: #999;
  162. font-size: $uni-font-size-sm;
  163. }
  164. }
  165. .stateBox{
  166. margin-left: auto;
  167. text-align: right;
  168. .tit{
  169. }
  170. .tip{
  171. color: #999;
  172. font-size: $uni-font-size-sm;
  173. }
  174. }
  175. }
  176. </style>