main
liudan 1 year ago
parent 612a2c1952
commit 43279616cd
  1. 16
      .hbuilderx/launch.json
  2. 17
      pages.json
  3. 223
      pages/allprocess/allprocess.vue
  4. 2
      pages/processList/processList.vue
  5. 80
      pages/taskList/taskList.vue
  6. BIN
      static/t3.png
  7. BIN
      static/t33.png

@ -0,0 +1,16 @@
{ // launch.json configurations app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtypelocalremote, localremote
"version": "0.0",
"configurations": [{
"app-plus" :
{
"launchtype" : "local"
},
"default" :
{
"launchtype" : "local"
},
"type" : "uniCloud"
}
]
}

@ -50,6 +50,17 @@
"navigationStyle": "custom"
}
},
{
"path" : "pages/allprocess/allprocess",
"style" :
{
"navigationBarTitleText": "工序",
"enablePullDownRefresh": false,
"navigationStyle": "custom",
"onReachBottomDistance": 100
}
}
],
"globalStyle": {
@ -81,6 +92,12 @@
"text": "待检测",
"iconPath": "static/t2.png",
"selectedIconPath": "static/t22.png"
},
{
"pagePath": "pages/allprocess/allprocess",
"text": "工序",
"iconPath": "static/t33.png",
"selectedIconPath": "static/t3.png"
}
]
}

@ -0,0 +1,223 @@
<template>
<view class="taskList">
<!-- -->
<u-navbar
title="工序"
:safeAreaInsetTop="false"
>
<view class="u-nav-slot" slot="right" @click="show = true">
...
</view>
</u-navbar>
<u-popup :show="show" mode="center" @close="close">
<view>
<u-button type="primary" size="small" text="切换账号" @click="changeUser"></u-button>
</view>
</u-popup>
<view v-if="progressList.length!=0" style="margin-top:44px;">
<view class="taskItem" v-for="(item,index) in progressList" :key="index">
<!-- <view class="title">工序号{{index+1}}</view> -->
<view class="item">
<view class=" rowItem">
<!-- <view>
工序号{{index+1}}
</view> -->
<view>
名称{{item.name}}
</view>
</view>
<view class="code rowItem">
<view>
编码{{info.code?info.code:'-'}}
</view>
<view class="right">
数量{{item.num}}
</view>
</view>
<view class="rowItem">
<view :class="item.status == 1?'status unfinish right':item.status == 2?'status right':'status right finish'">
状态<text>{{ item.status == 1 ? '未完成' : (item.status == 2 ? '进行中' : '已完成')}}</text>
</view>
<view class="lookdetails right" @click="goProgress(item)" v-if="item.is_info == 1&&item.is_start == 1">
开始
</view>
</view>
</view>
</view>
</view>
<view v-else class="empty-list">
<view class="empty-list-content">
<image src="/static/list-empty.png"></image>
<p class="empty-list-text">暂无数据</p>
</view>
</view>
</view>
</template>
<script>
import {getList,logout} from "@/api/user.js"
export default {
data() {
return {
pageNum:1,
pageSize:5,
progressList:[],//
allList:[],
show:false,
info:{},
total:0
};
},
methods:{
leftClick(){
uni.reLaunch({
url:'/pages/taskList/taskList'
})
},
close() {
this.show = false
},
getData(){
getList({task_id:this.info.id}).then(res=>{
this.allList = res.data.list
this.total = res.data.total;
this.progressList = this.allList.slice(this.pageNum-1,this.pageSize)
})
},
changeUser(){
logout().then(res=>{
console.log(res)
uni.redirectTo({
url: '/pages/login/login'
})
uni.removeStorage({
key: 'userToken'
})
this.$store.commit('logout')
})
},
goProgress(item){
uni.navigateTo({
url:'/pages/taskDetail/taskDetail?id='+item.id + '&status='+item.status + '&is_start='+ item.is_start +'&heat_num=' +this.info.heat_num +'&taskId='+this.info.id+'&code='+this.info.code
})
}
},
onLoad(option) {
if(uni.getStorageSync('userToken')){
console.log("已登录",option);
this.info = option
this.getData()
}else{
uni.redirectTo({
url:'/pages/login/login'
})
}
},
//
onReachBottom() {
if(this.progressList.length<this.total){
this.pageNum ++
if(this.progressList.length<this.total){
let progressList = this.allList.slice((this.pageNum-1)*this.pageSize,this.pageNum*this.pageSize)
this.progressList.push(...progressList)
}
}
}
}
</script>
<style lang="scss">
/deep/.u-popup__content{
border-radius:20upx;
padding:50upx 70upx;
}
.taskList{
min-height: calc(100vh);
background-color: #F7F8FA;
.taskItem{
background: #FFFFFF;
box-shadow: 0upx 4upx 13upx 0upx rgba(17,21,38,0.06);
padding:30upx 25upx;
margin-bottom:20upx;
.title{
font-size: 36upx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #333333;
}
.item{
background: #F6F6F6;
border-radius: 4upx;
padding:25upx 20upx;
// margin-top:30upx;
.rowItem{
margin-bottom:25upx;
display: flex;
justify-content: space-between;
align-items: center;
}
.code{
font-size: 28upx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #333333;
}
.right{
width:171upx;
}
.num{
font-size: 28upx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #0DC0F4;
}
.status{
font-size: 28upx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #333333;
text{
color:#FFAD0F;
}
}
.unfinish{
text{
color:red !important;
}
}
.finish{
color:#0DC0F4 !important;
text{
color:green !important;
}
}
.planTime{
font-size: 24upx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #999999;
}
.lookdetails{
font-size: 24upx;
font-family: Alibaba PuHuiTi;
font-weight: 400;
color: #0076F6;
}
}
}
.empty-list{
padding-top:20%;
text-align: center;
}
}
</style>

