Browse Source

多个table增加字段显示

master
邓平艺 5 years ago
parent
commit
ae2a96c1be
  1. 2
      canteen/common/shared.js
  2. 30
      canteen/pages/delivery/apply.vue
  3. 10
      canteen/pages/delivery/detail.vue
  4. 18
      canteen/pages/purchase/detail.vue
  5. 35
      canteen/pages/purchase/launch.vue
  6. 10
      supplier/pages/gonghuo/detail.vue
  7. 29
      supplier/pages/offer/index.vue
  8. 10
      supplier/pages/order/detail.vue

2
canteen/common/shared.js

@ -31,7 +31,7 @@ export function isValueType(value) {
export function recordTime(time = new Date(), separator = "-", swf = 'all'){
let year = time.getFullYear();
let month = time.getMonth() + 1;
let day = time.getDate()+1;
let day = time.getDate()+1; // date天数加1
let hour = time.getHours();
let min = time.getMinutes();
let ppn = time.getSeconds();

30
canteen/pages/delivery/apply.vue

@ -51,6 +51,12 @@
},{
label: '规格',
key: 'spec_name'
},{
label: '单位',
key: 'unit'
},{
label: '分类',
key: 'category'
},{
key: 'brand',
label: '品牌'
@ -103,6 +109,8 @@
for(let i in warehouse_list){
warehouse_list[i].delivery_number = {edit: true, value: warehouse_list[i].delivery_number || 1};
warehouse_list[i].operation = {button: true, key: 'delete', value: '删除'};
warehouse_list[i].unit = warehouse_list[i].unit.unit_name;
warehouse_list[i].category = warehouse_list[i].category.m_cate_name;
contents.push(warehouse_list[i]);
}
this.contents = contents;
@ -133,7 +141,9 @@
spec_id: item?.spec?.id || 0,
spec_name: item?.spec?.name || '',
supplier_name: item?.purchase?.supplier?.supplier_name || '',
delivery_number: item.out_number || 1
delivery_number: item.out_number || 1,
unit: item?.material?.unit || {},
category: item?.material?.category || {}
};
})
this.warehouse_list = warehouse_list;
@ -157,10 +167,22 @@
// table
onButtonClick(event){
if(event.content.key == 'delete'){
let material_index = event.contentIndex;
let material_name = event.lineData.material_name;
let spec_name = event.lineData.spec_name;
let order_id = event.lineData.order_id;
let material_index = event.lineData.contentIndex;
this.contents.splice(material_index, 1);
delete this.warehouse_list[order_id];
uni.showModal({
title: '温馨提示',
content: `确定删除 ${material_name}-${spec_name} 吗?`,
cancelColor: '#11D189',
confirmColor: '#FF0000',
success: result => {
if(result.confirm){
this.contents.splice(material_index, 1);
delete this.warehouse_list[order_id];
}
}
})
}
},
//

10
canteen/pages/delivery/detail.vue

@ -57,6 +57,12 @@
},{
label: '规格',
key: 'spec_name'
},{
label: '单位',
key: 'unit'
},{
label: '分类',
key: 'category'
},{
key: 'brand',
label: '品牌'
@ -130,7 +136,9 @@
m_sn: item.material.m_sn,
supplier_name: item.purchase.supplier.supplier_name,
purchase_id: item.purchase_id,
delivery_number: item.out_number
delivery_number: item.out_number,
unit: item?.material?.unit?.unit_name || '',
category: item?.material?.category?.m_cate_name || ''
}
})
this.contents = contents;

18
canteen/pages/purchase/detail.vue

@ -125,6 +125,12 @@
},{
key: 'spec',
label: '规格'
},{
label: '单位',
key: 'unit'
},{
label: '分类',
key: 'category'
},{
key: 'brand',
label: '品牌'
@ -140,9 +146,15 @@
},{
key: 'pre_tax_price',
label: '税前价格'
},{
key: 'total_tax_amount',
label: '含税合计'
},{
key: 'after_tax_price',
label: '税后价格'
},{
key: 'total_non_tax_amount',
label: '不含税合计'
},{
key: 'purchase_limit',
label: '起购数'
@ -285,7 +297,11 @@
pre_tax_price: item.total_tax_amount,
after_tax_price: item.total_non_tax_amount,
purchase_limit: item.p_order_item.purchase_limit,
purchase_number: item.purchase_number
purchase_number: item.purchase_number,
unit: item?.material?.unit?.unit_name || '',
category: item?.material?.category?.m_cate_name || '',
total_tax_amount: item.total_tax_amount,
total_non_tax_amount: item.total_non_tax_amount
}
})
this.contents = contents;

35
canteen/pages/purchase/launch.vue

