Browse Source

提交

master
865118801@qq.com 4 years ago
parent
commit
c04a39883e
  1. 14
      api/user.js
  2. 203
      pages/rawMaterialInfo/rawMaterialInfo.vue
  3. 225
      pages/stopLine/stopLine.vue

14
api/user.js

@ -340,4 +340,18 @@ export function dictionary(data) {
method: "get",
data
});
}
/**
* 原材料检验单
* @param {Object} data
*/
export function materialCheckForm(data) {
console.log(data)
return request({
url: `${functions.getDomain()}/api/material-check-form`,
method: "post",
data
});
}

203
pages/rawMaterialInfo/rawMaterialInfo.vue

@ -15,13 +15,13 @@
<text>{{CyInfo.spec}}</text>
</view>
<picker @change="bindDetectionMode" :value="detectionModeIndex" :range="detectionMode">
<view class="contet-up-card-cont-list">
<view>检测方式:</view>
<view class="jcfs-div">
{{detectionMode[detectionModeIndex]}}
<image src="../../static/xiala.png"></image>
</view>
</view>
<view class="contet-up-card-cont-list">
<view>检测方式:</view>
<view class="jcfs-div">
{{detectionMode[detectionModeIndex]}}
<image src="../../static/xiala.png"></image>
</view>
</view>
</picker>
<view class="contet-up-card-cont-list">
<view>供应商:</view>
@ -37,39 +37,18 @@
</view>
<view class="contet-up-card-cont-list">
<view>检测数量:</view>
<input v-model="froms.number_of_inspections" type="number" />
<input v-model="froms.number_of_inspections" type="number" />
</view>
</view>
</view>
<view class="contet-up-card" style="margin-top: 20upx;">
<view class="contet-up-card-cont">
<view class="contet-up-card-cont-list">
<view>尺寸检测数据:</view>
<input v-model="froms.number_of_inspections" type="number" />
</view>
<view class="contet-up-card-cont-list">
<view>尺寸检测数据:</view>
<input v-model="froms.number_of_inspections" type="number" />
</view>
<view class="contet-up-card-cont-list">
<view>尺寸检测数据:</view>
<input v-model="froms.number_of_inspections" type="number" />
</view>
<view class="contet-up-card-cont-list">
<view>尺寸检测数据:</view>
<input v-model="froms.number_of_inspections" type="number" />
</view>
<view class="contet-up-card-cont-list">
<view class="contet-up-card-cont-list" v-for="(item,key,index) in froms.dimensional_inspection[0]"
:key="index">
<view>尺寸检测数据:</view>
<input v-model="froms.number_of_inspections" type="number" />
</view>
<view class="contet-up-card-cont-list">
<view>尺寸检测数据:</view>
<input v-model="froms.number_of_inspections" type="number" />
</view>
<view class="contet-up-card-cont-list">
<input v-model="froms.dimensional_inspection[0][key]" type="number" />
</view>
</view>
</view>
<view class="testing">
@ -97,60 +76,75 @@
</view>
</view>
<picker @change="bindDetermine($event,index)" :value="item.status" :range="determine">
<view class="contet-up-card-cont-list">
<view style="width: 240upx;">判定:</view>
<view class="jcfs-div">
{{determine[item.status]}}
<image src="../../static/xiala.png"></image>
</view>
</view>
<view class="contet-up-card-cont-list">
<view style="width: 240upx;">判定:</view>
<view class="jcfs-div">
{{determine[item.status]}}
<image src="../../static/xiala.png"></image>
</view>
</view>
</picker>
<view class="testing-list" style="align-items: flex-start;">
<view class="testing-list-title">{{detectionMode[detectionModeIndex]}}结果:</view>
<textarea v-model="item.check_result" style="height: 100upx;border: 1upx solid #F1F1F1;width: 400upx;font-size: 26upx;padding-top: 10upx;padding-left: 10upx;" placeholder="请输入抽检结果"></textarea>
<textarea v-model="item.check_result"
style="height: 100upx;border: 1upx solid #F1F1F1;width: 400upx;font-size: 26upx;padding-top: 10upx;padding-left: 10upx;"
placeholder="请输入抽检结果"></textarea>
</view>
</view>
<view class="testing-list" style="align-items: flex-start;">
<view class="testing-list-title">检验不合格描述:</view>
<textarea v-model="froms.result_describe" style="height: 100upx;border: 1upx solid #F1F1F1;width: 400upx;font-size: 26upx;padding-top: 10upx;padding-left: 10upx;" placeholder="请输入抽检结果"></textarea>
</view>
</view>
<view class="testing-list" style="align-items: flex-start;">
<view class="testing-list-title">检验不合格描述:</view>
<textarea v-model="froms.result_describe"
style="height: 100upx;border: 1upx solid #F1F1F1;width: 400upx;font-size: 26upx;padding-top: 10upx;padding-left: 10upx;"
placeholder="请输入抽检结果"></textarea>
</view>
<view class="submit-btn">
<button type="primary">提交并发起审核</button>
<button type="primary" @tap="submit">提交并发起审核</button>
</view>
</view>
</view>
</view>
</template>
<script>
import {materialItem,dictionary} from "../../api/user.js"
import {
materialItem,
dictionary,
materialCheckForm
} from "../../api/user.js"
export default {
data() {
return {
detectionMode:["全检","抽检"],
detectionModeIndex:0,
determine:["合格","不合格"],
determineIndex:0,
ifCheck:false,
sendId:-1,
CyInfo:{},
materialItemList:[],//
crrentIds:0,
froms:{
purchase_id:'',//ID
name:'',//
rule:'',//
check_type:0,//1=2=
supplier:'',//
order_no:'',//
materialItemList:[],
arrival_quantity:0,//
number_of_inspections:0,//
result_describe:'',//
dimensional_inspection:[],//
detectionMode: ["全检", "抽检"],
detectionModeIndex: 0,
determine: ["合格", "不合格"],
determineIndex: 0,
ifCheck: false,
sendId: -1,
CyInfo: {},
materialItemList: [], //
crrentIds: 0,
froms: {
purchase_id: '', //ID
name: '', //
rule: '', //
check_type: 0, //1=2=
supplier: '', //
order_no: '', //
materialItemList: [],
arrival_quantity: 0, //
number_of_inspections: 0, //
result_describe: '', //
dimensional_inspection: [{
rule: 0,
no1: 0,
no2: 0,
no3: 0,
no4: 0,
no5: 0
}], //
}
};
},
@ -158,42 +152,57 @@
this.CyInfo = JSON.parse(decodeURIComponent(e.planInfo));
this.getMaterialItemList()
},
methods:{
getMaterialItemList(){
materialItem().then(res=>{
for(let b in res.item){
methods: {
getMaterialItemList() {
materialItem().then(res => {
for (let b in res.item) {
this.materialItemList.push({
title:res.item[b],
standard:res.standard[b],
num:0,
status:0,
check_result:'',
tool:'',
check:false
title: res.item[b],
standard: res.standard[b],
num: 0,
status: 0,
check_result: '',
tool: '',
check: false
})
}
})
},
bindDetectionMode: function(e) {
console.log('picker发送选择改变,携带值为', e.target.value)
bindDetectionMode: function(e) {
this.detectionModeIndex = e.target.value;
this.froms.check_type=this.detectionModeIndex+1
},
bindDetermine: function(e,index) {
},
bindDetermine: function(e, index) {
console.log('picker发送选择改变,携带值为', e.target.value)
this.determineIndex = e.target.value;
this.materialItemList[index].status=e.target.value
},
checkBtn(index){
this.materialItemList[index].check==false?this.materialItemList[index].check=true:this.materialItemList[index].check=false;
//this.sendId=index
}
this.materialItemList[index].status = e.target.value
},
checkBtn(index) {
this.materialItemList[index].check == false ? this.materialItemList[index].check = true : this
.materialItemList[index].check = false;
//this.sendId=index
},
submit() {
this.froms.name=this.CyInfo.title;
this.froms.supplier=this.CyInfo.supplier;
this.froms.rule=this.CyInfo.spec;
this.froms.purchase_id=this.CyInfo.id;
this.froms.check_type = this.detectionModeIndex + 1
this.froms.materialItemList = this.materialItemList;
materialCheckForm(this.froms).then(res => {
this.$functions.success("提交成功").then(() => {
uni.navigateBack({
})
})
})
}
}
}
</script>
<style lang="scss">
@import "./index.scss";
@import "./index.scss";
</style>

225
pages/stopLine/stopLine.vue

@ -19,38 +19,38 @@
<text>{{CyInfo.line_title}}</text>
<!-- <image class="next" src="../../static/next.png"></image> -->
</view>
</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 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>
</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 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>
</view>
</picker>
</view>
<view class="big-titlt">模具维修</view>
<view class="white-card">
<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 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>
</view>
</picker>
<view class="list-list">
<view class="list-title">异常现象</view>
@ -67,35 +67,35 @@
<view class="list-list">
<view class="list-title">维修描述</view>
<view class="list-right">
<input placeholder="请输入维修描述" v-model="froms.device[0].repair_description" />
<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" />
<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" />
<input placeholder="请输入维修人员" v-model="froms.device[0].repair_staff" />
</view>
</view>
<view class="bzqk-card">
<textarea value="" v-model="froms.device[0].remark" placeholder="备注情况说明" />
<textarea value="" v-model="froms.device[0].remark" placeholder="备注情况说明" />
</view>
</view>
<view class="big-titlt">设备维修</view>
<view class="white-card">
<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 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>
</view>
</picker>
<view class="list-list">
<view class="list-title">异常现象</view>
@ -112,25 +112,25 @@
<view class="list-list">
<view class="list-title">维修描述</view>
<view class="list-right">
<input placeholder="请输入维修描述" v-model="froms.mode[0].repair_description" />
<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" />
<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" />
<input placeholder="请输入维修人员" v-model="froms.mode[0].repair_staff" />
</view>
</view>
<view class="bzqk-card">
<textarea value="" placeholder="备注情况说明" v-model="froms.mode[0].remark" />
</view>
</view>
<view class="submit-btn">
<button type="primary" @tap="stopLine()">提交并发起审核</button>
@ -139,108 +139,121 @@
</template>
<script>
import {stopLineReason,device,mode,stopRecord} from "../../api/user.js"
import {
stopLineReason,
device,
mode,
stopRecord
} from "../../api/user.js"
export default {
data() {
return {
line:["A线","B线"],
lineIndex:0,
frequency:["白班","夜班"],
frequencyIds:0,
reason:["模具维修","设备维修","品质待定","辅料短缺","偶发停电"],
reasonIds:0,
mould:["1","2","3"],
mouldIds:0,
deviList:[],
CyInfo:{},
resonList:[],
deviceNo:[],
froms:{
plan_id:"",
frequency:'1',
reason_id:'',
remake:'',
device:[
{device_id:'1',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:''}
],
line: ["A线", "B线"],
lineIndex: 0,
frequency: ["白班", "夜班"],
frequencyIds: 0,
reason: ["模具维修", "设备维修", "品质待定", "辅料短缺", "偶发停电"],
reasonIds: 0,
mould: ["1", "2", "3"],
mouldIds: 0,
deviList: [],
CyInfo: {},
resonList: [],
deviceNo: [],
froms: {
plan_id: "",
frequency: '1',
reason_id: '',
remake: '',
device: [{
device_id: '1',
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.getDevice();
this.getMode()
this.CyInfo = JSON.parse(decodeURIComponent(e.planInfo));
this.froms.plan_id=this.CyInfo.plan_id;
console.log('picker发送选择改变,携带值为',this.CyInfo)
this.froms.plan_id = this.CyInfo.plan_id;
console.log('picker发送选择改变,携带值为', this.CyInfo)
},
methods:{
getDevice(){
device().then(res=>{
let newArr= []
newArr=res.map(item=>item.name)
this.deviceNo=newArr
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)
})
methods: {
getDevice() {
device().then(res => {
let newArr = []
newArr = res.map(item => item.name)
this.deviceNo = newArr
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)
})
},
getReson(){
stopLineReason().then(res=>{
getReson() {
stopLineReason().then(res => {
let arr = [];
for (let i in res) {
arr.push(res[i])
arr.push(res[i])
}
this.reason=arr
this.reason = arr
})
},
bindline: function(e) {
this.froms.frequency = e.target.value;
console.log("forms",this.froms)
console.log("forms", this.froms)
},
// bindfrequencyIds(e){
// this.froms.frequency = e.target.value
// console.log("forms",this.froms)
// },
bindReason(e){
bindReason(e) {
this.reasonIds = e.target.value;
this.froms.reason_id=e.target.value+1;
this.froms.reason_id = e.target.value + 1;
},
bindmouldIds(e){
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
bindmouldIds(e) {
this.froms.device[0].device_id = e.target.value + 1
console.log("设备id", this.froms.device[0].device_id)
},
stopLine(){
stopRecord(this.froms).then(res=>{
<<<<<<< HEAD
uni.navigateBack({
delta: -1
=======
this.$functions.success("操作成功").then(()=>{
bindmodeIds(e) {
this.froms.mode[0].mode_id = e.target.value + 1
},
stopLine() {
stopRecord(this.froms).then(res => {
this.$functions.success("操作成功").then(() => {
uni.navigateBack({
})
>>>>>>> 210f7a29f32e12bcef5e41ab96326748e071d9ae
});
})
}
}
@ -248,5 +261,5 @@
</script>
<style lang="scss">
@import "./index.scss"
@import "./index.scss"
</style>

Loading…
Cancel
Save