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.

352 lines
9.6 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>
<view class="contet-up-card-cont-list">
<view>检测日期:</view>
4 years ago
<text>{{CyInfo.create_time}}</text>
4 years ago
</view>
<view class="contet-up-card-cont-list">
<view>规格型号:</view>
4 years ago
<text>{{CyInfo.spec}}</text>
4 years ago
</view>
<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> -->
<view class="cc-card">
<view class="cc-input-ul">
<view class="cc-input-list">
<view class="title">rule</view>
<view class="cc-input">
<input type="number" />
</view>
</view>
</view>
<view class="pd-ul">
<view class="pd-title">判定</view>
<view class="pd-list">
<image src="../../static/xz.png"></image>
<text>OK</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">
{{determine[item.status]}}
<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
{{result[resltIds]}}
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&&isMenu('原材料提交')">提交</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,
rawFormDetail
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: '', //检验不合格描述
dimensional_inspection: [{
4 years ago
rule: "",
no1: "",
4 years ago
no2: "",
no3: "",
no4: "",
4 years ago
no5: ""
4 years ago
}], //尺寸
4 years ago
}
4 years ago
};
4 years ago
},
4 years ago
computed: {
...mapGetters(['userInfo', 'roleType'])
},
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();
console.log('检验项', this.userInfo)
4 years ago
},
4 years ago
methods: {
4 years ago
getArr() {
4 years ago
if(this.power.length>0){
let newArr = this.power.map(item => {
if (item.children) {
item.children.map(items => {
this.jurisdiction.push(items.title)
return items
})
}
})
}
4 years ago
console.log("xinshuzu", this.jurisdiction)
},
isMenu(title) {
return this.jurisdiction.includes(title);
},
4 years ago
getitem() {
4 years ago
materialItem({name:this.CyInfo.purchase_number}).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
})
},
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()
}).catch(res => {
4 years ago
this.buttonState = true
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>