Browse Source

修改bug

chenrui 2 năm trước cách đây
mục cha
commit
2c555d5db1
2 tập tin đã thay đổi với 190 bổ sung54 xóa
  1. 44 54
      pages/sales/productUniversal.vue
  2. 146 0
      pages/sales/searchParts.vue

+ 44 - 54
pages/sales/productUniversal.vue

@@ -4,7 +4,8 @@
 			<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>
+						<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>
+						<view class="p-tit-box" v-show="item.titFlag">{{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>
@@ -12,7 +13,12 @@
 						<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 u-line-2" @click="item.c_titFlag=!item.c_titFlag">
+								<text>通用产品名称:</text>
+								<u-tag style="margin:0 20rpx 10rpx 0" size="mini" :type="item.productCommon.onlineFalg==1?'success':'info'" :text="item.productCommon.onlineFalgDictValue"></u-tag>
+								<text>{{item.productCommon.name || '--'}}</text>
+							</view>
+							<view class="p-t-tit-box" v-show="item.c_titFlag">{{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>
@@ -22,24 +28,6 @@
 							</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;">
@@ -48,39 +36,31 @@
 			</view>
 		</scroll-view>
 		<!-- 搜索弹窗 -->
-		<search :showModal="showModal" @refresh="refreshList" @close="showModal=false"/>
+		<searchParts :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'
+	import searchParts from './searchParts.vue'
 	export default{
-		components:{search,copyText},
+		components:{searchParts,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
+					productCode:'',
+					productName:'',
+					productCommonCode:'',
+					productCommonName:'',
+					onlineFalg:undefined
 				}
 			}
 		},
@@ -93,22 +73,10 @@
 				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 : {},
@@ -126,6 +94,12 @@
 				this.status = "loading"
 				productUniversalQueryPage(params).then(res => {
 					if (res.status == 200) {
+						if(res.data.list.length>0){
+							res.data.list.forEach(con=>{
+								con.titFlag = false
+								con.c_titFlag = false
+							})
+						}
 						if(this.pageNo>1){
 							this.listData = this.listData.concat(res.data.list || [])
 						}else{
@@ -146,12 +120,6 @@
 					this.pageNo += 1
 					this.getList()
 				}
-			},
-			// 查看销售记录
-			toViewDetail(row){
-				uni.navigateTo({
-					url: "/pages/sales/salesRecord?productSn="+row.productSn + "&productName="+row.name+ "&productCode="+row.code
-				})
 			}
 		}
 	}
@@ -173,11 +141,33 @@
 						box-shadow: 1px 1px 3px #EEEEEE;
 						.st-detailList-tit{
 							padding-bottom: 20upx;
+							position: relative;
 							border-bottom: 1px solid #e4e7ed;
+							.p-tit-box{
+								width: 100%;
+								padding:20rpx 30rpx;
+								box-sizing: border-box;
+								position: absolute;
+								top: 60rpx;
+								left:0;
+								color:#fff;
+								background:rgba(0,0,0,.8);
+							}
 						}
 						.st-detailList-item-con{
 							padding: 20upx;
 							font-size: 26upx;
+							position: relative;
+							.p-t-tit-box{
+								width: 100%;
+								padding:20rpx 30rpx;
+								box-sizing: border-box;
+								position: absolute;
+								bottom: 66rpx;
+								left:0;
+								color:#fff;
+								background:rgba(0,0,0,.8);
+							}
 							.gray{
 								color: gray;
 							}

+ 146 - 0
pages/sales/searchParts.vue

@@ -0,0 +1,146 @@
+<template>
+	<view class="modal-box">
+		<u-popup v-model="isShow"  @close="isShow=false" mode="right" length="85%" >
+			<u-form :model="form" ref="uForm" label-width="200" class="form-content">
+				<u-form-item label="产品编码"><u-input v-model.trim="form.productCode" placeholder="请输入产品编码" input-align="right" /></u-form-item>
+				<u-form-item label="产品名称"><u-input v-model.trim="form.productName" placeholder="请输入产品名称" input-align="right" /></u-form-item>
+				<u-form-item label="产品状态" class="form-item">
+					<u-input v-model="onlineFalgName" @click="onlineFalgModal=true" disabled placeholder="请选择产品状态" input-align="right" />
+					<u-icon v-show="onlineFalgName.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="clearOnlineFlag"></u-icon>
+				</u-form-item>
+				<u-form-item label="产品通用编码"><u-input v-model.trim="form.productCommonCode" placeholder="请输入产品通用编码" input-align="right" /></u-form-item>
+				<u-form-item label="产品通用名称"><u-input v-model.trim="form.productCommonName" placeholder="请输入产品通用名称" input-align="right" /></u-form-item>
+			</u-form>
+			<view class="form-footer-btn">
+				<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClean">重置</u-button>
+				<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
+			</view>
+		</u-popup>
+		<!-- 选择产品状态 -->
+		<u-picker v-model="onlineFalgModal" @confirm="onlineFalgChange" :range="onlineFlagList" range-key="dispName" mode="selector"></u-picker>
+	</view>
+</template>
+
+<script>
+	import productBrand from '@/pages/common/productBrand.vue'
+	import productType from '@/pages/common/productType.vue'
+	import { dealerProductTypeList } from '@/api/dealerProductType'
+	export default{
+		components: { productBrand, productType },
+		props:{
+			showModal:{
+				type: Boolean,
+				default: false
+			}
+		},
+		data(){
+			return{
+				form: {
+					productCode:'',
+					productName:'',
+					productCommonCode:'',
+					productCommonName:'',
+					onlineFalg:undefined
+				},
+				customBtnStyle: {  //  自定义按钮样式
+					borderColor: this.$config('primaryColor'),
+					backgroundColor: this.$config('primaryColor'),
+					color: '#fff'
+				},
+				nowData: {
+					data: [],
+					indArr: [],
+					nowInd: 0
+				},
+				isShow:this.showModal,
+				onlineFalgModal: false,
+				onlineFalgName: '',
+				onlineFlagList: []
+			}
+		},
+		methods:{
+			// 表单清空
+			handleClean(){
+				this.form.productCode = ''
+				this.form.productName = ''
+				this.form.productCommonCode = ''
+				this.form.productCommonName = ''
+				this.clearOnlineFlag()
+				setTimeout(()=>{
+					this.handleSearch()
+				},300)
+			},
+			handleSearch(){
+				let data = JSON.parse(JSON.stringify(this.form))
+				this.$emit('refresh', data)
+				this.isShow=false
+			},
+			clearOnlineFlag(){
+				this.onlineFalgName = ''
+				this.form.onlineFalg = undefined
+			},
+			// 产品状态 change
+			onlineFalgChange(ind){
+				this.form.onlineFalg = this.onlineFlagList[ind].code || undefined
+				this.onlineFalgName = this.onlineFlagList[ind].dispName || ''
+			},
+			getStateList(){ //获取产品状态
+				this.onlineFlagList = this.$store.state.vuex_onlineFlagList
+				if(this.form.onlineFalg){
+					const b = this.onlineFlagList.find(item => item.code == this.form.onlineFalg)
+					this.onlineFalgName = b ? b.dispName : ''
+				}
+			}
+		},
+		watch:{
+			//  父页面传过来的弹框状态
+			showModal (newValue, oldValue) {
+				this.isShow = newValue
+			},
+			//  重定义的弹框状态
+			isShow (newValue, oldValue) {
+				if (!newValue) {
+					this.$emit('close')
+				}else{
+					this.getStateList()
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.modal-box{
+		width: 100%;
+		.search-title {
+			text-align: center;
+			padding: 30upx 22upx;
+			color: #333;
+			border-bottom: 1px solid #eee;
+		}
+		.form-content{
+			display: block;
+			padding: 0 20upx;
+			box-sizing: content-box;
+		}
+		.u-form-item{
+			padding: 20upx 10upx;
+		}
+		.form-footer-btn{
+			margin: 60upx 30upx 30upx;
+			display: flex;
+			justify-content: space-between;
+		}
+		.form-footer-btn {
+			display: flex;
+			padding: 20upx;
+			margin-top: 200upx;
+			.handle-btn {
+				font-size: 28upx;
+				margin: 0 30upx;
+				width: 100%;
+				flex: 1;
+			}
+		}
+	}
+</style>