Browse Source

出库订单

master
Enzo 5 years ago
parent
commit
38330fe150
  1. 4
      canteen/common/api.js
  2. 10
      canteen/pages/classification/warehouse.vue
  3. 11
      canteen/pages/delivery/apply.vue
  4. 37
      canteen/pages/delivery/order.vue

4
canteen/common/api.js

@ -2,8 +2,8 @@
export const DEV = "dev"; // dev 测试 | prod 正式 export const DEV = "dev"; // dev 测试 | prod 正式
export const VERSION = '1.0.0'; // 版本号 export const VERSION = '1.0.0'; // 版本号
// export const DEVURL = 'http://192.168.3.78'; // 测试服请求地址 // 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 PRODURL = ''; // 正式服请求地址
export const API_CANTEEN_LOGIN = '/api/canteen/login'; // 登录 export const API_CANTEEN_LOGIN = '/api/canteen/login'; // 登录

10
canteen/pages/classification/warehouse.vue

@ -86,7 +86,7 @@
return item; return item;
}) })
let list = res.data.material.map(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; item.checked = true;
}else{ }else{
item.checked = false; item.checked = false;
@ -97,7 +97,7 @@
this.tab_list = tab_list; this.tab_list = tab_list;
}else{ }else{
let list = res.data.material.map(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; item.checked = true;
}else{ }else{
item.checked = false; item.checked = false;
@ -122,16 +122,16 @@
if(this.is_search_ing){ if(this.is_search_ing){
this.tab_list.forEach(t_item => { this.tab_list.forEach(t_item => {
t_item.list.forEach(l_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; l_item.checked = item.checked;
} }
}) })
}) })
} }
if(item.checked){ if(item.checked){
this.checked_list[item.material_id] = item;
this.checked_list[item.order_id] = item;
}else{ }else{
delete this.checked_list[item.material_id];
delete this.checked_list[item.order_id];
} }
uni.$emit('addWarehouseList', this.checked_list); uni.$emit('addWarehouseList', this.checked_list);
console.log("checked_list", this.checked_list) console.log("checked_list", this.checked_list)

11
canteen/pages/delivery/apply.vue

@ -72,6 +72,10 @@
let contents = []; let contents = [];
let warehouse_list = this.warehouse_list; let warehouse_list = this.warehouse_list;
for(let i in 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]); contents.push(warehouse_list[i]);
} }
this.contents = contents; this.contents = contents;
@ -89,16 +93,19 @@
return this.$msg('您未选择物资') return this.$msg('您未选择物资')
} }
let list = this.contents.map(item => { let list = this.contents.map(item => {
console.log(item)
return { return {
m_id: item.material_id, m_id: item.material_id,
m_spec_id: item.spec_id, m_spec_id: item.spec_id,
tax_price: '', tax_price: '',
non_tax_price: '', non_tax_price: '',
purchase_id: item.purchase_id, purchase_id: item.purchase_id,
out_number: ''
out_number: '' ,
state: '待确认'
} }
}); });
this.contents = list;
console.log('==========',list)
// let state = ['', ''][_t]; // // let state = ['', ''][_t]; //
this.$http(this.API.API_CANTEEN_WAREHOUSEOUT, { this.$http(this.API.API_CANTEEN_WAREHOUSEOUT, {
data: list data: list

37
canteen/pages/delivery/order.vue

@ -67,7 +67,8 @@
..._public ..._public
}], }],
page_size: 10, page_size: 10,
windowHeight: 0
windowHeight: 0,
stateText: ''
} }
}, },
computed: { computed: {
@ -91,18 +92,30 @@
methods: { methods: {
// TODO // TODO
getData(options){ 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]; 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); console.log("getData", res);
this.tab_list[this.current].list = res.data.list || []; this.tab_list[this.current].list = res.data.list || [];
let 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){ if(options && options.refresh){
item.isRefresher = false; item.isRefresher = false;
@ -118,7 +131,7 @@
tabsChange(current){ tabsChange(current){
this.current = current; this.current = current;
if(this.tab_list[this.current].list.length <= 0){ if(this.tab_list[this.current].list.length <= 0){
this.getData();
this.getData({type: this.current});
} }
}, },
// swiper // swiper
@ -126,7 +139,7 @@
this.current = event.detail.current; this.current = event.detail.current;
if(event.detail.source == '') return; // if(event.detail.source == '') return; //
if(this.tab_list[this.current].list.length <= 0){ 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]; let item = this.tab_list[this.current];
if(item.isPage){ if(item.isPage){
item.page++; item.page++;
this.getData();
this.getData({type: this.current});
} }
}, },
// //
@ -147,7 +160,7 @@
item.loading_class = true; item.loading_class = true;
item.loading_text = '正在加载中...'; item.loading_text = '正在加载中...';
item.list = []; item.list = [];
this.getData({refresh: true});
this.getData({refresh: true,type: this.current});
}, 200); }, 200);
} }
} }

Loading…
Cancel
Save