|
|
@@ -220,26 +220,13 @@ export default {
|
|
|
this.form.teamName = data.name;
|
|
|
try {
|
|
|
const res = await listUserByIds([e]);
|
|
|
- this.crewList =
|
|
|
- res &&
|
|
|
- res.map((el) => {
|
|
|
- return {
|
|
|
- code: el.code,
|
|
|
- name: el.name,
|
|
|
- id: el.id
|
|
|
- };
|
|
|
- });
|
|
|
+ this.crewList = res;
|
|
|
// 查看当前的工序数据是不是 选择的人员 是的话同步更改
|
|
|
if (!this.processId || this.processId == 0) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- // if (data.assignType == 2) {
|
|
|
-
|
|
|
this.handleClick({ name: this.processId });
|
|
|
this.btnInit();
|
|
|
- // this.$set(data, 'list', res);
|
|
|
- // }
|
|
|
} catch {
|
|
|
this.crewList = [];
|
|
|
}
|
|
|
@@ -827,19 +814,21 @@ export default {
|
|
|
if (item.index !== this.processList.length - 1) {
|
|
|
// let latterIdx = item.index + 1;
|
|
|
let latterIdx = this.calculateIndex(item.index).endIdx;
|
|
|
- let time = this.processList[latterIdx].startDate;
|
|
|
- let latterName = this.processList[latterIdx].name;
|
|
|
- const latterTime = new Date(time); // 下一道工序的结束时间
|
|
|
- if (time && startTime > latterTime) {
|
|
|
- this.$message.closeAll();
|
|
|
- this.$message.info(
|
|
|
- `开始时间不能大于后面工序${latterName}的开始时间${time}`
|
|
|
- );
|
|
|
- // 判断是否 配置时间更改规则
|
|
|
- if (this.time_calc_code == '1') {
|
|
|
- row.startTime = '';
|
|
|
+ if (latterIdx !== 'none') {
|
|
|
+ let time = this.processList[latterIdx].startDate;
|
|
|
+ let latterName = this.processList[latterIdx].name;
|
|
|
+ const latterTime = new Date(time); // 下一道工序的结束时间
|
|
|
+ if (time && startTime > latterTime) {
|
|
|
+ this.$message.closeAll();
|
|
|
+ this.$message.info(
|
|
|
+ `开始时间不能大于后面工序${latterName}的开始时间${time}`
|
|
|
+ );
|
|
|
+ // 判断是否 配置时间更改规则
|
|
|
+ if (this.time_calc_code == '1') {
|
|
|
+ row.startTime = '';
|
|
|
+ }
|
|
|
+ return;
|
|
|
}
|
|
|
- return;
|
|
|
}
|
|
|
}
|
|
|
// 校验 是否 大于结束时间 wda
|
|
|
@@ -881,40 +870,42 @@ export default {
|
|
|
const endTime = new Date(row.endTime); // 结束时间
|
|
|
// 当前工序的结束时间 不能大于后一道工序的开始时间
|
|
|
if (item.index !== this.processList.length - 1) {
|
|
|
- // let latterIdx = item.index + 1;
|
|
|
let latterIdx = this.calculateIndex(item.index).endIdx;
|
|
|
- let latterName = this.processList[latterIdx].name;
|
|
|
- let time = this.processList[latterIdx].startDate;
|
|
|
- const latterTime = new Date(time); // 后面工序的开始时间
|
|
|
- if (time && endTime > latterTime) {
|
|
|
- this.$message.closeAll();
|
|
|
- this.$message.info(
|
|
|
- `结束时间不能大于后面工序${latterName}的开始时间${time}`
|
|
|
- );
|
|
|
- // 判断是否 配置时间更改规则
|
|
|
- if (this.time_calc_code == '1') {
|
|
|
- row.endTime = time;
|
|
|
+ if (latterIdx !== 'none') {
|
|
|
+ let latterName = this.processList[latterIdx].name;
|
|
|
+ let time = this.processList[latterIdx].startDate;
|
|
|
+ const latterTime = new Date(time); // 后面工序的开始时间
|
|
|
+ if (time && endTime > latterTime) {
|
|
|
+ this.$message.closeAll();
|
|
|
+ this.$message.info(
|
|
|
+ `结束时间不能大于后面工序${latterName}的开始时间${time}`
|
|
|
+ );
|
|
|
+ // 判断是否 配置时间更改规则
|
|
|
+ if (this.time_calc_code == '1') {
|
|
|
+ row.endTime = time;
|
|
|
+ }
|
|
|
+ return;
|
|
|
}
|
|
|
- return;
|
|
|
}
|
|
|
}
|
|
|
// 这一道工序的开始时间更不能小于于前一道工序的结束时间
|
|
|
if (item.index !== 0) {
|
|
|
- // let frontIdx = item.index - 1;
|
|
|
let frontIdx = this.calculateIndex(item.index).startIdx;
|
|
|
- let frontName = this.processList[frontIdx].name;
|
|
|
- let time = this.processList[frontIdx].endDate;
|
|
|
- const frontTime = new Date(time); // 上一道工序的结束时间
|
|
|
- if (time && endTime < frontTime) {
|
|
|
- this.$message.closeAll();
|
|
|
- this.$message.info(
|
|
|
- `结束时间不能小于前面工序${frontName}的结束时间${time}`
|
|
|
- );
|
|
|
- // 判断是否 配置时间更改规则
|
|
|
- if (this.time_calc_code == '1') {
|
|
|
- row.endTime = '';
|
|
|
+ if (frontIdx !== 'none') {
|
|
|
+ let frontName = this.processList[frontIdx].name;
|
|
|
+ let time = this.processList[frontIdx].endDate;
|
|
|
+ const frontTime = new Date(time); // 上一道工序的结束时间
|
|
|
+ if (time && endTime < frontTime) {
|
|
|
+ this.$message.closeAll();
|
|
|
+ this.$message.info(
|
|
|
+ `结束时间不能小于前面工序${frontName}的结束时间${time}`
|
|
|
+ );
|
|
|
+ // 判断是否 配置时间更改规则
|
|
|
+ if (this.time_calc_code == '1') {
|
|
|
+ row.endTime = '';
|
|
|
+ }
|
|
|
+ return;
|
|
|
}
|
|
|
- return;
|
|
|
}
|
|
|
}
|
|
|
this.checkEndTimeValid(row, item);
|