浏览代码

采购单

lilei 10 月之前
父节点
当前提交
20af5def33
共有 5 个文件被更改,包括 108 次插入167 次删除
  1. 2 2
      pages/morePage/morePage.vue
  2. 10 12
      pagesB/coupon.vue
  3. 59 56
      pagesB/procureOrder.vue
  4. 26 95
      pagesB/procureOrderList.vue
  5. 11 2
      pagesB/promoDetail.vue

+ 2 - 2
pages/morePage/morePage.vue

@@ -287,12 +287,12 @@
 	background-image: linear-gradient(#86defa 0%,#cdeff9 20%,#f8f8f8 30%);
 	.list-box{
 		background: #ffffff;
-		margin-bottom: 30rpx;
+		margin-bottom: 20rpx;
 		border-radius: 25rpx;
 		overflow: hidden;
 		box-shadow: 2rpx 2rpx 5rpx #eee;
 		.list-title{
-			padding:30rpx 20rpx;
+			padding: 25rpx 20rpx;
 			font-size: 30rpx;
 			border-bottom: 2rpx solid #f8f8f8;
 			> text{

+ 10 - 12
pagesB/coupon.vue

@@ -30,11 +30,11 @@
 									</view>
 								</view>
 								<view v-if="item.ticketExplain">
-									<view class="check-order-desc" :class="'border-'+current" @click="item.showDesc = !item.showDesc">
+									<view class="check-order-desc" :class="'border-'+current" @click="showDesc(item)">
 										<text>使用说明:</text>
-										<u-icon name="arrow-down"></u-icon>
+										<u-icon :name="item.showDesc?'arrow-up':'arrow-down'"></u-icon>
 									</view>
-									<view class="check-order-desc-content">
+									<view class="check-order-desc-content" v-if="item.showDesc">
 										 {{item.ticketExplain}}
 									</view>
 								</view>
@@ -98,12 +98,6 @@
 			})
 		},
 		methods:{
-			// 复制
-			copyVin(vin){
-				uni.setClipboardData({
-					data: vin||'',
-				})
-			},
 			message(title){
 				uni.showToast({
 					icon:'none',
@@ -115,6 +109,10 @@
 				this.pageNo = 1
 				this.getRow()
 			},
+			showDesc(item){
+				item.showDesc = !item.showDesc
+				this.list.splice()
+			},
 			// tabs通知swiper切换
 			tabsChange(index) {
 				this.swiperCurrent = index;
@@ -251,8 +249,8 @@
 					background: #2196F3;
 				}
 				.imgbg-1{
-					background: #f7e7b8;
-					color: #FF9800;
+					background: #4CAF50;
+					color: #ffffff;
 				}
 				.imgbg-2{
 					background: #d2d1d1;
@@ -288,7 +286,7 @@
 					border-top: 1rpx solid #eee;
 				}
 				.border-1{
-					border-top: 1rpx solid #f7e7b8;
+					border-top: 1rpx solid #CDDC39;
 				}
 				.border-2{
 					border-top: 1rpx solid #d2d1d1;

+ 59 - 56
pagesB/procureOrder.vue

@@ -8,7 +8,7 @@
 						</u-icon>
 						<text>{{statusText}}</text>
 					</view>
-					<view class="messageText">{{statusMessage}}</view>
+					<view class="messageText"><text>{{statusMessage}}</text></view>
 				</view>
 			</view>
 		</view>
@@ -16,7 +16,7 @@
 			<view class="info partList" v-if="partList.length">
 				<view class="infoList">
 					<view class="title">
-						<u-icon name="info-circle" color="#ffaa00" size="28"></u-icon><text>请耐心等待汽配经销商进行配送</text>
+						产品列表
 					</view>
 					<view>
 						{{partList.length}}款,共<text class="redText">{{totalNums}}</text>件
@@ -38,10 +38,21 @@
 							<view>
 								数量:<text class="redText">{{item.qty}}</text>{{item.product&&item.product.unit||''}}
 							</view>
+							<view><text class="redText">¥{{item.price}}</text></view>
 						</view>
 					</view>
 				</view>
 			</view>
+			<view class="info" v-if="info">
+				<view class="infoList">
+					<text>代金券</text>
+					<text class="redText">¥{{info.totalGiveAmount}}</text>
+				</view>
+				<view class="infoList">
+					<text>总金额</text>
+					<text class="redText">¥{{info.totalAmount}}</text>
+				</view>
+			</view>
 			<view class="info" v-if="info">
 				<view class="infoList">
 					<view class="title">单据信息</view>
@@ -65,6 +76,7 @@
 </template>
 
 <script>
+	import { purchaseQueryDetailPage } from '@/api/purchase.js'
 	export default {
 	   name: 'procureDetailOrder',
 	   data() {
@@ -73,30 +85,44 @@
 			   info: null,
 			   statusText: '',
 			   statusIcon: '', // 结算状态icon
-			   statusMessage: '',
+			   statusMessage: '请耐心等待汽配经销商进行配送',
 			   partList: [], // 配件列表
 			   state: 'success'
 		   }
 	   },
 	   onLoad(option) { 
-		  const data = this.$store.state.vuex_tempData
-		  if(data){
-			  this.info = data
-			  this.partList = data.detailList
-		  }
-		  uni.setNavigationBarTitle({
-		  	title: ''
-		  })
+		   // 从采购单列表来
+		  if(option.purchaseSn){
+			  this.state == option.state
+			  uni.setNavigationBarTitle({
+			  	title: '采购订单详情'
+			  })
+			  const stateText = {'WAIT_AUDIT':'待审核','AUDIT_REJECT':'审核不通过','WAIT_OUT_WAREHOUSE':'待收货','FINISH':'已完结'}
+			  this.statusText = stateText[option.state]
+			  this.statusIcon = option.state == 'FINISH' ? 'checkmark-circle' : 'hourglass'
+			  this.info = this.$store.state.vuex_tempData
+			  this.statusMessage = option.state == 'FINISH' || option.state == 'AUDIT_REJECT' ? '' : '请耐心等待汽配经销商进行配送'
+			  // 获取明细
+			  this.getDetailList(option.purchaseSn)
+		  }else{
+			  const data = this.$store.state.vuex_tempData
+			  if(data){
+				  this.info = data
+				  this.partList = data.detailList
+			  }
+			  uni.setNavigationBarTitle({
+			  	title: ''
+			  })
+			  this.statusText = '提交成功'
+			  this.statusIcon = 'checkmark-circle'
+		  } 
+		  
 		  // 更改标题栏背景色
 		  uni.setNavigationBarColor({
 		  	frontColor: '#ffffff',
-		  	backgroundColor: this.state!= 'error' ? '#066cff':'#ff5500',
+		  	backgroundColor: this.state!= 'error'&&this.state!= 'AUDIT_REJECT' ? '#066cff':'#ff5500',
 		  })
 	   },
-	   onShow() {
-		 this.statusText = '提交成功'
-		 this.statusIcon = 'checkmark-circle'
-	   },
 	   onUnload() {
 	   	this.$store.state.vuex_tempData = null
 	   },
@@ -110,6 +136,17 @@
 		   }
 	   },
 	   methods: {
+		 getDetailList(sn){
+		   uni.showLoading({
+		   	title: '加载中'
+		   })
+		   purchaseQueryDetailPage({purchaseSn: sn,pageNo:1,pageSize:9000}).then(res => {
+				uni.hideLoading()
+				if(res.status == 200){
+					this.partList = res.data ? res.data.list : []
+				}
+		   }) 
+		 },
 		 message(title){
 		 	uni.showToast({
 		 		icon:'none',
@@ -149,36 +186,13 @@
 					}
 				}
 				.messageText{
-					font-size: 30upx;
+					font-size: 28upx;
 					text-align: center;
 					text{
-						color: #ffaa00;
-					}
-					padding: 10rpx 0;
-				}
-			}
-			.orderTj{
-				padding: 0 20rpx 20rpx;
-				background-color: #fff;
-				> view{
-					text-align: center;
-					border-right: 2rpx solid #eee;
-					width: 50%;
-					color: #666E75;
-					.redText{
-						color: #FB1E1E;
-					}
-					&:last-child{
-						border: 0;
-					}
-					> view{
-						color: #666E75;
-						&:first-child{
-							font-size: 56rpx;
-						}
+						color: #f3e781;
 					}
+					padding: 20rpx 0;
 				}
-				border-radius: 20rpx 20rpx 0 0;
 			}
 		}
 		.info{
@@ -265,21 +279,10 @@
 					justify-content: space-between;
 					color: #666;
 					> view{
-						&:first-child{
-							font-size: 28rpx;
-							text{
-								margin-right: 30rpx;
-							}
-						}
-					}
-					.item-no{
 						font-size: 28rpx;
-						background: rgba(3, 54, 146, 0.15);
-						color: #033692;
-						border-radius: 100rpx;
-						padding: 2rpx 30rpx;
-						margin-right: 20rpx;
-						display: block;
+						text{
+							margin-right: 10rpx;
+						}
 					}
 				}
 			}

+ 26 - 95
pagesB/procureOrderList.vue

@@ -15,36 +15,22 @@
 							 @click="viewRow(item)"
 							>
 								<view class="check-row align-center justify_between">
-									<view class="orderNo">{{item.tempNo}}</view>
+									<view class="orderNo">{{item.purchaseNo}}</view>
 									<view class="times">{{item.createDate}}</view>
 								</view>
-								 <view class="check-row flex align-center">
-									 <view class="carImage flex align-center">
-										 <u-image :src="item.vehicleLogo" border-radius="30" width="100" height="100" bg-color="#EBEBEB" ></u-image> 
-									 </view>
-									 <view>
-										 <view class="carModel flex align-center" v-if="item.vehicleNumber" >
-										 	<view><carNo color="#0055ff" :val="item.vehicleNumber"></carNo></view>
-											<text style="margin-left: 20rpx;" v-if="item.vehicleModel">{{item.vehicleModel.split(' ')[0]}}</text>
-										 </view>
-										  <view class="carModel flex" v-if="!item.vehicleNumber" >
-											 <text>{{item.vehicleModel}}</text>
-										  </view>
-										  <view class="carVin flex align-center">
-											  VIN码:{{item.vin||'暂无'}}
-											  <text v-if="item.vin" @click.stop="copyVin(item.vin)">复制</text>
-										  </view>
-									 </view>
+								 <view class="check-row flex align-center justify_between">
+									 <view>总款数:{{item.totalCategory}}</view>
+									 <view>总金额:<text class="price">¥{{item.totalAmount}}</text></view>
 								 </view>
 								 <view class="check-row">
 									 <view class="nums">
-										 {{item.totalQty}}件商品
+										 共{{item.totalQty}}件商品
 									 </view>
 									 <view style="text-align: right;">
-										 <span v-if="item.billState == 'WAIT_AUDIT'">待审核</span>
-										 <span v-if="item.billState == 'AUDIT_REJECT'">审核不通过</span>
-										 <span v-if="item.billState == 'WAIT_OUT_WAREHOUSE'">待收货</span>
-										 <span v-if="item.billState == 'FINISH'">已完结</span>
+										 <span v-if="item.billStatus == 'WAIT_AUDIT'">待审核</span>
+										 <span v-if="item.billStatus == 'AUDIT_REJECT'">审核不通过</span>
+										 <span v-if="item.billStatus == 'WAIT_OUT_WAREHOUSE'">待收货</span>
+										 <span v-if="item.billStatus == 'FINISH'">已完结</span>
 									 </view>
 								 </view>
 							 </view>
@@ -60,14 +46,10 @@
 </template>
 
 <script>
-	import carNo from '@/components/carNo.vue'
-	import { getShelfTempBillList, shelfTempTotalWaitQty } from '@/api/shelf.js'
-	import moment from 'moment'
+	import { purchaseQueryPage } from '@/api/purchase.js'
 	export default {
-		components: {carNo},
 		data() {
 			return {
-				theme:'',
 				status: 'loading',
 				noDataText: '暂无数据',
 				tabList: [
@@ -87,8 +69,8 @@
 						count: 0
 					  },
 				  ],
-				current: 0,
-				swiperCurrent: 0,
+				current: 1,
+				swiperCurrent: 1,
 				// 查询条件
 				pageNo: 1,
 				pageSize: 10,
@@ -97,9 +79,9 @@
 			}
 		},
 		onLoad() {
+			this.$store.state.vuex_tempData = null
 			let _this = this
 			_this.pageInit()
-			_this.theme = getApp().globalData.theme
 			uni.$on('refreshOrder',function(data){
 				 _this.list = []
 				 _this.status = "loading"
@@ -107,12 +89,6 @@
 			})
 		},
 		methods:{
-			// 复制
-			copyVin(vin){
-				uni.setClipboardData({
-					data: vin||'',
-				})
-			},
 			message(title){
 				uni.showToast({
 					icon:'none',
@@ -123,15 +99,12 @@
 				this.total = 0
 				this.pageNo = 1
 				this.getRow()
-				// 获取总条数
-				this.getWaitTotal()
 			},
 			// tabs通知swiper切换
 			tabsChange(index) {
 				this.swiperCurrent = index;
 			},
 			swiperChange(event){
-				console.log(event.detail)
 				this.list = []
 				this.status = "loading"
 			},
@@ -153,7 +126,6 @@
 			},
 			// scroll-view到底部加载更多
 			onreachBottom() {
-				console.log(this.list.length, this.total)
 				if(this.list.length < this.total){
 					this.pageNo += 1
 					this.getRow()
@@ -161,13 +133,6 @@
 					this.status = "nomore"
 				}
 			},
-			checkNums (states, i){
-			  if(states){
-				  let arr = states.split(',')
-				  return arr[i]
-			  }
-				return 0
-			},
 			// 查询列表
 			getRow (pageNo) {
 			  let _this = this
@@ -180,13 +145,13 @@
 			  }
 			  // 状态条件
 			  if(this.swiperCurrent == 1){
-				  params.billStateList = ['WAIT_AUDIT','AUDIT_REJECT','WAIT_OUT_WAREHOUSE']
+				  params.billStatusList = ['WAIT_AUDIT','AUDIT_REJECT','WAIT_OUT_WAREHOUSE']
 			  }
 			  if(this.swiperCurrent == 2){
-				  params.billStateList = ['FINISH']
+				  params.billStatusList = ['FINISH']
 			  }
 			  this.status = "loading"
-			  getShelfTempBillList(params).then(res => {
+			  purchaseQueryPage(params).then(res => {
 				if (res.code == 200 || res.status == 204 || res.status == 200) {
 				  if(_this.pageNo>1){
 					  _this.list = _this.list.concat(res.data.list || [])
@@ -194,6 +159,10 @@
 					  _this.list = res.data.list || []
 				  }
 				  _this.total = res.data.count || 0
+				  // 待收货
+				  if(_this.swiperCurrent == 1){
+					  _this.tabList[1].count = _this.total
+				  }
 				} else {
 				  _this.list = []
 				  _this.total = 0
@@ -204,14 +173,10 @@
 			},
 			// 详细页
 			viewRow(item){
+				this.$store.state.vuex_tempData = item
 				uni.navigateTo({
-					url: "/pagesA/digitalShelf/tempOrderList/orderDetail?orderSn="+item.tempSn+"&state="+(item.billState == 'FINISH'?1:0)
+					url: "/pagesB/procureOrder?purchaseSn="+item.purchaseSn+"&state="+item.billStatus
 				})
-			},
-			// 获取待拿货数量
-			async getWaitTotal(){
-				 const ret = await shelfTempTotalWaitQty({billStateList:['WAIT_AUDIT','AUDIT_REJECT','WAIT_OUT_WAREHOUSE']}).then(res => res.data)
-				 this.tabList[1].count = ret || 0
 			}
 		}
 	}
@@ -263,44 +228,10 @@
 						}
 					}
 					> view{
-						.carModel{
-							color: #222222;
-							font-size: 32upx;
-							font-weight: bold;
-							line-height: normal;
-							margin-bottom: 10rpx;
-						}
-						.carVin{
-							color: #666E75;
-							font-size: 24upx;
-							text{
-								background-color: #EBEBEB;
-								border-radius: 100rpx;
-								padding: 0 20rpx;
-								color: #033692;
-								font-size: 20rpx;
-								display: flex;
-								align-items: center;
-								justify-content: center;
-								margin-left: 20rpx;
-							}
-						}
-					}
-					.carImage{
-						padding-right: 20rpx;
-					}
-					.action{
-						padding: 0 30rpx;
-						color: #fff;
-						border-radius: 100rpx;
-						margin-left: 15upx;
-						font-size: 24upx;
-						&:after{
-							border: 0;
-						}
-						&:active{
-							opacity: 0.5;
-						}
+						 .price{
+							 color: red;
+							 font-size: 28upx;
+						 }
 					}
 					 
 					.finish{

+ 11 - 2
pagesB/promoDetail.vue

@@ -442,18 +442,22 @@
 					border-radius: 10upx;
 					box-shadow: 1px 1px 3px #EEEEEE;
 					height: 100%;
+					display: flex;
+					flex-direction: column;
 					> view{
 						&:first-child{
 							position: relative;
 							overflow: hidden;
 						}
 						&:last-child{
-							padding: 20rpx;
+							padding: 20rpx 20rpx 60rpx 20rpx;
+							position: relative;
+							flex-grow: 1;
 							.product-name{
 								font-size: 28rpx;
 							}
 							.product-guige{
-								margin: 10rpx 0;
+								margin: 10rpx 0 20rpx 0;
 								color: #666;
 								text{
 									margin-right: 10rpx;
@@ -464,6 +468,11 @@
 							display: flex;
 							justify-content: space-between;
 							align-items: center;
+							position: absolute;
+							bottom: 20rpx;
+							left: 0;
+							width: 100%;
+							padding: 0 20rpx;
 						}
 					}
 				}