|
@@ -77,7 +77,7 @@
|
|
|
<el-table-column prop="currentSpecification" label="规格" header-align="center" align="center">
|
|
|
<template v-slot:default="scope">
|
|
|
<!-- 如果当前行正在编辑,则显示输入框 -->
|
|
|
- <el-input v-if="scope.row.isEditing" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
|
|
|
+ <el-input v-if="scope.row.isEditing" disabled="disabled" v-model="scope.row.currentSpecification" placeholder="请输入规格" @blur.stop.prevent="handleInputBlur(scope.row)">></el-input>
|
|
|
<!-- 否则显示普通文本 -->
|
|
|
<span v-else>{{ scope.row.currentSpecification }}</span>
|
|
|
</template>
|
|
@@ -206,19 +206,19 @@
|
|
|
<el-table-column prop="planStatus" label="计划状态" header-align="center" align="center" width="100px">
|
|
|
<template v-slot:default="scope">
|
|
|
<!--上机变停机待机-->
|
|
|
- <el-select v-if="scope.row.planStatus==1" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
|
|
|
+ <el-select v-if="scope.row.planStatus==1" v-model="scope.row.planStatus" placeholder="计划状态">
|
|
|
<el-option v-for="stateItem in stateList1" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
|
|
|
</el-select>
|
|
|
<!--待机可以上机-->
|
|
|
- <el-select v-if="scope.row.planStatus==0" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
|
|
|
+ <el-select v-if="scope.row.planStatus==0" v-model="scope.row.planStatus" placeholder="计划状态">
|
|
|
<el-option v-for="stateItem in stateList0" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
|
|
|
</el-select>
|
|
|
<!--停机变上机-->
|
|
|
- <el-select v-if="scope.row.planStatus==2" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
|
|
|
+ <el-select v-if="scope.row.planStatus==2" v-model="scope.row.planStatus" placeholder="计划状态">
|
|
|
<el-option v-for="stateItem in stateList2" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
|
|
|
</el-select>
|
|
|
<!--已完成-->
|
|
|
- <el-select v-if="scope.row.planStatus==3" v-model="scope.row.planStatus" placeholder="计划状态" @change="selectedSalesmanItem(scope.row,scope.row.planStatus)">
|
|
|
+ <el-select v-if="scope.row.planStatus==3" v-model="scope.row.planStatus" placeholder="计划状态">
|
|
|
<el-option v-for="stateItem in stateList3" :key="stateItem.id" :label="stateItem.name" :value="stateItem.id" ></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
@@ -307,7 +307,7 @@ export default {
|
|
|
//业务员信息
|
|
|
// this.getSalesman();
|
|
|
//得到排产产品信息
|
|
|
- this.getProductsInfo();
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
//五个显示为一排
|
|
@@ -346,6 +346,7 @@ export default {
|
|
|
getProductsInfo() {
|
|
|
getProductsInfo().then((response) => {
|
|
|
this.productsInfo = response.data;
|
|
|
+ console.log(this.productsInfo,"产品信息")
|
|
|
this.productsInfo.forEach(item => {
|
|
|
item.productName = item.productName+"—"+item.materieEncoding+item.materieColorNumber
|
|
|
});
|
|
@@ -365,18 +366,19 @@ export default {
|
|
|
getMaterielInfo(queryParams).then((response) => {
|
|
|
if (response.data!=null) {
|
|
|
this.materiel = response.data;
|
|
|
+ console.log(response.data,"规格")
|
|
|
//色号 母粒编码+色号
|
|
|
row.currentColorCode = this.materiel.materieEncoding+"("+this.materiel.materieColorNumber+")";
|
|
|
- row.sh=this.materiel.materieColorNumber;
|
|
|
- //批次
|
|
|
}
|
|
|
});
|
|
|
- console.log(this.product.salesmanId)
|
|
|
- //批号信息
|
|
|
+ //产品规格
|
|
|
+ row.currentSpecification= this.product.productSpecifications;
|
|
|
+ //合同号--销售单编号(以前打算存的是业务员信息后来存的是销售单编号)
|
|
|
row.salesmanId=this.product.saleOrderNo;
|
|
|
},
|
|
|
// 新增计划产品信息
|
|
|
handleAddPlan(row) {
|
|
|
+ this.getProductsInfo();
|
|
|
this.nanInsertDialogTableVisible = true
|
|
|
this.tableData2=[]
|
|
|
//先清空
|
|
@@ -440,6 +442,7 @@ export default {
|
|
|
},
|
|
|
// 新增一行标记为可编辑
|
|
|
addEditableRow() {
|
|
|
+ this.getProductsInfo();
|
|
|
// 检查当前编辑行是否已填写完毕
|
|
|
if(this.tableData2.length!=0){
|
|
|
if (this.editingRowIndex !== -1 && !this.isRowFilled(this.tableData2[this.editingRowIndex])) {
|
|
@@ -514,6 +517,7 @@ export default {
|
|
|
},
|
|
|
// 修改产品计划
|
|
|
handleEditPlan(row) {
|
|
|
+ this.getProductsInfo();
|
|
|
//当前操作机台号
|
|
|
this.machineId=row.machineId;
|
|
|
this.tableData2=[];
|
|
@@ -529,22 +533,22 @@ export default {
|
|
|
this.tableData2=response.data;
|
|
|
console.log( this.tableData2)
|
|
|
// 在数据加载完成后,手动触发每个行的第一个下拉框的 change 事件
|
|
|
- this.$nextTick(() => {
|
|
|
- // 获取第一个业务员选择框(假设表格只有一行)
|
|
|
- this.tableDataStatus=[];
|
|
|
- for (let i = 0; i < this.tableData2.length; i++) {
|
|
|
- const firstSalesmanSelect = this.$refs['salesmanSelect'+i];
|
|
|
- this.tableDataStatus.push({"index":i,"planStatus":this.tableData2[i].planStatus})
|
|
|
- // console.log(firstSalesmanSelect,11111111)
|
|
|
- // 触发 change 事件
|
|
|
- if (firstSalesmanSelect) {
|
|
|
- firstSalesmanSelect.$emit('change', {
|
|
|
- target: {value: "ddd"},
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // // 获取第一个业务员选择框(假设表格只有一行)
|
|
|
+ // this.tableDataStatus=[];
|
|
|
+ // for (let i = 0; i < this.tableData2.length; i++) {
|
|
|
+ // const firstSalesmanSelect = this.$refs['salesmanSelect'+i];
|
|
|
+ // this.tableDataStatus.push({"index":i,"planStatus":this.tableData2[i].planStatus})
|
|
|
+ // // console.log(firstSalesmanSelect,11111111)
|
|
|
+ // // 触发 change 事件
|
|
|
+ // if (firstSalesmanSelect) {
|
|
|
+ // firstSalesmanSelect.$emit('change', {
|
|
|
+ // target: {value: "ddd"},
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // });
|
|
|
})
|
|
|
},
|
|
|
//弹窗里边的点击查询
|
|
@@ -572,15 +576,6 @@ export default {
|
|
|
},
|
|
|
//更新状态
|
|
|
updateStatus(ind, row,planStatus){
|
|
|
- const a=planStatus;
|
|
|
- console.log( row.planStatus,this.tableDataStatus[ind].planStatus)
|
|
|
- if(planStatus==this.tableDataStatus[ind].planStatus){
|
|
|
- this.$message({
|
|
|
- message: '并未更改状态,不会发送请求',
|
|
|
- type: 'warning'
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
//先查询计划表中有没有正在上机的
|
|
|
getPlanSpinningInfo({"machineId":this.machineId,"planStatus":planStatus}).then(response => {
|
|
|
let i=0
|
|
@@ -606,10 +601,6 @@ export default {
|
|
|
type: 'success'
|
|
|
});
|
|
|
this.getSpinningPlanList();
|
|
|
- this.tableDataStatus=[]
|
|
|
- for (let i = 0; i < this.tableData2.length; i++) {
|
|
|
- this.tableDataStatus.push({"index": i, "planStatus": this.tableData2[i].planStatus})
|
|
|
- }
|
|
|
//最后把弹窗关掉
|
|
|
this.nanInsertDialogTableVisible=false
|
|
|
} else {
|