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.

456 lines
13 KiB

4 years ago
<template>
<view>
<view class="contet-up-card">
<view class="contet-up-card-cont">
<view class="contet-up-card-cont-list">
<view>产品名称:</view>
4 years ago
<text>{{CyInfo.title}}</text>
4 years ago
</view>
4 years ago
<!-- <view class="contet-up-card-cont-list">
4 years ago
<view>检测日期:</view>
4 years ago
<text>{{CyInfo.create_time}}</text>
4 years ago
</view> -->
4 years ago
<view class="contet-up-card-cont-list">
<view>规格型号:</view>
4 years ago
<text>{{CyInfo.spec}}</text>
4 years ago
</view>
4 years ago
<view class="contet-up-card-cont-list">
<view>检验员:</view>
<text>{{userInfo.name}}</text>
</view>
4 years ago
<picker @change="bindDetectionMode" :value="detectionModeIndex" :range="detectionMode">
4 years ago
<view class="contet-up-card-cont-list">
<view>检测方式:</view>
<view class="jcfs-div">
{{detectionMode[detectionModeIndex]}}
<image src="../../static/xiala.png"></image>
</view>
</view>
4 years ago
</picker>
<view class="contet-up-card-cont-list">
<view>供应商:</view>
4 years ago
<text>{{CyInfo.supplier}}</text>
4 years ago
</view>
<view class="contet-up-card-cont-list">
<view>送货单号:</view>
4 years ago
<input type="number" v-model="froms.order_no" />
4 years ago
</view>
<view class="contet-up-card-cont-list">
<view>到货数量:</view>
4 years ago
<input type="number" v-model="froms.arrival_quantity" />
4 years ago
</view>
<view class="contet-up-card-cont-list">
<view>检测数量:</view>
4 years ago
<input v-model="froms.number_of_inspections" type="number" />
4 years ago
</view>
</view>
</view>
4 years ago
4 years ago
<view class="contet-up-card" style="margin-top: 20upx;">
4 years ago
<view class="btitle-cc">尺寸检测数据</view>
<!-- <view class="contet-up-card-cont">
4 years ago
<view class="contet-up-card-cont-list" v-for="(item,key,index) in froms.dimensional_inspection[0]"
:key="index">
4 years ago
<view>尺寸检测数据:</view>
4 years ago
<input v-model="froms.dimensional_inspection[0][key]" type="number" />
4 years ago
</view>
4 years ago
</view> -->
4 years ago
<view class="cc-card" v-for="(item,index) in froms.dimensional_inspection" :key="index">
<view class="pd-ul2">
<view class="pd-title">规格</view>
<view class="pd-list">
<text>{{item.size}}</text>
</view>
<view class="pd-title">最大值</view>
<view class="pd-list">
<text>{{item.up}}</text>
</view>
<view class="pd-title">最小值</view>
<view class="pd-list">
<text>{{item.down}}</text>
</view>
</view>
4 years ago
<view class="cc-input-ul">
4 years ago
<!-- <view class="cc-input-list">
4 years ago
<view class="title">rule</view>
<view class="cc-input">
4 years ago
<input type="number" @input="updateResult($event,index)"
:class="item.rule!=''&&(item.rule>item.up||item.rule<item.down)?'borders':''"
v-model="item.rule" />
</view>
4 years ago
</view> -->
4 years ago
<view class="cc-input-list">
<view class="title">no1</view>
<view class="cc-input">
<input type="number" @input="updateResult($event,index)"
:class="item.no1!=''&&(item.no1>item.up||item.no1<item.down)?'borders':''"
v-model="item.no1" />
</view>
</view>
<view class="cc-input-list">
<view class="title">no2</view>
<view class="cc-input">
<input type="number" @input="updateResult($event,index)"
:class="item.no2!=''&&(item.no2>item.up||item.no2<item.down)?'borders':''"
v-model="item.no2" />
4 years ago
</view>
4 years ago
</view>
<view class="cc-input-list">
<view class="title">no3</view>
<view class="cc-input">
<input type="number" @input="updateResult($event,index)"
:class="item.no3!=''&&(item.no3>item.up||item.no3<item.down)?'borders':''"
v-model="item.no3" />
</view>
</view>
<view class="cc-input-list">
<view class="title">no4</view>
<view class="cc-input">
<input type="number" @input="updateResult($event,index)"
:class="item.no4!=''&&(item.no4>item.up||item.no4<item.down)?'borders':''"
v-model="item.no4" />
</view>
</view>
<view class="cc-input-list">
<view class="title">no5</view>
<view class="cc-input">
<input type="number" @input="updateResult($event,index)"
:class="item.no5!=''&&(item.no5>item.up||item.no5<item.down)?'borders':''"
v-model="item.no5" />
</view>
</view>
4 years ago
</view>
<view class="pd-ul">
<view class="pd-title">判定</view>
<view class="pd-list">
4 years ago
<image :src="item.result=='OK'?'../../static/xz.png':'../../static/wxz.png'"></image>
4 years ago
<text>OK</text>
</view>
4 years ago
<view class="pd-list">
<image :src="item.result=='NG'?'../../static/xz.png':'../../static/wxz.png'"></image>
<text>NG</text>
</view>
</view>
4 years ago
</view>
4 years ago
</view>
<view class="testing">
4 years ago
<view v-for="(item,index) in item" :key="index">
4 years ago
<view class="card">
<view class="testing-list">
<view class="testing-list-title">检测项:</view>
4 years ago
<text>{{item.check_item}}</text>
4 years ago
</view>
<view class="testing-list">
<view class="testing-list-title">检测工具:</view>
4 years ago
<input :disabled="true" v-model="item.check_tool" />
4 years ago
</view>
<view class="testing-list">
<view class="testing-list-title">抽样标准:</view>
4 years ago
<!-- <text class="check-btn" @tap="checkBtn(index)">点击查看</text> -->
4 years ago
</view>
4 years ago
<view class="cybz-card">
4 years ago
{{item.standard}}
4 years ago
</view>
<view class="testing-list">
<view class="testing-list-title">检测数量:</view>
<view>
4 years ago
<input type="number" v-model="item.check_number" />
4 years ago
</view>
</view>
4 years ago
<picker @change="bindDetermine($event,index)" :value="item.status" :range="determine">
4 years ago
<view class="contet-up-card-cont-list">
<view style="width: 240upx;">判定:</view>
<view class="jcfs-div">
4 years ago
<text :class="item.status==0?'hg-color':'bhg-color'">{{determine[item.status]}}</text>
4 years ago
<image src="../../static/xiala.png"></image>
</view>
</view>
4 years ago
</picker>
<view class="testing-list" style="align-items: flex-start;">
<view class="testing-list-title">{{detectionMode[detectionModeIndex]}}结果:</view>
4 years ago
<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>
4 years ago
</view>
4 years ago
4 years ago
</view>
4 years ago
</view>
4 years ago
<picker @change="bindResult" :value="resltIds" :range="result">
<view class="testing-list" style="align-items: center;font-size: 26upx;margin-left: 50upx;">
4 years ago
<view>产品检验结果:</view>
4 years ago
<view
style="height: 50upx;border: 1upx solid #F1F1F1;width:200upx;font-size: 26upx;padding-top: 10upx;padding-left: 10upx;margin-left: 100upx;">
4 years ago
<text :class="resltIds==0?'hg-color':'bhg-color'">{{result[resltIds]}}</text>
4 years ago
<image style="width: 33upx;height: 33upx;" src="../../static/xiala.png"></image>
</view>
</view>
</picker>
4 years ago
<view class="testing-list" v-if="resltIds==1" style="align-items: flex-start;">
4 years ago
<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>
4 years ago
</view>
<view class="submit-btn">
4 years ago
<button type="primary" @tap="submit" :disabled="buttonState==false?true:false"
4 years ago
v-if="check_status==null&&isMenu(29)">提交</button>
4 years ago
<button type="primary" @tap="examineBtn" :disabled="buttonState==false?true:false"
v-if="CyInfo.me!=null&&CyInfo.me==1&&isMenu(30)">审核</button>
4 years ago
</view>
4 years ago
</view>
4 years ago
</view>
</template>
<script>
4 years ago
import {
materialItem,
dictionary,
4 years ago
materialCheckForm,
4 years ago
rawFormDetail,
mfExamine
4 years ago
} from "../../api/user.js"
4 years ago
import {
mapGetters,
mapMutations
} from 'vuex';
4 years ago
export default {
data() {
return {
4 years ago
info: {},
4 years ago
itemList: [],
result: ["合格", "不合格"],
4 years ago
resltIds: 0,
4 years ago
detectionMode: ["全检", "抽检"],
detectionModeIndex: 0,
determine: ["合格", "不合格"],
determineIndex: 0,
ifCheck: false,
sendId: -1,
CyInfo: {},
4 years ago
item: [], //检验项目列表
4 years ago
crrentIds: 0,
4 years ago
type: 0,
check_status: 0,
jyxItem: {},
buttonState: true,
4 years ago
jurisdiction: [],
4 years ago
standard: {},
4 years ago
tooList: [],
power: [],
4 years ago
froms: {
4 years ago
result: 1,
4 years ago
purchase_id: '', //采购数据ID
name: '', //材料名字
rule: '', //规格
check_type: 0, //检测类型:1=抽检,2=全检
supplier: '', //供应商
order_no: '', //送货单号
4 years ago
item: [],
arrival_quantity: "", //到货数量
4 years ago
number_of_inspections: "", //检测数量
4 years ago
result_describe: '', //检验不合格描述
4 years ago
dimensional_inspection: [], //尺寸
4 years ago
}
4 years ago
};
4 years ago
},
4 years ago
computed: {
...mapGetters(['userInfo', 'roleType'])
4 years ago
4 years ago
},
4 years ago
onLoad(e) {
this.CyInfo = JSON.parse(decodeURIComponent(e.planInfo));
4 years ago
this.type = this.CyInfo.examine_status
4 years ago
this.check_status = this.CyInfo.m_id
4 years ago
this.power = this.userInfo.power
4 years ago
this.getitem()
4 years ago
this.getArr()
4 years ago
this.isMenu();
4 years ago
console.log('检验项', this.CyInfo)
4 years ago
},
4 years ago
methods: {
4 years ago
getArr() {
4 years ago
if (this.power.length > 0) {
4 years ago
let newArr = this.power.map(item => {
4 years ago
this.jurisdiction.push(item.id)
4 years ago
4 years ago
})
4 years ago
4 years ago
}
4 years ago
console.log("xinshuzu", this.jurisdiction)
4 years ago
},
4 years ago
isMenu(id) {
console.log("id",id)
return this.jurisdiction.includes(id);
4 years ago
},
4 years ago
getitem() {
4 years ago
materialItem({
4 years ago
name: this.CyInfo.title
4 years ago
}).then(res => {
4 years ago
this.itemList = res.item;
4 years ago
this.standard = res.standard;
4 years ago
this.tooList = res.tool;
4 years ago
for (let b in res.item) {
4 years ago
this.item.push({
check_item: res.item[b],
4 years ago
standard: res.standard[b],
4 years ago
check_number: '',
4 years ago
status: 0,
check_result: '',
4 years ago
check_tool: res.tool[b],
4 years ago
check: false
4 years ago
})
}
4 years ago
4 years ago
if (this.check_status) {
this.getInfo()
}
4 years ago
res.size.map(item => {
this.froms.dimensional_inspection.push({
rule: "",
no1: "",
no2: "",
no3: "",
no4: "",
no5: "",
size: item.size,
up: item.up,
down: item.down,
result: 'NG'
})
})
4 years ago
})
},
4 years ago
updateResult(e, index) {
let item = this.froms.dimensional_inspection[index];
if ((item.rule > item.up || item.rule < item.down) || (item.no1 >
item.up || item.no1 < item.down) || (item.no2 > item.up || item.no2 < item
.down) || (item.no3 > item.up || item.no3 < item
.down) || (item.no4 > item.up || item.no4 < item
.down) || (item.no5 > item.up || item.no5 < item
.down)) {
this.froms.dimensional_inspection[index].result = "NG";
} else {
this.froms.dimensional_inspection[index].result = "OK";
}
},
4 years ago
getInfo() {
rawFormDetail({
purchase_id: this.CyInfo.id
}).then(res => {
4 years ago
this.info = res
this.item = this.info.item.map(item => {
for (let b in this.standard) {
if (b == item.check_item) {
item.standard = this.standard[b];
4 years ago
4 years ago
break;
}
}
for (let b in this.itemList) {
if (b == item.check_item) {
item.check_item = this.itemList[b];
break;
}
}
4 years ago
4 years ago
return item;
})
this.froms.dimensional_inspection = this.info.dimensional_inspection
this.froms.order_no = this.info.data.order_no
this.froms.arrival_quantity = this.info.data.arrival_quantity
this.froms.number_of_inspections = this.info.data.number_of_inspections
this.resltIds = this.info.data.result - 1
console.log("原材料检验详情", res)
4 years ago
})
},
4 years ago
bindDetectionMode: function(e) {
4 years ago
this.detectionModeIndex = e.target.value;
4 years ago
4 years ago
},
bindDetermine: function(e, index) {
4 years ago
4 years ago
this.determineIndex = e.target.value;
4 years ago
this.item[index].status = e.target.value
},
4 years ago
bindResult(e) {
4 years ago
this.resltIds = e.target.value
4 years ago
},
checkBtn(index) {
4 years ago
this.item[index].check == false ? this.item[index].check = true : this
.item[index].check = false;
4 years ago
//this.sendId=index
},
submit() {
4 years ago
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;
4 years ago
this.froms.check_type = this.detectionModeIndex + 1
4 years ago
this.froms.item = this.item;
4 years ago
this.froms.result = this.resltIds + 1;
4 years ago
this.item.map(item => {
4 years ago
delete item.check;
delete item.standard
4 years ago
4 years ago
})
4 years ago
let params = JSON.parse(JSON.stringify(this.froms));
4 years ago
4 years ago
params.item = params.item.map(item => {
for (let b in this.itemList) {
if (item.check_item == this.itemList[b]) {
item.check_item = b;
break;
}
}
return item;
})
4 years ago
this.buttonState = false
this.$functions.confirm("是否进行此操作?").then(() => {
4 years ago
materialCheckForm(params).then(res => {
this.$functions.success("提交成功").then(() => {
4 years ago
uni.navigateBack()
4 years ago
})
4 years ago
}).catch(res => {
this.buttonState = true
4 years ago
})
})
4 years ago
4 years ago
},
examineBtn(){
let params={
id:this.CyInfo.m_id,
status:1,
remake:''
}
this.buttonState = false
this.$functions.confirm("是否进行此操作?").then(() => {
mfExamine(params).then(res => {
this.$functions.success("提交成功").then(() => {
uni.navigateBack()
})
}).catch(res => {
this.buttonState = true
})
})
4 years ago
}
4 years ago
}
}
</script>
<style lang="scss">
4 years ago
@import "./index.scss";
4 years ago
</style>