@ -159,7 +159,7 @@
background: #F6F6F6;
border-radius: 4upx;
padding:25upx 20upx;
margin-top:30upx;
// margin-top:30upx;
.rowItem{
margin-bottom:25upx;
display: flex;

@ -14,7 +14,55 @@
<u-button type="primary" size="small" text="切换账号" @click="changeUser"></u-button>
</view>
</u-popup>
<view v-if="taskList.length!=0" style="margin-top:44px;">
<view style="margin-top:44px;background-color: #ffffff;">
<u-tabs :list="list1" @click="tabClick"
lineColor="#0076F6"
:activeStyle="{
color: '#0076F6'
}"></u-tabs>
</view>
<view v-if="taskListFinish.length!=0" style="margin-top:20rpx;">
<!-- v-for="(item,index) in taskList" :key="index" -->
<view class="taskItem">
<!-- <view class="title">机器编号{{item.name}}</view> -->
<view class="item" v-for="i in taskListFinish" :key="i.id">
<view class="rowItem">
<view class="num">
炉号{{i.heat_number?i.heat_number:'-'}}
</view>
<view :class="i.status == 1?'status right':'status right finish'">
状态<text>{{i.status == 1 ? '未完成' : '已完成'}}</text>
</view>
</view>
<view class="code rowItem">
编号{{i.art_number}}
</view>
<view class="code rowItem">
当前工序{{i.procedure}}
</view>
<view class="code rowItem">
<view>
数量{{i.total}}
</view>
<view class="right">
面次{{i.face}}
</view>
</view>
<view class="rowItem">
<view class="planTime">
计划完成时间{{i.real_time ? i.real_time : '-'}}
</view>
<view class="lookdetails right" @click="goProgress(i)">
查看详情
</view>
</view>
<view class="planTime rowItem">
备注{{i.remake}}
</view>
</view>
</view>
</view>
<!-- <view v-if="taskList.length!=0" style="margin-top:20rpx;">
<view class="taskItem" v-for="(item,index) in taskList" :key="index">
<view class="title">机器编号{{item.name}}</view>
<view class="item" v-for="i in item.list" :key="i.id">
@ -53,7 +101,7 @@
</view>
</view>
</view>
</view>
</view> -->
<view v-else class="empty-list">
<view class="empty-list-content">
<image src="/static/list-empty.png"></image>
@ -70,17 +118,36 @@
data() {
return {
taskList:[],
show:false
show:false,
list1:[],
taskListFinish:[]
};
},
methods:{
tabClick(val){
console.log(val.name.substr(5))
if(val){
let str = val.name.substr(5);
let arr = this.taskList.filter(item=>{
if(str.indexOf(item.name)!=-1){
return item
}
})
this.taskListFinish =arr[0].list
}
},
close() {
this.show = false
},
getData(){
getTaskList().then(res=>{
console.log(res,"000")
this.taskList = res.data
this.taskList = res.data;
let arr = res.data;
this.taskListFinish = res.data[0].list
arr.forEach(item=>{
this.list1.push({name:'机器编号:'+item.name+'#'})
})
})
},
changeUser(){
@ -136,6 +203,9 @@
font-weight: 400;
color: #333333;
}
&>:first-child{
margin-top:0upx !important;
}
.item{
background: #F6F6F6;
border-radius: 4upx;

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Loading…
Cancel
Save