<template>
|
<view class="container">
|
<cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="index">
|
<block slot="backText">返回</block>
|
<block slot="content">不合格品审理</block>
|
</cu-custom>
|
|
<uni-search-bar placeholder="生产单号/物料信息" @confirm="search" :focus="false" v-model="searchValue" @blur="blur"
|
@focus="focus" @input="input" @cancel="cancel" @clear="clear">
|
</uni-search-bar>
|
<view class="container">
|
<mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback">
|
<view class="production-container">
|
<view class="bill-table" v-for="(item, index) in mockBillList" :key="index">
|
<!-- 表头(共用样式) -->
|
<view class="table-content">
|
<!-- 单据号行 -->
|
<view class="table-row">
|
<text class="table-header">单据号:</text>
|
<text class="table-value">{{item.billNo || item.num}}</text>
|
</view>
|
<!-- 物料编码行 -->
|
<view class="table-row">
|
<text class="table-header">物料编码:</text>
|
<text class="table-value">{{item.materialCode}}</text>
|
</view>
|
<!-- 物料描述行 -->
|
<view class="table-row">
|
<text class="table-header">物料描述:</text>
|
<text class="table-value">{{item.materialDesc}}</text>
|
</view>
|
<!-- 产线行 -->
|
<view class="table-row">
|
<text class="table-header">产线:</text>
|
<text class="table-value">{{item.productionLine}}</text>
|
</view>
|
<!-- 班组行 -->
|
<view class="table-row">
|
<text class="table-header">班组:</text>
|
<text class="table-value">{{item.team}}</text>
|
</view>
|
<view class="table-row">
|
<text class="table-header">审理人:</text>
|
<text class="table-value">{{item.team}}</text>
|
</view>
|
<view class="table-row">
|
<text class="table-header">审理结果:</text>
|
<text class="table-value">{{item.team}}</text>
|
</view>
|
<view class="table-row">
|
<text class="table-header">审理时间:</text>
|
<text class="table-value">{{item.team}}</text>
|
</view>
|
<!-- 生产日期行(多内容) -->
|
<view class="table-row">
|
<text class="table-header">检验类型:</text>
|
<view class="table-value">
|
<text>{{item.produceDate}}</text>
|
<text class="right-content">计划数量:{{item.planQty}}</text>
|
</view>
|
</view>
|
<!-- 检验记录行 -->
|
<view class="table-row">
|
<text class="table-header">单据状态:</text>
|
<view class="table-value">
|
<text class="status-tag" :class="[{ passed: item.inspectResult === '未审理' },{ finish: item.inspectResult === '已审理' }]">
|
{{item.inspectResult}}
|
</text>
|
</view>
|
</view>
|
<!-- 上料信息行(多内容) -->
|
<view class="table-row">
|
<text class="table-header">不合格数量:</text>
|
<view class="table-value">
|
<text>{{item.feedQty}}</text>
|
<text class="right-content">处理数量:{{item.feeder}}</text>
|
</view>
|
</view>
|
<!-- 操作行 -->
|
<view class="table-row operation-row">
|
<text class="table-header">操作:</text>
|
<view class="table-value">
|
<view class="button-group">
|
<button class="action-btn" v-for="btn in getActionButtons(TabCur)"
|
:key="btn.type" @click="handleButtonClick(item, btn)" :class="btn.type">
|
{{btn.text}}
|
</button>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</mescroll-uni>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
|
export default {
|
mixins: [MescrollMixin], // 使用mixin
|
data() {
|
return {
|
mockBillList: [{
|
billNo: 'SCGD202507001', // 单据号
|
materialCode: '220005874', // 物料编码
|
materialDesc: '外法兰\\G3-487/01', // 物料描述
|
spec: 'Φ120×30mm', // 规格型号
|
productionLine: '热处理组', // 产线
|
team: '张杰班组', // 班组
|
produceDate: '2025-07-10', // 生产日期
|
planQty: 500, // 计划数量
|
actualQty: 480, // 实际数量
|
inspectResult: '未审理', // 检验结果
|
feedQty: 200, // 上料数量
|
feeder: '王玉', // 上料人员
|
feedTime: '2025-07-10 08:30', // 上料时间
|
|
},
|
{
|
billNo: 'SCGD202507002',
|
materialCode: '120008194',
|
materialDesc: '三代轮教轴轴承单元\\G3-487',
|
spec: '型号305',
|
productionLine: '装配一线',
|
team: '张杰班组',
|
produceDate: '2025-07-10',
|
planQty: 200,
|
actualQty: 200,
|
inspectResult: '已审理',
|
feedQty: 200,
|
feeder: '张杰',
|
feedTime: '2025-07-10 09:15',
|
|
},
|
{
|
billNo: 'SCGD202507003',
|
materialCode: '330012456',
|
materialDesc: '转向节臂\\G3-500',
|
spec: 'L=210mm',
|
productionLine: '机加工二线',
|
team: '李华班组',
|
produceDate: '2025-07-11',
|
planQty: 300,
|
actualQty: 150,
|
inspectResult: '未审理',
|
feedQty: 150,
|
feeder: '赵明',
|
feedTime: '2025-07-11 10:00'
|
|
},
|
{
|
billNo: 'SCGD202507004',
|
materialCode: '440009876',
|
materialDesc: '半轴套管\\G3-620',
|
spec: 'Φ89×1200mm',
|
productionLine: '锻造线',
|
team: '王强班组',
|
produceDate: '2025-07-11',
|
planQty: 100,
|
actualQty: 0,
|
inspectResult: '已审理',
|
feedQty: 0,
|
feeder: '',
|
feedTime: ''
|
|
},
|
{
|
billNo: 'SCGD202507005',
|
materialCode: '550010345',
|
materialDesc: '制动盘\\G3-450',
|
spec: 'Φ350mm',
|
productionLine: '机加工一线',
|
team: '刘晓班组',
|
produceDate: '2025-07-09',
|
planQty: 400,
|
actualQty: 400,
|
inspectResult: '未审理',
|
feedQty: 400,
|
feeder: '孙伟',
|
feedTime: '2025-07-09 14:20'
|
|
},
|
{
|
billNo: 'SCGD202507006',
|
materialCode: '660007654',
|
materialDesc: '轮毂轴承单元\\G3-720',
|
spec: '型号5206',
|
productionLine: '装配二线',
|
team: '周红班组',
|
produceDate: '2025-07-12',
|
planQty: 250,
|
actualQty: 100,
|
inspectResult: '未审理',
|
feedQty: 100,
|
feeder: '吴芳',
|
feedTime: '2025-07-12 08:45'
|
|
},
|
{
|
billNo: 'SCGD202507007',
|
materialCode: '770003219',
|
materialDesc: '传动轴总成\\G3-800',
|
spec: '长1500mm',
|
productionLine: '总装线',
|
team: '郑军班组',
|
produceDate: '2025-07-12',
|
planQty: 80,
|
actualQty: 0,
|
inspectResult: '已审理',
|
feedQty: 0,
|
feeder: '',
|
feedTime: ''
|
|
}
|
],
|
scrollLeft: 0,
|
NavBarColor: this.NavBarColor,
|
upOption: {
|
page: {
|
num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
|
size: 10, // 每页数据的数量
|
|
},
|
noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
|
empty: {
|
tip: '~ 暂无数据 ~', // 提示
|
|
},
|
loading: '',
|
text: '全部',
|
isShowNoMore: false,
|
textNoMore: '我是有底线的 >_<'
|
},
|
styles: {
|
color: '#2979FF',
|
borderColor: '#2979FF'
|
},
|
actionConfig: {
|
'unexecuted': [{
|
text: '审理',
|
type: 'reviewDocument',
|
path: '/pages/eam/quality/reviewDocument/reviewDocument'
|
}],
|
},
|
url: {
|
delete: "/pm/arrivalAdvice/delete",
|
sub: "/pm/arrivalAdvice/issue",
|
list: "/pm/arrivalAdvice/list"
|
|
},
|
placeholderStyle: "color:#2979FF;font-size:14px",
|
current: 0,
|
colorIndex: 0,
|
activeColor: '#5277A6',
|
msdDelList: [],
|
msgList: [], //列表数据
|
announcementList: []
|
}
|
},
|
|
computed: {
|
top() {
|
return this.CustomBar * 3 + 50
|
},
|
style() {
|
var StatusBar = this.StatusBar;
|
var CustomBar = this.CustomBar;
|
var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
|
return style
|
},
|
},
|
|
methods: {
|
// 根据状态获取对应的操作按钮
|
getActionButtons(status) {
|
switch (status) {
|
case '未执行':
|
case 0:
|
return this.actionConfig.unexecuted;
|
default:
|
return this.actionConfig.unexecuted;
|
}
|
},
|
|
search(res) {
|
uni.showToast({
|
title: '搜索:' + res.value,
|
icon: 'none'
|
})
|
},
|
input(res) {
|
console.log('----input:', res)
|
},
|
clear(res) {
|
console.log('clear事件,清除值为:' + res.value)
|
},
|
/**
|
* @param {Object} res
|
* 当输入框失去焦点时触发
|
*/
|
blur(res) {
|
console.log('blur事件,输入值为:' + res.value)
|
|
},
|
/**
|
* @param {Object} e
|
* 当输入框获得焦点时触发
|
*/
|
focus(e) {
|
console.log('blur事件,输入值为:' + e.value)
|
|
},
|
cancel(res) {
|
console.log('blur事件,输入值为:' + res.value)
|
},
|
|
|
searBut() {
|
|
this.msgList = [];
|
|
this.$http.get(this.url.list, {
|
params: {
|
pageNo: 1,
|
pageSize: this.upOption.page.size,
|
num: this.formData.num,
|
column: "createTime",
|
order: "desc"
|
|
}
|
}).then(res => {
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
|
this.announcement1 = res.data.result.records
|
this.mescroll.endSuccess(this.announcement1.length);
|
console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
console.log("res", res.data)
|
this.msg1Count = res.data.result.total
|
this.msg1Title = "通知(" + res.data.result.total + ")";
|
for (let annItem of this.announcement1) {
|
this.msgList.push(annItem)
|
}
|
}
|
if (page.num == 1) {
|
this.msgList = []; //如果是第一页需手动制空列表
|
this.msgList = this.msgList.concat(this.announcement1); //追加新数据
|
}
|
|
}).catch(() => {
|
//联网失败, 结束加载
|
this.mescroll.endErr();
|
uni.showToast({
|
title: '网络异常,请稍后再试',
|
icon: 'none'
|
});
|
})
|
},
|
mescrollInit(mescroll) {
|
console.log('mescrollInit')
|
this.mescroll = mescroll;
|
},
|
|
// 按钮点击处理
|
handleButtonClick(item, button) {
|
console.log('点击按钮:', button.text, '工单:', item.billNo);
|
|
switch (button.type) {
|
case 'reviewDocument':
|
// 审理
|
uni.navigateTo({
|
url: button.path
|
});
|
break;
|
default:
|
uni.showToast({
|
title: '功能开发中',
|
icon: 'none'
|
});
|
}
|
},
|
|
upCallback(page) {
|
//联网加载数据
|
|
|
this.$http.get(this.url.list, {
|
params: {
|
pageNo: page.num,
|
pageSize: page.size,
|
order: "desc",
|
column: "createTime"
|
|
|
}
|
}).then(res => {
|
//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
|
|
this.announcement1 = res.data.result.records
|
this.mescroll.endSuccess(this.announcement1.length);
|
//console.log("url", res)
|
//设置列表数据
|
if (res.data.success) {
|
console.log("res", res.data)
|
this.msg1Count = res.data.result.total
|
this.msg1Title = "通知(" + res.data.result.total + ")";
|
for (let annItem of this.announcement1) {
|
this.msgList.push(annItem)
|
}
|
}
|
if (page.num == 1) {
|
this.msgList = []; //如果是第一页需手动制空列表
|
this.msgList = this.msgList.concat(this.announcement1); //追加新数据
|
}
|
|
}).catch(() => {
|
//联网失败, 结束加载
|
this.mescroll.endErr();
|
uni.showToast({
|
title: '网络异常,请稍后再试',
|
icon: 'none'
|
});
|
})
|
},
|
}
|
}
|
</script>
|
|
<style>
|
<style scoped>.container {
|
background-color: #f5f5f5;
|
min-height: 100vh;
|
}
|
|
.tab-container {
|
background-color: #ffffff;
|
}
|
|
.production-container {
|
padding: 20rpx;
|
}
|
|
.bill-table {
|
background-color: #ffffff;
|
border-radius: 16rpx;
|
margin-bottom: 20rpx;
|
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
|
overflow: hidden;
|
}
|
|
.table-content {
|
padding: 20rpx;
|
}
|
|
.table-row {
|
display: flex;
|
margin-bottom: 15rpx;
|
}
|
|
.table-row:last-child {
|
margin-bottom: 0;
|
}
|
|
.table-header {
|
flex: 0 0 180rpx;
|
font-size: 28rpx;
|
color: #666;
|
}
|
|
.table-value {
|
flex: 1;
|
font-size: 28rpx;
|
color: #333;
|
display: flex;
|
align-items: center;
|
}
|
|
.right-content {
|
margin-left: auto;
|
color: #999;
|
font-size: 26rpx;
|
}
|
|
.status-tag {
|
padding: 6rpx 12rpx;
|
border-radius: 8rpx;
|
font-size: 24rpx;
|
background-color: #ff6347;
|
color: #ffffff;
|
}
|
|
.status-tag.passed {
|
background-color: #39b54a;
|
}
|
.status-tag.finish {
|
background-color: #ff0000;
|
}
|
|
.button-group {
|
display: flex;
|
flex-wrap: wrap;
|
gap: 15rpx;
|
}
|
|
.action-btn {
|
padding: 12rpx 20rpx;
|
font-size: 24rpx;
|
border-radius: 8rpx;
|
border: none;
|
background-color: #007AFF;
|
color: #ffffff;
|
min-width: 120rpx;
|
text-align: center;
|
}
|
|
/* 不同操作按钮的颜色 */
|
.action-btn.check {
|
background-color: #007AFF;
|
}
|
|
.action-btn.process {
|
background-color: #39b54a;
|
}
|
|
.action-btn.device {
|
background-color: #9932cc;
|
}
|
|
.action-btn.sample {
|
background-color: #ff6347;
|
}
|
|
.action-btn.feed {
|
background-color: #ffa500;
|
}
|
|
.action-btn.report {
|
background-color: #1e90ff;
|
}
|
|
.action-btn.inspection {
|
background-color: #228b22;
|
}
|
|
.action-btn.detail {
|
background-color: #6a5acd;
|
}
|
|
.action-btn.record {
|
background-color: #808080;
|
}
|
|
.operation-row {
|
margin-top: 10rpx;
|
padding-top: 15rpx;
|
border-top: 1rpx solid #eee;
|
}
|
|
.empty-tip {
|
text-align: center;
|
padding: 100rpx 0;
|
color: #999;
|
font-size: 28rpx;
|
}
|
|
/* 标签页样式 */
|
.nav {
|
white-space: nowrap;
|
width: 100%;
|
}
|
|
.cu-item {
|
display: inline-block;
|
min-width: 150rpx;
|
padding: 0 30rpx;
|
height: 80rpx;
|
line-height: 80rpx;
|
text-align: center;
|
}
|
|
.cu-item.cur {
|
border-bottom: 4rpx solid #0081ff;
|
}
|
</style>
|