Browse Source

供货商端 采购下单 选择供货商支持添加并返回供货商

jf 5 years ago
parent
commit
fe4596d882

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

@@ -123,7 +123,7 @@
       </button>
       </button>
     </view>
     </view>
     <!-- 选择客户 -->
     <!-- 选择客户 -->
-    <AppCustomerSel :isNewClient.sync="isNewClient" :show.sync="showCustomer" @change="changeCustomerFn"/>
+    <AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn"/>
   </view>
   </view>
 </template>
 </template>
 
 

+ 16 - 10
ghsApp/src/components/app-supplier-sel.vue

@@ -3,7 +3,7 @@
 		<bottom-popup class="popup-wrap" :show="showPopup" @close="hidePopup">
 		<bottom-popup class="popup-wrap" :show="showPopup" @close="hidePopup">
 			<div class="map-wrap">
 			<div class="map-wrap">
 				<div class="map-top-tit-wrap">
 				<div class="map-top-tit-wrap">
-					<div class="map-top-tit">请选择客户</div>
+					<div class="map-top-tit">请选择供货商</div>
 					<app-close icon="iconguanbi" @close="hidePopup" />
 					<app-close icon="iconguanbi" @close="hidePopup" />
 				</div>
 				</div>
 				<!-- 搜索 -->
 				<!-- 搜索 -->
@@ -37,14 +37,14 @@
 						<view class="item-avatar">
 						<view class="item-avatar">
 							<image :src="item.smallAvatar" alt="商品图" />
 							<image :src="item.smallAvatar" alt="商品图" />
 						</view>
 						</view>
-						<view class="item-name"> {{ item.name || "" }}</view>
+						<view class="item-name"> {{ item.name || "" }} <text v-if="newGhsId==item.id">新供货商</text></view>
 						<view class="item-level">{{ getCustomerLevelName(item) }}</view>
 						<view class="item-level">{{ getCustomerLevelName(item) }}</view>
 						<!-- <view class="item-tag">NEW</view> -->
 						<!-- <view class="item-tag">NEW</view> -->
 					</view>
 					</view>
 				</scroll-view>
 				</scroll-view>
-<!--				<view class="add-customer-bar" @click="gotoAddCustomer">-->
-<!--					没有找到客户?新增-->
-<!--				</view>-->
+				<view class="add-customer-bar" @click="gotoAddCustomer">
+					没有找到供货商?新增
+				</view>
 			</div>
 			</div>
 		</bottom-popup>
 		</bottom-popup>
 	</div>
 	</div>
@@ -75,6 +75,7 @@ export default {
 		return {
 		return {
 			showPopup: false,
 			showPopup: false,
 			name: "",
 			name: "",
+			newGhsId: "",
 			customerListData: []
 			customerListData: []
 		};
 		};
 	},
 	},
@@ -107,9 +108,8 @@ export default {
 		initList() {
 		initList() {
 			return getList({ type: "0", name: this.name })
 			return getList({ type: "0", name: this.name })
 				.then(res => {
 				.then(res => {
-					const {
-						data: { list }
-					} = res;
+					const {data: { list }} = res;
+					this.newGhsId = uni.getStorageSync("newGhs")?uni.getStorageSync("newGhs").id:'';
 					this.customerListData = list;
 					this.customerListData = list;
 				})
 				})
 				.catch(err => {});
 				.catch(err => {});
@@ -148,7 +148,7 @@ export default {
 		},
 		},
 		gotoAddCustomer() {
 		gotoAddCustomer() {
 			uni.navigateTo({
 			uni.navigateTo({
-				url: "/pagesClient/member/add",
+				url: "/pagesPurchase/suppAdd",
 				success: result => {
 				success: result => {
 					this.hidePopup();
 					this.hidePopup();
 				},
 				},
@@ -218,7 +218,13 @@ export default {
 			.item-name {
 			.item-name {
 				flex-shrink: 0;
 				flex-shrink: 0;
 				margin: 0 20upx;
 				margin: 0 20upx;
-				width: 200upx;
+				/*width: 200upx;*/
+				text{
+					padding: 0 10rpx;
+					margin-left: 20rpx;
+					color: #3385ff;
+					border: 1px solid #3385ff;
+				}
 			}
 			}
 			.item-level {
 			.item-level {
 				margin: 0 20upx;
 				margin: 0 20upx;

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

@@ -199,6 +199,14 @@ export default {
 	onLoad() {
 	onLoad() {
 		this.initData();
 		this.initData();
 	},
 	},
+	onShow(){
+		if(!this.$util.isEmpty(uni.getStorageSync("newGhs"))){
+			this.showCustomer = true;
+		}
+	},
+	onUnload(){
+		uni.removeStorageSync('newGhs');
+	},
 	computed: {
 	computed: {
 		...mapGetters(["getMerchantInfo", "getLoginInfo"]),
 		...mapGetters(["getMerchantInfo", "getLoginInfo"]),
 		allPrice() {
 		allPrice() {

+ 2 - 1
ghsApp/src/pagesPurchase/suppAdd.vue

@@ -114,6 +114,7 @@ export default {
         title:"加载中..."
         title:"加载中..."
       })
       })
       ghsAdd(this.form).then(res => {
       ghsAdd(this.form).then(res => {
+							uni.setStorageSync('newGhs', res.data);
         uni.hideLoading()
         uni.hideLoading()
         setTimeout(() => {
         setTimeout(() => {
           this.$util.pageTo(1);
           this.$util.pageTo(1);
@@ -157,4 +158,4 @@ export default {
     width: 100%;
     width: 100%;
   }
   }
 }
 }
-</style>
+</style>

+ 3 - 0
ghsApp/src/pagesPurchase/supplier.vue

@@ -63,6 +63,9 @@ export default {
       tabIndex: 0
       tabIndex: 0
     }
     }
   },
   },
+	onShow(){
+		uni.removeStorageSync('newGhs');
+	},
   onPullDownRefresh() {
   onPullDownRefresh() {
     this.getGHSList().then(res => {
     this.getGHSList().then(res => {
       uni.stopPullDownRefresh();
       uni.stopPullDownRefresh();