diff --git a/src/App.vue b/src/App.vue index 34e0d05e..bddd6c86 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,17 +1,24 @@ diff --git a/src/utils/screenAdapt.js b/src/utils/screenAdapt.js new file mode 100644 index 00000000..60e9a645 --- /dev/null +++ b/src/utils/screenAdapt.js @@ -0,0 +1,27 @@ +export const SCREEN_DESIGN_WIDTH = 1920 +export const SCREEN_DESIGN_HEIGHT = 1080 +const SCREEN_SCALE_KEY = '__LONGCHUANG_SCREEN_SCALE__' + +export function setScreenScale(scale) { + if (typeof window === 'undefined') return + const safeScale = typeof scale === 'number' && scale > 0 ? scale : 1 + window[SCREEN_SCALE_KEY] = safeScale +} + +export function getScreenScale() { + if (typeof window === 'undefined') return 1 + const val = window[SCREEN_SCALE_KEY] + return typeof val === 'number' && val > 0 ? val : 1 +} + +export function getScreenInnerHeight() { + if (typeof window === 'undefined') return SCREEN_DESIGN_HEIGHT + const scale = getScreenScale() + return Math.max(0, Math.floor(window.innerHeight / scale)) +} + +export function getScreenInnerWidth() { + if (typeof window === 'undefined') return SCREEN_DESIGN_WIDTH + const scale = getScreenScale() + return Math.max(0, Math.floor(window.innerWidth / scale)) +} diff --git a/src/views/modules/longtron/production-plan-home-order.vue b/src/views/modules/longtron/production-plan-home-order.vue index d69a2927..9fbe90d6 100644 --- a/src/views/modules/longtron/production-plan-home-order.vue +++ b/src/views/modules/longtron/production-plan-home-order.vue @@ -30,6 +30,13 @@ 查询 重置 新增订单 + + 完工 + @@ -43,6 +50,13 @@ v-loading="dataListLoading" style="width: 100%" @current-change="onCurrentRowChange"> + + + @@ -65,14 +79,6 @@ - - - { + const targetRow = row || this.selectedOrder + if (!targetRow || !targetRow.orderNo) { + this.$message.warning('请先选择一条订单记录') + return + } + if (targetRow.status === '已完成') { + this.$message.warning('该订单已完工') + return + } + finishHomeLiftOrder({ orderNo: targetRow.orderNo }).then(({data}) => { if (data && data.code === 0) { this.$message.success(data.msg || '完工成功') this.getDataList() } else this.$message.error(data.msg || '完工失败') }).catch(() => { - row.status = '已完成' - row.finishDate = this.dayjs().format('YYYY-MM-DD') - row.nodeList = row.nodeList.map(item => ({ ...item, status: '已完成' })) - row.currentNode = '全部完成' - row.nodeDoneCount = row.nodeTotalCount + targetRow.status = '已完成' + targetRow.finishDate = this.dayjs().format('YYYY-MM-DD') + targetRow.nodeList = targetRow.nodeList.map(item => ({ ...item, status: '已完成' })) + targetRow.currentNode = '全部完成' + targetRow.nodeDoneCount = targetRow.nodeTotalCount this.$message.success('后端未完成,已在前端演示完工') }) }, diff --git a/src/views/modules/longtron/screen-cable-cop-progress.vue b/src/views/modules/longtron/screen-cable-cop-progress.vue index 835ad3dc..0e96fede 100644 --- a/src/views/modules/longtron/screen-cable-cop-progress.vue +++ b/src/views/modules/longtron/screen-cable-cop-progress.vue @@ -1,166 +1,5 @@ -