zhangdan 3 years ago
parent
commit
037c66ea06
2 changed files with 96 additions and 71 deletions
  1. 80 60
      pages/sales/addSales.vue
  2. 16 11
      pages/sales/chooseCustomer.vue

+ 80 - 60
pages/sales/addSales.vue

@@ -1,59 +1,64 @@
 <template>
 <template>
 	<view class="addCustomer-content">
 	<view class="addCustomer-content">
-		<view class="flex justify_between align_center content-customerName" v-if="itemId">
+		<view class="content-customerName">
+			<view class="flex justify_between align_center customerName">
 			<text>{{customerData?customerData.customerName:''}}</text>
 			<text>{{customerData?customerData.customerName:''}}</text>
-			<u-button size="mini" :hair-line="false" plain type="primary" hover-class="none" @click="goBack" :custom-style="customBtnStyle">重新选择</u-button>
+			
+				<u-button size="mini" :hair-line="false" plain type="primary" hover-class="none" @click="goBack" :custom-style="customBtnStyle">重新选择</u-button>
+			</view>
 		</view>
 		</view>
-		<view class="content-form">
-			<u-form :model="form" ref="uForm"  label-width="180" :error-type="['toast']">
-				<u-form-item label="客户地址" required >
-					<u-input v-model="areaInfo.label" :disabled="true" input-align="right" placeholder="请选择客户地址" @click="openAddress"/>
-					<u-icon name="arrow-right" color="#C0C4CC" slot="right"  @click="openAddress"></u-icon>
-				</u-form-item>
-				<u-form-item label="详细地址">
-					<textarea :auto-height="true" input-align="right" placeholder="请输入详细地址(最多60个字符)" :maxlength="60" v-model="form.shippingAddress" class="receiveAddress" placeholder-style="color:#C0C4CC;font-size:28upx;"/>
-				</u-form-item>
-				<u-form-item label="联系人">
-					<u-input v-model="form.consigneeName" input-align="right" placeholder="请输入联系人(最多30个字符)" :maxlength="11"/>
-				</u-form-item>
-				<u-form-item label="联系电话">
-					<u-input v-model.trim="form.consigneeTel" placeholder="请输入联系电话(最多15个字符)" input-align="right" :maxlength="15"/>
-				</u-form-item>
-				<u-form-item label="联系手机"><u-input v-model.trim="form.contactMobile" placeholder="请输入联系手机(最多11位字符)" input-align="right" :maxlength="11"/>
-				</u-form-item>
-				<u-form-item label="价格类型" required >
-					<v-select ref="priceType" :disabled="true" placeholder="请选择价格类型" @itemChange="chooseType" code="PRICE_TYPE" style="width: 100%"></v-select>
-				</u-form-item>
-				<u-form-item label="收款方式" required prop="settleStyleSn">
-					<u-input v-model="settleStyleName" input-align="right" :disabled="true" placeholder="请选择收款方式" @click="showSettle=true"/>
-					<u-icon name="arrow-right" color="#C0C4CC" slot="right"></u-icon>
-				</u-form-item>
-				<u-form-item label="铺货出库" required v-if="itemId">
-					<view style="width: 100%;display:flex;justify-content: flex-end;">
-					<u-radio-group v-model="form.distributionFlag" @change="radioChange" >
-						<u-radio 
-							v-for="(item, index) in ckList" :key="index" 
-							:name="item.code"
-						>
-							{{item.dispName}}
-						</u-radio>
-					</u-radio-group>
-					</view>
-				</u-form-item>
-				<u-form-item label="配送方式" >
-					<v-select ref="dispatchType" :disabled="true" placeholder="请选择配送方式" @itemChange="choosedispatchType" code="DISPATCH_TYPE" style="width: 100%"></v-select>
-				</u-form-item>
-				<u-form-item label="业务员">
-					<u-input v-model="userName" input-align="right" :disabled="true" placeholder="请选择业务员"  @click="showUser=true"/>
-					<u-icon name="arrow-right" color="#C0C4CC" slot="right"  @click="showUser=true"></u-icon>
-				</u-form-item>
-				<u-form-item label="备注">
-					<textarea :auto-height="true" input-align="right" placeholder="请输入备注(最多100个字符)" :maxlength="100" v-model="form.remarks" class="receiveAddress" placeholder-style="color:#C0C4CC;font-size:28upx;"/>
-				</u-form-item>
-			</u-form>
-		</view>
-		<view class="form-footer-btn">
-			<u-button class="handle-btn" size="medium" shape="circle" hover-class="none" @click="handleSaveCust" :custom-style="customBtnStyle">保存</u-button>
+		<view class="flex_1 content-box">
+			<view class="content-form">
+				<u-form :model="form" ref="uForm"  label-width="180" :error-type="['toast']">
+					<u-form-item label="客户地址" required >
+						<u-input v-model="areaInfo.label" :disabled="true" input-align="right" placeholder="请选择客户地址" @click="openAddress"/>
+						<u-icon name="arrow-right" color="#C0C4CC" slot="right"  @click="openAddress"></u-icon>
+					</u-form-item>
+					<u-form-item label="详细地址">
+						<textarea :auto-height="true" input-align="right" placeholder="请输入详细地址(最多60个字符)" :maxlength="60" v-model="form.shippingAddress" class="receiveAddress" placeholder-style="color:#C0C4CC;font-size:28upx;"/>
+					</u-form-item>
+					<u-form-item label="联系人">
+						<u-input v-model="form.consigneeName" input-align="right" placeholder="请输入联系人(最多30个字符)" :maxlength="11"/>
+					</u-form-item>
+					<u-form-item label="联系电话">
+						<u-input v-model.trim="form.consigneeTel" placeholder="请输入联系电话(最多15个字符)" input-align="right" :maxlength="15"/>
+					</u-form-item>
+					<u-form-item label="联系手机"><u-input v-model.trim="form.contactMobile" placeholder="请输入联系手机(最多11位字符)" input-align="right" :maxlength="11"/>
+					</u-form-item>
+					<u-form-item label="价格类型" required >
+						<v-select ref="priceType" :disabled="true" placeholder="请选择价格类型" @itemChange="chooseType" code="PRICE_TYPE" style="width: 100%"></v-select>
+					</u-form-item>
+					<u-form-item label="收款方式" required prop="settleStyleSn">
+						<u-input v-model="settleStyleName" input-align="right" :disabled="true" placeholder="请选择收款方式" @click="showSettle=true"/>
+						<u-icon name="arrow-right" color="#C0C4CC" slot="right"></u-icon>
+					</u-form-item>
+					<u-form-item label="铺货出库" required v-if="itemId">
+						<view style="width: 100%;display:flex;justify-content: flex-end;">
+						<u-radio-group v-model="form.distributionFlag" @change="radioChange" >
+							<u-radio 
+								v-for="(item, index) in ckList" :key="index" 
+								:name="item.code"
+							>
+								{{item.dispName}}
+							</u-radio>
+						</u-radio-group>
+						</view>
+					</u-form-item>
+					<u-form-item label="配送方式" >
+						<v-select ref="dispatchType" :disabled="true" placeholder="请选择配送方式" @itemChange="choosedispatchType" code="DISPATCH_TYPE" style="width: 100%"></v-select>
+					</u-form-item>
+					<u-form-item label="业务员">
+						<u-input v-model="userName" input-align="right" :disabled="true" placeholder="请选择业务员"  @click="showUser=true"/>
+						<u-icon name="arrow-right" color="#C0C4CC" slot="right"  @click="showUser=true"></u-icon>
+					</u-form-item>
+					<u-form-item label="备注">
+						<textarea :auto-height="true" input-align="right" placeholder="请输入备注(最多100个字符)" :maxlength="100" v-model="form.remarks" class="receiveAddress" placeholder-style="color:#C0C4CC;font-size:28upx;"/>
+					</u-form-item>
+				</u-form>
+			</view>
+			<view class="form-footer-btn">
+				<u-button class="handle-btn" size="medium" shape="circle" hover-class="none" @click="handleSaveCust" :custom-style="customBtnStyle">保存</u-button>
+			</view>
 		</view>
 		</view>
 		<!-- 省市区 -->
 		<!-- 省市区 -->
 		<Address ref="applyAddress" @onConfirm="areaConfirm"></Address>
 		<Address ref="applyAddress" @onConfirm="areaConfirm"></Address>
