|
@@ -116,8 +116,13 @@
|
|
|
fit="fill"
|
|
|
>
|
|
|
</el-image>
|
|
|
-
|
|
|
- <span style="text-align: center;"><h2>{{ item.name }}_{{ item.content }}</h2></span>
|
|
|
+
|
|
|
+ <div style="text-align: center;">
|
|
|
+ <el-badge :value="item.synFlag=='1'?'报工任务':''" class="item">
|
|
|
+ <h2>{{ item.name }}_{{ item.content }}</h2>
|
|
|
+ </el-badge>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="itemNo" style="margin-top: 10px" >任务编号: {{ item.no }}</div>
|
|
|
</div>
|
|
|
<el-form style="margin-top: 10px">
|
|
@@ -300,6 +305,7 @@ import stationMgrApi from "@/api/machiningClient/stationMgr";
|
|
|
import taskMgrApi from "@/api/runManageCenter/taskMgr";
|
|
|
import machiningClientApi from "@/api/machiningClient/machiningClient"
|
|
|
import Pagination from "@/components/Pagination"
|
|
|
+import moment from 'moment';
|
|
|
export default {
|
|
|
name: "TouchScreen",
|
|
|
components: {Pagination, TaskView,TaskView1,TaskView2,TaskView3,TaskView4, TaskView5, TaskView6,TaskView7},
|
|
@@ -308,6 +314,9 @@ export default {
|
|
|
return {
|
|
|
tableKey: 0,
|
|
|
queryParams: initQueryParams({}),
|
|
|
+ hasTask: true,
|
|
|
+ assignTask:{},
|
|
|
+ currentOrderId:"",
|
|
|
RFIDParams: {
|
|
|
url: "192.168.11.130",
|
|
|
port: "102",
|
|
@@ -346,7 +355,9 @@ export default {
|
|
|
},
|
|
|
// 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
created() {
|
|
|
+ this.currentDate = moment().format('YYYY-MM-DD');
|
|
|
this.getStation();
|
|
|
+ this.getCurrentSchedule();
|
|
|
},
|
|
|
watch: {
|
|
|
'taskData': {
|
|
@@ -366,8 +377,7 @@ export default {
|
|
|
return this.$store.state.account.user;
|
|
|
},
|
|
|
},
|
|
|
- mounted() {
|
|
|
- //setInterval(this.getStation, 2000);
|
|
|
+ mounted() {
|
|
|
this.timerTask()
|
|
|
},
|
|
|
methods: {
|
|
@@ -433,10 +443,11 @@ export default {
|
|
|
this.currentStationName = this.options[0].name
|
|
|
taskMgrApi.getStationTasks({ resourceId : this.currentStationId,type : "0" }).then((res) => {
|
|
|
res = res.data;
|
|
|
- if (res.isSuccess) {
|
|
|
- // if (res.data.length > 0) {
|
|
|
+ if (res.isSuccess) {
|
|
|
this.taskData = res.data;
|
|
|
- // }
|
|
|
+ if(this.taskData.length>0){
|
|
|
+ this.currentOrderId = this.taskData[0].orderId
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -474,15 +485,44 @@ export default {
|
|
|
resolveLogo(logo) {
|
|
|
return require(`@/assets/yunMap/${logo}`);
|
|
|
},
|
|
|
+ getCurrentSchedule() {
|
|
|
+ stationMgrApi.getCurrentSchedule({ userId: this.$store.state.account.user.id, date: this.currentDate })
|
|
|
+ .then((res) => {
|
|
|
+ res = res.data;
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.assignTask = res.data
|
|
|
+ }else{
|
|
|
+ this.hasTask = false
|
|
|
+ }
|
|
|
+ }).catch(()=>{ });
|
|
|
+ },
|
|
|
+ checkAssign(){
|
|
|
+ if(!this.hasTask){
|
|
|
+ this.$message({
|
|
|
+ message: "今天没有加工任务",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if(!this.assignTask.startTime){
|
|
|
+ this.$message({
|
|
|
+ message: "确认是否未打卡",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return this.navigator();
|
|
|
+ }
|
|
|
+ if(this.assignTask.endTime){
|
|
|
+ this.$message({
|
|
|
+ message: "下班打卡已经完成",
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
view (item) {
|
|
|
- // let that = this;
|
|
|
- // let current = that.options.filter(function (c, i, a) {
|
|
|
- // if (c.value == that.currentStationId) {
|
|
|
- // return c
|
|
|
- // }
|
|
|
- // })
|
|
|
- // item.procedurePosition = current[0].name;
|
|
|
- // 只有开始中的页面可以点击进入详情页面操作
|
|
|
+ if(item.synFlag=="1" && !this.checkAssign()) return false
|
|
|
+
|
|
|
console.log("开始")
|
|
|
item.currentStationName = this.currentStationName
|
|
|
if(item.exeStatus === '2' && item.interfaceType === '04' && item.step=="1"){
|
|
@@ -589,7 +629,7 @@ export default {
|
|
|
},
|
|
|
navigator() {
|
|
|
this.$store.dispatch('tagsView/delView', this.$route).then(res => {
|
|
|
- this.$router.push({ path: '/machiningClient/scheduleTask', query: {userId: this.$store.state.account.user.id}}) //带参跳转
|
|
|
+ this.$router.push({ path: '/machiningClient/scheduleTask', query: {userId: this.$store.state.account.user.id, orderId:this.currentOrderId}}) //带参跳转
|
|
|
})
|
|
|
},
|
|
|
},
|