Эх сурвалжийг харах

Merge branch 'master' of http://git.huaml.com/zhh/front-end

wangning 5 жил өмнө
parent
commit
a2b26a2114

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

@@ -322,7 +322,7 @@ export default {
 									wastage({product:JSON.stringify(product)}).then((res) => {
 									wastage({product:JSON.stringify(product)}).then((res) => {
 										self.resetSelectInfoByType(self.pageType);
 										self.resetSelectInfoByType(self.pageType);
 										const {data: { id, orderSn },} = res;
 										const {data: { id, orderSn },} = res;
-										let url = `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
+										let url = `/admin/billing/result?title=报损成功&orderId=${id}&orderSn=${orderSn}`;
 										uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },
 										uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },
 										});
 										});
 									});
 									});

+ 4 - 4
ghsApp/src/admin/billing/result.vue

@@ -1,11 +1,11 @@
 <template>
 <template>
-	<appResult>
+	<appResult :title="option.title">
 <!--		<button class="admin-button-com blue big" @click="gotoOrderDetails">发货详情</button>-->
 <!--		<button class="admin-button-com blue big" @click="gotoOrderDetails">发货详情</button>-->
-		<button class="admin-button-com blue big" @click="gotoOrderSend">发货</button>
+		<button v-if="option.title!='报损成功'" class="admin-button-com blue big" @click="gotoOrderSend">发货</button>
 
 
 <!--		<button class="admin-button-com big" @click="gotoOrderPrint">打印单据</button>-->
 <!--		<button class="admin-button-com big" @click="gotoOrderPrint">打印单据</button>-->
-		<button class="admin-button-com big" @click="gotoOrderDetails">订单详情</button>
-		<button class="admin-button-com big" @click="gotoOrderList">订单列表</button>
+		<button v-if="option.title!='报损成功'" class="admin-button-com big" @click="gotoOrderDetails">订单详情</button>
+		<button v-if="option.title!='报损成功'" class="admin-button-com big" @click="gotoOrderList">订单列表</button>
 		<button class="admin-button-com big" @click="gotoPlace">继续开单</button>
 		<button class="admin-button-com big" @click="gotoPlace">继续开单</button>
 	</appResult>
 	</appResult>
 </template>
 </template>

+ 1 - 1
ghsApp/src/components/plugin/modal.vue

@@ -136,7 +136,7 @@ export default {
 		handleClickCancel() {
 		handleClickCancel() {
 			// if (!this.maskClosable)return;
 			// if (!this.maskClosable)return;
 			// this.$emit('cancel')
 			// this.$emit('cancel')
-			// this.$emit('click', {index: 0})
+			this.$emit('click', {index: 3})
 			// if (!this.maskClosable)return;
 			// if (!this.maskClosable)return;
 		}
 		}
 	}
 	}

+ 19 - 8
ghsApp/src/mixins/product.js

@@ -176,6 +176,7 @@ export default {
 					params = { ...params, ...extendInfo };
 					params = { ...params, ...extendInfo };
 				}
 				}
 				const { data } = await getProductDataApi(params);
 				const { data } = await getProductDataApi(params);
+				this.filterProductInfo = '';
 				data.forEach(element => {
 				data.forEach(element => {
 					element.child &&
 					element.child &&
 						element.child.forEach(child => {
 						element.child.forEach(child => {
@@ -429,9 +430,11 @@ export default {
 					...info,
 					...info,
 					bigCount: 0, //扎数
 					bigCount: 0, //扎数
 					smallCount: 0, //支数
 					smallCount: 0, //支数
-					autoPrice: 0 //调价价格
+					autoPrice: 0, //调价价格
+					realityWeight: 0 //调价价格
 				};
 				};
 				list.push(params);
 				list.push(params);
+				console.log(list)
 				if(type!='noAdd'){
 				if(type!='noAdd'){
 					this.setSelectInfoByType({ type: this.pageType, info: list });
 					this.setSelectInfoByType({ type: this.pageType, info: list });
 				}
 				}
@@ -466,15 +469,21 @@ export default {
 		},
 		},
 		//减去所有商品
 		//减去所有商品
 		delAllEvent(item) {
 		delAllEvent(item) {
-			const list = this.selectList;
-			for (let index = 0; index < list.length; index++) {
-				const element = list[index];
-				if (element.id == item.id ) {
-					list.splice(index, 1);
-					break;
+			let list = this.selectList;
+			if(list.length==1){
+				this.setSelectInfoByType({ type: this.pageType, info: [] });
+			}else{
+				for (let index = 0; index < list.length; index++) {
+					const element = list[index];
+					if (element.id == item.id ) {
+						list.splice(index, 1);
+						break;
+					}
 				}
 				}
+				this.setSelectInfoByType({ type: this.pageType, info: list });
 			}
 			}
-			this.setSelectInfoByType({ type: this.pageType, info: list });
+
+
 			console.log('this.selectList减去所有',this.selectList)
 			console.log('this.selectList减去所有',this.selectList)
 		},
 		},
 		// /**
 		// /**
@@ -510,6 +519,7 @@ export default {
 						) {
 						) {
 							list[index].bigCount = Number(item.bigNum);
 							list[index].bigCount = Number(item.bigNum);
 							list[index].smallCount = Number(item.smallNum);
 							list[index].smallCount = Number(item.smallNum);
+							list[index].realityWeight = Number(item.realityWeight),
 							list[index].itemPrice = item.itemPrice?Number(item.itemPrice):'';
 							list[index].itemPrice = item.itemPrice?Number(item.itemPrice):'';
 						}
 						}
 					}
 					}
@@ -527,6 +537,7 @@ export default {
 			}
 			}
 
 
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 			this.setSelectInfoByType({ type: this.pageType, info: list });
+			console.log(this.selectList,'this.selectList')
 			// this.$forceUpdate();
 			// this.$forceUpdate();
 		},
 		},
 		/**
 		/**

+ 8 - 1
ghsApp/src/pagesPurchase/add.vue

@@ -36,6 +36,7 @@
 								:bigCount=" getSelectItemById(productItem.id, classItem.classId).bigCount"
 								:bigCount=" getSelectItemById(productItem.id, classItem.classId).bigCount"
 								:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
 								:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
 								:itemPrice="getSelectItemById(productItem.id, classItem.classId).itemPrice"
 								:itemPrice="getSelectItemById(productItem.id, classItem.classId).itemPrice"
+								:realityWeight="getSelectItemById(productItem.id, classItem.classId).realityWeight"
 								@customNum="customNum"
 								@customNum="customNum"
 								@add="addEvent"
 								@add="addEvent"
 								@addOneEvent="addCustomNumEvent"
 								@addOneEvent="addCustomNumEvent"
@@ -190,6 +191,7 @@ export default {
 		//自定义数量
 		//自定义数量
 		customNum(info) {
 		customNum(info) {
 			this.isModel = true;
 			this.isModel = true;
+			console.log(info,'customData')
 			this.customData = info;
 			this.customData = info;
 			this.$nextTick(()=>{
 			this.$nextTick(()=>{
 				// this.initAllInput();
 				// this.initAllInput();
@@ -209,12 +211,17 @@ export default {
 			this.isAloneAllFocus=false;
 			this.isAloneAllFocus=false;
 			this.$nextTick(()=>{
 			this.$nextTick(()=>{
 				console.log('customData',this.customData);
 				console.log('customData',this.customData);
+				console.log('val.index',val.index);
+				if (val.index === 3) {
+					this.modalCancel();
+					this.delAllEvent(this.customData);
+					return
+				}
 				if(this.customData.bigCount==0 && this.customData.smallCount==0){
 				if(this.customData.bigCount==0 && this.customData.smallCount==0){
 					this.delAllEvent(this.customData)}
 					this.delAllEvent(this.customData)}
 
 
 				if (val.index === 0) {
 				if (val.index === 0) {
 					this.modalCancel();
 					this.modalCancel();
-					this.delAllEvent(this.customData)
 				} else {
 				} else {
 					if(this.customData.itemPrice==0||this.customData.itemPrice==''){
 					if(this.customData.itemPrice==0||this.customData.itemPrice==''){
 						uni.showToast({title:"请输入总价格",icon:"none"})
 						uni.showToast({title:"请输入总价格",icon:"none"})

+ 7 - 2
ghsApp/src/pagesPurchase/components/CommodityPurchase.vue

@@ -91,6 +91,9 @@ export default {
     itemPrice: {
     itemPrice: {
       type: Number,
       type: Number,
       default: 0
       default: 0
+    },realityWeight: {
+      type: Number,
+      default: 0
     },
     },
   },
   },
   data () {
   data () {
@@ -129,7 +132,8 @@ export default {
           ...this.info,
           ...this.info,
           bigCount: this.bigCount,
           bigCount: this.bigCount,
           smallCount: this.smallCount,
           smallCount: this.smallCount,
-          itemPrice: this.itemPrice
+          itemPrice: this.itemPrice,
+										realityWeight: this.realityWeight
         };
         };
         this.$emit("addOneEvent", this.info, params, 'noAdd');
         this.$emit("addOneEvent", this.info, params, 'noAdd');
       }
       }
@@ -137,7 +141,8 @@ export default {
         ...this.info,
         ...this.info,
         bigCount: this.bigCount,
         bigCount: this.bigCount,
         smallCount: this.smallCount,
         smallCount: this.smallCount,
-        itemPrice: this.itemPrice
+        itemPrice: this.itemPrice,
+								realityWeight: this.realityWeight
       });
       });
     }
     }
   }
   }

+ 44 - 23
ghsApp/src/pagesPurchase/details.vue

@@ -47,7 +47,7 @@
 							<view class="describe-view">
 							<view class="describe-view">
 								共{{ selectList.length }}种,
 								共{{ selectList.length }}种,
 								<!-- 共16扎9支, -->
 								<!-- 共16扎9支, -->
-								合计 ¥<text class="price">{{ allPrice }}</text>
+								合计 ¥<text class="price">{{ selectAllPrice }}</text>
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
@@ -80,41 +80,49 @@
 					</tui-list-cell> -->
 					</tui-list-cell> -->
 				</view>
 				</view>
 				<view class="module-com input-line-wrap">
 				<view class="module-com input-line-wrap">
+					<tui-list-cell class="line-cell" :hover="false">
+						<view class="tui-title ">包装重量</view>
+						<input type="digit" :disabled="!canIEdit" v-model="form.packWeight" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="公斤"/>
+					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">打包费</view>
 						<view class="tui-title ">打包费</view>
-						<input type="digit" :disabled="!canIEdit" v-model="form.packingCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.packingCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">短途运费</view>
 						<view class="tui-title ">短途运费</view>
-						<input  type="digit" :disabled="!canIEdit" v-model="form.shortCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input  type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.shortCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">长途运费</view>
 						<view class="tui-title ">长途运费</view>
-						<input  type="digit" :disabled="!canIEdit" v-model="form.longCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input  type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.longCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">提货费</view>
 						<view class="tui-title ">提货费</view>
-						<input  type="digit" :disabled="!canIEdit" v-model="form.pickCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input  type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.pickCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false">
 					<tui-list-cell class="line-cell" :hover="false">
 						<view class="tui-title ">本地运费</view>
 						<view class="tui-title ">本地运费</view>
-						<input  type="digit" :disabled="!canIEdit" v-model="form.localCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+						<input  type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.localCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
 					</tui-list-cell>
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false" :arrow="true">
 					<tui-list-cell class="line-cell" :hover="false" :arrow="true">
 						<view class="tui-title ">入库日期</view>
 						<view class="tui-title ">入库日期</view>
-						<!-- <view class="tui-input" v-if="form.province || form.city">
-							{{ form.province + "-" + form.city }}
-						</view> -->
-						<!-- <view class="tui-placeholder" v-else>请选择</view>
-						<input v-model="form.province" name="province" hidden /> -->
-						<AppDatePicker
-							v-if="canIEdit"
-							:dateVal="form.entryTime"
-							:placeholder="'请选择日期'"
-						/>
+						<AppDatePicker v-if="canIEdit" :dateVal="form.entryTime" :placeholder="'请选择日期'"/>
 						<view v-else>{{ form.entryTime || "请选择日期" }}</view>
 						<view v-else>{{ form.entryTime || "请选择日期" }}</view>
 					</tui-list-cell>
 					</tui-list-cell>
 
 
+					<tui-list-cell class="line-cell" :hover="false">
+						<view class="tui-title ">总金额</view>
+						<view>{{totalPrice}}</view>
+					</tui-list-cell>
+					<tui-list-cell class="line-cell" :hover="false">
+						<view class="tui-title ">实付金额</view>
+						<input style="border: 1px solid #eee;color: #3385FF;width: calc(100%);"  type="digit" :disabled="!canIEdit"  @focus="realMoney=''" v-model="realMoney" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
+					</tui-list-cell>
+					<tui-list-cell class="line-cell" :hover="false">
+						<view class="tui-title ">损耗减免</view>
+						<view>{{totalPrice - realMoney }}</view>
+					</tui-list-cell>
+
 					<tui-list-cell class="line-cell remark-wrap" :hover="false">
 					<tui-list-cell class="line-cell remark-wrap" :hover="false">
 						<view class="tui-title">备注</view>
 						<view class="tui-title">备注</view>
 						<view class="tui-input">
 						<view class="tui-input">
@@ -132,9 +140,10 @@
 		</view>
 		</view>
 		<view class="under-bar">
 		<view class="under-bar">
 			<view class="price-view">
 			<view class="price-view">
-				<text class="price-title">金额</text>
+				<text class="price-title">实付金额</text>
 				<text class="price-number">
 				<text class="price-number">
-					¥ <text class="large">{{ Number(allPrice) + Number(form.packingCharge) + Number(form.shortCharge) + Number(form.longCharge) + Number(form.pickCharge) + Number(form.localCharge) }}</text>
+					<!--¥ <text class="large">{{ Number(allPrice) + Number(form.packingCharge) + Number(form.shortCharge) + Number(form.longCharge) + Number(form.pickCharge) + Number(form.localCharge) }}</text>-->
+					¥ <text class="large">{{ realMoney }}</text>
 				</text>
 				</text>
 			</view>
 			</view>
 			<button class="admin-button-com blue middle" v-if="canIEdit" @click="formSubmit">
 			<button class="admin-button-com blue middle" v-if="canIEdit" @click="formSubmit">
@@ -188,12 +197,15 @@ export default {
 				longCharge: "",
 				longCharge: "",
 				pickCharge: "",
 				pickCharge: "",
 				localCharge: "",
 				localCharge: "",
+				packWeight: "",
 
 
 				entryTime: "",
 				entryTime: "",
 				ghsId: null
 				ghsId: null
 			},
 			},
 			showCustomer: false,
 			showCustomer: false,
-			detailsInfo: {}
+			detailsInfo: {},
+			totalPrice:0,
+			realMoney:0,
 		};
 		};
 	},
 	},
 	onLoad() {
 	onLoad() {
@@ -203,15 +215,15 @@ export default {
 		if(!this.$util.isEmpty(uni.getStorageSync("newGhs"))){
 		if(!this.$util.isEmpty(uni.getStorageSync("newGhs"))){
 			this.showCustomer = true;
 			this.showCustomer = true;
 		}
 		}
+		this.selectAllPrice();
 	},
 	},
 	onUnload(){
 	onUnload(){
 		uni.removeStorageSync('newGhs');
 		uni.removeStorageSync('newGhs');
 	},
 	},
 	computed: {
 	computed: {
 		...mapGetters(["getMerchantInfo", "getLoginInfo"]),
 		...mapGetters(["getMerchantInfo", "getLoginInfo"]),
-		allPrice() {
+		selectAllPrice(){
 			let price = 0;
 			let price = 0;
-
 			if (this.selectList) {
 			if (this.selectList) {
 				console.log(this.selectList,'selectList')
 				console.log(this.selectList,'selectList')
 				for (const item of this.selectList) {
 				for (const item of this.selectList) {
@@ -222,7 +234,16 @@ export default {
 					}
 					}
 				}
 				}
 			}
 			}
-			return Math.round(price * 100) / 100;
+			this.realMoney = price.toFixed(2);
+			return price.toFixed(2);
+		},
+		inputFn(e) {
+			let price = Number(this.selectAllPrice);
+			price = price + Number(this.form.packingCharge) + Number(this.form.shortCharge) + Number(this.form.longCharge) + Number(this.form.pickCharge) + Number(this.form.localCharge)
+			this.totalPrice = price.toFixed(2);
+			this.realMoney = price.toFixed(2);
+
+			// return price.toFixed(2);
 		},
 		},
 		canIEdit() {
 		canIEdit() {
 			const { orderSn } = this.option || {};
 			const { orderSn } = this.option || {};
@@ -321,7 +342,7 @@ export default {
 				if (!this.getMerchantInfo) {
 				if (!this.getMerchantInfo) {
 					await this.initMerchantInfo();
 					await this.initMerchantInfo();
 				}
 				}
-				await createPurchaseOrderApi(formData);
+				await createPurchaseOrderApi({...formData,realPrice:this.realMoney});
 				uni.setStorageSync('flowersItemInfo', itemInfo);
 				uni.setStorageSync('flowersItemInfo', itemInfo);
 				this.resetSelectInfoByType(this.pageType);
 				this.resetSelectInfoByType(this.pageType);
 				uni.navigateTo({url:'/pagesPurchase/components/pageSuccess?title=新增成功'})
 				uni.navigateTo({url:'/pagesPurchase/components/pageSuccess?title=新增成功'})