From 38330fe15036fe17034ff6efe0463f2d2ee3c792 Mon Sep 17 00:00:00 2001 From: Enzo <1284707383@qq.com> Date: Sat, 31 Jul 2021 19:41:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=BA=93=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- canteen/common/api.js | 4 +-- canteen/pages/classification/warehouse.vue | 10 +++--- canteen/pages/delivery/apply.vue | 11 +++++-- canteen/pages/delivery/order.vue | 37 +++++++++++++++------- 4 files changed, 41 insertions(+), 21 deletions(-) diff --git a/canteen/common/api.js b/canteen/common/api.js index fd8a615..ae30b0b 100644 --- a/canteen/common/api.js +++ b/canteen/common/api.js @@ -2,8 +2,8 @@ export const DEV = "dev"; // dev 测试 | prod 正式 export const VERSION = '1.0.0'; // 版本号 // export const DEVURL = 'http://192.168.3.78'; // 测试服请求地址 -export const DEVURL = 'http://fsc.lanzulive.com'; // 测试服请求地址 -// export const DEVURL = 'http://192.168.3.96'; // 测试服请求地址 +// export const DEVURL = 'http://fsc.lanzulive.com'; // 测试服请求地址 +export const DEVURL = 'http://192.168.3.96'; // 测试服请求地址 export const PRODURL = ''; // 正式服请求地址 export const API_CANTEEN_LOGIN = '/api/canteen/login'; // 登录 diff --git a/canteen/pages/classification/warehouse.vue b/canteen/pages/classification/warehouse.vue index af37bdd..bccb896 100644 --- a/canteen/pages/classification/warehouse.vue +++ b/canteen/pages/classification/warehouse.vue @@ -86,7 +86,7 @@ return item; }) let list = res.data.material.map(item => { - if(this.checked_list[item.material_id]){ + if(this.checked_list[item.order_id]){ item.checked = true; }else{ item.checked = false; @@ -97,7 +97,7 @@ this.tab_list = tab_list; }else{ let list = res.data.material.map(item => { - if(this.checked_list[item.material_id]){ + if(this.checked_list[item.order_id]){ item.checked = true; }else{ item.checked = false; @@ -122,16 +122,16 @@ if(this.is_search_ing){ this.tab_list.forEach(t_item => { t_item.list.forEach(l_item => { - if(l_item.material_id == item.material_id){ + if(l_item.material_id == item.order_id){ l_item.checked = item.checked; } }) }) } if(item.checked){ - this.checked_list[item.material_id] = item; + this.checked_list[item.order_id] = item; }else{ - delete this.checked_list[item.material_id]; + delete this.checked_list[item.order_id]; } uni.$emit('addWarehouseList', this.checked_list); console.log("checked_list", this.checked_list) diff --git a/canteen/pages/delivery/apply.vue b/canteen/pages/delivery/apply.vue index 3776533..80e797d 100644 --- a/canteen/pages/delivery/apply.vue +++ b/canteen/pages/delivery/apply.vue @@ -72,6 +72,10 @@ let contents = []; let warehouse_list = this.warehouse_list; for(let i in warehouse_list){ + + warehouse_list[i].delivery_number = {edit: true, value: '1'} + warehouse_list[i].brand = i.brand + warehouse_list[i].quality_level = i.quality_level contents.push(warehouse_list[i]); } this.contents = contents; @@ -89,16 +93,19 @@ return this.$msg('您未选择物资') } let list = this.contents.map(item => { + console.log(item) return { m_id: item.material_id, m_spec_id: item.spec_id, tax_price: '', non_tax_price: '', purchase_id: item.purchase_id, - out_number: '' + out_number: '' , + state: '待确认' } }); - + this.contents = list; + console.log('==========',list) // let state = ['', ''][_t]; // 传入状态 this.$http(this.API.API_CANTEEN_WAREHOUSEOUT, { data: list diff --git a/canteen/pages/delivery/order.vue b/canteen/pages/delivery/order.vue index 08aac23..cbb909c 100644 --- a/canteen/pages/delivery/order.vue +++ b/canteen/pages/delivery/order.vue @@ -67,7 +67,8 @@ ..._public }], page_size: 10, - windowHeight: 0 + windowHeight: 0, + stateText: '' } }, computed: { @@ -91,18 +92,30 @@ methods: { // 获取数据 TODO 目前接口还没有数据 getData(options){ + if(this.current == 1) { + this.stateText = '待确认' + }else if(this.current == 2) { + this.stateText = '已出库' + }else { + this.stateText = '' + } let item = this.tab_list[this.current]; - this.$http(this.API.API_CANTEEN_WAREHOUSEOUTLIST).then(res => { + this.$http(this.API.API_CANTEEN_WAREHOUSEOUTLIST,{ + page: item.page, + pagesize: 10, + state: this.stateText + }).then(res => { console.log("getData", res); this.tab_list[this.current].list = res.data.list || []; let list = res.data.list || []; - // let isPage res.data.isPage; - // if(!isPage){ - // item.loading_class = false; - // item.loading_text = '已加载全部数据~'; - // } - // item.isPage = isPage; + let isPage = res.data.hasmore; + if(!isPage){ + item.loading_class = false; + item.loading_text = '已加载全部数据~'; + } + item.isPage = isPage; + uni.stopPullDownRefresh() if(options && options.refresh){ item.isRefresher = false; @@ -118,7 +131,7 @@ tabsChange(current){ this.current = current; if(this.tab_list[this.current].list.length <= 0){ - this.getData(); + this.getData({type: this.current}); } }, // swiper页面切换 @@ -126,7 +139,7 @@ this.current = event.detail.current; if(event.detail.source == '') return; // 如果是被动出发,没有事件类型则不做处理 if(this.tab_list[this.current].list.length <= 0){ - this.getData(); + this.getData({type: this.current}); } }, // 页面触底 @@ -134,7 +147,7 @@ let item = this.tab_list[this.current]; if(item.isPage){ item.page++; - this.getData(); + this.getData({type: this.current}); } }, // 下拉刷新 @@ -147,7 +160,7 @@ item.loading_class = true; item.loading_text = '正在加载中...'; item.list = []; - this.getData({refresh: true}); + this.getData({refresh: true,type: this.current}); }, 200); } }