|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<view class="white-card">
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">物料编号</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<text>{{CyInfo.product_number}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">填报日期</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<text>{{CyInfo.production}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">线别</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<text>{{CyInfo.line_title}}</text>
|
|
|
|
<!-- <image class="next" src="../../static/next.png"></image> -->
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<picker @change="bindline" :value="froms.frequency" :range="line">
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">班次</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<text>{{line[froms.frequency]}}</text>
|
|
|
|
<image class="next" src="../../static/xiala.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
</view>
|
|
|
|
<view class="white-card" style="margin-top: 30upx;">
|
|
|
|
<picker @change="bindReason" :value="reasonIds" :range="reason">
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">停线原因</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<text>{{reason[reasonIds]}}</text>
|
|
|
|
<image class="next" src="../../static/next.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
</view>
|
|
|
|
<view class="big-titlt" v-if="crrentReson=='设备维修'">设备维修</view>
|
|
|
|
<view class="white-card" v-if="crrentReson=='设备维修'">
|
|
|
|
<picker @change="bindmouldIds" :value="froms.device[0].device_id" :range="deviceNo">
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">设备编号</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<text>{{deviceNo[froms.device[0].device_id-1]}}</text>
|
|
|
|
<image class="next" src="../../static/next.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
<picker @change="ycxx($event,AbnormalPhenomenon)" :value="index" :range-key="'name'" :range="AbnormalPhenomenon">
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">异常现象</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<text>{{AbnormalPhenomenon[index].name}}</text>
|
|
|
|
<image class="next" src="../../static/next.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">原因分析</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<input placeholder="请输入原因分析" v-model="froms.device[0].cause_analysis" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">维修描述</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<input placeholder="请输入维修描述" v-model="froms.device[0].repair_description" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">维修时长</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<input placeholder="请输入维修时长" v-model="froms.device[0].repair_time" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">维修人员</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<input placeholder="请输入维修人员" v-model="froms.device[0].repair_staff" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="bzqk-card">
|
|
|
|
<textarea value="" v-model="froms.device[0].remark" placeholder="备注情况说明" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="big-titlt" v-if="crrentReson=='模具维修'">模具维修</view>
|
|
|
|
<view class="white-card" v-if="crrentReson=='模具维修'">
|
|
|
|
<picker @change="bindmodeIds" :value="froms.mode[0].mode_id" :range="mould">
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">模具编号</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<text>{{mould[froms.mode[0].mode_id-1]}}</text>
|
|
|
|
<image class="next" src="../../static/next.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
<picker @change="ycxx()" :value="index" :range="mould">
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">异常现象</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<text>{{mould[froms.mode[0].mode_id-1]}}</text>
|
|
|
|
<image class="next" src="../../static/next.png"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">原因分析</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<input placeholder="请输入原因分析" v-model="froms.mode[0].cause_analysis" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">维修描述</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<input placeholder="请输入维修描述" v-model="froms.mode[0].repair_description" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">维修时长</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<input placeholder="请输入维修时长" v-model="froms.mode[0].repair_time" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="list-list">
|
|
|
|
<view class="list-title">维修人员</view>
|
|
|
|
<view class="list-right">
|
|
|
|
<input placeholder="请输入维修人员" v-model="froms.mode[0].repair_staff" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="white-card" v-if="crrentReson!='设备维修'&&crrentReson!='模具维修'">
|
|
|
|
<view class="list-list" style="align-items: flex-start;">
|
|
|
|
<view class="list-title" style="padding-top: 30upx;">情况描述</view>
|
|
|
|
<view class="list-right" style="border: 1upx solid #F1F1F1;font-size: 26upx;">
|
|
|
|
<textarea style="font-size: 26upx;text-indent:30upx;padding-top: 30upx;" placeholder="请输入情况描述" v-model="froms.remake" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<!-- <view class="white-card">
|
|
|
|
<view class="bzqk-card">
|
|
|
|
<textarea value="" placeholder="备注" v-model="froms.remake" />
|
|
|
|
</view>
|
|
|
|
</view> -->
|
|
|
|
|
|
|
|
<view class="submit-btn">
|
|
|
|
<button type="primary" @tap="stopLine()">提交</button>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {
|
|
|
|
stopLineReason,
|
|
|
|
device,
|
|
|
|
mode,
|
|
|
|
stopRecord,
|
|
|
|
dictionary
|
|
|
|
} from "../../api/user.js"
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
line: ["夜班", "白班"],
|
|
|
|
lineIndex: 0,
|
|
|
|
frequency: ["白班", "夜班"],
|
|
|
|
frequencyIds: 0,
|
|
|
|
reason: ["模具维修", "设备维修", "品质待定", "辅料短缺", "偶发停电"],
|
|
|
|
reasonIds: 0,
|
|
|
|
mould: ["1", "2", "3"],
|
|
|
|
mouldIds: 0,
|
|
|
|
deviList: [],
|
|
|
|
CyInfo: {},
|
|
|
|
resonList: [],
|
|
|
|
deviceNo: [],
|
|
|
|
AbnormalPhenomenon:[],
|
|
|
|
index:0,
|
|
|
|
crrentReson:'',
|
|
|
|
froms: {
|
|
|
|
plan_id: "",
|
|
|
|
frequency: '1',
|
|
|
|
reason_id: '',
|
|
|
|
remake: '',
|
|
|
|
device: [{
|
|
|
|
device_id: '',
|
|
|
|
unusual_phenomenon: '',
|
|
|
|
cause_analysis: '',
|
|
|
|
repair_description: '',
|
|
|
|
repair_time: '',
|
|
|
|
repair_staff: '',
|
|
|
|
remark: ''
|
|
|
|
}],
|
|
|
|
mode: [{
|
|
|
|
mode_id: '',
|
|
|
|
unusual_phenomenon: '',
|
|
|
|
cause_analysis: '',
|
|
|
|
repair_description: '',
|
|
|
|
repair_time: '',
|
|
|
|
repair_staff: '',
|
|
|
|
remark: ''
|
|
|
|
}],
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onLoad(e) {
|
|
|
|
this.getReson();
|
|
|
|
this.getDevice();
|
|
|
|
this.getMode()
|
|
|
|
this.CyInfo = JSON.parse(decodeURIComponent(e.planInfo));
|
|
|
|
this.froms.plan_id = this.CyInfo.plan_id;
|
|
|
|
this.crrentReson="设备维修"
|
|
|
|
console.log('picker发送选择改变,携带值为', this.CyInfo)
|
|
|
|
this.getdeviceException();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getDevice() {
|
|
|
|
device().then(res => {
|
|
|
|
let newArr = []
|
|
|
|
newArr = res.map(item => item.name)
|
|
|
|
this.deviceNo = newArr
|
|
|
|
//this.deviceNo=res
|
|
|
|
console.log("设备编号11", this.deviceNo)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getMode() {
|
|
|
|
mode().then(res => {
|
|
|
|
let newArr = []
|
|
|
|
newArr = res.map(item => item.title)
|
|
|
|
this.mould = newArr
|
|
|
|
console.log("mode", this.mould)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getdeviceException(){
|
|
|
|
dictionary({key:'device_exception'}).then(res=>{
|
|
|
|
this.AbnormalPhenomenon=res
|
|
|
|
console.log("异常现象",res)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
ycxx(e,storage){
|
|
|
|
this.index = e.target.value
|
|
|
|
this.froms.device[0].unusual_phenomenon=storage[this.index].value
|
|
|
|
console.log("aaa",this.froms.device[0].unusual_phenomenon)
|
|
|
|
},
|
|
|
|
getReson() {
|
|
|
|
stopLineReason({status:1}).then(res => {
|
|
|
|
let arr = [];
|
|
|
|
for (let i in res) {
|
|
|
|
arr.push(res[i])
|
|
|
|
}
|
|
|
|
this.reason = arr
|
|
|
|
|
|
|
|
})
|
|
|
|
},
|
|
|
|
bindline: function(e) {
|
|
|
|
this.froms.frequency = e.target.value;
|
|
|
|
console.log("forms", this.froms)
|
|
|
|
},
|
|
|
|
// bindfrequencyIds(e){
|
|
|
|
// this.froms.frequency = e.target.value
|
|
|
|
// console.log("forms",this.froms)
|
|
|
|
// },
|
|
|
|
bindReason(e) {
|
|
|
|
|
|
|
|
this.reasonIds = e.target.value;
|
|
|
|
this.froms.reason_id = e.target.value + 1;
|
|
|
|
this.crrentReson=this.reason[e.target.value]
|
|
|
|
console.log("当前原因",this.crrentReson)
|
|
|
|
},
|
|
|
|
bindmouldIds(e) {
|
|
|
|
this.froms.device[0].device_id = e.target.value +1
|
|
|
|
// this.froms.device[0].device_id = e.target.value + 1
|
|
|
|
console.log("设备id", this.froms.device[0].device_id)
|
|
|
|
},
|
|
|
|
bindmodeIds(e) {
|
|
|
|
this.froms.mode[0].mode_id = e.target.value + 1
|
|
|
|
},
|
|
|
|
stopLine() {
|
|
|
|
if(this.crrentReson=='设备维修'||this.crrentReson=='模具维修'){
|
|
|
|
delete this.froms.remake
|
|
|
|
}
|
|
|
|
|
|
|
|
//this.froms.device[0].device_id=this.froms.device[0].device_id+1;
|
|
|
|
stopRecord(this.froms).then(res => {
|
|
|
|
|
|
|
|
this.$functions.success("操作成功").then(() => {
|
|
|
|
uni.navigateBack({
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import "./index.scss"
|
|
|
|
</style>
|