<template>
|
<view>
|
<page-nav title="首检检验"></page-nav>
|
|
|
<view class="mainContent">
|
<view>
|
<u-gap height="10" bgColor="#eff0f1"></u-gap>
|
<view class="head">
|
<view class="head_block">
|
<view class="head_left">
|
<view class="head_bar"></view>
|
<view class="head_title" style="font-weight: bolder;">
|
物料信息
|
</view>
|
</view>
|
</view>
|
|
<view class="marginLeft20 marginRight20">
|
<view class="marginBottom20" style="display: flex;">
|
<view class="flex_column titleFont">
|
<view>单据编号:</view>
|
<view>物料编码:</view>
|
<view>物料名称:</view>
|
<view>物料规格:</view>
|
<view>工序编码:</view>
|
<view>工序名称:</view>
|
<view>质检方案:</view>
|
<view>抽样方式:</view>
|
<view>质量状态:</view>
|
<view>物料数量:</view>
|
</view>
|
<view class="flex_column contentFont">
|
<view>{{processObj.wocode}}</view>
|
<view>{{processObj.partcode}}</view>
|
<view>{{processObj.partname}}</view>
|
<view>{{processObj.partspec?processObj.partspec:'/'}}</view>
|
<view>{{processObj.stepcode}}</view>
|
<view>{{processObj.stepname}}</view>
|
<view class="ellipsis" style="width: 460rpx;">{{processObj.checkstandname}}</view>
|
<view>{{processObj.sampmethod==='FIXED'?'固时抽检':'比例抽检'}}</view>
|
<view style="display: flex;align-items: center;">
|
<u-icon :name="isPlain?'checkmark-circle-fill':'close-circle-fill'"
|
:color="isPlain?'#55ff00':'#FF0000'" size="20"></u-icon>
|
<view style="margin-left: 10rpx;">
|
{{isPlain?'合格':'不合格'}}
|
</view>
|
</view>
|
<view>{{processObj.good_qty}}</view>
|
</view>
|
</view>
|
</view>
|
|
|
</view>
|
|
<u-gap height="10" bgColor="#eff0f1"></u-gap>
|
<view class="head">
|
<view class="head_block">
|
<view class="head_left">
|
<view class="head_bar"></view>
|
<view class="head_title" style="font-weight: bolder;">
|
检验结果
|
</view>
|
</view>
|
</view>
|
|
<view class="marginLeft20 marginRight20 marginBottom20">
|
<view class="" style="display: flex;">
|
<view class="flex_column titleFont">
|
<view>样本数量:</view>
|
<view>合格数量:</view>
|
<view>不合格数量:</view>
|
</view>
|
<view class="flex_column contentFont">
|
<view>{{processObj.sampleqty}} 个</view>
|
<view>{{processObj.goodqty}} 个</view>
|
<view>{{processObj.sampleqty-processObj.goodqty}} 个</view>
|
</view>
|
</view>
|
|
|
<view style="display: flex;margin-top: 30rpx;justify-content: flex-start;">
|
<u-button type="primary" @click="isPlain=true" style="width: 160rpx;height: 60rpx; "
|
:plain="!isPlain" text="合格"></u-button>
|
<u-button type="warning" @click="isPlain=false" style="width: 160rpx;height: 60rpx;"
|
:plain="isPlain" text="不合格"></u-button>
|
</view>
|
</view>
|
|
|
</view>
|
|
|
</view>
|
</view>
|
|
|
<view class="footer">
|
<u-button type="primary" size='large' :hairline="true" :loading="isDisabledSubmitButton" @click="submit"
|
loadingText="正在提交,请稍等..." text="确认提交"></u-button>
|
</view>
|
|
|
</view>
|
</template>
|
|
|
<script>
|
import {
|
SaveMesOrderStepCheckItem
|
|
} from '../../config/api.js';
|
|
export default {
|
onLoad(option) {
|
|
|
console.log(option, 2)
|
|
// let t1=JSON.parse(option.processObj)
|
// let t2=JSON.parse(option.processObj)
|
|
|
|
let processObj = JSON.parse(option.processObj)
|
// console.log(this.processObj)
|
|
this.processObj.wocode = processObj.wo_code
|
this.processObj.partcode = processObj.partcode
|
this.processObj.partname = processObj.partname
|
this.processObj.partspec = processObj.partspec
|
this.processObj.stepcode = processObj.stepcode
|
this.processObj.stepname = processObj.stepname
|
this.processObj.sampmethod = processObj.sampmethod
|
this.processObj.good_qty = processObj.good_qty
|
this.processObj.checkstandcode = processObj.checkstandcode
|
this.processObj.checkstandname = processObj.checkstandname
|
this.processObj.sampleqty = processObj.sampscare
|
|
this.processObj.goodqty = option.goodqty
|
|
this.isPlain = parseFloat(this.processObj.goodqty) === parseFloat(this.processObj.sampleqty)
|
|
|
this.processArr = JSON.parse(option.processArr)
|
|
|
|
},
|
|
onPullDownRefresh() {
|
setTimeout(() => {
|
this.init(() => {
|
uni.stopPullDownRefresh();
|
})
|
}, 1000);
|
},
|
|
data() {
|
return {
|
topRightMessageCount: '',
|
isDisabledSubmitButton: false,
|
|
processObj: {
|
wocode: '',
|
partcode: '',
|
partname: '',
|
partspec: '',
|
stepcode: '',
|
stepname: '',
|
checkstandcode: '',
|
checkstandname: '',
|
check_type: 'FirstCheck',
|
sampmethod: '', // FIXED(固时抽检) SCARE(比例抽检)
|
sampscare: '',
|
qualitystatus: '/',
|
good_qty: '', // 指的报工数量
|
sampleqty: '',
|
goodqty: '', // 合格数量
|
ngqty: '', // 不良数量
|
},
|
processArr: [],
|
isPlain: true
|
}
|
},
|
created() {
|
|
},
|
mounted() {
|
this.init()
|
|
},
|
methods: {
|
init() {
|
uni.stopPullDownRefresh();
|
},
|
|
|
// 提交接口
|
async submit() {
|
|
let checkitemcont = []
|
|
this.processArr.forEach((i, index) => {
|
checkitemcont.push({
|
checknum: i.checkNumber + '/' + this.processArr.length / this
|
.processArr.filter(j => j.checkNumber === 1).length,
|
checkiem_seq: i.stepcheckitem_seq,
|
checkitem_code: i.code,
|
checkitem_name: i.name,
|
check_value: i.real_value ? i.real_value : '',
|
check_result: i.isPlain ? 'OK' : 'NG',
|
checkitem_descr: ''
|
})
|
})
|
|
console.log(checkitemcont, 7)
|
|
|
let formData = {
|
stu_torgcode: uni.getStorageSync('stu_torgcode'),
|
wocode: this.processObj.wocode,
|
partcode: this.processObj.partcode,
|
stepcode: this.processObj.stepcode,
|
checkstandcode: this.processObj.checkstandcode,
|
check_type: this.processObj.check_type,
|
sampmethod: this.processObj.sampmethod,
|
qualitystatus: this.isPlain ? 'OK' : 'NG',
|
good_qty: this.processObj.good_qty,
|
sampleqty: this.processObj.sampleqty,
|
goodqty: this.processObj.goodqty,
|
|
ngqty: this.processObj.sampleqty - this.processObj.goodqty,
|
|
admin: uni.getStorageSync('usercode'),
|
checkitemcont: JSON.stringify(checkitemcont)
|
}
|
|
|
console.log(formData, 888)
|
|
this.isDisabledSubmitButton = true
|
|
const res = await SaveMesOrderStepCheckItem(formData)
|
|
if (res.code === '200') {
|
uni.$u.toast('提交成功!')
|
|
|
setTimeout(() => {
|
let prevPage = getCurrentPages()[getCurrentPages().length - 2]; // 上一页面实例
|
prevPage.$vm.fromSubmitData() // 调用上一页 定义的方法
|
uni.navigateBack({
|
delta: 1, //返回层数,1则上页
|
})
|
}, 1000)
|
|
this.isDisabledSubmitButton = false
|
} else {
|
uni.$u.toast(result.Message)
|
this.isDisabledSubmitButton = false
|
}
|
|
// uni.uploadFile({
|
// url: this.$baseUrl + '/AppQualityManagement/SaveStepCheckItem',
|
// files: [{
|
// "uri": "/"
|
// }],
|
// header: header,
|
// formData: formData,
|
// success: (res) => {
|
// console.log(res, 999)
|
// let result = JSON.parse(res.data)
|
// if (res.statusCode == 200 && result.code == '200') {
|
// uni.$u.toast('提交成功!')
|
|
// let prevPage = getCurrentPages()[getCurrentPages().length - 2]; // 上一页面实例
|
// prevPage.$vm.fromSubmitData() // 调用上一页 定义的方法
|
// uni.navigateBack({
|
// delta: 1, //返回层数,1则上页
|
// })
|
|
// } else {
|
// uni.$u.toast(result.Message)
|
// }
|
// this.isDisabledSubmitButton = false
|
// },
|
// fail(res) {
|
// console.log(res, 1000)
|
// uni.$u.toast('提交失败!')
|
// this.isDisabledSubmitButton = false
|
// },
|
// })
|
|
},
|
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import url('@/style/global.css');
|
|
::v-deep .uicon-arrow-left>span {
|
display: block;
|
}
|
</style>
|