shish 4 лет назад
Родитель
Сommit
f1de8476a0

+ 13 - 14
hdApp/src/components/module/shopSelect.vue

@@ -24,7 +24,8 @@
 </template>
 <script>
 import DropdownList from "@/components/plugin/dropdown-list";
-import {mapGetters,mapState} from "vuex";
+import {mapGetters} from "vuex";
+import { shopAll } from '@/api/common'
 export default {
     name:'DorpdownSelect',
     components:{
@@ -61,22 +62,20 @@ export default {
         }
     },
     computed:{
-		...mapGetters(["getMyShopInfo"]),
-        ...mapState({userShopAll:state=>state.user.userShopAll}),
+		...mapGetters(["getMyShopInfo"])
     },
     mounted(){
-        this.shopList = this.userShopAll.map(i=>({...i,name:i.shopName}))
+        this.shopList = []
+        shopAll().then(res=>{
+            if(res.code == 1){
+                if (!this.$util.isEmpty(res.data)){
+					res.data.forEach((i) => {
+						this.shopList.push({id:i.id,name:i.shopName})
+					})
+                }
+            }
+        })
     },
-	watch:{
-        userShopAll (val) {
-			if(!this.$util.isEmpty(val)) {
-				this.shopList = val.map(i=>({
-					...i,
-					name:i.shopName
-				}));
-			}
-		}
-	},
     methods:{
         switchCut(){
             this.dropdownShow = !this.dropdownShow

+ 16 - 21
hdApp/src/pagesStorehouse/allot/addExDetails.vue

@@ -7,13 +7,7 @@
 						<TuiListCell class="line-cell" :hover="false" :arrow="true">
 							<view class="tui-title ">收货门店</view>
 							<view class="tui-input">
-								<DorpdownSelect
-									:menuObj.sync="menuObj"
-									top="0"
-									:isShowMore="false"
-									:selectItemId.sync="form.inShopId"
-									@selectSussess="selectSussess"
-								></DorpdownSelect>
+								<ShopSelect class="bar" top="0" :isShowMore="false" @selectShopFn="selectShopFn" />
 							</view>
 						</TuiListCell>
 						<TuiListCell class="line-cell" :hover="false" :arrow="true">
@@ -84,25 +78,20 @@
 				</button>
 			</view>
 		</view>
-    <!-- <kd-entrance></kd-entrance> -->
 	</view>
 </template>
 <script>
-import { getMainProfile } from "@/api/statistics";
-
 import TuiListCell from "@/components/plugin/list-cell";
 import productMins from "@/mixins/product";
 import AppDatePicker from "@/components/app-date-picker";
-import DorpdownSelect from "@/components/module/dorpdownSelect";
+import ShopSelect from "@/components/module/shopSelect";
 import { selectShop } from "@/mixins";
 import { createStockOutOrderApi } from "@/api/storehouse/stock";
-import {mapActions} from "vuex";
+import {mapActions,mapGetters} from "vuex";
 const formUtil = require("@/utils/formValidation.js");
-
 export default {
-	components: { TuiListCell, AppDatePicker, DorpdownSelect },
+	components: { TuiListCell, AppDatePicker, ShopSelect },
 	mixins: [productMins, selectShop],
-
 	data() {
 		return {
 			pageType: "allotEx",
@@ -120,28 +109,34 @@ export default {
 				{
 					name: "库存",
 					dataIndex: "stock",
-					// color: "success",
 					width: 120,
 					align: "center"
 				},
 				{
 					name: "出库数量",
 					custom: "excount",
-					// color: "warn",
 					width: 120,
 					align: "center"
 				}
 			]
 		};
 	},
+	computed: {
+		...mapGetters(["getLoginInfo"])
+	},
 	onShow() {
-		console.log('拿到选择商品列表', this.selectList);
 	},
 	methods: {
 		...mapActions(["resetSelectInfoByType"]),
-		/**
-			* 清楚页面选中的商品列表  姜枫 2021.03.27
-			* */
+		selectShopFn(val) {
+			if(this.getLoginInfo.shopId == val.id) {
+				this.$msg('不能出到库到本店')
+				this.form.inShopId = ''
+				return
+			}
+			this.form.inShopId = val.id;
+		},
+		//清楚页面选中的商品列表  姜枫 2021.03.27
 		clearSelectList(){
 			this.resetSelectInfoByType(this.pageType)
 		},