Просмотр исходного кода

采购单详情页显示优化
囤货时显示优化

shish 5 лет назад
Родитель
Сommit
af4c931dc1

+ 13 - 8
hdApp/src/components/module/app-commodity.vue

@@ -1,8 +1,5 @@
 <template>
 <template>
 	<view class="item-cmd_bx" @click="customNum">
 	<view class="item-cmd_bx" @click="customNum">
-		<!--		<view class="img_bx" @click="addEvents">-->
-		<!--			<app-img  :src="info.cover" alt="商品图" mode="aspectFit" :height="160" />-->
-		<!--		</view>-->
 		<view class="img_bx" style="background:#eeeeee" @click.stop="showBigImg">
 		<view class="img_bx" style="background:#eeeeee" @click.stop="showBigImg">
 			<image :src="info.cover" v-if="isImg"></image>
 			<image :src="info.cover" v-if="isImg"></image>
 		</view>
 		</view>
@@ -30,7 +27,7 @@
 						</text>
 						</text>
 						<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click.stop="addEvents"></i>
 						<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click.stop="addEvents"></i>
 					</view>
 					</view>
-					<text style="padding-right: 55rpx">还剩 {{ info.stock }}</text>
+					<text style="padding-right: 55rpx">还剩 {{ currentStock }}</text>
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="num-open_bx flex-space" v-if="type == COMMODITY_TYPE.CHANGE">
 			<view class="num-open_bx flex-space" v-if="type == COMMODITY_TYPE.CHANGE">
@@ -105,22 +102,24 @@ export default {
 			type: Boolean,
 			type: Boolean,
 			default: false
 			default: false
 		},
 		},
+		showMaxStock:{
+			type:Number,
+			default:0
+		}
 	},
 	},
 	data() {
 	data() {
 		return {
 		return {
 			COMMODITY_TYPE,
 			COMMODITY_TYPE,
-			// isAllActive: false,
-			// isAllFocus: false,
 			isImg:false,
 			isImg:false,
 			isAlterMoney:false,
 			isAlterMoney:false,
 			isAloneAllActive: false,
 			isAloneAllActive: false,
 			isAloneAllFocus: false,
 			isAloneAllFocus: false,
-
 			isShowSucceed:false,
 			isShowSucceed:false,
 			changeAutoPrice:'',
 			changeAutoPrice:'',
 			showPrice:0.00,
 			showPrice:0.00,
 			oldPrice:0.00,
 			oldPrice:0.00,
-			ifFocus:false
+			ifFocus:false,
+			currentStock:0
 		};
 		};
 	},
 	},
 	created() {},
 	created() {},
@@ -133,6 +132,12 @@ export default {
 		}
 		}
 		this.showPrice = this.info.price;
 		this.showPrice = this.info.price;
 		this.oldPrice = (Number(this.info.cost) + Number(this.info.addPrice)).toFixed(2)
 		this.oldPrice = (Number(this.info.cost) + Number(this.info.addPrice)).toFixed(2)
+
+		this.currentStock = this.info.stock
+		if(this.info.stock > this.showMaxStock){
+			this.currentStock  = this.showMaxStock
+		}
+
 	},
 	},
 	methods: {
 	methods: {
 		//input点击删除按键
 		//input点击删除按键

+ 9 - 2
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -58,6 +58,7 @@
 									@addOneEvent="addCustomNumEvent"
 									@addOneEvent="addCustomNumEvent"
 									@del="delEvent"
 									@del="delEvent"
 									@showBigCover="showBigCover"
 									@showBigCover="showBigCover"
+									:showMaxStock="showMaxStock"
 								></Commondity>
 								></Commondity>
 							</view>
 							</view>
 							<!-- <Commondity
 							<!-- <Commondity
@@ -131,7 +132,7 @@ import { getShop } from '@/api/common/index'
 // import suitProductMins from "@/mixins/ghsProduct";
 // import suitProductMins from "@/mixins/ghsProduct";
 import SelPopup from "@/components/sel-popup.vue";
 import SelPopup from "@/components/sel-popup.vue";
 export default {
 export default {
-	name: "Billing", // 开单
+	name: "cgProduct", // 开单
 	components: {
 	components: {
 		AppTabs,
 		AppTabs,
 		AppSearchModule,
 		AppSearchModule,
@@ -171,7 +172,8 @@ export default {
 			},
 			},
 			myClass: 'fadeIn',
 			myClass: 'fadeIn',
 			shopId:0,
 			shopId:0,
-			infoData:{}
+			infoData:{},
+			showMaxStock:0
 		};
 		};
 	},
 	},
 	onPullDownRefresh() {
 	onPullDownRefresh() {
@@ -180,6 +182,7 @@ export default {
 		});
 		});
 	},
 	},
 	computed: {
 	computed: {
+		...mapGetters(["getDictionariesInfo"]),
 		confirmContent() {
 		confirmContent() {
 			let content = "确认下一步?";
 			let content = "确认下一步?";
 			if (this.hasNoStock) {
 			if (this.hasNoStock) {
@@ -196,6 +199,10 @@ export default {
 			}
 			}
 		}
 		}
 	},
 	},
+	onLoad() {
+		console.log('this.showMaxStock',this.showMaxStock,this.getDictionariesInfo)
+		this.showMaxStock = this.getDictionariesInfo.showMaxStock;
+	},
 	onUnload() {
 	onUnload() {
 		this.resetSelectInfoByType(this.pageType)
 		this.resetSelectInfoByType(this.pageType)
 	},
 	},

+ 1 - 2
hdApp/src/pagesPurchase/purDetails.vue

@@ -112,7 +112,6 @@
                 :src="s.cover"
                 :src="s.cover"
                 alt=""
                 alt=""
               />
               />
-
               <view class="item-info">
               <view class="item-info">
                 <view class="info-line">
                 <view class="info-line">
                   <text class="item-name">{{ s.name }}</text>
                   <text class="item-name">{{ s.name }}</text>
@@ -124,7 +123,7 @@
                 </view>
                 </view>
                 <view class="info-line">
                 <view class="info-line">
                   <text class="item-type">{{ s.property }}</text>
                   <text class="item-type">{{ s.property }}</text>
-                  <text class="item-count">{{ `${s.bigNum}/${s.smallNum}` }}</text>
+                  <text class="item-count"><text v-if="s.bigNum >0">{{s.bigNum}}扎*{{s.price}}</text><text v-if="s.smallNum>0" style="margin-left:10rpx;">{{s.smallNum}}支*{{s.smallPrice}}</text></text>
                 </view>
                 </view>
               </view>
               </view>
             </view>
             </view>