Files
klp-mono/apps/hand-factory/pages/easycode/easycode.vue
砂糖 30c319694c feat: 更新UI主题和样式,优化页面布局和交互
- 将侧边栏主题从深色改为浅色
- 移除多个组件的背景色和金属风格样式
- 调整按钮、表格和分页组件的样式和间距
- 新增easycode扫码功能页面
- 更新基础URL配置和应用版本号
- 优化登录后跳转逻辑和登出功能
- 调整滚动条和菜单项的样式
2025-11-03 11:16:07 +08:00

61 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<button v-for='item in types' @click="handleScan(item.dictValue)">
{{ item.dictLabel }}
</button>
<button @click='handleLogout'>
退出登录
</button>
</view>
</template>
<script>
import { getDicts } from '@/api/system/dict/data.js'
import { getGenerateRecord } from '@/api/wms/code.js'
export default {
data() {
return {
types: []
}
},
methods: {
handleLogout() {
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
this.$store.dispatch('LogOut').then(() => {}).finally(() => {
this.$tab.reLaunch('/pages/login')
})
})
},
handleScan(type) {
// 1. 扫码
uni.scanCode({
success(res) {
const result = res.result;
// 2. 解析二维码的content获取enter_coil_no、current_coil_no和coil_id
const qrcodeRecord = qrcodeRes.data;
const content = JSON.parse(qrcodeRecord.content);
const enterCoilNo = content.enter_coil_no;
const currentCoilNo = content.current_coil_no;
const coilId = content.coil_id && content.coil_id !== 'null' ? content.coil_id : null;
// 3. 调用创建待操作记录的API
}
})
}
},
mounted() {
// 获取字典
getDicts('easycode_type').then(res => {
console.log(res)
this.types = res.data
})
}
}
</script>
<style>
</style>