Prechádzať zdrojové kódy

前端小程序 sdy

zhongtianhaoyuan 3 rokov pred
rodič
commit
4f1ef2f554

+ 149 - 124
pageA/product/Identity_switching.vue

@@ -1,35 +1,46 @@
 <template>
 <template>
-	
+
 	<view class="center">
 	<view class="center">
 		<view v-for="(item , index) in lists" :Key="index">
 		<view v-for="(item , index) in lists" :Key="index">
-			<view class="forList">
+			<view class="forList" @click="definition(item)">
 				<view class="flex">
 				<view class="flex">
 					<view class="company" v-if="item.customerType == '企业'">{{item.customerType}}</view>
 					<view class="company" v-if="item.customerType == '企业'">{{item.customerType}}</view>
 					<view class="company1" v-if="item.customerType == '个人'">{{item.customerType}}</view>
 					<view class="company1" v-if="item.customerType == '个人'">{{item.customerType}}</view>
 					<view class="guess-item" @click="navToDetailPage(item)">
 					<view class="guess-item" @click="navToDetailPage(item)">
-				</view>
-				
+					</view>
+
 					<view class="infos">
 					<view class="infos">
-	
-						<view class="info1">{{item.customerName}}
-							<view class='but but1' v-if="item.authenticationStatus == '已认证'">{{item.authenticationStatus}}</view>
-							<view class='but but2' v-if="item.authenticationStatus == '审核中'">{{item.authenticationStatus}}</view>
-							<view class='but but3' v-if="item.authenticationStatus == '未通过'">{{item.authenticationStatus}}</view>
-							<view class='but but4' v-if="item.authenticationStatus == '已覆盖'">{{item.authenticationStatus}}</view>
+
+						<view class="info1">
+							<view v-if="item.customerType == '企业'">{{item.compName}}</view>
+							<view v-if="item.customerType == '个人'">{{item.customerName}}</view>
+							<view class='but but1' v-if="item.authenticationStatus == '已认证'">
+								{{item.authenticationStatus}}
+							</view>
+							<view class='but but2' v-if="item.authenticationStatus == '审核中'">
+								{{item.authenticationStatus}}
+							</view>
+							<view class='but but3' v-if="item.authenticationStatus == '未通过'">
+								{{item.authenticationStatus}}
+							</view>
+							<view class='but but4' v-if="item.authenticationStatus == '已覆盖'">
+								{{item.authenticationStatus}}
+							</view>
 						</view>
 						</view>
-						<view class="info2">{{item.customerPhone}}</view>	
+						<view class="info2">{{item.customerPhone}}</view>
 					</view>
 					</view>
-	
+
 				</view>
 				</view>
-					<hr style="margin: 10px 0px;">
+				<hr style="margin: 10px 0px;">
 				<label>
 				<label>
-					<checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked" @click.stop="checkBox($event,item)" ></checkbox>
+					<checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked"
+						@click.stop="checkBox($event,item)"></checkbox>
 					<text>设置默认</text>
 					<text>设置默认</text>
 				</label>
 				</label>
 			</view>
 			</view>
 		</view>
 		</view>
 	</view>
 	</view>
-	
+
 	</view>
 	</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -42,7 +53,7 @@
 		name: "buy",
 		name: "buy",
 		data() {
 		data() {
 			return {
 			return {
-				lists:[],
+				lists: [],
 				PageCur: "buy",
 				PageCur: "buy",
 				buyInfo: [],
 				buyInfo: [],
 				pages: 1, //页数
 				pages: 1, //页数
@@ -53,28 +64,28 @@
 				scrollTop: 0,
 				scrollTop: 0,
 				TabCur: 0,
 				TabCur: 0,
 				current: 1,
 				current: 1,
-				checked:false,
-				goodsName:'',
-				receivePrivate:'',
-				receiveCity:'',
-				receiveArea:'',
-				minimumVolume:'',
-				basis:'',
-				buyer:'',
-				unitPrice:'',
-				receiveWarehouse:'',
-				procurementPlanType:'',
-				procurementPlan:'',
+				checked: false,
+				goodsName: '',
+				receivePrivate: '',
+				receiveCity: '',
+				receiveArea: '',
+				minimumVolume: '',
+				basis: '',
+				buyer: '',
+				unitPrice: '',
+				receiveWarehouse: '',
+				procurementPlanType: '',
+				procurementPlan: '',
 				identityAuthenticationInfo: {
 				identityAuthenticationInfo: {
 					pageSize: 10,
 					pageSize: 10,
 					currentPage: 1,
 					currentPage: 1,
 					commonId: "",
 					commonId: "",
-					
-					
+
+
 				},
 				},
 			};
 			};
 		},
 		},
