@ -16,62 +16,128 @@
< / view >
< / u - p o p u p >
< view v-if ="taskList.length!=0" style="margin-top:44px;" >
< 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" >
< view class = "rowItem" >
< view class = "taskItem" v-for ="(i,index) in taskList" :key ="index" >
< view class = "item" >
< view class = "code rowItem" >
< view >
炉号 : { { i . heat _number } }
< / view >
< view >
任务编号 : { { i . art _number } }
< / view >
< / view >
< view class = "rowItem code" >
< view class = "num" >
炉号 : { { i . heat _number ? i . heat _number : '-' } }
待质检数 : { { i . num } }
< / view >
< view >
员工 : { { i . username } }
< / view >
< view : class = "i.status == 1?'status right':'status right finish'" >
状态 : < text > { { i . status == 1 ? '未完成' : '已完成' } } < / text >
< / view >
< view class = "rowItem" >
< view class = "num" style = "color:#E03023" >
注意事项 : { { i . needing _remake ? i . needing _remake : '-' } }
< / view >
< view class = "code rowItem" >
编号 : { { i . art _number } }
< / view >
< view class = "code rowItem" >
< view class = "num" >
附件 : < text @click ="downLoad(i)" style = "color:#0076F6;text-decoration: underline;margin-left:10upx;" > 查看 < / text >
< / view >
< view >
数量 : { { i . total } }
数量 : < text > { { i . total } } < / text >
< / view >
< / view >
< view class = "right" >
面次 : { { i . face } }
< view class = "code rowItem" style = "color:#E03023" v-for ="(p,r) in i.content" :key ="r" >
< view >
{ { p . key } }
< / view >
< view >
{ { p . value } }
< / view >
< view class = "rowItem" >
< view class = "planTime" >
计划完成时间 : { { i . real _time ? i . real _time : '-' } }
< / view >
< view class = "lookdetails right" @click ="goProgress(i) " >
<!-- 查看详情 -- > 检测
< view class = "code rowItem" v-if ="i.rejects!='null'" >
不良品 : { { i . rejects } }
< / view >
< view class = "code rowItem" >
< view >
不良品数量 : { { i . rejects _num } }
< / view >
< view class = "lookdetails" v-if ="isCheck==2" @click="checkHandle(i)" >
检测
< / view >
< view class = "planTime rowItem" >
备注 : { { i . remake } }
< / 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 >
< u -modal :show ="checkDialog" class = "checkDialog"
: showCancelButton = "true"
confirmText = "确认检测"
@ confirm = "confirmHandle"
@ cancel = "checkDialog=false"
title = "检测" >
< view class = "slot-content" >
< text > 合格数 < / text >
< u - -input
placeholder = "请输入内容"
border = "surround"
v - model = "qualified_num"
> < / u - - i n p u t >
< / view >
< / u - m o d a l >
< / view >
< / template >
< script >
import { checkList , logout } from "@/api/user.js"
import { checkList , logout , procedureCheckHandle } from "@/api/user.js"
export default {
data ( ) {
return {
taskList : [ ] ,
show : false
show : false ,
isCheck : 0 ,
checkDialog : false ,
qualified _num : '' ,
selectedId : null
} ;
} ,
methods : {
checkHandle ( i ) {
console . log ( i )
this . selectedId = i . id ;
this . checkDialog = true
} ,
confirmHandle ( ) {
if ( ! this . qualified _num ) {
uni . showToast ( {
icon : 'none' ,
mask : true ,
title : '请输入合格数'
} ) ;
return ;
}
procedureCheckHandle ( { id : this . selectedId , num : this . qualified _num } ) . then ( res => {
if ( code == 200 ) {
this . getData ( )
} else {
uni . showToast ( {
icon : 'none' ,
mask : true ,
title : res . msg
} ) ;
}
} )
} ,
close ( ) {
this . show = false
} ,
@ -79,6 +145,7 @@
checkList ( ) . then ( res => {
console . log ( res )
this . taskList = res . data . list
this . isCheck = res . data . is _check
} )
} ,
changeUser ( ) {
@ -93,6 +160,48 @@
this . $store . commit ( 'logout' )
} )
} ,
downLoad ( item ) {
console . log ( item )
if ( item . file _suffix == 'png' ) {
uni . previewImage ( {
urls : [ item . path ]
} )
} else {
uni . downloadFile ( {
url : item . path ,
success : ( data ) => {
if ( data . statusCode === 200 ) {
uni . saveFile ( {
tempFilePath : data . tempFilePath ,
success : function ( res ) {
uni . showToast ( {
icon : 'none' ,
mask : true ,
title : '文件已保存' + res . savedFilePath ,
duration : 3000
} ) ;
setTimeout ( ( ) => {
uni . openDocument ( {
filePath : res . savedFilePath ,
success : function ( res ) {
console . log ( '文档打开成功' )
}
} )
} , 3000 )
}
} )
}
} ,
fail : ( ) => {
uni . showToast ( {
icon : 'none' ,
mask : true ,
title : '失败请重新下载'
} )
}
} ) ;
}
} ,
goProgress ( item ) {
/ / u n i . n a v i g a t e T o ( {
/ / u r l : ' / p a g e s / p r o c e s s L i s t / p r o c e s s L i s t ? i d = ' + i t e m . i d + ' & c o d e = ' + i t e m . a r t _ n u m b e r
@ -110,6 +219,17 @@
border - radius : 20 upx ;
padding : 50 upx 70 upx ;
}
. checkDialog / deep / . u - popup _ _content {
padding : 0 ! important ;
}
. slot - content {
display : flex ;
align - items : center ;
text {
margin - right : 20 upx ;
color : # 333333
}
}
. taskList {
min - height : calc ( 100 vh - 100 upx ) ;
background - color : # F7F8FA ;
@ -128,7 +248,7 @@
background : # F6F6F6 ;
border - radius : 4 upx ;
padding : 25 upx 20 upx ;
margin - top : 30 upx ;
/ / m a r g i n - t o p : 3 0 u p x ;
. rowItem {
margin - bottom : 25 upx ;
display : flex ;
@ -169,10 +289,11 @@
color : # 999999 ;
}
. lookdetails {
font - size : 24 upx ;
font - size : 28 upx ;
font - family : Alibaba PuHuiTi ;
font - weight : 400 ;
color : # 0076 F6 ;
text - decoration : underline ;
}
}
}
@ -184,4 +305,5 @@
/deep/ . u - navbar _ _content _ _left {
display : none ;
}
< / style >