Przeglądaj źródła

开单记忆到人 撤回到创建和修改分开

shish 5 lat temu
rodzic
commit
5e49ac1c68

+ 3 - 2
ghsApp/src/admin/billing/affirm.vue

@@ -298,12 +298,13 @@ export default {
       this.form.customName = info.name;
       this.form.customName = info.name;
     },
     },
     confirmFn (options) {
     confirmFn (options) {
+      let that = this
       if (options.sendType == 2) {
       if (options.sendType == 2) {
         options.sendCost = "";
         options.sendCost = "";
       }
       }
       createOrder({...options,modifyPrice: this.modifyPrice,}).then((res) => {
       createOrder({...options,modifyPrice: this.modifyPrice,}).then((res) => {
         //删除记忆
         //删除记忆
-        this.removeMemory()
+        this.removeMemory(that.option.customId)
         const {data: { id, orderSn },} = res;
         const {data: { id, orderSn },} = res;
         let url = `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
         let url = `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
         uni.redirectTo({
         uni.redirectTo({
@@ -369,7 +370,7 @@ export default {
             if (res.confirm) {
             if (res.confirm) {
               wastage({product:JSON.stringify(product)}).then((res) => {
               wastage({product:JSON.stringify(product)}).then((res) => {
                 //删除记忆
                 //删除记忆
-                that.removeMemory()
+                that.removeMemory(that.option.customId)
                 const {data: { id, orderSn },} = res;
                 const {data: { id, orderSn },} = res;
                 let url = `/admin/billing/result?title=报损成功&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: () => { },});

+ 1 - 0
ghsApp/src/admin/billing/index.vue

@@ -106,6 +106,7 @@ export default {
 	mixins: [productMins],
 	mixins: [productMins],
 	data() {
 	data() {
 		return {
 		return {
+			pageType: "kd",
 			COMMODITY_TYPE,
 			COMMODITY_TYPE,
 			isFocus: false,
 			isFocus: false,
 			isModel: false,
 			isModel: false,

+ 1 - 1
ghsApp/src/api/order/index.js

@@ -28,7 +28,7 @@ export const comment = data => {
 };
 };
 
 
 /** *
 /** *
- * 商城下单-生成订单 m
+ * 添加订单
  */
  */
 export const createOrder = data => {
 export const createOrder = data => {
 	return https.post("/order/create-order", data);
 	return https.post("/order/create-order", data);

+ 25 - 13
ghsApp/src/mixins/product.js

@@ -27,7 +27,11 @@ export default {
 		}
 		}
 	},
 	},
 	onShow(){
 	onShow(){
-		if(this.option.modifyProductKey){
+		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)){
 			if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
 				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.option.modifyProductKey) })
 				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.option.modifyProductKey) })
 				uni.removeStorageSync('selectList'+this.option.modifyProductKey)
 				uni.removeStorageSync('selectList'+this.option.modifyProductKey)
@@ -37,7 +41,6 @@ export default {
 				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) })
 				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) })
 			}
 			}
 		}
 		}
-
 		if (this.autoLoad) {
 		if (this.autoLoad) {
 			this.initData();
 			this.initData();
 		}
 		}
@@ -346,12 +349,26 @@ export default {
 			console.log('this.selectList',this.selectList)
 			console.log('this.selectList',this.selectList)
 
 
 			//记忆已经选择的花材
 			//记忆已经选择的花材
-			uni.setStorageSync('selectList'+this.pageType, this.selectList)
+			this.rememberProduct()
 
 
 		},
 		},
 		//记忆已选的花材
 		//记忆已选的花材
 		rememberProduct(){
 		rememberProduct(){
-			uni.setStorageSync('selectList'+this.pageType, this.selectList)
+			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;
@@ -386,7 +403,7 @@ export default {
 				})
 				})
 
 
 				//记忆已经选择的花材
 				//记忆已经选择的花材
-				uni.setStorageSync('selectList'+this.pageType, this.selectList)
+				this.rememberProduct()
 
 
 		},
 		},
 		/**
 		/**
@@ -424,7 +441,7 @@ export default {
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 
 
 			//记忆已经选择的花材
 			//记忆已经选择的花材
-			uni.setStorageSync('selectList'+this.pageType, this.selectList)
+			this.rememberProduct()
 
 
 		},
 		},
 		//减去某个花材的数量,不是全部花材的意思 shish 20210803(方法名用All需要优化)
 		//减去某个花材的数量,不是全部花材的意思 shish 20210803(方法名用All需要优化)
@@ -449,7 +466,7 @@ export default {
 			console.log('this.selectList','减少花材之后:',this.selectList)
 			console.log('this.selectList','减少花材之后:',this.selectList)
 
 
 			//记忆已经选择的花材
 			//记忆已经选择的花材
-			uni.setStorageSync('selectList'+this.pageType, this.selectList)
+			this.rememberProduct()
 
 
 		},
 		},
 		/**
 		/**
@@ -492,14 +509,9 @@ export default {
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 
 
 			//记忆已经选择的花材
 			//记忆已经选择的花材
-			uni.setStorageSync('selectList'+this.pageType, this.selectList)
+			this.rememberProduct()
 
 
 		},
 		},
-		//清除已记忆花材
-		removeMemory(){
-			uni.removeStorageSync('selectList'+this.pageType);
-			this.resetSelectInfoByType(this.pageType);
-		},
 		/**
 		/**
 		 * 切换左侧商品类别
 		 * 切换左侧商品类别
 		 */
 		 */