shish 5 سال پیش
والد
کامیت
1e5bcb7346
4فایلهای تغییر یافته به همراه54 افزوده شده و 51 حذف شده
  1. 8 4
      ghsApp/src/admin/billing/affirm.vue
  2. 6 3
      ghsApp/src/api/order/index.js
  3. 39 43
      ghsApp/src/mixins/product.js
  4. 1 1
      ghsApp/src/pagesOrder/detail.vue

+ 8 - 4
ghsApp/src/admin/billing/affirm.vue

@@ -146,7 +146,7 @@ import appAddressGroup from "@/components/app-address-group";
 import appSendTime from "@/components/app-send-time";
 import appSendTime from "@/components/app-send-time";
 import appFormSend from "@/components/app-form-send";
 import appFormSend from "@/components/app-form-send";
 const formUtil = require("@/utils/formValidation.js");
 const formUtil = require("@/utils/formValidation.js");
-import { createOrder, freight,wastage } from "@/api/order/index";
+import { createOrder, freight,wastage,updateOrder } from "@/api/order/index";
 import { mapActions, mapGetters } from "vuex";
 import { mapActions, mapGetters } from "vuex";
 export default {
 export default {
   name: "BillingAffirm", // 开单确认
   name: "BillingAffirm", // 开单确认
@@ -168,7 +168,6 @@ export default {
 			payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
 			payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
 			payWayindex:0,
 			payWayindex:0,
       form: {
       form: {
-        id:0,
         debt: 1, //付款方式 1欠款订单 0正常订单
         debt: 1, //付款方式 1欠款订单 0正常订单
         shopId: "",
         shopId: "",
         shopName: "",
         shopName: "",
@@ -300,7 +299,13 @@ export default {
       if (options.sendType == 2) {
       if (options.sendType == 2) {
         options.sendCost = "";
         options.sendCost = "";
       }
       }
-      createOrder({...options,modifyPrice: this.modifyPrice,}).then((res) => {
+      let Fn = createOrder
+      let params = {...options,modifyPrice: this.modifyPrice};
+      if(this.option.orderId && this.option.orderId > 0){
+        Fn = updateOrder
+        params = {...params,id:this.option.orderId}
+      }
+      Fn(params).then((res) => {
         //删除记忆
         //删除记忆
         this.removeMemory(that.option.customId)
         this.removeMemory(that.option.customId)
         const {data: { id, orderSn },} = res;
         const {data: { id, orderSn },} = res;
@@ -336,7 +341,6 @@ export default {
           confirmColor: '#39B54A',
           confirmColor: '#39B54A',
           cancelColor: '#777777',
           cancelColor: '#777777',
           success: function (res) {
           success: function (res) {
-            self.form.id = self.option.orderId
             if (res.confirm) {
             if (res.confirm) {
               self.form.needPrint = 1
               self.form.needPrint = 1
               self.formSubmit();
               self.formSubmit();

+ 6 - 3
ghsApp/src/api/order/index.js

@@ -27,13 +27,16 @@ export const comment = data => {
 	return https.post("/order/comment", data);
 	return https.post("/order/comment", data);
 };
 };
 
 
-/** *
- * 添加订单
- */
+//添加订单
 export const createOrder = data => {
 export const createOrder = data => {
 	return https.post("/order/create-order", data);
 	return https.post("/order/create-order", data);
 };
 };
 
 
+//修改订单
+export const updateOrder = data => {
+	return https.post("/order/update-order", data);
+};
+
 /** *
 /** *
  * 商城下单-相关信息 m
  * 商城下单-相关信息 m
  */
  */

+ 39 - 43
ghsApp/src/mixins/product.js

@@ -26,31 +26,10 @@ export default {
 			this.pageType = pageType;
 			this.pageType = pageType;
 		}
 		}
 	},
 	},
-	onShow(){
-		if(this.pageType == 'kd' && !this.$util.isEmpty(this.option.customId)){
-			if(uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId)){
-				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId) })
-			}			
-		}else if(this.option.modifyProductKey){
-			if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
-				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.option.modifyProductKey) })
-				uni.removeStorageSync('selectList'+this.option.modifyProductKey)
-			}
-		}else{
-			if(uni.getStorageSync('selectList'+this.pageType)){
-				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) })
-			}
-		}
-		if (this.autoLoad) {
-			this.initData();
-		}
-	},
 	onUnload() {},
 	onUnload() {},
 	computed: {
 	computed: {
 		...mapGetters(["getSelectInfo"]),
 		...mapGetters(["getSelectInfo"]),
-		/**
-		 * 当前页面选中的商品列表
-		 */
+		//当前页面选中的商品列表
 		selectList() {
 		selectList() {
 			return this.getSelectInfo[this.pageType] || [];
 			return this.getSelectInfo[this.pageType] || [];
 		},
 		},
@@ -132,11 +111,46 @@ export default {
 			return has;
 			return has;
 		}
 		}
 	},
 	},
