shish 4 лет назад
Родитель
Сommit
2b2ded3097
31 измененных файлов с 261 добавлено и 308 удалено
  1. 8 7
      ghsApp/src/admin/billing/affirm.vue
  2. 2 2
      ghsApp/src/admin/billing/customerAffirm.vue
  3. 2 2
      ghsApp/src/admin/billing/customerPlace.vue
  4. 8 3
      ghsApp/src/admin/billing/index.vue
  5. 1 1
      ghsApp/src/admin/billing/priceChange.vue
  6. 2 2
      ghsApp/src/admin/breakage/confirm.vue
  7. 3 3
      ghsApp/src/admin/breakage/index.vue
  8. 1 1
      ghsApp/src/admin/breakage/info.vue
  9. 1 1
      ghsApp/src/admin/changePrice/list.vue
  10. 1 1
      ghsApp/src/admin/clear/customInfo.vue
  11. 1 1
      ghsApp/src/admin/clear/info.vue
  12. 1 1
      ghsApp/src/admin/item/list.vue
  13. 1 1
      ghsApp/src/admin/ptItem/itemList.vue
  14. 1 1
      ghsApp/src/components/module/app-commodity.vue
  15. 11 23
      ghsApp/src/mixins/globalMixins.js
  16. 39 86
      ghsApp/src/mixins/product.js
  17. 5 5
      ghsApp/src/mixins/productContrapose.js
  18. 5 5
      ghsApp/src/mixins/ptProductContrapose.js
  19. 5 10
      ghsApp/src/pagesOrder/detail.vue
  20. 2 2
      ghsApp/src/pagesOrder/select.vue
  21. 7 6
      ghsApp/src/pagesPurchase/add.vue
  22. 113 88
      ghsApp/src/pagesPurchase/components/pageSuccess.vue
  23. 9 17
      ghsApp/src/pagesPurchase/details.vue
  24. 1 1
      ghsApp/src/pagesPurchase/info.vue
  25. 2 2
      ghsApp/src/pagesShare/pay.vue
  26. 4 4
      ghsApp/src/pagesStorehouse/allot/addExDetails.vue
  27. 1 1
      ghsApp/src/pagesStorehouse/allot/exSelect.vue
  28. 1 1
      ghsApp/src/pagesStorehouse/inventory/select.vue
  29. 9 14
      ghsApp/src/pagesStorehouse/inventory/update.vue
  30. 1 1
      ghsApp/src/pagesStorehouse/stockWarn/manage.vue
  31. 13 15
      ghsApp/src/store/modules/product.js

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

@@ -35,7 +35,7 @@
               </view>
             </view>
             <view class="summary-bar">
-              <view class="operate-view" v-if="isScanEnv" @click="removeMemory(option.customId)"> <text class="iconfont iconshanchu1"></text>清除花材 </view>
+              <view class="operate-view" v-if="isScanEnv" @click="removeFromSave(option.customId)"> <text class="iconfont iconshanchu1"></text>清除花材 </view>
               <view class="operate-view" v-else @click="gobackEvent"><text class="iconfont icongouwuche"></text>重选花材</view>
               <view class="describe-view">共{{ selectList.length }}种,合计 ¥<text class="price">{{ allPrice }}</text></view>
             </view>
@@ -236,18 +236,19 @@ export default {
         that.customInfo = res.data
         that.$forceUpdate()
       })
-    }
 
-    //零售开单默认不打小票
-    // if(this.getLoginInfo.skCustomId == this.option.customId){
-    //   this.form.needPrint = 2
-    // }
+      //用于混入product的已选中花材!!!!!
+      this.selectJobId = option.customId
+      this.selectJobType = 'bill'
+
+    }
 
     // #ifdef APP-PLUS
     if(this.$util.isScanEnv()){
       this.isScanEnv = true
     }
     // #endif
