This commit is contained in:
xd 2024-02-24 09:59:48 +08:00
parent db5fc97c64
commit df9601da10
2 changed files with 4 additions and 124 deletions

View File

@ -704,7 +704,7 @@
this.$set(this.materialData, this.clickedRowIndex, updatedRow);
}
this.dialogInventoryVisible = false; // 打开选择盘具的 dialog
// 其他逻辑...23123123
// 其他逻辑...
},
},

View File

@ -183,33 +183,17 @@
</template>
</el-table-column>
<el-table-column
<<<<<<< HEAD
width="180"
=======
width="120"
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
prop="voltage"
label="电压">
</el-table-column>
<el-table-column
<<<<<<< HEAD
width="180"
=======
width="80"
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
prop="standard"
label="标准">
</el-table-column>
<el-table-column
width="180"
<<<<<<< HEAD
prop="core"
label="线芯">
</el-table-column>
<el-table-column
width="180"
=======
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
prop="costPrice"
label="成本价">
</el-table-column>
@ -221,21 +205,6 @@
<el-table-column
width="180"
prop="netVolume"
<<<<<<< HEAD
label="净量">
</el-table-column>
<el-table-column
width="180"
prop="inventory"
label="盘具">
<template slot-scope="scope">
<el-input v-model="scope.row.inventory" >
</el-input>
</template>
</el-table-column>
<el-table-column
width="180"
=======
label="净重量">
</el-table-column>
<el-table-column
@ -257,7 +226,6 @@
</el-table-column>
<el-table-column
width="100"
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
prop="weighInv"
label="盘重">
</el-table-column>
@ -296,11 +264,7 @@
</div>
</div>
<el-dialog class="regionDialogTable" :visible.sync="dialogRegionVisible" width="932px" >
<<<<<<< HEAD
<div slot="title" class="regionTable-title" style="margin: 0px">
=======
<div slot="title" style="margin: 0px">
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
<el-form>
<el-form-item >
<el-input style="width: 300px; " v-model="regionName" placeholder="请输入地区名称">
@ -374,25 +338,16 @@
</el-form>
</div>
<div style="display: flex; flex-direction: row;">
<<<<<<< HEAD
<div style="width: 866px">
<el-table
:data="materialTableData"
=======
<div style="width: 766px">
<el-table
:data="getCurrentMaterialData"
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
ref="materialTable"
@selection-change="handleSelectionChange"
:header-cell-style="{ background: '#eef1f6', color: '#606266', 'text-align': 'center', 'padding': '0px'}"
:cell-style="{'text-align': 'center', 'padding': '5px 0px'}"
highlight-selection-row
<<<<<<< HEAD
=======
:row-key="row => row.materialName"
:reserve-selection="true"
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
border>
<el-table-column
type="selection"
@ -428,14 +383,6 @@
prop="standard"
label="标准">
</el-table-column>
<<<<<<< HEAD
<el-table-column
width="100"
prop="core"
label="线芯">
</el-table-column>
</el-table>
=======
</el-table>
<div style="text-align: center; margin-top: 10px;">
<el-pagination
@ -445,7 +392,6 @@
:total="materialTableData.length"
></el-pagination>
</div>
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
</div>
<div style="flex-grow: 1; padding-left: 20px;">
<div
@ -458,17 +404,12 @@
</div>
</div>
</div>
<<<<<<< HEAD
=======
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
<div style="text-align: center; padding-top: 20px">
<el-button-group>
<el-button type="primary" size="small" style="margin-right: 80px" @click="addMaterialToTable">确认</el-button>
<el-button type="warning" size="small" @click="closeMaterialDialog">取消</el-button>
</el-button-group>
<<<<<<< HEAD
=======
</div>
</el-dialog>
<el-dialog class="inventoryDialogTable" :visible.sync="dialogInventoryVisible" width="792px" >
@ -507,7 +448,6 @@
</template>
</el-table-column>
</el-table>
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
</div>
<div style="text-align: center; margin-top: 10px;">
<el-pagination
@ -556,24 +496,8 @@
},
materialData: [
<<<<<<< HEAD
],
regionTableData: [
{
province: '浙江',
city: '杭州',
district: '西湖区',
kilometers: 10
},
{
province: '上海',
city: '上海',
district: '黄浦区',
kilometers: 20
},
=======
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
],
regionTableData: [],
price_0t_5t: '',
price_5t_10t: '',
price_10t_25t: '',
@ -586,28 +510,6 @@
materialCurrentPage: 1,
pageSize: 10,
dialogMaterialVisible: false,
<<<<<<< HEAD
materialTableData: [
{
materialName: 'Material 1',
model: 'Model A',
district: 'Spec 1',
voltage: '220V',
standard: 'Standard 1',
core: 'Core X'
},
{
materialName: 'Material 2',
model: 'Model B',
district: 'Spec 2',
voltage: '110V',
standard: 'Standard 2',
core: 'Core Y'
},
// Add more data as needed
],
selectedMaterialItems: [], // 选中的数据
=======
materialTableData: [],
selectedMaterialItems: [], // 选中的数据
savedSelectedMaterials: [], // 保存选中的数据
@ -617,7 +519,6 @@
dialogInventoryVisible: false,
inventoryTableData: [],
clickedRowIndex: null, // 用于记录点击的行的索引
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
}
},
computed: {
@ -715,14 +616,6 @@
this.dialogMaterialVisible = true;
},
handleSelectionChange(selection) {
<<<<<<< HEAD
// 当选择发生变化时更新选中数据
this.selectedMaterialItems = selection;
},
removeSelectedItem(selectedItem) {
// 移除选中的记录
const index = this.selectedMaterialItems.indexOf(selectedItem);
=======
selection.forEach(item => {
// 判断是否已经存在于已选列表中,避免重复添加
if (!this.selectedMaterialItems.some(selectedItem => selectedItem.materialName === item.materialName)) {
@ -737,24 +630,15 @@
// 从已选列表中移除该项
const index = this.selectedMaterialItems.findIndex(item => item.materialName === selectedItem.materialName);
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
if (index !== -1) {
this.selectedMaterialItems.splice(index, 1);
}
<<<<<<< HEAD
// 同步取消左侧表格中对应项的选择
const tableIndex = this.materialTableData.indexOf(selectedItem);
if (tableIndex !== -1) {
this.$refs.materialTable.toggleRowSelection(this.materialTableData[tableIndex]);
}
=======
// 如果当前数据被选择,则取消 el-table 中该项的选择状态
if (isSelected) {
this.$refs.materialTable.toggleRowSelection(selectedItem, false);
}
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
},
addMaterialToTable() {
@ -770,9 +654,6 @@
closeMaterialDialog() {
this.dialogMaterialVisible = false;
<<<<<<< HEAD
}
=======
},
searchMaterial() {
@ -823,12 +704,11 @@
this.$set(this.materialData, this.clickedRowIndex, updatedRow);
}
this.dialogInventoryVisible = false; // 打开选择盘具的 dialog
// 其他逻辑...
// 其他逻辑...23123123
},
>>>>>>> b1df0122aa39f2820f3b77c6d2aafe960d76c135
},
})
</script>
</body>
</html>
</html>