From efd8312d8708aeab472b0a38fd7006ec8400d1aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=82=93=E5=B9=B3=E8=89=BA?= <52643018@qq.com>
Date: Tue, 3 Aug 2021 18:50:28 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E8=B5=B7=E6=8A=A5=E4=BB=B7=E5=92=8C?=
=?UTF-8?q?=E5=8F=91=E8=B5=B7=E9=87=87=E8=B4=AD=E5=A2=9E=E5=8A=A0=E6=A0=A1?=
=?UTF-8?q?=E9=AA=8C=E7=89=A9=E8=B5=84=E5=A4=B1=E6=95=88=E7=9A=84=E6=83=85?=
=?UTF-8?q?=E5=86=B5=EF=BC=8C=E7=A6=81=E7=94=A8table(=E5=8F=AA=E6=9C=89?=
=?UTF-8?q?=E7=82=B9=E5=87=BB=E6=8C=89=E9=92=AE=E5=8F=AF=E7=94=A8)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
canteen/components/wyb-table/wyb-table.vue | 5 +++--
canteen/pages/purchase/launch.vue | 3 +++
supplier/components/wyb-table/wyb-table.vue | 5 +++--
supplier/pages/offer/index.vue | 23 ++++++++++++++++++---
4 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/canteen/components/wyb-table/wyb-table.vue b/canteen/components/wyb-table/wyb-table.vue
index 71dbd72..1b421ca 100644
--- a/canteen/components/wyb-table/wyb-table.vue
+++ b/canteen/components/wyb-table/wyb-table.vue
@@ -140,14 +140,15 @@
fontSize: (fontSize[1] || fontSize[0]) + 'rpx',
textDecoration: autoTextDecoration(cIndex, hIndex),
color: autoContentColor(cIndex, hIndex),
- backgroundColor: autoContentBgColor(cIndex, hIndex),
+ backgroundColor: content.disabled ? '#ecf0f1' : autoContentBgColor(cIndex, hIndex),
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
borderBottom: cIndex === contents.length - 1 ? '1px solid' + borderColor : 'none',
borderRight: hIndex === headers.length - 1 || (!showVertBorder && hIndex !== 0) ? 'none' : '1px solid' + borderColor,
zIndex: hIndex === 0 ? 20 : 0,
left: enableCheck ? checkColWidth + 'rpx' : 0,
position: hIndex === 0 && firstLineFixed ? 'sticky' : 'static'}">
-
-
@@ -77,6 +78,9 @@
},{
label: '非含税价',
key: 'non_tax_price'
+ },{
+ label: '操作',
+ key: 'operation'
}],
contents: [],
is_show: false,
@@ -149,7 +153,8 @@
number: item?.material?.m_sn || '',
purchase_limit: {edit: true, value: 1},
tax_price: {edit: true, value: ''},
- non_tax_price: {edit: true, value: ''}
+ non_tax_price: {edit: true, value: ''},
+ operation: {button: true, key: 'delete', value: '删除'}
}
})
this.contents = contents;
@@ -165,7 +170,7 @@
let list = res.data.order || [];
let canteen = res.data.canteen || [];
let contents = list.map(item => {
- return {
+ let obj = {
name: item?.material?.m_name || '',
material_id: item?.material?.id || 0,
spec: item.name,
@@ -176,8 +181,13 @@
purchase_limit: {edit: true, value: item?.quotation?.purchase_limit || ''},
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
+ quotation_id: item?.quotation?.id || 0,
+ operation: {button: true, key: 'delete', value: '删除'}
+ }
+ if(item?.material?.state && item?.material?.state != '启用'){
+ obj.disabled = true;
}
+ return obj;
})
this.contents = contents;
this.getCanteenList(canteen);
@@ -228,6 +238,13 @@
onInputChange(event){
this.contents[event.contentIndex][event.key].value = event.detailValue;
},
+ // table操作按钮被点击
+ onButtonClick(event){
+ if(event.content.key == 'delete'){
+ let contentIndex = event.lineData.contentIndex;
+ this.contents.splice(contentIndex, 1);
+ }
+ },
// 切换显示关联食堂modal
switchRelation(){
if(this.type == 1) return this.$msg('编辑不可更换关联食堂哦');