2022-03-17 12:30:12 +00:00
< template >
2022-03-30 01:04:25 +00:00
< view class = "content" >
< status -nav navBarTitle = "工单列表" returnColor = "#c2c2c2" > < / s t a t u s - n a v >
< container -subgroup -two >
< view slot = "content" style = "margin: -25rpx -25rpx -0rpx;" >
< view class = "project-list-input" : style = "{top:statusBarHeight + 'px'}" >
2022-04-02 12:08:56 +00:00
< input type = "text" @keydown.enter ="getDatalist" @confirm ="getDatalist" class = "int" v -model = " dataPage.keyword " value = "" placeholder = "请输入关键字" / >
< image @click ="getDatalist" class = "search" src = "../../static/iocn/ss.png" mode = "" > < / image >
2022-03-30 01:04:25 +00:00
< view class = "xian" > < / view >
< / view >
< view class = "screen" >
2022-03-30 08:22:44 +00:00
<!-- 筛选状态查询 、 日期查询 -- >
2022-04-02 12:08:56 +00:00
< picker class = "width30 disjcac" @change ="bindPickerChange" :value ="workeOrderStatusIndex" :range ="array" :range-key ="'name'" >
2022-03-30 01:04:25 +00:00
< view class = "li" >
< view class = "text" v-if ="workeOrderStatus!=''" > {{ workeOrderStatus }} < / view >
2022-03-31 06:19:26 +00:00
< view class = "text" v-else > {{ array [ workeOrderStatusIndex ] .name }} < / view >
2022-03-30 01:04:25 +00:00
< image class = "img" src = "../../static/iocn/xla.png" mode = "aspectFill" > < / image >
< / view >
< / picker >
2022-04-02 12:08:56 +00:00
< picker class = "width30 disjcac" mode = "date" :value ="date" @change ="bindDateChange" >
2022-03-30 01:04:25 +00:00
< view class = "li" >
2022-04-02 12:08:56 +00:00
< view class = "text" v-if ="dataPage.order_times==''" > 工 单 日 期 < / view >
< view class = "text" v-else > {{ dataPage.order_times }} < / view >
2022-03-30 01:04:25 +00:00
< image class = "img" src = "../../static/iocn/xla.png" mode = "aspectFill" > < / image >
< / view >
< / picker >
2022-04-02 12:08:56 +00:00
< view class = "li width30 disjcac" >
2022-03-30 01:04:25 +00:00
< view class = "text" > 筛选 < / view >
< image class = "imgA" src = "../../static/iocn/sx.png" mode = "aspectFill" > < / image >
< / view >
< / view >
< view class = "project-list" >
2022-03-30 08:22:44 +00:00
<!-- 列表循环体 -- >
2022-04-06 08:05:38 +00:00
< view class = "li" @click ="projectDetailsFun(item.order_status,item.order_id,item.attributes.text,item.attributes.color)" v-for ="(item,index) in dataList" :key ="index" >
2022-03-31 06:19:26 +00:00
< view class = "work-order-code" > 工单编号 : { { item . order _number } } < / view >
2022-03-30 01:04:25 +00:00
< view class = "message" >
< image class = "img" src = "../../static/del/img001.png" mode = "aspectFill" > < / image >
< view class = "text" >
< view class = "title" >
2022-03-31 06:19:26 +00:00
< view class = "text clips1" > { { item . project _name } } < / view >
2022-04-02 12:08:56 +00:00
< view class = "icon" : style = "{backgroundColor: item.attributes.color}" > { { item . attributes . text } } < / view >
2022-03-30 01:04:25 +00:00
< / view >
< view class = "disjb fc" style = "margin-left: -20rpx;height: 70%;" >
< view class = "serial-number scal09" >
2022-03-31 06:19:26 +00:00
< view class = "type" > # { { item . fault _type } } # < / view >
< view class = "date" > { { item . failure _time } } < / view >
2022-03-30 01:04:25 +00:00
< / view >
< view class = "specification scal09" >
2022-04-06 08:05:38 +00:00
紧急程度 : < view class = "text" > { { item . emergency _level _view } } < / view >
2022-03-30 01:04:25 +00:00
< / view >
2022-04-06 08:05:38 +00:00
< view class = "specification scal09" > 主负责人 : { { item . principal } } < / view >
< view class = "installation-site scal09 clips1" style = "margin-bottom: -10rpx;" > 故障描述 : { { item . failure _description } } < / view >
2022-03-30 01:04:25 +00:00
< / view >
< / view >
< / view >
< view class = "project-list-address" >
< view class = "address clips2" >
< image class = "img" src = "../../static/iocn/dz2.png" mode = "aspectFill" > < / image >
< view class = "text" > { { item . address } } < / view >
< / view >
2022-03-30 08:22:44 +00:00
<!-- 订单不等于已完成和待回访 , 并且访问人不是工程师 -- >
< view @tap.stop ="hurryUpEv(item.id)" class = "date" v-if ="item.status!=8 && item.status!=9 && role!=4" >
2022-03-30 01:04:25 +00:00
催一催 < image class = "img" src = "../../static/iocn/ld.png" mode = "" > < / image >
< / view >
< / view >
< / view >
< / view >
2022-04-06 08:05:38 +00:00
< nothing -page v-if ="dataList.length==0" content="暂无更多列表数据" currentType="0" > < / nothing -page >
2022-03-30 01:04:25 +00:00
< / view >
< / c o n t a i n e r - s u b g r o u p - t w o >
< / view >
2022-03-17 12:30:12 +00:00
< / template >
< script >
2022-03-30 01:04:25 +00:00
import containerSubgroupTwo from '@/components/containers/container-subgroup-two.vue' ;
import statusNav from '../../components/status-nav.vue' ;
import footTabOne from "../../components/foot-tabs/foot-tab-one.vue"
export default {
components : {
footTabOne ,
statusNav ,
containerSubgroupTwo
} ,
data ( ) {
const currentDate = this . getDate ( {
format : true
} )
return {
statusBarHeight : uni . getSystemInfoSync ( ) . statusBarHeight + 40 ,
2022-04-06 08:05:38 +00:00
role : uni . getStorageSync ( 'type_id' ) , // 1: 业务员 2:表示客户 3:表示客服 4: 表示工程师
2022-03-30 01:04:25 +00:00
date : currentDate ,
workeOrderStatus : '工单状态' ,
array : [
2022-03-31 06:19:26 +00:00
2022-03-30 01:04:25 +00:00
] ,
workeOrderStatusIndex : 0 ,
2022-03-31 03:15:53 +00:00
dataPage : {
list _rows : 10 ,
page : 1 ,
2022-04-02 12:08:56 +00:00
order _status : "" ,
order _times : "" ,
keyword : ""
2022-03-31 03:15:53 +00:00
} ,
2022-04-02 12:08:56 +00:00
total : 0 ,
2022-04-06 08:05:38 +00:00
dataList : [ ] ,
statusId : 0
2022-03-30 01:04:25 +00:00
}
} ,
2022-04-06 08:05:38 +00:00
onLoad ( op ) {
if ( op . statusId != undefined ) this . statusId = op . statusId ;
2022-04-01 01:26:49 +00:00
// 调用获取工单状态事件
2022-04-06 08:05:38 +00:00
this . getType ( ) ;
2022-04-01 02:59:01 +00:00
2022-03-30 01:04:25 +00:00
} ,
methods : {
2022-04-01 01:26:49 +00:00
// 获取工单状态
2022-04-06 08:05:38 +00:00
getType ( ) {
2022-04-01 02:59:01 +00:00
this . $requst . get ( '/universal/api.order/order_type' ) . then ( res => {
2022-03-31 03:15:53 +00:00
// this.$toolAll.tools.showToast(res.msg);
2022-04-01 01:26:49 +00:00
if ( res . code ) {
2022-03-31 06:19:26 +00:00
this . array = [ ... res . data ]
2022-04-01 02:59:01 +00:00
// 调用获取工单列表事件
2022-04-06 08:05:38 +00:00
if ( this . statusId ) {
this . workeOrderStatusIndex = this . array . findIndex ( item => item . id == this . statusId ) ;
2022-04-01 02:59:01 +00:00
if ( this . workeOrderStatusIndex != - 1 ) this . workeOrderStatus = '' ;
}
this . getDatalist ( ) ;
2022-03-31 03:15:53 +00:00
}
} )
} ,
2022-04-01 01:26:49 +00:00
// 获取工单列表
2022-03-31 03:15:53 +00:00
getDatalist ( ) {
2022-03-31 06:19:26 +00:00
this . $requst . get ( '/universal/api.order/order_list' , this . dataPage ) . then ( res => {
2022-04-01 01:26:49 +00:00
if ( res . code ) {
2022-04-02 12:08:56 +00:00
this . total = res . data . total ;
this . dataList = res . data . data ;
2022-03-31 03:15:53 +00:00
}
} )
} ,
2022-03-30 08:22:44 +00:00
// 催一催事件
hurryUpEv ( id ) {
this . $toolAll . tools . showToast ( ` 已催单成功 ` ) ;
} ,
// 查看工单详情和进入接单页面
projectDetailsFun ( status , id , statusText , statusColor ) {
2022-04-06 08:05:38 +00:00
if ( uni . getStorageSync ( 'type_id' ) == 4 && status == 2 ) {
2022-03-30 08:22:44 +00:00
// 工程师点击待接单工单
uni . showModal ( {
cancelText : '取消' ,
cancelColor : '#999999' ,
confirmColor : '#03affb' ,
confirmText : '确认' ,
content : '确认接单' ,
success : ( res ) => {
if ( res . confirm ) {
2022-04-06 08:05:38 +00:00
this . $requst . post ( '/universal/api.order/accept_order' , { order _id : id , is _order : 1 } ) . then ( res => {
if ( res . code ) {
this . $toolAll . tools . showToast ( '接单成功' ) ;
setTimeout ( ( ) => {
uni . navigateTo ( {
url : ` /pages/workOrder/workOrder?id= ${ id } `
} )
} , 1000 )
}
2022-03-30 08:22:44 +00:00
} )
}
}
2022-03-30 01:04:25 +00:00
} )
} else {
2022-03-30 08:22:44 +00:00
// 客户、客服、业务员、工程师点击查看详情
2022-03-30 01:04:25 +00:00
uni . navigateTo ( {
2022-03-30 08:22:44 +00:00
url : ` /pages/workOrder/details?id= ${ id } &status= ${ status } &statusText= ${ statusText } &statusColor= ${ statusColor } `
2022-03-30 01:04:25 +00:00
} )
}
} ,
bindPickerChange ( data ) {
2022-03-31 03:15:53 +00:00
2022-03-30 01:04:25 +00:00
this . workeOrderStatus = '' ;
this . workeOrderStatusIndex = data . detail . value ;
2022-03-31 06:19:26 +00:00
console . log ( data . detail . value )
this . dataPage . order _status = this . array [ data . detail . value ] . id - 0
this . getDatalist ( )
2022-03-30 01:04:25 +00:00
} ,
bindDateChange ( date ) {
2022-03-31 06:19:26 +00:00
this . dataPage . order _times = date . detail . value
2022-04-02 12:08:56 +00:00
this . getDatalist ( )
2022-03-30 01:04:25 +00:00
} ,
getDate ( type ) {
const date = new Date ( ) ;
let year = date . getFullYear ( ) ;
let month = date . getMonth ( ) + 1 ;
let day = date . getDate ( ) ;
if ( type === 'start' ) {
year = year - 60 ;
} else if ( type === 'end' ) {
year = year + 2 ;
}
month = month > 9 ? month : '0' + month ;
day = day > 9 ? day : '0' + day ;
console . log ( year , month , day )
return ` ${ year } - ${ month } - ${ day } ` ;
}
}
}
2022-03-17 12:30:12 +00:00
< / script >
< style scoped >
2022-03-30 01:04:25 +00:00
page {
background - color : # F7F7F7 ;
}
2022-03-18 09:57:22 +00:00
2022-03-25 10:33:33 +00:00
2022-03-25 03:41:31 +00:00
. project - list - input . xian {
width : 3 rpx ;
height : 35 rpx ;
position : absolute ;
2022-03-30 01:04:25 +00:00
background - color : # EAEAEA ;
2022-03-25 03:41:31 +00:00
right : 100 rpx ;
top : 50 % ;
margin - top : - 14 rpx ;
}
2022-03-30 01:04:25 +00:00
. project - list - input {
width : 100 % ;
height : 114 rpx ;
position : fixed ;
z - index : 2 ;
padding : 20 rpx 16 rpx ;
box - sizing : border - box ;
background - color : # FFFFFF
}
. project - list - input . int {
width : 100 % ;
height : 100 % ;
background - color : # F7F7F7 ;
padding : 0 25 rpx ;
box - sizing : border - box ;
border - radius : 36 rpx ;
}
. project - list - input . search {
width : 28 rpx ;
height : 28 rpx ;
position : absolute ;
right : 43 rpx ;
top : 50 % ;
margin - top : - 14 rpx ;
}
. screen {
display : flex ;
justify - content : space - around ;
padding : 25 rpx 20 rpx ;
border - bottom : 2 rpx solid # E6E6E6 ;
border - top : 2 rpx solid # E6E6E6 ;
margin : 20 rpx 0 rpx ;
margin - top : 57 px ;
}
. screen . li {
display : flex ;
align - items : center ;
}
. screen . li . text {
font - size : 32 rpx ;
color : # 333333 ;
margin - right : 10 rpx ;
}
. screen . li . img {
width : 14 rpx ;
height : 8 rpx ;
position : relative ;
z - index : 1 ;
}
. screen . li . imgA {
width : 24 rpx ;
height : 23 rpx ;
}
. project - list . li {
width : 710 rpx ;
box - sizing : border - box ;
background - color : # FFFFFF ;
position : relative ;
margin : auto ;
margin - bottom : 20 rpx ;
padding : 33 rpx 23 rpx ;
}
. project - list . li . iconBer {
background - image : url ( . . / . . / static / iocn / za . png ) ;
}
. project - list . li . iconBera {
background - image : url ( . . / . . / static / iocn / zaa . png ) ;
}
. project - list . li . message {
display : flex ;
}
. project - list . li . message . img {
width : 230 rpx ;
margin - right : 11 rpx ;
height : 180 rpx ;
}
. project - list . li . message . text {
flex : 1 ;
}
. project - list . li . message . text . title {
display : - webkit - box ;
- webkit - box - orient : vertical ;
- webkit - line - clamp : 1 ;
overflow : hidden ;
text - overflow : ellipsis ;
word - wrap : break - word ;
word - break : break - all ;
margin - bottom : 5 rpx ;
font - size : 24 rpx ;
display : flex ;
align - items : center ;
line - height : 29 rpx ;
color : # 333333 ;
font - weight : bold ;
}
. project - list . li . message . text . title . text {
width : 60 % ;
}
. project - list . li . message . text . title . icon {
font - size : 24 rpx ;
width : 120 rpx ;
height : 40 rpx ;
background - color : # ff5400 ;
border - radius : 50 rpx ;
color : # FFFFFF ;
text - align : center ;
line - height : 40 rpx ;
}
. project - list . li . message . text . title . icon1 {
background - color : # 00 a2e9 ;
}
. project - list . li . message . text . title . icon3 {
background - color : # 009 a44 ;
}
. project - list . li . message . serial - number {
color : # 9 b9ba3 ;
font - size : 24 rpx ;
margin - bottom : 10 rpx ;
line - height : 24 rpx ;
display : flex ;
}
. project - list . li . message . serial - number . type {
margin - right : 60 rpx ;
}
. project - list . li . message . specification {
color : # 9 b9ba3 ;
font - size : 24 rpx ;
margin - bottom : 10 rpx ;
display : flex ;
line - height : 24 rpx ;
}
. project - list . li . message . specification . text {
color : # e90000 ;
}
. project - list . li . message . installation - site {
color : # 9 b9ba3 ;
font - size : 24 rpx ;
2022-04-06 08:05:38 +00:00
/* line-height: 24rpx; */
2022-03-30 01:04:25 +00:00
}
. project - list - address {
display : flex ;
margin - top : 15 rpx ;
color : # 9 b9ba3 ;
align - items : center ;
justify - content : space - between ;
width : 100 % ;
}
. project - list - address . text {
font - size : 22 rpx ;
flex : 1 ;
}
. project - list - address . date {
font - size : 24 rpx ;
text - align : right ;
margin - left : 20 rpx ;
align - items : center ;
display : flex ;
color : # e90000 ;
}
. project - list - address . date . img {
width : 26 rpx ;
height : 24 rpx ;
margin - left : 5 rpx ;
}
. project - list - address . address . img {
width : 22 rpx ;
height : 30 rpx ;
margin - right : 10 rpx ;
}
. project - list - address . address {
display : flex ;
align - items : center ;
width : 80 % ;
}
. project - list . work - order - code {
font - size : 24 rpx ;
color : # 9 b9ba3 ;
margin - bottom : 26 rpx ;
}
. pickerDate {
width : 300 rpx ;
height : 300 rpx ;
}
2022-03-17 12:30:12 +00:00
< / style >