+	onShow(){
+		if(this.pageType == 'bill' && !this.$util.isEmpty(this.option.customId)){
+			if(uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId)){
+				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId) })
+			}			
+		}else if(this.option.modifyProductKey){
+			if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
+				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.option.modifyProductKey) })
+				uni.removeStorageSync('selectList'+this.option.modifyProductKey)
+			}
+		}else{
+			if(uni.getStorageSync('selectList'+this.pageType)){
+				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) })
+			}
+		}
+		if (this.autoLoad) {
+			this.initData();
+		}
+	},
 	methods: {
 	methods: {
 		...mapActions(["setSelectInfoByType", "resetSelectInfoByType"]),
 		...mapActions(["setSelectInfoByType", "resetSelectInfoByType"]),
-		/**
-		 * 请求商品数据
-		 */
+		//记忆已选的花材
+		rememberProduct(){
+			if(this.pageType == 'bill' && !this.$util.isEmpty(this.option.customId)){
+				//开单根据客户记住已选的花材
+				uni.setStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId, this.selectList)
+			}else{
+				uni.setStorageSync('selectList'+this.pageType, this.selectList)
+			}
+		},
+		//清除已记忆花材
+		removeMemory(customId){
+			if(customId){
+				uni.removeStorageSync('selectList'+this.pageType+'_custom_'+customId);
+			}else{
+				uni.removeStorageSync('selectList'+this.pageType);
+			}
+			this.resetSelectInfoByType(this.pageType);
+		},
+		//请求商品数据
 		async initData(extendInfo) {
 		async initData(extendInfo) {
 			//extendInfo调用时的扩展参数  如  shopId
 			//extendInfo调用时的扩展参数  如  shopId
 			try {
 			try {
@@ -349,24 +363,6 @@ export default {
 			this.rememberProduct()
 			this.rememberProduct()
 
 
 		},
 		},
-		//记忆已选的花材
-		rememberProduct(){
-			if(this.pageType == 'kd' && !this.$util.isEmpty(this.option.customId)){
-				//开单根据客户记住已选的花材
-				uni.setStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId, this.selectList)
-			}else{
-				uni.setStorageSync('selectList'+this.pageType, this.selectList)
-			}
-		},
-		//清除已记忆花材
-		removeMemory(customId){
-			if(customId){
-				uni.removeStorageSync('selectList'+this.pageType+'_custom_'+customId);
-			}else{
-				uni.removeStorageSync('selectList'+this.pageType);
-			}
-			this.resetSelectInfoByType(this.pageType);
-		},
 		addCustomNumEvent(item,params1,type) {
 		addCustomNumEvent(item,params1,type) {
 				const list = this.selectList;
 				const list = this.selectList;
 
 

+ 1 - 1
ghsApp/src/pagesOrder/detail.vue

@@ -383,7 +383,7 @@ export default {
 				let self = this;
 				let self = this;
 				uni.showModal({
 				uni.showModal({
 					title: '提示',
 					title: '提示',
-					content: '确认取消?',
+					content: '确认取消订单?',
 					success: function (res) {
 					success: function (res) {
 						if (res.confirm) {
 						if (res.confirm) {
 							cancel({id:item.id}).then((res) => {
 							cancel({id:item.id}).then((res) => {