erp 新洋电子
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

305 lines
8.9 KiB

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