@@ -174,8 +179,10 @@
 		},
 		},
 		methods:{
 		methods:{
 			getCustomerData(val){
 			getCustomerData(val){
+				uni.showLoading({title:'加载中...',mask:true})
 				customerDetail({id:val}).then(res=>{
 				customerDetail({id:val}).then(res=>{
 					if(res.status==200){
 					if(res.status==200){
+						uni.hideLoading({})
 						this.customerData=res.data
 						this.customerData=res.data
 						this.areaIdArr=[this.customerData.provinceSn,this.customerData.citySn,this.customerData.countySn]
 						this.areaIdArr=[this.customerData.provinceSn,this.customerData.citySn,this.customerData.countySn]
 						this.areaInfo={label:this.customerData.provinceName+'-'+this.customerData.cityName+'-'+this.customerData.countyName}
 						this.areaInfo={label:this.customerData.provinceName+'-'+this.customerData.cityName+'-'+this.customerData.countyName}
@@ -411,19 +418,32 @@
 	.addCustomer-content{
 	.addCustomer-content{
 		width: 100%;
 		width: 100%;
 		height: 100vh;
 		height: 100vh;
-		background-color: #fff;
-		padding:0 40upx;
+		// background-color: #fff;
+		
 		display: flex;
 		display: flex;
 		flex-direction: column;
 		flex-direction: column;
 		.content-customerName{
 		.content-customerName{
-			// padding: 10upx;
-			// border-radius: 10upx;
-			// border: 1upx solid #e5e5e5;
+			width: 100%;
+			.customerName{
+				position: fixed;
+				width: 100%;
+				z-index: 999;
+				color: #000000;
+				font-size: 30upx;
+				font-weight: 1000;
+				background-color: #fff;
+				padding:10upx 40upx 20upx;
+			}
+		}
+		.content-box{
+			display: flex;
+			flex-direction: column;
+			margin-top: 100upx;
+			padding:0 40upx;
+			background-color: #fff;
 		}
 		}
 		.content-form{
 		.content-form{
 			flex: 1;
 			flex: 1;
-			// box-shadow:0 8upx 24upx rgba(0,0,0,.1);
-			// border: 1upx solid #e5e5e5;
 			.receiveAddress{
 			.receiveAddress{
 				width: 100%;
 				width: 100%;
 				line-height: 1.5em;
 				line-height: 1.5em;
@@ -441,7 +461,7 @@
 			bottom: 0;
 			bottom: 0;
 			left: 0;
 			left: 0;
 			width: 100%;
 			width: 100%;
-			padding: 16upx 20upx 12upx;
+			padding: 30upx;
 			z-index: 999;
 			z-index: 999;
 			.handle-btn{
 			.handle-btn{
 				width: 100%;
 				width: 100%;

+ 16 - 11
pages/sales/chooseCustomer.vue

@@ -18,17 +18,17 @@
 				:action-style="{'color': '#fff', 'font-size': '24upx', 'background-color': $config('primaryColor'), 'border-radius': '6upx', 'padding': '12upx 0'}">
 				:action-style="{'color': '#fff', 'font-size': '24upx', 'background-color': $config('primaryColor'), 'border-radius': '6upx', 'padding': '12upx 0'}">
 			</u-search>
 			</u-search>
 		</view>
 		</view>
-			<scroll-view  class="picker-content flex_1" scroll-y>
-				<view class="picker-main">
-					<view class="picker-main-item" v-for="(item, index) in listData" :key="item.id" @click="chooseItem(index)">
-						<view class="item-name">{{item.customerName}}</view>
-					</view>
-					<view v-if="listData&&listData.length>=20" style="color:#999;font-size: 26upx;text-align: center;padding: 10upx;">最多显示前20条匹配客户,请尝试输入更多内容</view>
-					<view v-if="listData && listData.length == 0">
-						<u-empty text="暂无匹配客户" mode="list" :img-width="200" :margin-top="60"></u-empty>
-					</view>
+		<scroll-view class="picker-content flex_1" scroll-y >
+			<view class="picker-main">
+				<view class="picker-main-item" v-for="(item, index) in listData" :key="item.id" @click="chooseItem(index)">
+					<view class="item-name">{{item.customerName}}</view>
 				</view>
 				</view>
-			</scroll-view>
+				<view v-if="listData&&listData.length>=20" style="color:#999;font-size: 26upx;text-align: center;padding: 10upx;">最多显示前20条匹配客户,请尝试输入更多内容</view>
+				<view v-if="listData && listData.length == 0">
+					<u-empty text="暂无匹配客户" mode="list" :img-width="200" :margin-top="60"></u-empty>
+				</view>
+			</view>
+		</scroll-view>
 	</view>
 	</view>
 </template>
 </template>
 
 
@@ -41,10 +41,13 @@
 				queryWord:'',
 				queryWord:'',
 				pageSize:20,
 				pageSize:20,
 				pageNo:1,
 				pageNo:1,
+				scrollH:300,
 			}
 			}
 		},
 		},
 		onLoad() {
 		onLoad() {
 			uni.$on('clear',this.clearSearch)
 			uni.$on('clear',this.clearSearch)
+		},
+		onShow() {
 			this.init()
 			this.init()
 		},
 		},
 		onUnload() {
 		onUnload() {
@@ -101,6 +104,8 @@
 		height: 100vh;
 		height: 100vh;
 		background-color: #fff;
 		background-color: #fff;
 		padding:0 30upx;
 		padding:0 30upx;
+		display: flex;
+		flex-direction: column;
 		.search{
 		.search{
 			.search-title{
 			.search-title{
 				padding: 20upx 0;
 				padding: 20upx 0;
@@ -122,6 +127,7 @@
 		.picker-content{
 		.picker-content{
 			padding: 6upx 0 20upx;
 			padding: 6upx 0 20upx;
 			width: 100%;
 			width: 100%;
+			height: calc(100vh-144upx);
 			flex: 1;
 			flex: 1;
 			overflow-y: scroll;
 			overflow-y: scroll;
 			.picker-main{
 			.picker-main{
@@ -136,7 +142,6 @@
 						border-bottom:none
 						border-bottom:none
 					}
 					}
 				}
 				}
-				
 			}
 			}
 		}
 		}
 	}
 	}