|
@@ -6,11 +6,10 @@
|
|
|
<el-table
|
|
|
:data="tableData"
|
|
|
ref="tableRef"
|
|
|
- :span-method="objectSpanMethod"
|
|
|
- border style="margin-bottom: 10px" >
|
|
|
- <el-table-column prop="machineId" fixed label="机台号" header-align="center" align="center" min-width="110.5"></el-table-column>
|
|
|
+ :span-method="objectSpanMethod">
|
|
|
+ <el-table-column prop="machineId" fixed label="机台号" header-align="center" align="center" ></el-table-column>
|
|
|
+ <el-table-column prop="productType" fixed label="产品类别" header-align="center" align="center"></el-table-column>
|
|
|
<el-table-column label="在机产品" header-align="center">
|
|
|
- <el-table-column prop="productType" label="产品类别" header-align="center" align="center" min-width="110.5"></el-table-column>
|
|
|
<el-table-column prop="currentColorCode" label="色号" header-align="center" align="center"></el-table-column>
|
|
|
<el-table-column prop="currentSpecification" label="规格" header-align="center" align="center"></el-table-column>
|
|
|
<el-table-column prop="currentLotNumber" label="批号" header-align="center" align="center"></el-table-column>
|
|
@@ -24,21 +23,21 @@
|
|
|
<el-table-column prop="djNumber" label="数量" header-align="center" align="center"></el-table-column>
|
|
|
<el-table-column prop="djCurrentLotNumber" label="原丝批号" header-align="center" align="center"></el-table-column>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="listOfPendingProduction" label="待生产产品列表" header-align="center" align="center" min-width="300"></el-table-column>
|
|
|
- <el-table-column fixed="right" label="操作" header-align="center" align="center" min-width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-dropdown>
|
|
|
- <el-button type="primary">
|
|
|
- 操作
|
|
|
- <i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
- </el-button>
|
|
|
- <el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item @click.native.prevent="handleAddPlan(scope.row)">新增计划</el-dropdown-item>
|
|
|
- <el-dropdown-item @click.native.prevent="handleEditPlan(scope.row)">修改计划</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </el-dropdown>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="listOfPendingProduction" label="待生产产品列表" header-align="center" align="center" min-width="250"></el-table-column>
|
|
|
+<!-- <el-table-column fixed="right" label="操作" header-align="center" align="center" min-width="120">-->
|
|
|
+<!-- <template slot-scope="scope">-->
|
|
|
+<!-- <el-dropdown>-->
|
|
|
+<!-- <el-button type="primary">-->
|
|
|
+<!-- 操作-->
|
|
|
+<!-- <i class="el-icon-arrow-down el-icon--right"></i>-->
|
|
|
+<!-- </el-button>-->
|
|
|
+<!-- <el-dropdown-menu slot="dropdown">-->
|
|
|
+<!-- <el-dropdown-item @click.native.prevent="handleAddPlan(scope.row)">新增计划</el-dropdown-item>-->
|
|
|
+<!-- <el-dropdown-item @click.native.prevent="handleEditPlan(scope.row)">修改计划</el-dropdown-item>-->
|
|
|
+<!-- </el-dropdown-menu>-->
|
|
|
+<!-- </el-dropdown>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- </el-table-column>-->
|
|
|
</el-table>
|
|
|
<!--弹窗-->
|
|
|
|
|
@@ -145,6 +144,7 @@ export default {
|
|
|
},
|
|
|
previousMachineId: undefined,
|
|
|
currentRowspan: 1,
|
|
|
+ prevRow: {},
|
|
|
tableData2: [{
|
|
|
currentColorCode: '001浅绿',
|
|
|
currentSpecification: '15/36',
|
|
@@ -179,70 +179,52 @@ export default {
|
|
|
getAmmunitionPlanInfo() {
|
|
|
ammunitionPlanInfo(this.queryParams).then((response) => {
|
|
|
this.tableData = response.data
|
|
|
- console.log(response.data)
|
|
|
+ // console.log(response.data)
|
|
|
});
|
|
|
},
|
|
|
+ //合并单元格
|
|
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
|
- // if (columnIndex === 0) {
|
|
|
+ // // 初始化 previousMachineId 和 currentRowspan,确保首次执行时能正确赋值
|
|
|
+ // if (rowIndex === 0) {
|
|
|
+ // this.previousMachineId = row.machineId;
|
|
|
+ // this.currentRowspan = 1;
|
|
|
+ // return { rowspan: this.currentRowspan, colspan: 1 };
|
|
|
+ // }
|
|
|
//
|
|
|
- // if (rowIndex % 2 === 0) {
|
|
|
- // return {
|
|
|
- // rowspan: 2,
|
|
|
- // colspan: 1
|
|
|
- // };
|
|
|
+ // // 第0列并且上一行的 machineId 存在
|
|
|
+ // if (columnIndex === 0 && this.previousMachineId != undefined) {
|
|
|
+ // if (row.machineId === this.previousMachineId) {
|
|
|
+ // this.currentRowspan++;
|
|
|
+ // return { rowspan: this.currentRowspan, colspan: 1 };
|
|
|
// } else {
|
|
|
- // return {
|
|
|
- // rowspan: 0,
|
|
|
- // colspan: 0
|
|
|
- // };
|
|
|
+ // // 当 machineId 不同时,更新 previousMachineId 和重置 currentRowspan
|
|
|
+ // this.previousMachineId = row.machineId;
|
|
|
+ // this.currentRowspan = 1;
|
|
|
+ // return { rowspan: this.currentRowspan, colspan: 1 };
|
|
|
// }
|
|
|
// }
|
|
|
- if (columnIndex === 0 && this.previousMachineId !== undefined) {
|
|
|
- // 比较当前行的machineId是否与上一行相同
|
|
|
- if (row.machineId === this.previousMachineId) {
|
|
|
- // 内容相同,跨行
|
|
|
- this.currentRowspan++;
|
|
|
- return {
|
|
|
- rowspan: this.currentRowspan,
|
|
|
- colspan: 1
|
|
|
- };
|
|
|
- } else {
|
|
|
- // 内容不同,重置跨行计数
|
|
|
- this.currentRowspan = 1;
|
|
|
- this.previousMachineId = row.machineId;
|
|
|
- return {
|
|
|
- rowspan: 1,
|
|
|
- colspan: 1
|
|
|
- };
|
|
|
- }
|
|
|
- } else {
|
|
|
- // 非第一列或者第一次渲染,初始化状态
|
|
|
- this.previousMachineId = row.machineId;
|
|
|
- this.currentRowspan = 1;
|
|
|
- return {
|
|
|
- rowspan: 1,
|
|
|
- colspan: 1
|
|
|
- };
|
|
|
- }
|
|
|
+ //
|
|
|
+ // // 如果 columnIndex 不为 0,理论上不应该走到这里,因为只在第一列进行比较和合并
|
|
|
+ // // 但为了确保代码完整性,仍保留之前的返回逻辑
|
|
|
+ // return {
|
|
|
+ // rowspan: this.currentRowspan,
|
|
|
+ // colspan: 1
|
|
|
+ // };
|
|
|
},
|
|
|
//待投产的产品数据
|
|
|
getProductsInfo() {
|
|
|
getProductsInfo().then((response) => {
|
|
|
this.productsInfo = response.data;
|
|
|
this.productsInfo.forEach(item => {
|
|
|
- // item.lotNumber == null ? item.lotNumber = "24-1" : item.lotNumber;
|
|
|
item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
|
|
|
});
|
|
|
- console.log(this.productsInfo)
|
|
|
})
|
|
|
},
|
|
|
//下拉框数据改变查询色号批号信息
|
|
|
selectedChangeDate(row,selectedProduct) {
|
|
|
//选择的那个销售产品
|
|
|
- // console.log(row,selectedProduct)
|
|
|
this.product = this.productsInfo.find(product => product.id === selectedProduct);
|
|
|
this.form.product=selectedProduct;
|
|
|
- // console.log(this.product)
|
|
|
//通过母粒编码查询到对应的母粒信息
|
|
|
let queryParams = {
|
|
|
"materielCode": this.product.colourNumber
|
|
@@ -251,7 +233,6 @@ export default {
|
|
|
getMaterielInfo(queryParams).then((response) => {
|
|
|
if (response.data!=null) {
|
|
|
this.materiel = response.data;
|
|
|
- console.log(this.materiel.materieEncoding)
|
|
|
//色号
|
|
|
row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
|
|
|
//批次
|
|
@@ -373,7 +354,10 @@ export default {
|
|
|
this.editingRowIndex = this.tableData2.length - 1; // 更新当前编辑的行索引
|
|
|
this.lastEditLine = this.tableData2.length - 1
|
|
|
},
|
|
|
- }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|