소스 검색

通用产品

chenrui 2 년 전
부모
커밋
c0ea7e6b9c
5개의 변경된 파일245개의 추가작업 그리고 1개의 파일을 삭제
  1. 13 1
      api/sales.js
  2. 7 0
      pages.json
  3. 4 0
      pages/sales/index.vue
  4. 221 0
      pages/sales/productUniversal.vue
  5. BIN
      static/default/navIcon/parts.png

+ 13 - 1
api/sales.js

@@ -209,4 +209,16 @@ export const queryFlowByBizSn = (params) => {
 		data: params,
 		method: 'post'
 	  })
-}
+}
+
+//通用产品 列表  有分页
+export const productUniversalQueryPage = (params) => {
+  const url = `productUniversalCode/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 7 - 0
pages.json

@@ -510,6 +510,13 @@
 				}
 			}
 		},
+		{
+			"path": "pages/sales/productUniversal", // 产品报价
+			"style": {
+				"navigationBarTitleText": "产品报价",
+				"enablePullDownRefresh": false
+			}
+		},
 		{
 		    "path" : "pages/webviews/openview",
 		    "style" :                                                                                    

+ 4 - 0
pages/sales/index.vue

@@ -35,6 +35,10 @@
 					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/pfind.png`" width="64" height="64"></u-image>
 					<text class="nav-txt">产品查询</text>
 				</view>	
+				<view class="nav-item" @click="toPage('/pages/sales/productUniversal')" v-if="$hasPermissions('M_productUniversalList_mobile')">
+					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/parts.png`" width="64" height="64"></u-image>
+					<text class="nav-txt">通用产品</text>
+				</view>	
 				<view class="nav-item" @click="toPage('/pages/sales/chooseCustomerBill')" v-if="$hasPermissions('M_ARStatement_mobile')">
 					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/billImg.png`" width="64" height="64"></u-image>
 					<text class="nav-txt">应收对账单</text>

+ 221 - 0
pages/sales/productUniversal.vue

@@ -0,0 +1,221 @@
+<template>
+	<view class="productPricing-content">
+		<scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
+			<view class="st-detailList-main">
+				<view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id">
+					<view class="st-detailList-tit flex">
+						<view class="u-line-1"  style="font-weight: bold;margin-right: 20upx;max-width: 60%;">{{item.product.name}}</view>
+						<u-tag size="mini" :type="item.product.onlineFalg==1?'success':'info'" :text="item.product.onlineFalgDictValue"></u-tag>
+						<copyText :text="item.product.name" label="产品名称"></copyText>
+					</view>
+					<view class="st-detailList-item-con flex align_center">
+						<view class="flex_1">
+							<view class="padding_3">产品编码:{{item.productCode}} <copyText :text="item.productCode" label="产品编码"></copyText></view>
+							<view class="padding_3">通用产品编码:{{item.productCommonCode}} </view>
+							<view class="padding_3 u-line-2" style="max-width: 100%;">通用产品名称:{{item.productCommon.name || '--'}} </view>
+							<view class="padding_3">通用产品分类:
+							   <text v-if="item.productCommon.productTypeName2 || item.productCommon.productTypeName3">{{ item.productCommon.productTypeName2 }} {{ item.productCommon.productTypeName3 ? '>' : '' }} {{ item.productCommon.productTypeName3 }}</text>
+								<text v-else>--</text>
+							</view>
+							<view class="font_13">
+								创建时间:<text class="gray">{{item.createDate}}</text>
+							</view>
+						</view>
+					</view>
+					<view class="price-all flex" v-if="selPriceShow">
+						<view class="price-item1" v-if="priceList[0].checked">
+							<text>{{(item.offerCost||item.offerCost==0)?toThousands(item.offerCost,2):'--'}} </text>
+							<view>成本价</view>
+						</view>
+						<view class="price-item1" v-if="priceList[1].checked">
+							<text>{{(item.cityPrice || item.cityPrice==0)?toThousands(item.cityPrice,2):'--'}} </text>
+							<view>市级价</view>
+						</view>
+						<view class="price-item1" v-if="priceList[2].checked">
+							<text>{{(item.specialPrice||item.specialPrice==0)?toThousands(item.specialPrice,2):'--'}} </text>
+							<view>特约价</view>
+						</view>
+						<view class="price-item2" v-if="priceList[3].checked">
+							<text>{{(item.terminalPrice||item.terminalPrice==0)?toThousands(item.terminalPrice,2):'--'}}/{{item.dealerProductPrice&&(item.dealerProductPrice.terminalPrice||item.dealerProductPrice.terminalPrice==0)?toThousands(item.dealerProductPrice.terminalPrice,2):'--'}}  </text>
+							<view>终端价/自定义终端价</view>
+						</view>
+					</view>
+				</view>
+				<u-empty v-if="listData.length == 0 &&status!='loading'" :text="noDataText" mode="list" ></u-empty>
+				<view style="padding-bottom: 20upx;">
+					<u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
+				</view>
+			</view>
+		</scroll-view>
+		<!-- 搜索弹窗 -->
+		<search :showModal="showModal" @refresh="refreshList" @close="showModal=false"/>
+	</view>
+</template>
+
+<script>
+	import { toThousands } from '@/libs/tools'
+	import { productUniversalQueryPage } from '@/api/sales'
+	import search from './search.vue'
+	import copyText from '@/pages/common/copyText.vue'
+	export default{
+		components:{search,copyText},
+		data(){
+			return{
+				toThousands,
+				listData:[],
+				totalNum:0,
+				priceList:[
+					{ name: '成本价', checked: false, val: 'offerCost' },
+					{ name: '市级价', checked: false, val: 'cityPrice' },
+					{ name: '特约价', checked: false, val: 'specialPrice' },
+					{ name: '终端价/自定义终端价', checked: false, val: 'terminalPrice' },
+				],
+				pageNo:1,
+				pageSize:15,
+				noDataText: '暂无数据',
+				theme: '',
+				status: 'loadmore',
+				showModal:false,
+				params:{
+					"code": "",
+					"name": "",
+					"origCode": "",
+					"putStockFlag": 1
+				}
+			}
+		},
+		onNavigationBarButtonTap(e){
+			this.showModal=true
+		},
+		onBackPress() {
+			if(this.showModal){
+				this.showModal = false
+				return true
+			}
+		},
+		computed: {
+			selPriceShow() {
+				const a = this.priceList.filter(item => item.checked)
+				return a.length > 0
+			}
+		},
+		onLoad(option) {
+			this.theme = getApp().globalData.theme
+			this.getList()
+		},
+		methods:{
+			toPage(url){
+				uni.switchTab({
+					url:url
+				})
+			},
+			// 刷新列表
+			refreshList(val){
+				this.params =val ? val : {},
+				this.listData = []
+				this.totalNum = 0
+				this.getList(1)
+			},
+			// 列表
+			getList(pageNo){
+				const _this = this
+				if (pageNo) {
+					this.pageNo = pageNo
+				}
+				let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize })
+				this.status = "loading"
+				productUniversalQueryPage(params).then(res => {
+					if (res.status == 200) {
+						if(this.pageNo>1){
+							this.listData = this.listData.concat(res.data.list || [])
+						}else{
+							this.listData = res.data.list || []
+						}
+						this.totalNum = res.data.count || 0
+					} else {
+						this.listData = []
+						this.totalNum = 0
+						this.noDataText = res.message
+					}
+					this.status = "loadmore"
+				})
+			},
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				if(this.listData.length < this.totalNum){
+					this.pageNo += 1
+					this.getList()
+				}
+			},
+			// 查看销售记录
+			toViewDetail(row){
+				uni.navigateTo({
+					url: "/pages/sales/salesRecord?productSn="+row.productSn + "&productName="+row.name+ "&productCode="+row.code
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.productPricing-content{
+		width:100%;
+		height: 100vh;
+		.product-list{
+			height: 100vh;
+				.st-detailList-main{
+					padding: 20upx;
+					.st-detailList-main-item{
+						background: #ffffff;
+						padding: 20upx;
+						margin-bottom: 25upx;
+						border-radius: 25upx;
+						box-shadow: 1px 1px 3px #EEEEEE;
+						.st-detailList-tit{
+							padding-bottom: 20upx;
+							border-bottom: 1px solid #e4e7ed;
+						}
+						.st-detailList-item-con{
+							padding: 20upx;
+							font-size: 26upx;
+							.gray{
+								color: gray;
+							}
+							.pimgs{
+								margin-right: 16upx;
+							}
+							.font_13{
+								font-size: 26upx;
+							}
+							.padding_3{
+								padding: 6upx 0;
+								word-break: break-all;
+							}
+						}
+						.price-all{
+							border-top: 1px solid #e4e7ed;
+							padding: 20upx 20upx 0;
+							.price-item1{
+								width: 18%;
+								border-right:  1px solid #e4e7ed;
+								text-align: center;
+								>view{
+									color:#999;
+								}
+							}
+							.price-item2{
+								width: 46%;
+								border-right:  none;
+								text-align: center;
+								>view{
+									color:#999;
+								}
+							}
+						}
+					}
+				}
+				
+				
+		}
+	}
+</style>

BIN
static/default/navIcon/parts.png