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.
 
 
 

175 lines
4.7 KiB

<template>
<view>
<view class="sm-box">
<view class="content-box-card">
<view class="content-box-card-ul-two">
<view class="content-box-card-list">
<view class="content-box-card-title">物料名称:</view>
<text>{{ CyInfo.title }}</text>
</view>
<!-- <view class="content-box-card-list">
<view class="content-box-card-title">规格:</view>
<text>{{ info.product_size }}</text>
</view> -->
</view>
<view class="content-box-card-ul-two">
<view class="content-box-card-list">
<view class="content-box-card-title">规格:</view>
<text>{{ CyInfo.spec }}</text>
</view>
<view class="content-box-card-list">
<view class="content-box-card-title">数量:</view>
<text>{{ CyInfo.math }}</text>
</view>
</view>
</view>
</view>
<view class="big-title">
检验记录
</view>
<view class="white-card">
<view class="lists" v-for="(item,index) in list" :key="index">
<view class="list-left">
<view class="list-left-up">
<view class="list-left-up-left">检验人员:{{item.check_name}}</view>
<view class="list-left-up-mid">检验时间:{{item.create_time}}</view>
<view class="list-left-up-right-ok" v-if="item.result==1">OK</view>
<view class="list-left-up-right-no" v-if="item.result==2">NG</view>
</view>
<view class="list-left-dow">
<view class="list-left-dow-left">审核人:{{item.examine_name}}</view>
<view class="list-left-dow-btn">
<view @tap="rawMaterialInfo(item)">
查看详情
</view>
<!-- <view class="red" @tap="rawMaterialInfo(item)" v-if="isMenu(40)&&item.two_id==0">
审核
</view> -->
</view>
</view>
</view>
<!-- <view class="list-right" v-if="list.length==1||index==0">
</view>
<view class="list-right" v-if="list.length>=2&&list.length-1==index">
</view> -->
</view>
<view class="submit-btn">
<button type="primary" v-if="isMenu(29)" @tap="addRecord(CyInfo)">新增检验记录</button>
</view>
</view>
</view>
</template>
<script>
import {
newCheckZzList,
purchaseInspectionLists
} from "../../api/user.js"
import {
mapGetters,
mapMutations
} from 'vuex';
export default {
data() {
return {
plan_id: '',
CyInfo: {},
info: {},
power: [],
jurisdiction: [],
product_id:0,
list: [],
limit: 10,
page: 1
};
},
computed: {
...mapGetters(['userInfo', 'roleType'])
},
onShow() {
this.getData()
},
onLoad(e) {
this.plan_id = e.plan_id;
this.CyInfo = JSON.parse(decodeURIComponent(e.planInfo));
this.product_id=this.CyInfo.product_id;
this.power = this.userInfo.power
this.getArr();
this.isMenu();
},
methods: {
getArr() {
if (this.power.length > 0) {
let newArr = this.power.map(item => {
this.jurisdiction.push(item.id)
})
}
console.log("xinshuzu", this.jurisdiction)
},
isMenu(id) {
console.log("id", id)
return this.jurisdiction.includes(id);
},
getData() {
let param = {
purchase_id:this.CyInfo.id
};
purchaseInspectionLists(param).then(res => {
//this.info = res,
this.list = res;
console.log("详情", res)
})
},
rawMaterialInfo(item){
uni.navigateTo({
url: `../rawMaterialInfo/rawMaterialInfo?planInfo=${encodeURIComponent(JSON.stringify(item))}`,
success: res => {},
fail: () => {},
complete: () => {}
});
},
addRecord(item){
uni.navigateTo({
url: `../rawMaterialInfo/rawMaterialInfo?planInfo=${encodeURIComponent(JSON.stringify(item))}`,
success: res => {},
fail: () => {},
complete: () => {}
});
}
// addRecord() {
// uni.navigateTo({
// url: `../assembleInfo/assembleInfo?plan_id=${this.plan_id}&type=1&planInfo=${encodeURIComponent(JSON.stringify(this.CyInfo))}`,
// success: res => {},
// fail: () => {},
// complete: () => {}
// });
// },
// firstInspectionInfo(id,type) {
// uni.navigateTo({
// url: `../assembleInfo/assembleInfo?plan_id=${this.plan_id}&product_id=${this.product_id}&id=${id}&planInfo=${encodeURIComponent(JSON.stringify(this.CyInfo))}&type=2`,
// success: res => {},
// fail: () => {},
// complete: () => {}
// });
// },
// firstInspectionInfoSh(id,type) {
// uni.navigateTo({
// url: `../assembleInfo/assembleInfo?plan_id=${this.plan_id}&&type=3&product_id=${this.product_id}&id=${id}&planInfo=${encodeURIComponent(JSON.stringify(this.CyInfo))}`,
// success: res => {},
// fail: () => {},
// complete: () => {}
// });
// }
}
}
</script>
<style lang="scss">
@import "./index.scss"
</style>