合并之后修改

Signed-off-by: qianhao.xu <qianhao.xu@doan-tech.com>
This commit is contained in:
qianhao.xu 2024-04-30 13:21:44 +08:00
parent 34b44e5fc8
commit 00ba779499

View File

@ -126,38 +126,7 @@
</template>
<script>
<<<<<<< HEAD
import {
getIngredientTask,
getIngredientTask_son,
getfabgopoints,
go_workshop,
emergency_stop_agv
} from '@/api/materialManagement/MaterialRequsition.js';
export default {
data() {
return {
list: ['车间叫料', '空车返程'],
current: 0,
queryParams: {
workerorder_time: Number(new Date()),
pageNum: 1,
pageSize: 10,
sort: undefined,
sortType: undefined,
totalNum: 0
},
timeshow: false,
taskList: [],
show_popup: false,
title: '',
taskList_son: [],
loading: false,
start_point: '',
end_point: '',
fab_go_points: [],
reqCode: ''
=======
import { getIngredientTask, getIngredientTask_son, getfabgopoints, go_workshop, emergency_stop_agv, FinisBatchingTask } from '@/api/materialManagement/MaterialRequsition.js';
export default {
data() {
@ -201,19 +170,22 @@ export default {
mounted() {
this.getInitList();
},
methods: {
// todo
getInitList() {
// 使
let date = new Date(this.queryParams.workerorder_time);
//
let offset = 8 * 60; // UTC+8
//
let shanghaiTime = new Date(date.getTime() + offset * 60 * 1000);
let queryTask = { ...this.queryParams };
let queryTask = {
...this.queryParams
};
queryTask.datetimespan = shanghaiTime;
delete queryTask.workerorder_time;
getIngredientTask(queryTask).then((res) => {
@ -249,176 +221,107 @@ export default {
detail_item(taskId) {
const query = {
taskId: taskId
>>>>>>> 9c7f6d2 (配料任务)
};
},
watch: {},
filters: {
formatDate: function(value) {
// Date 使
const date = new Date(value);
//
const year = date.getFullYear();
const month = date.getMonth() + 1; // 0 1
const day = date.getDate();
return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
}
},
mounted() {
this.getInitList();
},
methods: {
// todo
getInitList() {
// 使
let date = new Date(this.queryParams.workerorder_time);
//
let offset = 8 * 60; // UTC+8
//
let shanghaiTime = new Date(date.getTime() + offset * 60 * 1000);
let queryTask = {
...this.queryParams
};
queryTask.datetimespan = shanghaiTime;
delete queryTask.workerorder_time;
getIngredientTask(queryTask).then((res) => {
if (res.code == 200) {
res.data.forEach((item, index) => {
item.id = index;
});
this.taskList = res.data;
}
});
},
sectionChange(index) {
this.current = index;
},
// scrolltolower() {
// this.loadmore();
// },
// loadmore() {
// for (let i = 0; i < 30; i++) {
// this.indexList.push({
// url: this.urls[uni.$u.random(0, this.urls.length - 1)]
// });
// }
// },
//todo
confirm() {
this.timeshow = false;
this.$nextTick(() => {
this.getInitList();
});
},
//todo
detail_item(taskId) {
const query = {
taskId: taskId
};
this.loading = true;
getIngredientTask_son(query).then((res) => {
if (res.code == 200) {
this.loading = false;
this.taskList_son = res.data;
this.show_popup = true;
this.title = '任务号:' + taskId;
}
});
},
//todo
confirm_startpoint(point) {
this.start_point = point;
},
//todo
get_fab_go_points() {
getfabgopoints().then((res) => {
if (res.code == 200) {
let array = [];
res.data.forEach((item) => {
array.push({
value: item,
text: item
});
});
this.fab_go_points = array;
}
});
},
//todo agv
start_agv() {
if (this.start_point == '' || this.end_point == '') {
this.$refs.uToast.show({
type: 'error',
message: '起点或者终点不能为空'
});
return;
this.loading = true;
getIngredientTask_son(query).then((res) => {
if (res.code == 200) {
this.loading = false;
this.taskList_son = res.data;
this.show_popup = true;
this.title = '任务号:' + taskId;
}
const query = {
start_point: this.start_point,
end_point: this.end_point
};
go_workshop(query).then((res) => {
if (res.code == 200) {
this.reqCode = res.data.data;
this.$refs.uToast.show({
type: 'error',
message: 'agv起动成功' + res.data
});
}
});
},
//todo agv
stop_agv() {
if (this.reqCode == '') {
this.$refs.uToast.show({
type: 'error',
message: '无任务编号'
});
return;
}
<<<<<<< HEAD
const query = {
reqCode: this.reqCode
};
emergency_stop_agv().then((res) => {
if (res.code == 200) {
this.$refs.uToast.show({
type: 'success',
message: '成功取消' + res.data
});
}
});
}
=======
});
},
//todo
final_task(taskId) {
if (this.start_point == '' || this.end_point == '' || taskId == '') {
//todo
confirm_startpoint(point) {
this.start_point = point;
},
//todo
get_fab_go_points() {
getfabgopoints().then((res) => {
if (res.code == 200) {
let array = [];
res.data.forEach((item) => {
array.push({
value: item,
text: item
});
});
this.fab_go_points = array;
}
});
},
//todo agv
start_agv() {
if (this.start_point == '' || this.end_point == '') {
this.$refs.uToast.show({
type: 'error',
message: '起点或者终点不能为空'
});
return;
}
const query = {
start_point: this.start_point,
end_point: this.end_point,
taskId: taskId
end_point: this.end_point
};
FinisBatchingTask(query).then((res) => {
go_workshop(query).then((res) => {
if (res.code == 200) {
this.reqCode = res.data.data;
this.$refs.uToast.show({
type: 'error',
message: 'agv起动成功' + res.data
});
}
});
},
//todo agv
stop_agv() {
if (this.reqCode == '') {
this.$refs.uToast.show({
type: 'error',
message: '无任务编号'
});
return;
}
const query = {
reqCode: this.reqCode
};
emergency_stop_agv().then((res) => {
if (res.code == 200) {
this.$refs.uToast.show({
type: 'success',
message: '完成成功' + res.data
message: '成功取消' + res.data
});
this.getInitList();
}
});
>>>>>>> 9c7f6d2 (配料任务)
}
},
//todo
final_task(taskId) {
if (this.start_point == '' || this.end_point == '' || taskId == '') {
return;
}
const query = {
start_point: this.start_point,
end_point: this.end_point,
taskId: taskId
};
FinisBatchingTask(query).then((res) => {
if (res.code == 200) {
this.$refs.uToast.show({
type: 'success',
message: '完成成功' + res.data
});
this.getInitList();
}
});
}
};
</script>