浏览代码

价格问题

shish 5 年之前
父节点
当前提交
de2848f645
共有 1 个文件被更改,包括 7 次插入22 次删除
  1. 7 22
      ghsApp/src/pagesPurchase/details.vue

+ 7 - 22
ghsApp/src/pagesPurchase/details.vue

@@ -58,9 +58,7 @@
 					<tui-list-cell class="line-cell" :hover="false" :arrow="true" @tap="showCustomer = true">
 					<tui-list-cell class="line-cell" :hover="false" :arrow="true" @tap="showCustomer = true">
 						<view class="tui-title ">供应商</view>
 						<view class="tui-title ">供应商</view>
 						<text :style="!supplier.name?'color:#cccccc':''">
 						<text :style="!supplier.name?'color:#cccccc':''">
-<!--							{{ detailsInfo.supplierName || "" }}-->
 							{{ supplier.name || "请选择" }}
 							{{ supplier.name || "请选择" }}
-							<!-- 欠款:91658.00  -->
 						</text>
 						</text>
 					</tui-list-cell>
 					</tui-list-cell>
 					<!-- <tui-list-cell class="line-cell" :hover="false">
 					<!-- <tui-list-cell class="line-cell" :hover="false">
@@ -237,14 +235,6 @@ export default {
 			this.modifyPrice = price.toFixed(2);
 			this.modifyPrice = price.toFixed(2);
 			return 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.modifyPrice = price.toFixed(2);
-
-			// return price.toFixed(2);
-		},
 		canIEdit() {
 		canIEdit() {
 			const { orderSn } = this.option || {};
 			const { orderSn } = this.option || {};
 
 
@@ -259,14 +249,17 @@ export default {
 		init() {
 		init() {
 			this._getDet();
 			this._getDet();
 		},
 		},
-		// api
+		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.modifyPrice = price.toFixed(2);
+		},
 		_getDet() {
 		_getDet() {
 			let data = uni.getStorageSync("modifyShopB");
 			let data = uni.getStorageSync("modifyShopB");
 			if (this.$util.isEmpty(data)) return;
 			if (this.$util.isEmpty(data)) return;
 			Object.keys(this.form).forEach((i, index) => {
 			Object.keys(this.form).forEach((i, index) => {
-				// if (i != 'password') {
 				this.form[i] = data[i];
 				this.form[i] = data[i];
-				// }
 			});
 			});
 		},
 		},
 
 
@@ -276,13 +269,10 @@ export default {
 				if (!orderSn) {
 				if (!orderSn) {
 					return;
 					return;
 				}
 				}
-
 				const { data } = await getPurchaseDetailApi(orderSn);
 				const { data } = await getPurchaseDetailApi(orderSn);
 				console.log(11111, data);
 				console.log(11111, data);
 				Object.keys(this.form).forEach((i, index) => {
 				Object.keys(this.form).forEach((i, index) => {
-					// if (i != 'password') {
 					this.form[i] = data[i];
 					this.form[i] = data[i];
-					// }
 				});
 				});
 
 
 				this.detailsInfo = data;
 				this.detailsInfo = data;
@@ -309,16 +299,11 @@ export default {
 			console.log("changeCustomerFn", e);
 			console.log("changeCustomerFn", e);
 			this.supplier = e;
 			this.supplier = e;
 			this.form.ghsId = e.id;
 			this.form.ghsId = e.id;
-			// this.form.address = e.address;
-			// this.form.lat = e.location.lat;
-			// this.form.long = e.location.lng;
 		},
 		},
 
 
 		onCityConfirm(e) {
 		onCityConfirm(e) {
-			// this.form.receiveAddress = e.label
 			this.form.province = e.provinceName;
 			this.form.province = e.provinceName;
 			this.form.city = e.cityName;
 			this.form.city = e.cityName;
-			// this.pickerText = JSON.stringify(e)
 		},
 		},
 		async confirmFn() {
 		async confirmFn() {
 			try {
 			try {
@@ -342,7 +327,7 @@ export default {
 				if (!this.getMerchantInfo) {
 				if (!this.getMerchantInfo) {
 					await this.initMerchantInfo();
 					await this.initMerchantInfo();
 				}
 				}
-				await createPurchaseOrderApi({...formData,realPrice:this.modifyPrice});
+				await createPurchaseOrderApi({...formData,modifyPrice:this.modifyPrice});
 				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=新增成功'})