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

更改开单、采购-新增(加号弹窗bug,减号数量bug),开单算运费,采购-新增完成添加成功页面

jiangfeng 5 лет назад
Родитель
Сommit
7587ff51dd

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

@@ -103,7 +103,8 @@ import appAddressGroup from "@/components/app-address-group";
 import appSendTime from "@/components/app-send-time";
 import appFormSend from "@/components/app-form-send";
 const formUtil = require("@/utils/formValidation.js");
-import { createOrder } from "@/api/order/index";
+import { createOrder,freight } from "@/api/order/index";
+// import { freight } from "@/api/order";
 import { mapActions, mapGetters } from "vuex";
 
 export default {
@@ -189,6 +190,17 @@ export default {
 
 		changeCustomerFn(info) {
 			console.log("changeCustomerFn", info);
+			let params = {
+				province: info.province,
+				city:info.city,
+				address:info.address,
+				floor:info.floor,
+				long: info.long,
+				lat: info.lat,
+			};
+			freight(params).then(res => {
+				this.form.sendCost = res.data.sedCost;
+			});
 			this.form.customId = info.id;
 			this.form.customName = info.name;
 		},

+ 5 - 2
ghsApp/src/admin/billing/index.vue

@@ -44,8 +44,8 @@
 										getSelectItemById(productItem.id, classItem.classId).smallCount
 									"
 									@customNum="customNum"
-									@add="addEvent"
-									@del="delEvent"
+									@add="addCustomNumEvent"
+									@del="delAllEvent"
 								></Commondity>
 							</view>
 							<!-- <Commondity
@@ -164,9 +164,12 @@ export default {
 			this.customData = {};
 		}, // 取消 确认
 		affirm(val) {
+			if(this.customData.bigCount==0 && this.customData.smallCount==0){
+				this.delAllEvent(this.customData)}
 			if (val.index === 0) {
 				this.modalCancel();
 			} else {
+				console.log(this.customData)
 				const {
 					bigCount,
 					smallCount,

+ 0 - 1
ghsApp/src/components/app-form-send1.vue

@@ -118,7 +118,6 @@ export default {
 			this.$nextTick(() => {
 				let params = {
 					id: this.orderid,
-					customId: this.customId,
 					province: this.formData.receiveProvince,
 					city:this.formData.receiveCity,
 					address:this.formData.receiveAddress,

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

@@ -9,12 +9,8 @@
 			<view class="num-open_bx">
 				<view class="price">¥{{ showPrice }}</view>
 				<view class="open-bx" v-if="type == COMMODITY_TYPE.COMMON">
-					<i
-						class="iconfont iconjian"
-						@click="delEvent"
-						v-if="bigCount > 0 || smallCount > 0"
-					></i>
-					<text class="num" @click="customNum">
+					<i class="iconfont iconjian" @click="delEvent" v-if="bigCount > 0 || smallCount > 0"></i>
+					<text class="num" @click="customNum" v-if="bigCount > 0 || smallCount > 0">
 						<text v-if="bigCount > 0 || smallCount > 0">{{ `${bigCount}` }}</text>
 						<text v-if="smallCount > 0">/</text>
 						<text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
@@ -82,7 +78,13 @@ export default {
 	},
 	methods: {
 		addEvent() {
-			this.$emit("add", this.info);
+			let params = {
+				...this.info,
+				bigCount: this.bigCount,
+				smallCount: this.smallCount
+			};
+			this.$emit("add", this.info,params);
+			// this.$emit("add", this.info);
 		},
 		delEvent() {
 			this.$emit("del", this.info);

+ 10 - 1
ghsApp/src/mixins/product.js

@@ -391,7 +391,16 @@ export default {
 		},
 		//减去所有商品
 		delAllEvent(item) {
-			const list = [];
+			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;
+				}
+			}
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 		},
 		// /**

+ 7 - 7
ghsApp/src/pagesPurchase/add.vue

@@ -65,12 +65,8 @@
 								:type="pageType"
 								:key="productIndex"
 								: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"
 								@customNum="customNum"
 								@add="addCustomNumEvent"
 								@del="delAllEvent"
@@ -178,7 +174,6 @@ export default {
 	methods: {
 		//自定义数量
 		customNum(info) {
-			console.log(info)
 			this.isModel = true;
 			this.customData = info;
 		},
@@ -187,9 +182,14 @@ export default {
 			this.customData = {};
 		}, // 取消 确认
 		affirm(val) {
+			if(this.customData.bigCount==0 && this.customData.smallCount==0){
+				this.delAllEvent(this.customData)}
+
 			if (val.index === 0) {
 				this.modalCancel();
 			} else {
+
+					// delAllEvent
 				//超过库存时 设置为库存最大值
 				this.updateItemEvent(this.customData);
 				this.modalCancel();

+ 4 - 6
ghsApp/src/pagesPurchase/details.vue

@@ -173,11 +173,7 @@
 					¥ <text class="large">{{ allPrice }}</text>
 				</text>
 			</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">
 				确认
 			</button>
 		</view>
@@ -336,6 +332,7 @@ export default {
 				}
 				const itemInfo = this.selectList.map(ele => {
 					return {
+						classId: ele.classId,
 						productId: ele.id,
 						bigNum: ele.bigCount,
 						smallNum: ele.smallCount,
@@ -351,7 +348,8 @@ export default {
 				this.$msg("确认成功!");
 
 				this.resetSelectInfoByType(this.pageType);
-				this.$util.pageTo({ url: "/pagesPurchase/result", type: 2 });
+				// this.$util.pageTo({ url: "/pagesPurchase/result", type: 2 });
+				uni.navigateTo({url:'/common/pageSuccess?title=新增成功'})
 			} catch (error) {}
 		},
 		// 表单验证