Browse Source

修改bug

chenrui 7 months ago
parent
commit
172518a670
1 changed files with 40 additions and 22 deletions
  1. 40 22
      pages/sales/edit.vue

+ 40 - 22
pages/sales/edit.vue

@@ -60,10 +60,10 @@
 								<view class="sales-item-name">
 									<view v-if="(isOwerEdit && item.oosFlag == 1) || (isOwerEdit && item.oosFlag == 1)" class="sign" :style="{backgroundColor: $config('errorColor')}">急</view>
 									<view v-if="item.price < item.cost" class="sign" :style="{backgroundColor: $config('warringColor')}">亏</view>
-									<view v-if="!isOwerEdit&&!isAudit&&(!item.currentStockQty || item.currentStockQty < item.qty)" class="sign" :style="{backgroundColor: $config('errorColor')}">缺</view>
-									<view class="sign1" v-if="detailData&&detailData.payOnlineFlag==1&&item.promoProductType=='GIFT_PRODUCT'" :style="{backgroundColor: $config('successColor')}">赠</view>
-									<view class="sign1" v-if="detailData&&detailData.payOnlineFlag==1&&item.promoProductType=='TICKET_PRODUCT'" :style="{backgroundColor: $config('orangeColor')}">券</view>
-									<view class="sign1" v-if="detailData&&detailData.payOnlineFlag==1&&item.promoProductType=='SPECIAL_PRODUCT'"  :style="{backgroundColor: $config('warringColor')}">特</view>
+									<view v-if="!isOwerEdit&&!isAudit&&(!item.currentStockQty || item.currentStockQty < item.qty)" class="sign" :style="{border:setColor.borderColor,backgroundColor:setColor.bgColor,color:setColor.fontColor}">缺</view>
+									<view class="sign1" v-if="detailData&&detailData.payOnlineFlag==1&&item.promoProductType=='GIFT_PRODUCT'" :style="{border:setColor.borderColor1,backgroundColor:setColor.bgColor1,color:setColor.fontColor1}">赠</view>
+									<view class="sign1" v-if="detailData&&detailData.payOnlineFlag==1&&item.promoProductType=='TICKET_PRODUCT'" :style="{border:setColor.borderColor2,backgroundColor:setColor.bgColor2,color:setColor.fontColor2}">券</view>
+									<view class="sign1" v-if="detailData&&detailData.payOnlineFlag==1&&item.promoProductType=='SPECIAL_PRODUCT'"  :style="{border:setColor.borderColor3,backgroundColor:setColor.bgColor3,color:setColor.fontColor3}">特</view>
 									<view class="nameInfo">{{item.productName || '--'}}</view>
 								</view>
 								<view class="sales-item-txt">{{item.productCode || '--'}}</view>
@@ -153,6 +153,20 @@
 				productInfo: null,  // 编辑产品需要的参数
 				editInfo: null,  // 添加/编辑 提交的值
 				commonType: 1,  // 公共弹框类型  1删除产品,2删除销售单,3编辑产品时库存不足
+				setColor:{
+					borderColor:'1upx solid #E70012',
+					fontColor:'#E70012',
+					bgColor:'rgba(236,0,18,.2)',
+					borderColor1:'1upx solid #13C442',
+					fontColor1:'#13C442',
+					bgColor1:'rgba(19,196,66,.2)',
+					borderColor2:'1upx solid #FF5500',
+					fontColor2:'#FF5500',
+					bgColor2:'rgba(255,85,0,.2)',
+					borderColor3:'1upx solid #f3bb12',
+					fontColor3:'#f3bb12',
+					bgColor3:'rgba(243,187,18,.2)'
+				}
 			}
 		},
 		onLoad(opt) {
@@ -189,14 +203,14 @@
 			getList(pageNo){
 				const _this = this
 				if (pageNo) {
-					this.pageNo = pageNo
+					_this.pageNo = pageNo
 				}
 				let params = {
-					pageNo: this.pageNo,
-					pageSize: this.pageSize,
-					salesBillSn: this.pageData.data && this.pageData.data.salesBillSn
+					pageNo: _this.pageNo,
+					pageSize:_this.pageSize,
+					salesBillSn: _this.pageData.data && _this.pageData.data.salesBillSn
 				}
-				this.status = "loading"
+				_this.status = "loading"
 				salesDetailList(params).then(res => {
 					if (res.status == 200) {
 						if(res.data && res.data.list){
@@ -205,21 +219,21 @@
 								item.productCode = item.productEntity && item.productEntity.code || item.dealerProductEntity && item.dealerProductEntity.code
 								item.productUnit = item.productEntity && item.productEntity.unit || item.dealerProductEntity && item.dealerProductEntity.unit
 							})
-							if(this.pageNo>1){
-								this.listData = this.listData.concat(res.data && res.data.list || [])
+							if(_this.pageNo>1){
+								_this.listData = _this.listData.concat(res.data && res.data.list || [])
 							}else{
-								this.listData = res.data.list || []
+								_this.listData = res.data.list || []
 							}
 						}else{
-							this.listData = []
+							_this.listData = []
 						}
-						this.totalNum = res.data && res.data.count || 0
+						_this.totalNum = res.data && res.data.count || 0
 					} else {
-						this.listData = []
-						this.totalNum = 0
-						this.noDataText = res.message
+						_this.listData = []
+						_this.totalNum = 0
+						_this.noDataText = res.message
 					}
-					this.status = "loadmore"
+					_this.status = "loadmore"
 				})
 			},
 			// scroll-view到底部加载更多
@@ -483,19 +497,23 @@
 							.sales-item-name{
 								display:flex;
 								.sign{
-									border-radius: 50%;
+									border-radius: 15%;
 									width: 40upx;
-									height: 40upx;
+									height:34upx;
+									line-height: 34upx;
 									text-align: center;
 									color:#ffffff;
+									font-size: 22upx;
 								}
 								.sign1{
-									border-radius: 50%;
+									border-radius: 15%;
 									width: 40upx;
-									height: 40upx;
+									height: 34upx;
+									line-height: 34upx;
 									text-align: center;
 									color:#ffffff;
 									margin:0 5px;
+									font-size: 22upx;
 								}
 								.nameInfo{
 									max-width: 80%;