@ -108,6 +108,12 @@
},{
key: 'spec_name',
label: '规格'
},{
label: '单位',
key: 'unit'
},{
label: '分类',
key: 'category'
},{
key: 'brand',
label: '品牌'
@ -144,6 +150,8 @@
material_list[i].material_list[j].supplier_name = material_list[i].supplier_name;
material_list[i].material_list[j].tax_price = material_list[i].material_list[j].tax_price;
material_list[i].material_list[j].non_tax_price = material_list[i].material_list[j].non_tax_price;
material_list[i].material_list[j].unit = material_list[i].material_list[j].unit.unit_name;
material_list[i].material_list[j].category = material_list[i].material_list[j].category.m_cate_name;
list_arr.push(material_list[i].material_list[j]);
}
material_list[i].material_list = list_arr;
@ -179,7 +187,9 @@
supplier_id: item.id,
supplier_name: item.supplier_name,
tax_price: i_item.tax_price,
purchase_number: i_item.purchase_number
purchase_number: i_item.purchase_number,
unit: i_item?.material?.unit || {},
category: i_item?.material?.category || {}
};
if(i_item?.material?.state && i_item?.material?.state != '启用'){
items_obj[i_item.quotation_item_id].disabled = true;
@ -220,13 +230,24 @@
},
// table
onButtonClick(event){
console.log("event", event);
if(event.content.key == 'delete'){
let supplier_id = event.lineData.supplier_id; // id
let item_id = event.lineData.item_id; // item_id
let material_index = event.lineData.contentIndex; //
this.render_material_list[supplier_id].material_list.splice(material_index, 1);
delete this.material_list[supplier_id].material_list[item_id];
let material_index = event.contentIndex;
let material_name = event.lineData.material_name;
let spec_name = event.lineData.spec_name;
let supplier_id = event.lineData.supplier_id;
let item_id = event.lineData.item_id;
uni.showModal({
title: '温馨提示',
content: `确定删除 ${material_name}-${spec_name} 吗?`,
cancelColor: '#11D189',
confirmColor: '#FF0000',
success: result => {
if(result.confirm){
this.render_material_list[supplier_id].material_list.splice(material_index, 1);
delete this.material_list[supplier_id].material_list[item_id];
}
}
})
}
},
//

10
supplier/pages/gonghuo/detail.vue

@ -147,6 +147,12 @@
},{
key: 'spec',
label: '规格'
},{
label: '单位',
key: 'unit'
},{
label: '分类',
key: 'category'
},{
key: 'brand',
label: '品牌'
@ -242,7 +248,9 @@
tax_price: item.tax_price,
non_tax_price: item.non_tax_price,
purchase_limit: item?.p_order_item?.purchase_limit || '',
purchase_number: item.purchase_number
purchase_number: item.purchase_number,
unit: item?.material?.unit?.unit_name || '',
category: item?.material?.category?.m_cate_name || ''
}
return obj;
});

29
supplier/pages/offer/index.vue

@ -60,6 +60,12 @@
},{
label: '规格',
key: 'spec'
},{
label: '单位',
key: 'unit'
},{
label: '分类',
key: 'category'
},{
label: '品牌',
key: 'brand'
@ -154,7 +160,9 @@
purchase_limit: {edit: true, value: 1},
tax_price: {edit: true, value: ''},
non_tax_price: {edit: true, value: ''},
operation: {button: true, key: 'delete', value: '删除'}
operation: {button: true, key: 'delete', value: '删除'},
unit: item?.material?.unit?.unit_name || '',
category: item?.material?.category?.m_cate_name || ''
}
})
this.contents = contents;
@ -182,7 +190,9 @@
tax_price: {edit: true, value: item?.quotation?.tax_price || ''},
non_tax_price: {edit: true, value: item?.quotation?.non_tax_price || ''},
quotation_id: item?.quotation?.id || 0,
operation: {button: true, key: 'delete', value: '删除'}
operation: {button: true, key: 'delete', value: '删除'},
unit: item?.material?.unit?.unit_name || '',
category: item?.material?.category?.m_cate_name || ''
}
if(item?.material?.state && item?.material?.state != '启用'){
obj.disabled = true;
@ -241,8 +251,19 @@
// table
onButtonClick(event){
if(event.content.key == 'delete'){
let contentIndex = event.lineData.contentIndex;
this.contents.splice(contentIndex, 1);
let contentIndex = event.contentIndex;
let name = event.lineData.name;
let spec = event.lineData.spec;
uni.showModal({
title: '温馨提示',
content: `确定删除 ${name}-${spec} 吗?`,
confirmColor: '#1833F2',
success: result => {
if(result.confirm){
this.contents.splice(contentIndex, 1);
}
}
})
}
},
// modal

10
supplier/pages/order/detail.vue

@ -65,6 +65,12 @@
},{
label: '规格',
key: 'spec'
},{
label: '单位',
key: 'unit'
},{
label: '分类',
key: 'category'
},{
label: '品牌',
key: 'brand'
@ -142,7 +148,9 @@
number: item?.material?.m_sn || '',
tax_price: item.tax_price,
non_tax_price: item.non_tax_price,
purchase_limit: item.purchase_limit
purchase_limit: item.purchase_limit,
unit: item?.material?.unit?.unit_name || '',
category: item?.material?.category?.m_cate_name || ''
}
return obj;
});

Loading…
Cancel
Save