# Conflicts:
#	pages/materialManagement/MaterialRequisition/MaterialRequisition.vue
This commit is contained in:
赵正易 2024-04-30 13:25:53 +08:00
commit f6ed3db500
3 changed files with 200 additions and 112 deletions

View File

@ -44,4 +44,15 @@ export function emergency_stop_agv(params) {
method: 'get', method: 'get',
params params
}) })
}
export function FinisBatchingTask(params) {
return request({
url: '/mes/mm/materialinput/finishBatchingTask',
method: 'get',
params
})
} }

View File

@ -216,15 +216,15 @@
"navigationBarTitleText" : "车间叫料", "navigationBarTitleText" : "车间叫料",
"enablePullDownRefresh" : false "enablePullDownRefresh" : false
} }
},
{
"path" : "pages/materialManagement/MaterialWarehousing/MaterialWarehousing",
"style" :
{
"navigationBarTitleText" : "成品入库",
"enablePullDownRefresh" : false
}
} }
// {
// "path" : "pages/materialManagement/MaterialWarehousing/MaterialWarehousing",
// "style" :
// {
// "navigationBarTitleText" : "成品入库",
// "enablePullDownRefresh" : false
// }
// }
] ]
} }

View File

@ -27,6 +27,7 @@
<view class="cartoon-list-item"> <view class="cartoon-list-item">
<u-row> <u-row>
<u-col span="2">{{ item.id }}</u-col> <u-col span="2">{{ item.id }}</u-col>
<<<<<<< HEAD
<u-col span="1"><u-tag :text="item.agvPosition" size="mini" <u-col span="1"><u-tag :text="item.agvPosition" size="mini"
type="primary"></u-tag></u-col> type="primary"></u-tag></u-col>
<u-col span="3" offset="1"><u-icon name="arrow-right-double" color="#2979ff" <u-col span="3" offset="1"><u-icon name="arrow-right-double" color="#2979ff"
@ -34,6 +35,12 @@
<u-col span="2"><u-button type="success" text="开始" size="mini" <u-col span="2"><u-button type="success" text="开始" size="mini"
@click="confirm_startpoint(item.agvPosition)"></u-button></u-col> @click="confirm_startpoint(item.agvPosition)"></u-button></u-col>
<u-col span="2"><u-button type="error" text="结束" size="mini"></u-button></u-col> <u-col span="2"><u-button type="error" text="结束" size="mini"></u-button></u-col>
=======
<u-col span="1"><u-tag :text="item.agvPosition" size="mini" type="primary"></u-tag></u-col>
<u-col span="3" offset="1"><u-icon name="arrow-right-double" color="#2979ff" size="50" @click="detail_item(item.taskId)"></u-icon></u-col>
<u-col span="2"><u-button type="success" text="开始" size="mini" @click="confirm_startpoint(item.agvPosition)"></u-button></u-col>
<u-col span="2"><u-button type="error" text="结束" size="mini" @click="final_task(item.taskId)"></u-button></u-col>
>>>>>>> 9c7f6d2 (配料任务)
</u-row> </u-row>
</view> </view>
</u-list-item> </u-list-item>
@ -119,79 +126,137 @@
</template> </template>
<script> <script>
import {
getIngredientTask, import { getIngredientTask, getIngredientTask_son, getfabgopoints, go_workshop, emergency_stop_agv, FinisBatchingTask } from '@/api/materialManagement/MaterialRequsition.js';
getIngredientTask_son, export default {
getfabgopoints, data() {
go_workshop, return {
emergency_stop_agv list: ['车间叫料', '空车返程'],
} from '@/api/materialManagement/MaterialRequsition.js'; current: 0,
export default { queryParams: {
data() { workerorder_time: Number(new Date()),
return { pageNum: 1,
list: ['车间叫料', '空车返程'], pageSize: 10,
current: 0, sort: undefined,
queryParams: { sortType: undefined,
workerorder_time: Number(new Date()), totalNum: 0
pageNum: 1, },
pageSize: 10, timeshow: false,
sort: undefined, taskList: [],
sortType: undefined, show_popup: false,
totalNum: 0 title: '',
}, taskList_son: [],
timeshow: false, loading: false,
taskList: [], start_point: '',
show_popup: false, end_point: '',
title: '', fab_go_points: [],
taskList_son: [], reqCode: ''
loading: false, };
start_point: '', },
end_point: '', watch: {},
fab_go_points: [], filters: {
reqCode: '' 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;
}
});
}, },
watch: {}, sectionChange(index) {
filters: { this.current = index;
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() { // scrolltolower() {
this.getInitList(); // 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();
});
}, },
methods: { //todo
// todo detail_item(taskId) {
getInitList() { const query = {
// 使 taskId: taskId
let date = new Date(this.queryParams.workerorder_time); };
this.loading = true;
// getIngredientTask_son(query).then((res) => {
let offset = 8 * 60; // UTC+8 if (res.code == 200) {
this.loading = false;
// this.taskList_son = res.data;
let shanghaiTime = new Date(date.getTime() + offset * 60 * 1000); this.show_popup = true;
this.title = '任务号:' + taskId;
let queryTask = { }
...this.queryParams });
}; },
queryTask.datetimespan = shanghaiTime; //todo
delete queryTask.workerorder_time; confirm_startpoint(point) {
getIngredientTask(queryTask).then((res) => { this.start_point = point;
if (res.code == 200) { },
res.data.forEach((item, index) => { //todo
item.id = index; get_fab_go_points() {
getfabgopoints().then((res) => {
if (res.code == 200) {
let array = [];
res.data.forEach((item) => {
array.push({
value: item,
text: item
}); });
this.taskList = res.data; });
} this.fab_go_points = array;
}
});
},
//todo agv
start_agv() {
if (this.start_point == '' || this.end_point == '') {
this.$refs.uToast.show({
type: 'error',
message: '起点或者终点不能为空'
}); });
}, },
sectionChange(index) { sectionChange(index) {
@ -255,47 +320,59 @@
if (this.start_point == '' || this.end_point == '') { if (this.start_point == '' || this.end_point == '') {
this.$refs.uToast.show({ this.$refs.uToast.show({
type: 'error', type: 'error',
message: '起点或者终点不能为空' message: 'agv起动成功' + res.data
}); });
return;
} }
const query = { });
start_point: this.start_point, },
end_point: this.end_point //todo agv
}; stop_agv() {
go_workshop(query).then((res) => { if (this.reqCode == '') {
if (res.code == 200) { this.$refs.uToast.show({
this.reqCode = res.data.data; type: 'error',
this.$refs.uToast.show({ message: '无任务编号'
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
});
}
}); });
return;
} }
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 == '') {
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> </script>