ソースを参照

供应商的采购增加一个采购记忆功能,再增加一个清除采购按钮和添加花材按钮

jiangfeng 5 年 前
コミット
6a7e184cb3

+ 3 - 0
ghsApp/src/mixins/product.js

@@ -472,6 +472,9 @@ export default {
 
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 			console.log(this.selectList,'this.selectList')
+			if(this.isReserve){
+				uni.setStorageSync('selectList', this.selectList);
+			}
 			// this.$forceUpdate();
 		},
 		/**

+ 22 - 0
ghsApp/src/pagesPurchase/add.vue

@@ -1,7 +1,15 @@
 <template>
 	<view class="billing_box_bg">
 		<view class="input-wrap">
+			<view class="search-bar">
 			<app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索" @input="searchFn"/>
+			</view>
+			<view style="padding:0 0rpx 0 20rpx;" >
+				<button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/item/detail' })">添加</button>
+			</view>
+			<view style="padding:0 0rpx 0 20rpx;" >
+				<button class="admin-button-com middle blue" @click="removeAllSelectList()">清除采购</button>
+			</view>
 		</view>
 
 		<view class="scroll-middle_bx">
@@ -123,6 +131,7 @@ export default {
 			pageType: "purchase",
 
 			isFocus: false,
+			isReserve: true,
 			isAloneAllActive: false,
 			isAloneAllFocus: false,
 
@@ -145,6 +154,11 @@ export default {
 		...mapGetters(["getMyShopInfo","getLoginInfo"]),
 	},
 	onShow(){
+		if(uni.getStorageSync('selectList')){
+			console.log(uni.getStorageSync('selectList'))
+			this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList') });
+		}
+
 		this.shopId = this.getMyShopInfo.id;
 		let type = '';
 		this.initData({ type, shopId: this.shopId,status:0});
@@ -155,6 +169,10 @@ export default {
 		this.initData({ type, shopId: this.shopId,status:0});
 	},
 	methods: {
+		removeAllSelectList(){
+			uni.removeStorageSync('selectList');
+			this.resetSelectInfoByType(this.pageType);
+		},
 		// 计算重量
 		countWeight(){
 			let ratio = this.customData.ratio;
@@ -334,7 +352,11 @@ export default {
 	display: flex;
 	flex-direction: column;
 	.input-wrap {
+		display: flex;
 		padding: 22px 20px 22px 30px;
+		.search-bar {
+			flex: 1;
+		}
 	}
 	.scroll-middle_bx {
 		flex: 1;

+ 1 - 0
ghsApp/src/pagesPurchase/details.vue

@@ -368,6 +368,7 @@ export default {
 				await createPurchaseOrderApi({...formData,modifyPrice:this.modifyPrice});
 				uni.setStorageSync('flowersItemInfo', itemInfo);
 				this.resetSelectInfoByType(this.pageType);
+				uni.removeStorageSync('selectList');
 				uni.navigateTo({url:'/pagesPurchase/components/pageSuccess?title=新增成功'})
 			} catch (error) {}
 		},