productUniversal.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="productPricing-content">
  3. <scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
  4. <view class="st-detailList-main">
  5. <view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id">
  6. <view class="st-detailList-tit">
  7. <text style="font-weight: bold;">{{item.product.name}}</text>
  8. <view class="p-tit-box" v-show="item.titFlag">{{item.product.name}}</view>
  9. <u-tag size="mini" style="margin:10rpx 0 0 20rpx;zoom:0.7;" :type="item.product.onlineFalg==1?'success':'info'" :text="item.product.onlineFalgDictValue"></u-tag>
  10. <copyText :text="item.product.name" style="zoom:0.7;margin-left: 5px;" label="产品名称"></copyText>
  11. </view>
  12. <view class="st-detailList-item-con flex align_center">
  13. <view class="flex_1">
  14. <view class="padding_3">产品编码:{{item.productCode}} <copyText style="zoom:0.7;margin-left: 5px;" :text="item.productCode" label="产品编码"></copyText></view>
  15. <view class="padding_3">通用产品编码:{{item.productCommonCode}} </view>
  16. <view class="padding_3" >
  17. <text>通用产品名称:{{item.productCommon.name || '--'}}</text>
  18. <u-tag style="margin:10rpx 0 0 20rpx;zoom:0.7;" size="mini" :type="item.productCommon.onlineFalg==1?'success':'info'" :text="item.productCommon.onlineFalgDictValue"></u-tag>
  19. </view>
  20. <view class="p-t-tit-box" v-show="item.c_titFlag">{{item.productCommon.name || '--'}}</view>
  21. <view class="padding_3">通用产品分类:
  22. <text v-if="item.productCommon.productTypeName2 || item.productCommon.productTypeName3">{{ item.productCommon.productTypeName2 }} {{ item.productCommon.productTypeName3 ? '>' : '' }} {{ item.productCommon.productTypeName3 }}</text>
  23. <text v-else>--</text>
  24. </view>
  25. <view class="font_13">
  26. 创建时间:<text class="gray">{{item.createDate}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <u-empty v-if="listData.length == 0 &&status!='loading'" :text="noDataText" mode="list" ></u-empty>
  32. <view style="padding-bottom: 20upx;">
  33. <u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
  34. </view>
  35. </view>
  36. </scroll-view>
  37. <!-- 搜索弹窗 -->
  38. <searchParts :showModal="showModal" @refresh="refreshList" @close="showModal=false"/>
  39. </view>
  40. </template>
  41. <script>
  42. import { productUniversalQueryPage } from '@/api/sales'
  43. import copyText from '@/pages/common/copyText.vue'
  44. import searchParts from './searchParts.vue'
  45. export default{
  46. components:{searchParts,copyText},
  47. data(){
  48. return{
  49. listData:[],
  50. totalNum:0,
  51. pageNo:1,
  52. pageSize:15,
  53. noDataText: '暂无数据',
  54. status: 'loadmore',
  55. showModal:false,
  56. params:{
  57. productCode:'',
  58. productName:'',
  59. productCommonCode:'',
  60. productCommonName:'',
  61. onlineFalg:undefined
  62. }
  63. }
  64. },
  65. onNavigationBarButtonTap(e){
  66. this.showModal=true
  67. },
  68. onBackPress() {
  69. if(this.showModal){
  70. this.showModal = false
  71. return true
  72. }
  73. },
  74. onLoad(option) {
  75. this.getList()
  76. },
  77. methods:{
  78. // 刷新列表
  79. refreshList(val){
  80. this.params =val ? val : {},
  81. this.listData = []
  82. this.totalNum = 0
  83. this.getList(1)
  84. },
  85. // 列表
  86. getList(pageNo){
  87. const _this = this
  88. if (pageNo) {
  89. this.pageNo = pageNo
  90. }
  91. let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize })
  92. this.status = "loading"
  93. productUniversalQueryPage(params).then(res => {
  94. if (res.status == 200) {
  95. if(res.data.list.length>0){
  96. res.data.list.forEach(con=>{
  97. con.titFlag = false
  98. con.c_titFlag = false
  99. })
  100. }
  101. if(this.pageNo>1){
  102. this.listData = this.listData.concat(res.data.list || [])
  103. }else{
  104. this.listData = res.data.list || []
  105. }
  106. this.totalNum = res.data.count || 0
  107. } else {
  108. this.listData = []
  109. this.totalNum = 0
  110. this.noDataText = res.message
  111. }
  112. this.status = "loadmore"
  113. })
  114. },
  115. // scroll-view到底部加载更多
  116. onreachBottom() {
  117. if(this.listData.length < this.totalNum){
  118. this.pageNo += 1
  119. this.getList()
  120. }
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss">
  126. .productPricing-content{
  127. width:100%;
  128. height: 100vh;
  129. .product-list{
  130. height: 100vh;
  131. .st-detailList-main{
  132. padding: 20upx;
  133. .st-detailList-main-item{
  134. background: #ffffff;
  135. padding: 20upx;
  136. margin-bottom: 25upx;
  137. border-radius: 25upx;
  138. box-shadow: 1px 1px 3px #EEEEEE;
  139. .st-detailList-tit{
  140. padding-bottom: 20upx;
  141. position: relative;
  142. border-bottom: 1px solid #e4e7ed;
  143. .p-tit-box{
  144. width: 100%;
  145. padding:20rpx 30rpx;
  146. box-sizing: border-box;
  147. position: absolute;
  148. top: 60rpx;
  149. left:0;
  150. color:#fff;
  151. background:rgba(0,0,0,.8);
  152. }
  153. }
  154. .st-detailList-item-con{
  155. padding: 20upx;
  156. font-size: 26upx;
  157. position: relative;
  158. .p-t-tit-box{
  159. width: 100%;
  160. padding:20rpx 30rpx;
  161. box-sizing: border-box;
  162. position: absolute;
  163. bottom: 66rpx;
  164. left:0;
  165. color:#fff;
  166. background:rgba(0,0,0,.8);
  167. }
  168. .gray{
  169. color: gray;
  170. }
  171. .pimgs{
  172. margin-right: 16upx;
  173. }
  174. .font_13{
  175. font-size: 26upx;
  176. }
  177. .padding_3{
  178. padding: 6upx 0;
  179. word-break: break-all;
  180. }
  181. }
  182. .price-all{
  183. border-top: 1px solid #e4e7ed;
  184. padding: 20upx 20upx 0;
  185. .price-item1{
  186. width: 18%;
  187. border-right: 1px solid #e4e7ed;
  188. text-align: center;
  189. >view{
  190. color:#999;
  191. }
  192. }
  193. .price-item2{
  194. width: 46%;
  195. border-right: none;
  196. text-align: center;
  197. >view{
  198. color:#999;
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. }
  206. </style>