+
   },
 	onShow(){
 		if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
@@ -437,7 +438,7 @@ export default {
       }
       Fn(params).then((res) => {
         if(res.code == 1){
-          this.removeMemoryDirect(this.option.customId)
+          this.removeFromSaveDirect()
           const {data: { id, orderSn,actPrice }} = res;
           if(this.form.hasPay == 0){
             this.$util.pageTo({ url: '/admin/billing/toPay',type:2,query: {orderId:id,orderSn:orderSn,actPrice:actPrice}})

+ 2 - 2
ghsApp/src/admin/billing/customerAffirm.vue

@@ -111,7 +111,7 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			pageType: "customer",
+			selectJobType: "customer",
 			autoLoad: false,
 			form: {
 				shopId: "",
@@ -170,7 +170,7 @@ export default {
 		confirmFn(options) {
 			createOrder(options).then(res => {
 				// this.$msg("下单成功");
-				this.resetSelectInfoByType(this.pageType);
+				this.reSetSelectInfo({selectJobType:this.selectJobType,selectJobId:this.selectJobId})
 				const {
 					data: { orderId, orderSn }
 				} = res;

+ 2 - 2
ghsApp/src/admin/billing/customerPlace.vue

@@ -152,7 +152,7 @@ export default {
 	data() {
 		return {
 			COMMODITY_TYPE,
-			pageType: "customer",
+			selectJobType: "customer",
 			autoLoad: false,
 			tabIndex: 0,
 			shopId: null,
@@ -193,7 +193,7 @@ export default {
 		this.initData({ shopId: this.shopId });
 	},
 	onUnload() {
-		this.resetSelectInfoByType(this.pageType);
+		this.reSetSelectInfo({selectJobType:this.selectJobType,selectJobId:this.selectJobId})
 	},
 
 	methods: {

+ 8 - 3
ghsApp/src/admin/billing/index.vue

@@ -6,7 +6,7 @@
 				<app-search-module v-model="py" placeholder="输英文字母搜索" @input="searchFn" />
 			</view>
 			<view style="float:right">
-				<button class="admin-button-com middle blue" @click="removeMemory(option.customId)">清除花材</button>
+				<button class="admin-button-com middle blue" @click="removeFromSave(option.customId)">清除花材</button>
 			</view>
 		</view>
 
@@ -29,7 +29,7 @@
 							<view style="height: 160upx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
 								<Commondity v-if="classItem.isActive"
 									:checkStock="true"
-									:pageType="pageType"
+									:selectJobType="selectJobType"
 									:info="productItem"
 									@showAddModelFn="showAddModelFn"
 									@replaceItemFn="replaceItemFn"
@@ -105,7 +105,12 @@ export default {
 
 	},
 	onUnload() {
-		this.resetSelectInfoByType(this.pageType);
+		this.reSetSelectInfo({selectJobType:this.selectJobType,selectJobId:this.selectJobId})
+	},
+	onLoad () {
+		if (!this.$util.isEmpty(this.option.customId)){
+			this.selectJobId = this.option.customId
+		}
 	},
 	methods: {
 		confirmToSave() {

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

@@ -56,7 +56,7 @@ export default {
 	},
   data () {
     return {
-      pageType: "price_change",
+      selectJobType: "price_change",
       COMMODITY_TYPE,
     };
   },

+ 2 - 2
ghsApp/src/admin/breakage/confirm.vue

@@ -113,7 +113,7 @@ export default {
       },
       money: "",
       showCustomer: false,
-			pageType: "wastage",
+			selectJobType: "wastage",
     };
   },
   onLoad (option) {
@@ -220,7 +220,7 @@ export default {
 
           wastage({product:JSON.stringify(product),remark:that.form.remark}).then((res) => {
             //删除记忆
-            that.removeMemoryDirect()
+            that.removeFromSaveDirect()
             const {data: { id, orderSn },} = res;
             let url = '/admin/breakage/result';
             uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },});

+ 3 - 3
ghsApp/src/admin/breakage/index.vue

@@ -6,7 +6,7 @@
 				<app-search-module v-model="py" placeholder="输英文字母搜索" @input="searchFn" />
 			</view>
 			<view style="float:right">
-				<button class="admin-button-com middle blue" @click="removeMemory(0)">清除花材</button>
+				<button class="admin-button-com middle blue" @click="removeFromSave(0)">清除花材</button>
 			</view>
 		</view>
 		
@@ -103,7 +103,7 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			pageType: "wastage", //选择商品页面类别  用于区分不同功能的数据
+			selectJobType: "wastage", //选择商品页面类别  用于区分不同功能的数据
 			COMMODITY_TYPE,
 			isAddModel: false,
 			isSmallCount:false,//是否是小单位(支)
@@ -127,7 +127,7 @@ export default {
 	},
 
 	onUnload() {
-		this.resetSelectInfoByType(this.pageType);
+		this.reSetSelectInfo({selectJobType:this.selectJobType,selectJobId:this.selectJobId})
 	},
 
 	methods: {

+ 1 - 1
ghsApp/src/admin/breakage/info.vue

@@ -84,7 +84,7 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			pageType: "order_change",
+			selectJobType: "order_change",
 			autoLoad: false,
 			stepActive: 0,
 			form: {

+ 1 - 1
ghsApp/src/admin/changePrice/list.vue

@@ -71,7 +71,7 @@ export default {
 	data() {
 		return {
 			autoLoad: false, //不自动请求数据  自定义请求
-			pageType: "stock",
+			selectJobType: "stock",
 			tabIndex: 0,
 			priceArr:[]
 		};

+ 1 - 1
ghsApp/src/admin/clear/customInfo.vue

@@ -135,7 +135,7 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			pageType: "order_change",
+			selectJobType: "order_change",
 			autoLoad: false,
 			stepActive: 0,
 			form: {

+ 1 - 1
ghsApp/src/admin/clear/info.vue

@@ -129,7 +129,7 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			pageType: "order_change",
+			selectJobType: "order_change",
 			autoLoad: false,
 			stepActive: 0,
 			form: {

+ 1 - 1
ghsApp/src/admin/item/list.vue

@@ -70,7 +70,7 @@ export default {
 		return {
 			STOCK_TYPE,
 			autoLoad: false,
-			pageType: "stock",
+			selectJobType: "stock",
 			tabIndex: 0,
 			getAppIdList:{}
 		};

+ 1 - 1
ghsApp/src/admin/ptItem/itemList.vue

@@ -57,7 +57,7 @@ export default {
 	data() {
 		return {
 			autoLoad: false,
-			pageType: "getPtItem",
+			selectJobType: "getPtItem",
 			tabIndex: 0,
 			modifyStock:{},
 			allClass:[]

+ 1 - 1
ghsApp/src/components/module/app-commodity.vue

@@ -54,7 +54,7 @@ export default {
 			type: Boolean,
 			default: false
 		},
-		pageType:{
+		selectJobType:{
 			type: String,
 			default: ''
 		}

+ 11 - 23
ghsApp/src/mixins/globalMixins.js

@@ -155,7 +155,7 @@ export default {
           //PDA扫码开单前准备好所有花材,首页已经有加载不再需要
           allProduct().then(res=>{
             this.allProduct = res.data.list
-            console.log('................载入最新花材和库存................')
+            console.log('................载入最新花材................')
           })
 
           this.checkStock = true
@@ -218,7 +218,7 @@ export default {
 
 			let that = this
       that.kdType = 'SCAN'
-      let pageType = "bill"
+      let selectJobType = "bill"
 
       let currentCustomId = that.skCustomId || 0
       let pdaCustomId = uni.getStorageSync('pdaCustomId')
@@ -229,23 +229,14 @@ export default {
         this.$util.noStockRemind()
         this.$msg('没有客户信息')
       }
-
+      let selectJobId = currentCustomId
       //涉及记住花材的代码和流程,请全项目搜索关键词remember_item
-			if(uni.getStorageSync('selectList_'+pageType+'_target_'+currentCustomId)){
-        //console.log(this.getSelectInfo[pageType])
-        //console.log(uni.getStorageSync('selectList_'+pageType+'_target_'+currentCustomId))
-				this.setSelectInfoByType({ type: pageType, info: uni.getStorageSync('selectList_'+pageType+'_target_'+currentCustomId)})
-        //console.log(this.getSelectInfo[pageType])
-			}else{
-        // this.$store.commit('flushSelectItem',{})
-        // uni.removeStorageSync('selectList_'+pageType+'_target_'+currentCustomId)
-        // console.log(this.getSelectInfo)
-        // console.log(this.getSelectInfo[pageType])
-        // console.log(uni.getStorageSync('selectList_'+pageType+'_target_'+currentCustomId))
-      }
-
-      let currentList = this.getSelectInfo[pageType] || [];
-
+      let storageData = uni.getStorageSync('selectList_'+selectJobType+'_target_'+selectJobId)
+			if(!this.$util.isEmpty(storageData)){
+				this.setSelectInfo({ selectJobType: selectJobType, info: storageData,selectJobId:selectJobId})
+			}
+      let selectInfoData = this.getSelectInfo
+      let currentList = selectInfoData[selectJobType+'_'+selectJobId] || []
       let index = this.allProduct.findIndex(ele => Number(ele.id) == Number(productIdCode))
       if(index == -1){
         this.$util.noStockRemind()
@@ -253,7 +244,6 @@ export default {
         return false
       }
       let currentProduct = this.allProduct[index]
-      
       let storeIndex = -1
       if(!this.$util.isEmpty(currentList)){
         storeIndex = currentList.findIndex(ele=> Number(ele.id) == Number(currentProduct.id))
@@ -286,10 +276,8 @@ export default {
         currentList[storeIndex].bigCount = Number(currentList[storeIndex].bigCount) + 1
         currentItem = currentList[storeIndex]
       }
-
-      uni.setStorageSync('selectList_'+pageType+'_target_'+currentCustomId, currentList)
-      that.setSelectInfoByType({ type: pageType, info: currentList })
-
+      uni.setStorageSync('selectList_'+selectJobType+'_target_'+currentCustomId, currentList)
+      that.setSelectInfo({ selectJobType: selectJobType, info: currentList,selectJobId:selectJobId })
       if(currentRoute != 'admin/billing/affirm'){
         that.$util.pageTo({url: "/admin/billing/affirm",query:{customId:currentCustomId,kdType:that.kdType}})
       }

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

@@ -4,7 +4,8 @@ import { copyObject } from "@/utils/util";
 export default {
 	data() {
 		return {
-			pageType: "bill", //选择商品页面类别  用于区分不同功能的数据
+			selectJobType: "bill",//业务类型,开单、采购、报损、盘点
+			selectJobId:0,//业务类型对应的主体ID等
 			isCut:false,
 			productInfoList: [], //商品信息
 			classIndex: 0, //当前商品类别下标
@@ -26,9 +27,9 @@ export default {
 		};
 	},
 	onLoad(options) {
-		const { pageType } = options;
-		if (pageType) {
-			this.pageType = pageType;
+		const { selectJobType } = options;
+		if (selectJobType) {
+			this.selectJobType = selectJobType;
 		}
 	},
 	onUnload() {},
@@ -36,7 +37,8 @@ export default {
 		...mapGetters(["getSelectInfo"]),
 		//当前页面选中的商品列表
 		selectList() {
-			return this.getSelectInfo[this.pageType] || [];
+			let selectInfo = this.getSelectInfo;
+			return selectInfo[this.selectJobType+'_'+this.selectJobId] || []
 		},
 		scrollClassId() {
 			const curClass = this.productInfoList[this.classIndex];
@@ -104,64 +106,35 @@ export default {
 		}
 	},
 	onShow(){
-		//修改花材
-		if(this.option.modifyProductKey){
-			if(uni.getStorageSync('selectList_'+this.option.modifyProductKey)){
-				//由于价格会变化,所以在initData()重新载入已经选择的花材
-			}
-		}else if(this.pageType == 'bill' && !this.$util.isEmpty(this.option.customId)){
-			if(uni.getStorageSync('selectList_'+this.pageType+'_target_'+this.option.customId)){
-				//由于价格会变化,所以在initData()重新载入已经选择的花材
-			}
-		}else if(this.pageType == 'purchase' && !this.$util.isEmpty(this.option.ghsId)){
-			if(uni.getStorageSync('selectList_'+this.pageType+'_target_'+this.option.ghsId)){
-				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList_'+this.pageType+'_target_'+this.option.ghsId) })
-			}
-		}else{
-			//盘点和报损等不需要考虑价格
-			if(uni.getStorageSync('selectList_'+this.pageType)){
-				this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList_'+this.pageType) })
-			}
-		}
+
 	},
 	methods: {
-		...mapActions(["setSelectInfoByType", "resetSelectInfoByType"]),
+		...mapActions(["setSelectInfo", "reSetSelectInfo"]),
 		init(){
 			if (this.autoLoad) {
 				this.initData();
 			}
 		},
-		//记忆已选的花材
-		rememberProduct(){
-			if(this.pageType == 'bill' && !this.$util.isEmpty(this.option.customId)){
-				//开单根据客户记住已选的花材
-				uni.setStorageSync('selectList_'+this.pageType+'_target_'+this.option.customId, this.selectList)
-			}else if(this.pageType == 'purchase' && !this.$util.isEmpty(this.option.ghsId)){
-				//采购根据供应商记住已选的花材
-				uni.setStorageSync('selectList_'+this.pageType+'_target_'+this.option.ghsId, this.selectList)
-			}else{
-				uni.setStorageSync('selectList_'+this.pageType, this.selectList)
-			}
+		//放到仓库
+		pushToSave(selectData){
+			this.setSelectInfo({ selectJobType: this.selectJobType, info: selectData,selectJobId:this.selectJobId })
+			uni.setStorageSync('selectList_'+this.selectJobType+'_target_'+this.selectJobId, selectData)
 		},
-		//清除记忆花材
-		removeMemory(customId=0){
+		//询问是否删除缓存
+		removeFromSave(){
 			let that = this
-
 			that.$util.confirmModal({content:'确认清除花材?'},() => {
-				that.removeMemoryDirect(customId)
+				that.removeFromSaveDirect()
 				that.$msg('已清除')
             })
-
 		},
-		//直接清除记忆花材不提示
-		removeMemoryDirect(targetId=0){
+		//直接删除缓存
+		removeFromSaveDirect(){
 			let that = this
-			if(targetId!=0){
-				uni.removeStorageSync('selectList_'+that.pageType+'_target_'+targetId)
-			}else{
-				uni.removeStorageSync('selectList_'+that.pageType)
-			}
-			that.resetSelectInfoByType(that.pageType)
+
+			uni.removeStorageSync('selectList_'+that.selectJobType+'_target_'+that.selectJobId)
+			that.reSetSelectInfo({selectJobType:that.selectJobType,selectJobId:that.selectJobId})
+
 			if(!this.$util.isEmpty(this.globalClassItemList)){
 				this.globalClassItemList.forEach((item,index,arr) =>{
 					if(!this.$util.isEmpty(arr[index].child)){
@@ -197,37 +170,17 @@ export default {
 						});
 				});
 				this.productInfoList = data;
-				if(this.option.modifyProductKey){
-					//修改花材
-					if(uni.getStorageSync('selectList_'+this.option.modifyProductKey)){
-						let currentInfo = uni.getStorageSync('selectList_'+this.option.modifyProductKey)
-						if(!this.$util.isEmpty(currentInfo)){
-							currentInfo.forEach((currentItem,currentIndex,currentArray)=>{
-								let currentId = currentItem.id
-								if(this.globalItemList[currentId]){
-									currentArray[currentIndex].bigPrice = this.globalItemList[currentId].bigPrice
-									currentArray[currentIndex].smallPrice = this.globalItemList[currentId].smallPrice
-								}
-							})
-							this.setSelectInfoByType({ type: this.pageType, info:  currentInfo})
-							uni.removeStorageSync('selectList_'+this.option.modifyProductKey)
-						}
-					}
-				}else if(this.pageType == 'bill' && !this.$util.isEmpty(this.option.customId)){
-					//开单记忆花材取出到selectList
-					if(uni.getStorageSync('selectList_'+this.pageType+'_target_'+this.option.customId)){
-						let currentInfo = uni.getStorageSync('selectList_'+this.pageType+'_target_'+this.option.customId)
-						if(!this.$util.isEmpty(currentInfo)){
-							currentInfo.forEach((currentItem,currentIndex,currentArray)=>{
-								let currentId = currentItem.id
-								if(this.globalItemList[currentId]){
-									currentArray[currentIndex].bigPrice = this.globalItemList[currentId].bigPrice
-									currentArray[currentIndex].smallPrice = this.globalItemList[currentId].smallPrice
-								}
-							})
-							this.setSelectInfoByType({ type: this.pageType, info: currentInfo })
+
+				let currentInfo = uni.getStorageSync('selectList_'+this.selectJobType+'_target_'+this.selectJobId)
+				if(!this.$util.isEmpty(currentInfo)){
+					currentInfo.forEach((currentItem,currentIndex,currentArray)=>{
+						let currentId = currentItem.id
+						if(this.globalItemList[currentId]){
+							currentArray[currentIndex].bigPrice = this.globalItemList[currentId].bigPrice
+							currentArray[currentIndex].smallPrice = this.globalItemList[currentId].smallPrice
 						}
-					}			
+					})
+					this.setSelectInfo({ selectJobType: this.selectJobType, info: currentInfo,selectJobId:this.selectJobId })
 				}
 
 				this.classIndex = 0;
@@ -406,13 +359,13 @@ export default {
 			if(this.kdType == 'HIT' && multiple ==0){
 				this.$util.hitRemind()
 			}
+			
+			//数据放到仓库永久存放
+			this.pushToSave(list)
 
-			this.setSelectInfoByType({ type: this.pageType, info: list })
+			this.itemNumPriceRefresh()
 
-			this.itemListRefresh()
 
-			//记忆已经选择的花材
-			this.rememberProduct()
 		},
 		//显示可以修改花材的弹框
 		showAddModelFn(info) {
@@ -429,7 +382,7 @@ export default {
 			this.$nextTick(()=>{
 				this.customData.smallCount = this.customData.smallCount==0?null:this.customData.smallCount;
 				this.customData.bigCount = this.customData.bigCount==0?null:this.customData.bigCount;
-				if(this.pageType == 'bill'){
+				if(this.selectJobType == 'bill'){
 					if(this.customData.userPrice == null || this.customData.userPrice == 0){
 						this.customData.userPrice =	this.customData.bigPrice;
 					}
@@ -465,7 +418,7 @@ export default {
 				}
 			}
 			//只有开单和采购需要使用价格
-			if(this.pageType == 'bill' || this.pageType == 'purchase'){
+			if(this.selectJobType == 'bill' || this.selectJobType == 'purchase'){
 				if(/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(this.customData.userPrice) == false){
 					uni.showToast({title:"金额错误",icon:"none"})
 					return;
@@ -482,7 +435,7 @@ export default {
 			this.isAddModel = false;
 			this.customData = {};
 		},
-		itemListRefresh(){
+		itemNumPriceRefresh(){
 			//涉及记住花材的代码和流程,请全项目搜索关键词remember_item
 			//将已选的花材按classId_productId键名组合
 			let selectListData = []

+ 5 - 5
ghsApp/src/mixins/productContrapose.js

@@ -5,7 +5,7 @@ import { copyObject } from "@/utils/util";
 export default {
 	data() {
 		return {
-			pageType: "bill", //选择商品页面类别  用于区分不同功能的数据
+			selectJobType: "bill", //选择商品页面类别  用于区分不同功能的数据
 			productInfoList: [], //商品信息
 			classIndex: 0, //当前商品类别下标
 			py: "", //拼音搜索条件
@@ -19,9 +19,9 @@ export default {
 		};
 	},
 	onLoad(options) {
-		const { pageType } = options;
-		if (pageType) {
-			this.pageType = pageType;
+		const { selectJobType } = options;
+		if (selectJobType) {
+			this.selectJobType = selectJobType;
 		}
 		if (this.autoLoad) {
 			this.initDataContrapose();
@@ -32,7 +32,7 @@ export default {
 		...mapGetters(["getSelectInfo","getMyShopInfo"]),
 	},
 	methods: {
-		...mapActions(["setSelectInfoByType", "resetSelectInfoByType"]),
+		...mapActions(["setSelectInfo", "reSetSelectInfo"]),
 		async initDataContrapose(extendInfo) {
 			let params = {
 				py: this.py,

+ 5 - 5
ghsApp/src/mixins/ptProductContrapose.js

@@ -3,7 +3,7 @@ import { mapGetters, mapActions } from "vuex";
 export default {
 	data() {
 		return {
-			pageType: "ptProductList", //选择商品页面类别  用于区分不同功能的数据
+			selectJobType: "ptProductList", //选择商品页面类别  用于区分不同功能的数据
 			productInfoList: [], //商品信息
 			classIndex: 0, //当前商品类别下标
 			py: "", //拼音搜索条件
@@ -17,9 +17,9 @@ export default {
 		};
 	},
 	onLoad(options) {
-		const { pageType } = options;
-		if (pageType) {
-			this.pageType = pageType;
+		const { selectJobType } = options;
+		if (selectJobType) {
+			this.selectJobType = selectJobType;
 		}
 	},
 	onUnload() {},
@@ -27,7 +27,7 @@ export default {
 		...mapGetters(["getSelectInfo","getMyShopInfo"]),
 	},
 	methods: {
-		...mapActions(["setSelectInfoByType", "resetSelectInfoByType"]),
+		...mapActions(["setSelectInfo", "reSetSelectInfo"]),
 		async initDataContrapose(extendInfo) {
 			let params = {
 				name: this.py,

+ 5 - 10
ghsApp/src/pagesOrder/detail.vue

@@ -215,7 +215,7 @@ export default {
 		return {
 			ORDER_STATUS,
 			orderId:'',
-			pageType: "order_change",
+			selectJobType: "order_change",
 			autoLoad: false,
 			stepActive: 0,
 			userPrice: 0,
@@ -468,15 +468,10 @@ export default {
 				const { product } = this.detailInfo;
 
 				if (product) {
-					this.setSelectInfoByType({
-						type: this.pageType,
-						info: product.map(ele => {
-							return {
-								...ele,
-								bigCount: Number(ele.bigNum),
-								smallCount: Number(ele.smallNum)
-							};
-						})
+					this.setSelectInfo({
+						selectJobType: this.selectJobType,
+						info: product.map(ele => { return { ...ele, bigCount: Number(ele.bigNum), smallCount: Number(ele.smallNum) } }),
+						selectJobId:this.selectJobId
 					});
 				}
 			} catch {

+ 2 - 2
ghsApp/src/pagesOrder/select.vue

@@ -128,7 +128,7 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			pageType: "order_change",
+			selectJobType: "order_change",
 			COMMODITY_TYPE,
 			tabIndex: 0,
 			tabs: [
@@ -160,7 +160,7 @@ export default {
 		}
 	},
 	onUnload() {
-		this.resetSelectInfoByType(this.pageType);
+		this.reSetSelectInfo({selectJobType:this.selectJobType,selectJobId:this.selectJobId})
 	},
 
 	methods: {

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

@@ -9,7 +9,7 @@
 				<button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/ptItem/itemList' })">添花材</button>
 			</view>
 			<view style="padding:0 0upx 0 20upx;" >
-				<button class="admin-button-com middle blue" @click="removeMemory(option.ghsId)">清除采购</button>
+				<button class="admin-button-com middle blue" @click="removeFromSave(option.ghsId)">清除采购</button>
 			</view>
 		</view>
 
@@ -28,7 +28,7 @@
 						<template v-for="(productItem, productIndex) in classItem.child">
 							<view style="height: 160upx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
 							<CommodityPurchase v-if="classItem.isActive"
-								:type="pageType"
+								:type="selectJobType"
 								:key="productIndex"
 								:info="productItem"
 								@showAddModelFn="showAddModelFn"
@@ -98,7 +98,7 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			pageType: "purchase",
+			selectJobType: "purchase",
 			isAloneAllActive: false,
 			isAloneAllFocus: false,
 			isWeightActive: false,
@@ -125,10 +125,11 @@ export default {
 		this.cgItemInit()
 	},
 	onUnload() {
-		this.resetSelectInfoByType(this.pageType);
 	},
 	onLoad() {
-
+		if(!this.$util.isEmpty(this.option.ghsId)){
+			this.selectJobId = this.option.ghsId
+		}
 	},
 	methods: {
 		cgItemInit(){
@@ -141,7 +142,7 @@ export default {
 				this.$msg('请选择花材')
 				return false
 			}
-			uni.navigateTo({ url: "/pagesPurchase/details?ghsId="+this.option.ghsId+"&ghsName="+this.option.ghsName })
+			this.$util.pageTo({ url: '/pagesPurchase/details',type:2,query: {ghsId:this.option.ghsId,ghsName:this.option.ghsName}})
 		}
 	}
 };

+ 113 - 88
ghsApp/src/pagesPurchase/components/pageSuccess.vue

@@ -1,87 +1,42 @@
-<style lang="scss" scoped>
-.admin-button-com {
-	margin-bottom: 20upx;
-	width: 100%;
-}
-.goHome{
-	width: 80%;
-	height: 80upx;
-	color: #FFFFFF;
-	margin-top: 50upx;
-	background: #3385FF;
-	border-radius: 10upx;
-	font-size:30upx;
-}
-.title{
-	font-weight:700;
-	margin-bottom:30upx;
-}
-.product-area{
-	width:600upx;
-	height:120upx;
-	.first-area{
-		text{
-			width:270upx;
-			overflow: hidden;
-			text-overflow:ellipsis;
-			white-space: nowrap;
-			display:inline-block;
-		}
-		input{
-			border:1upx solid #cccccc;
-			display:inline-block;
-			width:150upx;
-			margin-left:30upx;
-			margin-right:10upx;
-		}
-	}
-	.second-area{
-		float:left;
-		color:#646464;
-		margin-top:10upx;
-		.one{
-			color:red;
-		}
-		.two{
-			color:#CCCCCC;
-		}
-	}
-}
-</style>
 <template>
-  <appResult title="已完成">
-	<view class="flowers-list-box">
-		<view class="flex title">建议修改以下花材售价:</view>
-		<checkbox-group @change="checkboxChange">
-			<view v-for="(res,i) in flowersList" :key="i">
-				<view class="product-area">
-					<view class="first-area"><text>{{res.name}}</text><input type="digit" v-model="res.autoPrice" @focus="priceFocus(i,res)" @input="modifyPrice(res)"> 元</view>
-					<view class="second-area">
-			                <view class="one" v-if="parseFloat(res.autoPrice)!=parseFloat(Number(res.addPrice)+Number(res.cost)) && parseFloat(Number(res.autoPrice)-Number(res.cost)) > 0">
-							<label>重量 {{parseFloat(res.weight)}} 成本 {{parseFloat(res.cost)}},加价建议{{parseFloat(Number(res.autoPrice)-Number(res.cost))}}元,修改请勾选<checkbox :value="res.id" style="transform:scale(0.7)" /> </label>
+	<view class="app-content">
+		<view class="billing_box_bg">
+			<view class="top-view"> </view>
+			<view class="result-view">
+				<view class="iconfont iconchenggong"></view>
+				<view class="result-title">采购成功</view>
+
+				<view class="flowers-list-box">
+					<view class="flex title">建议修改以下花材售价:</view>
+					<checkbox-group @change="checkboxChange">
+						<view v-for="(res,i) in flowersList" :key="i">
+							<view class="product-area">
+								<view class="first-area"><text>{{res.name}}</text><input type="digit" v-model="res.autoPrice" @focus="priceFocus(i,res)" @input="modifyPrice(res)"> 元</view>
+								<view class="second-area">
+										<view class="one" v-if="parseFloat(res.autoPrice)!=parseFloat(Number(res.addPrice)+Number(res.cost)) && parseFloat(Number(res.autoPrice)-Number(res.cost)) > 0">
+										<label>重量 {{parseFloat(res.weight)}} 成本 {{parseFloat(res.cost)}},加价建议{{parseFloat(Number(res.autoPrice)-Number(res.cost))}}元,修改请勾选<checkbox :value="res.id" style="transform:scale(0.7)" /> </label>
+									</view>
+									<view class="two" v-else>成本 {{parseFloat(res.cost)}},加价 {{parseFloat(res.addPrice)}}元</view>
+								</view>
+							</view>
 						</view>
-						<view class="two" v-else>成本 {{parseFloat(res.cost)}},加价 {{parseFloat(res.addPrice)}}元</view>
-					</view>
+					</checkbox-group>
 				</view>
+
+				<button class="admin-button-com big blue" style="width:40vh;margin-top:50upx;" @click="commitChange">确认修改</button>
+				<button class="admin-button-com big default" style="width:40vh;margin-top:30upx;" @click="goBackFn">返回首页</button>
+
 			</view>
-		</checkbox-group>
+		</view>
 	</view>
-	<button class="admin-button-com big blue" style="width:80%;margin-top:50upx;" @click="commitChange">确认修改</button>
-	<navigator open-type="switchTab" class="flex-center goHome" @click="goBackHome" >返回首页</navigator>
-  </appResult>
 </template>
 <script>
 import { getAllProductDataApi } from "@/api/product/index";
 import { batchUpdatePrice } from '@/api/product/index'
-import appResult from "@/components/app-result";
 export default {
-  name: "pageSuccess",
-  components: {
-    appResult
-  },
+    name: "pageSuccess",
 	data() {
 		return {
-			title:'',
 			flowersItemInfo:'',
 			flowersList:[],
 			productList:[],
@@ -93,20 +48,16 @@ export default {
 		this.getList();
 	},
 	onLoad(e){
-  	this.title = e.title
 	},
 	onUnload(){
 		uni.removeStorageSync('flowersItemInfo');
-		uni.navigateBack({delta:2})
 	},
 	methods: {
 		checkboxChange(e) {
-			console.log('values',e.detail.value)
 			this.costChangeIds = e.detail.value
 		},
 		priceFocus(i,res){
 			this.flowersList[i].autoPrice = ''
-
 			let id = res.id
 			if(parseFloat(res.autoPrice)==parseFloat(Number(res.addPrice)+Number(res.cost)) || parseFloat(Number(res.autoPrice)-Number(res.cost)) < 0){
 				let i = this.costChangeIds.indexOf(id)
@@ -114,11 +65,6 @@ export default {
 					this.costChangeIds.splice(i,1)
 				}
 			}
-			console.log('this.costChangeIds',this.costChangeIds)
-
-		},
-		closeLayer() {
-			uni.navigateBack({delta: 3});
 		},
 		getList(){
 			let productIdArr = '';
@@ -127,7 +73,6 @@ export default {
 			getAllProductDataApi({ids : productIdArr.substring(0, productIdArr.lastIndexOf(',')),}).then((res)=>{
 				that.flowersList = res.data.list;
 				that.productList = [];
-				console.log('that.productList',that.productList)
 				that.flowersList.forEach(function(item,index,arr){
 					that.productList.push({id:item.id,price:item.autoPrice})
 				})
@@ -143,8 +88,6 @@ export default {
 					this.costChangeIds.splice(i,1)
 				}
 			}
-			console.log('this.costChangeIds',this.costChangeIds)
-
 			let arr = this.productList.map((ele)=>{
 				if(ele.id == id){
 					return {id:id,price:price}
@@ -162,9 +105,91 @@ export default {
 				}
 			})
 		},
-		goBackHome() {
-			this.$util.pageTo({ url: "/admin/home/workbench", type: 3, query: { tabIndex: 0 }})
+		goBackFn() {
+			uni.navigateBack({})
 		}
-  },
+	}
 };
-</script>
+</script>
+<style lang="scss" scoped>
+.go-back{
+	width: 80%;
+	height: 80upx;
+	color: #FFFFFF;
+	margin-top: 50upx;
+	background: #3385FF;
+	border-radius: 10upx;
+	font-size:30upx;
+}
+.title{
+	font-weight:700;
+	margin-bottom:30upx;
+}
+.product-area{
+	width:600upx;
+	height:120upx;
+	.first-area{
+		text{
+			width:270upx;
+			overflow: hidden;
+			text-overflow:ellipsis;
+			white-space: nowrap;
+			display:inline-block;
+		}
+		input{
+			border:1upx solid #cccccc;
+			display:inline-block;
+			width:150upx;
+			margin-left:30upx;
+			margin-right:10upx;
+		}
+	}
+	.second-area{
+		float:left;
+		color:#646464;
+		margin-top:10upx;
+		.one{
+			color:red;
+		}
+		.two{
+			color:#CCCCCC;
+		}
+	}
+}
+.billing_box_bg {
+	position: relative;
+	padding: 60upx 30upx;
+	display: flex;
+	background: white;
+	flex-direction: column;
+    background-color: #f5f5f5;
+	.top-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 299upx;
+		background: #3385ff;
+		border-radius: 0upx 0upx 83upx 83upx;
+	}
+	.result-view {
+		position: relative;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		padding: 70upx;
+		width: 100%;
+		background: #ffffff;
+		border-radius: 20upx;
+		z-index: 1;
+		.iconchenggong {
+			font-size: 170upx;
+			color: $mainColor1;
+		}
+		.result-title {
+			margin: 50upx 0 70upx;
+			font-size: 32upx;
+		}
+	}
+}
+</style>

+ 9 - 17
ghsApp/src/pagesPurchase/details.vue

@@ -152,7 +152,7 @@ export default {
 		return {
 			PURCHASE_ORDER_STATUS,
 			autoLoad: false,
-			pageType: "purchase",
+			selectJobType: "purchase",
 			supplier:'',
 			form: {
 				packingCharge: "",
@@ -176,6 +176,9 @@ export default {
 	},
 	onLoad(option) {
 		this.form.ghsId = option.ghsId
+		if(!this.$util.isEmpty(option.ghsId)){
+			this.selectJobId = option.ghsId
+		}
 		if(this.getLoginInfo.cgModel == 1){
 			this.form.avgKgWeight = this.myShopInfo.cgPerCost
 		}
@@ -287,7 +290,7 @@ export default {
 						element.bigCount = element.bigNum;
 						element.smallCount = element.smallNum;
 					});
-					this.setSelectInfoByType({ type: this.pageType, info: list });
+					this.setSelectInfo({ selectJobType: this.selectJobType, info: list,selectJobId:this.selectJobId });
 				}
 				if (!this.getMerchantInfo) {
 					await this.initMerchantInfo();
@@ -334,21 +337,12 @@ export default {
 			}
 			const res = await createPurchaseOrderApi({...formData,modifyPrice:this.modifyPrice,cgModel:this.getLoginInfo.cgModel})
 			uni.setStorageSync('flowersItemInfo', itemInfo)
-
-			this.removeMemoryDirect(this.form.ghsId)
-
-			uni.reLaunch({url:'/pagesPurchase/components/pageSuccess?orderSn='+res.data.orderSn})
-
+			this.removeFromSaveDirect()
+			this.$util.pageTo({url: "/pagesPurchase/components/pageSuccess",type:2,query: {orderSn: res.data.orderSn}})
 		},
-		// 表单验证
 		formSubmit(e) {
-			// 表单规则
 			let rules = [
-				{
-					name: "itemInfo",
-					rule: ["minLength", 1],
-					msg: ["请选择花材"]
-				}
+				{ name: "itemInfo", rule: ["minLength", 1], msg: ["请选择花材"] }
 			];
 			// 进行表单检查
 			let formData = this.form;
@@ -362,9 +356,7 @@ export default {
 			}
 		},
 		gobackEvent() {
-			uni.navigateBack({
-				delta: 1,
-			});
+			this.pageTo({url: '/pagesPurchase/add',query:{ghsId:this.option.ghsId,ghsName:this.option.ghsName},type:2})
 		}
 	}
 };

+ 1 - 1
ghsApp/src/pagesPurchase/info.vue

@@ -217,7 +217,7 @@ export default {
 	mixins: [productMins],
 	data() {
 		return {
-			pageType: "order_change",
+			selectJobType: "order_change",
 			autoLoad: false,
 			stepActive: 0,
 			form: {

+ 2 - 2
ghsApp/src/pagesShare/pay.vue

@@ -161,8 +161,8 @@ export default {
       //   return false;
       // }
       // // #endif
-      if (this.option.pageType) {
-        this.tabIndex = parseInt(this.option.pageType);
+      if (this.option.selectJobType) {
+        this.tabIndex = parseInt(this.option.selectJobType);
       }
       
       getOrderShop().then(res => {

+ 4 - 4
ghsApp/src/pagesStorehouse/allot/addExDetails.vue

@@ -73,7 +73,7 @@
 				</block>
 				<view class="btn-bar">
 					<button class="admin-button-com big blue" @click="gotoSelectPage">选择花材</button>
-					<button v-if="!$util.isEmpty(selectList)" class="admin-button-com big blue" @click="removeMemory(0)" style="margin-left:30upx;">清空花材</button>
+					<button v-if="!$util.isEmpty(selectList)" class="admin-button-com big blue" @click="removeFromSave(0)" style="margin-left:30upx;">清空花材</button>
 				</view>
 			</view>
 		</view>
@@ -101,7 +101,7 @@ export default {
 	computed: {		...mapGetters(["getLoginInfo"])	},
 	data() {
 		return {
-			pageType: "allotEx",
+			selectJobType: "allotEx",
 			autoLoad: false,
 			form: {
 				date: "",
@@ -139,7 +139,7 @@ export default {
 	onLoad(){
 	},
 	methods: {
-		...mapActions(["resetSelectInfoByType"]),
+		...mapActions(["reSetSelectInfo"]),
 		async init() {
 		},
 		gotoSelectPage() {
@@ -212,7 +212,7 @@ export default {
 		async confirmStockOut(formData){
 			let { data } = await createStockOutOrderApi(formData);
 			this.$msg("确认成功")
-			this.removeMemoryDirect()
+			this.removeFromSaveDirect()
 			this.pageTo({url:'/pagesStorehouse/allot/exDetails?orderSn=' + data.orderSn, type: 2});
 		},
 	}

+ 1 - 1
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -93,7 +93,7 @@ export default {
 	data() {
 		return {
 			COMMODITY_TYPE,
-			pageType: "allotEx",
+			selectJobType: "allotEx",
 			tabIndex: 0,
 			isAddInputFocus: false,
 			isAddModel: false,

+ 1 - 1
ghsApp/src/pagesStorehouse/inventory/select.vue

@@ -93,7 +93,7 @@ export default {
 	mixins: [productMins,allMoreSelectInputMins],
 	data() {
 		return {
-			pageType: "inventory",
+			selectJobType: "inventory",
 			checkStock: false,
 			isAddInputFocus: false,
 			isSmallCount:false,//是否是小单位(支)

+ 9 - 14
ghsApp/src/pagesStorehouse/inventory/update.vue

@@ -63,7 +63,7 @@
 		</view>
 		<view class="bar-view" v-if="selectList.length>0">
 			<view class="btn-view">
-				<button class="admin-button-com middle" @click="removeMemory(0)" style="margin-left:30upx;">清空花材</button>
+				<button class="admin-button-com middle" @click="removeFromSave(0)" style="margin-left:30upx;">清空花材</button>
 				<button :class="['admin-button-com', 'middle']" @click="gotoSelectPage"> 修改花材 </button>
 				<button v-if="!orderSn" :class="['admin-button-com', 'middle', { disabled: allCount == 0 }]" :disabled="allCount == 0" @click="confirmPop(1)"> 确认盘点 </button>
 				<button v-if="orderSn" :class="['admin-button-com', 'middle', { disabled: allCount == 0 }]" :disabled="allCount == 0" @click="confirmPop(2)"> 确认盘点 </button>
@@ -93,7 +93,7 @@ export default {
 			autoLoad: false,
 			shopInfo:{shopName:''},
 			remark: "",
-			pageType: "inventory",
+			selectJobType: "inventory",
 			columns: [
 				{
 					name: "名称",
@@ -134,7 +134,7 @@ export default {
 			this.orderSn = orderSn;
 			this.initInfo();
 		}else{
-			this.resetSelectInfoByType(this.pageType);
+			this.reSetSelectInfo({selectJobType:this.selectJobType,selectJobId:this.selectJobId});
 		}
 	this.getInfo();
 		if (!this.getMerchantInfo) {
@@ -152,17 +152,12 @@ export default {
 				this.infoData = data;
 				const { remark, itemInfo } = data;
 				this.remark = remark;
-				this.setSelectInfoByType({
-					type: this.pageType,
+				this.setSelectInfo({
+					selectJobType: this.selectJobType,
 					info: itemInfo.map(ele => {
-						return {
-							...ele,
-							bigNum: Number(ele.bigNumStock),
-							smallNum: Number(ele.smallNumStock),
-							bigCount: Number(ele.bigNum),
-							smallCount: Number(ele.smallNum)
-						};
-					})
+						return { ...ele, bigNum: Number(ele.bigNumStock), smallNum: Number(ele.smallNumStock), bigCount: Number(ele.bigNum), smallCount: Number(ele.smallNum) }
+					}),
+					selectJobId:this.selectJobId
 				});
 			} catch (error) {}
 		},
@@ -262,7 +257,7 @@ export default {
 					await updateCheckOrderApi(params)
 				}
 				this.$msg("盘点成功");
-				this.removeMemoryDirect()
+				this.removeFromSaveDirect()
 				uni.navigateBack({delta: 1});
 			} catch (error) {}
 		},

+ 1 - 1
ghsApp/src/pagesStorehouse/stockWarn/manage.vue

@@ -45,7 +45,7 @@ export default {
 	data() {
 		return {
 			autoLoad: false, //不自动请求数据  自定义请求
-			pageType: "stock",
+			selectJobType: "stock",
 			tabIndex: 0,
 			modifyStock:{},
 			tabs: [

+ 13 - 15
ghsApp/src/store/modules/product.js

@@ -1,28 +1,26 @@
 export default {
 	state: {
-		selectInfo: {} //选择商品信息  用页面pageType当key  查询对应模块选择的商品列表
+		//选中的花材信息
+		selectInfo: {}
 	},
 	getters: {
 		getSelectInfo(state) {
-			return state.selectInfo || {};
+			return state.selectInfo
 		}
 	},
 	actions: {
-		//设置不同类别选中商品列表信息
-		setSelectInfoByType({ commit }, { type, info }) {
-			commit("SET_SELECTINFO_BY_TYPE", { type, info });
+		//保存已选花材列表
+		setSelectInfo({ commit }, { selectJobType, info,selectJobId }) {
+			commit("SET_SELECTED_ITEM", { selectJobType, info,selectJobId });
 		},
-		//清空不同类别选中商品列表信息
-		resetSelectInfoByType({ commit }, type) {
-			commit("SET_SELECTINFO_BY_TYPE", { type, info: [] });
+		//清空已选花材信息
+		reSetSelectInfo({ commit }, {selectJobType,selectJobId}) {
+			commit("SET_SELECTED_ITEM", { selectJobType, info: [],selectJobId });
 		}
 	},
 	mutations: {
-		["SET_SELECTINFO_BY_TYPE"](state, { type, info }) {
-			state.selectInfo = { ...state.selectInfo, [type]: info }
-		},
-		flushSelectItem(state, payload) {
-			state.selectInfo = payload
-		},
+		SET_SELECTED_ITEM(state, { selectJobType, info,selectJobId }) {
+			state.selectInfo = { ...state.selectInfo, [selectJobType+'_'+selectJobId]: info }
+		}
 	}
-};
+};