|
@@ -29,7 +29,7 @@
|
|
|
>
|
|
>
|
|
|
<el-form-item :label="item.label">
|
|
<el-form-item :label="item.label">
|
|
|
<!-- <div class="item_label">{{ current[item.prop] }}</div> -->
|
|
<!-- <div class="item_label">{{ current[item.prop] }}</div> -->
|
|
|
- <el-input v-model="current[item.prop]" disabled />
|
|
|
|
|
|
|
+ <el-input :value="fieldValue(item.prop)" disabled />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -233,13 +233,13 @@
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <template v-slot:quantity="{ row}">
|
|
|
|
|
|
|
+ <template v-slot:quantity="{ row }">
|
|
|
<el-input
|
|
<el-input
|
|
|
:disabled="permissions(row)"
|
|
:disabled="permissions(row)"
|
|
|
type="number"
|
|
type="number"
|
|
|
v-model="row.quantity"
|
|
v-model="row.quantity"
|
|
|
placeholder="请输入数量"
|
|
placeholder="请输入数量"
|
|
|
- @input="(e) => handleQuantityInput(e, row,item)"
|
|
|
|
|
|
|
+ @input="(e) => handleQuantityInput(e, row, item)"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:weight="{ row }">
|
|
<template v-slot:weight="{ row }">
|
|
@@ -248,9 +248,20 @@
|
|
|
type="number"
|
|
type="number"
|
|
|
v-model="row.weight"
|
|
v-model="row.weight"
|
|
|
placeholder="请输入重量"
|
|
placeholder="请输入重量"
|
|
|
- @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="请选择">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in options"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
<template v-slot:startTime="{ row }">
|
|
<template v-slot:startTime="{ row }">
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
:disabled="permissions(row)"
|
|
:disabled="permissions(row)"
|
|
@@ -381,10 +392,37 @@
|
|
|
{ label: '要求生产重量:', prop: 'initialWeight' },
|
|
{ label: '要求生产重量:', prop: 'initialWeight' },
|
|
|
{ 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: '北京烤鸭'
|
|
|
|
|
+ }
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ fieldValue() {
|
|
|
|
|
+ return (field) => {
|
|
|
|
|
+ return this.current[field];
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
clientEnvironmentId() {
|
|
clientEnvironmentId() {
|
|
|
return this.$store.state.user.info.clientEnvironmentId;
|
|
return this.$store.state.user.info.clientEnvironmentId;
|
|
|
},
|
|
},
|
|
@@ -507,6 +545,14 @@
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
width: 140
|
|
width: 140
|
|
|
},
|
|
},
|
|
|
|
|
+ {
|
|
|
|
|
+ slot: 'classes',
|
|
|
|
|
+ prop: 'classes',
|
|
|
|
|
+ label: '班次',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ showOverflowTooltip: true,
|
|
|
|
|
+ minWidth: 140
|
|
|
|
|
+ },
|
|
|
{
|
|
{
|
|
|
slot: 'startTime',
|
|
slot: 'startTime',
|
|
|
prop: 'startTime',
|
|
prop: 'startTime',
|
|
@@ -538,12 +584,12 @@
|
|
|
watch: {},
|
|
watch: {},
|
|
|
created() {
|
|
created() {
|
|
|
this.workCenterData();
|
|
this.workCenterData();
|
|
|
- this.FirstTaskIdFn();
|
|
|
|
|
this.form.singleReport = this.clientEnvironmentId == 2 ? 0 : 1;
|
|
this.form.singleReport = this.clientEnvironmentId == 2 ? 0 : 1;
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
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);
|
|
|
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;
|
|
@@ -551,10 +597,12 @@
|
|
|
// 查首工序
|
|
// 查首工序
|
|
|
this.changeWork(res[0].id); // 选择工作中心
|
|
this.changeWork(res[0].id); // 选择工作中心
|
|
|
this.getProductionData(res[0].id); // 查询产线
|
|
this.getProductionData(res[0].id); // 查询产线
|
|
|
|
|
+ this.FirstTaskIdFn(); // 查询工位数据
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 查询工序列表数据
|
|
// 查询工序列表数据
|
|
|
changeDispatch(e) {
|
|
changeDispatch(e) {
|
|
|
|
|
+ console.log('请求了这里 11');
|
|
|
// if (e == 1) {
|
|
// if (e == 1) {
|
|
|
// return;
|
|
// return;
|
|
|
// }
|
|
// }
|
|
@@ -566,7 +614,6 @@
|
|
|
// listByWorkCenter(this.form.workCenterId)
|
|
// listByWorkCenter(this.form.workCenterId)
|
|
|
listByRoutingIds([this.current.produceRoutingId])
|
|
listByRoutingIds([this.current.produceRoutingId])
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
-
|
|
|
|
|
this.tabsLoading = false;
|
|
this.tabsLoading = false;
|
|
|
// 如果没有首工序的数据 就不能选择工序任务派单
|
|
// 如果没有首工序的数据 就不能选择工序任务派单
|
|
|
if (!res || res.length == 0) {
|
|
if (!res || res.length == 0) {
|
|
@@ -580,7 +627,9 @@
|
|
|
let isExist = false;
|
|
let isExist = false;
|
|
|
let firstTaskindex = '';
|
|
let firstTaskindex = '';
|
|
|
res.forEach((item, index) => {
|
|
res.forEach((item, index) => {
|
|
|
- isExist = isExist ? isExist : item.sourceTaskId === this.current.firstTaskId;
|
|
|
|
|
|
|
+ isExist = isExist
|
|
|
|
|
+ ? isExist
|
|
|
|
|
+ : item.sourceTaskId === this.current.firstTaskId;
|
|
|
// 如果有首工序id 存储它的下标
|
|
// 如果有首工序id 存储它的下标
|
|
|
if (isExist) {
|
|
if (isExist) {
|
|
|
if (!firstTaskindex && firstTaskindex !== 0) {
|
|
if (!firstTaskindex && firstTaskindex !== 0) {
|
|
@@ -614,13 +663,13 @@
|
|
|
this.processList = [];
|
|
this.processList = [];
|
|
|
this.form.taskAss = 1;
|
|
this.form.taskAss = 1;
|
|
|
this.procTaskDis = true;
|
|
this.procTaskDis = true;
|
|
|
- this.$message.warning('当前任务没有首工序报工')
|
|
|
|
|
|
|
+ this.$message.warning('当前任务没有首工序报工');
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
this.processList = [];
|
|
this.processList = [];
|
|
|
this.tabsLoading = false;
|
|
this.tabsLoading = false;
|
|
|
- this.$message.warning(err.message);
|
|
|
|
|
|
|
+ this.$message.error(err.message);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 选择工作中心
|
|
// 选择工作中心
|
|
@@ -661,13 +710,16 @@
|
|
|
},
|
|
},
|
|
|
// 查询工位数据
|
|
// 查询工位数据
|
|
|
FirstTaskIdFn() {
|
|
FirstTaskIdFn() {
|
|
|
- listByFirstTaskId(this.current.firstTaskId).then((res) => {
|
|
|
|
|
- this.stationList = res;
|
|
|
|
|
- this.changeDispatch();
|
|
|
|
|
- }).catch((err) => {
|
|
|
|
|
- this.stationList = [];
|
|
|
|
|
- this.$message.error(err.message);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // listByFirstTaskId(this.current.firstTaskId)
|
|
|
|
|
+ listByFirstTaskId(this.current.taskInstanceId)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ this.stationList = res;
|
|
|
|
|
+ this.changeDispatch();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((err) => {
|
|
|
|
|
+ this.stationList = [];
|
|
|
|
|
+ this.$message.error(err.message);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
// 重置(单个)
|
|
// 重置(单个)
|
|
|
resetData(row, item) {
|
|
resetData(row, item) {
|
|
@@ -686,7 +738,7 @@
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
this.toolbarLoading = false;
|
|
this.toolbarLoading = false;
|
|
|
- this.$message.warning(err.message);
|
|
|
|
|
|
|
+ this.$message.error(err.message);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 撤回的逻辑
|
|
// 撤回的逻辑
|
|
@@ -777,7 +829,7 @@
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
this.toolbarLoading = false;
|
|
this.toolbarLoading = false;
|
|
|
- this.$message.warning(err.message);
|
|
|
|
|
|
|
+ this.$message.error(err.message);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
cancel() {
|
|
cancel() {
|
|
@@ -897,7 +949,7 @@
|
|
|
})
|
|
})
|
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
|
this.toolbarLoading = false;
|
|
this.toolbarLoading = false;
|
|
|
- this.$message.warning(err.message);
|
|
|
|
|
|
|
+ this.$message.error(err.message);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
// 工序选择
|
|
// 工序选择
|
|
@@ -1028,7 +1080,7 @@
|
|
|
},
|
|
},
|
|
|
assignRadio(e) {},
|
|
assignRadio(e) {},
|
|
|
// 数量正则 quantity
|
|
// 数量正则 quantity
|
|
|
- handleQuantityInput(e, row,item) {
|
|
|
|
|
|
|
+ handleQuantityInput(e, row, item) {
|
|
|
// 过滤非数字字符(包括负号)
|
|
// 过滤非数字字符(包括负号)
|
|
|
let value = e.replace(/[^\d]/g, '');
|
|
let value = e.replace(/[^\d]/g, '');
|
|
|
// 限制不能以 0 开头(除非是 0 本身)
|
|
// 限制不能以 0 开头(除非是 0 本身)
|
|
@@ -1037,45 +1089,45 @@
|
|
|
}
|
|
}
|
|
|
// 更新绑定值
|
|
// 更新绑定值
|
|
|
row.quantity = value;
|
|
row.quantity = value;
|
|
|
- this.calculateQuantity(row,item)
|
|
|
|
|
|
|
+ this.calculateQuantity(row, item);
|
|
|
},
|
|
},
|
|
|
- calculateQuantity(row,item){
|
|
|
|
|
|
|
+ calculateQuantity(row, item) {
|
|
|
// 如果没有该字段 就不做判断
|
|
// 如果没有该字段 就不做判断
|
|
|
- if (!this.current.formingNum){
|
|
|
|
|
|
|
+ if (!this.current.formingNum) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
let total = 0;
|
|
let total = 0;
|
|
|
- item.list.forEach(el => {
|
|
|
|
|
- if (el.quantity){
|
|
|
|
|
|
|
+ item.list.forEach((el) => {
|
|
|
|
|
+ if (el.quantity) {
|
|
|
total = total + (el.quantity - 0);
|
|
total = total + (el.quantity - 0);
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
- if (total > (this.current.formingNum - 0)){
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ if (total > this.current.formingNum - 0) {
|
|
|
this.$message.warning('列表数量相加不能大于目标要求生产数量');
|
|
this.$message.warning('列表数量相加不能大于目标要求生产数量');
|
|
|
row.quantity = 0;
|
|
row.quantity = 0;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 计算重量
|
|
// 计算重量
|
|
|
- calculateWeight(row,item){
|
|
|
|
|
|
|
+ calculateWeight(row, item) {
|
|
|
// 如果没有该字段 就不做判断
|
|
// 如果没有该字段 就不做判断
|
|
|
- if (!this.current.formingWeight){
|
|
|
|
|
|
|
+ if (!this.current.formingWeight) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
let total = 0;
|
|
let total = 0;
|
|
|
- item.list.forEach(el => {
|
|
|
|
|
- if (el.weight){
|
|
|
|
|
|
|
+ item.list.forEach((el) => {
|
|
|
|
|
+ if (el.weight) {
|
|
|
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)){
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(total, 'total');
|
|
|
|
|
+ console.log(this.current, 'this.current');
|
|
|
|
|
+ if (total > this.current.formingWeight - 0) {
|
|
|
this.$message.warning('列表数量相加不能大于目标要求生产数量');
|
|
this.$message.warning('列表数量相加不能大于目标要求生产数量');
|
|
|
row.weight = 0;
|
|
row.weight = 0;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 重量正则 weight
|
|
// 重量正则 weight
|
|
|
- handleWeightInput(e, row,item) {
|
|
|
|
|
|
|
+ handleWeightInput(e, row, item) {
|
|
|
// 过滤非数字和非小数点字符(包括负号)
|
|
// 过滤非数字和非小数点字符(包括负号)
|
|
|
let value = e.replace(/[^\d.]/g, '');
|
|
let value = e.replace(/[^\d.]/g, '');
|
|
|
// 限制只能有一个小数点
|
|
// 限制只能有一个小数点
|
|
@@ -1090,7 +1142,7 @@
|
|
|
}
|
|
}
|
|
|
// 更新绑定值
|
|
// 更新绑定值
|
|
|
row.weight = value;
|
|
row.weight = value;
|
|
|
- this.calculateWeight(row,item)
|
|
|
|
|
|
|
+ this.calculateWeight(row, item);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|