|
@@ -251,13 +251,17 @@
|
|
|
@input="(e) => handleWeightInput(e, row, item)"
|
|
@input="(e) => handleWeightInput(e, row, item)"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-slot:classes>
|
|
|
|
|
- <el-select v-model="row.classes" clearable placeholder="请选择">
|
|
|
|
|
|
|
+ <template v-slot:teamTimeDetailId="{ row }">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="row.teamTimeDetailId"
|
|
|
|
|
+ placeholder="班次"
|
|
|
|
|
+ @change="(e) => shiftSelection(e, row)"
|
|
|
|
|
+ >
|
|
|
<el-option
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
|
|
+ v-for="item in shiftList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.id"
|
|
|
>
|
|
>
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
@@ -338,7 +342,8 @@
|
|
|
listAssign,
|
|
listAssign,
|
|
|
checkAssignConfirm,
|
|
checkAssignConfirm,
|
|
|
resetAssignee,
|
|
resetAssignee,
|
|
|
- listByRoutingIds
|
|
|
|
|
|
|
+ listByRoutingIds,
|
|
|
|
|
+ listByFactoryId
|
|
|
} from '@/api/mainData/index.js';
|
|
} from '@/api/mainData/index.js';
|
|
|
import { releaseWorkOrder } from '@/api/workOrder/index.js';
|
|
import { releaseWorkOrder } from '@/api/workOrder/index.js';
|
|
|
export default {
|
|
export default {
|
|
@@ -393,28 +398,8 @@
|
|
|
{ label: '计划开始时间:', prop: 'planStartTime' },
|
|
{ label: '计划开始时间:', prop: 'planStartTime' },
|
|
|
{ label: '计划结束时间:', prop: 'planCompleteTime' }
|
|
{ label: '计划结束时间:', prop: 'planCompleteTime' }
|
|
|
],
|
|
],
|
|
|
- options: [
|
|
|
|
|
- {
|
|
|
|
|
- value: '选项1',
|
|
|
|
|
- label: '黄金糕'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: '选项2',
|
|
|
|
|
- label: '双皮奶'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: '选项3',
|
|
|
|
|
- label: '蚵仔煎'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: '选项4',
|
|
|
|
|
- label: '龙须面'
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: '选项5',
|
|
|
|
|
- label: '北京烤鸭'
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ shiftList: [],
|
|
|
|
|
+ dateValue: ''
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -501,34 +486,6 @@
|
|
|
return row.status.desc || '';
|
|
return row.status.desc || '';
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // {
|
|
|
|
|
- // prop: 'name',
|
|
|
|
|
- // label: '名称',
|
|
|
|
|
- // align: 'center',
|
|
|
|
|
- // showOverflowTooltip: true,
|
|
|
|
|
- // width: 180
|
|
|
|
|
- // },
|
|
|
|
|
- // {
|
|
|
|
|
- // prop: 'model',
|
|
|
|
|
- // label: '型号',
|
|
|
|
|
- // align: 'center',
|
|
|
|
|
- // showOverflowTooltip: true,
|
|
|
|
|
- // width: 180
|
|
|
|
|
- // },
|
|
|
|
|
- // {
|
|
|
|
|
- // prop: 'specifications',
|
|
|
|
|
- // label: '规格',
|
|
|
|
|
- // align: 'center',
|
|
|
|
|
- // showOverflowTooltip: true,
|
|
|
|
|
- // width: 180
|
|
|
|
|
- // },
|
|
|
|
|
- // {
|
|
|
|
|
- // prop: 'brandNumber',
|
|
|
|
|
- // label: '牌号',
|
|
|
|
|
- // align: 'center',
|
|
|
|
|
- // showOverflowTooltip: true,
|
|
|
|
|
- // width: 180
|
|
|
|
|
- // },
|
|
|
|
|
{
|
|
{
|
|
|
slot: 'quantity',
|
|
slot: 'quantity',
|
|
|
prop: 'quantity',
|
|
prop: 'quantity',
|
|
@@ -546,8 +503,8 @@
|
|
|
width: 140
|
|
width: 140
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- slot: 'classes',
|
|
|
|
|
- prop: 'classes',
|
|
|
|
|
|
|
+ slot: 'teamTimeDetailId',
|
|
|
|
|
+ prop: 'teamTimeDetailId',
|
|
|
label: '班次',
|
|
label: '班次',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
@@ -584,32 +541,51 @@
|
|
|
watch: {},
|
|
watch: {},
|
|
|
created() {
|
|
created() {
|
|
|
this.workCenterData();
|
|
this.workCenterData();
|
|
|
|
|
+ this.getClassesData();
|
|
|
this.form.singleReport = this.clientEnvironmentId == 2 ? 0 : 1;
|
|
this.form.singleReport = this.clientEnvironmentId == 2 ? 0 : 1;
|
|
|
|
|
+ this.dateValue = this.getFormattedDate();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 查询班次
|
|
|
|
|
+ getClassesData() {
|
|
|
|
|
+ if (!this.current.factoriesId) return;
|
|
|
|
|
+ listByFactoryId(this.current.factoriesId).then((res) => {
|
|
|
|
|
+ if (!res) return;
|
|
|
|
|
+ this.shiftList = res;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 选中班次
|
|
|
|
|
+ shiftSelection(e, row) {
|
|
|
|
|
+ let data = this.shiftList.find((item) => item.id == e);
|
|
|
|
|
+ let startTime = `${this.dateValue} ${data.startTime}`;
|
|
|
|
|
+ let endTime = `${this.dateValue} ${data.endTime}`;
|
|
|
|
|
+ this.$set(row, 'startTime', startTime);
|
|
|
|
|
+ this.$set(row, 'endTime', endTime);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取当前年月日
|
|
|
|
|
+ getFormattedDate() {
|
|
|
|
|
+ const now = new Date();
|
|
|
|
|
+ const year = now.getFullYear();
|
|
|
|
|
+ const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
+ const date = String(now.getDate()).padStart(2, '0');
|
|
|
|
|
+ return `${year}-${month}-${date}`;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 查询工作中心
|
|
|
async workCenterData() {
|
|
async workCenterData() {
|
|
|
// const res = await listWorkCenter(this.current.firstTaskId);
|
|
// const res = await listWorkCenter(this.current.firstTaskId);
|
|
|
- const res = await listWorkCenter(this.current.taskInstanceId);
|
|
|
|
|
|
|
+ const res = await listWorkCenter(this.current.firstTaskId);
|
|
|
this.workCenterList = res;
|
|
this.workCenterList = res;
|
|
|
if (res.length > 0) {
|
|
if (res.length > 0) {
|
|
|
this.form.factoryName = res[0].factoryName;
|
|
this.form.factoryName = res[0].factoryName;
|
|
|
this.form.workCenterId = res[0].id;
|
|
this.form.workCenterId = res[0].id;
|
|
|
// 查首工序
|
|
// 查首工序
|
|
|
- this.changeWork(res[0].id); // 选择工作中心
|
|
|
|
|
|
|
+ await this.changeWork(res[0].id); // 选择工作中心
|
|
|
this.getProductionData(res[0].id); // 查询产线
|
|
this.getProductionData(res[0].id); // 查询产线
|
|
|
this.FirstTaskIdFn(); // 查询工位数据
|
|
this.FirstTaskIdFn(); // 查询工位数据
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 查询工序列表数据
|
|
// 查询工序列表数据
|
|
|
changeDispatch(e) {
|
|
changeDispatch(e) {
|
|
|
- console.log('请求了这里 11');
|
|
|
|
|
- // if (e == 1) {
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
- // if (!this.form.workCenterId) {
|
|
|
|
|
- // this.$message.warning('请先选择工作中心');
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
this.tabsLoading = true;
|
|
this.tabsLoading = true;
|
|
|
// listByWorkCenter(this.form.workCenterId)
|
|
// listByWorkCenter(this.form.workCenterId)
|
|
|
listByRoutingIds([this.current.produceRoutingId])
|
|
listByRoutingIds([this.current.produceRoutingId])
|
|
@@ -645,6 +621,7 @@
|
|
|
selection: [], // 当前工序下面的指派 选中的数据
|
|
selection: [], // 当前工序下面的指派 选中的数据
|
|
|
code: item.code, // 工序 编码
|
|
code: item.code, // 工序 编码
|
|
|
index: index, // 当前工序数据的下标
|
|
index: index, // 当前工序数据的下标
|
|
|
|
|
+
|
|
|
radioBun: {
|
|
radioBun: {
|
|
|
// 指派按钮的操作状态 绑定 默认false(可操作)
|
|
// 指派按钮的操作状态 绑定 默认false(可操作)
|
|
|
stationDis: false,
|
|
stationDis: false,
|
|
@@ -673,15 +650,23 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 选择工作中心
|
|
// 选择工作中心
|
|
|
- changeWork(e) {
|
|
|
|
|
|
|
+ async changeWork(e) {
|
|
|
this.form.workCenterId = e;
|
|
this.form.workCenterId = e;
|
|
|
// this.changeDispatch(); // 查询工序列表
|
|
// this.changeDispatch(); // 查询工序列表
|
|
|
let data = this.workCenterList.find((item) => item.id == e);
|
|
let data = this.workCenterList.find((item) => item.id == e);
|
|
|
this.form.workCenterName = data.name;
|
|
this.form.workCenterName = data.name;
|
|
|
- this.teamList = data.teamList || [];
|
|
|
|
|
|
|
+ this.teamList = data.teamList || []; // 重新获取 班组数据
|
|
|
if (this.teamList.length > 0) {
|
|
if (this.teamList.length > 0) {
|
|
|
this.form.teamId = this.teamList[0].id;
|
|
this.form.teamId = this.teamList[0].id;
|
|
|
- this.changeGroups(this.teamList[0].id);
|
|
|
|
|
|
|
+ await this.changeGroups(this.teamList[0].id); // 获取人员数据方法
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 如果没有 班组数据 将人员数据清空 并且判断
|
|
|
|
|
+ this.crewList = [];
|
|
|
|
|
+ this.form.teamId = '';
|
|
|
|
|
+ let data = this.processList.find((item) => item.id == this.processId);
|
|
|
|
|
+ if (data.assignType == 2) {
|
|
|
|
|
+ this.$set(data, 'list', []);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 选择班组 查询人员的数据
|
|
// 选择班组 查询人员的数据
|
|
@@ -692,12 +677,13 @@
|
|
|
const res = await listUserByIds([e]);
|
|
const res = await listUserByIds([e]);
|
|
|
this.crewList = res || [];
|
|
this.crewList = res || [];
|
|
|
// 查看当前的工序数据是不是 选择的人员 是的话同步更改
|
|
// 查看当前的工序数据是不是 选择的人员 是的话同步更改
|
|
|
- if (this.form.taskAss == 1) {
|
|
|
|
|
|
|
+ if (!this.processId || this.processId == 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
let data = this.processList.find((item) => item.id == this.processId);
|
|
let data = this.processList.find((item) => item.id == this.processId);
|
|
|
if (data.assignType == 2) {
|
|
if (data.assignType == 2) {
|
|
|
- this.$set(data, 'list', res);
|
|
|
|
|
|
|
+ this.handleClick({ name: this.processId });
|
|
|
|
|
+ // this.$set(data, 'list', res);
|
|
|
}
|
|
}
|
|
|
} catch {
|
|
} catch {
|
|
|
this.crewList = [];
|
|
this.crewList = [];
|
|
@@ -711,7 +697,7 @@
|
|
|
// 查询工位数据
|
|
// 查询工位数据
|
|
|
FirstTaskIdFn() {
|
|
FirstTaskIdFn() {
|
|
|
// listByFirstTaskId(this.current.firstTaskId)
|
|
// listByFirstTaskId(this.current.firstTaskId)
|
|
|
- listByFirstTaskId(this.current.taskInstanceId)
|
|
|
|
|
|
|
+ listByFirstTaskId(this.current.firstTaskId)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
this.stationList = res;
|
|
this.stationList = res;
|
|
|
this.changeDispatch();
|
|
this.changeDispatch();
|
|
@@ -782,7 +768,7 @@
|
|
|
flag = false;
|
|
flag = false;
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- assignees.push({
|
|
|
|
|
|
|
+ let Aobj = {
|
|
|
assigneeId: item.id,
|
|
assigneeId: item.id,
|
|
|
quantity: item.quantity,
|
|
quantity: item.quantity,
|
|
|
weight: item.weight,
|
|
weight: item.weight,
|
|
@@ -790,7 +776,11 @@
|
|
|
endTime: item.endTime,
|
|
endTime: item.endTime,
|
|
|
assigneeType: row.assignType,
|
|
assigneeType: row.assignType,
|
|
|
assigneeName: item.name
|
|
assigneeName: item.name
|
|
|
- });
|
|
|
|
|
|
|
+ };
|
|
|
|
|
+ if (item.teamTimeDetailId) {
|
|
|
|
|
+ Aobj.teamTimeDetailId = item.teamTimeDetailId;
|
|
|
|
|
+ }
|
|
|
|
|
+ assignees.push(Aobj);
|
|
|
changeIds.push(item.changeId);
|
|
changeIds.push(item.changeId);
|
|
|
});
|
|
});
|
|
|
if (!flag) {
|
|
if (!flag) {
|
|
@@ -952,14 +942,15 @@
|
|
|
this.$message.error(err.message);
|
|
this.$message.error(err.message);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- // 工序选择
|
|
|
|
|
|
|
+ // 工序选择 有问题
|
|
|
handleClick(tab) {
|
|
handleClick(tab) {
|
|
|
let id = tab.name;
|
|
let id = tab.name;
|
|
|
this.processId = id;
|
|
this.processId = id;
|
|
|
let data = this.processList.find((item) => item.id == this.processId);
|
|
let data = this.processList.find((item) => item.id == this.processId);
|
|
|
- if (data.list.length == 0) {
|
|
|
|
|
- this.changeRadio(1, data.index);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 传指定的指派类型
|
|
|
|
|
+ // if (data.list.length == 0) {
|
|
|
|
|
+ this.changeRadio(data.assignType, data.index);
|
|
|
|
|
+ // }
|
|
|
},
|
|
},
|
|
|
// 指派选择
|
|
// 指派选择
|
|
|
changeRadio(e, index) {
|
|
changeRadio(e, index) {
|
|
@@ -982,6 +973,10 @@
|
|
|
async getAssignData(index, arr) {
|
|
async getAssignData(index, arr) {
|
|
|
let list = JSON.parse(JSON.stringify(arr));
|
|
let list = JSON.parse(JSON.stringify(arr));
|
|
|
let dataRow = this.processList[index];
|
|
let dataRow = this.processList[index];
|
|
|
|
|
+ // 不存在 班组数据的话 就不调用这个方法
|
|
|
|
|
+ if (!this.form.teamId) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
let params = {
|
|
let params = {
|
|
|
workOrderId: this.current.id,
|
|
workOrderId: this.current.id,
|
|
|
workCenterId: this.form.workCenterId,
|
|
workCenterId: this.form.workCenterId,
|
|
@@ -1073,6 +1068,7 @@
|
|
|
listArr[idx].quantity = item.quantity;
|
|
listArr[idx].quantity = item.quantity;
|
|
|
listArr[idx].weight = item.weight;
|
|
listArr[idx].weight = item.weight;
|
|
|
listArr[idx].changeId = item.id;
|
|
listArr[idx].changeId = item.id;
|
|
|
|
|
+ listArr[idx].teamTimeDetailId = item.teamTimeDetailId;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
this.$set(dataRow, 'list', listArr);
|
|
this.$set(dataRow, 'list', listArr);
|
|
@@ -1090,6 +1086,20 @@
|
|
|
// 更新绑定值
|
|
// 更新绑定值
|
|
|
row.quantity = value;
|
|
row.quantity = value;
|
|
|
this.calculateQuantity(row, item);
|
|
this.calculateQuantity(row, item);
|
|
|
|
|
+ this.bringWeight(row.quantity, row);
|
|
|
|
|
+ },
|
|
|
|
|
+ // 自动算重量
|
|
|
|
|
+ bringWeight(value, row) {
|
|
|
|
|
+ if (!this.current.formingWeight) {
|
|
|
|
|
+ this.$set(row, 'weight', 0);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let weight =
|
|
|
|
|
+ (this.current.formingWeight / this.current.formingNum) * value;
|
|
|
|
|
+ if (weight > 0) {
|
|
|
|
|
+ weight = weight.toFixed(4) - 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$set(row, 'weight', weight);
|
|
|
},
|
|
},
|
|
|
calculateQuantity(row, item) {
|
|
calculateQuantity(row, item) {
|
|
|
// 如果没有该字段 就不做判断
|
|
// 如果没有该字段 就不做判断
|
|
@@ -1119,8 +1129,6 @@
|
|
|
total = total + (el.weight - 0);
|
|
total = total + (el.weight - 0);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- console.log(total, 'total');
|
|
|
|
|
- console.log(this.current, 'this.current');
|
|
|
|
|
if (total > this.current.formingWeight - 0) {
|
|
if (total > this.current.formingWeight - 0) {
|
|
|
this.$message.warning('列表数量相加不能大于目标要求生产数量');
|
|
this.$message.warning('列表数量相加不能大于目标要求生产数量');
|
|
|
row.weight = 0;
|
|
row.weight = 0;
|