Browse Source

2026-02-06

机台工作台增加【暂停生产】【继续生产】
master
fengyuan_yang 3 weeks ago
parent
commit
5ef90b62f2
  1. 3
      src/api/yieldReport/produce_report_normal.js
  2. 124
      src/views/modules/yieldReport/com_produce_report_normal.vue

3
src/api/yieldReport/produce_report_normal.js

@ -3,6 +3,9 @@ import { createAPI } from '@/utils/httpRequest.js'
// 获取派工单信息 // 获取派工单信息
export const getScheduleDataBySeqNo = data => createAPI('schedule/getScheduleDataBySeqNo', 'POST', data) export const getScheduleDataBySeqNo = data => createAPI('schedule/getScheduleDataBySeqNo', 'POST', data)
// 暂停生产/继续生产(调用存储过程 UspUpdateProductionStatus)
export const updateProductionStatus = data => createAPI('schedule/updateProductionStatus', 'POST', data)
// 获取当前上机卷信息 // 获取当前上机卷信息
export const getCurrentRollOpsBySeqNo = data => createAPI('schedule/getCurrentRollOpsBySeqNo', 'POST', data) export const getCurrentRollOpsBySeqNo = data => createAPI('schedule/getCurrentRollOpsBySeqNo', 'POST', data)

124
src/views/modules/yieldReport/com_produce_report_normal.vue

