Procházet zdrojové kódy

供货商开单可修改金额

jiangfeng před 5 roky
rodič
revize
f7765128f5

+ 10 - 1
ghsApp/src/admin/billing/affirm.vue

@@ -214,6 +214,7 @@ export default {
       });
     }
     this.modifyPrice = this.allPrice.toFixed(2);
+    this.courier(2);
   },
 	onShow(){
 		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
@@ -332,13 +333,17 @@ export default {
 							},
 						});
 					}else{
+    		let price = 0;
 						let product = this.selectList.map((ele) => {
+							price += ele.bigCount * Number(ele.bigPrice);
+							price += ele.smallCount * Number(ele.smallPrice);
 							return {
 								productId: ele.id,
 								bigNum: ele.bigCount,
 								smallNum: ele.smallCount,
 								classId: ele.classId,
 								itemId: ele.itemId,
+								price: ele.userPrice>0?ele.userPrice:price,
 							};
 						});
 						console.log(product)
@@ -367,14 +372,18 @@ export default {
         // 进行表单检查
         this.form;
         let formData = this.form;
-
+							let price = 0;
         const product = this.selectList.map((ele) => {
+
+									price += ele.bigCount * Number(ele.bigPrice);
+									price += ele.smallCount * Number(ele.smallPrice);
           return {
             productId: ele.id,
             bigNum: ele.bigCount,
             smallNum: ele.smallCount,
             classId: ele.classId,
             itemId: ele.itemId,
+												price: ele.userPrice>0?ele.userPrice:price,
           };
         });
         formData.product = JSON.stringify(product);

+ 19 - 11
ghsApp/src/admin/billing/index.vue

@@ -35,12 +35,9 @@
 								<Commondity v-if="classItem.isActive"
 																				:offVerifyRepertory="true"
 									:info="productItem"
-									:bigCount="
-										getSelectItemById(productItem.id, classItem.classId).bigCount
-									"
-									:smallCount="
-										getSelectItemById(productItem.id, classItem.classId).smallCount
-									"
+									:bigCount="getSelectItemById(productItem.id, classItem.classId).bigCount"
+									:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
+									:userPrice="getSelectItemById(productItem.id, classItem.classId).userPrice"
 									@customNum="customNum"
 									@add="addEvent"
 									@addOneEvent="addCustomNumEvent"
@@ -71,9 +68,12 @@
 					<view class="kc"> 库存 {{ customData.stock }} </view>
 					<view class="num_bx">
 						<!--<input v-model="customData.bigCount" @focus="customData.bigCount = null" type="number" />扎-->
-						<input v-model="customData.bigCount" :focus="isFocus" type="number" />扎
-
-						<input v-model="customData.smallCount"  type="number" style="margin-left:24upx" />支
+						<input v-model="customData.bigCount" @input="countPrice" :focus="isFocus" type="number" />扎
+						<input v-model="customData.smallCount" @input="countPrice" type="number" style="margin-left:24upx" />支
+					</view>
+					<view class="num_bx">
+						<input style="width: 498rpx" v-model="customData.userPrice" @focus="customData.userPrice = null" type="number" placeholder="金额" />
+						<text style="margin-left: 20rpx">元</text>
 					</view>
 				</view>
 			</template>
@@ -121,7 +121,8 @@ export default {
 			offVerifyRepertory:true,
 			customData: {
 				bigCount: 0,
-				smallCount: 0
+				smallCount: 0,
+				userPrice: 0,
 			},
 			showSubmitModel: false
 		};
@@ -141,6 +142,12 @@ export default {
 	},
 
 	methods: {
+		countPrice() {
+			let price = 0;
+			price += this.customData.bigCount * Number(this.customData.bigPrice);
+			price += this.customData.smallCount * Number(this.customData.smallPrice);
+			this.customData.userPrice = price.toFixed(2)
+		},
 		//自定义数量
 		customNum(info) {
 			this.isModel = true;
@@ -149,6 +156,7 @@ export default {
 			this.$nextTick(()=>{
 				this.customData.smallCount = 	this.customData.smallCount==0?null:this.customData.smallCount;
 				this.customData.bigCount = 	this.customData.bigCount==0?null:this.customData.bigCount;
+				this.customData.userPrice = 	this.customData.userPrice==0?null:this.customData.userPrice;
 				this.isFocus = true;
 			})
 		},
@@ -350,7 +358,7 @@ export default {
 		& .num_bx {
 			display: flex;
 			align-items: center;
-			margin-bottom: 80px;
+			margin-bottom: 40px;
 			& > input {
 				width: 212px;
 				height: 80px;

+ 14 - 7
ghsApp/src/components/module/app-commodity.vue

@@ -14,7 +14,7 @@
 				<view style="text-align: right" >
 					<view class="open-bx" >
 						<i class="iconfont iconjian" :class="delAnimationData?'animation':''" @click.stop="delEvent" v-if="bigCount > 0 || smallCount > 0"></i>
-						<text class="num" @click.stop="customNum">
+						<text class="num" >
 							<text v-if="bigCount > 0 || smallCount > 0">{{ `${bigCount}` }}</text>
 							<text v-if="smallCount > 0">/</text>
 							<text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
@@ -85,6 +85,9 @@ export default {
 		smallCount: {
 			type: Number,
 			default: 0
+		},userPrice: {
+			type: Number,
+			default: 0
 		},
 		autoPrice: {},
 		offPrice: {
@@ -230,17 +233,21 @@ export default {
 				let params = {
 					...this.info,
 					bigCount: this.bigCount,
-					smallCount: this.smallCount
+					smallCount: this.smallCount,
+					userPrice: this.userPrice,
 				};
 
 				this.$emit("addOneEvent", this.info,params);
+			}else{
+				this.$emit("customNum", {
+					...this.info,
+					bigCount: this.bigCount,
+					smallCount: this.smallCount,
+					userPrice: this.userPrice,
+				});
 			}
 			
-			this.$emit("customNum", {
-				...this.info,
-				bigCount: this.bigCount,
-				smallCount: this.smallCount
-			});
+
 		}
 	}
 };

+ 15 - 5
ghsApp/src/mixins/product.js

@@ -72,8 +72,13 @@ export default {
 						!this.$util.isEmpty(itemInfo.bigPrice) &&
 						!this.$util.isEmpty(itemInfo.smallPrice)
 					) {
-						price += item.bigCount * Number(itemInfo.bigPrice);
-						price += item.smallCount * Number(itemInfo.smallPrice);
+						if(item.userPrice>0){
+							price += item.userPrice;
+						}else{
+							price += item.bigCount * Number(itemInfo.bigPrice);
+							price += item.smallCount * Number(itemInfo.smallPrice);
+						}
+
 					}
 				}
 			}
@@ -140,7 +145,8 @@ export default {
 						element.child.forEach(child => {
 							child.classId = element.classId;
 							child.className = element.className;
-							child.realityWeight = 0
+							child.realityWeight = 0;
+							child.userPrice = 0;
 						});
 				});
 				this.productInfo = data;
@@ -364,14 +370,16 @@ export default {
 					bigCount: null, //扎数
 					smallCount: null, //支数
 					autoPrice: null, //调价价格
-					realityWeight: null //调价价格
+					realityWeight: null, //调价价格
+					userPrice: null, //调价价格
 				};
 				list.push(params);
-				console.log(list)
+				console.log(list,'-----------')
 				if(type!='noAdd'){
 					this.setSelectInfoByType({ type: this.pageType, info: list });
 				}
 				this.$nextTick(()=>{
+					console.log(9999)
 					this.customNum(params1)
 				})
 		},
@@ -454,6 +462,7 @@ export default {
 							list[index].bigCount = Number(item.bigNum);
 							list[index].smallCount = Number(item.smallNum);
 							list[index].realityWeight = Number(item.realityWeight),
+							list[index].userPrice = Number(item.userPrice),
 							list[index].itemPrice = item.itemPrice?Number(item.itemPrice):'';
 						}
 					}
@@ -463,6 +472,7 @@ export default {
 						bigCount: Number(item.bigCount),
 						smallCount: Number(item.smallCount),
 						realityWeight: Number(item.realityWeight),
+						userPrice: Number(item.userPrice),
 						itemPrice: item.itemPrice?Number(item.itemPrice):''
 					};
 

+ 26 - 3
ghsApp/src/pagesOrder/detail.vue

@@ -107,7 +107,7 @@
 									<text class="item-price">
 										<text class="unit">¥</text>
 
-										<text class="price">{{ s.price }}</text>
+										<text class="price">{{s.userPrice>0?s.userPrice:s.price }}</text>
 									</text>
 								</view>
 								<view class="info-line">
@@ -120,7 +120,8 @@
 					<view class="summary-bar">
 						<view class="operate-view" ></view>
 						<view class="describe-view">
-							共{{ detailInfo.productStat.kind}}种, 共{{ detailInfo.productStat.bigNum }}扎{{detailInfo.productStat.smallNun}}支,合计 ¥<text class="price">{{ detailInfo.productStat.totalPrice }}</text>
+							<!--共{{ detailInfo.productStat.kind}}种, 共{{ detailInfo.productStat.bigNum }}扎{{detailInfo.productStat.smallNun}}支,合计 ¥<text class="price">{{ detailInfo.productStat.totalPrice }}</text>-->
+							共{{ detailInfo.productStat.kind}}种, 共{{ detailInfo.productStat.bigNum }}扎{{detailInfo.productStat.smallNun}}支,合计 ¥<text class="price">{{ userPrice.toFixed(2) }}</text>
 						</view>
 					</view>
 				</view>
@@ -207,6 +208,7 @@ export default {
 			pageType: "order_change",
 			autoLoad: false,
 			stepActive: 0,
+			userPrice: 0,
 			form: {
 				name: ""
 			},
@@ -224,6 +226,19 @@ export default {
 		this.init();
 	},
 	methods: {
+		totalPriceFun(){
+			let list = this.detailInfo.product;
+			let product = 0;
+			list.forEach(ele=>{
+				console.log(ele)
+				if(ele.userPrice>0){
+					product += ele.userPrice;
+				}else{
+					product += ele.price;
+				}
+			})
+			return product.toFixed(2)
+		},
 		freeShipModalClick() {
 			freeShipping({ id: this.detailInfo.id }).then(res => {
 				this.init();
@@ -333,7 +348,15 @@ export default {
 					id: this.option.id
 				});
 				this.detailInfo = res.data;
-
+				console.log(this.detailInfo)
+				this.detailInfo.product.forEach(ele=>{
+					console.log(ele)
+					if(ele.userPrice>0){
+						this.userPrice += Number(ele.userPrice);
+					}else{
+						this.userPrice += Number(ele.price);
+					}
+				})
 				const { product } = this.detailInfo;
 
 				if (product) {