<template>
|
<view class="content">
|
<!-- <view class="form">
|
<view class="form-item">
|
<view class="title">设备编号:</view>
|
<view class="right">
|
<input v-model="hform.HNumber" placeholder="请输入设备编号" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">设备名称:</view>
|
<view class="right">
|
<input v-model="hform.HName" placeholder="请输入设备名称" />
|
</view>
|
</view>
|
</view> -->
|
|
<!-- <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view> -->
|
|
<view class="tabs">
|
<view :class="tabs == 0 ? 'on':''" @tap="changeTab(0)">全部</view>
|
<view :class="tabs == 1 ? 'on':''" @tap="changeTab(1)">运行</view>
|
<view :class="tabs == 2 ? 'on':''" @tap="changeTab(2)">待机</view>
|
<view :class="tabs == 3 ? 'on':''" @tap="changeTab(3)">停机</view>
|
</view>
|
|
<view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
|
|
<view class="list" v-for="(item,index) in showList" :key="index">
|
<uni-card style="margin: 10px;" @tap="toList(item)">
|
<view class="card-main">
|
<image src="../../static/sb.png" mode=""></image>
|
<view class="right">
|
<view class="detail" v-if="item.HSourceName">
|
<text>设备编号:</text>{{item.HSourceName}}
|
</view>
|
<view class="detail" v-if="item.HSourceNumber">
|
<text>设备代码:</text>{{item.HSourceNumber}}
|
</view>
|
<view class="detail" v-if="item.HUserName">
|
<text>操作员:</text>{{item.HUserName}}
|
</view>
|
<view class="detail" v-if="item.GroupName">
|
<text>生产班组:</text>{{item.GroupName}}
|
</view>
|
<view class="detail" v-if="item.HEmpName">
|
<text>负责人:</text>{{item.HEmpName}}
|
</view>
|
</view>
|
<view class="op">
|
<view class="op5" v-if="item.HStatus == '空闲'">
|
<uni-icons type="smallcircle-filled" size="14" color=""></uni-icons><text>{{item.HStatus}}</text>
|
</view>
|
<view class="op3" v-if="item.HStatus == '开机'">
|
<uni-icons type="smallcircle-filled" size="14" color=""></uni-icons><text>{{item.HStatus}}</text>
|
</view>
|
<view class="op4" v-if="item.HStatus == '停机'">
|
<uni-icons type="smallcircle-filled" size="14" color=""></uni-icons><text>{{item.HStatus}}</text>
|
</view>
|
<view class="op1" v-if="item.HStatus == '生产'">
|
<uni-icons type="smallcircle-filled" size="14" color=""></uni-icons><text>{{item.HStatus}}</text>
|
</view>
|
<view class="op2" v-if="item.HStatus == '维修进行中'">
|
<uni-icons type="smallcircle-filled" size="14" color=""></uni-icons><text>{{item.HStatus}}</text>
|
</view>
|
<view class="op2" v-if="item.HStatus == '维修结束'">
|
<uni-icons type="smallcircle-filled" size="14" color=""></uni-icons><text>{{item.HStatus}}</text>
|
</view>
|
<view class="op2" v-if="item.HStatus == '维修终止'">
|
<uni-icons type="smallcircle-filled" size="14" color=""></uni-icons><text>{{item.HStatus}}</text>
|
</view>
|
</view>
|
</view>
|
<!-- <view class="card-detail" v-if="showDetail == index">
|
<view class="detail" v-if="moreData.HSourceBillNo">
|
<text>当前订单:</text>{{moreData.HSourceBillNo}}
|
</view>
|
<view class="detail" v-if="moreData.HMaterName">
|
<text>物料名称:</text>{{moreData.HMaterName}}
|
</view>
|
</view> -->
|
|
<!-- <view class="more" v-if="showDetail == index && operations != index">
|
<view class="part" style="border-right: 1px solid #eee;" @tap.stop="showMore(item,index)">
|
<uni-icons type="top" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>收起
|
</view>
|
<view class="part" @tap.stop="operations = operations==index?-1:index">
|
<uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>操作
|
</view>
|
</view>
|
<view class="more" v-if="showDetail != index && operations != index">
|
<view class="part" style="border-right: 1px solid #eee;" @tap.stop="showMore(item,index)">
|
<uni-icons type="bottom" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>更多信息
|
</view>
|
<view class="part" @tap.stop="operations = operations==index?-1:index">
|
<uni-icons type="more-filled" style="color: #888;margin-right: 10rpx;" size="14"></uni-icons>操作
|
</view>
|
</view> -->
|
|
<view class="op" v-if="operations == index">
|
<button class="op1" size="mini" plain @tap.stop="check(item)">开工</button>
|
<!-- <button class="op1" size="mini" plain @tap.stop="check(item)">完工</button>
|
<button class="op2" size="mini" plain @tap.stop="antiCheck(item)">停工</button> -->
|
<button class="op3" size="mini" plain @tap.stop="edit(item)">汇报</button>
|
<button class="op4" size="mini" plain @tap.stop="del(item)">异常申请</button>
|
<button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button>
|
</view>
|
</uni-card>
|
</view>
|
|
<view class="over" v-if="listData.length == 0">暂无数据</view>
|
<view class="over" v-if="listData.length != 0 && listData.length != showList.length">加载中...</view>
|
<view class="over" v-if="listData.length != 0 && listData.length == showList.length">已到底</view>
|
</view>
|
</template>
|
|
<script>
|
import { getUserInfo } from "@/utils/auth.js";
|
export default {
|
data() {
|
return {
|
userInfo:getUserInfo(),
|
serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
|
tabs:0,
|
status:'全部',
|
hform:{
|
HNumber:'',
|
HName:'',
|
},
|
sWhere:'',
|
listData:[],
|
moreData:[],
|
showList:[],
|
showDetail:-1,
|
operations:-1,
|
|
page:1,
|
}
|
},
|
onLoad() {
|
this.getList()
|
// console.log(this.userInfo,uni.getStorageSync('HUserName'))
|
},
|
onReachBottom: function() {
|
this.page++
|
setTimeout(() => {
|
this.showList = this.showList.concat(this.getPage(this.page,this.listData))
|
}, 100)
|
},
|
onPullDownRefresh: function() {
|
this.clear()
|
setTimeout(()=>{
|
uni.stopPullDownRefresh();
|
}, 1000);
|
},
|
methods: {
|
getPage(page,list){
|
let sindex = (parseInt(page) - 1) * 20
|
let eindex = parseInt(page) * 20
|
let newList = list.slice(sindex,eindex)
|
return newList
|
},
|
changeTab(e){
|
this.tabs = e
|
this.page = 1
|
this.showList = []
|
if(this.tabs == 0){
|
this.status = '全部'
|
this.getList()
|
// this.showList = this.getPage(this.page,this.listData)
|
}
|
if(this.tabs == 1){
|
this.status = '运行'
|
this.getList()
|
// this.showList = this.getPage(this.page,this.listData)
|
}
|
if(this.tabs == 2){
|
this.status = '待机'
|
this.getList()
|
// this.showList = this.getPage(this.page,this.listData)
|
}
|
if(this.tabs == 3){
|
this.status = '停机'
|
this.getList()
|
// this.showList = this.getPage(this.page,this.listData)
|
}
|
},
|
getList(){
|
// console.log(this.sWhere)
|
uni.showLoading({
|
title:'加载中...'
|
})
|
uni.request({
|
url: this.serverUrl + '/ReportPlatForm/SearchGetLineBindBillListStatus',
|
data:{
|
HStatus:this.status,
|
HUserName: uni.getStorageSync('HUserName')
|
},
|
success: (res) => {
|
console.log(1,res.data);
|
if(res.data.count == 1){
|
this.listData = res.data.data.h_p_JIT_GetSourceInfoByUser
|
console.log(this.listData.length)
|
this.showList = this.getPage(this.page,this.listData)
|
setTimeout(()=>{
|
uni.hideLoading()
|
}, 1000)
|
}else{
|
this.listData = []
|
uni.hideLoading()
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.hideLoading()
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//选择单据日期
|
BenginHCreateDateChange(e){
|
console.log(e.detail.value)
|
this.hform.BenginHCreateDate = e.detail.value
|
},
|
//选择单据日期
|
EndHCreateDateChange(e){
|
console.log(e.detail.value)
|
this.hform.EndHCreateDate = e.detail.value
|
},
|
//搜索
|
search(){
|
this.sWhere = ''
|
this.listData = []
|
this.page = 1
|
this.showList = []
|
|
console.log(this.hform)
|
if (this.hform.HNumber) {
|
this.sWhere += " and 设备代码 like '%" + this.hform.HNumber + "%'";
|
}
|
if (this.hform.HName) {
|
this.sWhere += " and 设备名称 like '%" + this.hform.HName + "%'";
|
}
|
|
this.getList()
|
},
|
//新增
|
creat(){
|
uni.navigateTo({
|
url:'/pages/shebeidangan/Gy_EquipFileMainBill'
|
})
|
},
|
//重置
|
clear(){
|
this.listData = []
|
this.page = 1
|
this.showList = []
|
|
this.sWhere = ''
|
this.showDetail = -1,
|
this.operations = -1,
|
this.hform = {
|
HNumber:'',
|
HName:'',
|
}
|
this.getList()
|
},
|
//更多
|
showMore(item,index){
|
this.showDetail = this.showDetail==index?-1:index
|
console.log(item)
|
uni.request({
|
url: this.serverUrl + '/ReportPlatForm/SearchGetWorkBillList',
|
data:{
|
HSourceID: item.HSourceID
|
},
|
success: (res) => {
|
console.log(2,res.data.data);
|
if(res.data.count == 1){
|
this.moreData = res.data.data.h_p_JIT_GetWorkBillListInfoBySource1 //时间点产量
|
console.log(2,this.moreData);
|
this.$forceUpdate()
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.hideLoading()
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//工单列表
|
toList(item){
|
uni.navigateTo({
|
url:'./list?HSourceID=' + item.HSourceID + '&HSourceName=' + item.HSourceName,
|
})
|
},
|
//编辑
|
edit(item){
|
console.log(item)
|
uni.navigateTo({
|
url:'/pages/shebeidangan/Gy_EquipFileMainBill?hmainid=' + item.hmainid
|
})
|
},
|
//删除
|
del(item){
|
console.log(item)
|
uni.showModal({
|
title: '提示',
|
content: '确认要删除吗,删除后不能恢复',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.request({
|
url: this.serverUrl + '/Gy_EquipFileMain/Delete_EquipFile',
|
data:{
|
HItemID: item.hmainid,
|
user: uni.getStorageSync('HUserName')
|
},
|
success: (res) => {
|
console.log(1,res);
|
if(res.data.count == 1){
|
this.clear()
|
}
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
});
|
},
|
// //审核
|
// check(item){
|
// console.log(item)
|
// if (item.HBillStatus > 0) {
|
// uni.showToast({
|
// title:'单据不为未审核状态!'
|
// })
|
// }
|
// },
|
// //反审核
|
// antiCheck(item){
|
|
// },
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.form{
|
width: 640rpx;
|
margin: 20rpx auto;
|
}
|
.tabs{
|
width: 100%;
|
display: flex;
|
view{
|
width: 25%;
|
font-size: 30rpx;
|
color: #555;
|
text-align: center;
|
padding: 16rpx 0;
|
}
|
.on{
|
color: #3a78ff;
|
font-weight: bold;
|
border-bottom: 3px solid #3a78ff;
|
}
|
}
|
.form-item{
|
display: flex;
|
align-items: center;
|
font-size: 28rpx;
|
padding: 6rpx 0;
|
.title{
|
width: 180rpx;
|
text{
|
color: red;
|
font-weight: bold;
|
}
|
}
|
.right{
|
width: 450rpx;
|
border-radius: 22rpx;
|
border: 1px solid #acacac;
|
}
|
.righton{
|
width: 450rpx;
|
border-radius: 22rpx;
|
border: 1px solid #e4e4e4;
|
background-color: #e4e4e4;
|
}
|
input{
|
width: 100%;
|
padding: 8rpx 20rpx;
|
font-size: 30rpx;
|
}
|
}
|
.buttons{
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
margin-top: 20rpx;
|
button{
|
border-radius: 50rpx;
|
width: 180rpx;
|
height: 66rpx;
|
line-height: 66rpx;
|
font-size: 28rpx;
|
}
|
.btn-a{
|
background-color: #acacac;
|
color: #fff;
|
}
|
.btn-b{
|
background-color: #41a863;
|
color: #fff;
|
}
|
.btn-c{
|
background-color: #3a78ff;
|
color: #fff;
|
}
|
}
|
|
.list{
|
width: 100%;
|
.card-main{
|
display: flex;
|
image{
|
width: 160rpx;
|
height: 160rpx;
|
margin-right: 30rpx;
|
}
|
.right{
|
font-size: 26rpx;
|
margin-bottom: 12rpx;
|
color: #555;
|
text{
|
color: #999;
|
}
|
}
|
}
|
.card-detail{
|
width: 100%;
|
display: flex;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
line-height: 120%;
|
.detail{
|
// width: 50%;
|
font-size: 26rpx;
|
margin-bottom: 12rpx;
|
color: #555;
|
margin-right: 20rpx;
|
text{
|
color: #999;
|
font-size: 26rpx;
|
}
|
}
|
}
|
.more{
|
color: #888;
|
font-size: 24rpx;
|
display: flex;
|
border-top: 1px solid #eee;
|
padding-top: 20rpx;
|
.part{
|
width: 50%;
|
text-align: center;
|
}
|
}
|
.op{
|
display: flex;
|
// justify-content: space-around;
|
// margin-top: 20rpx;
|
align-items: center;
|
justify-content: center;
|
margin-top: 4rpx;
|
font-size: 26rpx;
|
font-weight: bold;
|
position: absolute;
|
right: 30rpx;
|
bottom: 30rpx;
|
text{
|
margin-right: 10rpx;
|
font-weight: bold;
|
font-size: 28rpx;
|
}
|
button{
|
padding: 0;
|
width: 150rpx;
|
font-size: 25rpx;
|
}
|
.op1{
|
// border: 1px solid #41a863;
|
color: #41a863;
|
background-color: rgba( #41a863, .15);
|
padding: 2rpx 10rpx;
|
border-radius: 4rpx;
|
box-shadow: 2rpx 2rpx 6rpx 0 #acacac;
|
}
|
.op2{
|
// border: 1px solid #d98d00;
|
color: #d98d00;
|
background-color: rgba( #d98d00, .15);
|
padding: 2rpx 10rpx;
|
border-radius: 4rpx;
|
box-shadow: 2rpx 2rpx 6rpx 0 #acacac;
|
}
|
.op3{
|
// border: 1px solid #3a78ff;
|
color: #3a78ff;
|
background-color: rgba( #3a78ff, .15);
|
padding: 2rpx 10rpx;
|
border-radius: 4rpx;
|
box-shadow: 2rpx 2rpx 6rpx 0 #acacac;
|
}
|
.op4{
|
// border: 1px solid #da0000;
|
color: #da0000;
|
background-color: rgba( #da0000, .15);
|
padding: 2rpx 10rpx;
|
border-radius: 4rpx;
|
box-shadow: 2rpx 2rpx 6rpx 0 #acacac;
|
}
|
.op5{
|
// border: 1px solid #888;
|
color: #888;
|
background-color: rgba( #888, .15);
|
padding: 2rpx 10rpx;
|
border-radius: 4rpx;
|
box-shadow: 2rpx 2rpx 6rpx 0 #acacac;
|
}
|
}
|
}
|
|
</style>
|