productUniversal.vue 5.9 KB

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