Browse Source

发起报价和发起采购增加校验物资失效的情况,禁用table(只有点击按钮可用)

master
邓平艺 5 years ago
parent
commit
efd8312d87
  1. 5
      canteen/components/wyb-table/wyb-table.vue
  2. 3
      canteen/pages/purchase/launch.vue
  3. 5
      supplier/components/wyb-table/wyb-table.vue
  4. 23
      supplier/pages/offer/index.vue

5
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'}">
<input class="lf-w-100" :disabled="false" placeholder="请输入.."
<input class="lf-w-100" placeholder="请输入.."
:disabled="content.disabled || false"
v-if="isObject(autoContentItem(cIndex, hIndex), 'edit')"
:style="{minHeight: (minHeight[1] || minHeight[0]) + 'rpx'}"
placeholder-style="30rpx"

3
canteen/pages/purchase/launch.vue

@ -181,6 +181,9 @@
tax_price: i_item.tax_price,
purchase_number: i_item.purchase_number
};
if(i_item?.material?.state && i_item?.material?.state != '启用'){
items_obj[i_item.quotation_item_id].disabled = true;
}
});
item.material_list = items_obj;
material_list[item.id] = item;

5
supplier/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'}">
<input class="lf-w-100" :disabled="false" placeholder="请输入.."
<input class="lf-w-100" placeholder="请输入.."
:disabled="content.disabled || false"
v-if="isObject(autoContentItem(cIndex, hIndex), 'edit')"
:style="{minHeight: (minHeight[1] || minHeight[0]) + 'rpx'}"
placeholder-style="30rpx"

23
supplier/pages/offer/index.vue

@ -32,6 +32,7 @@
:headers="headers"
:contents="contents"
@onInputChange="onInputChange"
@onButtonClick="onButtonClick"
width="100%" height="80vh"></wyb-table>
</view>
<view style="height: 140rpx;"></view>
@ -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('编辑不可更换关联食堂哦');

Loading…
Cancel
Save