-		onShow(){
+		onShow() {
 			this.getList()
 			this.getList()
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
@@ -88,40 +99,47 @@
 			this.unitPrice = options.unitPrice
 			this.unitPrice = options.unitPrice
 			this.receiveWarehouse = options.receiveWarehouse
 			this.receiveWarehouse = options.receiveWarehouse
 			this.procurementPlanType = options.procurementPlanType
 			this.procurementPlanType = options.procurementPlanType
-			this.procurementPlan=options.procurementPlanNo
+			this.procurementPlan = options.procurementPlanNo
 		},
 		},
 		computed: {
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		},
 		methods: {
 		methods: {
+			definition(item){
+				if (item.customerType == "企业") {
+					this.$store.commit('configfreightChoice', item.compName)
+				} else if (item.customerType == "个人") {
+					this.$store.commit('configfreightChoice', item.customerName)
+				}
+				uni.navigateBack(1)
+			},
 			getList() {
 			getList() {
 				this.identityAuthenticationInfo.commonId = this.userInfo.id
 				this.identityAuthenticationInfo.commonId = this.userInfo.id
 				this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
 				this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
 						pageSize: 10,
 						pageSize: 10,
 						currentPage: 1,
 						currentPage: 1,
 						commonId: this.userInfo.id,
 						commonId: this.userInfo.id,
-						flag:1
+						flag: 1
 					}, 'application/json;charset=UTF-8').then(res => {
 					}, 'application/json;charset=UTF-8').then(res => {
-						if(res.data.code==200){
-							for(var i=0;i<res.data.data.records.length;i++){
-								if(res.data.data.records[i].defaultFlag!=1){
-									res.data.data.records[i].checked=false
-								}else{
-									res.data.data.records[i].checked=true
+						if (res.data.code == 200) {
+							for (var i = 0; i < res.data.data.records.length; i++) {
+								if (res.data.data.records[i].defaultFlag != 1) {
+									res.data.data.records[i].checked = false
+								} else {
+									res.data.data.records[i].checked = true
 								}
 								}
 							}
 							}
 							this.lists = res.data.data.records
 							this.lists = res.data.data.records
 						}
 						}
 					})
 					})
 					.catch(res => {
 					.catch(res => {
-						if(res.errmsg){
+						if (res.errmsg) {
 							uni.showToast({
 							uni.showToast({
 								title: res.errmsg,
 								title: res.errmsg,
 								icon: 'none',
 								icon: 'none',
 								duration: 2000
 								duration: 2000
 							})
 							})
-						}
-						else{
+						} else {
 							uni.showToast({
 							uni.showToast({
 								title: "系统异常,请联系管理员",
 								title: "系统异常,请联系管理员",
 								icon: 'none',
 								icon: 'none',
@@ -130,35 +148,34 @@
 						}
 						}
 					});
 					});
 			},
 			},
-			checkBox(e,item){
-				for(var i=0;i<this.lists.length;i++){
-					this.lists[i].checked=true
+			checkBox(e, item) {
+				for (var i = 0; i < this.lists.length; i++) {
+					this.lists[i].checked = true
 				}
 				}
-				item.checked=true
+				item.checked = true
 				this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
 				this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
-						id:item.id,
-						defaultFlag:1,
+						id: item.id,
+						defaultFlag: 1,
 						commonId: this.userInfo.id
 						commonId: this.userInfo.id
 					}).then(res => {
 					}).then(res => {
-						if(res.data.code==200){
+						if (res.data.code == 200) {
 							// this.lists = res.data.data.records
 							// this.lists = res.data.data.records
-							
+
 							uni.navigateBack({
 							uni.navigateBack({
-							 
-							  delta: 1
-							 
-})
+
+								delta: 1
+
+							})
 						}
 						}
 					})
 					})
 					.catch(res => {
 					.catch(res => {
-						if(res.errmsg){
+						if (res.errmsg) {
 							uni.showToast({
 							uni.showToast({
 								title: res.errmsg,
 								title: res.errmsg,
 								icon: 'none',
 								icon: 'none',
 								duration: 2000
 								duration: 2000
 							})
 							})
-						}
-						else{
+						} else {
 							uni.showToast({
 							uni.showToast({
 								title: "系统异常,请联系管理员",
 								title: "系统异常,请联系管理员",
 								icon: 'none',
 								icon: 'none',
@@ -180,17 +197,17 @@
 			// },
 			// },
 			navToDetailPage(item) {
 			navToDetailPage(item) {
 				// if (index == 1) {
 				// if (index == 1) {
-					uni.navigateTo({
-						url: `/pageA/product/business_buy?id=${item.id}&customerName=${item.customerName}&goodsName=${this.goodsName}
+				uni.navigateTo({
+					url: `/pageA/product/business_buy?id=${item.id}&customerName=${item.customerName}&goodsName=${this.goodsName}
 						&receivePrivate=${this.receivePrivate}&receiveCity=${this.receiveCity}&receiveArea=${this.receiveArea}&minimumVolume=${this.minimumVolume}&buyer=${this.buyer}&basisPrice=${this.basis}&unitPrice=${this.unitPrice}
 						&receivePrivate=${this.receivePrivate}&receiveCity=${this.receiveCity}&receiveArea=${this.receiveArea}&minimumVolume=${this.minimumVolume}&buyer=${this.buyer}&basisPrice=${this.basis}&unitPrice=${this.unitPrice}
 						&receiveWarehouse=${this.receiveWarehouse}&procurementPlanType=${this.procurementPlanType}&procurementPlanNo=${this.procurementPlan}`
 						&receiveWarehouse=${this.receiveWarehouse}&procurementPlanType=${this.procurementPlanType}&procurementPlanNo=${this.procurementPlan}`
-					})
-					},
-				// } else {
-				// 	uni.navigateTo({
-				// 		url: `/pageD/identity/driverIdentityLook`
-				// 	})
-				
+				})
+			},
+			// } else {
+			// 	uni.navigateTo({
+			// 		url: `/pageD/identity/driverIdentityLook`
+			// 	})
+
 
 
 			// }
 			// }
 		}
 		}
@@ -220,68 +237,76 @@
 		line-height: 35px;
 		line-height: 35px;
 		color: #22C572;
 		color: #22C572;
 		font-size: 12px;
 		font-size: 12px;
-		
+
 	}
 	}
-	.company1{
-			width: 35px;
-			height: 35px;
-			background-color: #FEECE6;
-			font-size: 16px;
-			margin-top: 10px;
-			border-radius: 5px;
-			text-align: center;
-			line-height: 35px;
-			color:#FE6430;
-			font-size: 12px;
-		}
-	
-		.infos {
-			/* margin: 10px 20px; */
-			width: 100%;
-			display: inline-table;
-		}
-	
-		.info {
-			line-height: 20px;
-		}
-	
-		.but {
-			margin-right: 30px;
-			float: right;
-			font-size: 14px;
-			
-			background-color: #FFFFFF;
-		}
-		.but1{
-			color: #22C572 ;
-		}
-		.but2{
-			color:#FE6430;
-		}
-		.but3{
-			color:#FB1E1E;
-		}
-		.but4{
-			color:#AFB3BF;
-		}
-		.forList{
-			background-color: #FFFFFF;
-			padding: 10px 10px;
-			border-radius: 10px;
-			margin-top: 10px;
-		}
+
+	.company1 {
+		width: 35px;
+		height: 35px;
+		background-color: #FEECE6;
+		font-size: 16px;
+		margin-top: 10px;
+		border-radius: 5px;
+		text-align: center;
+		line-height: 35px;
+		color: #FE6430;
+		font-size: 12px;
+	}
+
+	.infos {
+		/* margin: 10px 20px; */
+		width: 100%;
+		display: inline-table;
+	}
+
+	.info {
+		line-height: 20px;
+	}
+
+	.but {
+		margin-right: 30px;
+		float: right;
+		font-size: 14px;
+
+		background-color: #FFFFFF;
+	}
+
+	.but1 {
+		color: #22C572;
+	}
+
+	.but2 {
+		color: #FE6430;
+	}
+
+	.but3 {
+		color: #FB1E1E;
+	}
+
+	.but4 {
+		color: #AFB3BF;
+	}
+
+	.forList {
+		background-color: #FFFFFF;
+		padding: 10px 10px;
+		border-radius: 10px;
+		margin-top: 10px;
+	}
+
 	/* 	.guess-item{
 	/* 	.guess-item{
 			font-size: 18px;
 			font-size: 18px;
 			margin-left: 20px;
 			margin-left: 20px;
 			font-weight: 700;
 			font-weight: 700;
 		} */
 		} */
-		.info1{
-			font-size: 18px;
-			margin-left: 20px;
-			font-weight: 700;
-		}
-		.info2{
-			margin-left: 20px;
-			color: #AFB3BF;
-		}
+	.info1 {
+		font-size: 18px;
+		margin-left: 20px;
+		font-weight: 700;
+	}
+
+	.info2 {
+		margin-left: 20px;
+		color: #AFB3BF;
+	}
 </style>
 </style>

+ 27 - 17
pageA/product/business_buy.vue

@@ -216,7 +216,8 @@
 				unloadingFee: 0,
 				unloadingFee: 0,
 				packingMoney: 0,
 				packingMoney: 0,
 				packing: '散装',
 				packing: '散装',
-				packingFee: 0
+				packingFee: 0,
+				// choice : false,
 			};
 			};
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
@@ -240,25 +241,34 @@
 		},
 		},
 		computed: {
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
 			...mapState(['hasLogin', 'userInfo']),
+			
 		},
 		},
 		onShow() {
 		onShow() {
-			this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {
-				commonId: this.userInfo.id
-			}).then(res => {
-				if (res.data.code == 200) {
-					this.goods = res.data.data
-					if (this.goods.customerTypeFlag == 1) {
-						this.purchaseOrder.invoiceFee = -20
-						this.purchaseOrder.settlementPrice = Number(this.purchaseOrder.basis) - Number(this
-							.purchaseOrder.invoiceFee)
-					} else {
-						this.purchaseOrder.invoiceFee = 0
-						this.purchaseOrder.settlementPrice = Number(this.purchaseOrder.basis) - Number(this
-							.purchaseOrder.invoiceFee)
-					}
+			if( this.$store.state.choice != "" ){
+				if(this.goods.customerTypeFlag==1){
+					this.goods.customerName = this.$store.state.choice
+				}else if(this.goods.customerTypeFlag==2){
+					this.goods.compName = this.$store.state.choice
 				}
 				}
-				uni.hideLoading()
-			})
+			}else{
+				this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo', {
+					commonId: this.userInfo.id
+				}).then(res => {
+					if (res.data.code == 200) {
+						this.goods = res.data.data
+						if (this.goods.customerTypeFlag == 1) {
+							this.purchaseOrder.invoiceFee = -20
+							this.purchaseOrder.settlementPrice = Number(this.purchaseOrder.basis) - Number(this
+								.purchaseOrder.invoiceFee)
+						} else {
+							this.purchaseOrder.invoiceFee = 0
+							this.purchaseOrder.settlementPrice = Number(this.purchaseOrder.basis) - Number(this
+								.purchaseOrder.invoiceFee)
+						}
+					}
+					uni.hideLoading()
+				})
+			}	
 		},
 		},
 		methods: {
 		methods: {
 			liang() {
 			liang() {

+ 8 - 0
pageA/product/business_sale.vue

@@ -235,6 +235,13 @@
 				...mapState(['hasLogin','userInfo']),
 				...mapState(['hasLogin','userInfo']),
 			},
 			},
 			onShow() {
 			onShow() {
+				if( this.$store.state.choice != "" ){
+					if(this.goods.customerTypeFlag==1){
+						this.goods.customerName = this.$store.state.choice
+					}else if(this.goods.customerTypeFlag==2){
+						this.goods.compName = this.$store.state.choice
+					}
+				}else{
 				this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo',{commonId:this.userInfo.id}).then(res => {
 				this.$api.doRequest('get', '/identityAuthenticationInfo/getInfo',{commonId:this.userInfo.id}).then(res => {
 					if(res.data.code==200){
 					if(res.data.code==200){
 						this.goods=res.data.data
 						this.goods=res.data.data
@@ -248,6 +255,7 @@
 					}
 					}
 					uni.hideLoading()
 					uni.hideLoading()
 				})
 				})
+				}
 			},
 			},
 			methods: {
 			methods: {
 				liang(){
 				liang(){

+ 6 - 1
store/index.js

@@ -86,7 +86,8 @@ const store = new Vuex.Store({
 		],
 		],
 		clientId: lifeData.clientId?lifeData.clientId: "",
 		clientId: lifeData.clientId?lifeData.clientId: "",
 		// 确定收货
 		// 确定收货
-		isConfigfreightTransport:false
+		isConfigfreightTransport:false,
+		choice:""
 	},
 	},
 	mutations: {
 	mutations: {
 		$uStore(state, payload) {
 		$uStore(state, payload) {
@@ -121,8 +122,12 @@ const store = new Vuex.Store({
 		},
 		},
 		configfreightTransport(state,flag){
 		configfreightTransport(state,flag){
 			state.isConfigfreightTransport = flag
 			state.isConfigfreightTransport = flag
+		},
+		configfreightChoice(state,val){
+			state.choice = val
 		}
 		}
 		
 		
+		
 	},
 	},
 	actions: {
 	actions: {