@ -257,6 +257,16 @@
</el-button> </el-button>
</div> </div>
</div> </div>
<!-- 暂停生产/继续生产保留圆框样式整块可点击调用存储过程 UspUpdateProductionStatus -->
<div
v-if="scheduleData.seqNo"
class="production-status-circle"
:class="[scheduleData.parkFlag === 'N' ? 'status-pause' : 'status-continue', { 'is-loading': productionStatusLoading }]"
@click="handleProductionStatusClick">
<span v-if="productionStatusLoading" class="status-loading"><i class="el-icon-loading"></i></span>
<span v-else class="status-text">{{ scheduleData.parkFlag === 'N' ? '暂停生产' : '继续生产' }}</span>
</div>
</div> </div>
<!-- 列表信息区域 --> <!-- 列表信息区域 -->
@ -860,7 +870,8 @@ import {
getOrderFirstItemNo, getOrderFirstItemNo,
checkProcessInspectionPendingCount, checkProcessInspectionPendingCount,
getOrderNotesByOrderNo, // getOrderNotesByOrderNo, //
openMaterialRoll //
openMaterialRoll, //
updateProductionStatus // / UspUpdateProductionStatus
} from "@/api/yieldReport/produce_report_normal.js"; } from "@/api/yieldReport/produce_report_normal.js";
import { import {
getUserSpecialSecurity, getUserSpecialSecurity,
@ -3270,6 +3281,7 @@ export default {
rollCount: '', rollCount: '',
carrierNo: '', carrierNo: '',
batchNo: '', // batchNo: '', //
parkFlag: '', // N- Y-
}, },
currentRollOps: { currentRollOps: {
site: this.$store.state.user.site, site: this.$store.state.user.site,
@ -3304,6 +3316,7 @@ export default {
processInspectionFlag: true processInspectionFlag: true
}, },
dataListLoading: false, dataListLoading: false,
productionStatusLoading: false, // / loading
buttons: { buttons: {
newRollButton: '创建新卷', newRollButton: '创建新卷',
switchRoll: '切换卷', switchRoll: '切换卷',
@ -4054,6 +4067,44 @@ export default {
this.$refs.notOverFinishRoll.init(this.scheduleData, this.operatorData) this.$refs.notOverFinishRoll.init(this.scheduleData, this.operatorData)
}); });
}, },
// / UspUpdateProductionStatus
handleProductionStatusClick() {
if (this.productionStatusLoading) return
const isPause = this.scheduleData.parkFlag === 'N'
const actionText = isPause ? '暂停生产' : '继续生产'
this.$confirm(`确定要${actionText}吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const now = new Date()
const pad = n => (n < 10 ? '0' + n : n)
const currentTime = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`
this.productionStatusLoading = true
updateProductionStatus({
site: this.scheduleData.site || this.$store.state.user.site,
orderNo: this.scheduleData.orderNo,
seqNo: this.scheduleData.seqNo,
itemNo: this.scheduleData.itemNo,
rollNo: this.scheduleData.rollNo || '*',
currentTime,
operatorId: this.scheduleData.operatorId || this.$store.state.user.name,
parkFlag: isPause ? 'Y' : 'N'
}).then(({ data }) => {
this.productionStatusLoading = false
if (data && (data.code === 0 || data.code === 200)) {
this.$message.success(data.msg || '操作成功')
this.getScheduleDataBySeqNo()
} else {
this.$message.error((data && data.msg) || '操作失败')
}
}).catch((err) => {
this.productionStatusLoading = false
const msg = (err && err.msg) || (err && err.response && err.response.data && err.response.data.msg) || '操作失败'
this.$message.error(msg)
})
}).catch(() => {})
},
// //
getScheduleDataBySeqNo() { getScheduleDataBySeqNo() {
getScheduleDataBySeqNo(this.scheduleData.seqNo).then(({data}) => { getScheduleDataBySeqNo(this.scheduleData.seqNo).then(({data}) => {
@ -4085,7 +4136,7 @@ export default {
this.scheduleData.rowCount = data.row.rowCount; this.scheduleData.rowCount = data.row.rowCount;
this.scheduleData.rollCount = data.row.rollCount; this.scheduleData.rollCount = data.row.rollCount;
this.scheduleData.carrierNo = data.row.carrierNo; this.scheduleData.carrierNo = data.row.carrierNo;
this.scheduleData.parkFlag = data.row.parkFlag;
}); });
}, },
// //
@ -4294,6 +4345,7 @@ export default {
this.scheduleData.rollCount = data.row.rollCount; this.scheduleData.rollCount = data.row.rollCount;
this.scheduleData.carrierNo = data.row.carrierNo; this.scheduleData.carrierNo = data.row.carrierNo;
this.scheduleData.batchNo = data.row.batchNo; this.scheduleData.batchNo = data.row.batchNo;
this.scheduleData.parkFlag = data.row.parkFlag;
// //
this.titleCon = '机台工作台' + ' - ' + data.row.itemDesc + ' ' this.titleCon = '机台工作台' + ' - ' + data.row.itemDesc + ' '
+ data.row.resourceDesc + ' (' + this.operatorData.operatorName + ')'; + data.row.resourceDesc + ' (' + this.operatorData.operatorName + ')';
@ -5679,6 +5731,74 @@ export default {
border-color: #d0d4d9; border-color: #d0d4d9;
} }
/* 生产状态圆框样式 */
.production-status-circle {
width: 120px;
height: 120px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 20px auto;
border: 4px solid;
transition: all 0.3s ease;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.production-status-circle .status-text {
font-size: 16px;
font-weight: bold;
text-align: center;
}
/* 圆框可点击:手型与悬停 */
.production-status-circle {
cursor: pointer;
user-select: none;
}
.production-status-circle:hover:not(.is-loading) {
transform: scale(1.05);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.production-status-circle.is-loading {
cursor: not-allowed;
opacity: 0.85;
}
.production-status-circle .status-loading {
font-size: 28px;
}
.production-status-circle.status-pause .status-loading {
color: #f56c6c;
}
.production-status-circle.status-continue .status-loading {
color: #67c23a;
}
/* 暂停生产状态 - 红色圆框 */
.production-status-circle.status-pause {
border-color: #f56c6c;
background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
}
.production-status-circle.status-pause .status-text {
color: #f56c6c;
}
/* 继续生产状态 - 绿色圆框 */
.production-status-circle.status-continue {
border-color: #67c23a;
background: linear-gradient(135deg, #f0f9eb 0%, #e1f3d8 100%);
}
.production-status-circle.status-continue .status-text {
color: #67c23a;
}
/* 模块标题 - 改为卡片标题样式 */ /* 模块标题 - 改为卡片标题样式 */
.section-title { .section-title {
display: flex; display: flex;

Loading…
Cancel
Save