20 changed files with 2514 additions and 44 deletions
-
2src/assets/scss/global.scss
-
37src/router/index.js
-
4src/views/common/login.vue
-
38src/views/main.vue
-
190src/views/modules/handlingunit/handlingunit.vue
-
187src/views/modules/mrissue/mrissue.vue
-
191src/views/modules/otherinout/otherinout.vue
-
190src/views/modules/outsource/outsource.vue
-
190src/views/modules/productionissue/productionissue.vue
-
189src/views/modules/productionwhse/productionwhse.vue
-
140src/views/modules/recv/inspectionResults.vue
-
4src/views/modules/recv/po-recv.vue
-
162src/views/modules/recv/qualifiedStorage.vue
-
5src/views/modules/recv/recv.vue
-
187src/views/modules/salereturn/salereturn.vue
-
140src/views/modules/salereturn/scrap.vue
-
140src/views/modules/salereturn/store.vue
-
187src/views/modules/saleshipping/saleshipping.vue
-
188src/views/modules/stocktaking/stocktaking.vue
-
187src/views/modules/transportation/transportation.vue
@ -0,0 +1,190 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">Handling Unit</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: '装Handling Unit', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '合并Handling Unit', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
{ icon: '✅', label: '拆Handling Unit', color: '#4CAF50', action: 'search' ,to:'recv' }, |
|||
{ icon: '📦', label: '补打印Handling Unit标签', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '查看Handling Unit', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,187 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">MR发料</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: 'MR发料', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: 'MR退料', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,191 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">其他出入库</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: '移库', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: 'Receive from Transit', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
{ icon: '✅', label: '报废', color: '#4CAF50', action: 'search' ,to:'recv' }, |
|||
{ icon: '📦', label: '其他入库', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '其他出库', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
{ icon: '📦', label: 'CALL料', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,190 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">委外发料</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: '直接发料', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '拣选', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
{ icon: '✅', label: '申请单发料', color: '#4CAF50', action: 'search' ,to:'recv' }, |
|||
{ icon: '📦', label: '退料', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '委外PO接收', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,190 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">生成发料</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: '直接发料', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '拣选', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
{ icon: '✅', label: '申请单发料', color: '#4CAF50', action: 'search' ,to:'recv' }, |
|||
{ icon: '📦', label: '直接退料', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '申请单退料', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,189 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">生成入库</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: '包装', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '装托盘', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
{ icon: '✅', label: '入库登记', color: '#4CAF50', action: 'search' ,to:'recv' }, |
|||
{ icon: '📦', label: '退库', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,140 @@ |
|||
<template> |
|||
<div> |
|||
<div class="pda-container"> |
|||
<div class="status-bar"> |
|||
<div class="goBack" @click="$router.back()"><i class="el-icon-arrow-left"></i>上一页</div> |
|||
<div class="goBack">登记检验结果</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
<!-- 扫描输入区 --> |
|||
<div class="scan-box"> |
|||
<input |
|||
v-model="scanCode" |
|||
placeholder="扫描PO条码或输入PO号" |
|||
@keyup.enter="addItem" |
|||
ref="scanCodeRef" |
|||
/> |
|||
</div> |
|||
|
|||
<!-- 商品列表区 --> |
|||
<div class="item-list"> |
|||
<div |
|||
v-for="(item, i) in items" |
|||
:key="i" |
|||
class="item-row" |
|||
> |
|||
<span>{{ item.code }}</span> |
|||
<span>{{ item.qty }}件</span> |
|||
<el-button icon="el-icon-delete" @click="removeItem(i)"></el-button> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 操作按钮区 --> |
|||
<el-button |
|||
class="submit-btn" |
|||
@click="submit" |
|||
> |
|||
确认收货 ({{ totalQty }}) |
|||
</el-button> |
|||
</div> |
|||
<el-dialog |
|||
style="font-size: 12px" |
|||
v-drag |
|||
:title="'Dialog'" |
|||
:visible.sync="siteVisible" |
|||
width="260px" :append-to-body="true" > |
|||
<el-form label-position="top" style="margin-left: 7px;margin-top: 10px;"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="24"> |
|||
<el-form-item :label="'Test'" > |
|||
<el-radio label="Y">Y</el-radio> |
|||
<el-radio label="N">N</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="">确定</el-button> |
|||
<el-button type="primary" @click="siteVisible=false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
siteVisible: false, |
|||
scanCode: '', |
|||
items: [{code: 'A001', qty: 1}, {code: 'A002', qty: 2}] |
|||
} |
|||
}, |
|||
computed: { |
|||
totalQty() { |
|||
return this.items.reduce((sum, item) => sum + item.qty, 0) |
|||
} |
|||
}, |
|||
methods: { |
|||
toShouye(){ |
|||
this.$router.push({path: '/'}) |
|||
}, |
|||
addItem() { |
|||
if (!this.scanCode) return |
|||
this.items.push({ |
|||
code: this.scanCode, |
|||
qty: 1 |
|||
}) |
|||
this.scanCode = '' |
|||
}, |
|||
removeItem(index) { |
|||
this.items.splice(index, 1) |
|||
}, |
|||
submit() { |
|||
alert(`已提交${this.items.length}种商品`) |
|||
this.items = [] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.$refs.scanCodeRef.focus() |
|||
}) |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.pda-receipt { |
|||
display: flex; |
|||
flex-direction: column; |
|||
height: 80vh; |
|||
padding: 10px; |
|||
} |
|||
|
|||
.scan-box input { |
|||
width: 100%; |
|||
padding: 12px; |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.item-list { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
margin: 20px 0; |
|||
} |
|||
|
|||
.item-row { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
padding: 8px; |
|||
border-bottom: 1px solid #eee; |
|||
} |
|||
|
|||
.submit-btn { |
|||
padding: 12px; |
|||
background: #07c160; |
|||
color: white; |
|||
border: none; |
|||
font-size: larger; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,162 @@ |
|||
<template> |
|||
<div> |
|||
<div class="pda-container"> |
|||
<div class="status-bar"> |
|||
<div class="goBack" @click="$router.back()"><i class="el-icon-arrow-left"></i>上一页</div> |
|||
<div class="goBack">检验合格入库</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
<!-- 扫描输入区 --> |
|||
<div class="scan-box"> |
|||
<input |
|||
v-model="scanCode" |
|||
placeholder="扫描PO条码或输入PO号" |
|||
@keyup.enter="addItem" |
|||
ref="scanCodeRef" |
|||
/> |
|||
</div> |
|||
|
|||
<!-- 商品列表区 --> |
|||
<div class="item-list"> |
|||
<el-table :height="240" :data="items" @row-click="rowClick" |
|||
stripe highlight-current-row border :row-style="{ height: '30px' }" style="width: 100%;"> |
|||
<el-table-column prop="code" header-align="center" align="center" label="商品编码"></el-table-column> |
|||
<el-table-column prop="qty" header-align="center" align="center" label="数量" width="42"></el-table-column> |
|||
<el-table-column prop="recvQty" header-align="center" align="center" label="入库数量"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.recvQty" style="height: 11px;width:98%"></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="locnCode" header-align="center" align="center" label="库位"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.locnCode" style="height: 11px;width:98%"></el-input> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<!-- <div |
|||
v-for="(item, i) in items" |
|||
:key="i" |
|||
class="item-row" |
|||
> |
|||
<span>{{ item.code }}</span> |
|||
<span>{{ item.qty }}件</span> |
|||
<el-button icon="el-icon-delete" @click="removeItem(i)"></el-button> |
|||
</div>--> |
|||
</div> |
|||
|
|||
<!-- 操作按钮区 --> |
|||
<el-button |
|||
class="submit-btn" |
|||
@click="submit" |
|||
> |
|||
确认收货 ({{ totalQty }}) |
|||
</el-button> |
|||
</div> |
|||
<el-dialog |
|||
style="font-size: 12px" |
|||
v-drag |
|||
:title="'Dialog'" |
|||
:visible.sync="siteVisible" |
|||
width="260px" :append-to-body="true" > |
|||
<el-form label-position="top" style="margin-left: 7px;margin-top: 10px;"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="24"> |
|||
<el-form-item :label="'Test'" > |
|||
<el-radio label="Y">Y</el-radio> |
|||
<el-radio label="N">N</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="">确定</el-button> |
|||
<el-button type="primary" @click="siteVisible=false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
siteVisible: false, |
|||
scanCode: '', |
|||
items: [{code: 'A001', qty: 1}, {code: 'A002', qty: 2}] |
|||
} |
|||
}, |
|||
computed: { |
|||
totalQty() { |
|||
return this.items.reduce((sum, item) => sum + item.qty, 0) |
|||
} |
|||
}, |
|||
methods: { |
|||
rowClick(row){ |
|||
|
|||
}, |
|||
addItem() { |
|||
if (!this.scanCode) return |
|||
this.items.push({ |
|||
code: this.scanCode, |
|||
qty: 1 |
|||
}) |
|||
this.scanCode = '' |
|||
}, |
|||
removeItem(index) { |
|||
this.items.splice(index, 1) |
|||
}, |
|||
submit() { |
|||
alert(`已提交${this.items.length}种商品`) |
|||
this.items = [] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.$refs.scanCodeRef.focus() |
|||
}) |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.pda-receipt { |
|||
display: flex; |
|||
flex-direction: column; |
|||
height: 80vh; |
|||
padding: 10px; |
|||
} |
|||
|
|||
.scan-box input { |
|||
width: 100%; |
|||
padding: 12px; |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.item-list { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
margin: 20px 0; |
|||
} |
|||
|
|||
.item-row { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
padding: 8px; |
|||
border-bottom: 1px solid #eee; |
|||
} |
|||
|
|||
.submit-btn { |
|||
padding: 12px; |
|||
background: #07c160; |
|||
color: white; |
|||
border: none; |
|||
font-size: larger; |
|||
} |
|||
|
|||
/deep/ .el-table .cell { |
|||
line-height: 24px; |
|||
font-size: 12px; |
|||
height: 24px; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,187 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">销售退货</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: '入库', color: '#FF9800', action: 'stockIn',to:'store' }, |
|||
{ icon: '📄', label: '报废', color: '#2196F3', action: 'stockOut',to:'scrap' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,140 @@ |
|||
<template> |
|||
<div> |
|||
<div class="pda-container"> |
|||
<div class="status-bar"> |
|||
<div class="goBack" @click="$router.back()"><i class="el-icon-arrow-left"></i>上一页</div> |
|||
<div class="goBack">报废</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
<!-- 扫描输入区 --> |
|||
<div class="scan-box"> |
|||
<input |
|||
v-model="scanCode" |
|||
placeholder="扫描PO条码或输入PO号" |
|||
@keyup.enter="addItem" |
|||
ref="scanCodeRef" |
|||
/> |
|||
</div> |
|||
|
|||
<!-- 商品列表区 --> |
|||
<div class="item-list"> |
|||
<div |
|||
v-for="(item, i) in items" |
|||
:key="i" |
|||
class="item-row" |
|||
> |
|||
<span>{{ item.code }}</span> |
|||
<span>{{ item.qty }}件</span> |
|||
<el-button icon="el-icon-delete" @click="removeItem(i)"></el-button> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 操作按钮区 --> |
|||
<el-button |
|||
class="submit-btn" |
|||
@click="submit" |
|||
> |
|||
确认收货 ({{ totalQty }}) |
|||
</el-button> |
|||
</div> |
|||
<el-dialog |
|||
style="font-size: 12px" |
|||
v-drag |
|||
:title="'Dialog'" |
|||
:visible.sync="siteVisible" |
|||
width="260px" :append-to-body="true" > |
|||
<el-form label-position="top" style="margin-left: 7px;margin-top: 10px;"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="24"> |
|||
<el-form-item :label="'Test'" > |
|||
<el-radio label="Y">Y</el-radio> |
|||
<el-radio label="N">N</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="">确定</el-button> |
|||
<el-button type="primary" @click="siteVisible=false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
siteVisible: false, |
|||
scanCode: '', |
|||
items: [{code: 'A001', qty: 1}, {code: 'A002', qty: 2}] |
|||
} |
|||
}, |
|||
computed: { |
|||
totalQty() { |
|||
return this.items.reduce((sum, item) => sum + item.qty, 0) |
|||
} |
|||
}, |
|||
methods: { |
|||
toShouye(){ |
|||
this.$router.push({path: '/'}) |
|||
}, |
|||
addItem() { |
|||
if (!this.scanCode) return |
|||
this.items.push({ |
|||
code: this.scanCode, |
|||
qty: 1 |
|||
}) |
|||
this.scanCode = '' |
|||
}, |
|||
removeItem(index) { |
|||
this.items.splice(index, 1) |
|||
}, |
|||
submit() { |
|||
alert(`已提交${this.items.length}种商品`) |
|||
this.items = [] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.$refs.scanCodeRef.focus() |
|||
}) |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.pda-receipt { |
|||
display: flex; |
|||
flex-direction: column; |
|||
height: 80vh; |
|||
padding: 10px; |
|||
} |
|||
|
|||
.scan-box input { |
|||
width: 100%; |
|||
padding: 12px; |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.item-list { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
margin: 20px 0; |
|||
} |
|||
|
|||
.item-row { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
padding: 8px; |
|||
border-bottom: 1px solid #eee; |
|||
} |
|||
|
|||
.submit-btn { |
|||
padding: 12px; |
|||
background: #07c160; |
|||
color: white; |
|||
border: none; |
|||
font-size: larger; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,140 @@ |
|||
<template> |
|||
<div> |
|||
<div class="pda-container"> |
|||
<div class="status-bar"> |
|||
<div class="goBack" @click="$router.back()"><i class="el-icon-arrow-left"></i>上一页</div> |
|||
<div class="goBack">入库</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
<!-- 扫描输入区 --> |
|||
<div class="scan-box"> |
|||
<input |
|||
v-model="scanCode" |
|||
placeholder="扫描PO条码或输入PO号" |
|||
@keyup.enter="addItem" |
|||
ref="scanCodeRef" |
|||
/> |
|||
</div> |
|||
|
|||
<!-- 商品列表区 --> |
|||
<div class="item-list"> |
|||
<div |
|||
v-for="(item, i) in items" |
|||
:key="i" |
|||
class="item-row" |
|||
> |
|||
<span>{{ item.code }}</span> |
|||
<span>{{ item.qty }}件</span> |
|||
<el-button icon="el-icon-delete" @click="removeItem(i)"></el-button> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- 操作按钮区 --> |
|||
<el-button |
|||
class="submit-btn" |
|||
@click="submit" |
|||
> |
|||
确认收货 ({{ totalQty }}) |
|||
</el-button> |
|||
</div> |
|||
<el-dialog |
|||
style="font-size: 12px" |
|||
v-drag |
|||
:title="'Dialog'" |
|||
:visible.sync="siteVisible" |
|||
width="260px" :append-to-body="true" > |
|||
<el-form label-position="top" style="margin-left: 7px;margin-top: 10px;"> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="24"> |
|||
<el-form-item :label="'Test'" > |
|||
<el-radio label="Y">Y</el-radio> |
|||
<el-radio label="N">N</el-radio> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
|||
<el-button type="primary" @click="">确定</el-button> |
|||
<el-button type="primary" @click="siteVisible=false">关闭</el-button> |
|||
</el-footer> |
|||
</el-dialog> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
siteVisible: false, |
|||
scanCode: '', |
|||
items: [{code: 'A001', qty: 1}, {code: 'A002', qty: 2}] |
|||
} |
|||
}, |
|||
computed: { |
|||
totalQty() { |
|||
return this.items.reduce((sum, item) => sum + item.qty, 0) |
|||
} |
|||
}, |
|||
methods: { |
|||
toShouye(){ |
|||
this.$router.push({path: '/'}) |
|||
}, |
|||
addItem() { |
|||
if (!this.scanCode) return |
|||
this.items.push({ |
|||
code: this.scanCode, |
|||
qty: 1 |
|||
}) |
|||
this.scanCode = '' |
|||
}, |
|||
removeItem(index) { |
|||
this.items.splice(index, 1) |
|||
}, |
|||
submit() { |
|||
alert(`已提交${this.items.length}种商品`) |
|||
this.items = [] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.$refs.scanCodeRef.focus() |
|||
}) |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.pda-receipt { |
|||
display: flex; |
|||
flex-direction: column; |
|||
height: 80vh; |
|||
padding: 10px; |
|||
} |
|||
|
|||
.scan-box input { |
|||
width: 100%; |
|||
padding: 12px; |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.item-list { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
margin: 20px 0; |
|||
} |
|||
|
|||
.item-row { |
|||
display: flex; |
|||
justify-content: space-between; |
|||
padding: 8px; |
|||
border-bottom: 1px solid #eee; |
|||
} |
|||
|
|||
.submit-btn { |
|||
padding: 12px; |
|||
background: #07c160; |
|||
color: white; |
|||
border: none; |
|||
font-size: larger; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,187 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">客户订单发货</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: '发货', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '取消发货', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,188 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">盘点</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: '盘点', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '盘盈', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
{ icon: '✅', label: '盘亏', color: '#4CAF50', action: 'search' ,to:'recv' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
@ -0,0 +1,187 @@ |
|||
|
|||
<template> |
|||
<div class="pda-container"> |
|||
<!-- 状态栏 --> |
|||
<div class="status-bar"> |
|||
<div class="time">{{ currentTime }}</div> |
|||
<div class="time">运输任务</div> |
|||
<div class="network" style="color: #fff" @click="$router.push({path: '/'})">🏠首页</div> |
|||
</div> |
|||
|
|||
<!-- 可滚动按钮区 --> |
|||
<div class="button-scroll-container"> |
|||
<div class="button-grid"> |
|||
<button |
|||
v-for="(btn, index) in buttons" |
|||
:key="index" |
|||
class="pda-button" |
|||
:style="{ |
|||
'background': btn.color, |
|||
'transform': activeIndex === index ? 'scale(0.95)' : 'none' |
|||
}" |
|||
@touchstart.passive="setActive(index)" |
|||
@touchend.passive="clearActive()" |
|||
@touchcancel.passive="clearActive()"> |
|||
<router-link class="pda-button" :style="{ |
|||
'background': ';#4CAF50',}" :to="btn.to"> |
|||
<span class="button-icon">{{ btn.icon }}</span> |
|||
<span class="button-label">{{ btn.label }}</span> |
|||
</router-link> |
|||
</button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return { |
|||
currentTime: new Date().toTimeString().substr(0, 5), |
|||
activeIndex: null, |
|||
buttons: [ |
|||
{ icon: '📦', label: '调拨申请', color: '#FF9800', action: 'stockIn',to:'recv' }, |
|||
{ icon: '📄', label: '移库', color: '#2196F3', action: 'stockOut',to:'recv' }, |
|||
] |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.updateTime(); |
|||
window.addEventListener('resize', this.adjustLayout); |
|||
this.$nextTick(this.adjustLayout); |
|||
}, |
|||
beforeDestroy() { |
|||
clearInterval(this.timeInterval); |
|||
window.removeEventListener('resize', this.adjustLayout); |
|||
}, |
|||
methods: { |
|||
updateTime() { |
|||
this.timeInterval = setInterval(() => { |
|||
this.currentTime = new Date().toTimeString().substr(0, 5); |
|||
}, 60000); |
|||
}, |
|||
adjustLayout() { |
|||
const container = document.querySelector('.button-grid'); |
|||
if (container) { |
|||
const width = container.clientWidth; |
|||
const columns = Math.max(3, Math.floor(width / 120)); |
|||
document.documentElement.style.setProperty('--columns', columns); |
|||
} |
|||
}, |
|||
handleClick(action) { |
|||
console.log('执行操作:', action); |
|||
}, |
|||
setActive(index) { |
|||
this.activeIndex = index; |
|||
}, |
|||
clearActive() { |
|||
this.activeIndex = null; |
|||
}, |
|||
// 退出 |
|||
logoutHandle() { |
|||
this.$confirm('确定进行[退出]操作?', '提示', { |
|||
confirmButtonText: '确认', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.$http({ |
|||
url: this.$http.adornUrl('/sys/logout'), |
|||
method: 'post', |
|||
data: this.$http.adornData() |
|||
}).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
//clearLoginInfo() |
|||
this.$router.push({name: 'login'}) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
:root { |
|||
--columns: 4; |
|||
--button-size: calc(100vw / var(--columns) - 20px); |
|||
} |
|||
|
|||
.pda-container { |
|||
width: 100vw; |
|||
height: 100vh; |
|||
display: flex; |
|||
flex-direction: column; |
|||
background: #f5f5f5; |
|||
font-family: 'Arial', sans-serif; |
|||
overflow: hidden; |
|||
} |
|||
|
|||
|
|||
.button-scroll-container { |
|||
flex: 1; |
|||
overflow-y: auto; |
|||
padding: 10px; |
|||
-webkit-overflow-scrolling: touch; |
|||
} |
|||
|
|||
.button-grid { |
|||
display: grid; |
|||
grid-template-columns: repeat(auto-fill, minmax(var(--button-size), 1fr)); |
|||
gap: 14px; |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pda-button { |
|||
position: relative; |
|||
width: 100%; |
|||
aspect-ratio: 1; |
|||
border: none; |
|||
border-radius: 12px; |
|||
display: flex; |
|||
flex-direction: column; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: white; |
|||
transition: transform 0.1s ease; |
|||
box-shadow: 0 4px 8px rgba(0,0,0,0.1); |
|||
overflow: hidden; |
|||
cursor: pointer; |
|||
user-select: none; |
|||
} |
|||
|
|||
.button-icon { |
|||
font-size: 28px; |
|||
margin-bottom: 6px; |
|||
} |
|||
|
|||
.button-label { |
|||
font-size: 18px; |
|||
font-weight: 800; |
|||
} |
|||
|
|||
.button-badge { |
|||
position: absolute; |
|||
top: 8px; |
|||
right: 8px; |
|||
background: #ff4757; |
|||
color: white; |
|||
width: 18px; |
|||
height: 18px; |
|||
border-radius: 50%; |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
font-size: 10px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
@media (max-width: 480px) { |
|||
.button-icon { |
|||
font-size: 20px; |
|||
} |
|||
.button-label { |
|||
font-size: 14px; |
|||
} |
|||
} |
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue