Browse Source

BOM复制后,临时表tree结构问题

java8
han\hanst 2 months ago
parent
commit
9bf3e98f02
  1. 62
      src/views/modules/part/bom_create.vue

62
src/views/modules/part/bom_create.vue

@ -549,11 +549,12 @@
<div class="rq "> <div class="rq ">
<el-table <el-table
:data="subDetailList" :data="subDetailList"
height="256px"
height="286px"
border border
style="width:100%"> style="width:100%">
<!-- 第一部分到物料单位为止 -->
<el-table-column <el-table-column
v-for="(item,index) in filteredBatchUpdateComponentsColumn" :key="index"
v-for="(item,index) in filteredBatchUpdateComponentsColumnPart1" :key="'part1-'+index"
:sortable="item.columnSortable" :sortable="item.columnSortable"
:prop="item.columnProp" :prop="item.columnProp"
:header-align="item.headerAlign" :header-align="item.headerAlign"
@ -567,7 +568,40 @@
<span v-if="item.columnProp==='familyName'"> <span v-if="item.columnProp==='familyName'">
<el-input v-model="scope.row.familyName" readonly @click.native="handleFamilySelect(scope.row, scope.$index)" style="width: 100%"></el-input> <el-input v-model="scope.row.familyName" readonly @click.native="handleFamilySelect(scope.row, scope.$index)" style="width: 100%"></el-input>
</span> </span>
<span v-else-if="item.columnProp==='productionData'">
<span v-else>
{{scope.row[item.columnProp]}}
</span>
</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<!-- 单位用量调机量损耗率 -->
<el-table-column
prop=""
header-align="center"
align="right"
min-width="80"
label="单位用量">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`qtyPerAssembly${scope.$index}`" v-model="scope.row.qtyPerAssembly" @keyup.enter.native="focusNextInput(scope.$index, 'qtyPerAssembly')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<!-- 第二部分从实际生产数量开始 -->
<el-table-column
v-for="(item,index) in filteredBatchUpdateComponentsColumnPart2" :key="'part2-'+index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed == ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">
<span v-if="item.columnProp==='productionData'">
<el-input-number :controls="false" :step="0" min="0" <el-input-number :controls="false" :step="0" min="0"
:disabled="!productionDataFamily.includes(scope.row.familyID)" :disabled="!productionDataFamily.includes(scope.row.familyID)"
v-model="scope.row.productionData" v-model="scope.row.productionData"
@ -636,16 +670,6 @@
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
prop=""
header-align="center"
align="right"
min-width="80"
label="单位用量">
<template slot-scope="scope">
<el-input-number :controls="false" :step="0" :ref="`qtyPerAssembly${scope.$index}`" v-model="scope.row.qtyPerAssembly" @keyup.enter.native="focusNextInput(scope.$index, 'qtyPerAssembly')" style="height: 11px; width: 98%"></el-input-number>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="" prop=""
header-align="center" header-align="center"
@ -955,6 +979,18 @@ export default {
if (item.columnProp === 'unitConversion') return this.unitConversionFlag; if (item.columnProp === 'unitConversion') return this.unitConversionFlag;
return true; return true;
}); });
},
// -
filteredBatchUpdateComponentsColumnPart1() {
const filtered = this.filteredBatchUpdateComponentsColumn;
const splitIndex = filtered.findIndex(item => item.columnProp === 'printUnitName');
return splitIndex >= 0 ? filtered.slice(0, splitIndex + 1) : filtered;
},
// -
filteredBatchUpdateComponentsColumnPart2() {
const filtered = this.filteredBatchUpdateComponentsColumn;
const splitIndex = filtered.findIndex(item => item.columnProp === 'printUnitName');
return splitIndex >= 0 ? filtered.slice(splitIndex + 1) : [];
} }
}, },
data() { data() {

Loading…
Cancel
Save