shish 3 лет назад
Родитель
Сommit
c9ee586eab

+ 11 - 41
ghsApp/src/pagesStorehouse/stockWarn/detailed.vue

@@ -58,25 +58,7 @@ export default {
 	computed: {		...mapGetters(["getDictionariesInfo","getLoginInfo"])	},
 	data() {
 		return {
-			isShow:false,
-			customizationTime:'',
-			menuTimeObj:'',
-			menuShopObj:'',
-			selectTimeId:'',
-			shopId:'',
-			itemId:'',
-			nowTime: "",
-			showTimeDropdown: false,
-			nowShop: "",
-			showShopDropdown: false,
-			dataList: [],
-			params:{
-				itemId: '',
-				searchTime:'',
-				startTime: "",
-				endTime: "",
-				shopId: "",
-			},
+
 		};
 	},
 	onPullDownRefresh() {
@@ -85,24 +67,6 @@ export default {
 			uni.stopPullDownRefresh();
 		});
 	},
-	onLoad(e) {
-		this.itemId = e.id;
-		this.params.id = e.id;
-		let dateDefaultOption = [];
-		let list = this.getDictionariesInfo.dateDefaultOption;
-		if(!this.$util.isEmpty(list)){
-			for (let i=0;i<list.length;i++){
-				dateDefaultOption.push({name:list[i].name,id:list[i].value})
-			}
-			this.menuTimeObj = {title:'今天',titleChild:'时间',list: dateDefaultOption}
-		}
-		this.shopId = this.getLoginInfo.shopId;
-
-		if(this.option.name){
-			uni.setNavigationBarTitle({ title: this.option.name })
-		}
-
-	},
 	onReachBottom() {
 		if (!this.list.finished) {
 			this.getStockList().then((res) => {
@@ -114,12 +78,18 @@ export default {
 	},
 	methods: {
 		...mapActions(['setUserShopAll']),
-		async init() {
-			this.getStockList();
+		init() {
+
+			if(this.option.name){
+				uni.setNavigationBarTitle({ title: this.option.name })
+			}
+
+			this.getStockList()
 		},
 		getStockList() {
-			return getStockDetailApi({...this.params,page: this.list.page,}).then(res => {
-				this.completes(res);
+			console.log(this.option)
+			return getStockDetailApi({id:this.option.id,page: this.list.page}).then(res => {
+				this.completes(res)
 			});
 		}
 	}

+ 10 - 71
hdApp/src/pagesStorehouse/stockWarn/detailed.vue

@@ -54,82 +54,18 @@ export default {
 	computed: {		...mapGetters(["getDictionariesInfo","getLoginInfo"])	},
 	data() {
 		return {
-			isShow:false,
-			customizationTime:'',
-			menuTimeObj:'',
-			menuShopObj:'',
-			selectTimeId:'',
-			shopId:'',
-			itemId:'',
-			selectListData: [
-				{
-					title: "时间",
-					key: "time",
-					default: "1",
-					data: [
-						{
-							name: "下午",
-							value: "1"
-						}
-					]
-				},
-				{
-					title: "全部",
-					key: "shopId",
-					default: "01",
-					data: [
-						{
-							name: "瑞景店",
-							value: "01"
-						},
-						{
-							name: "加州店",
-							value: "02"
-						}
-					]
-				}
-			],
-			nowTime: "",
-			showTimeDropdown: false,
-			nowShop: "",
-			showShopDropdown: false,
-			dataList: [],
-			params:{
-				itemId: '',
-				searchTime:'',
-				startTime: "",
-				endTime: "",
-				shopId: "",
-			},
+
 		};
 	},
 	onPullDownRefresh() {
 		this.resetList();
-		this._list().then(res => {
+		this.getStockChangeList().then(res => {
 			uni.stopPullDownRefresh();
 		});
 	},
-	onLoad(e) {
-		this.itemId = e.id;
-		this.params.id = e.id;
-		let dateDefaultOption = [];
-		let list = this.getDictionariesInfo.dateDefaultOption;
-		if(!this.$util.isEmpty(list)){
-			for (let i=0;i<list.length;i++){
-				dateDefaultOption.push({name:list[i].name,id:list[i].value})
-			}
-			this.menuTimeObj = {title:'今天',titleChild:'时间',list: dateDefaultOption}
-		}
-		this.shopId = this.getLoginInfo.shopId;
-
-		if(this.option.name){
-			uni.setNavigationBarTitle({ title: this.option.name+' 库存变动' })
-		}
-
-	},
 	onReachBottom() {
 		if (!this.list.finished) {
-			this._list().then((res) => {
+			this.getStockChangeList().then((res) => {
 				uni.stopPullDownRefresh();
 			});
 		} else {
@@ -138,11 +74,14 @@ export default {
 	},
 	methods: {
 		...mapActions(['setUserShopAll']),
-		async init() {
-			this._list();
+		init() {
+			if(this.option.name){
+				uni.setNavigationBarTitle({ title: this.option.name })
+			}
+			this.getStockChangeList();
 		},
-		_list() {
-			return getStockDetailApi({...this.params,page: this.list.page,}).then(res => {
+		getStockChangeList() {
+			return getStockDetailApi({id:this.option.id,page: this.list.page,}).then(res => {
 				this.completes(res);
 			});
 		}