|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<view class="card" v-for="(item,index) in list" :key="index" >
|
|
|
|
<view class="card-left">
|
|
|
|
<view class="card-up-list">
|
|
|
|
<view class="card-up-list-list">
|
|
|
|
<view>物料名称:</view><text>{{item.product_name}}</text>
|
|
|
|
</view>
|
|
|
|
<view class="card-right" @tap="open(item.plan_id,item.frequency)">
|
|
|
|
人员统计
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="card-up-list">
|
|
|
|
<view class="card-up-list-list">
|
|
|
|
<view>物料编号:</view><text>{{item.product_number}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="card-dow-list">
|
|
|
|
<view class="card-up-list-list">
|
|
|
|
<view>班次:</view>
|
|
|
|
<text v-if="item.frequency==0">夜班</text>
|
|
|
|
<text v-if="item.frequency==1">白班</text>
|
|
|
|
</view>
|
|
|
|
<view class="card-up-list-list">
|
|
|
|
<view>产线:</view><text>{{item.line_title}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="btn-grounp">
|
|
|
|
<view :class="item.status!=1?'':'dis-btn'" v-if="" @tap="openLine(item.plan_id,item)">开线</view>
|
|
|
|
<view class="btn-tx" @tap="stopLine(item)">停线</view>
|
|
|
|
<view v-if="item.status==1" class="btn-xx" @tap="offLine(item.plan_id)">下线</view>
|
|
|
|
<view class="btn-blp" @tap="badProduct(item)">不良品统计</view>
|
|
|
|
<view class="btn-back" @tap="rework(item)">返修</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<uni-popup ref="popup" type="center">
|
|
|
|
<view class="card-pop">
|
|
|
|
<view class="pop-list">
|
|
|
|
<text>班次:</text>
|
|
|
|
<view class="right-pic">
|
|
|
|
<text v-if="frequencyId==0">夜班</text>
|
|
|
|
<text v-if="frequencyId==1">白班</text>
|
|
|
|
<!-- <image src="../../static/next.png"></image> -->
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="pop-list">
|
|
|
|
<text>上线人数:</text>
|
|
|
|
<input type="number" v-model="froms.in_line" placeholder="请输入上线人数" />
|
|
|
|
</view>
|
|
|
|
<!-- <view class="pop-list">
|
|
|
|
<text>工时投入:</text>
|
|
|
|
<input type="number" v-model="froms.peoples" placeholder="请输入工时投入" />
|
|
|
|
</view> -->
|
|
|
|
<!-- <picker @change="bindStatus" :value="froms.status" :range="status">
|
|
|
|
<view class="pop-list">
|
|
|
|
<text>状态:</text>
|
|
|
|
<view class="right-pic">
|
|
|
|
<text>{{status[froms.status-1]}}</text>
|
|
|
|
<image src="../../static/next.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</picker> -->
|
|
|
|
<view class="submit" :disabled="buttonState==false?true:false" @tap="tjrsBtn()">提交</view>
|
|
|
|
</view>
|
|
|
|
</uni-popup>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {
|
|
|
|
firstCheckLists,
|
|
|
|
openLine,
|
|
|
|
trtj,
|
|
|
|
putInDetail,
|
|
|
|
noDetail
|
|
|
|
} from "../../api/user.js";
|
|
|
|
import {
|
|
|
|
mapGetters,
|
|
|
|
mapMutations
|
|
|
|
} from 'vuex';
|
|
|
|
export default {
|
|
|
|
computed: {
|
|
|
|
...mapGetters(['userInfo', 'roleType'])
|
|
|
|
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
|
|
|
|
this.getArr();
|
|
|
|
this.isMenu();
|
|
|
|
this.getTime()
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.getData()
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
list:[],
|
|
|
|
status:["冲压","喷涂"],
|
|
|
|
frequency:["夜班", "白班"],
|
|
|
|
buttonState:false,
|
|
|
|
froms:{
|
|
|
|
plan_id:'',
|
|
|
|
in_line:'',
|
|
|
|
//peoples:'',
|
|
|
|
status:1,
|
|
|
|
frequency:0
|
|
|
|
},
|
|
|
|
frequencyId:'',
|
|
|
|
power: [],
|
|
|
|
jurisdiction: [],
|
|
|
|
};
|
|
|
|
},methods:{
|
|
|
|
getArr() {
|
|
|
|
let newArr = this.power.map(item => {
|
|
|
|
if (item.children) {
|
|
|
|
|
|
|
|
item.children.map(items => {
|
|
|
|
this.jurisdiction.push(items.title)
|
|
|
|
return items
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
console.log("xinshuzu", this.jurisdiction)
|
|
|
|
},
|
|
|
|
isMenu(title) {
|
|
|
|
return this.jurisdiction.includes(title);
|
|
|
|
},
|
|
|
|
bindline: function(e) {
|
|
|
|
this.froms.frequency = e.target.value
|
|
|
|
},
|
|
|
|
bindStatus: function(e) {
|
|
|
|
console.log("状态",e.target.value)
|
|
|
|
this.froms.status = e.target.value+1
|
|
|
|
},
|
|
|
|
openLine(plan_id,item){
|
|
|
|
if(item.status==1){
|
|
|
|
this.$functions.error("已开线,请勿重复操作");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
openLine({id:plan_id}).then(res=>{
|
|
|
|
this.$functions.success('操作成功').then(() => {
|
|
|
|
this.getData()
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
getData(){
|
|
|
|
firstCheckLists({type:1}).then(res => {
|
|
|
|
this.list = res;
|
|
|
|
this.list.map(item=>{
|
|
|
|
this.dateFormat(item.open_time)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
stopLine(item){
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `../stopLineList/stopLineList?planInfo=${encodeURIComponent(JSON.stringify(item))}`
|
|
|
|
});
|
|
|
|
},
|
|
|
|
offLine(plan_id){
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `../offLine/offLine?plan_id=${plan_id}`
|
|
|
|
});
|
|
|
|
},
|
|
|
|
badProduct(item){
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `../badProduct/badProduct?badProduct=${encodeURIComponent(JSON.stringify(item))}`
|
|
|
|
});
|
|
|
|
}
|
|
|
|
,
|
|
|
|
rework(item){
|
|
|
|
uni.navigateTo({
|
|
|
|
url: `../rework/rework?badProduct=${encodeURIComponent(JSON.stringify(item))}`
|
|
|
|
});
|
|
|
|
},
|
|
|
|
open(e){
|
|
|
|
|
|
|
|
this.froms.plan_id=e;
|
|
|
|
|
|
|
|
// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
|
|
|
|
this.$refs.popup.open('center')
|
|
|
|
putInDetail({plan_id:e}).then(res=>{
|
|
|
|
|
|
|
|
if(res){
|
|
|
|
this.froms.frequency=res.frequency
|
|
|
|
this.froms.in_line=res.in_line
|
|
|
|
console.log("投入详情", this.froms.in_line)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
tjrsBtn(){
|
|
|
|
|
|
|
|
this.buttonState = false;
|
|
|
|
trtj(this.froms).then(res=>{
|
|
|
|
this.$functions.success('提交成功').then(() => {
|
|
|
|
this.$refs.popup.close('center')
|
|
|
|
}).catch(res => {
|
|
|
|
this.buttonState = true;
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getTime:function(){
|
|
|
|
|
|
|
|
var date = new Date(),
|
|
|
|
year = date.getFullYear(),
|
|
|
|
month = date.getMonth() + 1,
|
|
|
|
day = date.getDate(),
|
|
|
|
hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(),
|
|
|
|
minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(),
|
|
|
|
second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
|
|
|
|
month >= 1 && month <= 9 ? (month = "0" + month) : "";
|
|
|
|
day >= 0 && day <= 9 ? (day = "0" + day) : "";
|
|
|
|
var timer = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
|
|
|
|
console.log("当前时间",timer)
|
|
|
|
return timer;
|
|
|
|
|
|
|
|
},
|
|
|
|
dateFormat(second){
|
|
|
|
console.log("开线时间",second)
|
|
|
|
var dd,hh,mm,ss;
|
|
|
|
|
|
|
|
second = typeof second === 'string' ? parseInt(second) : second;
|
|
|
|
|
|
|
|
if(!second || second < 0){
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//天
|
|
|
|
|
|
|
|
dd = second / (24 * 3600) | 0;
|
|
|
|
|
|
|
|
second = Math.round(second) - dd * 24 * 3600;
|
|
|
|
|
|
|
|
//小时
|
|
|
|
|
|
|
|
hh = second / 3600 | 0;
|
|
|
|
|
|
|
|
second = Math.round(second) - hh * 3600;
|
|
|
|
|
|
|
|
//分
|
|
|
|
|
|
|
|
mm = second / 60 | 0;
|
|
|
|
|
|
|
|
//秒
|
|
|
|
|
|
|
|
ss = Math.round(second) - mm * 60;
|
|
|
|
|
|
|
|
if(Math.round(dd) < 10){
|
|
|
|
|
|
|
|
dd = dd > 0 ? '0' + dd : '';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(Math.round(hh) < 10){
|
|
|
|
|
|
|
|
hh = '0' + hh;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(Math.round(mm) < 10){
|
|
|
|
|
|
|
|
mm = '0' + mm;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(Math.round(ss) < 10){
|
|
|
|
|
|
|
|
ss = '0' + ss;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// alert( dd + ' ' + hh + ':' + mm + ':' + ss);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import "./index.scss";
|
|
|
|
</style>
|